Language-neutral FORMAT / TEST / REPL_EVAL / START_REPL dispatch.
Language extensions register handlers under :ext/language-tools; this
foundation surface exposes stable bare tool names and dispatches to the
active handler for the requested/current language. REPL lifecycle is resource
backed: repl creates a language-owned session resource and repl_stop
stops one by id. Live REPLs also surface in the ctx resources block.
Language-neutral FORMAT / TEST / REPL_EVAL / START_REPL dispatch. Language extensions register handlers under `:ext/language-tools`; this foundation surface exposes stable bare tool names and dispatches to the active handler for the requested/current language. REPL lifecycle is resource backed: `repl` creates a language-owned session resource and `repl_stop` stops one by id. Live REPLs also surface in the ctx `resources` block.
(capability-data env)STRUCTURED capability map for the ACTIVE language packs:
{"clojure" ["format" "test" "repl_eval" "repl"], "python" [...]}
— nil when none active. Recomputed every turn from active-extensions, so it
GAINS a language the moment its pack activates (e.g. a .py file appears). Goes
in ctx (session["language_tools"]) so the model can read it programmatically
AND it always reflects the current turn.
STRUCTURED capability map for the ACTIVE language packs:
`{"clojure" ["format" "test" "repl_eval" "repl"], "python" [...]}`
— nil when none active. Recomputed every turn from active-extensions, so it
GAINS a language the moment its pack activates (e.g. a .py file appears). Goes
in ctx (`session["language_tools"]`) so the model can read it programmatically
AND it always reflects the current turn.(capability-matrix env)AUTO capability matrix for the system prompt — the active packs' facade verbs
AUTO capability matrix for the system prompt — the active packs' facade verbs
+ a CERTAIN statement of when each is the tool. nil when no pack is active.
LANGUAGE TOOLS (active packs; call via the facade, language first):
clojure : format_code · run_tests · repl_eval · repl
python : repl_eval · repl(connect-repl env & args)Attach to an EXTERNAL, ALREADY-RUNNING REPL the user started themselves — repl_connect(language, {"port": N, "host"?, "dir"?}). Explicit opt-in: vis registers the address as a session REPL resource (eval/test/ctx target it like a managed one) but NEVER spawns, kills, or reaps the process — stopping it merely detaches.
Attach to an EXTERNAL, ALREADY-RUNNING REPL the user started themselves — repl_connect(language, {"port": N, "host"?, "dir"?}). Explicit opt-in: vis registers the address as a session REPL resource (eval/test/ctx target it like a managed one) but NEVER spawns, kills, or reaps the process — stopping it merely detaches.
(format-code env & args)Format source using a language extension. Pass language FIRST when you know it — format_code(language, arg); it may be omitted only for the {"path": file} form (then inferred from the file/workspace).
arg is either a raw code string / {"code": ...} (returns a lean changed? + char-delta ack, not the text), a {"path": file} map (formats that ONE file IN PLACE and returns a LEAN ack — which file + changed? — NOT the file's text, so don't print it back), or a {"paths": [file-or-dir …]} map (formats MANY paths IN PLACE — a DIRECTORY is walked RECURSIVELY for source files — returning a per-file changed roll-up). Omit all of code/path/paths to format the workspace's default source paths recursively. The payload is passed through to the language handler verbatim.
Format source using a language extension. Pass `language` FIRST when you know it — format_code(language, arg); it may be omitted only for the {"path": file} form (then inferred from the file/workspace).
`arg` is either a raw code string / {"code": ...} (returns a lean changed? + char-delta ack, not the text), a {"path": file} map (formats that ONE file IN PLACE and returns a LEAN ack — which file + changed? — NOT the file's text, so don't print it back), or a {"paths": [file-or-dir …]} map (formats MANY paths IN PLACE — a DIRECTORY is walked RECURSIVELY for source files — returning a per-file changed roll-up). Omit all of code/path/paths to format the workspace's default source paths recursively. The payload is passed through to the language handler verbatim.(lint-code env & args)Lint source using a language extension. Pass language FIRST when you know it —
lint_code(language, arg); inferred from the file/workspace only when omitted. arg is a raw code string / {"code": ...}
(lints the snippet), a {"path": file} or {"paths": […]} map (lints those on
disk), or nothing (lints the workspace's default source paths). Returns the
linter's findings + severity counts.
Lint source using a language extension. Pass `language` FIRST when you know it —
lint_code(language, arg); inferred from the file/workspace only when omitted. `arg` is a raw code string / {"code": ...}
(lints the snippet), a {"path": file} or {"paths": […]} map (lints those on
disk), or nothing (lints the workspace's default source paths). Returns the
linter's findings + severity counts.(prompt env)The language-facade reference: the AUTO capability matrix (active packs only)
language is explicit only when several packs match.The language-facade reference: the AUTO capability matrix (active packs only) + the bare facade verbs. nil when no language pack is active, so a non-coding or single-language workspace carries nothing extra. Each verb's own docstring holds its args/return; `language` is explicit only when several packs match.
(repl-eval env & args)Evaluate code in an already-running project REPL. ALWAYS pass the language
FIRST — repl_eval(language, arg). arg may include id/repl_id, dir,
and timeout_ms; dir defaults to the workspace root.
Evaluate code in an already-running project REPL. ALWAYS pass the language FIRST — repl_eval(language, arg). `arg` may include `id`/`repl_id`, `dir`, and `timeout_ms`; `dir` defaults to the workspace root.
(repl-status env)(repl-status env arg)List REPL resources, optionally filtered by language or id.
List REPL resources, optionally filtered by language or id.
(repl-stop env id)Stop a REPL by session resource id. This is the REPL-specific wrapper around resource_stop(id).
Stop a REPL by session resource id. This is the REPL-specific wrapper around resource_stop(id).
(run-tests env & args)Run tests using a language extension. ALWAYS pass the language FIRST — run_tests(language, arg). arg selects what to run: a namespace/module string (e.g. run_tests("clojure", "my.app.core-test")), or a dict — {"namespaces": ["a-test" "b-test"]} (alias :ns) to run several, {"paths": ["test" ...]} to discover *_test namespaces under dirs/files, plus optional {"only": [...] :include/:exclude [tags]} selectors. Omit arg to run the whole suite.
Run tests using a language extension. ALWAYS pass the language FIRST — run_tests(language, arg). `arg` selects what to run: a namespace/module string (e.g. run_tests("clojure", "my.app.core-test")), or a dict — {"namespaces": ["a-test" "b-test"]} (alias :ns) to run several, {"paths": ["test" ...]} to discover *_test namespaces under dirs/files, plus optional {"only": [...] :include/:exclude [tags]} selectors. Omit arg to run the whole suite.
(start-repl env & args)Start or restart a language REPL resource. ALWAYS pass the language FIRST —
repl(language, {op, dir, id, ...}); op defaults to start.
Start or restart a language REPL resource. ALWAYS pass the language FIRST —
repl(language, {op, dir, id, ...}); `op` defaults to `start`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |