Liking cljdoc? Tell your friends :D

com.blockether.vis.ext.language-typescript-bun.repl-manager

A MANAGED TypeScript (Bun) REPL: a persistent bun subprocess running a line-framed JSON eval server — one request per stdin line ({"code": ...} or {"op": "ping"}), one response per stdout line ({ok, out, err, value, data, type, exc}). The server (a .js resource shipped with this pack, passed via bun -e) rewrites top-level const/let/var/ function/class declarations to globalThis assignments and imports to dynamic await import, so REPL globals PERSIST across evals and top-level await just works. stdout/stderr are captured permanently server-side, so a live system's async logs ride back on the next response instead of corrupting the protocol. One process per dir; the Process handle is cached so teardown is clean.

A MANAGED TypeScript (Bun) REPL: a persistent `bun` subprocess running a
line-framed JSON eval server — one request per stdin line ({"code": ...}
or {"op": "ping"}), one response per stdout line
({ok, out, err, value, data, type, exc}). The server (a .js resource shipped
with this pack, passed via `bun -e`) rewrites top-level const/let/var/
function/class declarations to globalThis assignments and imports to dynamic
`await import`, so REPL globals PERSIST across evals and top-level await just
works. stdout/stderr are captured permanently server-side, so a live
system's async logs ride back on the next response instead of corrupting the
protocol. One process per dir; the `Process` handle is cached so teardown is
clean.
raw docstring

eval!clj

(eval! dir code timeout-ms)

Evaluate code (TypeScript or JavaScript) in the REPL for dir. Returns {"ok" "out" "err" "value" "data" "type" "exc"} — value is the last expression's inspect string, data its JSON-safe STRUCTURED view (objects/Maps/Sets/class instances, so the model can read real fields), type the constructor name. A reload(path) global does a cache-busted re-import of a project module.

Evaluate `code` (TypeScript or JavaScript) in the REPL for `dir`. Returns
{"ok" "out" "err" "value" "data" "type" "exc"} — `value` is the
last expression's inspect string, `data` its JSON-safe STRUCTURED view
(objects/Maps/Sets/class instances, so the model can read real fields),
`type` the constructor name. A `reload(path)` global does a cache-busted
re-import of a project module.
sourceraw docstring

start!clj

(start! dir _opts)

Spawn (or replace) the managed Bun REPL for dir. Returns a STRING-keyed status map (crosses the strings-only boundary as a tool :result).

Spawn (or replace) the managed Bun REPL for `dir`. Returns a STRING-keyed
status map (crosses the strings-only boundary as a tool `:result`).
sourceraw docstring

statusclj

(status dir)

STRING-keyed lifecycle view (crosses as a tool :result).

STRING-keyed lifecycle view (crosses as a tool `:result`).
sourceraw docstring

stop!clj

(stop! dir)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close