Skip to content

SlashCommandContext

Defined in: packages/agent/src/modules/slashCommands.ts:78

Read-only session context a command may surface (e.g. /status, /model).

optional autocompact?: AutocompactStatus

Defined in: packages/agent/src/modules/slashCommands.ts:114

EXT-161 — the preventive compaction threshold in force, for /status.

A snapshot rather than a live read because run is synchronous and resolving a window can do I/O. The surface refreshes it when the session starts and again whenever /autocompact changes it, which is what makes /status report a session override rather than the seeded value it replaced. Omitted on a surface with no resolved model (the fixture agent), where /status simply says nothing about compaction instead of claiming a state it cannot know.


optional configSummary?: string[]

Defined in: packages/agent/src/modules/slashCommands.ts:126

Pre-rendered, secret-free summary lines of the resolved config, surfaced read-only by /config (GS2-1). The App builds these once from the resolved config (see formatConfigSummary); omitted where no config is loaded (e.g. the fixture agent).


optional configWarnings?: string[]

Defined in: packages/agent/src/modules/slashCommands.ts:132

TUI-C19 — the actual config-validation warnings (unknown keys / deprecated names) captured at load, so /config can render the DETAILS the standing “config has problems” advisory line points at. Empty/omitted ⇒ /config shows only the resolved summary (a clean config).


optional conversationId?: number

Defined in: packages/agent/src/modules/slashCommands.ts:100

GS2-20 — the conversation this session is recording under, as gth history list numbers it, so /status can name what gth history resume <id> would take. Undefined when nothing is being recorded (history off, the store did not open, or a surface with no store at all).


debugVisible: boolean

Defined in: packages/agent/src/modules/slashCommands.ts:104

Whether the docked debug panel is currently shown (drives /debug copy).


optional dumpDebugSession?: (input) => object

Defined in: packages/agent/src/modules/slashCommands.ts:200

GS2-46 — fs-writing implementation for /debug-dump: writes an UNSANITIZED archive (transcript, resolved config, env/version info, the in-memory debugLog ring buffer, and best-effort git repo state) to ~/.gsloth/debug-dumps/<timestamp>/ and returns its path. Injected by the App the same way historySearch is (GS2-7), so this module stays pure and testable with a fake — the real writer (packages/core/src/utils/debugDump.ts) does the actual I/O. Omitted ⇒ /debug-dump reports itself unavailable (fixture / no session state).

DebugDumpInput

object

archiveDir: string


optional hasSlashMenu?: boolean

Defined in: packages/agent/src/modules/slashCommands.ts:227

TUI-C96 — whether THIS surface has the slash-command menu, which is the other half of the unknown-command notice’s explanation of why a shortened name failed.

Supplied by the surface for the same reason SlashCommandContext.keyBindings is: the registry is shared, the surfaces are not. slashMenuQuery is consumed by the Ink <PromptInput> alone, so on the readline session a prefix resolves nowhere at all, and copy telling that user a prefix “works in the menu” sends them looking for something that does not exist. The suggestion itself is identical on both surfaces — only the explanatory sentence varies.

Absent means NO menu, so a surface that says nothing is never made to promise one. That is the safe direction: the cost of omitting it is a sentence that is merely less specific, while the cost of defaulting the other way is a sentence that is false.


optional historyAvailability?: HistoryAvailability

Defined in: packages/agent/src/modules/slashCommands.ts:148

GS2-88 — why /history /insights /search have what they have, established by the surface rather than inferred here from an empty summary.

Every interactive surface builds this and the three fields below with core’s one buildHistorySlashProps, so neither can serve a subset of the other. The store is a local SQLite file and the formatters are pure, so there is nothing about these commands a renderer could own.

Absent means this surface provides no history at all, and the commands then say exactly that — they do not name the store and they do not name the config, because from here neither has been looked at. That default is the whole node: a readline session that passed nothing used to render as “your config turned history off” to a user whose config had done no such thing.


optional historySearch?: (query) => string[]

Defined in: packages/agent/src/modules/slashCommands.ts:167

GS2-7 (B20) — a fail-soft search provider for /search <query>, bound to the local history store (returns already-formatted result lines). Injected (rather than the command touching the DB) so the registry stays pure and testable with a stub. Omitted unless SlashCommandContext.historyAvailability is available.

string

string[]


optional historySummary?: string[]

Defined in: packages/agent/src/modules/slashCommands.ts:155

GS2-7 (B20) / GS2-19 — pre-rendered recent-conversation lines for /history, built fail-soft from the local history store (see formatConversationList). Omitted unless SlashCommandContext.historyAvailability is available, in which case /history explains itself from that field instead.


optional insightsSummary?: string[]

Defined in: packages/agent/src/modules/slashCommands.ts:160

GS2-7 (B20) — pre-rendered analytics lines for /insights (see formatInsightsSummary), built fail-soft; omitted unless SlashCommandContext.historyAvailability is available.


optional keyBindings?: readonly KeyBindingGroup[]

Defined in: packages/agent/src/modules/slashCommands.ts:211

TUI-C63 — the key bindings THIS surface actually has, grouped by context, appended to /help.

Supplied by the surface rather than held as a constant here, because this registry is shared (GS2-8) and the two surfaces have different keyboards: the full-screen TUI owns its conversation region and every key that scrolls it, while the readline session has no Ink components, no mouse layer and the terminal’s own scrollback — so wheel, PgUp/PgDn, Ctrl+Home/Ctrl+End and Ctrl+T mean nothing there. Readline passes nothing and its /help stays the command list alone. GS2-87: the divergence is deliberate and stated, never accidental.


mode: string

Defined in: packages/agent/src/modules/slashCommands.ts:79


modelDisplayName: string

Defined in: packages/agent/src/modules/slashCommands.ts:80


optional modelProviderType?: string

Defined in: packages/agent/src/modules/slashCommands.ts:92

CFG-38 — the resolved provider (config.modelProviderType, the raw llm.type the loader stashes), so /status and /model can render the shared model (provider) spelling instead of a model id that is ambiguous on its own (the same id is served by anthropic and by openrouter, and an OpenAI-compatible endpoint answers to a name that says nothing about who is serving it).

Optional and legitimately absent — a module config hands the loader an already-built BaseChatModel, so there is no provider string to stash. That case renders the bare model with nothing extra, which is what modelProviderLabel does with an absent provider.


optional mouseEnabled?: boolean

Defined in: packages/agent/src/modules/slashCommands.ts:120

TUI-C37 — whether terminal mouse reporting is currently on (drives /mouse copy). Undefined on surfaces that have no mouse layer at all, where /mouse reports itself unavailable rather than claiming a state it cannot change.


optional resolvedConfig?: unknown

Defined in: packages/agent/src/modules/slashCommands.ts:191

GS2-46 — see SlashCommandContext.transcript.


toolsExpanded: boolean

Defined in: packages/agent/src/modules/slashCommands.ts:102

Whether tool-call panels currently show their full args/result (drives /verbose copy).


optional transcript?: unknown[]

Defined in: packages/agent/src/modules/slashCommands.ts:189

GS2-46 — the live transcript (all committed turns, tool calls + results) and the resolved config, for /debug-dump. Kept opaque (unknown) so this pure module stays decoupled from the TUI’s TranscriptItem type and GthConfig — forwarded as-is into the injected dumpDebugSession writer (see DebugDumpInput). Omitted where no session state is available (e.g. the fixture agent), in which case /debug-dump reports itself unavailable.


turnCount: number

Defined in: packages/agent/src/modules/slashCommands.ts:94

Count of committed turns so far (for /help-style introspection if needed).


optional turnReasonings?: string[]

Defined in: packages/agent/src/modules/slashCommands.ts:181

TUI-C18 — the reasoning text of each committed assistant turn, in transcript order (index 0 = turn 1). '' for a turn that produced no thinking layer. Drives /reasoning, which reprints a committed turn’s thinking. The Ink TUI builds this from its transcript, and an EMPTY array there truthfully means no turn has been committed yet.

GS2-88 — absent is a different fact from empty, and the two must not be merged. The plain readline surface keeps no transcript and its string streaming path drops the reasoning channel outright (answerTextOf in GthAbstractAgent), so it has no per-turn thinking to offer at any point in the session. It therefore passes nothing, and /reasoning reports the surface’s own limit instead of claiming the session has committed no turns — which it had, by the dozen, when this field’s absence was read as emptiness.