@gaunt-sloth/core 2.0.0-beta.1 → 2.0.0-beta.3

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 (117) hide show
  1. package/LICENSE +6 -6
  2. package/dist/config/loader.d.ts +13 -0
  3. package/dist/config/loader.js +55 -11
  4. package/dist/config/loader.js.map +1 -1
  5. package/dist/config/schema.d.ts +10 -0
  6. package/dist/config/schema.js +46 -24
  7. package/dist/config/schema.js.map +1 -1
  8. package/dist/config/shell-policy.d.ts +144 -3
  9. package/dist/config/shell-policy.js +117 -10
  10. package/dist/config/shell-policy.js.map +1 -1
  11. package/dist/config/tool-descriptions.d.ts +5 -5
  12. package/dist/config/tool-descriptions.js +3 -3
  13. package/dist/config/types.d.ts +19 -0
  14. package/dist/config/types.js.map +1 -1
  15. package/dist/constants.d.ts +10 -0
  16. package/dist/constants.js +10 -0
  17. package/dist/constants.js.map +1 -1
  18. package/dist/core/GthAbstractAgent.d.ts +32 -1
  19. package/dist/core/GthAbstractAgent.js +222 -7
  20. package/dist/core/GthAbstractAgent.js.map +1 -1
  21. package/dist/core/GthAgentRunner.d.ts +323 -27
  22. package/dist/core/GthAgentRunner.js +1092 -112
  23. package/dist/core/GthAgentRunner.js.map +1 -1
  24. package/dist/core/GthLangChainAgent.js +1 -1
  25. package/dist/core/GthLangChainAgent.js.map +1 -1
  26. package/dist/core/approvals/approvalRequest.d.ts +247 -0
  27. package/dist/core/approvals/approvalRequest.js +315 -0
  28. package/dist/core/approvals/approvalRequest.js.map +1 -0
  29. package/dist/core/approvals/grants.d.ts +165 -9
  30. package/dist/core/approvals/grants.js +702 -57
  31. package/dist/core/approvals/grants.js.map +1 -1
  32. package/dist/core/plainToolIndication.d.ts +11 -1
  33. package/dist/core/plainToolIndication.js +25 -10
  34. package/dist/core/plainToolIndication.js.map +1 -1
  35. package/dist/core/reasoningBlocks.d.ts +4 -6
  36. package/dist/core/reasoningBlocks.js +4 -6
  37. package/dist/core/reasoningBlocks.js.map +1 -1
  38. package/dist/core/shell/ShellCommandFailedError.d.ts +4 -4
  39. package/dist/core/shell/ShellCommandFailedError.js +4 -4
  40. package/dist/core/shell/abstention.d.ts +1 -1
  41. package/dist/core/shell/abstention.js +65 -11
  42. package/dist/core/shell/abstention.js.map +1 -1
  43. package/dist/core/shell/alignment.d.ts +491 -0
  44. package/dist/core/shell/alignment.js +687 -0
  45. package/dist/core/shell/alignment.js.map +1 -0
  46. package/dist/core/shell/approvalCapture.d.ts +53 -41
  47. package/dist/core/shell/approvalCapture.js +0 -42
  48. package/dist/core/shell/approvalCapture.js.map +1 -1
  49. package/dist/core/shell/approvalStop.d.ts +121 -3
  50. package/dist/core/shell/approvalStop.js +153 -90
  51. package/dist/core/shell/approvalStop.js.map +1 -1
  52. package/dist/core/shell/hardline.d.ts +26 -4
  53. package/dist/core/shell/hardline.js +321 -16
  54. package/dist/core/shell/hardline.js.map +1 -1
  55. package/dist/core/shell/negotiation.d.ts +352 -63
  56. package/dist/core/shell/negotiation.js +295 -123
  57. package/dist/core/shell/negotiation.js.map +1 -1
  58. package/dist/core/shell/openWorld.d.ts +136 -0
  59. package/dist/core/shell/openWorld.js +573 -35
  60. package/dist/core/shell/openWorld.js.map +1 -1
  61. package/dist/core/shell/provenance.d.ts +91 -0
  62. package/dist/core/shell/provenance.js +136 -0
  63. package/dist/core/shell/provenance.js.map +1 -0
  64. package/dist/core/shell/rater.d.ts +394 -163
  65. package/dist/core/shell/rater.js +536 -238
  66. package/dist/core/shell/rater.js.map +1 -1
  67. package/dist/core/shell/raterHealth.d.ts +101 -0
  68. package/dist/core/shell/raterHealth.js +121 -0
  69. package/dist/core/shell/raterHealth.js.map +1 -0
  70. package/dist/core/shell/raterModel.d.ts +17 -8
  71. package/dist/core/shell/raterModel.js +11 -8
  72. package/dist/core/shell/raterModel.js.map +1 -1
  73. package/dist/core/shell/rejection.d.ts +20 -5
  74. package/dist/core/shell/rejection.js +18 -4
  75. package/dist/core/shell/rejection.js.map +1 -1
  76. package/dist/core/toolDisplay.d.ts +91 -2
  77. package/dist/core/toolDisplay.js +168 -19
  78. package/dist/core/toolDisplay.js.map +1 -1
  79. package/dist/core/types.d.ts +140 -22
  80. package/dist/core/types.js.map +1 -1
  81. package/dist/providers/configurationPassthrough.d.ts +36 -6
  82. package/dist/providers/configurationPassthrough.js +40 -28
  83. package/dist/providers/configurationPassthrough.js.map +1 -1
  84. package/dist/providers/geminiSchemaSanitizer.d.ts +2 -2
  85. package/dist/providers/geminiSchemaSanitizer.js +2 -2
  86. package/dist/providers/geminiThinking.d.ts +10 -5
  87. package/dist/providers/geminiThinking.js +10 -5
  88. package/dist/providers/geminiThinking.js.map +1 -1
  89. package/dist/providers/openrouter.js +36 -6
  90. package/dist/providers/openrouter.js.map +1 -1
  91. package/dist/providers/vertexai.js +21 -0
  92. package/dist/providers/vertexai.js.map +1 -1
  93. package/dist/runtime/askStructured.d.ts +22 -0
  94. package/dist/runtime/askStructured.js +53 -0
  95. package/dist/runtime/askStructured.js.map +1 -1
  96. package/dist/utils/aiignoreUtils.d.ts +6 -0
  97. package/dist/utils/aiignoreUtils.js +69 -1
  98. package/dist/utils/aiignoreUtils.js.map +1 -1
  99. package/dist/utils/binaryOutputUtils.js +103 -21
  100. package/dist/utils/binaryOutputUtils.js.map +1 -1
  101. package/dist/utils/displayWidth.d.ts +10 -5
  102. package/dist/utils/displayWidth.js +148 -54
  103. package/dist/utils/displayWidth.js.map +1 -1
  104. package/dist/utils/fileUtils.d.ts +7 -1
  105. package/dist/utils/fileUtils.js +17 -3
  106. package/dist/utils/fileUtils.js.map +1 -1
  107. package/dist/utils/globalConfigUtils.d.ts +5 -2
  108. package/dist/utils/globalConfigUtils.js +14 -3
  109. package/dist/utils/globalConfigUtils.js.map +1 -1
  110. package/dist/utils/llmUtils.d.ts +1 -1
  111. package/dist/utils/llmUtils.js +1 -1
  112. package/dist/utils/systemPromptNotes.d.ts +3 -3
  113. package/dist/utils/systemPromptNotes.js +3 -3
  114. package/dist/utils/vertexaiUtils.js +160 -3
  115. package/dist/utils/vertexaiUtils.js.map +1 -1
  116. package/package.json +6 -5
  117. package/schema/gsloth-config.schema.json +34 -0
@@ -43,6 +43,12 @@ export interface ToolCallDisplayInput {
43
43
  output?: string;
44
44
  /** The real `ToolMessage.status === 'error'` signal (TUI-C7) — never sniffed from text. */
45
45
  isError?: boolean;
46
+ /**
47
+ * [[TUI-C69]] §5.4 — the gate refused this call BACK TO THE AGENT as a negotiation round, so the
48
+ * status row reads as a clarification request rather than as a failure. See
49
+ * {@link toolStatusDisplay}. Display-only, and additive to {@link isError}.
50
+ */
51
+ raterClarification?: boolean;
46
52
  /**
47
53
  * True when the live child output ALREADY streamed raw to the user's terminal (the plain
48
54
  * surface's default sink). Formatters then suppress the duplicated output body and render
@@ -50,6 +56,42 @@ export interface ToolCallDisplayInput {
50
56
  */
51
57
  liveOutputAlreadyShown?: boolean;
52
58
  }
59
+ /**
60
+ * [[TUI-C69]] §5.4 — **what a finished tool call's status row says, glyph, word and tone**, for
61
+ * both surfaces at once.
62
+ *
63
+ * `tone` rather than a colour name, because the two surfaces paint through different systems (Ink
64
+ * `<Text color>` and raw ANSI) and only one of them has a `magenta`. What is shared is the
65
+ * DISTINCTION, which is the thing a divergence would break.
66
+ */
67
+ export type ToolStatusTone = 'success' | 'warn' | 'error';
68
+ /** Glyph + word + tone for one finished call. */
69
+ export interface ToolStatusDisplay {
70
+ glyph: string;
71
+ label: string;
72
+ tone: ToolStatusTone;
73
+ }
74
+ /**
75
+ * [[TUI-C69]] §5.4 — **an intermediate rating rejection is a clarification request, never a
76
+ * failure**, and this is the one place that decides so for every surface.
77
+ *
78
+ * A `destructive` rating at `auto` does not end anything: it goes back to the agent naming what
79
+ * would make the command acceptable (§5.2), and on the happy path the very next round succeeds.
80
+ * Drawn in the same red `✗ … [error]` vocabulary a genuinely failed tool gets, it teaches the user
81
+ * that a working safety mechanism is a malfunction — which is the fastest way to make someone want
82
+ * it switched off. It is measured, not hypothetical: a live `auto` run rendered a round-1 rejection
83
+ * as `▾ ✗ 🔧 run_shell_command(command=git clone …) [error]`.
84
+ *
85
+ * **The glyph and the word carry the distinction, not the colour.** A monochrome terminal — and a
86
+ * user who cannot tell red from orange — must still be able to tell a refused round from a broken
87
+ * command, so `⚠` and the words differ before any tone is applied.
88
+ *
89
+ * **`raterClarification` outranks `isError`, and both are facts.** The call did not run, so
90
+ * LangChain's error status is correct and every reader that grades on it is right to; what this
91
+ * answers is the different question of how to TONE the row. Neither is ever sniffed from the
92
+ * result text — legitimate output may begin with "Error handling…".
93
+ */
94
+ export declare function toolStatusDisplay(input: Pick<ToolCallDisplayInput, 'isError' | 'raterClarification'>): ToolStatusDisplay;
53
95
  /**
54
96
  * Tolerant parse of a (possibly partial) streamed args JSON. Mirrors the view-model's
55
97
  * defensive posture: a half-streamed or malformed buffer never throws — it returns `null`.
@@ -98,15 +140,62 @@ export declare function summariseToolCall(name: string, argsText: string | undef
98
140
  /**
99
141
  * The FULL (uncapped) body lines for a call: the registry formatter when one applies, else the
100
142
  * shape-based shell formatter, else the generic fallback (live output lines, then the final
101
- * result — both dim). Every line is secret-redacted. Used by the TUI's EXPANDED panel; cap it
102
- * with {@link capToolDisplayLines} for the collapsed preview.
143
+ * result — both dim). Every line is secret-redacted and then neutralised. Used by the TUI's
144
+ * EXPANDED panel; cap it with {@link capToolDisplayLines} for the collapsed preview.
103
145
  */
104
146
  export declare function buildToolBodyLines(input: ToolCallDisplayInput, secrets?: readonly string[]): ToolDisplayLine[];
147
+ /** The strings the expanded panel paints beside the body, ready to draw. */
148
+ export interface ToolExpansionText {
149
+ /** The streamed args text as one row's content, or `null` when the call carries no args. */
150
+ args: string | null;
151
+ /** The routed notice, one element per row the expansion draws. */
152
+ noticeLines: string[];
153
+ }
154
+ /**
155
+ * [[TUI-C102]] — the two untrusted strings the EXPANDED tool panel paints OUTSIDE the body: the
156
+ * raw streamed args text and the routed "🔧 Executing …" notice. Neither passes through
157
+ * {@link buildToolBodyLines}, and neither is ours: `argsText` is whatever the model streamed —
158
+ * under prompt injection, attacker-chosen, and for a shell call it is the command itself — and a
159
+ * notice quotes that same command back. Under [[TUI-C99]] this expansion is the route by which a
160
+ * human inspects a call they are being asked to permit, so it gets the treatment the rest of the
161
+ * display path already has.
162
+ *
163
+ * **Both the renderer and the row-count oracle must call this, on the same input.** Neutralised
164
+ * text is WIDER than the raw text it replaces, so a renderer that neutralises beside an estimator
165
+ * that measures the raw string disagree about how many rows the panel occupies — and a row
166
+ * miscount shows as content in the wrong place on screen rather than as an error anywhere. One
167
+ * helper for both sides is what stops them drifting apart again.
168
+ *
169
+ * Same order as everywhere else on this path: **redact the raw text, then neutralise.** A secret
170
+ * literal that carries a control character stops literal-matching the moment that character is
171
+ * rewritten. Redaction is here at all because the collapsed summary above this row already
172
+ * redacts, and an expansion that did not would print, under `/verbose`, the secret the row above
173
+ * it hid.
174
+ *
175
+ * The notice splits through the module's own `toLines`, so a `\r\n` inside a quoted command is one
176
+ * break there too; the args text is a single value and keeps its own newlines as visible `\x0a`,
177
+ * which is what a streamed JSON buffer carrying a real newline actually contains.
178
+ */
179
+ export declare function buildToolExpansionText(input: {
180
+ argsText?: string;
181
+ notice?: string;
182
+ }, secrets?: readonly string[]): ToolExpansionText;
105
183
  /**
106
184
  * Apply the canonical render cap: at most `maxLines` lines (each char-capped at
107
185
  * {@link TOOL_PREVIEW_LINE_MAX_CHARS} with `…`), plus a dim `… (+N more lines)` overflow
108
186
  * marker when anything was cut. The marker line is IN ADDITION to the cap so exactly how much
109
187
  * was hidden is always stated (DL-4 transparency).
188
+ *
189
+ * This stays a GENERIC width utility and does not neutralise: it measures a line by what it
190
+ * RENDERS as, so a caller passing genuinely styled text (the renderer's own SGR) gets a cap that
191
+ * counts the columns the user sees rather than the escapes' own bytes.
192
+ *
193
+ * **No production caller passes styled text today.** {@link buildToolPreviewLines} is the only
194
+ * one, and its lines arrive already neutralised from {@link buildToolBodyLines}, so on the tool
195
+ * path there is nothing left to discount. The discount is kept because this is public API — core
196
+ * exports every module — and a width utility that mismeasured styled text would be wrong for any
197
+ * caller that did pass some. It is a property of the utility, not a live requirement of the tool
198
+ * path, and the spec covering it says the same.
110
199
  */
111
200
  export declare function capToolDisplayLines(lines: ToolDisplayLine[], maxLines?: number): ToolDisplayLine[];
112
201
  /**
@@ -23,10 +23,18 @@
23
23
  * - **Secret redaction reuses the GS2-47 `redactSecrets` lineage** (literal env/config secrets +
24
24
  * provider key patterns) — no new redactor. Applied to the params summary and every
25
25
  * preview/body line, fail-safe (redact MORE on any error, never leak).
26
+ * - **Untrusted text is NEUTRALISED before it can reach a terminal** ([[TUI-C102]]). A tool
27
+ * result is a file's bytes, a fetched page, an MCP server's response or a command's stdout,
28
+ * and a string is not inert on a terminal: SGR colour plus cursor positioning lets it paint
29
+ * something shaped like gsloth's own approval prompt a few rows from the real one. Every
30
+ * rendered line AND the params summary go through {@link neutralizeUntrustedText} — the same
31
+ * neutraliser `core/shell/framing` gives the approval dialog and the attack banner, reused
32
+ * rather than reimplemented so the two paths cannot come to disagree about what is inert.
26
33
  * - **`write_file`/`edit_file` render the change as a diff derived from the tool's ARGS**
27
34
  * (added = `added` style/green, removed = `removed` style/red); monochrome keeps the `+`/`-`
28
35
  * prefixes so the diff still reads without colour (DL-7 graceful degradation).
29
36
  */
37
+ import { neutralizeToOneLine, neutralizeUntrustedText } from '#src/core/shell/framing.js';
30
38
  import { displayWidth, sliceToWidth } from '#src/utils/displayWidth.js';
31
39
  import { collectSecretValues, redactText } from '#src/utils/redactSecrets.js';
32
40
  import { env } from '#src/utils/systemUtils.js';
@@ -49,6 +57,37 @@ export const ELLIPSIS = '…';
49
57
  * before slicing. Derived rather than written as `1` so it stays true of whatever marker is used.
50
58
  */
51
59
  export const ELLIPSIS_WIDTH = displayWidth(ELLIPSIS);
60
+ /**
61
+ * [[TUI-C69]] §5.4 — **an intermediate rating rejection is a clarification request, never a
62
+ * failure**, and this is the one place that decides so for every surface.
63
+ *
64
+ * A `destructive` rating at `auto` does not end anything: it goes back to the agent naming what
65
+ * would make the command acceptable (§5.2), and on the happy path the very next round succeeds.
66
+ * Drawn in the same red `✗ … [error]` vocabulary a genuinely failed tool gets, it teaches the user
67
+ * that a working safety mechanism is a malfunction — which is the fastest way to make someone want
68
+ * it switched off. It is measured, not hypothetical: a live `auto` run rendered a round-1 rejection
69
+ * as `▾ ✗ 🔧 run_shell_command(command=git clone …) [error]`.
70
+ *
71
+ * **The glyph and the word carry the distinction, not the colour.** A monochrome terminal — and a
72
+ * user who cannot tell red from orange — must still be able to tell a refused round from a broken
73
+ * command, so `⚠` and the words differ before any tone is applied.
74
+ *
75
+ * **`raterClarification` outranks `isError`, and both are facts.** The call did not run, so
76
+ * LangChain's error status is correct and every reader that grades on it is right to; what this
77
+ * answers is the different question of how to TONE the row. Neither is ever sniffed from the
78
+ * result text — legitimate output may begin with "Error handling…".
79
+ */
80
+ export function toolStatusDisplay(input) {
81
+ if (input.raterClarification) {
82
+ // **The words name the actor as well as the event.** "clarification requested" alone leaves
83
+ // the reader to guess who asked, and the one thing they must not conclude is that the command
84
+ // was wrong: the auto-rater asked the agent to narrow it, and the argument is still running.
85
+ return { glyph: '⚠', label: 'auto-rater: clarification requested', tone: 'warn' };
86
+ }
87
+ if (input.isError)
88
+ return { glyph: '✗', label: 'error', tone: 'error' };
89
+ return { glyph: '✓', label: 'done', tone: 'success' };
90
+ }
52
91
  const FALLBACK_GLYPH = '⚙';
53
92
  const FILE_GLYPH = '📁';
54
93
  const SHELL_GLYPH = '🔧';
@@ -115,10 +154,6 @@ export function resetToolDisplaySecretsCacheForTests() {
115
154
  cachedSecrets = null;
116
155
  displayConfig = undefined;
117
156
  }
118
- /** Collapse whitespace runs (incl. newlines) so a value stays a one-line token. */
119
- function inline(value) {
120
- return value.replace(/\s+/g, ' ').trim();
121
- }
122
157
  /**
123
158
  * Truncate to `max` terminal COLUMNS with the {@link ELLIPSIS} marker, reserving the marker's own
124
159
  * width out of the budget. Slicing goes through the shared width primitive: a code-point count
@@ -137,14 +172,22 @@ function truncate(value, max) {
137
172
  return sliceToWidth(value, max - ELLIPSIS_WIDTH) + ELLIPSIS;
138
173
  }
139
174
  /**
140
- * Render one arg value for the summary: strings inline+truncated, the rest JSON-ish.
175
+ * Render one arg value for the summary: strings neutralised onto one line + truncated, the rest
176
+ * JSON-ish.
141
177
  *
142
- * ORDER MATTERS (fix-cycle-1 finding): redaction runs BEFORE any transformation. Truncating
143
- * first would bisect a literal secret longer than the value cap so it no longer
144
- * literal-matches — its head would render in the call summary on both surfaces (a partial
145
- * leak); whitespace-collapsing first could likewise alter a literal out of matching. So:
146
- * redact the RAW text, then inline, then truncate (`<redacted>` contains no whitespace and is
147
- * shorter than the cap, so the later steps can never damage the marker).
178
+ * ORDER MATTERS (fix-cycle-1 finding, extended by [[TUI-C102]]): **redaction runs BEFORE any
179
+ * transformation.** Truncating first would bisect a literal secret longer than the value cap so it
180
+ * no longer literal-matches — its head would render in the call summary on both surfaces (a
181
+ * partial leak); whitespace-collapsing first could likewise alter a literal out of matching; and
182
+ * **neutralising first breaks the same match**, since a secret whose literal carries a control
183
+ * character stops matching the moment that character is rewritten to `\x0b`. So: redact the RAW
184
+ * text, then neutralise onto one line, then truncate (`<redacted>` contains no whitespace, no
185
+ * control characters and is shorter than the cap, so the later steps can never damage the marker).
186
+ *
187
+ * {@link neutralizeToOneLine} is the approval dialog's own helper and does the whitespace collapse
188
+ * this used to do locally — deliberately reused, because a private collapse was exactly how this
189
+ * path came to look tidy while an ESC walked through it: JavaScript's `\s` covers LF, CR and TAB
190
+ * but not ESC, BEL, the C1 range or the bidi overrides.
148
191
  */
149
192
  function formatParamValue(value, secrets) {
150
193
  let text;
@@ -162,11 +205,27 @@ function formatParamValue(value, secrets) {
162
205
  text = String(value);
163
206
  }
164
207
  }
165
- return truncate(inline(redactText(text, secrets)), TOOL_PARAM_VALUE_MAX_CHARS);
208
+ return truncate(neutralizeToOneLine(redactText(text, secrets)), TOOL_PARAM_VALUE_MAX_CHARS);
166
209
  }
167
- /** Split into lines, dropping a single trailing newline's phantom empty last element. */
210
+ /**
211
+ * Split untrusted text into the lines the body renders, dropping a single trailing newline's
212
+ * phantom empty last element.
213
+ *
214
+ * `\r\n` is ONE break, because that is what a Windows-authored file means by it. A **lone** `\r`
215
+ * is deliberately NOT a break: it is left for {@link neutralizeUntrustedText} to make visible as
216
+ * `\x0d`, since a bare carriage return is the cursor-to-column-0 overwrite trick far more often
217
+ * than it is a line ending, and turning it into a break would hide that it was ever there.
218
+ *
219
+ * That rule is `splitLogicalLines` in `core/shell/framing`, matched deliberately rather than
220
+ * re-decided here. The approval dialog splits the command it frames exactly this way, and this
221
+ * node exists because the tool path and the approval path had come to disagree about what is
222
+ * inert; a splitter that differed would re-open that divergence one layer down. It weakens
223
+ * nothing — the attack is the lone `\r`, which still reaches the neutraliser — while the pair
224
+ * every terminal already draws as one break stops putting a visible `\x0d` on the end of every
225
+ * line of every CRLF-authored file, which is one of the commonest things this product reads.
226
+ */
168
227
  function toLines(text) {
169
- const lines = text.split('\n');
228
+ const lines = text.replace(/\r\n/gu, '\n').split('\n');
170
229
  if (lines.length > 1 && lines[lines.length - 1] === '')
171
230
  lines.pop();
172
231
  return lines;
@@ -328,6 +387,10 @@ const TOOL_DISPLAY_REGISTRY = {
328
387
  },
329
388
  run_lint: { glyph: SHELL_GLYPH, formatBody: formatShellBody, shellShaped: true },
330
389
  run_build: { glyph: SHELL_GLYPH, formatBody: formatShellBody, shellShaped: true },
390
+ // Dormant, deliberately: the `task` tool went with the deepagents runtime (EXT-114), and nothing
391
+ // emits one until GS2-25 lands the lean subagent primitive. Kept rather than swept because an
392
+ // unregistered name falls back to the generic glyph, so an unused row renders nothing and says
393
+ // nothing to anyone until a producer returns.
331
394
  task: { glyph: '🤖', summariseArgs: ['subagent_type', 'description'] },
332
395
  };
333
396
  /** The registry glyph for a tool name (generic `⚙` when unknown). */
@@ -355,7 +418,16 @@ export function summariseToolCall(name, argsText, secrets = getDefaultSecrets())
355
418
  const args = parseToolArgsSafe(argsText);
356
419
  if (args === null) {
357
420
  const hasRawArgs = !!argsText && argsText.trim().length > 0 && argsText.trim() !== '{}';
358
- return hasRawArgs ? `${label}(${ELLIPSIS})` : `${label}()`;
421
+ // [[TUI-C102]] THIS RETURN RUNS THE SAME PASS AS THE ONE AT THE END, and it is the branch
422
+ // taken most often: a partially streamed args buffer does not parse, so every frame between
423
+ // `tool_start` (which supplies the name) and the final `tool_args` delta renders here, and a
424
+ // call whose args never become valid JSON renders here permanently. What it paints is the
425
+ // tool NAME, which is not ours — an MCP server names its own tools, and under prompt
426
+ // injection the model chooses what to stream. Returning it untreated put raw ANSI on the row
427
+ // [[TUI-C99]] turns into the approval row. Redact first, then neutralise, for the reason
428
+ // spelled out at the main return below; the ellipsis and the `(tool)` fallback are module
429
+ // constants and hold nothing either step can act on.
430
+ return neutralizeUntrustedText(redactText(hasRawArgs ? `${label}(${ELLIPSIS})` : `${label}()`, secrets));
359
431
  }
360
432
  const entry = TOOL_DISPLAY_REGISTRY[name];
361
433
  const keys = entry?.summariseArgs !== undefined
@@ -370,7 +442,13 @@ export function summariseToolCall(name, argsText, secrets = getDefaultSecrets())
370
442
  // Redact before the whole-summary cap too, so this truncation can no more bisect a secret
371
443
  // out of literal-matching than the per-value one can.
372
444
  const inner = truncate(redactText(parts.join(', '), secrets), TOOL_SUMMARY_MAX_CHARS);
373
- return redactText(`${label}(${inner})`, secrets);
445
+ // [[TUI-C102]] — the values were neutralised one by one above (each needed it before its own
446
+ // width budget could mean anything); this last pass covers the two strings that never went
447
+ // through {@link formatParamValue}: the tool NAME and the arg KEYS. Neither is ours — an MCP
448
+ // server names its own tools, and an unregistered tool's keys are whatever the model streamed.
449
+ // Idempotent over the values, whose escape alphabet (`\`, `x`, `u`, `{`, `}`, hex) holds nothing
450
+ // for it to rewrite.
451
+ return neutralizeUntrustedText(redactText(`${label}(${inner})`, secrets));
374
452
  }
375
453
  /* ------------------------------------------------------------------------- *
376
454
  * Body + preview *
@@ -378,8 +456,8 @@ export function summariseToolCall(name, argsText, secrets = getDefaultSecrets())
378
456
  /**
379
457
  * The FULL (uncapped) body lines for a call: the registry formatter when one applies, else the
380
458
  * shape-based shell formatter, else the generic fallback (live output lines, then the final
381
- * result — both dim). Every line is secret-redacted. Used by the TUI's EXPANDED panel; cap it
382
- * with {@link capToolDisplayLines} for the collapsed preview.
459
+ * result — both dim). Every line is secret-redacted and then neutralised. Used by the TUI's
460
+ * EXPANDED panel; cap it with {@link capToolDisplayLines} for the collapsed preview.
383
461
  */
384
462
  export function buildToolBodyLines(input, secrets = getDefaultSecrets()) {
385
463
  const args = parseToolArgsSafe(input.argsText);
@@ -399,13 +477,84 @@ export function buildToolBodyLines(input, secrets = getDefaultSecrets()) {
399
477
  lines.push(...styled(toLines(input.result), 'dim'));
400
478
  }
401
479
  }
402
- return lines.map((l) => ({ ...l, text: redactText(l.text, secrets) }));
480
+ // [[TUI-C102]] THE ORDER OF THESE TWO STEPS, AND OF THE CAP THAT FOLLOWS THEM, IS LOAD-BEARING.
481
+ //
482
+ // 1. REDACT the raw text. A secret literal that carries a control character stops matching the
483
+ // moment that character is rewritten to `\x0b`, so neutralising first would leave the secret
484
+ // on the screen — the same argument {@link formatParamValue} makes about truncating first.
485
+ // 2. NEUTRALISE what redaction returns, so nothing downstream ever holds an escape.
486
+ // 3. CAP last ({@link capToolDisplayLines}, via {@link buildToolPreviewLines}). A neutralised
487
+ // line is WIDER than the raw one — `\x1b[2J` is 8 printable columns where the sequence was 0
488
+ // — and the cap measures a line by what it RENDERS as. Because the escapes are already gone
489
+ // when it looks, the width it measures and the text it slices are the same string. Capping
490
+ // first would measure the raw line, discount escapes that the neutralised text no longer
491
+ // has, and hand back a row that over-runs the terminal it is drawn on.
492
+ //
493
+ // INVARIANT this step relies on: **a line arriving here holds no `\n`.** Neutralisation would
494
+ // rewrite one to a literal `\x0a` and silently collapse multi-line output onto a single row.
495
+ // Every producer was checked: the generic fallback, {@link formatShellBody},
496
+ // {@link formatWriteFileBody} and {@link formatEditFileBody} all split through {@link toLines},
497
+ // and {@link TOOL_DISPLAY_REGISTRY} is module-private, so there is no third-party `formatBody`.
498
+ // A new formatter must split its own output rather than return an embedded newline.
499
+ //
500
+ // OUT OF SCOPE, deliberately: `/debug-dump` (GS2-46) stays an UNSANITIZED archive. Neutralising
501
+ // is about what a TERMINAL does with a string; a dump is written to a file, is read with tools
502
+ // that render bytes as bytes, and exists to reproduce a failure — escaping its contents would
503
+ // destroy the evidence it is collected for. It is redacted for secrets, which is the property
504
+ // that actually travels with a file someone may attach to an issue.
505
+ return lines.map((l) => ({
506
+ ...l,
507
+ text: neutralizeUntrustedText(redactText(l.text, secrets)),
508
+ }));
509
+ }
510
+ /**
511
+ * [[TUI-C102]] — the two untrusted strings the EXPANDED tool panel paints OUTSIDE the body: the
512
+ * raw streamed args text and the routed "🔧 Executing …" notice. Neither passes through
513
+ * {@link buildToolBodyLines}, and neither is ours: `argsText` is whatever the model streamed —
514
+ * under prompt injection, attacker-chosen, and for a shell call it is the command itself — and a
515
+ * notice quotes that same command back. Under [[TUI-C99]] this expansion is the route by which a
516
+ * human inspects a call they are being asked to permit, so it gets the treatment the rest of the
517
+ * display path already has.
518
+ *
519
+ * **Both the renderer and the row-count oracle must call this, on the same input.** Neutralised
520
+ * text is WIDER than the raw text it replaces, so a renderer that neutralises beside an estimator
521
+ * that measures the raw string disagree about how many rows the panel occupies — and a row
522
+ * miscount shows as content in the wrong place on screen rather than as an error anywhere. One
523
+ * helper for both sides is what stops them drifting apart again.
524
+ *
525
+ * Same order as everywhere else on this path: **redact the raw text, then neutralise.** A secret
526
+ * literal that carries a control character stops literal-matching the moment that character is
527
+ * rewritten. Redaction is here at all because the collapsed summary above this row already
528
+ * redacts, and an expansion that did not would print, under `/verbose`, the secret the row above
529
+ * it hid.
530
+ *
531
+ * The notice splits through the module's own `toLines`, so a `\r\n` inside a quoted command is one
532
+ * break there too; the args text is a single value and keeps its own newlines as visible `\x0a`,
533
+ * which is what a streamed JSON buffer carrying a real newline actually contains.
534
+ */
535
+ export function buildToolExpansionText(input, secrets = getDefaultSecrets()) {
536
+ const clean = (text) => neutralizeUntrustedText(redactText(text, secrets));
537
+ return {
538
+ args: input.argsText ? clean(input.argsText) : null,
539
+ noticeLines: input.notice ? toLines(input.notice).map(clean) : [],
540
+ };
403
541
  }
404
542
  /**
405
543
  * Apply the canonical render cap: at most `maxLines` lines (each char-capped at
406
544
  * {@link TOOL_PREVIEW_LINE_MAX_CHARS} with `…`), plus a dim `… (+N more lines)` overflow
407
545
  * marker when anything was cut. The marker line is IN ADDITION to the cap so exactly how much
408
546
  * was hidden is always stated (DL-4 transparency).
547
+ *
548
+ * This stays a GENERIC width utility and does not neutralise: it measures a line by what it
549
+ * RENDERS as, so a caller passing genuinely styled text (the renderer's own SGR) gets a cap that
550
+ * counts the columns the user sees rather than the escapes' own bytes.
551
+ *
552
+ * **No production caller passes styled text today.** {@link buildToolPreviewLines} is the only
553
+ * one, and its lines arrive already neutralised from {@link buildToolBodyLines}, so on the tool
554
+ * path there is nothing left to discount. The discount is kept because this is public API — core
555
+ * exports every module — and a width utility that mismeasured styled text would be wrong for any
556
+ * caller that did pass some. It is a property of the utility, not a live requirement of the tool
557
+ * path, and the spec covering it says the same.
409
558
  */
410
559
  export function capToolDisplayLines(lines, maxLines = TOOL_OUTPUT_PREVIEW_LINES) {
411
560
  const capped = lines.slice(0, maxLines).map((l) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"toolDisplay.js","sourceRoot":"","sources":["../../src/core/toolDisplay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD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