gaunt-sloth 2.0.0-alpha.2 → 2.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -5
- package/cli.js +43 -10
- package/dist/cli.js +33 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/adkEvalRunner.d.ts +66 -0
- package/dist/commands/adkEvalRunner.js +69 -0
- package/dist/commands/adkEvalRunner.js.map +1 -0
- package/dist/commands/agUiEvalRunner.d.ts +73 -0
- package/dist/commands/agUiEvalRunner.js +216 -0
- package/dist/commands/agUiEvalRunner.js.map +1 -0
- package/dist/commands/askCommand.d.ts +3 -2
- package/dist/commands/askCommand.js +26 -7
- package/dist/commands/askCommand.js.map +1 -1
- package/dist/commands/batchCommand.d.ts +78 -0
- package/dist/commands/batchCommand.js +245 -0
- package/dist/commands/batchCommand.js.map +1 -0
- package/dist/commands/cliOptionParsers.d.ts +12 -0
- package/dist/commands/cliOptionParsers.js +18 -0
- package/dist/commands/cliOptionParsers.js.map +1 -0
- package/dist/commands/commandIntrospection.d.ts +6 -6
- package/dist/commands/commandIntrospection.js +12 -12
- package/dist/commands/commandIntrospection.js.map +1 -1
- package/dist/commands/commandUtils.d.ts +16 -16
- package/dist/commands/commandUtils.js +20 -20
- package/dist/commands/commandUtils.js.map +1 -1
- package/dist/commands/configCommand.d.ts +24 -0
- package/dist/commands/configCommand.js +117 -0
- package/dist/commands/configCommand.js.map +1 -0
- package/dist/commands/configSetup.d.ts +1 -1
- package/dist/commands/configSetup.js +17 -2
- package/dist/commands/configSetup.js.map +1 -1
- package/dist/commands/evalCommand.d.ts +41 -0
- package/dist/commands/evalCommand.js +483 -0
- package/dist/commands/evalCommand.js.map +1 -0
- package/dist/commands/execCommand.js +4 -1
- package/dist/commands/execCommand.js.map +1 -1
- package/dist/commands/firstRunDialog.d.ts +39 -5
- package/dist/commands/firstRunDialog.js +72 -10
- package/dist/commands/firstRunDialog.js.map +1 -1
- package/dist/commands/getCommand.js +7 -7
- package/dist/commands/getCommand.js.map +1 -1
- package/dist/commands/historyCommand.d.ts +17 -0
- package/dist/commands/historyCommand.js +102 -0
- package/dist/commands/historyCommand.js.map +1 -0
- package/dist/commands/initCommand.d.ts +3 -0
- package/dist/commands/initCommand.js +9 -4
- package/dist/commands/initCommand.js.map +1 -1
- package/dist/commands/insightsCommand.d.ts +8 -0
- package/dist/commands/insightsCommand.js +32 -0
- package/dist/commands/insightsCommand.js.map +1 -0
- package/dist/commands/modelsCommand.d.ts +25 -0
- package/dist/commands/modelsCommand.js +96 -0
- package/dist/commands/modelsCommand.js.map +1 -0
- package/dist/commands/prCommand.js +14 -15
- package/dist/commands/prCommand.js.map +1 -1
- package/dist/commands/prDiscovery.d.ts +2 -2
- package/dist/commands/prDiscovery.js +27 -29
- package/dist/commands/prDiscovery.js.map +1 -1
- package/dist/commands/reviewCommand.js +15 -10
- package/dist/commands/reviewCommand.js.map +1 -1
- package/dist/commands/workflowCommand.d.ts +19 -0
- package/dist/commands/workflowCommand.js +77 -0
- package/dist/commands/workflowCommand.js.map +1 -0
- package/dist/helpers/jira/jiraLogWork.js.map +1 -1
- package/dist/modules/startSession.js +9 -7
- package/dist/modules/startSession.js.map +1 -1
- package/dist/tools/gthJiraLogWorkTool.js +3 -3
- package/dist/tools/gthJiraLogWorkTool.js.map +1 -1
- package/dist/tui/components/App.js +321 -21
- package/dist/tui/components/App.js.map +1 -1
- package/dist/tui/components/ApprovalPrompt.d.ts +18 -0
- package/dist/tui/components/ApprovalPrompt.js +26 -0
- package/dist/tui/components/ApprovalPrompt.js.map +1 -0
- package/dist/tui/components/DebugPanel.d.ts +29 -9
- package/dist/tui/components/DebugPanel.js +46 -23
- package/dist/tui/components/DebugPanel.js.map +1 -1
- package/dist/tui/components/FetchProgress.d.ts +36 -0
- package/dist/tui/components/FetchProgress.js +39 -0
- package/dist/tui/components/FetchProgress.js.map +1 -0
- package/dist/tui/components/LiveTurn.d.ts +26 -4
- package/dist/tui/components/LiveTurn.js +104 -18
- package/dist/tui/components/LiveTurn.js.map +1 -1
- package/dist/tui/components/NoticeBar.d.ts +32 -0
- package/dist/tui/components/NoticeBar.js +39 -0
- package/dist/tui/components/NoticeBar.js.map +1 -0
- package/dist/tui/components/PromptInput.d.ts +26 -1
- package/dist/tui/components/PromptInput.js +93 -7
- package/dist/tui/components/PromptInput.js.map +1 -1
- package/dist/tui/components/Rule.js.map +1 -1
- package/dist/tui/components/SelectList.d.ts +98 -9
- package/dist/tui/components/SelectList.js +209 -26
- package/dist/tui/components/SelectList.js.map +1 -1
- package/dist/tui/components/SlashCommandMenu.d.ts +20 -0
- package/dist/tui/components/SlashCommandMenu.js +28 -0
- package/dist/tui/components/SlashCommandMenu.js.map +1 -0
- package/dist/tui/components/StatusBar.d.ts +7 -1
- package/dist/tui/components/StatusBar.js +7 -3
- package/dist/tui/components/StatusBar.js.map +1 -1
- package/dist/tui/components/Transcript.js +6 -1
- package/dist/tui/components/Transcript.js.map +1 -1
- package/dist/tui/debugRender.d.ts +41 -6
- package/dist/tui/debugRender.js +126 -12
- package/dist/tui/debugRender.js.map +1 -1
- package/dist/tui/debugSearch.d.ts +40 -0
- package/dist/tui/debugSearch.js +73 -0
- package/dist/tui/debugSearch.js.map +1 -0
- package/dist/tui/markdown.js +0 -0
- package/dist/tui/markdown.js.map +1 -1
- package/dist/tui/pasteParser.d.ts +21 -0
- package/dist/tui/pasteParser.js +24 -0
- package/dist/tui/pasteParser.js.map +1 -0
- package/dist/tui/selectCancelled.d.ts +13 -0
- package/dist/tui/selectCancelled.js +17 -0
- package/dist/tui/selectCancelled.js.map +1 -0
- package/dist/tui/slashCommands.d.ts +220 -1
- package/dist/tui/slashCommands.js +408 -1
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/tuiSessionModule.js +249 -24
- package/dist/tui/tuiSessionModule.js.map +1 -1
- package/dist/tui/types.d.ts +96 -7
- package/dist/tui/viewModel.d.ts +34 -0
- package/dist/tui/viewModel.js +67 -0
- package/dist/tui/viewModel.js.map +1 -1
- package/dist/utils/stdinPolicy.d.ts +31 -0
- package/dist/utils/stdinPolicy.js +37 -0
- package/dist/utils/stdinPolicy.js.map +1 -0
- package/package.json +21 -17
|
@@ -19,7 +19,125 @@ export interface SlashCommandContext {
|
|
|
19
19
|
toolsExpanded: boolean;
|
|
20
20
|
/** Whether the docked debug panel is currently shown (drives `/debug` copy). */
|
|
21
21
|
debugVisible: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Pre-rendered, secret-free summary lines of the resolved config, surfaced read-only by
|
|
24
|
+
* `/config` (GS2-1). The App builds these once from the resolved config (see
|
|
25
|
+
* {@link formatConfigSummary}); omitted where no config is loaded (e.g. the fixture agent).
|
|
26
|
+
*/
|
|
27
|
+
configSummary?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* TUI-C19 — the actual config-validation warnings (unknown keys / deprecated names) captured at
|
|
30
|
+
* load, so `/config` can render the DETAILS the standing "config has problems" advisory line
|
|
31
|
+
* points at. Empty/omitted ⇒ `/config` shows only the resolved summary (a clean config).
|
|
32
|
+
*/
|
|
33
|
+
configWarnings?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* GS2-7 (B20) / GS2-19 — pre-rendered recent-conversation lines for `/history`. The App builds
|
|
36
|
+
* these fail-soft from the local history store (see `formatConversationList`); omitted when no
|
|
37
|
+
* store is available (history never enabled / DB missing), in which case `/history` shows an
|
|
38
|
+
* "unavailable" notice.
|
|
39
|
+
*/
|
|
40
|
+
historySummary?: string[];
|
|
41
|
+
/**
|
|
42
|
+
* GS2-7 (B20) — pre-rendered analytics lines for `/insights` (see `formatInsightsSummary`),
|
|
43
|
+
* built fail-soft by the App; omitted when no store is available.
|
|
44
|
+
*/
|
|
45
|
+
insightsSummary?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* GS2-7 (B20) — a fail-soft search provider for `/search <query>`, bound by the App to the local
|
|
48
|
+
* history store (returns already-formatted result lines). Injected (rather than the command
|
|
49
|
+
* touching the DB) so the registry stays pure and testable with a stub. Omitted when no store is
|
|
50
|
+
* available, in which case `/search` reports that history is unavailable.
|
|
51
|
+
*/
|
|
52
|
+
historySearch?: (query: string) => string[];
|
|
53
|
+
/**
|
|
54
|
+
* TUI-C18 — the reasoning text of each committed assistant turn, in transcript order (index 0 =
|
|
55
|
+
* turn 1). `''` for a turn that produced no thinking layer. Drives `/reasoning`, which reprints a
|
|
56
|
+
* committed turn's thinking (frozen in `<Static>`, so it can never re-expand in place). The App
|
|
57
|
+
* builds this from the transcript; omitted (empty) where there are no committed turns yet.
|
|
58
|
+
*/
|
|
59
|
+
turnReasonings?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* GS2-46 — the live transcript (all committed turns, tool calls + results) and the resolved
|
|
62
|
+
* config, for `/debug-dump`. Kept opaque (`unknown`) so this pure module stays decoupled from
|
|
63
|
+
* the TUI's `TranscriptItem` type and `GthConfig` — forwarded as-is into the injected
|
|
64
|
+
* `dumpDebugSession` writer (see {@link DebugDumpInput}). Omitted where no session state is
|
|
65
|
+
* available (e.g. the fixture agent), in which case `/debug-dump` reports itself unavailable.
|
|
66
|
+
*/
|
|
67
|
+
transcript?: unknown[];
|
|
68
|
+
/** GS2-46 — see {@link SlashCommandContext.transcript}. */
|
|
69
|
+
resolvedConfig?: unknown;
|
|
70
|
+
/**
|
|
71
|
+
* GS2-46 — fs-writing implementation for `/debug-dump`: writes an UNSANITIZED archive
|
|
72
|
+
* (transcript, resolved config, env/version info, the in-memory debugLog ring buffer, and
|
|
73
|
+
* best-effort git repo state) to `~/.gsloth/debug-dumps/<timestamp>/` and returns its path.
|
|
74
|
+
* Injected by the App the same way `historySearch` is (GS2-7), so this module stays pure and
|
|
75
|
+
* testable with a fake — the real writer (`packages/core/src/utils/debugDump.ts`) does the
|
|
76
|
+
* actual I/O. Omitted ⇒ `/debug-dump` reports itself unavailable (fixture / no session state).
|
|
77
|
+
*/
|
|
78
|
+
dumpDebugSession?: (input: DebugDumpInput) => {
|
|
79
|
+
archiveDir: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* GS2-46 — the input `/debug-dump` assembles from context and hands to the injected
|
|
84
|
+
* `dumpDebugSession` writer. `transcript`/`config` are opaque to this pure module (the real
|
|
85
|
+
* writer, not this file, interprets them); `modelDisplayName` mirrors the field already on
|
|
86
|
+
* {@link SlashCommandContext}.
|
|
87
|
+
*/
|
|
88
|
+
export interface DebugDumpInput {
|
|
89
|
+
transcript: unknown[];
|
|
90
|
+
config: unknown;
|
|
91
|
+
modelDisplayName: string;
|
|
92
|
+
/**
|
|
93
|
+
* GS2-47 — whether the writer should redact secrets from every artifact. Resolved by
|
|
94
|
+
* {@link resolveDebugDumpRedact} from the config (`debugDump.redact`, default ON) and the
|
|
95
|
+
* `--unsafe-no-redact` command flag, then threaded straight through to `writeDebugDump`.
|
|
96
|
+
*/
|
|
97
|
+
redact: boolean;
|
|
22
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* The subset of the resolved config `/config` surfaces. Structurally typed (not the full
|
|
101
|
+
* `GthConfig`) so this pure module stays decoupled from the config types; the caller passes the
|
|
102
|
+
* real resolved config, which is a superset.
|
|
103
|
+
*/
|
|
104
|
+
export interface ConfigSummaryInput {
|
|
105
|
+
modelDisplayName?: string;
|
|
106
|
+
agent?: {
|
|
107
|
+
backend?: string;
|
|
108
|
+
};
|
|
109
|
+
filesystem?: unknown;
|
|
110
|
+
streamOutput?: boolean;
|
|
111
|
+
useColour?: boolean;
|
|
112
|
+
consoleLevel?: unknown;
|
|
113
|
+
commands?: Record<string, unknown>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Build the compact, read-only `/config` summary (GS2-1): a handful of the most orienting
|
|
117
|
+
* resolved-config fields, one per line, with a pointer to `gth config print` for the full view.
|
|
118
|
+
* Pure and secret-free — it only reads non-sensitive scalar fields (never API keys / the live
|
|
119
|
+
* llm instance). Used by the App to fill {@link SlashCommandContext.configSummary}.
|
|
120
|
+
*/
|
|
121
|
+
export declare function formatConfigSummary(config: ConfigSummaryInput): string[];
|
|
122
|
+
/**
|
|
123
|
+
* The `/config` notice, from the pre-rendered summary lines (or an unavailable fallback).
|
|
124
|
+
*
|
|
125
|
+
* TUI-C19 — when config-validation `warnings` are present (unknown keys / deprecated names), they
|
|
126
|
+
* are rendered FIRST, as the details the standing "config has problems" advisory line points at,
|
|
127
|
+
* then a blank spacer, then the resolved summary. A clean config (no warnings) reads exactly as
|
|
128
|
+
* before. Tone flips to `warn` (yellow) while there are warnings so the block reads as caution.
|
|
129
|
+
*/
|
|
130
|
+
export declare function configNotice(summary: string[] | undefined, warnings?: string[]): SlashCommandNotice;
|
|
131
|
+
/** The `/history` notice (GS2-7): recent recorded sessions, or an "unavailable" fallback. */
|
|
132
|
+
export declare function historyNotice(summary: string[] | undefined): SlashCommandNotice;
|
|
133
|
+
/** The `/insights` notice (GS2-7): local analytics summary, or an "unavailable" fallback. */
|
|
134
|
+
export declare function insightsNotice(summary: string[] | undefined): SlashCommandNotice;
|
|
135
|
+
/**
|
|
136
|
+
* The `/search` notice (GS2-7). With no query it prints usage; otherwise it runs the injected
|
|
137
|
+
* fail-soft {@link SlashCommandContext.historySearch} provider and renders its result lines. When
|
|
138
|
+
* no provider is bound (no store), it reports history as unavailable.
|
|
139
|
+
*/
|
|
140
|
+
export declare function searchNotice(args: string[], search: ((query: string) => string[]) | undefined): SlashCommandNotice;
|
|
23
141
|
/**
|
|
24
142
|
* A structured, noticeable command-feedback block (TUI-C14): a title that states WHAT happened
|
|
25
143
|
* plus body lines explaining HOW it affects the user. The component renders these via
|
|
@@ -51,6 +169,26 @@ export interface SlashCommandResult {
|
|
|
51
169
|
toggleDebug?: boolean;
|
|
52
170
|
/** When true, the component toggles tool-call panels between collapsed and expanded. */
|
|
53
171
|
toggleTools?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* EXT-12 — a requested change to the runner's session-scoped auto-approve flag (shell commands
|
|
174
|
+
* auto-approved this session), from the `/auto-approve` command: `'on'` / `'off'` set it
|
|
175
|
+
* explicitly, `'toggle'` flips it. The command itself stays pure — it cannot read the runner's
|
|
176
|
+
* flag — so the App owns the actual apply + the resulting-state notice (mirroring how `/tools`
|
|
177
|
+
* / `/debug` defer their state-aware copy to the App).
|
|
178
|
+
*/
|
|
179
|
+
autoApprove?: 'on' | 'off' | 'toggle';
|
|
180
|
+
/**
|
|
181
|
+
* TUI-C18 — a committed turn's thinking to REPRINT into the transcript (the `/reasoning` command).
|
|
182
|
+
* Committed reasoning is frozen in Ink's `<Static>` and can never re-expand in place, so instead of
|
|
183
|
+
* mutating the old turn we emit a fresh block that reuses the TUI-C15 `💭`/gutter styling. The App
|
|
184
|
+
* turns this into a `reasoning` transcript item; the command stays pure (it resolves the target from
|
|
185
|
+
* `turnReasonings`). Absent when the command instead returns a friendly `notice` (no reasoning /
|
|
186
|
+
* out-of-range).
|
|
187
|
+
*/
|
|
188
|
+
reprintReasoning?: {
|
|
189
|
+
reasoning: string;
|
|
190
|
+
turnNumber: number;
|
|
191
|
+
};
|
|
54
192
|
/** When true, the component quits the app (runs `onExit`). */
|
|
55
193
|
exit?: boolean;
|
|
56
194
|
}
|
|
@@ -60,6 +198,14 @@ export interface SlashCommand {
|
|
|
60
198
|
name: string;
|
|
61
199
|
/** One-line description shown by `/help`. */
|
|
62
200
|
description: string;
|
|
201
|
+
/**
|
|
202
|
+
* EXT-12 — whether this command may be dispatched WHILE a turn is streaming ("during
|
|
203
|
+
* inference"). Defaults to false: most commands are idle-only. The read-only / session-toggle
|
|
204
|
+
* commands (e.g. `/auto-approve`, `/tools`, `/debug`, `/help`, `/model`) set this so the user
|
|
205
|
+
* can flip auto-approval or inspect state mid-turn without interrupting the run. Commands that
|
|
206
|
+
* mutate the transcript or thread (`/clear`) or end the session (`/exit`) stay idle-only.
|
|
207
|
+
*/
|
|
208
|
+
availableDuringRun?: boolean;
|
|
63
209
|
run(ctx: SlashCommandContext, args: string[]): SlashCommandResult;
|
|
64
210
|
}
|
|
65
211
|
/** Parsed shape of a `/...` line. `null` for plain (non-slash) input. */
|
|
@@ -73,6 +219,28 @@ export interface ParsedSlashCommand {
|
|
|
73
219
|
* whitespace-separated tokens are the args.
|
|
74
220
|
*/
|
|
75
221
|
export declare function parseSlashCommand(input: string): ParsedSlashCommand | null;
|
|
222
|
+
/**
|
|
223
|
+
* TUI-C10 — the discovery-menu trigger test. The Ink `<PromptInput>` shows the slash-command menu
|
|
224
|
+
* while the user is typing a bare command: the raw input is a menu query iff its first character is
|
|
225
|
+
* `/` and it contains no whitespace yet (once a space is typed the user is entering args, so the
|
|
226
|
+
* menu closes and normal dispatch takes over). Returns the lower-cased query AFTER the slash (so a
|
|
227
|
+
* bare `/` yields `''` = "show everything"), or `null` when the input is not a menu trigger.
|
|
228
|
+
*
|
|
229
|
+
* Kept pure and next to the registry (like {@link parseSlashCommand}) so the menu's show/hide and
|
|
230
|
+
* filter logic is unit-testable without React.
|
|
231
|
+
*/
|
|
232
|
+
export declare function slashMenuQuery(input: string): string | null;
|
|
233
|
+
/**
|
|
234
|
+
* TUI-C10 — filter the registry down to the commands that match a menu query, most-relevant first.
|
|
235
|
+
* Prefix matches (the name starts with the query) rank above looser substring matches; within each
|
|
236
|
+
* bucket the registry's own order is preserved (so extension-registered commands — appended to the
|
|
237
|
+
* array — naturally sort after the built-ins). An empty query returns the whole registry, so a bare
|
|
238
|
+
* `/` lists every command including any the extensions added (never a hardcoded list).
|
|
239
|
+
*
|
|
240
|
+
* Pure: takes the registry the caller already built via {@link createCommandRegistry}, so the menu
|
|
241
|
+
* automatically reflects extension commands without this layer knowing they exist.
|
|
242
|
+
*/
|
|
243
|
+
export declare function filterSlashCommands(registry: SlashCommand[], query: string): SlashCommand[];
|
|
76
244
|
/**
|
|
77
245
|
* The notice for the tool-detail toggle, given the RESULTING (post-toggle) state. Shared by the
|
|
78
246
|
* `/tools` command and the Ctrl+T key handler so the copy is single-sourced (TUI-C14).
|
|
@@ -83,6 +251,50 @@ export declare function toolsToggleNotice(expanded: boolean): SlashCommandNotice
|
|
|
83
251
|
* command reports exactly the state the component will apply.
|
|
84
252
|
*/
|
|
85
253
|
export declare function debugToggleNotice(visible: boolean): SlashCommandNotice;
|
|
254
|
+
/**
|
|
255
|
+
* The notice for the `/auto-approve` toggle (EXT-12), given the RESULTING (post-apply) state.
|
|
256
|
+
* Shared so the command reports exactly the state the App applies. ON is rendered 'warn' (yellow)
|
|
257
|
+
* because it disables the approval gate for the session; OFF is 'info'.
|
|
258
|
+
*/
|
|
259
|
+
export declare function autoApproveNotice(on: boolean): SlashCommandNotice;
|
|
260
|
+
/**
|
|
261
|
+
* EXT-12 — parse the `/auto-approve` argument: no arg (or `toggle`) flips; `on`/`off` (and the
|
|
262
|
+
* friendly synonyms `enable`/`disable`, `true`/`false`) set explicitly. Returns `null` for an
|
|
263
|
+
* unrecognized argument so the command can render a usage hint instead of guessing.
|
|
264
|
+
*/
|
|
265
|
+
export declare function parseAutoApproveArg(args: string[]): 'on' | 'off' | 'toggle' | null;
|
|
266
|
+
/**
|
|
267
|
+
* TUI-C18 — resolve a `/reasoning` invocation against the committed turns' reasoning (in transcript
|
|
268
|
+
* order, index 0 = turn 1). Pure, so the whole selection + friendly-notice logic is unit-testable
|
|
269
|
+
* without React:
|
|
270
|
+
*
|
|
271
|
+
* - **no arg** → the most recent turn that actually recorded thinking; if none exists, a friendly
|
|
272
|
+
* info notice (nothing to show).
|
|
273
|
+
* - **`<n>`** → turn `n` (1-based). A non-positive / non-integer / out-of-range `n` → a warn notice;
|
|
274
|
+
* a valid turn that recorded no thinking → an info notice. Otherwise a `reprintReasoning` request.
|
|
275
|
+
*
|
|
276
|
+
* The App renders a `reprintReasoning` result as a fresh reasoning block (reusing the TUI-C15
|
|
277
|
+
* styling) and a `notice` result via the shared `CommandNotice`.
|
|
278
|
+
*/
|
|
279
|
+
export declare function resolveReasoning(reasonings: string[], args: string[]): SlashCommandResult;
|
|
280
|
+
/**
|
|
281
|
+
* GS2-47 — resolve whether the `/debug-dump` archive should be redacted. ON by default; opt out via
|
|
282
|
+
* the config (`debugDump.redact: false`) OR the `--unsafe-no-redact` command flag. Any uncertainty
|
|
283
|
+
* (no/non-object config) defaults to redacting — fail safe. `resolvedConfig` is opaque here, so this
|
|
284
|
+
* reads the flag structurally without depending on the `GthConfig` type.
|
|
285
|
+
*/
|
|
286
|
+
export declare function resolveDebugDumpRedact(resolvedConfig: unknown, args: string[]): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* The `/debug-dump` success notice (a standard 3-line CommandNotice — DL-1: no command reads as
|
|
289
|
+
* "does nothing"). GS2-47 flips the default to REDACTED: when redaction ran (the default) the note
|
|
290
|
+
* is softened ("secrets redacted; review before sharing") and points at the opt-out. When the user
|
|
291
|
+
* opted OUT (raw archive) it is the loud, impossible-to-miss UNSANITIZED warning. Colour follows
|
|
292
|
+
* DL-8 / the tone rule in maintenance/ux-guidelines.md: the safe, redacted default is normal
|
|
293
|
+
* feedback (no `tone` ⇒ info), while the raw opt-out is caution and so `tone: 'warn'` (yellow) —
|
|
294
|
+
* mirroring how `autoApproveNotice` reserves yellow for the dangerous (gate-off) state. Redaction is
|
|
295
|
+
* best-effort pattern-based, so even the softened note still says review-before-sharing.
|
|
296
|
+
*/
|
|
297
|
+
export declare function debugDumpNotice(archiveDir: string, redacted: boolean): SlashCommandNotice;
|
|
86
298
|
/**
|
|
87
299
|
* Build the default command registry. Returns a fresh array each call so callers may push
|
|
88
300
|
* extension commands onto it (EXT-5) without sharing mutable module state.
|
|
@@ -94,5 +306,12 @@ export declare function formatHelp(registry: SlashCommand[]): SlashCommandNotice
|
|
|
94
306
|
* Dispatch a parsed command against a registry. Unknown commands return a friendly hint
|
|
95
307
|
* rather than throwing, so the component can render it as a system line and never forward
|
|
96
308
|
* the text to the model.
|
|
309
|
+
*
|
|
310
|
+
* EXT-12 — when `options.duringRun` is set (a turn is streaming), commands that are not marked
|
|
311
|
+
* {@link SlashCommand.availableDuringRun} are refused with a friendly notice rather than run,
|
|
312
|
+
* so mid-turn input can only reach the safe, non-mutating commands (`/auto-approve`, `/tools`,
|
|
313
|
+
* `/debug`, …). `/help` is always allowed.
|
|
97
314
|
*/
|
|
98
|
-
export declare function dispatchSlashCommand(parsed: ParsedSlashCommand, registry: SlashCommand[], ctx: SlashCommandContext
|
|
315
|
+
export declare function dispatchSlashCommand(parsed: ParsedSlashCommand, registry: SlashCommand[], ctx: SlashCommandContext, options?: {
|
|
316
|
+
duringRun?: boolean;
|
|
317
|
+
}): SlashCommandResult;
|