Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.client

HTTP/SSE client for the long-lived gateway daemon.

Interactive channels call this facade instead of gateway.state directly. It discover-or-starts the one daemon for the current DB, then speaks the same HTTP/SSE API every other client uses. This is the thin-client half of the gateway-daemon plan: token refresh, turn execution, and live streaming happen in ONE process.

HTTP/SSE client for the long-lived gateway daemon.

Interactive channels call this facade instead of `gateway.state` directly. It
discover-or-starts the one daemon for the current DB, then speaks the same
HTTP/SSE API every other client uses. This is the thin-client half of the
gateway-daemon plan: token refresh, turn execution, and live streaming happen
in ONE process.
raw docstring

add-filesystem-root!clj

(add-filesystem-root! sid path)

Add path as an extra filesystem root for sid IN THE DAEMON, returning the refreshed session-workspace-info. The daemon owns the session's DB, so the new root is what every channel reads back (fixing the local-only mutation that never reached the running session).

Add `path` as an extra filesystem root for `sid` IN THE DAEMON, returning the
refreshed `session-workspace-info`. The daemon owns the session's DB, so the
new root is what every channel reads back (fixing the local-only mutation that
never reached the running session).
sourceraw docstring

assign-group!clj

(assign-group! sid gid)

Assign a session to a group (nil clears / ungroups). Returns the soul.

Assign a session to a group (nil clears / ungroups). Returns the soul.
sourceraw docstring

attach-turn-sync!clj

(attach-turn-sync! sid tid {:keys [on-event]})
source

cancel-turn!clj

(cancel-turn! sid tid)
source

change-root!clj

(change-root! sid path)

Repoint sid's PRIMARY filesystem root to path IN THE DAEMON, returning the refreshed session-workspace-info (whose :id is the newly pinned workspace).

Repoint `sid`'s PRIMARY filesystem root to `path` IN THE DAEMON, returning the
refreshed `session-workspace-info` (whose `:id` is the newly pinned workspace).
sourceraw docstring

close-session!clj

(close-session! sid)
source

context-snapshotclj

(context-snapshot sid)
source

create-group!clj

(create-group! opts)
source

create-session!clj

(create-session! opts)
source

current-seqclj

(current-seq sid)
source

delete-group!clj

(delete-group! gid)
source

delete-queued-turn!clj

(delete-queued-turn! sid tid)
source

ensure-gateway!clj

(ensure-gateway!)

Return a fresh daemon registry entry for the current DB, auto-starting the detached gateway if needed. :memory is a programmer error for this client; headless one-shots stay in-process and should not call here.

Return a fresh daemon registry entry for the current DB, auto-starting the
detached gateway if needed. `:memory` is a programmer error for this client;
headless one-shots stay in-process and should not call here.
sourceraw docstring

ensure-gateway-serving!clj

(ensure-gateway-serving! path)

Like ensure-gateway!, but tries to GUARANTEE the returned daemon actually serves path. When ensure-gateway! attaches to an already-running daemon that 404s on path (started from a classpath missing the extension that owns it), respawn a fresh daemon from THIS process — whose classpath, by construction, carries the route. This is what lets vis channels web self-heal instead of parking on a /ui that 404s.

The respawn is NON-DESTRUCTIVE. A blind POST /v1/admin/stop is refcount-blind: it would abort every in-flight turn and kill every session's background resources. So we force-restart the stale daemon ONLY when it is idle — no OTHER clients and no running turn. Otherwise we leave it untouched and surface a clear error. A transport blip on the probe (not a real 404) never triggers a restart. Returns the entry.

Like [[ensure-gateway!]], but tries to GUARANTEE the returned daemon actually
serves `path`. When [[ensure-gateway!]] attaches to an already-running daemon
that 404s on `path` (started from a classpath missing the extension that owns
it), respawn a fresh daemon from THIS process — whose classpath, by
construction, carries the route. This is what lets `vis channels web`
self-heal instead of parking on a `/ui` that 404s.

The respawn is NON-DESTRUCTIVE. A blind POST /v1/admin/stop is refcount-blind:
it would abort every in-flight turn and kill every session's background
resources. So we force-restart the stale daemon ONLY when it is idle — no OTHER
clients and no running turn. Otherwise we leave it untouched and surface a clear
error. A transport blip on the probe (not a real 404) never triggers a restart.
Returns the entry.
sourceraw docstring

events-sinceclj

(events-since sid cursor)
source

get-groupclj

(get-group gid)
source

get-turnclj

(get-turn sid tid)
source

list-groupsclj

(list-groups)
(list-groups {:keys [channel owner archived?]})

GET /v1/groups. opts: :channel (keyword/string, :all ⇒ every group), :owner (string), :archived? (bool). Returns the :groups vector.

GET /v1/groups. `opts`: :channel (keyword/string, :all ⇒ every group),
:owner (string), :archived? (bool). Returns the :groups vector.
sourceraw docstring

list-sessionsclj

(list-sessions)
(list-sessions _channel)
source

list-turnsclj

(list-turns sid)
source

provider-limitsclj

(provider-limits provider-id)
source

provider-statusclj

(provider-status provider-id)
source

reconcile-running-turns!clj

(reconcile-running-turns!)

Clients do not sweep. Only the daemon may reconcile its own startup orphans.

Clients do not sweep. Only the daemon may reconcile its own startup orphans.
sourceraw docstring

release-session!clj

(release-session! sid)

Release a session VIEW when the owning channel exits: tell the daemon to stop the session's background resources (shell_bg children, REPLs) and drop its live runtime, then release the process-level client lease. This is NOT a per-session delete (the transcript stays resumable) and never sends daemon shutdown; the daemon stops itself only when refcount AND running-turn-count hit zero. Best-effort and never daemon-spawning — if no fresh daemon is registered there is nothing to release against.

Release a session VIEW when the owning channel exits: tell the daemon to
stop the session's background resources (shell_bg children, REPLs) and drop
its live runtime, then release the process-level client lease. This is NOT
a per-session delete (the transcript stays resumable) and never sends daemon
shutdown; the daemon stops itself only when refcount AND running-turn-count
hit zero. Best-effort and never daemon-spawning — if no fresh daemon is
registered there is nothing to release against.
sourceraw docstring

remove-filesystem-root!clj

(remove-filesystem-root! sid path)

Remove path from sid's extra filesystem roots IN THE DAEMON, returning the refreshed session-workspace-info.

Remove `path` from `sid`'s extra filesystem roots IN THE DAEMON, returning the
refreshed `session-workspace-info`.
sourceraw docstring

session-modelclj

(session-model sid)
source

session-model-cachedclj

(session-model-cached sid)
source

session-workspace-infoclj

(session-workspace-info sid)
source

set-session-model!clj

(set-session-model! sid provider model)
source

soulclj

(soul sid)
source

sse-event-actionclj

(sse-event-action event wanted-turn-id)

Pure classifier for one parsed SSE event while blocking on wanted-turn-id. Returns [action event']: :terminal — the wanted turn reached a terminal event (return event') :forward — hand to on-event (own-turn progress OR a sibling turn's queue-mirror event — see wire/queue-mirror-event-types), then keep reading :skip — another turn's non-queue event, drop it. A turn.queued.deleted for the WANTED turn is terminal too: the queued record was pulled back into an editor before it ever ran, so a cancelled terminal is synthesized instead of blocking on a turn that never starts.

Pure classifier for one parsed SSE event while blocking on `wanted-turn-id`.
Returns `[action event']`:
  :terminal — the wanted turn reached a terminal event (return `event'`)
  :forward  — hand to on-event (own-turn progress OR a sibling turn's
              queue-mirror event — see `wire/queue-mirror-event-types`),
              then keep reading
  :skip     — another turn's non-queue event, drop it.
A `turn.queued.deleted` for the WANTED turn is terminal too: the queued
record was pulled back into an editor before it ever ran, so a cancelled
terminal is synthesized instead of blocking on a turn that never starts.
sourceraw docstring

statusclj

(status)
source

stop-daemon!clj

(stop-daemon!)
source

submit-turn!clj

(submit-turn! sid opts)
source

submit-turn-sync!clj

(submit-turn-sync! sid {:keys [on-event] :as opts})
source

subscribe!clj

(subscribe! sid sub-id sink cursor)

Remote equivalent of gateway.state/subscribe!: start a background SSE reader that replays cursor then calls sink for every live event. Returns an empty replay vector because the gateway's SSE endpoint itself handles replay before live delivery.

Remote equivalent of gateway.state/subscribe!: start a background SSE reader
that replays `cursor` then calls `sink` for every live event. Returns an empty
replay vector because the gateway's SSE endpoint itself handles replay before
live delivery.
sourceraw docstring

transcriptclj

(transcript sid)
source

turn-traceclj

(turn-trace sid tid)

Canonical wire iterations of ONE persisted turn (nil when the id is unknown to the daemon).

Canonical wire iterations of ONE persisted turn (nil when the id is
unknown to the daemon).
sourceraw docstring

unsubscribe!clj

(unsubscribe! _sid sub-id)
source

update-group!clj

(update-group! gid opts)
source

update-queued-turn!clj

(update-queued-turn! sid tid request)
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