Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.wire

Wire encoding for the HTTP gateway.

One dumb, deterministic boundary: engine EDN -> JSON. Keyword/symbol keys become snake_case strings (namespace dropped), keyword values become their name, non-JSON leaves fall back to str. The walker makes ZERO semantic decisions - no flattening, no rendering. Canonical IR vectors pass through structurally ([:ir {...} ...] -> ["ir", {...}, ...]), which is exactly the ALWAYS-IR contract: the client walks IR; the gateway never renders.

Wire encoding for the HTTP gateway.

One dumb, deterministic boundary: engine EDN -> JSON. Keyword/symbol
keys become snake_case strings (namespace dropped), keyword values
become their name, non-JSON leaves fall back to `str`. The walker
makes ZERO semantic decisions - no flattening, no rendering. Canonical
IR vectors pass through structurally (`[:ir {...} ...]` ->
`["ir", {...}, ...]`), which is exactly the ALWAYS-IR contract:
the client walks IR; the gateway never renders.
raw docstring

->wireclj

(->wire x)

Recursively convert an engine value into JSON-encodable data.

Recursively convert an engine value into JSON-encodable data.
sourceraw docstring

bounded-prclj

(bounded-pr x limit)

Bounded pr-str for tool results / errors riding events. Protects the event log and SSE frames from multi-megabyte values.

Bounded `pr-str` for tool results / errors riding events. Protects the
event log and SSE frames from multi-megabyte values.
sourceraw docstring

bounded-strclj

(bounded-str s limit)

Bounded plain-string clamp for an ALREADY-rendered value (e.g. the model-facing render-form-value string) — same megabyte protection as bounded-pr but WITHOUT re-pr-str'ing, so the string rides the wire verbatim instead of quoted/escaped.

Bounded plain-string clamp for an ALREADY-rendered value (e.g. the
model-facing `render-form-value` string) — same megabyte protection as
`bounded-pr` but WITHOUT re-`pr-str`'ing, so the string rides the wire
verbatim instead of quoted/escaped.
sourceraw docstring

json-strclj

(json-str x)

Encode any engine value as a JSON string via ->wire.

Encode any engine value as a JSON string via [[->wire]].
sourceraw docstring

json-str-prettyclj

(json-str-pretty x)

Pretty-printed (2-space indent) JSON via ->wire — for HUMAN-facing surfaces (the web ctx rail's trailer view), never the wire itself.

Pretty-printed (2-space indent) JSON via [[->wire]] — for
HUMAN-facing surfaces (the web ctx rail's trailer view), never the
wire itself.
sourceraw docstring

parse-jsonclj

(parse-json s)

Parse a JSON request body into keyword-keyed Clojure data. Returns nil on blank or malformed input (callers map that to 400).

Parse a JSON request body into keyword-keyed Clojure data. Returns
nil on blank or malformed input (callers map that to 400).
sourceraw docstring

sse-frameclj

(sse-frame {:keys [seq type] :as event})

Render one event map as an SSE frame. The event's :seq doubles as the SSE id: so Last-Event-ID reconnects resume losslessly.

Render one event map as an SSE frame. The event's `:seq` doubles as
the SSE `id:` so `Last-Event-ID` reconnects resume losslessly.
sourceraw docstring

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