@gaunt-sloth/core 2.0.0-alpha.9 → 2.0.0-beta.0

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 (275) hide show
  1. package/.gsloth.review.md +2 -0
  2. package/README.md +71 -20
  3. package/dist/config/colour.d.ts +38 -0
  4. package/dist/config/colour.js +36 -0
  5. package/dist/config/colour.js.map +1 -0
  6. package/dist/config/configDiscovery.d.ts +79 -0
  7. package/dist/config/configDiscovery.js +80 -0
  8. package/dist/config/configDiscovery.js.map +1 -0
  9. package/dist/config/defaults.d.ts +20 -20
  10. package/dist/config/defaults.js +10 -8
  11. package/dist/config/defaults.js.map +1 -1
  12. package/dist/config/filesystem-tools.d.ts +41 -0
  13. package/dist/config/filesystem-tools.js +56 -0
  14. package/dist/config/filesystem-tools.js.map +1 -0
  15. package/dist/config/loader.d.ts +171 -19
  16. package/dist/config/loader.js +1054 -144
  17. package/dist/config/loader.js.map +1 -1
  18. package/dist/config/mouse.d.ts +50 -0
  19. package/dist/config/mouse.js +44 -0
  20. package/dist/config/mouse.js.map +1 -0
  21. package/dist/config/profiles.d.ts +68 -0
  22. package/dist/config/profiles.js +93 -0
  23. package/dist/config/profiles.js.map +1 -0
  24. package/dist/config/providerKeys.d.ts +69 -0
  25. package/dist/config/providerKeys.js +69 -0
  26. package/dist/config/providerKeys.js.map +1 -0
  27. package/dist/config/schema.d.ts +2671 -138
  28. package/dist/config/schema.js +1361 -85
  29. package/dist/config/schema.js.map +1 -1
  30. package/dist/config/shell-policy.d.ts +899 -111
  31. package/dist/config/shell-policy.js +800 -70
  32. package/dist/config/shell-policy.js.map +1 -1
  33. package/dist/config/tool-descriptions.d.ts +211 -0
  34. package/dist/config/tool-descriptions.js +272 -0
  35. package/dist/config/tool-descriptions.js.map +1 -0
  36. package/dist/config/types.d.ts +352 -41
  37. package/dist/config/types.js +1 -0
  38. package/dist/config/types.js.map +1 -1
  39. package/dist/config.d.ts +35 -1
  40. package/dist/config.js +16 -1
  41. package/dist/config.js.map +1 -1
  42. package/dist/constants.d.ts +28 -1
  43. package/dist/constants.js +28 -1
  44. package/dist/constants.js.map +1 -1
  45. package/dist/core/GthAbstractAgent.d.ts +166 -11
  46. package/dist/core/GthAbstractAgent.js +484 -45
  47. package/dist/core/GthAbstractAgent.js.map +1 -1
  48. package/dist/core/GthAgentRunner.d.ts +543 -57
  49. package/dist/core/GthAgentRunner.js +1494 -140
  50. package/dist/core/GthAgentRunner.js.map +1 -1
  51. package/dist/core/GthLangChainAgent.d.ts +117 -2
  52. package/dist/core/GthLangChainAgent.js +602 -29
  53. package/dist/core/GthLangChainAgent.js.map +1 -1
  54. package/dist/core/approvals/annotations.d.ts +122 -0
  55. package/dist/core/approvals/annotations.js +137 -0
  56. package/dist/core/approvals/annotations.js.map +1 -0
  57. package/dist/core/approvals/grants.d.ts +216 -0
  58. package/dist/core/approvals/grants.js +469 -0
  59. package/dist/core/approvals/grants.js.map +1 -0
  60. package/dist/core/approvals/matcher.d.ts +202 -0
  61. package/dist/core/approvals/matcher.js +267 -0
  62. package/dist/core/approvals/matcher.js.map +1 -0
  63. package/dist/core/approvals/mcpSubjects.d.ts +40 -0
  64. package/dist/core/approvals/mcpSubjects.js +99 -0
  65. package/dist/core/approvals/mcpSubjects.js.map +1 -0
  66. package/dist/core/approvals/promptHeader.d.ts +28 -0
  67. package/dist/core/approvals/promptHeader.js +62 -0
  68. package/dist/core/approvals/promptHeader.js.map +1 -0
  69. package/dist/core/approvals/toolAnnotationSources.d.ts +105 -0
  70. package/dist/core/approvals/toolAnnotationSources.js +277 -0
  71. package/dist/core/approvals/toolAnnotationSources.js.map +1 -0
  72. package/dist/core/approvals/toolHost.d.ts +46 -0
  73. package/dist/core/approvals/toolHost.js +108 -0
  74. package/dist/core/approvals/toolHost.js.map +1 -0
  75. package/dist/core/debugCapture.d.ts +74 -0
  76. package/dist/core/debugCapture.js +100 -0
  77. package/dist/core/debugCapture.js.map +1 -0
  78. package/dist/core/gthLeanAgentFactory.d.ts +4 -4
  79. package/dist/core/gthLeanAgentFactory.js +4 -4
  80. package/dist/core/launchBanner.d.ts +127 -0
  81. package/dist/core/launchBanner.js +414 -0
  82. package/dist/core/launchBanner.js.map +1 -0
  83. package/dist/core/modelLabel.d.ts +19 -0
  84. package/dist/core/modelLabel.js +26 -0
  85. package/dist/core/modelLabel.js.map +1 -0
  86. package/dist/core/plainToolIndication.d.ts +15 -0
  87. package/dist/core/plainToolIndication.js +174 -0
  88. package/dist/core/plainToolIndication.js.map +1 -0
  89. package/dist/core/reasoningBlocks.d.ts +65 -0
  90. package/dist/core/reasoningBlocks.js +103 -0
  91. package/dist/core/reasoningBlocks.js.map +1 -0
  92. package/dist/core/refusal.d.ts +53 -0
  93. package/dist/core/refusal.js +133 -0
  94. package/dist/core/refusal.js.map +1 -0
  95. package/dist/core/runHeader.d.ts +38 -0
  96. package/dist/core/runHeader.js +42 -0
  97. package/dist/core/runHeader.js.map +1 -0
  98. package/dist/core/runStats.d.ts +14 -3
  99. package/dist/core/runStats.js +48 -3
  100. package/dist/core/runStats.js.map +1 -1
  101. package/dist/core/shell/ShellCommandFailedError.d.ts +3 -4
  102. package/dist/core/shell/ShellCommandFailedError.js +3 -4
  103. package/dist/core/shell/ShellCommandFailedError.js.map +1 -1
  104. package/dist/core/shell/abstention.d.ts +88 -0
  105. package/dist/core/shell/abstention.js +184 -0
  106. package/dist/core/shell/abstention.js.map +1 -0
  107. package/dist/core/shell/approvalCapture.d.ts +271 -0
  108. package/dist/core/shell/approvalCapture.js +108 -0
  109. package/dist/core/shell/approvalCapture.js.map +1 -0
  110. package/dist/core/shell/approvalStop.d.ts +123 -0
  111. package/dist/core/shell/approvalStop.js +269 -0
  112. package/dist/core/shell/approvalStop.js.map +1 -0
  113. package/dist/core/shell/arity.d.ts +6 -0
  114. package/dist/core/shell/arity.js +20 -6
  115. package/dist/core/shell/arity.js.map +1 -1
  116. package/dist/core/shell/denylist.d.ts +11 -0
  117. package/dist/core/shell/denylist.js +37 -0
  118. package/dist/core/shell/denylist.js.map +1 -0
  119. package/dist/core/shell/escalationSeverity.d.ts +141 -0
  120. package/dist/core/shell/escalationSeverity.js +89 -0
  121. package/dist/core/shell/escalationSeverity.js.map +1 -0
  122. package/dist/core/shell/framing.d.ts +190 -0
  123. package/dist/core/shell/framing.js +633 -0
  124. package/dist/core/shell/framing.js.map +1 -0
  125. package/dist/core/shell/hardline.d.ts +103 -0
  126. package/dist/core/shell/hardline.js +780 -0
  127. package/dist/core/shell/hardline.js.map +1 -0
  128. package/dist/core/shell/negotiation.d.ts +328 -0
  129. package/dist/core/shell/negotiation.js +488 -0
  130. package/dist/core/shell/negotiation.js.map +1 -0
  131. package/dist/core/shell/normalize.d.ts +44 -4
  132. package/dist/core/shell/normalize.js +61 -7
  133. package/dist/core/shell/normalize.js.map +1 -1
  134. package/dist/core/shell/openWorld.d.ts +263 -0
  135. package/dist/core/shell/openWorld.js +1188 -0
  136. package/dist/core/shell/openWorld.js.map +1 -0
  137. package/dist/core/shell/rater.d.ts +873 -0
  138. package/dist/core/shell/rater.js +1454 -0
  139. package/dist/core/shell/rater.js.map +1 -0
  140. package/dist/core/shell/raterModel.d.ts +41 -0
  141. package/dist/core/shell/raterModel.js +51 -0
  142. package/dist/core/shell/raterModel.js.map +1 -0
  143. package/dist/core/shell/raterVocabulary.d.ts +121 -0
  144. package/dist/core/shell/raterVocabulary.js +116 -0
  145. package/dist/core/shell/raterVocabulary.js.map +1 -0
  146. package/dist/core/shell/rejection.d.ts +69 -0
  147. package/dist/core/shell/rejection.js +38 -0
  148. package/dist/core/shell/rejection.js.map +1 -0
  149. package/dist/core/toolCallRepair/grammar.d.ts +41 -0
  150. package/dist/core/toolCallRepair/grammar.js +116 -0
  151. package/dist/core/toolCallRepair/grammar.js.map +1 -0
  152. package/dist/core/toolCallRepair/index.d.ts +2 -0
  153. package/dist/core/toolCallRepair/index.js +7 -0
  154. package/dist/core/toolCallRepair/index.js.map +1 -0
  155. package/dist/core/toolCallRepair/payload.d.ts +36 -0
  156. package/dist/core/toolCallRepair/payload.js +341 -0
  157. package/dist/core/toolCallRepair/payload.js.map +1 -0
  158. package/dist/core/toolCallRepair/promote.d.ts +45 -0
  159. package/dist/core/toolCallRepair/promote.js +90 -0
  160. package/dist/core/toolCallRepair/promote.js.map +1 -0
  161. package/dist/core/toolDisplay.d.ts +123 -0
  162. package/dist/core/toolDisplay.js +451 -0
  163. package/dist/core/toolDisplay.js.map +1 -0
  164. package/dist/core/toolOutputChannel.d.ts +95 -0
  165. package/dist/core/toolOutputChannel.js +165 -0
  166. package/dist/core/toolOutputChannel.js.map +1 -0
  167. package/dist/core/types.d.ts +349 -16
  168. package/dist/core/types.js.map +1 -1
  169. package/dist/history/historyFormat.d.ts +12 -3
  170. package/dist/history/historyFormat.js +50 -8
  171. package/dist/history/historyFormat.js.map +1 -1
  172. package/dist/history/historyStore.d.ts +77 -0
  173. package/dist/history/historyStore.js +173 -6
  174. package/dist/history/historyStore.js.map +1 -1
  175. package/dist/history/recordSession.d.ts +10 -1
  176. package/dist/history/recordSession.js +27 -0
  177. package/dist/history/recordSession.js.map +1 -1
  178. package/dist/providers/anthropic.js +12 -0
  179. package/dist/providers/anthropic.js.map +1 -1
  180. package/dist/providers/configurationPassthrough.d.ts +107 -0
  181. package/dist/providers/configurationPassthrough.js +148 -0
  182. package/dist/providers/configurationPassthrough.js.map +1 -0
  183. package/dist/providers/geminiSchemaSanitizer.d.ts +55 -0
  184. package/dist/providers/geminiSchemaSanitizer.js +347 -0
  185. package/dist/providers/geminiSchemaSanitizer.js.map +1 -0
  186. package/dist/providers/geminiThinking.d.ts +60 -0
  187. package/dist/providers/geminiThinking.js +92 -0
  188. package/dist/providers/geminiThinking.js.map +1 -0
  189. package/dist/providers/google-genai.js +18 -1
  190. package/dist/providers/google-genai.js.map +1 -1
  191. package/dist/providers/groq.js +12 -0
  192. package/dist/providers/groq.js.map +1 -1
  193. package/dist/providers/huggingface.d.ts +25 -0
  194. package/dist/providers/huggingface.js +69 -0
  195. package/dist/providers/huggingface.js.map +1 -0
  196. package/dist/providers/modelCatalog.d.ts +109 -0
  197. package/dist/providers/modelCatalog.js +245 -0
  198. package/dist/providers/modelCatalog.js.map +1 -0
  199. package/dist/providers/modelDiscovery.d.ts +99 -5
  200. package/dist/providers/modelDiscovery.js +191 -35
  201. package/dist/providers/modelDiscovery.js.map +1 -1
  202. package/dist/providers/ollama.d.ts +18 -4
  203. package/dist/providers/ollama.js +67 -37
  204. package/dist/providers/ollama.js.map +1 -1
  205. package/dist/providers/openai.js +34 -0
  206. package/dist/providers/openai.js.map +1 -1
  207. package/dist/providers/openrouter.d.ts +26 -4
  208. package/dist/providers/openrouter.js +83 -26
  209. package/dist/providers/openrouter.js.map +1 -1
  210. package/dist/providers/vertexai.js +19 -1
  211. package/dist/providers/vertexai.js.map +1 -1
  212. package/dist/providers/xai.js +20 -0
  213. package/dist/providers/xai.js.map +1 -1
  214. package/dist/runtime/askStructured.d.ts +105 -0
  215. package/dist/runtime/askStructured.js +120 -0
  216. package/dist/runtime/askStructured.js.map +1 -0
  217. package/dist/runtime/conversation.d.ts +64 -0
  218. package/dist/runtime/conversation.js +171 -0
  219. package/dist/runtime/conversation.js.map +1 -0
  220. package/dist/runtime/singleShot.d.ts +37 -6
  221. package/dist/runtime/singleShot.js +113 -67
  222. package/dist/runtime/singleShot.js.map +1 -1
  223. package/dist/runtime/structuredOutput.d.ts +104 -0
  224. package/dist/runtime/structuredOutput.js +393 -0
  225. package/dist/runtime/structuredOutput.js.map +1 -0
  226. package/dist/utils/ProgressIndicator.d.ts +21 -0
  227. package/dist/utils/ProgressIndicator.js +30 -3
  228. package/dist/utils/ProgressIndicator.js.map +1 -1
  229. package/dist/utils/aiignoreUtils.js.map +1 -1
  230. package/dist/utils/binaryOutputUtils.js.map +1 -1
  231. package/dist/utils/consoleUtils.d.ts +95 -0
  232. package/dist/utils/consoleUtils.js +112 -2
  233. package/dist/utils/consoleUtils.js.map +1 -1
  234. package/dist/utils/crashHandler.d.ts +87 -0
  235. package/dist/utils/crashHandler.js +128 -0
  236. package/dist/utils/crashHandler.js.map +1 -0
  237. package/dist/utils/debugDump.d.ts +134 -0
  238. package/dist/utils/debugDump.js +381 -0
  239. package/dist/utils/debugDump.js.map +1 -0
  240. package/dist/utils/debugUtils.d.ts +13 -4
  241. package/dist/utils/debugUtils.js +36 -13
  242. package/dist/utils/debugUtils.js.map +1 -1
  243. package/dist/utils/displayWidth.d.ts +53 -0
  244. package/dist/utils/displayWidth.js +195 -0
  245. package/dist/utils/displayWidth.js.map +1 -0
  246. package/dist/utils/fileUtils.js.map +1 -1
  247. package/dist/utils/globalConfigUtils.d.ts +14 -2
  248. package/dist/utils/globalConfigUtils.js +22 -4
  249. package/dist/utils/globalConfigUtils.js.map +1 -1
  250. package/dist/utils/llmUtils.d.ts +39 -8
  251. package/dist/utils/llmUtils.js +76 -8
  252. package/dist/utils/llmUtils.js.map +1 -1
  253. package/dist/utils/redactSecrets.d.ts +63 -0
  254. package/dist/utils/redactSecrets.js +286 -0
  255. package/dist/utils/redactSecrets.js.map +1 -0
  256. package/dist/utils/systemPromptNotes.d.ts +222 -0
  257. package/dist/utils/systemPromptNotes.js +338 -0
  258. package/dist/utils/systemPromptNotes.js.map +1 -0
  259. package/dist/utils/systemUtils.d.ts +18 -1
  260. package/dist/utils/systemUtils.js +38 -3
  261. package/dist/utils/systemUtils.js.map +1 -1
  262. package/dist/utils/toolMatching.d.ts +30 -0
  263. package/dist/utils/toolMatching.js +44 -0
  264. package/dist/utils/toolMatching.js.map +1 -0
  265. package/dist/utils/untrustedText.d.ts +86 -0
  266. package/dist/utils/untrustedText.js +101 -0
  267. package/dist/utils/untrustedText.js.map +1 -0
  268. package/package.json +21 -7
  269. package/schema/gsloth-config.schema.json +1921 -326
  270. package/dist/core/shell/allowlist.d.ts +0 -75
  271. package/dist/core/shell/allowlist.js +0 -187
  272. package/dist/core/shell/allowlist.js.map +0 -1
  273. package/dist/core/shell/judge.d.ts +0 -161
  274. package/dist/core/shell/judge.js +0 -261
  275. package/dist/core/shell/judge.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rater.js","sourceRoot":"","sources":["../../../src/core/shell/rater.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,iGAAiG;AACjG,gGAAgG;AAChG,qCAAqC;AACrC,OAAO,EACL,wBAAwB,EAExB,eAAe,GAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;;GAIG;AACH,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,oCAAoC,CAAC;AAO5C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC;SACP,IAAI,CAAC,cAAc,CAAC;SACpB,QAAQ,CACP,+CAA+C;QAC7C,4BAA4B;QAC5B,sFAAsF;QACtF,yDAAyD;QACzD,oFAAoF;QACpF,wFAAwF;QACxF,sFAAsF;QACtF,SAAS,CACZ;IACH,MA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AAS,EAAE,CAAC;IAClF,IAAI,SAAS,CAAC,OAAO,KAAK,cAAc;QAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC5F,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @module core/shell/raterModel
3
+ *
4
+ * CFG-26 — resolve the model the AI rater rates with when `approvals.rater.profile` names an
5
+ * identity profile. Without this the profile is validated and then IGNORED: the config parses,
6
+ * `gth config validate` passes, CFG-24's first-run dialog promises "set a stronger model as the
7
+ * rater later via approvals.rater.profile" — and the runtime quietly rates with the main model.
8
+ *
9
+ * Why it matters concretely (QA-5 rater baseline, 2026-07-26): rating quality varies enormously by
10
+ * model. A local `gemma4:12b` scored 61.7% tier accuracy; `llama3.2:1b` scored 25.5% and rated
11
+ * EVERY safe command `danger`. Pointing the rater at a competent model is the difference between
12
+ * `auto` being useful and being `ask` with a bill attached — so the knob has to actually work.
13
+ *
14
+ * Kept in its own module (rather than inline in {@link GthAgentRunner}) for two reasons: the
15
+ * runner's specs can mock THIS seam instead of the whole `#src/config.js` barrel, and the
16
+ * global-state discipline below lives in exactly one place.
17
+ */
18
+ import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
19
+ /**
20
+ * Load the identity profile named by `approvals.rater.profile` and return ITS model.
21
+ *
22
+ * Strict, per [[GS2-62]]: a profile that cannot be loaded, or that resolves to a config with no
23
+ * usable model, is an ERROR — never a silent fallback to the session's main model. A silent
24
+ * fallback is precisely the failure this function exists to remove (the user asked for a stronger
25
+ * rater and would have been given the weak one, with nothing said). The profile's EXISTENCE is
26
+ * already validated at config-load time by the loader (and by `gth config validate`); this is the
27
+ * later, separate question of whether it yields a usable model.
28
+ *
29
+ * **Global-state discipline.** `initConfig` re-runs project discovery and calls
30
+ * `setProjectDir(discovered?.dir)` as a side effect. That is correct for the SESSION's config load
31
+ * but wrong for this subsidiary one: a rater sub-config must never re-root the session. Because
32
+ * this call passes no `customConfigPath`, discovery re-walks from cwd and can legitimately land on
33
+ * a different dir than the session did (e.g. a session started with `-c <path>`), which would then
34
+ * silently repoint every `getProjectDir()` consumer — prompt files, output paths, the shell
35
+ * allow-list file, debug dumps. So the project dir is snapshotted and restored in a `finally`.
36
+ *
37
+ * @param profile The identity profile name from `approvals.rater.profile`.
38
+ * @returns The profile's chat model, ready to be handed to `rateShellCommand`'s `model` option.
39
+ * @throws When the profile's config cannot be loaded or carries no usable model.
40
+ */
41
+ export declare function resolveRaterModel(profile: string): Promise<BaseChatModel>;
@@ -0,0 +1,51 @@
1
+ import { initConfig } from '#src/config/loader.js';
2
+ import { peekProjectDir, setProjectDir } from '#src/utils/systemUtils.js';
3
+ /**
4
+ * Load the identity profile named by `approvals.rater.profile` and return ITS model.
5
+ *
6
+ * Strict, per [[GS2-62]]: a profile that cannot be loaded, or that resolves to a config with no
7
+ * usable model, is an ERROR — never a silent fallback to the session's main model. A silent
8
+ * fallback is precisely the failure this function exists to remove (the user asked for a stronger
9
+ * rater and would have been given the weak one, with nothing said). The profile's EXISTENCE is
10
+ * already validated at config-load time by the loader (and by `gth config validate`); this is the
11
+ * later, separate question of whether it yields a usable model.
12
+ *
13
+ * **Global-state discipline.** `initConfig` re-runs project discovery and calls
14
+ * `setProjectDir(discovered?.dir)` as a side effect. That is correct for the SESSION's config load
15
+ * but wrong for this subsidiary one: a rater sub-config must never re-root the session. Because
16
+ * this call passes no `customConfigPath`, discovery re-walks from cwd and can legitimately land on
17
+ * a different dir than the session did (e.g. a session started with `-c <path>`), which would then
18
+ * silently repoint every `getProjectDir()` consumer — prompt files, output paths, the shell
19
+ * allow-list file, debug dumps. So the project dir is snapshotted and restored in a `finally`.
20
+ *
21
+ * @param profile The identity profile name from `approvals.rater.profile`.
22
+ * @returns The profile's chat model, ready to be handed to `rateShellCommand`'s `model` option.
23
+ * @throws When the profile's config cannot be loaded or carries no usable model.
24
+ */
25
+ export async function resolveRaterModel(profile) {
26
+ // Snapshot BEFORE initConfig's discovery mutates it (see the note above). `peekProjectDir`
27
+ // rather than `getProjectDir` so an UNSET dir is restored as unset, not pinned to today's cwd.
28
+ const projectDirBefore = peekProjectDir();
29
+ let raterConfig;
30
+ try {
31
+ raterConfig = await initConfig({ identityProfile: profile });
32
+ }
33
+ catch (error) {
34
+ throw new Error(`Could not load the AI rater profile "${profile}" named by approvals.rater.profile: ` +
35
+ `${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? { cause: error } : undefined);
36
+ }
37
+ finally {
38
+ setProjectDir(projectDirBefore);
39
+ }
40
+ const model = raterConfig?.llm;
41
+ // Guard explicitly rather than returning `undefined`: `rateShellCommand` falls back to
42
+ // `config.llm` when its `model` option is undefined, so handing it undefined here would
43
+ // reintroduce the very silent fallback this module removes.
44
+ if (!model || typeof model.withStructuredOutput !== 'function') {
45
+ throw new Error(`The AI rater profile "${profile}" resolved to a config with no usable model. ` +
46
+ 'Give that profile a valid `llm`, or remove approvals.rater.profile to rate with the ' +
47
+ 'session model.');
48
+ }
49
+ return model;
50
+ }
51
+ //# sourceMappingURL=raterModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raterModel.js","sourceRoot":"","sources":["../../../src/core/shell/raterModel.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAe;IACrD,2FAA2F;IAC3F,+FAA+F;IAC/F,MAAM,gBAAgB,GAAG,cAAc,EAAE,CAAC;IAC1C,IAAI,WAAW,CAAC;IAChB,IAAI,CAAC;QACH,WAAW,GAAG,MAAM,UAAU,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,wCAAwC,OAAO,sCAAsC;YACnF,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC7D,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CACtD,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,EAAE,GAAG,CAAC;IAC/B,uFAAuF;IACvF,wFAAwF;IACxF,4DAA4D;IAC5D,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,oBAAoB,KAAK,UAAU,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CACb,yBAAyB,OAAO,+CAA+C;YAC7E,sFAAsF;YACtF,gBAAgB,CACnB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @module core/shell/raterVocabulary
3
+ *
4
+ * **The approvals gate's closed vocabularies, and nothing else.** Three lists: the outcomes a rater
5
+ * may return, the actions the gate may resolve to, and the deterministic preflights that can floor a
6
+ * command. Each is the SINGLE place its members are written down.
7
+ *
8
+ * ## Why they live apart from {@link ./rater.js}, which owns their meaning
9
+ *
10
+ * A vocabulary has two kinds of consumer. The gate itself needs the words *and* the machinery around
11
+ * them. A **checker** — a schema, a report axis, a compile-time guard in another package — needs only
12
+ * the words, and must be able to read them without loading a rating prompt, a structured-output
13
+ * boundary and a chat-model client. `rater.js` imports LangChain and Zod; a suite parser that had to
14
+ * import it to learn which actions exist would pull the whole model layer into a parse.
15
+ *
16
+ * So this module has **no imports at all**, and it must stay that way. `rater.js` re-exports every
17
+ * symbol here, so the gate's own callers are unaffected and there is exactly one spelling of each
18
+ * word in the codebase.
19
+ *
20
+ * **A checker that RESTATES one of these lists is the failure this module exists to prevent.** A
21
+ * restated list does not grow when the gate grows: the new member is simply never recognised, and
22
+ * the checker keeps reporting success over a vocabulary it no longer covers. Derive from these
23
+ * arrays — ideally as a total `Record` keyed on the type, so a new member is a compile error rather
24
+ * than a silence.
25
+ */
26
+ /**
27
+ * (Spec §4.1) — the **four** outcomes the rater may return. There is no ordering knob and no
28
+ * threshold: each outcome's consequence is fixed by the rung
29
+ * ({@link import('./rater.js').mapVerdictToAction}).
30
+ *
31
+ * - `safe` — no harmful effect.
32
+ * - `destructive` — **the catch-all**: harmful, but recoverable from inside the session, and not
33
+ * an attack — **and anything the rater cannot assess**. The rating prompt defines it *by
34
+ * exclusion* ("not safe, not catastrophic and not an attack") precisely so no command can fall
35
+ * outside the four.
36
+ * - `catastrophic` — *can this be undone from inside the session?* Irreversible without something
37
+ * OUTSIDE the session: rescue media, a backup, a re-provision, a restore from a third party.
38
+ * Escalates at both rated rungs; never negotiable and never sticky (§4.2).
39
+ * - `attack` — *is something hostile acting here?* The command's own **structure** evidences
40
+ * compromise (§4.1.1: credential targeting, privilege escalation / permission weakening,
41
+ * persistence, deception, obfuscation). It is the only outcome that HALTS the run.
42
+ *
43
+ * **`catastrophic` and `attack` are not ranked against each other** — they ask different
44
+ * questions, and the spec says so explicitly. A command can be both; `attack` wins the
45
+ * *consequence* (a manipulated session cannot be trusted to continue) but MUST NOT swallow the
46
+ * finding — see the §6.1 clause in {@link import('./rater.js').buildRaterSystemPrompt}. Nothing
47
+ * here may be written as a severity comparison between the two.
48
+ */
49
+ export declare const RATER_OUTCOMES: readonly ['safe', 'destructive', 'catastrophic', 'attack'];
50
+ /** One outcome of {@link RATER_OUTCOMES}. */
51
+ export type RaterOutcome = (typeof RATER_OUTCOMES)[number];
52
+ /**
53
+ * The actions the approvals gate can resolve to for a single gated call, BEFORE the human prompt.
54
+ * {@link import('./rater.js').mapVerdictToAction} is the whole mapping from an outcome and a rung
55
+ * onto one of these, and its docblock carries the table.
56
+ *
57
+ * - `approve` — approve ONCE; do not touch the human or the allow-list.
58
+ * - `escalate` — fall through to the human approval callback, carrying the verdict when one
59
+ * exists. Where there is no human, §6.2 turns this into an immediate non-zero exit — that
60
+ * translation belongs to the runner, not to the mapping.
61
+ * - `halt` — **end the agent loop** (§4.2). Reserved for `attack`. It is not a rejection the
62
+ * model can respond to and offers it no moves; no rung except `bypass` can turn it into
63
+ * anything else.
64
+ * - `reject` — (§5): hand the rater's explanation back to the **agent** as the refused call's tool
65
+ * result (§7), opening a round of the negotiation. Returned for `destructive` at `auto` and
66
+ * nowhere else.
67
+ *
68
+ * **`reject` says the outcome is negotiable, NOT that the negotiation may continue.** The mapping is
69
+ * keyed on the rung and knows nothing about how many rounds have been spent; §5.3's consecutive cap
70
+ * and the reachability bound live with the state they count — `ShellNegotiationState` — and it is
71
+ * whoever drives that state (the session runner, and the `gth eval` rater target, which drives the
72
+ * same class) that turns a `reject` into an escalation once either bound is spent. Putting the
73
+ * counters into the mapping would make a pure rung-keyed table depend on session history, and would
74
+ * leave every caller that legitimately rates ONE command with an action that varies with a
75
+ * negotiation it is not part of.
76
+ *
77
+ * There is deliberately **no `abstain` arm.** A command whose target the gate cannot statically
78
+ * resolve is rated like any other, under §6.1's rule — *deterministic checks fire only where we are
79
+ * confident something is a threat; where we cannot tell, the model decides*. A parser reporting that
80
+ * it could not resolve a string is not a detection, so it earns no action of its own; what it earns
81
+ * is a neutral note in the rating prompt
82
+ * ({@link import('./abstention.js').buildParserPreflightNote}) and a real rating. That is also what
83
+ * keeps the ceiling reachable: an action of its own would make `catastrophic` and `attack`
84
+ * unreachable for every composed, substituting or redirecting command, so `pwd && rm -rf ~` could
85
+ * only ever be floored at `destructive`.
86
+ *
87
+ * There is deliberately **no `refuse` arm for `catastrophic`** (§4.2). The deterministic members of
88
+ * that class — fork bomb, `mkfs`, `rm -rf /`, `dd` to a block device — are already refused
89
+ * unappealably by the §8 hardline floor under every rung including `bypass`, so a refusing
90
+ * `catastrophic` would add nothing for the commands that motivate the idea. What it would newly
91
+ * refuse is the remainder the floor cannot reach, every member of which has routine legitimate use
92
+ * (a staging database, an ephemeral `terraform destroy`, a preview namespace). An unmeasured
93
+ * classifier belongs behind a human who can correct it; a refusal has no correction path.
94
+ *
95
+ * **This list is exhaustive by construction, and downstream must treat it that way.** Anything that
96
+ * enumerates actions — a report axis, an eval suite's declared enum, a rendering table — has to
97
+ * derive from here. The failure mode of a restatement is silent rather than loud: an action the
98
+ * enumerator does not know is not an error it can raise, it is a row it quietly files under
99
+ * "unrecognized", and the thing that was being measured simply stops being measured.
100
+ */
101
+ export declare const RATER_ACTIONS: readonly ['approve', 'escalate', 'halt', 'reject'];
102
+ /** One action of {@link RATER_ACTIONS}. */
103
+ export type RaterAction = (typeof RATER_ACTIONS)[number];
104
+ /**
105
+ * The deterministic preflights that can floor a command at `destructive`, in the FIXED order
106
+ * {@link import('./rater.js').preflightFloorFinding} evaluates them.
107
+ *
108
+ * - `script-env-leak` — an interpreter invocation expanding an ALL_CAPS environment variable into
109
+ * its arguments. §11.1b's narrowing of the `attack` clause rests on this arm firing.
110
+ * - `open-world` — (§4.6) a host literal in a fetch/transfer position. Its reason NAMES THE HOST,
111
+ * so, unlike the other arm's, its text varies per command: identify this arm by its `kind`, never
112
+ * by matching its prose.
113
+ *
114
+ * They are arms of a single decision rather than independent checks, and the outcome is identical
115
+ * whichever fires — the order is the order of the *explanation* a human reads. Anything that
116
+ * attributes a floored decision to a mechanism must key on this list, so that a preflight added to
117
+ * the gate cannot go unattributed.
118
+ */
119
+ export declare const PREFLIGHT_FLOOR_KINDS: readonly ['script-env-leak', 'open-world'];
120
+ /** One preflight of {@link PREFLIGHT_FLOOR_KINDS}. */
121
+ export type PreflightFloorKind = (typeof PREFLIGHT_FLOOR_KINDS)[number];
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @module core/shell/raterVocabulary
3
+ *
4
+ * **The approvals gate's closed vocabularies, and nothing else.** Three lists: the outcomes a rater
5
+ * may return, the actions the gate may resolve to, and the deterministic preflights that can floor a
6
+ * command. Each is the SINGLE place its members are written down.
7
+ *
8
+ * ## Why they live apart from {@link ./rater.js}, which owns their meaning
9
+ *
10
+ * A vocabulary has two kinds of consumer. The gate itself needs the words *and* the machinery around
11
+ * them. A **checker** — a schema, a report axis, a compile-time guard in another package — needs only
12
+ * the words, and must be able to read them without loading a rating prompt, a structured-output
13
+ * boundary and a chat-model client. `rater.js` imports LangChain and Zod; a suite parser that had to
14
+ * import it to learn which actions exist would pull the whole model layer into a parse.
15
+ *
16
+ * So this module has **no imports at all**, and it must stay that way. `rater.js` re-exports every
17
+ * symbol here, so the gate's own callers are unaffected and there is exactly one spelling of each
18
+ * word in the codebase.
19
+ *
20
+ * **A checker that RESTATES one of these lists is the failure this module exists to prevent.** A
21
+ * restated list does not grow when the gate grows: the new member is simply never recognised, and
22
+ * the checker keeps reporting success over a vocabulary it no longer covers. Derive from these
23
+ * arrays — ideally as a total `Record` keyed on the type, so a new member is a compile error rather
24
+ * than a silence.
25
+ */
26
+ /**
27
+ * (Spec §4.1) — the **four** outcomes the rater may return. There is no ordering knob and no
28
+ * threshold: each outcome's consequence is fixed by the rung
29
+ * ({@link import('./rater.js').mapVerdictToAction}).
30
+ *
31
+ * - `safe` — no harmful effect.
32
+ * - `destructive` — **the catch-all**: harmful, but recoverable from inside the session, and not
33
+ * an attack — **and anything the rater cannot assess**. The rating prompt defines it *by
34
+ * exclusion* ("not safe, not catastrophic and not an attack") precisely so no command can fall
35
+ * outside the four.
36
+ * - `catastrophic` — *can this be undone from inside the session?* Irreversible without something
37
+ * OUTSIDE the session: rescue media, a backup, a re-provision, a restore from a third party.
38
+ * Escalates at both rated rungs; never negotiable and never sticky (§4.2).
39
+ * - `attack` — *is something hostile acting here?* The command's own **structure** evidences
40
+ * compromise (§4.1.1: credential targeting, privilege escalation / permission weakening,
41
+ * persistence, deception, obfuscation). It is the only outcome that HALTS the run.
42
+ *
43
+ * **`catastrophic` and `attack` are not ranked against each other** — they ask different
44
+ * questions, and the spec says so explicitly. A command can be both; `attack` wins the
45
+ * *consequence* (a manipulated session cannot be trusted to continue) but MUST NOT swallow the
46
+ * finding — see the §6.1 clause in {@link import('./rater.js').buildRaterSystemPrompt}. Nothing
47
+ * here may be written as a severity comparison between the two.
48
+ */
49
+ export const RATER_OUTCOMES = ['safe', 'destructive', 'catastrophic', 'attack'];
50
+ /**
51
+ * The actions the approvals gate can resolve to for a single gated call, BEFORE the human prompt.
52
+ * {@link import('./rater.js').mapVerdictToAction} is the whole mapping from an outcome and a rung
53
+ * onto one of these, and its docblock carries the table.
54
+ *
55
+ * - `approve` — approve ONCE; do not touch the human or the allow-list.
56
+ * - `escalate` — fall through to the human approval callback, carrying the verdict when one
57
+ * exists. Where there is no human, §6.2 turns this into an immediate non-zero exit — that
58
+ * translation belongs to the runner, not to the mapping.
59
+ * - `halt` — **end the agent loop** (§4.2). Reserved for `attack`. It is not a rejection the
60
+ * model can respond to and offers it no moves; no rung except `bypass` can turn it into
61
+ * anything else.
62
+ * - `reject` — (§5): hand the rater's explanation back to the **agent** as the refused call's tool
63
+ * result (§7), opening a round of the negotiation. Returned for `destructive` at `auto` and
64
+ * nowhere else.
65
+ *
66
+ * **`reject` says the outcome is negotiable, NOT that the negotiation may continue.** The mapping is
67
+ * keyed on the rung and knows nothing about how many rounds have been spent; §5.3's consecutive cap
68
+ * and the reachability bound live with the state they count — `ShellNegotiationState` — and it is
69
+ * whoever drives that state (the session runner, and the `gth eval` rater target, which drives the
70
+ * same class) that turns a `reject` into an escalation once either bound is spent. Putting the
71
+ * counters into the mapping would make a pure rung-keyed table depend on session history, and would
72
+ * leave every caller that legitimately rates ONE command with an action that varies with a
73
+ * negotiation it is not part of.
74
+ *
75
+ * There is deliberately **no `abstain` arm.** A command whose target the gate cannot statically
76
+ * resolve is rated like any other, under §6.1's rule — *deterministic checks fire only where we are
77
+ * confident something is a threat; where we cannot tell, the model decides*. A parser reporting that
78
+ * it could not resolve a string is not a detection, so it earns no action of its own; what it earns
79
+ * is a neutral note in the rating prompt
80
+ * ({@link import('./abstention.js').buildParserPreflightNote}) and a real rating. That is also what
81
+ * keeps the ceiling reachable: an action of its own would make `catastrophic` and `attack`
82
+ * unreachable for every composed, substituting or redirecting command, so `pwd && rm -rf ~` could
83
+ * only ever be floored at `destructive`.
84
+ *
85
+ * There is deliberately **no `refuse` arm for `catastrophic`** (§4.2). The deterministic members of
86
+ * that class — fork bomb, `mkfs`, `rm -rf /`, `dd` to a block device — are already refused
87
+ * unappealably by the §8 hardline floor under every rung including `bypass`, so a refusing
88
+ * `catastrophic` would add nothing for the commands that motivate the idea. What it would newly
89
+ * refuse is the remainder the floor cannot reach, every member of which has routine legitimate use
90
+ * (a staging database, an ephemeral `terraform destroy`, a preview namespace). An unmeasured
91
+ * classifier belongs behind a human who can correct it; a refusal has no correction path.
92
+ *
93
+ * **This list is exhaustive by construction, and downstream must treat it that way.** Anything that
94
+ * enumerates actions — a report axis, an eval suite's declared enum, a rendering table — has to
95
+ * derive from here. The failure mode of a restatement is silent rather than loud: an action the
96
+ * enumerator does not know is not an error it can raise, it is a row it quietly files under
97
+ * "unrecognized", and the thing that was being measured simply stops being measured.
98
+ */
99
+ export const RATER_ACTIONS = ['approve', 'escalate', 'halt', 'reject'];
100
+ /**
101
+ * The deterministic preflights that can floor a command at `destructive`, in the FIXED order
102
+ * {@link import('./rater.js').preflightFloorFinding} evaluates them.
103
+ *
104
+ * - `script-env-leak` — an interpreter invocation expanding an ALL_CAPS environment variable into
105
+ * its arguments. §11.1b's narrowing of the `attack` clause rests on this arm firing.
106
+ * - `open-world` — (§4.6) a host literal in a fetch/transfer position. Its reason NAMES THE HOST,
107
+ * so, unlike the other arm's, its text varies per command: identify this arm by its `kind`, never
108
+ * by matching its prose.
109
+ *
110
+ * They are arms of a single decision rather than independent checks, and the outcome is identical
111
+ * whichever fires — the order is the order of the *explanation* a human reads. Anything that
112
+ * attributes a floored decision to a mechanism must key on this list, so that a preflight added to
113
+ * the gate cannot go unattributed.
114
+ */
115
+ export const PREFLIGHT_FLOOR_KINDS = ['script-env-leak', 'open-world'];
116
+ //# sourceMappingURL=raterVocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raterVocabulary.js","sourceRoot":"","sources":["../../../src/core/shell/raterVocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,CAAU,CAAC;AAKzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAKhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAU,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @module core/shell/rejection
3
+ *
4
+ * EXT-58 (spec §7) — **what the model is told when a gated tool call is refused.**
5
+ *
6
+ * A rejection returned to the model MUST name the moves available to it, not merely the refusal.
7
+ * The pre-EXT-58 message was the bare string *"User rejected the shell command."*, which tells the
8
+ * model it failed and nothing about what to do instead — so it either re-runs the identical call or
9
+ * abandons a legitimate task silently. §7 fixes both ends: state the refusal, carry the explanation
10
+ * when one exists, and name the three moves (re-call with a justification, call a different
11
+ * command, ask the user).
12
+ *
13
+ * When the rater named an already-granted alternative (§4.4), the message MUST carry it **and** say
14
+ * that the alternative needs no approval. That last clause is the sentence that actually redirects
15
+ * behaviour: without it the model reads a tool name and still has no reason to believe calling it
16
+ * is cheaper than arguing about the command it already chose.
17
+ *
18
+ * What this module deliberately does NOT do:
19
+ *
20
+ * - It does not decide anything. It renders a refusal that has already been decided elsewhere; a
21
+ * suggestion it carries is never an approval and changes no outcome (§4.4).
22
+ * - It does not serve a **halt** (§4.2). A halt is not a rejection and offers the model no moves,
23
+ * so it is an error (`AttackHaltError`) rather than a message — see `approvalStop.ts`.
24
+ * - It does not serve a **deny-list** refusal. A deny entry is the user's own hardline, and
25
+ * "re-call the same command with a justification" is not a move the model has there; that message
26
+ * stays as it is, in `GthAgentRunner.decideToolApproval`.
27
+ * - It does not serve a command the gate's parser could not READ. There is no such refusal:
28
+ * [[EXT-81]] rates that command instead of refusing it, so every rejection this module renders is
29
+ * a JUDGED one and "call the same command with a justification" is always a move the model has.
30
+ */
31
+ import type { ShellSafetyVerdict } from '#src/core/shell/rater.js';
32
+ /** Who refused the call — the opening sentence and the moves both follow from this. */
33
+ export type RejectionSource =
34
+ /** The human answered "no" at the escalation prompt (§6). */
35
+ 'user'
36
+ /** The auto-rater refused during a negotiation (§5 / [[EXT-29]]). */
37
+ | 'rater';
38
+ /** The three moves §7 requires a JUDGED rejection to name. */
39
+ export declare const REJECTION_MOVES: string;
40
+ /**
41
+ * §7 — the clause that makes a suggestion actionable. Verbatim in substance from the spec:
42
+ * *"`gth_edit_file` does this and is already approved at this level, so it will not interrupt the
43
+ * user."*
44
+ */
45
+ export declare function buildGrantedAlternativeClause(toolName: string): string;
46
+ /** Inputs to {@link buildRejectionMessage}. */
47
+ export interface RejectionMessageOptions {
48
+ /** Who refused. */
49
+ source: RejectionSource;
50
+ /** The tool that was refused; defaults to a generic phrasing when absent. */
51
+ toolName?: string;
52
+ /**
53
+ * The rating that accompanied the escalation, when one exists. Carries both the explanation the
54
+ * model is owed and — when the rater named one — the granted alternative (§4.4). Absent at the
55
+ * unrated rungs (`manual`, `write`), where there is no rating at all and the descriptions of
56
+ * §4.5 are the only mechanism in play.
57
+ */
58
+ verdict?: ShellSafetyVerdict;
59
+ }
60
+ /**
61
+ * Build the rejection message handed back to the model as the refused call's tool result.
62
+ *
63
+ * §7 shape, each part omitted when it does not apply:
64
+ * 1. who refused what;
65
+ * 2. the rater's explanation, when a rating exists;
66
+ * 3. the three moves — always;
67
+ * 4. the granted alternative plus the no-approval-needed clause, when the rater named one.
68
+ */
69
+ export declare function buildRejectionMessage(options: RejectionMessageOptions): string;
@@ -0,0 +1,38 @@
1
+ /** The three moves §7 requires a JUDGED rejection to name. */
2
+ export const REJECTION_MOVES = 'You may call the same command with a justification, call a different command, or ask the user ' +
3
+ 'if there is no way around it.';
4
+ /**
5
+ * §7 — the clause that makes a suggestion actionable. Verbatim in substance from the spec:
6
+ * *"`gth_edit_file` does this and is already approved at this level, so it will not interrupt the
7
+ * user."*
8
+ */
9
+ export function buildGrantedAlternativeClause(toolName) {
10
+ return `\`${toolName}\` does this and is already approved at this level, so it will not interrupt the user.`;
11
+ }
12
+ /**
13
+ * Build the rejection message handed back to the model as the refused call's tool result.
14
+ *
15
+ * §7 shape, each part omitted when it does not apply:
16
+ * 1. who refused what;
17
+ * 2. the rater's explanation, when a rating exists;
18
+ * 3. the three moves — always;
19
+ * 4. the granted alternative plus the no-approval-needed clause, when the rater named one.
20
+ */
21
+ export function buildRejectionMessage(options) {
22
+ const target = options.toolName ? `your call to ${options.toolName}` : 'your command';
23
+ const opener = options.source === 'rater'
24
+ ? `The auto-rater rejected ${target}.`
25
+ : `The user rejected ${target}.`;
26
+ const parts = [opener];
27
+ const reason = options.verdict?.reason?.trim();
28
+ if (reason) {
29
+ parts.push(`Explanation: ${reason}`);
30
+ }
31
+ parts.push(REJECTION_MOVES);
32
+ const suggested = options.verdict?.suggestedTool?.trim();
33
+ if (suggested) {
34
+ parts.push(buildGrantedAlternativeClause(suggested));
35
+ }
36
+ return parts.join(' ');
37
+ }
38
+ //# sourceMappingURL=rejection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rejection.js","sourceRoot":"","sources":["../../../src/core/shell/rejection.ts"],"names":[],"mappings":"AAuCA,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAC1B,gGAAgG;IAChG,+BAA+B,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAAgB;IAC5D,OAAO,KAAK,QAAQ,wFAAwF,CAAC;AAC/G,CAAC;AAiBD;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAgC;IACpE,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;IACtF,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,KAAK,OAAO;QACxB,CAAC,CAAC,2BAA2B,MAAM,GAAG;QACtC,CAAC,CAAC,qBAAqB,MAAM,GAAG,CAAC;IAErC,MAAM,KAAK,GAAa,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACzD,IAAI,SAAS,EAAE,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,41 @@
1
+ /** Legacy marker some models emit after a serialized JSON tool request. */
2
+ export declare const END_TOOL_REQUEST = "[END_TOOL_REQUEST]";
3
+ /** Harmony stream marker that introduces the target channel before a tool call. */
4
+ export declare const HARMONY_CHANNEL_MARKER = "<|channel|>";
5
+ /** Harmony stream marker that may separate the header from the JSON payload. */
6
+ export declare const HARMONY_MESSAGE_MARKER = "<|message|>";
7
+ /** Harmony stream marker that may close a serialized tool-call payload. */
8
+ export declare const HARMONY_CALL_MARKER = "<|call|>";
9
+ /**
10
+ * Harmony marker real gpt-oss emits in place of the reference grammar's literal `code` token —
11
+ * e.g. `<|constrain|>json` declares the tool-call payload format. (EXT-43.)
12
+ */
13
+ export declare const HARMONY_CONSTRAIN_MARKER = "<|constrain|>";
14
+ /** Tool names in bracket/plain-text repairs intentionally match provider-safe ids only. */
15
+ export declare function isPlainTextToolNameChar(char: string | undefined): boolean;
16
+ /**
17
+ * Harmony tool names may be NAMESPACED with dots (real gpt-oss emits `to=functions.get_weather`),
18
+ * so the Harmony header scanner accepts `.` on top of the provider-safe id chars. This is a
19
+ * Harmony-only widening (EXT-43): the bracket/XML-ish dialects keep {@link isPlainTextToolNameChar}
20
+ * unchanged so their prose-safety is untouched. The final dot-segment is the tool name matched
21
+ * against the allow-list (see {@link finalDotSegment}).
22
+ */
23
+ export declare function isHarmonyToolNameChar(char: string | undefined): boolean;
24
+ /**
25
+ * The tool name for a (possibly namespaced) Harmony target: the final dot-segment.
26
+ * `functions.get_weather` → `get_weather`; `functions.tools.get_weather` → `get_weather`; a dotless
27
+ * `get_weather` → itself. Returns `''` for a trailing-dot / empty final segment (rejected upstream).
28
+ */
29
+ export declare function finalDotSegment(name: string): string;
30
+ /** Skips spaces and tabs only, preserving line boundaries for grammar decisions. */
31
+ export declare function skipHorizontalWhitespace(text: string, start: number): number;
32
+ /** Skips all JavaScript whitespace when line structure is no longer meaningful. */
33
+ export declare function skipWhitespace(text: string, start: number): number;
34
+ /** Consumes either Unix or Windows line endings and returns the first offset after them. */
35
+ export declare function consumeLineBreak(text: string, start: number): number | null;
36
+ /**
37
+ * Finds the exclusive end offset of a balanced JSON object starting at `start`. Returns null if
38
+ * the object never closes, or (when `maxPayloadBytes` is set) as soon as the scan runs past the
39
+ * cap — the payload-size gate that keeps a runaway blob from being treated as a tool call.
40
+ */
41
+ export declare function findJsonObjectEnd(text: string, start: number, maxPayloadBytes?: number): number | null;