@gaunt-sloth/agent 2.0.0-alpha.23 → 2.0.0-alpha.25

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 (56) hide show
  1. package/README.md +73 -24
  2. package/dist/core/GthDeepAgent.d.ts +3 -3
  3. package/dist/core/GthDeepAgent.js +82 -35
  4. package/dist/core/GthDeepAgent.js.map +1 -1
  5. package/dist/core/debugCapture.d.ts +1 -1
  6. package/dist/core/debugCapture.js.map +1 -1
  7. package/dist/core/subagentProfiles.d.ts +50 -0
  8. package/dist/core/subagentProfiles.js +81 -0
  9. package/dist/core/subagentProfiles.js.map +1 -0
  10. package/dist/middleware/binaryContentInjectionMiddleware.d.ts +8 -1
  11. package/dist/middleware/binaryContentInjectionMiddleware.js +11 -2
  12. package/dist/middleware/binaryContentInjectionMiddleware.js.map +1 -1
  13. package/dist/middleware/frontendImageInjectionMiddleware.d.ts +80 -0
  14. package/dist/middleware/frontendImageInjectionMiddleware.js +146 -0
  15. package/dist/middleware/frontendImageInjectionMiddleware.js.map +1 -0
  16. package/dist/middleware/registry.js +36 -1
  17. package/dist/middleware/registry.js.map +1 -1
  18. package/dist/middleware/types.d.ts +16 -2
  19. package/dist/modules/a2a/A2AClientWrapper.d.ts +15 -6
  20. package/dist/modules/a2a/A2AClientWrapper.js +93 -64
  21. package/dist/modules/a2a/A2AClientWrapper.js.map +1 -1
  22. package/dist/modules/apiAgUiModule.d.ts +68 -0
  23. package/dist/modules/apiAgUiModule.js +95 -4
  24. package/dist/modules/apiAgUiModule.js.map +1 -1
  25. package/dist/modules/interactiveSessionModule.js +199 -43
  26. package/dist/modules/interactiveSessionModule.js.map +1 -1
  27. package/dist/modules/slashCommands.d.ts +467 -0
  28. package/dist/modules/slashCommands.js +888 -0
  29. package/dist/modules/slashCommands.js.map +1 -0
  30. package/dist/resolvers.js +15 -0
  31. package/dist/resolvers.js.map +1 -1
  32. package/dist/tools/GthCustomToolkit.js +72 -3
  33. package/dist/tools/GthCustomToolkit.js.map +1 -1
  34. package/dist/tools/GthDevToolkit.d.ts +6 -3
  35. package/dist/tools/GthDevToolkit.js +31 -11
  36. package/dist/tools/GthDevToolkit.js.map +1 -1
  37. package/dist/tools/GthFileSystemToolkit.d.ts +16 -0
  38. package/dist/tools/GthFileSystemToolkit.js +218 -110
  39. package/dist/tools/GthFileSystemToolkit.js.map +1 -1
  40. package/dist/tools/McpResourceTool.d.ts +31 -0
  41. package/dist/tools/McpResourceTool.js +106 -0
  42. package/dist/tools/McpResourceTool.js.map +1 -0
  43. package/dist/tools/shell/env.js +1 -1
  44. package/dist/tools/shell/hardline.d.ts +33 -2
  45. package/dist/tools/shell/hardline.js +525 -40
  46. package/dist/tools/shell/hardline.js.map +1 -1
  47. package/package.json +8 -8
  48. package/dist/tools/shell/allowlist.d.ts +0 -11
  49. package/dist/tools/shell/allowlist.js +0 -12
  50. package/dist/tools/shell/allowlist.js.map +0 -1
  51. package/dist/tools/shell/arity.d.ts +0 -11
  52. package/dist/tools/shell/arity.js +0 -12
  53. package/dist/tools/shell/arity.js.map +0 -1
  54. package/dist/tools/shell/normalize.d.ts +0 -10
  55. package/dist/tools/shell/normalize.js +0 -11
  56. package/dist/tools/shell/normalize.js.map +0 -1
@@ -1,2 +1,70 @@
1
1
  import { GthConfig } from '@gaunt-sloth/core/config.js';
2
+ import type { BaseMessage } from '@langchain/core/messages';
3
+ /** An AG-UI wire message as received on the run input (the shape {@link convertMessage} accepts). */
4
+ type AgUiWireMessage = {
5
+ role: string;
6
+ content?: string;
7
+ id: string;
8
+ toolCalls?: Array<{
9
+ id: string;
10
+ type: string;
11
+ function: {
12
+ name: string;
13
+ arguments: string;
14
+ };
15
+ }>;
16
+ toolCallId?: string;
17
+ };
18
+ /** Per-message options for {@link convertMessage}. */
19
+ interface ConvertMessageOptions {
20
+ /**
21
+ * Whether an assistant text-emitted tool call may be PROMOTED to a native tool_call for this
22
+ * message. Defaults to `true` (the EXT-35 behaviour). {@link convertMessages} sets this to `false`
23
+ * for a DANGLING history call (one not followed by its tool result) so a stalled replayed call
24
+ * stays plain text — see EXT-43 and that function's doc.
25
+ */
26
+ allowTextCallPromotion?: boolean;
27
+ }
28
+ /**
29
+ * Convert AG-UI message format to LangChain BaseMessage.
30
+ *
31
+ * `allowedToolNames` is the set of tool names bound to this run (config.tools + any run-input
32
+ * client tools). It gates EXT-35 plain-text tool-call repair on the assistant branch: an incoming
33
+ * assistant message with NO native `toolCalls` whose content is a STANDALONE text-emitted call
34
+ * (bracket / `<function=…>` / Harmony — the dialects small/local models produce) is promoted to a
35
+ * native tool_call so a replayed history turn is a real tool call rather than inert prose. An empty
36
+ * (or absent) allow-list promotes nothing — the prose-safe default. This runs alongside
37
+ * {@link parseToolArguments} (which rescues malformed args on an ALREADY-native tool_call).
38
+ *
39
+ * EXT-43: `options.allowTextCallPromotion` (default `true`) lets a caller suppress promotion for a
40
+ * single message; {@link convertMessages} uses it to leave a DANGLING history call as text.
41
+ */
42
+ export declare function convertMessage(msg: AgUiWireMessage, allowedToolNames?: Set<string>, options?: ConvertMessageOptions): BaseMessage;
43
+ /**
44
+ * Convert a whole AG-UI history array to LangChain messages, applying TWO symmetric replay guards
45
+ * so a poisoned history can never abort every subsequent turn on the thread.
46
+ *
47
+ * EXT-43 (forward, dangling-CALL): EXT-35's per-message promotion is unconditional, which is correct
48
+ * for a call that WILL be executed this turn. But when replaying HISTORY, promoting a STALLED text
49
+ * call (one the client recorded but that never ran) yields an `AIMessage` with `tool_calls` and NO
50
+ * following `tool_result` — a shape a strict provider (Anthropic) 400s on, where the pre-EXT-35
51
+ * plain text was valid. So promotion is allowed ONLY when the assistant message is immediately
52
+ * followed by a `tool` result message; a dangling call stays plain text (`allowTextCallPromotion:
53
+ * false`).
54
+ *
55
+ * RC-18 (backward, orphan-RESULT): the mirror image. A replayed `role:'tool'` message whose matching
56
+ * `tool_call` id is absent from EVERY PRECEDING assistant message is an ORPHAN — converting it to a
57
+ * `ToolMessage` yields a tool result with no preceding `AIMessage.tool_calls`, which the same strict
58
+ * provider 400s on (`Invalid parameter: messages with role 'tool' must be a response to a preceding
59
+ * message with 'tool_calls'`, INVALID_TOOL_RESULTS). Such orphans arise when a terminal
60
+ * (`returnDirect`) tool call's result is reconstructed by the client without its parenting assistant
61
+ * `tool_call`. We DROP the orphan (match on tool_call_id, NOT adjacency; keep genuine pairs; do NOT
62
+ * fabricate a synthetic call — mirroring EXT-43's demote-don't-invent spirit). Ids are accumulated
63
+ * in iteration order, so a result whose matching call appears only LATER is still an orphan.
64
+ *
65
+ * The live middleware path (`GthLangChainAgent`, fixing the CURRENT turn) is unaffected — both
66
+ * guards are history-replay only.
67
+ */
68
+ export declare function convertMessages(messages: AgUiWireMessage[], allowedToolNames?: Set<string>): BaseMessage[];
2
69
  export declare function startAgUiServer(config: GthConfig, port: number): Promise<void>;
70
+ export {};
@@ -6,6 +6,7 @@ import { GthDeepAgent } from '#src/core/GthDeepAgent.js';
6
6
  import { GthLangChainAgent } from '@gaunt-sloth/core/core/GthLangChainAgent.js';
7
7
  import { defaultStatusCallback, displayInfo, displayWarning, } from '@gaunt-sloth/core/utils/consoleUtils.js';
8
8
  import { getNewRunnableConfig } from '@gaunt-sloth/core/utils/llmUtils.js';
9
+ import { textToNativeToolCalls } from '@gaunt-sloth/core/core/toolCallRepair/index.js';
9
10
  import { HumanMessage, AIMessage, SystemMessage, ToolMessage } from '@langchain/core/messages';
10
11
  import { MemorySaver } from '@langchain/langgraph';
11
12
  import { tool } from '@langchain/core/tools';
@@ -97,9 +98,20 @@ function parseToolArguments(raw, toolName) {
97
98
  }
98
99
  }
99
100
  /**
100
- * Convert AG-UI message format to LangChain BaseMessage
101
+ * Convert AG-UI message format to LangChain BaseMessage.
102
+ *
103
+ * `allowedToolNames` is the set of tool names bound to this run (config.tools + any run-input
104
+ * client tools). It gates EXT-35 plain-text tool-call repair on the assistant branch: an incoming
105
+ * assistant message with NO native `toolCalls` whose content is a STANDALONE text-emitted call
106
+ * (bracket / `<function=…>` / Harmony — the dialects small/local models produce) is promoted to a
107
+ * native tool_call so a replayed history turn is a real tool call rather than inert prose. An empty
108
+ * (or absent) allow-list promotes nothing — the prose-safe default. This runs alongside
109
+ * {@link parseToolArguments} (which rescues malformed args on an ALREADY-native tool_call).
110
+ *
111
+ * EXT-43: `options.allowTextCallPromotion` (default `true`) lets a caller suppress promotion for a
112
+ * single message; {@link convertMessages} uses it to leave a DANGLING history call as text.
101
113
  */
102
- function convertMessage(msg) {
114
+ export function convertMessage(msg, allowedToolNames, options) {
103
115
  const content = typeof msg.content === 'string' ? msg.content : '';
104
116
  switch (msg.role) {
105
117
  case 'user':
@@ -116,6 +128,17 @@ function convertMessage(msg) {
116
128
  })),
117
129
  });
118
130
  }
131
+ // EXT-35: no native tool_calls — a small/local model may have emitted the call as assistant
132
+ // TEXT. Promote a standalone text-emitted call (gated by the bound-tool allow-list + payload
133
+ // cap + standalone-only) to a native tool_call; otherwise fall through to plain text.
134
+ // EXT-43: `allowTextCallPromotion === false` (a dangling history call) short-circuits the
135
+ // promotion so the message stays plain text.
136
+ const repairedToolCalls = options?.allowTextCallPromotion !== false && allowedToolNames && allowedToolNames.size > 0
137
+ ? textToNativeToolCalls(content, { allowedToolNames })
138
+ : undefined;
139
+ if (repairedToolCalls) {
140
+ return new AIMessage({ content: '', tool_calls: repairedToolCalls });
141
+ }
119
142
  return new AIMessage(content);
120
143
  }
121
144
  case 'system':
@@ -127,6 +150,65 @@ function convertMessage(msg) {
127
150
  return new HumanMessage(content);
128
151
  }
129
152
  }
153
+ /**
154
+ * Convert a whole AG-UI history array to LangChain messages, applying TWO symmetric replay guards
155
+ * so a poisoned history can never abort every subsequent turn on the thread.
156
+ *
157
+ * EXT-43 (forward, dangling-CALL): EXT-35's per-message promotion is unconditional, which is correct
158
+ * for a call that WILL be executed this turn. But when replaying HISTORY, promoting a STALLED text
159
+ * call (one the client recorded but that never ran) yields an `AIMessage` with `tool_calls` and NO
160
+ * following `tool_result` — a shape a strict provider (Anthropic) 400s on, where the pre-EXT-35
161
+ * plain text was valid. So promotion is allowed ONLY when the assistant message is immediately
162
+ * followed by a `tool` result message; a dangling call stays plain text (`allowTextCallPromotion:
163
+ * false`).
164
+ *
165
+ * RC-18 (backward, orphan-RESULT): the mirror image. A replayed `role:'tool'` message whose matching
166
+ * `tool_call` id is absent from EVERY PRECEDING assistant message is an ORPHAN — converting it to a
167
+ * `ToolMessage` yields a tool result with no preceding `AIMessage.tool_calls`, which the same strict
168
+ * provider 400s on (`Invalid parameter: messages with role 'tool' must be a response to a preceding
169
+ * message with 'tool_calls'`, INVALID_TOOL_RESULTS). Such orphans arise when a terminal
170
+ * (`returnDirect`) tool call's result is reconstructed by the client without its parenting assistant
171
+ * `tool_call`. We DROP the orphan (match on tool_call_id, NOT adjacency; keep genuine pairs; do NOT
172
+ * fabricate a synthetic call — mirroring EXT-43's demote-don't-invent spirit). Ids are accumulated
173
+ * in iteration order, so a result whose matching call appears only LATER is still an orphan.
174
+ *
175
+ * The live middleware path (`GthLangChainAgent`, fixing the CURRENT turn) is unaffected — both
176
+ * guards are history-replay only.
177
+ */
178
+ export function convertMessages(messages, allowedToolNames) {
179
+ // Ids of tool calls emitted by PRECEDING assistant messages, accumulated as we iterate in order.
180
+ // A `tool` result whose tool_call_id is not yet in this set has no preceding assistant tool_call.
181
+ const seenToolCallIds = new Set();
182
+ const converted = [];
183
+ messages.forEach((msg, index) => {
184
+ // RC-18 backward orphan-RESULT guard.
185
+ if (msg.role === 'tool') {
186
+ const toolCallId = msg.toolCallId || msg.id;
187
+ if (!seenToolCallIds.has(toolCallId)) {
188
+ displayWarning(`Dropping orphan tool result (tool_call_id ${JSON.stringify(toolCallId)}) with no ` +
189
+ 'preceding assistant tool_call in the replayed history; converting it would 400 the ' +
190
+ 'provider (INVALID_TOOL_RESULTS).');
191
+ return; // drop — do not convert to a ToolMessage
192
+ }
193
+ converted.push(convertMessage(msg, allowedToolNames));
194
+ return;
195
+ }
196
+ // Record this assistant's native tool_call ids BEFORE any following tool result is checked, so
197
+ // a genuine call→result pair (id present on a preceding assistant) survives the guard above.
198
+ if (msg.role === 'assistant' && msg.toolCalls) {
199
+ for (const tc of msg.toolCalls) {
200
+ if (tc?.id)
201
+ seenToolCallIds.add(tc.id);
202
+ }
203
+ }
204
+ // EXT-43 forward dangling-CALL guard (PRESERVED, unchanged).
205
+ const followedByToolResult = messages[index + 1]?.role === 'tool';
206
+ converted.push(convertMessage(msg, allowedToolNames, {
207
+ allowTextCallPromotion: followedByToolResult,
208
+ }));
209
+ });
210
+ return converted;
211
+ }
130
212
  /**
131
213
  * Construct the AG-UI agent for the configured backend (B5).
132
214
  * - `agent.backend: 'deep'` → {@link GthDeepAgent} (deepagents runtime, experimental).
@@ -215,6 +297,13 @@ export async function startAgUiServer(config, port) {
215
297
  // the server's statically-configured agent.
216
298
  const hasClientTools = Array.isArray(tools) && tools.length > 0;
217
299
  const activeAgent = hasClientTools ? await getAgentForTools(tools) : agent;
300
+ // EXT-35: the names of the tools bound to THIS run (server config.tools + any run-input client
301
+ // tools) — the allow-list for plain-text tool-call repair in convertMessage. Only a text-emitted
302
+ // call naming one of these is promoted to a native tool_call; an empty set promotes nothing.
303
+ const allowedToolNames = new Set([
304
+ ...(config.tools ?? []).map((t) => t?.name),
305
+ ...(hasClientTools ? tools.map((t) => t.name) : []),
306
+ ].filter((name) => Boolean(name)));
218
307
  const encoder = new EventEncoder({ accept: req.headers.accept });
219
308
  res.setHeader('Content-Type', encoder.getContentType());
220
309
  res.setHeader('Cache-Control', 'no-cache');
@@ -290,7 +379,7 @@ export async function startAgUiServer(config, port) {
290
379
  ? queued
291
380
  .map((s) => typeof s === 'string'
292
381
  ? new HumanMessage(s)
293
- : convertMessage(s))
382
+ : convertMessage(s, allowedToolNames))
294
383
  .filter((m) => Boolean(m))
295
384
  : [];
296
385
  eventStream = activeAgent.streamWithEventsResume(forwardedProps.command.resume, runConfig, queuedMessages, ac.signal);
@@ -299,7 +388,9 @@ export async function startAgUiServer(config, port) {
299
388
  // The system prompt (backstory + guidelines + mode prompt + identity) lives in the
300
389
  // deep-agent graph via createDeepAgent({ systemPrompt }) — see GthDeepAgent — so it is no
301
390
  // longer prepended here. A separate, non-first SystemMessage would be rejected by Anthropic.
302
- const langChainMessages = (messages || []).map(convertMessage);
391
+ // EXT-43: convertMessages (not a bare map) applies the dangling-call guard so a stalled
392
+ // text call replayed in history is not promoted to a native tool_call with no result.
393
+ const langChainMessages = convertMessages((messages || []), allowedToolNames);
303
394
  eventStream = activeAgent.streamWithEvents(langChainMessages, runConfig, ac.signal);
304
395
  }
305
396
  for await (const event of eventStream) {
@@ -1 +1 @@
1
- {"version":3,"file":"apiAgUiModule.js","sourceRoot":"","sources":["../../src/modules/apiAgUiModule.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,cAAc,GACf,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAapD;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,CAAe;IAC1C,MAAM,IAAI,GAAG,IAAI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M,CAAC,gBAAgB,IAAI,GAAG,EAAE,KAAK,IAAI,IAAI;SACrD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACpB,WAAW,CAAC,8CAA8C,IAAI,EAAE,CAAC,CAAC;YAClE,WAAW,CAAC,yCAAyC,IAAI,uBAAuB,CAAC,CAAC;YAClF,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,13 +1,18 @@
1
1
  import { initConfig } from '@gaunt-sloth/core/config.js';
2
- import { defaultStatusCallback, display, displayInfo, displayWarning, flushSessionLog, formatInputPrompt, initSessionLogging, stopSessionLogging, } from '@gaunt-sloth/core/utils/consoleUtils.js';
2
+ import { defaultStatusCallback, display, displayInfo, displayLaunchBanner, displayWarning, flushSessionLog, formatInputPrompt, initSessionLogging, stopSessionLogging, } from '@gaunt-sloth/core/utils/consoleUtils.js';
3
3
  import { GthAgentRunner } from '@gaunt-sloth/core/core/GthAgentRunner.js';
4
+ import { GthAbstractAgent } from '@gaunt-sloth/core/core/GthAbstractAgent.js';
5
+ import { launchBannerFields, launchBannerText } from '@gaunt-sloth/core/core/launchBanner.js';
6
+ import { buildRejectionMessage } from '@gaunt-sloth/core/core/shell/rejection.js';
7
+ import { writeDebugDump } from '@gaunt-sloth/core/utils/debugDump.js';
4
8
  import { appendToFile, getCommandOutputFilePath } from '@gaunt-sloth/core/utils/fileUtils.js';
5
9
  import { openConversationSafe, recordSessionSafe, } from '@gaunt-sloth/core/history/recordSession.js';
6
- import { createInterface, error, exit, getProjectDir, refStdin, setRawMode, stdin as input, stdout as output, } from '@gaunt-sloth/core/utils/systemUtils.js';
10
+ import { createInterface, error, exit, getProjectDir, getUseColour, refStdin, setRawMode, stdin as input, stdout as output, } from '@gaunt-sloth/core/utils/systemUtils.js';
7
11
  import { HumanMessage } from '@langchain/core/messages';
8
12
  import { MemorySaver } from '@langchain/langgraph';
9
13
  import { createResolvers } from '#src/resolvers.js';
10
14
  import { resolveAgentFactory } from '#src/core/resolveAgentFactory.js';
15
+ import { approvalsRungNotice, approvalsStatusNotice, approvalsTrustNotice, createCommandRegistry, dispatchSlashCommand, formatConfigSummary, parseSlashCommand, } from '#src/modules/slashCommands.js';
11
16
  export async function createInteractiveSession(sessionConfig, commandLineConfigOverrides, message) {
12
17
  const config = { ...(await initConfig(commandLineConfigOverrides)) };
13
18
  const checkpointSaver = new MemorySaver();
@@ -33,6 +38,27 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
33
38
  await runner.init(sessionConfig.mode, config, checkpointSaver);
34
39
  const rl = createInterface({ input, output });
35
40
  let shouldExit = false;
41
+ // GS2-8 — the readline surface shares the SAME command registry as the Ink TUI (one source
42
+ // of truth): every registered command parses, appears in /help, and dispatches here too.
43
+ const registry = createCommandRegistry();
44
+ // Committed-turn counter for the /status command (mirrors the TUI's status-bar counter).
45
+ let turnCount = 0;
46
+ // GS2-56 — wire `/debug-dump` on the readline (`--no-tui`) surface too. Previously this surface
47
+ // injected no writer, so `/debug-dump` reported itself "unavailable" here; it now forwards to the
48
+ // same core writer the TUI uses AND threads the agent's always-on last-model-request snapshot
49
+ // (read at CALL time from the live agent), so the archive carries the full model input even
50
+ // though this surface keeps no on-screen transcript. Fail-soft: no agent handle ⇒ the snapshot is
51
+ // simply omitted (the other artifacts still write). `redact` is resolved by the shared command.
52
+ const dumpDebugSession = (dumpInput) => {
53
+ const agent = runner.getAgent();
54
+ return writeDebugDump({
55
+ transcript: dumpInput.transcript,
56
+ config: dumpInput.config,
57
+ modelDisplayName: dumpInput.modelDisplayName,
58
+ redact: dumpInput.redact,
59
+ modelRequest: agent instanceof GthAbstractAgent ? agent.lastModelRequest : undefined,
60
+ });
61
+ };
36
62
  // EXT-18: ref stdin before every rl.question() that can run AFTER an agent turn/stream end.
37
63
  // When a run suspends (tool-approval interrupt) or throws, the stream's finally calls
38
64
  // stopWaitingForEscape(), which unref's stdin so one-shot commands can exit. A prompt that
@@ -60,10 +86,28 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
60
86
  : JSON.stringify(pending.args);
61
87
  displayWarning(`\nThe agent wants to run a shell command via ${pending.name}:`);
62
88
  display(`\n ${commandText}\n`);
63
- // EXT-10: if the LLM-as-judge gate escalated (rather than auto-approving) this command, show
64
- // its flag + reason before the human decides.
89
+ // CFG-27: when the auto-rater escalated this command (rather than approving it), show its
90
+ // outcome + reason before the human decides. §6 makes that explanation mandatory whenever a
91
+ // rating exists; at the unrated rungs there is none and the prompt shows the command alone.
65
92
  if (pending.safetyVerdict) {
66
- displayWarning(`⚠ safety judge (${pending.safetyVerdict.risk}): ${pending.safetyVerdict.reason}`);
93
+ displayWarning(`⚠ Auto-rater (${pending.safetyVerdict.outcome}): ${pending.safetyVerdict.reason}`);
94
+ }
95
+ // EXT-71 §3.2 — when a declared `approvals.escalate` entry is what brought this call here,
96
+ // the prompt shows THE ENTRY THAT FIRED. Without it the user is asked about a command their
97
+ // rung would have approved, with nothing on screen tying the question to the line they wrote
98
+ // — which reads as the gate malfunctioning rather than as their own rule working.
99
+ if (pending.escalatedBy) {
100
+ displayWarning(`⚠ Your approvals.escalate list matched this call: ${pending.escalatedBy}`);
101
+ }
102
+ // EXT-71/EXT-70 §6 — the menu MUST show what a sticky choice will store, at the moment of
103
+ // the choice, and it names it in the words the control is written in: the command itself for
104
+ // a shell call, the tool (with its server and host bound) for a tool call, since for a tool
105
+ // "the stored thing is the tool, not the arguments" (§4.7.4). The exact entry follows it, so
106
+ // the user sees the thing they are agreeing to rather than a generalization of it.
107
+ const sticky = pending.grantPreview !== undefined;
108
+ if (sticky) {
109
+ displayInfo(`[s]/[a] will remember ${pending.grantSummary ?? pending.grantPreview}`);
110
+ displayInfo(` stored as ${pending.grantPreview}`);
67
111
  }
68
112
  setRawMode(false); // ensure typed input is echoed for this confirm
69
113
  // EXT-18: wrap the prompt in try/finally so the raw-mode/ref state is not left wedged if
@@ -72,7 +116,15 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
72
116
  // suspended on the tool interrupt, whose stream-end unref'd stdin).
73
117
  let answer;
74
118
  try {
75
- answer = (await askLine(formatInputPrompt('Approve? [o]nce / [s]ession / [a]lways / [N]o: ')))
119
+ // §6 a sticky control is SHOWN only where a sticky grant is actually on offer. Where
120
+ // nothing would be remembered — a `catastrophic` outcome (§4.2), a command that does not
121
+ // statically resolve, a tool call nothing can attribute — the menu simply does not offer
122
+ // the choice, because "a control that is offered and then refused reads as a bug rather
123
+ // than as a policy". Hiding it, never disabling it: a disabled control invites the user to
124
+ // hunt for why.
125
+ answer = (await askLine(formatInputPrompt(sticky
126
+ ? 'Approve? [o]nce / [s]ession / [a]lways / [N]o: '
127
+ : 'Approve? [o]nce / [N]o: ')))
76
128
  .trim()
77
129
  .toLowerCase();
78
130
  }
@@ -82,16 +134,47 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
82
134
  if (answer === 'o' || answer === 'once') {
83
135
  return { type: 'approve', scope: 'once' };
84
136
  }
137
+ // CFG-28 (§4.2) — a `catastrophic` approval is NEVER sticky. The runner clamps the
138
+ // allow-list write, so `[s]` and `[a]` grant exactly this one invocation and the next
139
+ // variant prompts again. The decision is still returned unchanged: that clamp is the single
140
+ // chokepoint, in core, so the policy does not depend on which surface asked. What must change
141
+ // HERE is only the confirmation — §6 rejects "a control that is offered and then refused",
142
+ // and a confirmation that promises a persistence the gate has already discarded is that same
143
+ // failure with the evidence hidden. Withdrawing the key itself is [[TUI-C26]]'s.
144
+ // The confirmation must name what actually happened, and the condition for that is the SAME
145
+ // one that decides whether the control was shown: no grant on offer means no grant written,
146
+ // whatever key was typed. `catastrophic` keeps its own wording because the reason matters to
147
+ // the reader, but it is one case of the general one rather than the only one — the other
148
+ // cases (a command that does not statically resolve, an unattributable tool call) used to be
149
+ // confirmed as remembered while the runner stored nothing.
150
+ const notRemembered = pending.safetyVerdict?.outcome === 'catastrophic'
151
+ ? 'Approved this once — a command rated catastrophic is never remembered, so the next ' +
152
+ 'one like it will ask again.'
153
+ : 'Approved this once — there is nothing about this call that can be remembered, so the ' +
154
+ 'next one like it will ask again.';
85
155
  if (answer === 's' || answer === 'session') {
86
- displayInfo('Approved for this session, future variants will not re-prompt.');
156
+ displayInfo(sticky ? 'Approved this exact command will not ask again this session.' : notRemembered);
87
157
  return { type: 'approve', scope: 'session' };
88
158
  }
89
159
  if (answer === 'a' || answer === 'always') {
90
- displayInfo('Approved and remembered, saved to the project allow-list.');
160
+ displayInfo(sticky
161
+ ? 'Approved and remembered — this exact command is saved to the project allow-list.'
162
+ : notRemembered);
91
163
  return { type: 'approve', scope: 'always' };
92
164
  }
93
165
  displayInfo('Command rejected.');
94
- return { type: 'reject', message: 'User rejected the shell command.' };
166
+ // EXT-58 (§7): the model is told the moves it has — re-call with a justification, call a
167
+ // different command, or ask the user — and, when the rater named an already-granted
168
+ // alternative (§4.4), that tool plus the clause saying it needs no approval. A bare "user
169
+ // rejected" leaves the model to guess, which it does by repeating itself or giving up.
170
+ return {
171
+ type: 'reject',
172
+ message: buildRejectionMessage({
173
+ source: 'user',
174
+ toolName: pending.name,
175
+ verdict: pending.safetyVerdict,
176
+ }),
177
+ };
95
178
  });
96
179
  if (logFileName) {
97
180
  displayInfo(`${sessionConfig.mode} session will be logged to ${logFileName}\n`);
@@ -134,6 +217,27 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
134
217
  tools: runStats.tools.length > 0 ? runStats.tools : undefined,
135
218
  durationMs: Date.now() - startedAt,
136
219
  });
220
+ turnCount += 1; // GS2-8 — feeds the /status turn counter
221
+ };
222
+ // GS2-8 — render a structured command notice on the plain-text surface: tone-matched title
223
+ // (warn ⇒ yellow), then the body lines indented under it.
224
+ const printNotice = (notice) => {
225
+ if (notice.tone === 'warn') {
226
+ displayWarning(notice.title);
227
+ }
228
+ else {
229
+ displayInfo(notice.title);
230
+ }
231
+ for (const line of notice.lines) {
232
+ display(` ${line}`);
233
+ }
234
+ };
235
+ const endSession = async () => {
236
+ display('Exiting...');
237
+ shouldExit = true;
238
+ await runner.cleanup();
239
+ stopSessionLogging();
240
+ rl.close();
137
241
  };
138
242
  const askQuestion = async () => {
139
243
  while (!shouldExit) {
@@ -142,45 +246,82 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
142
246
  if (!userInput.trim()) {
143
247
  continue; // Skip inference if no input
144
248
  }
145
- const lowerInput = userInput.toLowerCase().trim();
146
- if (lowerInput === 'exit' || lowerInput === '/exit') {
147
- display('Exiting...');
148
- shouldExit = true;
149
- await runner.cleanup();
150
- stopSessionLogging();
151
- rl.close();
249
+ // Legacy bare `exit` keyword still quits (parity with the TUI's plain-exit handling).
250
+ if (userInput.toLowerCase().trim() === 'exit') {
251
+ await endSession();
152
252
  break;
153
253
  }
154
- // EXT-12 — `/auto-approve` (with the `/yolo` alias) sets session-wide shell auto-approval
155
- // at the approval-decision layer (the runner flag). `on`/`off` set it explicitly, no arg
156
- // (or `/yolo`) toggles. Session-scoped, reversible, never persisted; the hardline floor
157
- // still blocks catastrophic commands. The runner seeds this from the static `shellYolo`
158
- // config, so `/auto-approve off` also turns off a config-enabled auto-approval.
159
- if (lowerInput === '/auto-approve' ||
160
- lowerInput.startsWith('/auto-approve ') ||
161
- lowerInput === '/yolo') {
162
- const arg = lowerInput.startsWith('/auto-approve ')
163
- ? lowerInput.slice('/auto-approve '.length).trim()
164
- : '';
165
- let enabled;
166
- if (arg === 'on' || arg === 'enable' || arg === 'true')
167
- enabled = runner.setSessionYolo(true);
168
- else if (arg === 'off' || arg === 'disable' || arg === 'false')
169
- enabled = runner.setSessionYolo(false);
170
- else if (arg === '' || arg === 'toggle')
171
- enabled = runner.toggleSessionYolo();
172
- else {
173
- displayWarning(`Unknown option "${arg}". Usage: /auto-approve [on|off] (no arg toggles).`);
174
- continue;
254
+ // GS2-8every `/command` dispatches through the SAME registry as the Ink TUI (single
255
+ // source of truth). parseSlashCommand's `/`-vs-path heuristic means a pasted filesystem
256
+ // path (`/usr/home/bob/test.md`) is NOT a command and falls through to the model below.
257
+ const parsed = parseSlashCommand(userInput);
258
+ if (parsed) {
259
+ const result = dispatchSlashCommand(parsed, registry, {
260
+ mode: sessionConfig.mode,
261
+ modelDisplayName: config.modelDisplayName ?? '',
262
+ turnCount,
263
+ // No tool-detail panels or debug pane exist on this surface; their commands degrade
264
+ // below rather than vanishing from the catalog.
265
+ toolsExpanded: false,
266
+ debugVisible: false,
267
+ // CFG-25 — pass the session command so the panel prints the EFFECTIVE per-command
268
+ // filesystem value (e.g. `all` for `code`), not the top-level default.
269
+ configSummary: formatConfigSummary(config, sessionConfig.mode),
270
+ // GS2-56 `/debug-dump` is now available here. This surface keeps no on-screen
271
+ // transcript array, so `transcript` is empty; the real as-sent history lands in the
272
+ // archive's model-messages.json from the always-on snapshot (that is the point).
273
+ transcript: [],
274
+ resolvedConfig: config,
275
+ dumpDebugSession,
276
+ });
277
+ if (result.exit) {
278
+ await endSession();
279
+ break;
280
+ }
281
+ if (result.approvals) {
282
+ // CFG-27 — `/approvals <rung>` sets the session rung at the approval-decision layer
283
+ // (the runner posture). Session-scoped, reversible, never persisted. With no argument
284
+ // the command DISPLAYS the posture instead of changing it.
285
+ if ('show' in result.approvals) {
286
+ printNotice(approvalsStatusNotice(runner.getSessionApprovals(), runner.getAllowlistCounts(), runner.getDenylist(), runner.getGrants(), runner.getMcpAnnotationTrust()));
287
+ }
288
+ else if ('trust' in result.approvals) {
289
+ // EXT-70 §4.7.1 — believe (or stop believing) specific hints from one server, for
290
+ // this session. The notice is built from what the runner RETURNS, so it can only
291
+ // describe the trust actually in force — including §4.7.4's consequence when the
292
+ // withdrawal is a weakening.
293
+ const { server, hints, believe } = result.approvals.trust;
294
+ printNotice(approvalsTrustNotice(runner.setMcpAnnotationTrust(server, hints, believe)));
295
+ }
296
+ else {
297
+ runner.setSessionApprovalRung(result.approvals.rung);
298
+ // Report the posture the runner actually LANDED on, not the one requested.
299
+ printNotice(approvalsRungNotice(runner.getSessionApprovals()));
300
+ }
175
301
  }
176
- if (enabled) {
177
- displayWarning('Auto-approve ON — shell commands run this session without the per-command prompt. ' +
178
- 'The hardline safety floor still blocks catastrophic commands. Run /auto-approve off to require approvals.');
302
+ else if (result.clearTranscript ||
303
+ result.toggleDebug ||
304
+ result.toggleTools ||
305
+ result.reprintReasoning) {
306
+ // TUI-only effects (transcript clear, debug pane, tool-detail fold, reasoning
307
+ // reprint) have no equivalent on the plain readline surface — degrade with a clear
308
+ // pointer instead of silently doing nothing (GS2-8).
309
+ displayInfo(`/${parsed.name} is not available without the TUI — start the session on an ` +
310
+ `interactive terminal without --no-tui/GTH_NO_TUI to use it.`);
179
311
  }
180
- else {
181
- displayInfo('Auto-approve OFF — approvals required before each shell command.');
312
+ else if (result.notice) {
313
+ printNotice(result.notice);
182
314
  }
183
- continue; // do not send the command to the model
315
+ if (result.message) {
316
+ // Incidental system line (e.g. the /tools→/verbose deprecation pointer).
317
+ if (result.level === 'warning') {
318
+ displayWarning(result.message);
319
+ }
320
+ else {
321
+ displayInfo(result.message);
322
+ }
323
+ }
324
+ continue; // never send a slash command to the model
184
325
  }
185
326
  let shouldRetry = false;
186
327
  do {
@@ -211,6 +352,21 @@ export async function createInteractiveSession(sessionConfig, commandLineConfigO
211
352
  await processMessage(message);
212
353
  }
213
354
  else {
355
+ // TUI-C33 — the ASCII-art launch banner, ABOVE the untouched ready message. Only on this
356
+ // branch: an `-m` run goes straight to work, which is the readline twin of the TUI hiding
357
+ // its intro when it mounts with an initialMessage.
358
+ //
359
+ // Gated on `stdout.isTTY` (as the TUI's viewport bump is) so piped, redirected and non-TTY
360
+ // runs stay clean, and on `getUseColour()` for the escapes, so a monochrome session degrades
361
+ // the banner to plain text instead of dropping it. `stdout.columns` is what every field is
362
+ // truncated against — see launchBanner.ts on why a wrapped line would shatter the art.
363
+ if (output.isTTY) {
364
+ displayLaunchBanner(launchBannerText({
365
+ ...launchBannerFields(config.modelDisplayName, config.modelProviderType),
366
+ columns: output.columns,
367
+ colour: getUseColour(),
368
+ }));
369
+ }
214
370
  display(sessionConfig.readyMessage);
215
371
  displayInfo(sessionConfig.exitMessage);
216
372
  }