@gaunt-sloth/core 2.0.0-alpha.29 → 2.0.0-alpha.30

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 (76) hide show
  1. package/dist/config/schema.d.ts +48 -48
  2. package/dist/config/schema.js +55 -29
  3. package/dist/config/schema.js.map +1 -1
  4. package/dist/config/shell-policy.d.ts +241 -26
  5. package/dist/config/shell-policy.js +353 -52
  6. package/dist/config/shell-policy.js.map +1 -1
  7. package/dist/config/tool-descriptions.d.ts +78 -32
  8. package/dist/config/tool-descriptions.js +72 -29
  9. package/dist/config/tool-descriptions.js.map +1 -1
  10. package/dist/config/types.d.ts +9 -4
  11. package/dist/config/types.js.map +1 -1
  12. package/dist/core/GthAbstractAgent.d.ts +13 -5
  13. package/dist/core/GthAbstractAgent.js +42 -13
  14. package/dist/core/GthAbstractAgent.js.map +1 -1
  15. package/dist/core/GthAgentRunner.d.ts +203 -9
  16. package/dist/core/GthAgentRunner.js +646 -39
  17. package/dist/core/GthAgentRunner.js.map +1 -1
  18. package/dist/core/GthLangChainAgent.js +58 -17
  19. package/dist/core/GthLangChainAgent.js.map +1 -1
  20. package/dist/core/reasoningBlocks.d.ts +60 -0
  21. package/dist/core/reasoningBlocks.js +98 -0
  22. package/dist/core/reasoningBlocks.js.map +1 -0
  23. package/dist/core/refusal.js +6 -2
  24. package/dist/core/refusal.js.map +1 -1
  25. package/dist/core/shell/approvalCapture.d.ts +271 -0
  26. package/dist/core/shell/approvalCapture.js +108 -0
  27. package/dist/core/shell/approvalCapture.js.map +1 -0
  28. package/dist/core/shell/approvalStop.d.ts +16 -7
  29. package/dist/core/shell/approvalStop.js +18 -7
  30. package/dist/core/shell/approvalStop.js.map +1 -1
  31. package/dist/core/shell/escalationSeverity.d.ts +141 -0
  32. package/dist/core/shell/escalationSeverity.js +89 -0
  33. package/dist/core/shell/escalationSeverity.js.map +1 -0
  34. package/dist/core/shell/framing.d.ts +190 -0
  35. package/dist/core/shell/framing.js +633 -0
  36. package/dist/core/shell/framing.js.map +1 -0
  37. package/dist/core/shell/hardline.d.ts +81 -0
  38. package/dist/core/shell/hardline.js +607 -0
  39. package/dist/core/shell/hardline.js.map +1 -0
  40. package/dist/core/shell/negotiation.d.ts +249 -0
  41. package/dist/core/shell/negotiation.js +355 -0
  42. package/dist/core/shell/negotiation.js.map +1 -0
  43. package/dist/core/shell/normalize.d.ts +5 -5
  44. package/dist/core/shell/normalize.js +5 -5
  45. package/dist/core/shell/rater.d.ts +353 -18
  46. package/dist/core/shell/rater.js +556 -39
  47. package/dist/core/shell/rater.js.map +1 -1
  48. package/dist/core/shell/rejection.d.ts +1 -1
  49. package/dist/core/types.d.ts +97 -4
  50. package/dist/providers/geminiThinking.d.ts +52 -0
  51. package/dist/providers/geminiThinking.js +72 -0
  52. package/dist/providers/geminiThinking.js.map +1 -0
  53. package/dist/providers/google-genai.js +4 -1
  54. package/dist/providers/google-genai.js.map +1 -1
  55. package/dist/providers/vertexai.js +4 -1
  56. package/dist/providers/vertexai.js.map +1 -1
  57. package/dist/runtime/askStructured.d.ts +45 -3
  58. package/dist/runtime/askStructured.js +46 -5
  59. package/dist/runtime/askStructured.js.map +1 -1
  60. package/dist/runtime/conversation.d.ts +2 -1
  61. package/dist/runtime/conversation.js +2 -1
  62. package/dist/runtime/conversation.js.map +1 -1
  63. package/dist/runtime/singleShot.d.ts +3 -2
  64. package/dist/runtime/singleShot.js +3 -2
  65. package/dist/runtime/singleShot.js.map +1 -1
  66. package/dist/utils/debugDump.d.ts +19 -0
  67. package/dist/utils/debugDump.js +11 -0
  68. package/dist/utils/debugDump.js.map +1 -1
  69. package/dist/utils/displayWidth.d.ts +23 -0
  70. package/dist/utils/displayWidth.js +61 -6
  71. package/dist/utils/displayWidth.js.map +1 -1
  72. package/dist/utils/systemPromptNotes.d.ts +12 -1
  73. package/dist/utils/systemPromptNotes.js +24 -2
  74. package/dist/utils/systemPromptNotes.js.map +1 -1
  75. package/package.json +1 -1
  76. package/schema/gsloth-config.schema.json +48 -48
@@ -14,6 +14,7 @@
14
14
  * keeps the toolkit/accessor surface stable while the single config surface is `builtInTools`.
15
15
  */
16
16
  import { StatusLevel } from '#src/core/types.js';
17
+ import { isAccessClassGrantedAtRung } from '#src/config/tool-descriptions.js';
17
18
  /**
18
19
  * The fixed dev-command tools: each maps a `command` string (from its {@link BuiltInToolConfig})
19
20
  * to a run_* tool emitted by {@link GthDevToolkit}.
@@ -196,80 +197,369 @@ export function getEffectiveDevToolsConfig(config, command) {
196
197
  * -------------------------------------------------------------------------------------------- */
197
198
  /**
198
199
  * CFG-27 (spec §1, §2) — **the ladder**. There is ONE approvals setting and it is a single ordered
199
- * ladder of five rungs; each rung fully determines behaviour. There are no severity thresholds, no
200
- * strictness levels and no independent rater on/off switch.
200
+ * ladder; each rung fully determines behaviour. There are no severity thresholds, no strictness
201
+ * levels and no independent rater on/off switch.
201
202
  *
202
203
  * | # | Rung | Rater | LLM cost |
203
204
  * |---|---|---|---|
204
- * | 1 | `read-only` | no | none |
205
+ * | 1 | `manual` | no | none |
205
206
  * | 2 | `write` | no | none |
206
- * | 3 | `auto-safe` | yes | 1 call per gated call |
207
- * | 4 | `full-auto` | yes | 1–2 calls per gated call |
207
+ * | 3 | `assisted` | yes | 1 call per gated call |
208
+ * | 4 | `auto` | yes | 1–2 calls per gated call |
208
209
  * | 5 | `bypass` | no | none |
209
210
  *
210
211
  * Rungs 1, 2 and 5 are fully deterministic: no model is consulted, so behaviour is reproducible
211
212
  * and costs nothing.
212
213
  *
213
- * **`bypass` is NOT a higher-autonomy rung than `full-auto`** (§2.5). Both let the agent act
214
+ * **CFG-39 four postures plus one modifier, not five peers.** `write` is not a rung on a trust
215
+ * ladder: it is the same posture as `manual` with a different auto-granted set. The four postures
216
+ * a user chooses between are {@link APPROVAL_POSTURES} (`manual` → `assisted` → `auto`, plus
217
+ * `bypass`), and that ordering is legible in the names themselves. `write` remains fully settable
218
+ * — via `/approvals write` and via config — and simply does not occupy a row in quick access.
219
+ * This constant keeps ALL FIVE members: it is the type's domain, the set
220
+ * {@link resolveInterruptToolNames} unions over, and what makes `write` settable at all.
221
+ *
222
+ * **`bypass` is NOT a higher-autonomy rung than `auto`** (§2.5). Both let the agent act
214
223
  * without asking; `bypass` is the same autonomy with the checks removed. The ordering below is the
215
- * order the rungs are *offered* in, and must never be presented as though `full-auto` were an
224
+ * order the rungs are *offered* in, and must never be presented as though `auto` were an
216
225
  * incomplete `bypass`.
217
226
  *
218
- * Identifiers are kebab-case (§9.1) because the same token must work as a config value, a
219
- * slash-command argument and a CLI flag — a space breaks the last two. Display names keep their
220
- * spaces; see {@link APPROVAL_RUNG_LABELS}.
227
+ * Identifiers are lower-case single words (§9.1) because the same token must work as a config
228
+ * value, a slash-command argument and a CLI flag — a space breaks the last two. Display names are
229
+ * capitalised; see {@link APPROVAL_RUNG_LABELS}.
221
230
  */
222
- export const APPROVAL_RUNGS = ['read-only', 'write', 'auto-safe', 'full-auto', 'bypass'];
231
+ export const APPROVAL_RUNGS = ['manual', 'write', 'assisted', 'auto', 'bypass'];
223
232
  /**
224
233
  * §9.1 rule / §10 rule 4 — the display spelling of each rung, with spaces. An identifier and a
225
234
  * label do not have to match and only one of them has to survive a shell, so user-facing prose
226
235
  * uses these and never the kebab-case identifiers.
227
236
  */
228
237
  export const APPROVAL_RUNG_LABELS = {
229
- 'read-only': 'Read only',
238
+ manual: 'Manual',
230
239
  write: 'Write',
231
- 'auto-safe': 'Auto safe',
232
- 'full-auto': 'Full auto',
240
+ assisted: 'Assisted',
241
+ auto: 'Auto',
233
242
  bypass: 'Bypass',
234
243
  };
235
244
  /**
236
- * §10 — the one sentence shown wherever a rung is chosen or displayed. **Copied verbatim from the
237
- * specification**; the wording is constrained by four normative rules there (state what the rung
238
- * PERMITS, state the allow-list carve-out, never claim safety this system cannot deliver, use the
239
- * display spelling) plus §8.1 (the hardline floor is real but is NEVER advertised descriptions
240
- * cite only protections the user can inspect and extend, i.e. the deny list). Do not "improve"
241
- * these: `auto-safe` in particular MUST keep the sentence saying files are still rewritten and
242
- * deleted without asking.
243
- *
244
- * The only departure from the source text is that §10's markdown emphasis markers (`**not**` in
245
- * *Full auto*) are dropped, since these strings are rendered as plain terminal copy.
245
+ * CFG-39**the four postures**, in the order they are offered: the rows `/approvals` presents
246
+ * when it asks the user to choose one.
247
+ *
248
+ * `write` is deliberately absent, and its absence is the whole point of the reframe. It is not a
249
+ * rung on a trust ladder it is `manual`'s posture with a different auto-granted set, so listing
250
+ * it as a fifth peer is what made a four-point ladder read as five indistinguishable ones. It stays
251
+ * fully settable via `/approvals write` and via config; it simply leaves quick access.
252
+ *
253
+ * **This is a presentation list, never a policy one.** Every predicate, every `Record<ApprovalRung,
254
+ * …>` and the interrupt set are built from {@link APPROVAL_RUNGS}, which keeps all five. Using this
255
+ * constant to decide behaviour would silently un-settle `write`.
256
+ */
257
+ export const APPROVAL_POSTURES = [
258
+ 'manual',
259
+ 'assisted',
260
+ 'auto',
261
+ 'bypass',
262
+ ];
263
+ /**
264
+ * CFG-39 — the one-line note that `write` exists, shown as picker CHROME beside the `manual` row.
265
+ *
266
+ * It lives here rather than appended to {@link APPROVAL_RUNG_DESCRIPTIONS}`.manual` on purpose: the
267
+ * descriptions are one surface's copy shared by six, so a sentence about quick-access mechanics
268
+ * would follow the mode into the status display and the tool-description layer, where it means
269
+ * nothing.
270
+ */
271
+ export const APPROVAL_WRITE_MODIFIER_HINT = 'Manual also has a Write variant that may edit files in your working folder without asking: ' +
272
+ 'set it with /approvals write.';
273
+ /**
274
+ * §10 — what each mode is **for**, in at most two sentences, shown wherever a mode is chosen or
275
+ * displayed.
276
+ *
277
+ * **The first sentence is load-bearing and must stand alone.** The `/approvals` picker, the text
278
+ * fallback and the usage hint all render one line per mode through `firstSentence`, so sentence
279
+ * one has to answer "what is this mode for" on its own and sentence two carries the qualification.
280
+ * Keep it short enough to read as a menu row.
281
+ *
282
+ * **Say what the mode is for, not only what it permits.** A description that lists permissions
283
+ * invites the category error these modes actually suffer: Manual reads as "the safe one", so it
284
+ * gets picked for a long unattended run — where the deciding is done by a human, and a human is the
285
+ * fastest-degrading decider in the system. Manual and Write are bounded-volume tools and their copy
286
+ * says so.
287
+ *
288
+ * The wording is constrained by four normative rules (state what the mode PERMITS, state the
289
+ * allow-list carve-out, never claim safety this system cannot deliver, use the display spelling)
290
+ * plus §8.1 — the hardline floor is real but is NEVER advertised, so descriptions cite only
291
+ * protections the user can inspect and extend, i.e. the deny list. Five further constraints bind
292
+ * every edit here:
293
+ *
294
+ * 1. **No description may imply containment.** The gate protects against accidents, not intent, and
295
+ * a working-folder claim collapses the moment the agent has a shell — `write_file` refuses a
296
+ * path that `touch` then writes. The narrow true form (the built-in file *tools* are confined)
297
+ * is stated once, on `write`, alongside the fact that the shell is not confined that way.
298
+ * 2. **Claims are scoped to the session the user is in.** These strings render on terminal surfaces
299
+ * only; a sentence whose subject is "Gaunt Sloth" and whose claim is that it always asks would
300
+ * be false over the AG-UI and ACP servers, which never drain an approval interrupt ([[EXT-94]]).
301
+ * 3. **`assisted` MUST keep the sentence saying files are still rewritten and deleted without
302
+ * asking** — it sounds safer than it is, and that clause is the correction.
303
+ * 4. **A qualification may not live in the second sentence alone.** The picker, the text fallback
304
+ * and the usage hint all render `firstSentence` and nothing else, so the opener is the whole
305
+ * message on the three surfaces a user reads while *choosing* a mode. An opener that sells a
306
+ * behavioural difference the product does not have is not rescued by a sentence two those
307
+ * surfaces never print — check a wording by rendering it, not by reading the constant.
308
+ * 5. **`auto` is the mode a reader most wants to hear is quiet, and it is not.** It settles some
309
+ * risky commands with the rater instead of interrupting — that difference is real and may be
310
+ * stated — but the copy MUST also say that a bounded exchange ends at the user, and MUST NOT
311
+ * promise the user watches it happen. The rounds reach a person at the escalation, all of them
312
+ * at once, and nothing renders them before that ([[TUI-C26]]), so a sentence implying a live
313
+ * commentary would be describing a screen that does not exist.
314
+ *
315
+ * Everything these two sentences cannot hold lives at {@link APPROVAL_PROTECTION_DOCS_URL}, which
316
+ * the surfaces print beside the copy rather than each description repeating it.
246
317
  */
247
318
  export const APPROVAL_RUNG_DESCRIPTIONS = {
248
- 'read-only': 'Gaunt Sloth may automatically read and list files in the current working folder. It asks ' +
249
- 'for approval for anything else, until you tell it to always allow a command.',
250
- write: 'Gaunt Sloth may automatically read, edit, create and delete files in the current working ' +
251
- 'folder. It asks for approval for anything else, until you tell it to always allow a command.',
252
- 'auto-safe': 'Same as write, plus the auto-rater rates everything else and automatically approves what it ' +
253
- 'rates as safe; anything questionable comes to you. Gaunt Sloth can still rewrite and delete ' +
254
- 'files in your working folder without asking "safe" means each action is checked for ' +
255
- 'reaching outside that folder or harming your system, not that nothing changes.',
256
- 'full-auto': 'The auto-rater steers Gaunt Sloth: it decides for itself and does not stop to ask you. This ' +
257
- 'is safer than bypass the auto-rater still stops the run on a command that reads your keys ' +
258
- 'or passwords, weakens permissions, installs itself to run again later, or hides what it ' +
259
- 'does; it brings anything it cannot undo to you rather than deciding alone; and your deny ' +
260
- 'list still applies but it is not safe. Gaunt Sloth will change and delete things. Use it ' +
261
- 'where the consequences are recoverable, and put real gates (deployment approvals, ' +
262
- 'two-factor, branch protection) on anything that is not.',
263
- bypass: 'No gate. Gaunt Sloth runs whatever it decides to run, without asking and without rating. ' +
264
- 'Only the refusals configured in the deny list in your config still apply.',
319
+ manual: 'For a handful of commands you want to read yourself not a mode to leave running. In this ' +
320
+ 'session Gaunt Sloth reads and lists files in your working folder on its own; everything ' +
321
+ 'else shell, file changes, MCP and custom tools comes to you, until you tell it to always ' +
322
+ 'allow a command.',
323
+ write: 'Manual, for work that is mostly editing, and like Manual a bounded stretch: the built-in ' +
324
+ 'file tools run free inside your working folder. The shell is not confined that way, so shell ' +
325
+ 'commands, MCP calls and custom tools still come to you, until you tell it to always allow a ' +
326
+ 'command.',
327
+ assisted: 'For everyday work: safe commands run, anything riskier comes to you usually with a line ' +
328
+ 'explaining what it does. Gaunt Sloth can still rewrite and delete files in your working ' +
329
+ 'folder without asking "safe" means each action is checked for reaching outside that folder ' +
330
+ 'or harming your system, not that nothing changes.',
331
+ auto: 'For work you want to keep moving: Auto sends a risky command back to the agent to fix or ' +
332
+ 'justify a few times, then stops and asks you. It is not safe — Gaunt Sloth will change and ' +
333
+ 'delete things, your deny list still applies, and when it does ask, you are shown the whole ' +
334
+ 'argument that led there.',
335
+ bypass: 'No gate, for a throwaway environment you would not mind losing. Whatever Gaunt Sloth decides ' +
336
+ 'to run, runs — nothing is rated and nothing is asked; only the refusals in your config’s ' +
337
+ 'deny list still apply.',
265
338
  };
339
+ /**
340
+ * The page that carries what these modes do and do NOT protect you from — the reasoning the
341
+ * two-sentence descriptions deliberately do not hold.
342
+ *
343
+ * **A GitHub blob URL, matching the one other user-facing runtime doc link in this package** (the
344
+ * 2.0 migration pointer in `config/schema.ts`). The docs site publishes the same page at
345
+ * `https://gauntsloth.app/docs/guides/what-approvals-protect-you-from/`; move this constant there
346
+ * once that path serves the page, and nothing else changes.
347
+ */
348
+ export const APPROVAL_PROTECTION_DOCS_URL = 'https://github.com/pukeko-robotics/gaunt-sloth/blob/main/docs/guides/what-approvals-protect-you-from.md';
349
+ /**
350
+ * The docs pointer as the surfaces print it: **label and URL as two separate lines**, never one
351
+ * joined string. Every notice surface takes `lines: string[]` and renders one line each, so a bare
352
+ * URL on its own line is the only form that survives a narrow pane without the break landing
353
+ * mid-path — and it is what lets a terminal that linkifies URLs pick the whole thing up.
354
+ *
355
+ * It lives beside the descriptions rather than inside them for {@link APPROVAL_WRITE_MODIFIER_HINT}'s
356
+ * reason: one line about where to read more, repeated into all five descriptions, would follow each
357
+ * mode into the tool-description layer and the status display, where it is noise.
358
+ */
359
+ export const APPROVAL_PROTECTION_DOCS_LINES = [
360
+ 'What these modes do and do not protect you from:',
361
+ APPROVAL_PROTECTION_DOCS_URL,
362
+ ];
266
363
  /** Narrowing type guard for a raw string that may name a rung. */
267
364
  export function isApprovalRung(value) {
268
365
  return typeof value === 'string' && APPROVAL_RUNGS.includes(value);
269
366
  }
270
367
  /** The rungs at which every gated call is rated by the model (§2.3, §2.4). */
271
368
  export function isRatedRung(rung) {
272
- return rung === 'auto-safe' || rung === 'full-auto';
369
+ return rung === 'assisted' || rung === 'auto';
370
+ }
371
+ /**
372
+ * [[EXT-29]] (§5) — the rung at which a `destructive` rating opens a **negotiation** with the rater
373
+ * instead of going to the human: the agent may revise the command or justify it, the rater re-rates
374
+ * with the exchange in view, and only a spent bound reaches a person.
375
+ *
376
+ * **This is the one predicate that separates `auto` from `assisted`, and it is deliberately ONE.**
377
+ * Three places have to agree about it — the decision mapping
378
+ * ({@link import('../core/shell/rater.js').mapVerdictToAction}, which returns `reject` here and
379
+ * `escalate` at `assisted`), the rating prompt (§5.2's wording rules are addressed to the agent, so
380
+ * they are turned on by this and not by whether a transcript happens to exist yet), and the runner
381
+ * that counts the rounds. Two of them agreeing and the third not is exactly how the two rated rungs
382
+ * would drift back into being the same posture with different names.
383
+ *
384
+ * Written as a `=== 'auto'` test rather than as "rated but not assisted" so that a sixth rung has to
385
+ * be classified deliberately rather than inheriting a negotiation by omission.
386
+ */
387
+ export function isNegotiatingRung(rung) {
388
+ return rung === 'auto';
389
+ }
390
+ /**
391
+ * The rungs that decide a gated call **without a model** — `manual` and `write` (§2.1, §2.2).
392
+ * Everything they do not auto-grant goes to the human, so these are the two rungs a user picks in
393
+ * order to read and approve every tool call themselves.
394
+ *
395
+ * The complement of {@link isRatedRung} plus `bypass`; written out rather than negated so that a
396
+ * sixth rung would have to be classified deliberately instead of defaulting into this set.
397
+ */
398
+ export function isDeterministicRung(rung) {
399
+ return rung === 'manual' || rung === 'write';
400
+ }
401
+ /**
402
+ * **The one rule: does `rung` gate this tool — i.e. must this call be decided rather than simply
403
+ * run?** Everything else in this area is a projection of this predicate over a set of names.
404
+ *
405
+ * - The shell is gated whenever the shell gate is on, at EVERY rung (`bypass` included, so §2.5's
406
+ * deny list can still fire — see the `bypass` arm of `GthAgentRunner.decideToolApproval`).
407
+ * - At the two **deterministic** rungs, a tool is gated when the rung's own grant does not cover its
408
+ * access class ({@link isAccessClassGrantedAtRung}). At `manual` that leaves only the built-in
409
+ * READ tools free; at `write`, the built-in read and write tools. The write built-ins, the shell,
410
+ * deepagents' `execute`, MCP tools and custom/agent-authored tools all escalate to the human.
411
+ * - At `assisted`, `auto` and `bypass` nothing but the shell is gated. **That split is
412
+ * deliberate and load-bearing, not tidiness.** At a rated rung a gated non-shell call reaches the
413
+ * `subject.kind !== 'shell'` arm of `GthAgentRunner.decideToolApproval`, which floors it at
414
+ * `destructive` and sends it to the human *with no rating call*, because §4.3 keeps the rater on
415
+ * the shell until [[EXT-30]]. Gating there would silently turn every MCP call at `assisted` into
416
+ * a human prompt — a UX change belonging to EXT-30, not to the two rungs whose published
417
+ * descriptions this predicate makes true.
418
+ *
419
+ * `gateShell` only ever WIDENS the result. At a deterministic rung the shell is gated by its own
420
+ * (absent) access class if it is bound at all, so `gateShell: false` does not exempt it — an
421
+ * exemption keyed to one tool NAME is the defect class this predicate exists to remove. In practice
422
+ * a disabled shell tool is never bound, so the two agree.
423
+ *
424
+ * **This takes no bound toolset**, which is what lets `GthAgentRunner` ask it about a single
425
+ * arriving call: the runner sees the names the graph registered, and on the deep backend that list
426
+ * omits tools deepagents registers itself. A decision that consulted a bound list would grant
427
+ * `execute` at `manual` purely because the runner could not see it.
428
+ */
429
+ export function isToolGatedAtRung(options) {
430
+ const { toolName, rung, gateShell } = options;
431
+ if (gateShell && toolName === SHELL_TOOL_NAME)
432
+ return true;
433
+ if (!isDeterministicRung(rung))
434
+ return false;
435
+ return !isAccessClassGrantedAtRung(toolName, rung);
436
+ }
437
+ /**
438
+ * **The LIVE gated set: which bound tools the rung in force actually gates.** What a decision is
439
+ * measured against — the tool descriptions the model reads (§4.5) and the rater's granted-tools
440
+ * summary (§4.4) are both built from this, so neither can tell the model a tool is free while the
441
+ * gate escalates it.
442
+ *
443
+ * **It is NOT what the backends wire into the interrupt.** That is
444
+ * {@link resolveInterruptToolNames}, and the two are different sets on purpose: the interrupt is
445
+ * installed once, at agent init, while `/approvals <rung>` moves the rung underneath it for the rest
446
+ * of the session. A set that carried the rung would be frozen at the rung the session started on —
447
+ * and since the default is `assisted`, typing `/approvals manual` would leave exactly the write
448
+ * tools this design escalates ungated. So the interrupt is wired rung-independently and
449
+ * `GthAgentRunner.decideToolApproval` consults {@link isToolGatedAtRung} against the LIVE rung.
450
+ *
451
+ * **Derived from the bound toolset, never a hand-written list.** A static list of built-ins would
452
+ * leave MCP, custom and agent-authored tools out — the exact tools with no access class and so the
453
+ * exact tools the deterministic rungs must escalate. `boundToolNames` must therefore be the FINAL
454
+ * toolset the graph is handed, including tools the graph builder registers itself (deepagents'
455
+ * filesystem tools, `execute`, `task` and `write_todos` never appear in the array gsloth passes it).
456
+ *
457
+ * Order is stable: the shell first, then bound order. Duplicates are collapsed, so a caller may pass
458
+ * overlapping name sources without deduplicating first.
459
+ */
460
+ export function resolveGatedToolNames(options) {
461
+ const { rung, gateShell, boundToolNames } = options;
462
+ return collectToolNames(gateShell, boundToolNames, (name) => isToolGatedAtRung({ toolName: name, rung, gateShell }));
463
+ }
464
+ /**
465
+ * **Which commands have something that ANSWERS an approval interrupt.**
466
+ *
467
+ * `GthAgentRunner` is the one component that drains a suspended graph
468
+ * (`resolveToolInterrupts` → `decideToolApproval`) and the one that holds the session rung, so every
469
+ * command it drives answers approvals and can move the rung under a running session.
470
+ *
471
+ * **The AG-UI server (`api`) does not.** It drives the agent directly — `agent.init` +
472
+ * `streamWithEvents` — and its resume path serves its own frontend-tool `interrupt()` stubs, not
473
+ * approvals. An approval interrupt raised there suspends the graph with nobody to resume it: the
474
+ * tool never runs, the client is never asked, and the turn simply ends with that tool call
475
+ * unanswered. Measured, not inferred.
476
+ *
477
+ * So a command that answers nothing must be handed **no approval interrupt beyond what the shell
478
+ * gate itself requires** — see the `interruptTools` wiring in both backends. In particular it must
479
+ * NOT be handed the LIVE set for its configured rung: that set is non-empty at `manual` and
480
+ * `write`, so it carries exactly the same trap, and `commands.api.approvals` (plus a root-level
481
+ * `approvals`, which applies to every command) puts an ordinary config on those rungs.
482
+ *
483
+ * **Total over {@link GthCommand} on purpose.** An eighth command has to be classified here before
484
+ * it compiles, rather than defaulting silently into "answers approvals". The property is really
485
+ * about the DRIVER and not about the command — a second server built under an existing command that
486
+ * drives the agent without `GthAgentRunner` would inherit the trap with this record fully populated
487
+ * — so the shape that cannot rot at all is for the constructing surface to declare it at its own
488
+ * call site.
489
+ *
490
+ * Approvals for the AG-UI surface are [[EXT-30]]'s to build; until then this keeps a rung the server
491
+ * cannot serve from silently swallowing the tool calls it was asked to make.
492
+ */
493
+ const COMMAND_ANSWERS_APPROVALS = {
494
+ ask: true,
495
+ chat: true,
496
+ code: true,
497
+ exec: true,
498
+ pr: true,
499
+ review: true,
500
+ /** The AG-UI server: it drives the agent itself and drains nothing. */
501
+ api: false,
502
+ };
503
+ /**
504
+ * {@link COMMAND_ANSWERS_APPROVALS} as a predicate. An unset command is a session driven by
505
+ * `GthAgentRunner` (nothing else leaves it unset), so it answers approvals.
506
+ *
507
+ * **`?? true` is the fail-safe default, not defensive noise.** The lookup yields `undefined` for a
508
+ * value outside {@link GthCommand}, and `undefined` is falsy — which would tell the caller to
509
+ * install NO approval interrupt, the one direction this predicate must never fail in. TypeScript
510
+ * makes that unreachable from inside this repo, but the function is re-exported from the public
511
+ * `@gaunt-sloth/core/config.js` barrel, so an untyped consumer can reach it. The coalesce restores
512
+ * runtime totality without weakening the compile-time totality the record already gives.
513
+ */
514
+ export function commandAnswersApprovals(command) {
515
+ return command === undefined ? true : (COMMAND_ANSWERS_APPROVALS[command] ?? true);
516
+ }
517
+ /**
518
+ * **The interrupt set: which tool names the backends wire into the approval interrupt.** Every bound
519
+ * tool that ANY rung could gate — the union of {@link resolveGatedToolNames} over
520
+ * {@link APPROVAL_RUNGS}, which in practice is the shell plus every bound tool that is not a
521
+ * built-in READ tool.
522
+ *
523
+ * One derivation for both backends, for the same reason {@link resolveShellApprovalGate} is one: the
524
+ * lean backend installs `humanInTheLoopMiddleware` directly and the deep backend installs the very
525
+ * same middleware through deepagents' `interruptOn`, and a set computed twice is a set that drifts.
526
+ *
527
+ * **Deliberately rung-independent.** The interrupt is installed once, when the agent is built, and
528
+ * `/approvals <rung>` then moves the rung for the rest of the session without rebuilding it. Only a
529
+ * set that covers every rung can survive that: the interrupt fires and
530
+ * `GthAgentRunner.decideToolApproval` decides on the rung in force, which is where the rung has
531
+ * always been read. **Wiring wider does not gate wider** — a call the live rung does not gate is
532
+ * approved there with no rating call and no prompt, so `assisted`, `auto` and `bypass` behave
533
+ * exactly as they do when the interrupt holds the shell alone.
534
+ *
535
+ * **Only for a command that answers approvals** ({@link commandAnswersApprovals}). A surface that
536
+ * drains nothing gets the shell-gate set instead, because a rung-independent set there parks tool
537
+ * calls nobody can reach.
538
+ */
539
+ export function resolveInterruptToolNames(options) {
540
+ const { gateShell, boundToolNames } = options;
541
+ return collectToolNames(gateShell, boundToolNames, (name) => APPROVAL_RUNGS.some((rung) => isToolGatedAtRung({ toolName: name, rung, gateShell })));
542
+ }
543
+ /**
544
+ * Shared body of the two resolvers above: the shell first (when gated), then the bound names the
545
+ * caller's predicate selects, in bound order, deduplicated, with nameless entries dropped.
546
+ */
547
+ function collectToolNames(gateShell, boundToolNames, include) {
548
+ const names = [];
549
+ const seen = new Set();
550
+ const add = (name) => {
551
+ if (typeof name !== 'string' || name.length === 0 || seen.has(name))
552
+ return;
553
+ seen.add(name);
554
+ names.push(name);
555
+ };
556
+ if (gateShell)
557
+ add(SHELL_TOOL_NAME);
558
+ for (const name of boundToolNames) {
559
+ if (typeof name === 'string' && name.length > 0 && include(name))
560
+ add(name);
561
+ }
562
+ return names;
273
563
  }
274
564
  /**
275
565
  * §4.7 — the four MCP `ToolAnnotations` hint names, and the whole vocabulary. It is the same list
@@ -296,13 +586,13 @@ export const TOOL_ANNOTATION_HINTS = [
296
586
  'openWorldHint',
297
587
  ];
298
588
  /**
299
- * §1.1 — **the default rung is `auto-safe`, everywhere.** It is the default in every interactive
589
+ * §1.1 — **the default rung is `assisted`, everywhere.** It is the default in every interactive
300
590
  * context, it does NOT vary with the configured model, and there is no separate non-interactive
301
591
  * default. What changes without a human is what an escalation *does* (§6.2: an immediate non-zero
302
592
  * exit, never an approval), not which rung the session starts on. A context-dependent default
303
593
  * would reintroduce exactly the hidden branching this ladder exists to remove.
304
594
  */
305
- export const DEFAULT_APPROVAL_RUNG = 'auto-safe';
595
+ export const DEFAULT_APPROVAL_RUNG = 'assisted';
306
596
  /** Normalize the scalar/object union to the object form. The scalar is sugar for `{ mode }`. */
307
597
  function toApprovalsObject(raw) {
308
598
  if (raw === undefined)
@@ -314,7 +604,7 @@ function toApprovalsObject(raw) {
314
604
  /**
315
605
  * CFG-27 — resolve the effective {@link ResolvedApprovals} for the active command.
316
606
  *
317
- * There is no defaults *matrix*: §1.1 makes `auto-safe` the default in every context, so this
607
+ * There is no defaults *matrix*: §1.1 makes `assisted` the default in every context, so this
318
608
  * resolver neither detects nor accepts a "context". Precedence is the only thing it decides, and
319
609
  * §9.1 splits it in two:
320
610
  *
@@ -400,10 +690,15 @@ export function resolveApprovals(config, command) {
400
690
  *
401
691
  * What each rung then does is decided in `decideToolApproval`, not here:
402
692
  * • `bypass` — deny list, then approve without prompting or rating.
403
- * • `read-only`/`write` — deny list, allow-list, else escalate to the human.
404
- * • `auto-safe`/`full-auto` — deny list, allow-list, then the rater.
405
- * • With the shell tool disabled — or on a non-dev-tools command (chat/api/…) — nothing is gated
406
- * and nothing is announced.
693
+ * • `manual`/`write` — deny list, allow-list, else escalate to the human.
694
+ * • `assisted`/`auto` — deny list, allow-list, then the rater.
695
+ *
696
+ * **This decides the SHELL's gating only, and it is not the whole gated set.** With the shell tool
697
+ * disabled — or on a non-dev-tools command (chat/api/…) — nothing about the shell is gated and
698
+ * nothing is announced, but at `manual` and `write` {@link resolveGatedToolNames} still gates
699
+ * every bound tool the rung does not auto-grant, so an MCP call in a plain `chat` session is
700
+ * escalated there. Read `gateShell` as "does the shell need the interrupt", never as "is the
701
+ * interrupt needed at all".
407
702
  *
408
703
  * Shell enablement itself is resolved through {@link getEffectiveDevToolsConfig} +
409
704
  * {@link isShellToolEnabled}, so the gate stays in lockstep with where `GthDevToolkit` actually
@@ -422,19 +717,25 @@ export function resolveShellApprovalGate(config, command) {
422
717
  notice: {
423
718
  level: StatusLevel.WARNING,
424
719
  message: 'Shell tool (run_shell_command): commands run without asking and without rating ' +
425
- '(approvals: bypass). Only your deny list still applies — type /approvals auto-safe to ' +
720
+ '(approvals: bypass). Only your deny list still applies — type /approvals assisted to ' +
426
721
  'rate commands again.',
427
722
  },
428
723
  };
429
724
  }
430
725
  if (isRatedRung(rung)) {
726
+ // **Both rated modes get the SAME tail, because it is true of both and it is all this line
727
+ // promises**: nothing the rater does not clear simply runs. They reach it differently — at
728
+ // `assisted` an unsafe-looking command goes to the human, at `auto` ([[EXT-29]] §5) it is
729
+ // refused back to the agent first and reaches the human when a bound is spent — and at `auto`
730
+ // both halves happen within one session, so a per-mode tail could only pick one of them. This
731
+ // is the startup notice a user meets while working out what their config does; the mode's own
732
+ // description ({@link APPROVAL_RUNG_DESCRIPTIONS}) is where the difference is stated.
431
733
  return {
432
734
  gateShell,
433
735
  notice: {
434
736
  level: StatusLevel.INFO,
435
737
  message: `Shell tool (run_shell_command) rated by the auto-rater (approvals: ${rung}); ` +
436
- 'anything it does not rate safe is still ' +
437
- (rung === 'auto-safe' ? 'escalated to you.' : 'refused or escalated.'),
738
+ 'anything it does not rate safe is still refused or escalated to you.',
438
739
  },
439
740
  };
440
741
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell-policy.js","sourceRoot":"","sources":["../../src/config/shell-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAmB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAwElE;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,WAA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