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.
Files changed (127) hide show
  1. package/README.md +55 -5
  2. package/cli.js +43 -10
  3. package/dist/cli.js +33 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/adkEvalRunner.d.ts +66 -0
  6. package/dist/commands/adkEvalRunner.js +69 -0
  7. package/dist/commands/adkEvalRunner.js.map +1 -0
  8. package/dist/commands/agUiEvalRunner.d.ts +73 -0
  9. package/dist/commands/agUiEvalRunner.js +216 -0
  10. package/dist/commands/agUiEvalRunner.js.map +1 -0
  11. package/dist/commands/askCommand.d.ts +3 -2
  12. package/dist/commands/askCommand.js +26 -7
  13. package/dist/commands/askCommand.js.map +1 -1
  14. package/dist/commands/batchCommand.d.ts +78 -0
  15. package/dist/commands/batchCommand.js +245 -0
  16. package/dist/commands/batchCommand.js.map +1 -0
  17. package/dist/commands/cliOptionParsers.d.ts +12 -0
  18. package/dist/commands/cliOptionParsers.js +18 -0
  19. package/dist/commands/cliOptionParsers.js.map +1 -0
  20. package/dist/commands/commandIntrospection.d.ts +6 -6
  21. package/dist/commands/commandIntrospection.js +12 -12
  22. package/dist/commands/commandIntrospection.js.map +1 -1
  23. package/dist/commands/commandUtils.d.ts +16 -16
  24. package/dist/commands/commandUtils.js +20 -20
  25. package/dist/commands/commandUtils.js.map +1 -1
  26. package/dist/commands/configCommand.d.ts +24 -0
  27. package/dist/commands/configCommand.js +117 -0
  28. package/dist/commands/configCommand.js.map +1 -0
  29. package/dist/commands/configSetup.d.ts +1 -1
  30. package/dist/commands/configSetup.js +17 -2
  31. package/dist/commands/configSetup.js.map +1 -1
  32. package/dist/commands/evalCommand.d.ts +41 -0
  33. package/dist/commands/evalCommand.js +483 -0
  34. package/dist/commands/evalCommand.js.map +1 -0
  35. package/dist/commands/execCommand.js +4 -1
  36. package/dist/commands/execCommand.js.map +1 -1
  37. package/dist/commands/firstRunDialog.d.ts +39 -5
  38. package/dist/commands/firstRunDialog.js +72 -10
  39. package/dist/commands/firstRunDialog.js.map +1 -1
  40. package/dist/commands/getCommand.js +7 -7
  41. package/dist/commands/getCommand.js.map +1 -1
  42. package/dist/commands/historyCommand.d.ts +17 -0
  43. package/dist/commands/historyCommand.js +102 -0
  44. package/dist/commands/historyCommand.js.map +1 -0
  45. package/dist/commands/initCommand.d.ts +3 -0
  46. package/dist/commands/initCommand.js +9 -4
  47. package/dist/commands/initCommand.js.map +1 -1
  48. package/dist/commands/insightsCommand.d.ts +8 -0
  49. package/dist/commands/insightsCommand.js +32 -0
  50. package/dist/commands/insightsCommand.js.map +1 -0
  51. package/dist/commands/modelsCommand.d.ts +25 -0
  52. package/dist/commands/modelsCommand.js +96 -0
  53. package/dist/commands/modelsCommand.js.map +1 -0
  54. package/dist/commands/prCommand.js +14 -15
  55. package/dist/commands/prCommand.js.map +1 -1
  56. package/dist/commands/prDiscovery.d.ts +2 -2
  57. package/dist/commands/prDiscovery.js +27 -29
  58. package/dist/commands/prDiscovery.js.map +1 -1
  59. package/dist/commands/reviewCommand.js +15 -10
  60. package/dist/commands/reviewCommand.js.map +1 -1
  61. package/dist/commands/workflowCommand.d.ts +19 -0
  62. package/dist/commands/workflowCommand.js +77 -0
  63. package/dist/commands/workflowCommand.js.map +1 -0
  64. package/dist/helpers/jira/jiraLogWork.js.map +1 -1
  65. package/dist/modules/startSession.js +9 -7
  66. package/dist/modules/startSession.js.map +1 -1
  67. package/dist/tools/gthJiraLogWorkTool.js +3 -3
  68. package/dist/tools/gthJiraLogWorkTool.js.map +1 -1
  69. package/dist/tui/components/App.js +321 -21
  70. package/dist/tui/components/App.js.map +1 -1
  71. package/dist/tui/components/ApprovalPrompt.d.ts +18 -0
  72. package/dist/tui/components/ApprovalPrompt.js +26 -0
  73. package/dist/tui/components/ApprovalPrompt.js.map +1 -0
  74. package/dist/tui/components/DebugPanel.d.ts +29 -9
  75. package/dist/tui/components/DebugPanel.js +46 -23
  76. package/dist/tui/components/DebugPanel.js.map +1 -1
  77. package/dist/tui/components/FetchProgress.d.ts +36 -0
  78. package/dist/tui/components/FetchProgress.js +39 -0
  79. package/dist/tui/components/FetchProgress.js.map +1 -0
  80. package/dist/tui/components/LiveTurn.d.ts +26 -4
  81. package/dist/tui/components/LiveTurn.js +104 -18
  82. package/dist/tui/components/LiveTurn.js.map +1 -1
  83. package/dist/tui/components/NoticeBar.d.ts +32 -0
  84. package/dist/tui/components/NoticeBar.js +39 -0
  85. package/dist/tui/components/NoticeBar.js.map +1 -0
  86. package/dist/tui/components/PromptInput.d.ts +26 -1
  87. package/dist/tui/components/PromptInput.js +93 -7
  88. package/dist/tui/components/PromptInput.js.map +1 -1
  89. package/dist/tui/components/Rule.js.map +1 -1
  90. package/dist/tui/components/SelectList.d.ts +98 -9
  91. package/dist/tui/components/SelectList.js +209 -26
  92. package/dist/tui/components/SelectList.js.map +1 -1
  93. package/dist/tui/components/SlashCommandMenu.d.ts +20 -0
  94. package/dist/tui/components/SlashCommandMenu.js +28 -0
  95. package/dist/tui/components/SlashCommandMenu.js.map +1 -0
  96. package/dist/tui/components/StatusBar.d.ts +7 -1
  97. package/dist/tui/components/StatusBar.js +7 -3
  98. package/dist/tui/components/StatusBar.js.map +1 -1
  99. package/dist/tui/components/Transcript.js +6 -1
  100. package/dist/tui/components/Transcript.js.map +1 -1
  101. package/dist/tui/debugRender.d.ts +41 -6
  102. package/dist/tui/debugRender.js +126 -12
  103. package/dist/tui/debugRender.js.map +1 -1
  104. package/dist/tui/debugSearch.d.ts +40 -0
  105. package/dist/tui/debugSearch.js +73 -0
  106. package/dist/tui/debugSearch.js.map +1 -0
  107. package/dist/tui/markdown.js +0 -0
  108. package/dist/tui/markdown.js.map +1 -1
  109. package/dist/tui/pasteParser.d.ts +21 -0
  110. package/dist/tui/pasteParser.js +24 -0
  111. package/dist/tui/pasteParser.js.map +1 -0
  112. package/dist/tui/selectCancelled.d.ts +13 -0
  113. package/dist/tui/selectCancelled.js +17 -0
  114. package/dist/tui/selectCancelled.js.map +1 -0
  115. package/dist/tui/slashCommands.d.ts +220 -1
  116. package/dist/tui/slashCommands.js +408 -1
  117. package/dist/tui/slashCommands.js.map +1 -1
  118. package/dist/tui/tuiSessionModule.js +249 -24
  119. package/dist/tui/tuiSessionModule.js.map +1 -1
  120. package/dist/tui/types.d.ts +96 -7
  121. package/dist/tui/viewModel.d.ts +34 -0
  122. package/dist/tui/viewModel.js +67 -0
  123. package/dist/tui/viewModel.js.map +1 -1
  124. package/dist/utils/stdinPolicy.d.ts +31 -0
  125. package/dist/utils/stdinPolicy.js +37 -0
  126. package/dist/utils/stdinPolicy.js.map +1 -0
  127. package/package.json +21 -17
@@ -9,6 +9,93 @@
9
9
  * The registry is a plain array so later layers (e.g. extension-registered commands, EXT-5)
10
10
  * can append more entries via {@link createCommandRegistry} without this module changing.
11
11
  */
12
+ /**
13
+ * Build the compact, read-only `/config` summary (GS2-1): a handful of the most orienting
14
+ * resolved-config fields, one per line, with a pointer to `gth config print` for the full view.
15
+ * Pure and secret-free — it only reads non-sensitive scalar fields (never API keys / the live
16
+ * llm instance). Used by the App to fill {@link SlashCommandContext.configSummary}.
17
+ */
18
+ export function formatConfigSummary(config) {
19
+ const fmt = (v) => typeof v === 'string' ? v : Array.isArray(v) ? JSON.stringify(v) : String(v);
20
+ const lines = [];
21
+ lines.push(`Model: ${config.modelDisplayName || 'unknown'}`);
22
+ lines.push(`Agent backend: ${config.agent?.backend ?? 'lean'}`);
23
+ if (config.filesystem !== undefined)
24
+ lines.push(`Filesystem: ${fmt(config.filesystem)}`);
25
+ if (config.streamOutput !== undefined)
26
+ lines.push(`Stream output: ${config.streamOutput}`);
27
+ if (config.useColour !== undefined)
28
+ lines.push(`Colour: ${config.useColour}`);
29
+ const commandNames = config.commands ? Object.keys(config.commands) : [];
30
+ if (commandNames.length > 0)
31
+ lines.push(`Commands configured: ${commandNames.join(', ')}`);
32
+ lines.push('Run `gth config print` for the full resolved config (secrets redacted).');
33
+ return lines;
34
+ }
35
+ /**
36
+ * The `/config` notice, from the pre-rendered summary lines (or an unavailable fallback).
37
+ *
38
+ * TUI-C19 — when config-validation `warnings` are present (unknown keys / deprecated names), they
39
+ * are rendered FIRST, as the details the standing "config has problems" advisory line points at,
40
+ * then a blank spacer, then the resolved summary. A clean config (no warnings) reads exactly as
41
+ * before. Tone flips to `warn` (yellow) while there are warnings so the block reads as caution.
42
+ */
43
+ export function configNotice(summary, warnings) {
44
+ const summaryLines = summary && summary.length > 0
45
+ ? summary
46
+ : ['Configuration details are not available in this session.'];
47
+ const hasWarnings = !!warnings && warnings.length > 0;
48
+ const lines = hasWarnings
49
+ ? [
50
+ `${warnings.length === 1 ? 'Config warning' : `Config warnings (${warnings.length})`}:`,
51
+ ...warnings.map((w) => ` • ${w}`),
52
+ '',
53
+ ...summaryLines,
54
+ ]
55
+ : summaryLines;
56
+ return {
57
+ title: 'Resolved configuration',
58
+ lines,
59
+ ...(hasWarnings ? { tone: 'warn' } : {}),
60
+ };
61
+ }
62
+ /** Shared "history is unavailable" body (history off / DB missing), reused by all three commands. */
63
+ const HISTORY_UNAVAILABLE_LINES = [
64
+ 'No local session history is available in this session.',
65
+ 'Enable it with `history.enabled: true` in your gsloth config (local only, opt-in).',
66
+ ];
67
+ /** The `/history` notice (GS2-7): recent recorded sessions, or an "unavailable" fallback. */
68
+ export function historyNotice(summary) {
69
+ return {
70
+ title: 'Recent sessions',
71
+ lines: summary && summary.length > 0 ? summary : HISTORY_UNAVAILABLE_LINES,
72
+ };
73
+ }
74
+ /** The `/insights` notice (GS2-7): local analytics summary, or an "unavailable" fallback. */
75
+ export function insightsNotice(summary) {
76
+ return {
77
+ title: 'Session insights (local only)',
78
+ lines: summary && summary.length > 0 ? summary : HISTORY_UNAVAILABLE_LINES,
79
+ };
80
+ }
81
+ /**
82
+ * The `/search` notice (GS2-7). With no query it prints usage; otherwise it runs the injected
83
+ * fail-soft {@link SlashCommandContext.historySearch} provider and renders its result lines. When
84
+ * no provider is bound (no store), it reports history as unavailable.
85
+ */
86
+ export function searchNotice(args, search) {
87
+ const query = args.join(' ').trim();
88
+ if (!query) {
89
+ return {
90
+ title: 'Search session history',
91
+ lines: ['Usage: /search <terms> — full-text search across your recorded sessions.'],
92
+ };
93
+ }
94
+ if (!search) {
95
+ return { title: `Search: "${query}"`, lines: HISTORY_UNAVAILABLE_LINES };
96
+ }
97
+ return { title: `Search: "${query}"`, lines: search(query) };
98
+ }
12
99
  /**
13
100
  * Parse a raw input line into a slash command, or `null` if it is not one. A line is a slash
14
101
  * command iff its first non-whitespace character is `/`. The name is lower-cased; remaining
@@ -24,6 +111,39 @@ export function parseSlashCommand(input) {
24
111
  const [name, ...args] = tokens;
25
112
  return { name: name.toLowerCase(), args };
26
113
  }
114
+ /**
115
+ * TUI-C10 — the discovery-menu trigger test. The Ink `<PromptInput>` shows the slash-command menu
116
+ * while the user is typing a bare command: the raw input is a menu query iff its first character is
117
+ * `/` and it contains no whitespace yet (once a space is typed the user is entering args, so the
118
+ * menu closes and normal dispatch takes over). Returns the lower-cased query AFTER the slash (so a
119
+ * bare `/` yields `''` = "show everything"), or `null` when the input is not a menu trigger.
120
+ *
121
+ * Kept pure and next to the registry (like {@link parseSlashCommand}) so the menu's show/hide and
122
+ * filter logic is unit-testable without React.
123
+ */
124
+ export function slashMenuQuery(input) {
125
+ if (!/^\/\S*$/.test(input))
126
+ return null;
127
+ return input.slice(1).toLowerCase();
128
+ }
129
+ /**
130
+ * TUI-C10 — filter the registry down to the commands that match a menu query, most-relevant first.
131
+ * Prefix matches (the name starts with the query) rank above looser substring matches; within each
132
+ * bucket the registry's own order is preserved (so extension-registered commands — appended to the
133
+ * array — naturally sort after the built-ins). An empty query returns the whole registry, so a bare
134
+ * `/` lists every command including any the extensions added (never a hardcoded list).
135
+ *
136
+ * Pure: takes the registry the caller already built via {@link createCommandRegistry}, so the menu
137
+ * automatically reflects extension commands without this layer knowing they exist.
138
+ */
139
+ export function filterSlashCommands(registry, query) {
140
+ const q = query.toLowerCase();
141
+ if (!q)
142
+ return [...registry];
143
+ const prefix = registry.filter((c) => c.name.startsWith(q));
144
+ const substring = registry.filter((c) => !c.name.startsWith(q) && c.name.includes(q));
145
+ return [...prefix, ...substring];
146
+ }
27
147
  /**
28
148
  * The notice for the tool-detail toggle, given the RESULTING (post-toggle) state. Shared by the
29
149
  * `/tools` command and the Ctrl+T key handler so the copy is single-sourced (TUI-C14).
@@ -66,6 +186,172 @@ export function debugToggleNotice(visible) {
66
186
  ],
67
187
  };
68
188
  }
189
+ /**
190
+ * The notice for the `/auto-approve` toggle (EXT-12), given the RESULTING (post-apply) state.
191
+ * Shared so the command reports exactly the state the App applies. ON is rendered 'warn' (yellow)
192
+ * because it disables the approval gate for the session; OFF is 'info'.
193
+ */
194
+ export function autoApproveNotice(on) {
195
+ return on
196
+ ? {
197
+ title: 'Auto-approve ON — shell commands run without asking',
198
+ lines: [
199
+ 'run_shell_command will now execute WITHOUT the per-command approval prompt.',
200
+ 'Session-scoped only (not saved); run /auto-approve off to require approvals.',
201
+ 'The hardline safety floor still blocks catastrophic commands.',
202
+ ],
203
+ tone: 'warn',
204
+ }
205
+ : {
206
+ title: 'Auto-approve OFF — approvals required',
207
+ lines: [
208
+ 'run_shell_command will prompt for approval again before each command.',
209
+ 'Run /auto-approve (or /auto-approve on) to re-enable session-wide auto-approval.',
210
+ ],
211
+ };
212
+ }
213
+ /**
214
+ * EXT-12 — parse the `/auto-approve` argument: no arg (or `toggle`) flips; `on`/`off` (and the
215
+ * friendly synonyms `enable`/`disable`, `true`/`false`) set explicitly. Returns `null` for an
216
+ * unrecognized argument so the command can render a usage hint instead of guessing.
217
+ */
218
+ export function parseAutoApproveArg(args) {
219
+ if (args.length === 0)
220
+ return 'toggle';
221
+ const arg = args[0].toLowerCase();
222
+ if (arg === 'toggle')
223
+ return 'toggle';
224
+ if (arg === 'on' || arg === 'enable' || arg === 'true')
225
+ return 'on';
226
+ if (arg === 'off' || arg === 'disable' || arg === 'false')
227
+ return 'off';
228
+ return null;
229
+ }
230
+ /**
231
+ * TUI-C18 — resolve a `/reasoning` invocation against the committed turns' reasoning (in transcript
232
+ * order, index 0 = turn 1). Pure, so the whole selection + friendly-notice logic is unit-testable
233
+ * without React:
234
+ *
235
+ * - **no arg** → the most recent turn that actually recorded thinking; if none exists, a friendly
236
+ * info notice (nothing to show).
237
+ * - **`<n>`** → turn `n` (1-based). A non-positive / non-integer / out-of-range `n` → a warn notice;
238
+ * a valid turn that recorded no thinking → an info notice. Otherwise a `reprintReasoning` request.
239
+ *
240
+ * The App renders a `reprintReasoning` result as a fresh reasoning block (reusing the TUI-C15
241
+ * styling) and a `notice` result via the shared `CommandNotice`.
242
+ */
243
+ export function resolveReasoning(reasonings, args) {
244
+ const count = reasonings.length;
245
+ const has = (i) => (reasonings[i] ?? '').trim().length > 0;
246
+ if (args.length > 0) {
247
+ // `Number(...)` (not parseInt) so "2x"/"1.5"/"" don't silently coerce to a valid index.
248
+ const raw = args[0];
249
+ const n = Number(raw);
250
+ if (!Number.isInteger(n) || n < 1 || n > count) {
251
+ return {
252
+ notice: {
253
+ title: `No turn ${raw}`,
254
+ lines: count === 0
255
+ ? [
256
+ 'This session has no committed turns yet.',
257
+ 'Ask something first, then run /reasoning.',
258
+ ]
259
+ : [
260
+ `Pick a turn between 1 and ${count} (this session has ${count} so far).`,
261
+ 'Run /reasoning with no number for the most recent turn that recorded thinking.',
262
+ ],
263
+ tone: 'warn',
264
+ },
265
+ };
266
+ }
267
+ const idx = n - 1;
268
+ if (!has(idx)) {
269
+ return {
270
+ notice: {
271
+ title: `Turn ${n} has no thinking`,
272
+ lines: [
273
+ `Turn ${n} didn't record a thinking layer (only some models stream one).`,
274
+ 'Run /reasoning (no number) to jump to the most recent turn that did.',
275
+ ],
276
+ },
277
+ };
278
+ }
279
+ return { reprintReasoning: { reasoning: reasonings[idx], turnNumber: n } };
280
+ }
281
+ // No arg: walk back to the most recent turn that recorded thinking.
282
+ for (let i = count - 1; i >= 0; i--) {
283
+ if (has(i))
284
+ return { reprintReasoning: { reasoning: reasonings[i], turnNumber: i + 1 } };
285
+ }
286
+ return {
287
+ notice: {
288
+ title: 'No thinking to show',
289
+ lines: [
290
+ 'No turn in this session has recorded a thinking layer yet.',
291
+ 'Reasoning appears for models that stream a thinking / chain-of-thought layer.',
292
+ ],
293
+ },
294
+ };
295
+ }
296
+ /** `/debug-dump` when no `dumpDebugSession` writer is injected (fixture agent / no session state). */
297
+ const DEBUG_DUMP_UNAVAILABLE_LINES = [
298
+ 'No debug-dump writer is available in this session.',
299
+ 'This is only available in a real session (not the fixture/demo agent).',
300
+ ];
301
+ /**
302
+ * GS2-47 — resolve whether the `/debug-dump` archive should be redacted. ON by default; opt out via
303
+ * the config (`debugDump.redact: false`) OR the `--unsafe-no-redact` command flag. Any uncertainty
304
+ * (no/non-object config) defaults to redacting — fail safe. `resolvedConfig` is opaque here, so this
305
+ * reads the flag structurally without depending on the `GthConfig` type.
306
+ */
307
+ export function resolveDebugDumpRedact(resolvedConfig, args) {
308
+ if (args.some((a) => a === '--unsafe-no-redact' || a === '--no-redact'))
309
+ return false;
310
+ const debugDump = resolvedConfig?.debugDump;
311
+ if (debugDump &&
312
+ typeof debugDump === 'object' &&
313
+ debugDump.redact === false) {
314
+ return false;
315
+ }
316
+ return true;
317
+ }
318
+ /**
319
+ * The `/debug-dump` success notice (a standard 3-line CommandNotice — DL-1: no command reads as
320
+ * "does nothing"). GS2-47 flips the default to REDACTED: when redaction ran (the default) the note
321
+ * is softened ("secrets redacted; review before sharing") and points at the opt-out. When the user
322
+ * opted OUT (raw archive) it is the loud, impossible-to-miss UNSANITIZED warning. Colour follows
323
+ * DL-8 / the tone rule in maintenance/ux-guidelines.md: the safe, redacted default is normal
324
+ * feedback (no `tone` ⇒ info), while the raw opt-out is caution and so `tone: 'warn'` (yellow) —
325
+ * mirroring how `autoApproveNotice` reserves yellow for the dangerous (gate-off) state. Redaction is
326
+ * best-effort pattern-based, so even the softened note still says review-before-sharing.
327
+ */
328
+ export function debugDumpNotice(archiveDir, redacted) {
329
+ if (redacted) {
330
+ return {
331
+ title: 'Debug dump written — secrets redacted',
332
+ lines: [
333
+ `Archive: ${archiveDir}`,
334
+ '',
335
+ 'Secrets were redacted (API keys, tokens and auth headers replaced with <redacted>).',
336
+ 'Redaction is best-effort and pattern-based — review before sharing.',
337
+ '',
338
+ 'To write a raw, unredacted archive: set `debugDump.redact: false` in your gsloth config,',
339
+ 'or run `/debug-dump --unsafe-no-redact`.',
340
+ ],
341
+ };
342
+ }
343
+ return {
344
+ title: '⚠️ Debug dump written — UNSANITIZED, review before sharing',
345
+ lines: [
346
+ `Archive: ${archiveDir}`,
347
+ '',
348
+ 'This archive contains the full transcript, resolved config, env info, debug log and git',
349
+ 'state AS-IS — it may include secrets: API keys, tokens, file contents, env vars.',
350
+ 'Review it carefully before sending it anywhere.',
351
+ ],
352
+ tone: 'warn',
353
+ };
354
+ }
69
355
  /**
70
356
  * Build the default command registry. Returns a fresh array each call so callers may push
71
357
  * extension commands onto it (EXT-5) without sharing mutable module state.
@@ -89,15 +375,48 @@ export function createCommandRegistry() {
89
375
  {
90
376
  name: 'debug',
91
377
  description: 'Toggle the docked subagents + debug panel',
378
+ availableDuringRun: true,
92
379
  // State-aware: report the notice for the state the toggle will land on (the inverse of now).
93
380
  run: (ctx) => ({ toggleDebug: true, notice: debugToggleNotice(!ctx.debugVisible) }),
94
381
  },
95
382
  {
96
383
  name: 'tools',
97
384
  description: 'Toggle tool-call detail (collapsed summary ⇄ expanded args/result)',
385
+ availableDuringRun: true,
98
386
  // State-aware: report the notice for the state the toggle will land on (the inverse of now).
99
387
  run: (ctx) => ({ toggleTools: true, notice: toolsToggleNotice(!ctx.toolsExpanded) }),
100
388
  },
389
+ {
390
+ name: 'auto-approve',
391
+ description: 'Auto-approve shell commands this session (/auto-approve on|off; no arg toggles)',
392
+ // Available mid-turn so the user can stop being prompted for the run's remaining tool calls
393
+ // (EXT-12). The App owns the runner flag, so it applies the change and commits the notice for
394
+ // the landed state (the command can't read the flag here).
395
+ availableDuringRun: true,
396
+ run: (_ctx, args) => {
397
+ const action = parseAutoApproveArg(args);
398
+ if (action === null) {
399
+ return {
400
+ notice: {
401
+ title: `Unknown option: ${args[0]}`,
402
+ lines: [
403
+ 'Usage: /auto-approve [on|off] — with no argument it toggles.',
404
+ 'When ON, shell commands run this session without the per-command prompt.',
405
+ ],
406
+ tone: 'warn',
407
+ },
408
+ };
409
+ }
410
+ return { autoApprove: action };
411
+ },
412
+ },
413
+ {
414
+ name: 'yolo',
415
+ description: 'Alias for /auto-approve (toggles session-wide shell auto-approval)',
416
+ availableDuringRun: true,
417
+ // Back-compat alias: a bare toggle, routed through the same auto-approve apply path. EXT-12.
418
+ run: () => ({ autoApprove: 'toggle' }),
419
+ },
101
420
  {
102
421
  name: 'exit',
103
422
  description: 'Quit the session',
@@ -106,6 +425,7 @@ export function createCommandRegistry() {
106
425
  {
107
426
  name: 'mode',
108
427
  description: 'Show the current session mode',
428
+ availableDuringRun: true,
109
429
  run: (ctx) => ({
110
430
  notice: {
111
431
  title: `Session mode: ${ctx.mode}`,
@@ -116,9 +436,40 @@ export function createCommandRegistry() {
116
436
  },
117
437
  }),
118
438
  },
439
+ {
440
+ name: 'config',
441
+ description: 'Show the resolved configuration (read-only)',
442
+ availableDuringRun: true,
443
+ // Read-only discovery: surface the pre-rendered, secret-free summary the App computed from
444
+ // the resolved config, prefixed with any load-time validation warnings (TUI-C19 — the
445
+ // details the standing advisory line points at). Editing lives in `gth init` / the config
446
+ // file, not here (GS2-1).
447
+ run: (ctx) => ({ notice: configNotice(ctx.configSummary, ctx.configWarnings) }),
448
+ },
449
+ {
450
+ name: 'history',
451
+ description: 'Show recent recorded sessions (local, opt-in history)',
452
+ availableDuringRun: true,
453
+ // Read-only discovery, mirroring /config: render the App's fail-soft, pre-built summary.
454
+ run: (ctx) => ({ notice: historyNotice(ctx.historySummary) }),
455
+ },
456
+ {
457
+ name: 'search',
458
+ description: 'Search recorded session history (/search <terms>)',
459
+ availableDuringRun: true,
460
+ // Dynamic query, so it calls the App-injected fail-soft search provider (stubbable in tests).
461
+ run: (ctx, args) => ({ notice: searchNotice(args, ctx.historySearch) }),
462
+ },
463
+ {
464
+ name: 'insights',
465
+ description: 'Show local analytics over recorded sessions (tokens, cost, top tools)',
466
+ availableDuringRun: true,
467
+ run: (ctx) => ({ notice: insightsNotice(ctx.insightsSummary) }),
468
+ },
119
469
  {
120
470
  name: 'model',
121
471
  description: 'Show the current model / provider',
472
+ availableDuringRun: true,
122
473
  run: (ctx) => ({
123
474
  notice: {
124
475
  title: `Model: ${ctx.modelDisplayName || 'unknown'}`,
@@ -129,6 +480,45 @@ export function createCommandRegistry() {
129
480
  },
130
481
  }),
131
482
  },
483
+ {
484
+ name: 'reasoning',
485
+ description: "Reprint a turn's thinking (/reasoning [n]; no number = latest with thinking)",
486
+ // Read-only recall of a past turn's thinking — safe to run mid-turn, like /history and /config.
487
+ availableDuringRun: true,
488
+ // Pure: resolve the target from the App-provided committed reasonings; the App renders the
489
+ // reprint (reusing TUI-C15 styling) or the friendly notice.
490
+ run: (ctx, args) => resolveReasoning(ctx.turnReasonings ?? [], args),
491
+ },
492
+ {
493
+ name: 'debug-dump',
494
+ description: 'Dump transcript + config + env + debug log to ~/.gsloth/debug-dumps (secrets redacted; --unsafe-no-redact keeps raw)',
495
+ // Read-only from the transcript/thread's perspective (it only writes a diagnostic archive,
496
+ // never mutates session state), so it's useful precisely when something is going wrong
497
+ // mid-turn — mirrors /history, /config, /debug being availableDuringRun.
498
+ availableDuringRun: true,
499
+ run: (ctx, args) => {
500
+ if (!ctx.dumpDebugSession) {
501
+ return {
502
+ notice: {
503
+ title: 'Debug dump unavailable',
504
+ lines: DEBUG_DUMP_UNAVAILABLE_LINES,
505
+ tone: 'warn',
506
+ },
507
+ };
508
+ }
509
+ // GS2-47 — redact by default; opt out via config `debugDump.redact: false` or the
510
+ // `--unsafe-no-redact` flag. The resolved flag is threaded into the writer AND picks the
511
+ // notice (softened when redacted, loud "unsanitized" warning when raw).
512
+ const redact = resolveDebugDumpRedact(ctx.resolvedConfig, args);
513
+ const { archiveDir } = ctx.dumpDebugSession({
514
+ transcript: ctx.transcript ?? [],
515
+ config: ctx.resolvedConfig,
516
+ modelDisplayName: ctx.modelDisplayName,
517
+ redact,
518
+ });
519
+ return { notice: debugDumpNotice(archiveDir, redact) };
520
+ },
521
+ },
132
522
  ];
133
523
  }
134
524
  /** Build the `/help` notice from a registry: one body line per command (`/name — description`). */
@@ -142,8 +532,13 @@ export function formatHelp(registry) {
142
532
  * Dispatch a parsed command against a registry. Unknown commands return a friendly hint
143
533
  * rather than throwing, so the component can render it as a system line and never forward
144
534
  * the text to the model.
535
+ *
536
+ * EXT-12 — when `options.duringRun` is set (a turn is streaming), commands that are not marked
537
+ * {@link SlashCommand.availableDuringRun} are refused with a friendly notice rather than run,
538
+ * so mid-turn input can only reach the safe, non-mutating commands (`/auto-approve`, `/tools`,
539
+ * `/debug`, …). `/help` is always allowed.
145
540
  */
146
- export function dispatchSlashCommand(parsed, registry, ctx) {
541
+ export function dispatchSlashCommand(parsed, registry, ctx, options = {}) {
147
542
  if (parsed.name === 'help') {
148
543
  return { notice: formatHelp(registry) };
149
544
  }
@@ -157,6 +552,18 @@ export function dispatchSlashCommand(parsed, registry, ctx) {
157
552
  },
158
553
  };
159
554
  }
555
+ if (options.duringRun && !command.availableDuringRun) {
556
+ return {
557
+ notice: {
558
+ title: `/${command.name} is not available while the agent is working`,
559
+ lines: [
560
+ 'Wait for the current turn to finish, then run it again.',
561
+ 'Commands like /auto-approve, /tools and /debug do work mid-turn.',
562
+ ],
563
+ tone: 'warn',
564
+ },
565
+ };
566
+ }
160
567
  return command.run(ctx, parsed.args);
161
568
  }
162
569
  //# sourceMappingURL=slashCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/tui/slashComm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