Skip to main content

Module tui

Module tui 

Source
Expand description

/tui/* external-controller group (PLAN §17; freeze parity probed live 2026-10-08 against upstream 1.18.31).

Semantics (v1 groups/tui.ts + handlers/tui.ts): every endpoint publishes onto the global event stream and returns true; the attached TUI (packages/tui/src/app.tsx:987) consumes tui.command.execute, tui.toast.show, tui.session.select, tui.prompt.append and acts. Primary external caller: the VS Code extension’s /tui/append-prompt.

Faithful quirks kept: open-themes publishes session.list (upstream bug, replicated); unknown execute-command values publish an event whose properties omit command (JS undefined drops from JSON); toast duration defaults to 5000.

Control rendezvous (/tui/control/next GET long-poll + /response POST) is the queue pair from v1 shared/tui-control.ts. No production caller exists in-tree (test harness only); implemented with bounded channels so a client disconnect releases the waiter.

Structs§

TuiControl

Functions§

append_prompt
bad_request_payload
Effect payload-decode envelope (probed live: /tui/select-session with a non-ses id returns this shape).
clear_prompt
control_next
control_response
execute_command
open_help
open_models
open_sessions
open_themes
Upstream quirk, replicated deliberately (handlers/tui.ts:51-54): open-themes publishes session.list.
publish_event
Union dispatch (v1 handlers/tui.ts:86-96): unknown types answer true without publishing.
select_session
show_toast
submit_prompt