Skip to main content

Module commands

Module commands 

Source
Expand description

The slash-command parser/dispatcher — DOC-50 §5 Slice 7, §6 Q4 (“mixed routing”).

Why: DOC-50 §6 Q4 resolves slash-command handling as a split: a small, fixed set of client-side built-ins (/help, /clear, /quit//exit) that never reach a product’s crate::engine::TuiEngine, and every other slash command (domain commands like /model, /workstream, plus any command this crate has never heard of) forwarded verbatim to TuiEngine::handle_input — “the client does NOT interpret domain commands” (thin-client axiom, DOC-39 §2.1 C-1/C-2). This module is where that split is decided. It replaces tagent’s monolithic try_handle_slash/SLASH_COMMANDS (crates/trusty-agents/src/repl/*.rs, crates/trusty-agents/src/repl/tui/helpers.rs:156-181), which mixed generic commands with tagent-specific ones and carried no routing metadata at all.

What: three pieces.

§Spec References

  • SPEC-TTUI-05~draft — Slice 7 deliverable (§5, Slice 7) and Q4 (mixed routing), Q6 (inline pickers).

Enums§

BuiltIn
The effect of a recognized built-in command — applied directly by crate::app::ReplApp::submit_line, never round-tripped through TuiEngine.
Forward
What the caller should do with a Route::Forward line.
Route
Where a submitted line should route (DOC-50 §6 Q4).

Functions§

built_in_commands
The fixed, client-side built-in command table (DOC-50 §6 Q4) — never forwarded to TuiEngine::handle_input.
compose_selection
Compose the line to resubmit when the user confirms selected from request (DOC-50 §3.2 PickerRequest contract: "{dispatch_command} {selected.id}").
dispatch_forward
The Route::Forward half of the dispatch pipeline: resolve a picker or call engine.handle_input.
render_help
Render /help’s output: the built-ins plus every engine-supplied command, one line each, then the key bindings.
resolve_forward
Resolve a Route::Forward line against engine: does it open a picker, or does it genuinely need handle_input?
route
Classify one submitted line per DOC-50 §6 Q4’s mixed-routing model.