Lightweight TUI channel registration.
Keep this namespace tiny: manifest discovery loads it on every Vis startup. The full Lanterna screen implementation is resolved only when the TUI channel actually runs.
Fast-fail validation:
--session-id ID is parsed, looked up, and (on miss) reported with
a friendly message + exit code 2 BEFORE the heavy
com.blockether.vis.ext.channel-tui.screen namespace (Lanterna +
~14 sibling tui namespaces) is required. Catching the miss early on
the lightweight path keeps vis channels tui --session-id <bad>
from paying full TUI class-loading cost.
Correct hits still go through the normal screen channel-main, so all existing screen behavior - argument parsing, redirects, lifecycle - stays intact. Runtime semantics live below the TUI layer and are unaffected: this only changes WHEN screen.clj is required.
Lightweight TUI channel registration. Keep this namespace tiny: manifest discovery loads it on every Vis startup. The full Lanterna screen implementation is resolved only when the TUI channel actually runs. Fast-fail validation: `--session-id ID` is parsed, looked up, and (on miss) reported with a friendly message + exit code 2 BEFORE the heavy `com.blockether.vis.ext.channel-tui.screen` namespace (Lanterna + ~14 sibling tui namespaces) is required. Catching the miss early on the lightweight path keeps `vis channels tui --session-id <bad>` from paying full TUI class-loading cost. Correct hits still go through the normal screen channel-main, so all existing screen behavior - argument parsing, redirects, lifecycle - stays intact. Runtime semantics live below the TUI layer and are unaffected: this only changes WHEN screen.clj is required.
(channel-main args)Lazy channel entry point. Loading the Lanterna screen stack is deferred
until the TUI channel is invoked AND any supplied --session-id
has been validated, so command discovery/help and --session-id
misses do not pay full TUI class-loading cost.
Lazy channel entry point. Loading the Lanterna screen stack is deferred until the TUI channel is invoked AND any supplied `--session-id` has been validated, so command discovery/help and `--session-id` misses do not pay full TUI class-loading cost.
(render-for-tui ir)(render-for-tui ir opts)TUI's :channel/messages-renderer-fn.
STRICT input contract: canonical answer-IR ([:ir & nodes] as
produced by vis.internal.render/->ast). Anything else is a
programmer bug at the call site — we throw with the actual type so
the offender shows up in stderr immediately. The IR boundary is
upstream (loop / persistence / chat helpers); this renderer never
soft-coerces strings, Hiccup, EDN, or anything else.
Returns plain markdown text the TUI transcript layouter consumes.
A follow-up commit replaces the markdown round-trip with the
styled-line walker (channel-tui.render-ir/ir->lines) without
changing this function's contract.
TUI's :channel/messages-renderer-fn. STRICT input contract: canonical answer-IR (`[:ir & nodes]` as produced by `vis.internal.render/->ast`). Anything else is a programmer bug at the call site — we throw with the actual type so the offender shows up in stderr immediately. The IR boundary is upstream (loop / persistence / chat helpers); this renderer never soft-coerces strings, Hiccup, EDN, or anything else. Returns plain markdown text the TUI transcript layouter consumes. A follow-up commit replaces the markdown round-trip with the styled-line walker (`channel-tui.render-ir/ir->lines`) without changing this function's contract.
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 |