@gaunt-sloth/core 2.0.0-alpha.3 → 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 (271) hide show
  1. package/README.md +52 -20
  2. package/dist/config/colour.d.ts +38 -0
  3. package/dist/config/colour.js +36 -0
  4. package/dist/config/colour.js.map +1 -0
  5. package/dist/config/defaults.d.ts +84 -0
  6. package/dist/config/defaults.js +99 -0
  7. package/dist/config/defaults.js.map +1 -0
  8. package/dist/config/filesystem-tools.d.ts +41 -0
  9. package/dist/config/filesystem-tools.js +56 -0
  10. package/dist/config/filesystem-tools.js.map +1 -0
  11. package/dist/config/jsonc.d.ts +12 -0
  12. package/dist/config/jsonc.js +41 -0
  13. package/dist/config/jsonc.js.map +1 -0
  14. package/dist/config/loader.d.ts +246 -0
  15. package/dist/config/loader.js +1321 -0
  16. package/dist/config/loader.js.map +1 -0
  17. package/dist/config/mouse.d.ts +50 -0
  18. package/dist/config/mouse.js +44 -0
  19. package/dist/config/mouse.js.map +1 -0
  20. package/dist/config/profiles.d.ts +68 -0
  21. package/dist/config/profiles.js +93 -0
  22. package/dist/config/profiles.js.map +1 -0
  23. package/dist/config/providerKeys.d.ts +69 -0
  24. package/dist/config/providerKeys.js +69 -0
  25. package/dist/config/providerKeys.js.map +1 -0
  26. package/dist/config/schema.d.ts +2999 -0
  27. package/dist/config/schema.js +1519 -0
  28. package/dist/config/schema.js.map +1 -0
  29. package/dist/config/shell-policy.d.ts +896 -0
  30. package/dist/config/shell-policy.js +750 -0
  31. package/dist/config/shell-policy.js.map +1 -0
  32. package/dist/config/tool-descriptions.d.ts +211 -0
  33. package/dist/config/tool-descriptions.js +272 -0
  34. package/dist/config/tool-descriptions.js.map +1 -0
  35. package/dist/config/types.d.ts +760 -0
  36. package/dist/config/types.js +13 -0
  37. package/dist/config/types.js.map +1 -0
  38. package/dist/config.d.ts +34 -827
  39. package/dist/config.js +25 -657
  40. package/dist/config.js.map +1 -1
  41. package/dist/constants.d.ts +46 -0
  42. package/dist/constants.js +46 -0
  43. package/dist/constants.js.map +1 -1
  44. package/dist/core/GthAbstractAgent.d.ts +135 -2
  45. package/dist/core/GthAbstractAgent.js +496 -30
  46. package/dist/core/GthAbstractAgent.js.map +1 -1
  47. package/dist/core/GthAgentRunner.d.ts +568 -54
  48. package/dist/core/GthAgentRunner.js +1537 -136
  49. package/dist/core/GthAgentRunner.js.map +1 -1
  50. package/dist/core/GthLangChainAgent.d.ts +115 -0
  51. package/dist/core/GthLangChainAgent.js +644 -17
  52. package/dist/core/GthLangChainAgent.js.map +1 -1
  53. package/dist/core/approvals/annotations.d.ts +122 -0
  54. package/dist/core/approvals/annotations.js +137 -0
  55. package/dist/core/approvals/annotations.js.map +1 -0
  56. package/dist/core/approvals/grants.d.ts +216 -0
  57. package/dist/core/approvals/grants.js +469 -0
  58. package/dist/core/approvals/grants.js.map +1 -0
  59. package/dist/core/approvals/matcher.d.ts +202 -0
  60. package/dist/core/approvals/matcher.js +267 -0
  61. package/dist/core/approvals/matcher.js.map +1 -0
  62. package/dist/core/approvals/mcpSubjects.d.ts +40 -0
  63. package/dist/core/approvals/mcpSubjects.js +99 -0
  64. package/dist/core/approvals/mcpSubjects.js.map +1 -0
  65. package/dist/core/approvals/toolAnnotationSources.d.ts +105 -0
  66. package/dist/core/approvals/toolAnnotationSources.js +277 -0
  67. package/dist/core/approvals/toolAnnotationSources.js.map +1 -0
  68. package/dist/core/approvals/toolHost.d.ts +46 -0
  69. package/dist/core/approvals/toolHost.js +108 -0
  70. package/dist/core/approvals/toolHost.js.map +1 -0
  71. package/dist/core/debugCapture.d.ts +75 -0
  72. package/dist/core/debugCapture.js +101 -0
  73. package/dist/core/debugCapture.js.map +1 -0
  74. package/dist/core/gthLeanAgentFactory.d.ts +9 -0
  75. package/dist/core/gthLeanAgentFactory.js +10 -0
  76. package/dist/core/gthLeanAgentFactory.js.map +1 -0
  77. package/dist/core/launchBanner.d.ts +120 -0
  78. package/dist/core/launchBanner.js +418 -0
  79. package/dist/core/launchBanner.js.map +1 -0
  80. package/dist/core/plainToolIndication.d.ts +15 -0
  81. package/dist/core/plainToolIndication.js +174 -0
  82. package/dist/core/plainToolIndication.js.map +1 -0
  83. package/dist/core/reasoningBlocks.d.ts +60 -0
  84. package/dist/core/reasoningBlocks.js +98 -0
  85. package/dist/core/reasoningBlocks.js.map +1 -0
  86. package/dist/core/refusal.d.ts +53 -0
  87. package/dist/core/refusal.js +133 -0
  88. package/dist/core/refusal.js.map +1 -0
  89. package/dist/core/runStats.d.ts +52 -0
  90. package/dist/core/runStats.js +118 -0
  91. package/dist/core/runStats.js.map +1 -0
  92. package/dist/core/shell/ShellCommandFailedError.d.ts +54 -0
  93. package/dist/core/shell/ShellCommandFailedError.js +68 -0
  94. package/dist/core/shell/ShellCommandFailedError.js.map +1 -0
  95. package/dist/core/shell/abstention.d.ts +88 -0
  96. package/dist/core/shell/abstention.js +184 -0
  97. package/dist/core/shell/abstention.js.map +1 -0
  98. package/dist/core/shell/approvalCapture.d.ts +271 -0
  99. package/dist/core/shell/approvalCapture.js +108 -0
  100. package/dist/core/shell/approvalCapture.js.map +1 -0
  101. package/dist/core/shell/approvalStop.d.ts +84 -0
  102. package/dist/core/shell/approvalStop.js +119 -0
  103. package/dist/core/shell/approvalStop.js.map +1 -0
  104. package/dist/core/shell/arity.d.ts +6 -0
  105. package/dist/core/shell/arity.js +20 -6
  106. package/dist/core/shell/arity.js.map +1 -1
  107. package/dist/core/shell/denylist.d.ts +11 -0
  108. package/dist/core/shell/denylist.js +37 -0
  109. package/dist/core/shell/denylist.js.map +1 -0
  110. package/dist/core/shell/escalationSeverity.d.ts +141 -0
  111. package/dist/core/shell/escalationSeverity.js +89 -0
  112. package/dist/core/shell/escalationSeverity.js.map +1 -0
  113. package/dist/core/shell/framing.d.ts +190 -0
  114. package/dist/core/shell/framing.js +633 -0
  115. package/dist/core/shell/framing.js.map +1 -0
  116. package/dist/core/shell/hardline.d.ts +81 -0
  117. package/dist/core/shell/hardline.js +607 -0
  118. package/dist/core/shell/hardline.js.map +1 -0
  119. package/dist/core/shell/negotiation.d.ts +249 -0
  120. package/dist/core/shell/negotiation.js +355 -0
  121. package/dist/core/shell/negotiation.js.map +1 -0
  122. package/dist/core/shell/normalize.d.ts +44 -4
  123. package/dist/core/shell/normalize.js +61 -7
  124. package/dist/core/shell/normalize.js.map +1 -1
  125. package/dist/core/shell/openWorld.d.ts +263 -0
  126. package/dist/core/shell/openWorld.js +1188 -0
  127. package/dist/core/shell/openWorld.js.map +1 -0
  128. package/dist/core/shell/rater.d.ts +935 -0
  129. package/dist/core/shell/rater.js +1473 -0
  130. package/dist/core/shell/rater.js.map +1 -0
  131. package/dist/core/shell/raterModel.d.ts +41 -0
  132. package/dist/core/shell/raterModel.js +51 -0
  133. package/dist/core/shell/raterModel.js.map +1 -0
  134. package/dist/core/shell/rejection.d.ts +69 -0
  135. package/dist/core/shell/rejection.js +38 -0
  136. package/dist/core/shell/rejection.js.map +1 -0
  137. package/dist/core/toolCallRepair/grammar.d.ts +41 -0
  138. package/dist/core/toolCallRepair/grammar.js +116 -0
  139. package/dist/core/toolCallRepair/grammar.js.map +1 -0
  140. package/dist/core/toolCallRepair/index.d.ts +2 -0
  141. package/dist/core/toolCallRepair/index.js +7 -0
  142. package/dist/core/toolCallRepair/index.js.map +1 -0
  143. package/dist/core/toolCallRepair/payload.d.ts +36 -0
  144. package/dist/core/toolCallRepair/payload.js +341 -0
  145. package/dist/core/toolCallRepair/payload.js.map +1 -0
  146. package/dist/core/toolCallRepair/promote.d.ts +45 -0
  147. package/dist/core/toolCallRepair/promote.js +90 -0
  148. package/dist/core/toolCallRepair/promote.js.map +1 -0
  149. package/dist/core/toolDisplay.d.ts +123 -0
  150. package/dist/core/toolDisplay.js +451 -0
  151. package/dist/core/toolDisplay.js.map +1 -0
  152. package/dist/core/toolOutputChannel.d.ts +95 -0
  153. package/dist/core/toolOutputChannel.js +165 -0
  154. package/dist/core/toolOutputChannel.js.map +1 -0
  155. package/dist/core/types.d.ts +294 -12
  156. package/dist/core/types.js.map +1 -1
  157. package/dist/history/historyFormat.d.ts +28 -0
  158. package/dist/history/historyFormat.js +127 -0
  159. package/dist/history/historyFormat.js.map +1 -0
  160. package/dist/history/historyStore.d.ts +198 -0
  161. package/dist/history/historyStore.js +482 -0
  162. package/dist/history/historyStore.js.map +1 -0
  163. package/dist/history/recordSession.d.ts +37 -0
  164. package/dist/history/recordSession.js +56 -0
  165. package/dist/history/recordSession.js.map +1 -0
  166. package/dist/index.d.ts +4 -0
  167. package/dist/index.js +4 -0
  168. package/dist/index.js.map +1 -1
  169. package/dist/providers/anthropic.d.ts +1 -1
  170. package/dist/providers/anthropic.js +5 -10
  171. package/dist/providers/anthropic.js.map +1 -1
  172. package/dist/providers/deepseek.d.ts +1 -1
  173. package/dist/providers/deepseek.js +5 -10
  174. package/dist/providers/deepseek.js.map +1 -1
  175. package/dist/providers/geminiSchemaSanitizer.d.ts +55 -0
  176. package/dist/providers/geminiSchemaSanitizer.js +347 -0
  177. package/dist/providers/geminiSchemaSanitizer.js.map +1 -0
  178. package/dist/providers/geminiThinking.d.ts +52 -0
  179. package/dist/providers/geminiThinking.js +72 -0
  180. package/dist/providers/geminiThinking.js.map +1 -0
  181. package/dist/providers/google-genai.d.ts +1 -1
  182. package/dist/providers/google-genai.js +12 -11
  183. package/dist/providers/google-genai.js.map +1 -1
  184. package/dist/providers/groq.d.ts +1 -1
  185. package/dist/providers/groq.js +5 -10
  186. package/dist/providers/groq.js.map +1 -1
  187. package/dist/providers/huggingface.d.ts +25 -0
  188. package/dist/providers/huggingface.js +69 -0
  189. package/dist/providers/huggingface.js.map +1 -0
  190. package/dist/providers/modelCatalog.d.ts +109 -0
  191. package/dist/providers/modelCatalog.js +245 -0
  192. package/dist/providers/modelCatalog.js.map +1 -0
  193. package/dist/providers/modelDiscovery.d.ts +153 -6
  194. package/dist/providers/modelDiscovery.js +295 -41
  195. package/dist/providers/modelDiscovery.js.map +1 -1
  196. package/dist/providers/ollama.d.ts +19 -5
  197. package/dist/providers/ollama.js +60 -52
  198. package/dist/providers/ollama.js.map +1 -1
  199. package/dist/providers/openai.d.ts +1 -1
  200. package/dist/providers/openai.js +39 -10
  201. package/dist/providers/openai.js.map +1 -1
  202. package/dist/providers/openrouter.d.ts +4 -5
  203. package/dist/providers/openrouter.js +20 -35
  204. package/dist/providers/openrouter.js.map +1 -1
  205. package/dist/providers/vertexai.d.ts +1 -1
  206. package/dist/providers/vertexai.js +12 -11
  207. package/dist/providers/vertexai.js.map +1 -1
  208. package/dist/providers/xai.d.ts +1 -1
  209. package/dist/providers/xai.js +5 -10
  210. package/dist/providers/xai.js.map +1 -1
  211. package/dist/runtime/askStructured.d.ts +105 -0
  212. package/dist/runtime/askStructured.js +120 -0
  213. package/dist/runtime/askStructured.js.map +1 -0
  214. package/dist/runtime/conversation.d.ts +60 -0
  215. package/dist/runtime/conversation.js +151 -0
  216. package/dist/runtime/conversation.js.map +1 -0
  217. package/dist/runtime/singleShot.d.ts +25 -5
  218. package/dist/runtime/singleShot.js +95 -36
  219. package/dist/runtime/singleShot.js.map +1 -1
  220. package/dist/runtime/structuredOutput.d.ts +104 -0
  221. package/dist/runtime/structuredOutput.js +393 -0
  222. package/dist/runtime/structuredOutput.js.map +1 -0
  223. package/dist/utils/ProgressIndicator.d.ts +21 -0
  224. package/dist/utils/ProgressIndicator.js +30 -3
  225. package/dist/utils/ProgressIndicator.js.map +1 -1
  226. package/dist/utils/aiignoreUtils.js.map +1 -1
  227. package/dist/utils/binaryOutputUtils.js.map +1 -1
  228. package/dist/utils/consoleUtils.d.ts +52 -0
  229. package/dist/utils/consoleUtils.js +72 -2
  230. package/dist/utils/consoleUtils.js.map +1 -1
  231. package/dist/utils/crashHandler.d.ts +87 -0
  232. package/dist/utils/crashHandler.js +128 -0
  233. package/dist/utils/crashHandler.js.map +1 -0
  234. package/dist/utils/debugDump.d.ts +134 -0
  235. package/dist/utils/debugDump.js +381 -0
  236. package/dist/utils/debugDump.js.map +1 -0
  237. package/dist/utils/debugUtils.d.ts +13 -4
  238. package/dist/utils/debugUtils.js +36 -13
  239. package/dist/utils/debugUtils.js.map +1 -1
  240. package/dist/utils/displayWidth.d.ts +53 -0
  241. package/dist/utils/displayWidth.js +195 -0
  242. package/dist/utils/displayWidth.js.map +1 -0
  243. package/dist/utils/fileUtils.d.ts +24 -2
  244. package/dist/utils/fileUtils.js +54 -12
  245. package/dist/utils/fileUtils.js.map +1 -1
  246. package/dist/utils/llmUtils.d.ts +39 -8
  247. package/dist/utils/llmUtils.js +76 -8
  248. package/dist/utils/llmUtils.js.map +1 -1
  249. package/dist/utils/redactSecrets.d.ts +63 -0
  250. package/dist/utils/redactSecrets.js +286 -0
  251. package/dist/utils/redactSecrets.js.map +1 -0
  252. package/dist/utils/systemPromptNotes.d.ts +225 -0
  253. package/dist/utils/systemPromptNotes.js +340 -0
  254. package/dist/utils/systemPromptNotes.js.map +1 -0
  255. package/dist/utils/systemUtils.d.ts +49 -1
  256. package/dist/utils/systemUtils.js +67 -3
  257. package/dist/utils/systemUtils.js.map +1 -1
  258. package/dist/utils/toolMatching.d.ts +30 -0
  259. package/dist/utils/toolMatching.js +44 -0
  260. package/dist/utils/toolMatching.js.map +1 -0
  261. package/dist/utils/untrustedText.d.ts +66 -0
  262. package/dist/utils/untrustedText.js +80 -0
  263. package/dist/utils/untrustedText.js.map +1 -0
  264. package/package.json +22 -6
  265. package/schema/gsloth-config.schema.json +3134 -0
  266. package/dist/core/shell/allowlist.d.ts +0 -75
  267. package/dist/core/shell/allowlist.js +0 -187
  268. package/dist/core/shell/allowlist.js.map +0 -1
  269. package/dist/core/shell/judge.d.ts +0 -161
  270. package/dist/core/shell/judge.js +0 -261
  271. package/dist/core/shell/judge.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL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CAAC;QAC9B,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC9C,IAAI,UAAU,IAAI,sBAAsB,EAAE,CAAC;YACzC,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAC;QAC5C,CAAC;QACD,MAAM,SAAS,GAAG,WAAW,CAAC,KAAiC,CAAC,CAAC;QACjE,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,cAAc,CAC3B,MAAoB,EACpB,GAAkB,EAClB,0BAAsD;IAEtD,MAAM,gBAAgB,GAAuB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC;IAC/D,OAAO,MAAM,WAAW,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE,0BAA0B,CAAC,CAAC;AAC7F,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC"}
@@ -3,7 +3,14 @@ export declare const GSLOTH_SETTINGS_DIR = ".gsloth-settings";
3
3
  export declare const GSLOTH_AUTH = ".gsloth-auth";
4
4
  export declare const USER_PROJECT_CONFIG_JS = ".gsloth.config.js";
5
5
  export declare const USER_PROJECT_CONFIG_JSON = ".gsloth.config.json";
6
+ /**
7
+ * GS2-69 — the `.jsonc` filename variant. Both JSON names are parsed by the same lenient
8
+ * {@link import('#src/config/jsonc.js').parseJsonc}; this one just carries the conventional
9
+ * extension so editors/review tools expect the comments. `.json` wins when both exist.
10
+ */
11
+ export declare const USER_PROJECT_CONFIG_JSONC = ".gsloth.config.jsonc";
6
12
  export declare const USER_PROJECT_CONFIG_MJS = ".gsloth.config.mjs";
13
+ export declare const USER_PROJECT_CONFIG_TS = ".gsloth.config.ts";
7
14
  export declare const GSLOTH_BACKSTORY = ".gsloth.backstory.md";
8
15
  export declare const PROJECT_GUIDELINES = ".gsloth.guidelines.md";
9
16
  export declare const PROJECT_REVIEW_INSTRUCTIONS = ".gsloth.review.md";
@@ -12,8 +19,47 @@ export declare const GSLOTH_CHAT_PROMPT = ".gsloth.chat.md";
12
19
  export declare const GSLOTH_CODE_PROMPT = ".gsloth.code.md";
13
20
  export declare const GSLOTH_EXEC_PROMPT = ".gsloth.exec.md";
14
21
  export declare const AIIGNORE_FILE = ".aiignore";
22
+ /**
23
+ * `$schema` pointer written into a generated `.gsloth.config.json` (GS2-1) so editors offer
24
+ * autocomplete + validation. The **hosted, major-pinned** URL is used rather than a relative
25
+ * `node_modules` path because the relative path only resolves when `@gaunt-sloth/core` sits in a
26
+ * `node_modules` beside the config, which is NOT the case for a globally-installed CLI
27
+ * (`npm i -g`): the schema lands in the global prefix, not next to the user's project config, so
28
+ * a relative pointer would silently fail to resolve. A hosted URL resolves for every install mode
29
+ * (global, npx, local, or a hand-written config with nothing installed) and is the standard
30
+ * convention editors fetch + cache.
31
+ *
32
+ * The channel is **major-pinned** (`/schema/v2/…`, not `latest` or `alpha`) so a config never
33
+ * revalidates against a future major it was not written for. The hosted copy is kept in sync with
34
+ * this package's generated schema by the deploy runbook in
35
+ * `websites/gauntsloth-site/schema/README.md` (interim, hand-run) and, in time, PLAT-9's automated
36
+ * release step. The schema still ships inside the package (`files: ["./schema/*"]`) as an offline
37
+ * artifact and golden-snapshot source of truth; it is just no longer what the pointer references.
38
+ */
39
+ export declare const CONFIG_SCHEMA_POINTER = "https://gauntsloth.app/schema/v2/gsloth-config.schema.json";
15
40
  /**
16
41
  * EXT-9 Tier-2: project-scoped persisted shell allow-list (`always` approvals).
17
42
  * Lives under `.gsloth/.gsloth-settings/` like other project settings.
18
43
  */
19
44
  export declare const SHELL_ALLOWLIST_FILE = "shell-allowlist.json";
45
+ /**
46
+ * The `additionalToolNamePrefix` handed to `MultiServerMCPClient` so every MCP tool name is
47
+ * namespaced. Combined with `prefixToolNameWithServerName`, the adapter emits tool names shaped
48
+ * `${MCP_TOOL_NAME_PREFIX}__<serverName>__<toolName>` (the `__` separator is the mcp-adapters
49
+ * convention). Single-sourced here so the resolver that sets the prefix (EXT-32) and any consumer
50
+ * that groups tools back by server (the [[TUI-C20]] MCP debug tab) can never silently drift apart.
51
+ */
52
+ export declare const MCP_TOOL_NAME_PREFIX = "mcp";
53
+ /**
54
+ * GS2-35 — the canonical Git co-author identity for agent-authored commits. When Gaunt Sloth writes
55
+ * a commit (via `run_shell_command` `git commit`) the co-author is *Gaunt Sloth itself*, NOT the
56
+ * underlying model: the commit was produced by the assistant, so attributing it to the model that
57
+ * served the session is factually wrong. The email is what makes the trailer resolve to the real
58
+ * Gaunt Sloth account, so it is the half that must not move. This name is the BASE the composed
59
+ * trailer is built from, not the whole emitted value: the resolved active model decorates it as
60
+ * `Gaunt Sloth (provider:model)` (EXT-83). Config (`commit.coAuthor`) overrides
61
+ * this; single-sourced so the config default and the prompt-guidance fallback
62
+ * ({@link import('#src/utils/systemPromptNotes.js').appendCommitCoAuthorNote}) can never drift.
63
+ */
64
+ export declare const DEFAULT_COMMIT_CO_AUTHOR_NAME = "Gaunt Sloth";
65
+ export declare const DEFAULT_COMMIT_CO_AUTHOR_EMAIL = "code@gauntsloth.app";
package/dist/constants.js CHANGED
@@ -3,7 +3,14 @@ export const GSLOTH_SETTINGS_DIR = '.gsloth-settings';
3
3
  export const GSLOTH_AUTH = '.gsloth-auth';
4
4
  export const USER_PROJECT_CONFIG_JS = '.gsloth.config.js';
5
5
  export const USER_PROJECT_CONFIG_JSON = '.gsloth.config.json';
6
+ /**
7
+ * GS2-69 — the `.jsonc` filename variant. Both JSON names are parsed by the same lenient
8
+ * {@link import('#src/config/jsonc.js').parseJsonc}; this one just carries the conventional
9
+ * extension so editors/review tools expect the comments. `.json` wins when both exist.
10
+ */
11
+ export const USER_PROJECT_CONFIG_JSONC = '.gsloth.config.jsonc';
6
12
  export const USER_PROJECT_CONFIG_MJS = '.gsloth.config.mjs';
13
+ export const USER_PROJECT_CONFIG_TS = '.gsloth.config.ts';
7
14
  export const GSLOTH_BACKSTORY = '.gsloth.backstory.md';
8
15
  export const PROJECT_GUIDELINES = '.gsloth.guidelines.md';
9
16
  export const PROJECT_REVIEW_INSTRUCTIONS = '.gsloth.review.md';
@@ -12,9 +19,48 @@ export const GSLOTH_CHAT_PROMPT = '.gsloth.chat.md';
12
19
  export const GSLOTH_CODE_PROMPT = '.gsloth.code.md';
13
20
  export const GSLOTH_EXEC_PROMPT = '.gsloth.exec.md';
14
21
  export const AIIGNORE_FILE = '.aiignore';
22
+ /**
23
+ * `$schema` pointer written into a generated `.gsloth.config.json` (GS2-1) so editors offer
24
+ * autocomplete + validation. The **hosted, major-pinned** URL is used rather than a relative
25
+ * `node_modules` path because the relative path only resolves when `@gaunt-sloth/core` sits in a
26
+ * `node_modules` beside the config, which is NOT the case for a globally-installed CLI
27
+ * (`npm i -g`): the schema lands in the global prefix, not next to the user's project config, so
28
+ * a relative pointer would silently fail to resolve. A hosted URL resolves for every install mode
29
+ * (global, npx, local, or a hand-written config with nothing installed) and is the standard
30
+ * convention editors fetch + cache.
31
+ *
32
+ * The channel is **major-pinned** (`/schema/v2/…`, not `latest` or `alpha`) so a config never
33
+ * revalidates against a future major it was not written for. The hosted copy is kept in sync with
34
+ * this package's generated schema by the deploy runbook in
35
+ * `websites/gauntsloth-site/schema/README.md` (interim, hand-run) and, in time, PLAT-9's automated
36
+ * release step. The schema still ships inside the package (`files: ["./schema/*"]`) as an offline
37
+ * artifact and golden-snapshot source of truth; it is just no longer what the pointer references.
38
+ */
39
+ export const CONFIG_SCHEMA_POINTER = 'https://gauntsloth.app/schema/v2/gsloth-config.schema.json';
15
40
  /**
16
41
  * EXT-9 Tier-2: project-scoped persisted shell allow-list (`always` approvals).
17
42
  * Lives under `.gsloth/.gsloth-settings/` like other project settings.
18
43
  */
19
44
  export const SHELL_ALLOWLIST_FILE = 'shell-allowlist.json';
45
+ /**
46
+ * The `additionalToolNamePrefix` handed to `MultiServerMCPClient` so every MCP tool name is
47
+ * namespaced. Combined with `prefixToolNameWithServerName`, the adapter emits tool names shaped
48
+ * `${MCP_TOOL_NAME_PREFIX}__<serverName>__<toolName>` (the `__` separator is the mcp-adapters
49
+ * convention). Single-sourced here so the resolver that sets the prefix (EXT-32) and any consumer
50
+ * that groups tools back by server (the [[TUI-C20]] MCP debug tab) can never silently drift apart.
51
+ */
52
+ export const MCP_TOOL_NAME_PREFIX = 'mcp';
53
+ /**
54
+ * GS2-35 — the canonical Git co-author identity for agent-authored commits. When Gaunt Sloth writes
55
+ * a commit (via `run_shell_command` `git commit`) the co-author is *Gaunt Sloth itself*, NOT the
56
+ * underlying model: the commit was produced by the assistant, so attributing it to the model that
57
+ * served the session is factually wrong. The email is what makes the trailer resolve to the real
58
+ * Gaunt Sloth account, so it is the half that must not move. This name is the BASE the composed
59
+ * trailer is built from, not the whole emitted value: the resolved active model decorates it as
60
+ * `Gaunt Sloth (provider:model)` (EXT-83). Config (`commit.coAuthor`) overrides
61
+ * this; single-sourced so the config default and the prompt-guidance fallback
62
+ * ({@link import('#src/utils/systemPromptNotes.js').appendCommitCoAuthorNote}) can never drift.
63
+ */
64
+ export const DEFAULT_COMMIT_CO_AUTHOR_NAME = 'Gaunt Sloth';
65
+ export const DEFAULT_COMMIT_CO_AUTHOR_EMAIL = 'code@gauntsloth.app';
20
66
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AACvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AACvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAC1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AACpD,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,4DAA4D,CAAC;AAClG;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,aAAa,CAAC;AAC3D,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAC"}
@@ -1,10 +1,13 @@
1
- import { GthConfig, ServerTool } from '#src/config.js';
2
- import { AgentResolvers, AgentStreamEvent, GthAgentInterface, GthCommand, GthCompiledGraph, Message, PendingToolInterrupt, StatusUpdateCallback } from '#src/core/types.js';
1
+ import { GthConfig, ServerTool, type ApprovalRung, type DescribableTool } from '#src/config.js';
2
+ import { AgentResolvers, AgentStreamEvent, GthAgentInterface, GthCommand, GthCompiledGraph, GthRunStats, Message, PendingToolInterrupt, StatusUpdateCallback } from '#src/core/types.js';
3
+ import type { DeclaredToolAnnotations } from '#src/core/approvals/annotations.js';
4
+ import type { DebugCapture, DebugRequestExtras, LastModelRequest } from '#src/core/debugCapture.js';
3
5
  import { BaseMessage } from '@langchain/core/messages';
4
6
  import { RunnableConfig } from '@langchain/core/runnables';
5
7
  import { BaseToolkit, StructuredToolInterface } from '@langchain/core/tools';
6
8
  import { IterableReadableStream } from '@langchain/core/utils/stream';
7
9
  import { BaseCheckpointSaver } from '@langchain/langgraph';
10
+ import { type RefusalInfo } from '#src/core/refusal.js';
8
11
  /**
9
12
  * Shared, graph-agnostic agent plumbing.
10
13
  *
@@ -24,12 +27,142 @@ export declare abstract class GthAbstractAgent implements GthAgentInterface {
24
27
  protected agent: GthCompiledGraph | null;
25
28
  protected config: GthConfig | null;
26
29
  protected command: GthCommand | undefined;
30
+ /**
31
+ * Opt-in debug sink for the TUI `/debug` panel. Set AFTER {@link init} via
32
+ * `runner.getAgent()`; read lazily inside each backend's `wrapModelCall` capture middleware
33
+ * so that when it is `undefined` (the normal path) the middleware is a transparent
34
+ * pass-through. Lives on the base so BOTH the lean and deep backends support it; the AG-UI
35
+ * server / non-TUI callers simply never set it, so those contracts are unchanged.
36
+ */
37
+ debugCapture: DebugCapture | undefined;
38
+ /**
39
+ * GS2-56 — the ALWAYS-ON snapshot of the most recent model request (extras + the as-sent,
40
+ * post-summarization messages), populated UNCONDITIONALLY at each backend's `wrapModelCall` feed
41
+ * site — NOT gated on {@link debugCapture} being attached. This is what lets `/debug-dump` render
42
+ * the full model input even when the TUI `/debug` panel was never opened and on non-TUI surfaces
43
+ * (the sink only ever fed the live `/debug` panel). O(1): a single overwritten reference retaining
44
+ * only the LAST call — no accumulation, so the "pay nothing until you need it" intent is kept.
45
+ */
46
+ lastModelRequest: LastModelRequest | undefined;
47
+ /**
48
+ * GS2-56 — stash the last model request (the as-sent messages + {@link DebugRequestExtras}).
49
+ * Called unconditionally from each backend's capture middleware, independent of the debug sink,
50
+ * so the snapshot is available to `/debug-dump` on every surface. Overwrites (retains only the
51
+ * most recent call). Callers already guard the invocation; kept trivial so it can never throw.
52
+ */
53
+ protected setLastModelRequest(messages: BaseMessage[], extras?: DebugRequestExtras): void;
54
+ /**
55
+ * GS2-16 — per-run analytics tally (token usage + invoked tool names) folded from the messages
56
+ * flowing through {@link invoke} / the streaming paths. Reset at each turn boundary via
57
+ * {@link resetRunStats} (the runner is reused across turns), read via {@link getRunStats}, and
58
+ * fully fail-soft (accumulation is guarded and never throws into a run).
59
+ */
60
+ private runStatsAcc;
61
+ /**
62
+ * EXT-58 — the names of the tools registered with the graph at the last {@link init}, recorded by
63
+ * {@link registerApprovalsAwareTools}. Read by `GthAgentRunner` to build the rater's
64
+ * granted-built-in list (§4.4), so a suggestion can only ever name a tool the model actually has.
65
+ */
66
+ private registeredToolNames;
67
+ /**
68
+ * EXT-70 §4.7.1 — what the connected MCP servers DECLARED about their own tools, captured from
69
+ * the same registration hook as {@link registeredToolNames} and keyed by the registered tool
70
+ * name. Read by `GthAgentRunner` as the `mcp` half of a `DeclaredToolAnnotationLookup`.
71
+ *
72
+ * It is a record of claims, never of decisions: no trust is applied here (that is
73
+ * `createEffectiveToolAnnotationSource`'s only job), and an absent tool yields the fail-closed
74
+ * defaults rather than "declared nothing".
75
+ */
76
+ private declaredMcpToolAnnotations;
27
77
  constructor(statusUpdate: StatusUpdateCallback, resolvers?: AgentResolvers);
78
+ /**
79
+ * GS2-63 — emit one line of the technical run-header preamble (the Workdir/Model/Tools/Middleware
80
+ * block) UNLESS it is opted out via `output.header: false`. The opt-out only ever reaches here in
81
+ * non-TUI text modes: the interactive TUI forces `output.header` on before init (see
82
+ * `createTuiSession`), and the TUI event path never goes through the interrupt-hint site, so the
83
+ * whole preamble stays visible there. Only INFO header lines route through this — real model/tool
84
+ * output, warnings and errors keep using {@link statusUpdate} directly.
85
+ */
86
+ protected headerStatus(message: string): void;
87
+ /**
88
+ * EXT-58 (spec §4.5) — the ONE tool-registration hook both backends call with their final tool
89
+ * array, just before handing it to the graph builder. It does two things:
90
+ *
91
+ * 1. Appends the rung's approval sentence to every tool that is **not** auto-approved at that
92
+ * rung, and leaves every granted tool's description untouched (the absence of the sentence is
93
+ * what marks a tool free). See {@link applyRungAwareToolDescriptions}.
94
+ * 2. Records the registered tool names for {@link getRegisteredToolNames}, which feeds the
95
+ * rater's granted-alternative list (§4.4).
96
+ * 3. EXT-70 §4.7.1 — records what the MCP servers declared about their own tools, for
97
+ * {@link getDeclaredMcpToolAnnotations}. This is the ONE place a `tools/list` annotation
98
+ * enters the approvals stack, and it enters as a claim: nothing here decides whether it is
99
+ * believed.
100
+ *
101
+ * `gatedTools` MUST be the **LIVE gated set for the rung in force** — `resolveGatedToolNames` for
102
+ * that rung — and NOT the set the caller wires into the approval interrupt. The two are different
103
+ * on purpose: the interrupt is installed once, at agent init, and is deliberately
104
+ * rung-independent (`resolveInterruptToolNames`, the union over every rung) so that
105
+ * `/approvals <mode>` can move the mode underneath it for the rest of the session. Passing that
106
+ * wider set here would describe tools as needing approval that the live mode does not gate — and
107
+ * a call the live mode does not gate is auto-approved the moment it reaches the runner, so the
108
+ * sentence would be a promise nothing keeps.
109
+ *
110
+ * What keeps a description from promising an approval the gate will not ask for is therefore that
111
+ * both this and `GthAgentRunner`'s own check are projections of the SAME rule,
112
+ * `isToolGatedAtRung`, evaluated against the SAME live mode — §4.5's "a description that disagrees
113
+ * with what the gate will actually do is worse than no description at all".
114
+ *
115
+ * `additionalToolNames` covers tools the graph builder registers itself and that therefore never
116
+ * appear in `tools` — deepagents' own filesystem tools on the deep backend. Their descriptions
117
+ * are deepagents', not ours, so they cannot be suffixed here; they are recorded only so the
118
+ * rater's suggestion list reflects what the deep model actually has.
119
+ */
120
+ protected registerApprovalsAwareTools<T extends DescribableTool>(tools: T[], options: {
121
+ rung: ApprovalRung;
122
+ gatedTools: readonly string[];
123
+ additionalToolNames?: readonly string[];
124
+ }): T[];
125
+ /**
126
+ * EXT-58 — the tool names registered with the graph at the last {@link init} (empty before it).
127
+ * The runner intersects these with the built-in summaries table to build the rater's
128
+ * granted-alternative list, so the rater can never name a tool this session does not have.
129
+ */
130
+ getRegisteredToolNames(): string[];
131
+ /**
132
+ * EXT-70 §4.7.1 — what the MCP servers declared for their tools at the last {@link init}, keyed
133
+ * by registered tool name (empty before it, and on a session with no MCP servers).
134
+ */
135
+ getDeclaredMcpToolAnnotations(): ReadonlyMap<string, DeclaredToolAnnotations>;
136
+ /**
137
+ * GS2-16 — clear the per-run analytics tally so the next turn starts from zero. The runner
138
+ * calls this at each turn boundary because it (and this agent) are reused across turns in an
139
+ * interactive session.
140
+ */
141
+ resetRunStats(): void;
142
+ /** GS2-16 — the analytics harvested since the last {@link resetRunStats}. Never throws. */
143
+ getRunStats(): GthRunStats;
144
+ /** GS2-16 — fold one message (or chunk) into the run tally. Fully guarded (fail-soft). */
145
+ protected recordRunStats(message: unknown): void;
146
+ /**
147
+ * GS2-16 — best-effort count of messages already in the checkpointed thread state, used by
148
+ * {@link invoke} as the baseline so it harvests only THIS turn's new messages rather than the
149
+ * whole accumulated conversation a checkpointer returns. Fail-soft: a missing `getState`, an odd
150
+ * state shape, or any error yields 0 (worst case a one-turn over-count, never a throw).
151
+ */
152
+ private getStateMessageCount;
28
153
  /**
29
154
  * Build the underlying compiled graph and assign it to {@link agent}. This is the only
30
155
  * part that differs between the lean and deep agents.
31
156
  */
32
157
  abstract init(command: GthCommand | undefined, configIn: GthConfig, checkpointer?: BaseCheckpointSaver | undefined): Promise<void>;
158
+ /**
159
+ * EXT-37 — surface a detected content-policy refusal: emit the clear, user-facing explanation at
160
+ * WARNING level (an empty-content refusal streams nothing, so without this the console shows
161
+ * nothing) and return the same message so it becomes the turn's terminal answer. Shared by the
162
+ * non-streaming {@link invoke} and streaming {@link streamFromInput} paths so both render a
163
+ * refusal identically. A refusal is a *successful* (if declined) response — never a retry.
164
+ */
165
+ protected surfaceRefusal(info: RefusalInfo): string;
33
166
  /**
34
167
  * Invoke LLM with a message and runnable config.
35
168
  * For streaming use {@link #stream} method, streaming is preferred if model API supports it.