@gaunt-sloth/core 2.0.0-alpha.8 → 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
@@ -7,7 +7,48 @@
7
7
  import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
8
8
  import type { BaseToolkit, StructuredToolInterface } from '@langchain/core/tools';
9
9
  import type { StatusLevel } from '#src/core/types.js';
10
- import type { GthDevToolsConfig } from '#src/config/shell-policy.js';
10
+ import type { ApprovalsConfig, BuiltInToolsSetting } from '#src/config/shell-policy.js';
11
+ import type { GthAcpSessionMode, GthOutputHeaderRung } from '#src/config/schema.js';
12
+ /**
13
+ * GS2-43 — the seven configurable prompt segments. Each maps to a prompt file with a
14
+ * well-known default name (`.gsloth.backstory.md`, `.gsloth.guidelines.md`,
15
+ * `.gsloth.system.md`, `.gsloth.chat.md`, `.gsloth.code.md`, `.gsloth.exec.md`,
16
+ * `.gsloth.review.md`) and can be retargeted / disabled / composed via
17
+ * {@link GthConfig.prompts}.
18
+ */
19
+ export type PromptSegmentName = 'backstory' | 'guidelines' | 'system' | 'chat' | 'code' | 'exec' | 'review';
20
+ /**
21
+ * GS2-43 — configuration for one prompt segment.
22
+ */
23
+ export interface PromptSegmentConfig {
24
+ /**
25
+ * File to read for this segment. Resolved like every prompt file: the config dir
26
+ * (`.gsloth/.gsloth-settings[/<profile>]/`) first, then relative to the project root.
27
+ */
28
+ path?: string;
29
+ /**
30
+ * `false` drops the segment entirely — even its bundled default. Default `true`.
31
+ */
32
+ enabled?: boolean;
33
+ /**
34
+ * `'replace'` (default): the {@link path} file replaces the built-in segment content.
35
+ * `'append'`: the file content is appended after the built-in content.
36
+ */
37
+ mode?: 'replace' | 'append';
38
+ }
39
+ /**
40
+ * GS2-43 — one segment's setting: a `string` path (shorthand for `{ path }`) or a
41
+ * {@link PromptSegmentConfig} object.
42
+ */
43
+ export type PromptSegmentSetting = string | PromptSegmentConfig;
44
+ /**
45
+ * GS2-43 — the unified `prompts` config object. Replaces the removed flat
46
+ * `projectGuidelines` / `projectReviewInstructions` keys and makes all seven prompt
47
+ * segments retargetable through config. Sibling keys are trivially addable (GS2-44 will
48
+ * add `agents` for AGENTS.md auto-discovery), so keep segment names and future siblings
49
+ * in this one flat namespace.
50
+ */
51
+ export type PromptsConfig = Partial<Record<PromptSegmentName, PromptSegmentSetting>>;
11
52
  /**
12
53
  * Shared per-command tooling configuration (the knobs every actionable command carries).
13
54
  * Reused across the per-command types in {@link GthConfig.commands} and by
@@ -18,12 +59,41 @@ import type { GthDevToolsConfig } from '#src/config/shell-policy.js';
18
59
  */
19
60
  export interface CommandToolingConfig {
20
61
  filesystem?: string[] | 'all' | 'read' | 'none';
21
- builtInTools?: string[];
62
+ builtInTools?: BuiltInToolsSetting;
63
+ /**
64
+ * §9.1 — per-command approvals posture. It overrides only the fields it NAMES: `mode`,
65
+ * `rater`, `raterTimeoutMs` and `allow` replace the root's, while `deny` and `escalate`
66
+ * concatenate with it. See {@link GthConfig.approvals}.
67
+ */
68
+ approvals?: ApprovalsConfig;
22
69
  customTools?: CustomToolsConfig | false;
23
70
  /** See {@link GthConfig.allowedTools}. */
24
71
  allowedTools?: string[];
25
72
  binaryFormats?: false | BinaryFormatConfig[];
26
73
  }
74
+ /**
75
+ * GS2-33 — one profile-backed subagent declaration. When the parent agent spawns this subagent,
76
+ * the CHILD resolves the named config {@link profile} through the GS2-1 cascade, so it runs under
77
+ * THAT profile's model + tools + prompt (e.g. a cheap flash-lite profile for recall/search
78
+ * subagents while the parent runs on a strong model).
79
+ *
80
+ * No backend spawns subagents today — see the `subagents` field on {@link GthConfig}.
81
+ *
82
+ * The `profile` is a named profile block created by `gth config profile create <name>` — a
83
+ * `.gsloth/.gsloth-settings/<name>/` config dir, the same discovery convention `--profile` /
84
+ * `--identity-profile` resolve.
85
+ */
86
+ export interface SubagentProfileSpec {
87
+ /** Identifier the model selects this subagent by (the task-tool subagent name). */
88
+ name: string;
89
+ /** Description shown to the model when it chooses a subagent. Defaults to a profile note. */
90
+ description?: string;
91
+ /**
92
+ * Named config profile whose model + tools + prompt the CHILD resolves. Threaded through the
93
+ * subagent-spawn config resolution as {@link CommandLineConfigOverrides.identityProfile}.
94
+ */
95
+ profile: string;
96
+ }
27
97
  /**
28
98
  * This is a processed Gaunt Sloth config ready to be passed down into components.
29
99
  *
@@ -33,16 +103,19 @@ export interface GthConfig {
33
103
  llm: BaseChatModel;
34
104
  /**
35
105
  * Selects the agent backend.
36
- * - `deep` (default when omitted): the deepagents runtime. Preserves every current behavior.
37
- * - `lean`: the plain LangChain agent ({@link GthLangChainAgent}) with no deepagents machinery
38
- * (no `/large_tool_results` offload). Useful for `filesystem: 'none'` consumers (e.g. the
39
- * robot AG-UI backend) where the deep agent's tool-result offload writes are denied.
40
106
  *
41
- * Honored at the AG-UI/api entry only. The ACP server is structurally deep-only and rejects
42
- * an explicit `lean` backend. The CLI (code mode) stays deep.
107
+ * `lean` the plain LangChain agent ({@link GthLangChainAgent}), given gsloth's full toolset
108
+ * (filesystem + hardened dev/shell + the `gth_checklist` planning tool) is the only backend,
109
+ * and what runs when the key is omitted. Every command resolves the same one, so the key selects
110
+ * nothing today; it exists so a config can name what it runs on, and so a second backend has a
111
+ * name to arrive under.
112
+ *
113
+ * The retired `deep` value is a hard config error, not a coercion — see `RETIRED_AGENT_BACKENDS`
114
+ * in `config/schema.ts` for why substituting a different agent for the one a config named is the
115
+ * wrong kindness.
43
116
  */
44
117
  agent?: {
45
- backend?: 'deep' | 'lean';
118
+ backend?: 'lean';
46
119
  };
47
120
  /**
48
121
  * GS2-7 (B20) — local, opt-in session history store. DEFAULT OFF (absent = disabled): a default
@@ -77,11 +150,12 @@ export interface GthConfig {
77
150
  */
78
151
  requirementSource: string;
79
152
  /**
80
- * Path to project-specific guidelines.
81
- * The default is `.gsloth.guidelines.md`; this config may be used to point Gaunt Sloth to a different file,
82
- * for example, to AGENTS.md
153
+ * GS2-43 the unified prompt-segment config (see {@link PromptsConfig}). Each of the seven
154
+ * segments (`backstory | guidelines | system | chat | code | exec | review`) accepts a string
155
+ * path (e.g. `"guidelines": "AGENTS.md"`) or an object (`{ path?, enabled?, mode? }`). When a
156
+ * segment is omitted its default-named file / bundled default applies unchanged.
83
157
  */
84
- projectGuidelines: string;
158
+ prompts?: PromptsConfig;
85
159
  /**
86
160
  * Separate identity profile.
87
161
  * May include separate identity, guidelines and command protocol,
@@ -105,7 +179,6 @@ export interface GthConfig {
105
179
  locale?: string;
106
180
  timezone?: string;
107
181
  };
108
- projectReviewInstructions: string;
109
182
  /**
110
183
  * If true, only use user-provided system prompts. Do not fall back to the
111
184
  * bundled `.gsloth.*.md` prompt files shipped with the installation.
@@ -113,7 +186,32 @@ export interface GthConfig {
113
186
  */
114
187
  noDefaultPrompts?: boolean;
115
188
  filesystem: string[] | 'all' | 'read' | 'none';
116
- builtInTools?: string[];
189
+ /**
190
+ * Selects and configures the built-in tools the agent loads. Either a `string[]` of tool names
191
+ * (each enabled) or a registry keyed by tool name whose values enable (`true`), force-disable
192
+ * (`false`), or configure ({@link BuiltInToolConfig}) each tool. CFG-18 folded the former
193
+ * per-command `devTools` (the `run_*` commands + `run_shell_command`'s EXT-9/10/12 config) into
194
+ * this single registry: e.g. `{ "run_tests": { "command": "npm test" }, "run_shell_command": {
195
+ * "timeout": 300000 } }`. Settable at the root or per command (`commands.<command>.builtInTools`);
196
+ * a per-command value replaces the top-level one.
197
+ */
198
+ builtInTools?: BuiltInToolsSetting;
199
+ /**
200
+ * CFG-27 — the tool-approval **ladder**: one of the five rungs (`manual` · `write` ·
201
+ * `assisted` · `auto` · `bypass`), written either as the bare rung name or as an object
202
+ * carrying the rater's identity profile and the declared allow/deny lists. Each rung fully
203
+ * determines behaviour — there are no severity thresholds, no strictness levels and no
204
+ * independent rater switch.
205
+ *
206
+ * Settable at the root or per command (`commands.<command>.approvals`). §9.1 — a per-command
207
+ * value overrides only the fields it NAMES. `mode`, `rater` and `raterTimeoutMs` replace the
208
+ * root's; `deny` and `escalate` CONCATENATE across every scope, so a per-command rung can never
209
+ * discard the root's prohibitions; `allow` is REPLACED when the command states its own and
210
+ * inherited when it does not, so a scope may narrow what runs unprompted and may never widen
211
+ * what is prohibited (§3.1: a too-broad allow entry runs unrated, a missed deny entry does not).
212
+ * Absent = `assisted`, resolved by `resolveApprovals`.
213
+ */
214
+ approvals?: ApprovalsConfig;
117
215
  tools?: StructuredToolInterface[] | BaseToolkit[] | ServerTool[];
118
216
  /**
119
217
  * Restrict the agent to this allow-list of tool names, applied after every tool source
@@ -189,6 +287,13 @@ export interface GthConfig {
189
287
  * Use colour in output
190
288
  */
191
289
  useColour: boolean;
290
+ /**
291
+ * Enable terminal mouse reporting in the Ink TUI, making its affordances clickable.
292
+ * On by default in an interactive terminal. While it is on the terminal's own text selection
293
+ * needs a modifier (Shift, or Option in some macOS terminals) — set this to `false`, or set
294
+ * `GTH_NO_MOUSE`, to get unmodified selection back.
295
+ */
296
+ useMouse: boolean;
192
297
  /**
193
298
  * Stream session log instead of writing it when inference streaming is complete.
194
299
  * (only works when {@link streamOutput} is true)
@@ -225,6 +330,24 @@ export interface GthConfig {
225
330
  * @see {@link https://modelcontextprotocol.io/}
226
331
  */
227
332
  mcpServers?: Record<string, unknown>;
333
+ /**
334
+ * TLS trust for outbound HTTPS. Primarily so an `http`-transport MCP server behind a
335
+ * private/corporate CA can be reached without prepending `NODE_EXTRA_CA_CERTS` on every
336
+ * invocation. The mechanism is a process-global undici dispatcher, so it applies to ALL
337
+ * outbound `fetch` this process makes (LLM provider calls included), not only MCP.
338
+ */
339
+ tls?: {
340
+ /**
341
+ * Extra CA certificate file(s) to trust IN ADDITION to Node's built-in roots. Paths resolve
342
+ * relative to the project dir (or `~`/absolute). Additive — never removes a default root.
343
+ */
344
+ extraCaCerts?: string[];
345
+ /**
346
+ * DANGER — `false` disables TLS certificate verification for ALL outbound HTTPS this process
347
+ * makes, not just MCP. Escape hatch only; a loud security warning is emitted every session.
348
+ */
349
+ rejectUnauthorized?: boolean;
350
+ };
228
351
  /**
229
352
  * A2A (Agent-to-Agent) protocol agents configuration.
230
353
  * Enables delegation of tasks to external AI agents.
@@ -245,27 +368,27 @@ export interface GthConfig {
245
368
  requirementSource?: string;
246
369
  rating?: RatingConfig;
247
370
  };
248
- ask?: CommandToolingConfig & {
249
- /**
250
- * Dev tools (run commands etc.) for `ask --write` runs. Normally inherited from
251
- * `commands.exec` / `commands.code` by the `--write` flag rather than set directly.
252
- */
253
- devTools?: GthDevToolsConfig;
254
- };
371
+ ask?: CommandToolingConfig;
255
372
  chat?: CommandToolingConfig;
256
- code?: CommandToolingConfig & {
257
- devTools?: GthDevToolsConfig;
258
- };
373
+ /**
374
+ * `gth code` — interactive coding session. Carries the do-the-job tool/filesystem knobs; the
375
+ * dev/shell tools (CFG-18) are configured via {@link CommandToolingConfig.builtInTools}.
376
+ */
377
+ code?: CommandToolingConfig;
259
378
  /**
260
379
  * `gth exec` — prompt-as-script runtime. Like `code`, an exec run may need to actually
261
380
  * do the job (read/write files, run commands), so it carries the same tool/filesystem knobs.
262
381
  */
263
- exec?: CommandToolingConfig & {
264
- devTools?: GthDevToolsConfig;
265
- };
382
+ exec?: CommandToolingConfig;
266
383
  api?: {
267
384
  filesystem?: string[] | 'all' | 'read' | 'none';
268
- builtInTools?: string[];
385
+ builtInTools?: BuiltInToolsSetting;
386
+ /**
387
+ * §9.1 — per-command approvals posture. It overrides only the fields it NAMES: `mode`,
388
+ * `rater`, `raterTimeoutMs` and `allow` replace the root's, while `deny` and `escalate`
389
+ * concatenate with it. See {@link GthConfig.approvals}.
390
+ */
391
+ approvals?: ApprovalsConfig;
269
392
  port?: number;
270
393
  cors?: {
271
394
  allowOrigin?: string;
@@ -274,14 +397,93 @@ export interface GthConfig {
274
397
  };
275
398
  };
276
399
  };
400
+ /**
401
+ * EXT-117 — the ACP (Agent Client Protocol) surface, i.e. a session an editor such as Zed opens.
402
+ *
403
+ * `mode` is the command an ACP session is resolved under, and it defaults to **`code`**: an
404
+ * editor asks for an agent that can do the job, and a read-only one is a worse default than an
405
+ * occasional prompt. Set `acp: { mode: 'chat' }` for a read-only editor agent.
406
+ *
407
+ * The deliberate consequence, because it is what makes this overridable without a second parallel
408
+ * config surface: the mode names an EXISTING command, so an ACP session is configured by that
409
+ * command's own block. At the default the session takes its `filesystem`, `approvals`,
410
+ * `builtInTools` and mode prompt from **{@link GthConfig.commands}`.code`** — the same settings
411
+ * `gth code` runs under — and at `chat` from `commands.chat`. There is no ACP-only copy of those
412
+ * knobs to keep in step.
413
+ *
414
+ * Defaulted at the read site (not in {@link DEFAULT_CONFIG}) to avoid churning the
415
+ * effective-config snapshot, à la {@link injectModelContext}.
416
+ */
417
+ acp?: {
418
+ mode?: GthAcpSessionMode;
419
+ };
420
+ /**
421
+ * GS2-35/EXT-83 — identity for the `Co-Authored-By` trailer of agent-authored git commits. Gaunt
422
+ * Sloth has no dedicated commit tool (it commits via `run_shell_command`), so this identity is
423
+ * injected into the code-mode system prompt, which instructs the agent to co-author commits as
424
+ * this account. Optional and defaulted, each field independently: when the name is unset the
425
+ * default is {@link DEFAULT_COMMIT_CO_AUTHOR_NAME} decorated with the resolved active model —
426
+ * `Gaunt Sloth (provider:model)` — falling back to the bare
427
+ * {@link DEFAULT_COMMIT_CO_AUTHOR_NAME} when no model resolves or {@link injectModelContext} is
428
+ * `false`; when the email is unset it is {@link DEFAULT_COMMIT_CO_AUTHOR_EMAIL}. A CONFIGURED
429
+ * name is emitted verbatim — the model identity decorates only the default.
430
+ */
431
+ commit?: {
432
+ coAuthor?: {
433
+ name?: string;
434
+ email?: string;
435
+ };
436
+ };
277
437
  modelDisplayName?: string;
278
438
  /**
279
- * Transient (runtime-only) extra filesystem roots the agent is allowed to read/write for
280
- * THIS run, in addition to the cwd sandbox. Populated by `gth exec --allow-dir <path>`
281
- * (repeatable); never persisted to a config file. When set, the deep agent's
282
- * {@link FilesystemBackend} drops `virtualMode` (so absolute paths and `..` resolve on the
283
- * real filesystem) and access is constrained to cwd + these dirs via permission allow-rules.
284
- * Removing the cwd-only sandbox is a guardrail removal, so callers announce it loudly.
439
+ * GS2-53 the configured provider `type` string (`openrouter`/`deepseek`/`xai`/`anthropic`/…),
440
+ * stashed by the loader from the raw `llm.type` before the built `BaseChatModel` replaces the raw
441
+ * spec. INTERNAL (loader-set, never user-supplied), so it is deliberately absent from the config
442
+ * schema. {@link import('#src/utils/systemPromptNotes.js').resolveModelIdentity} PREFERS this over
443
+ * the live model's `_llmType()` for the injected identity, because that is the model class's own
444
+ * label rather than the gth provider namespace (`huggingface` reports `openai`, and both Gemini
445
+ * providers report `google`) and would otherwise mislabel the provider half. Absent for module
446
+ * configs (which hand us an already-built
447
+ * LLM with no raw `type`), where resolution falls back to the guarded `_llmType()`.
448
+ */
449
+ modelProviderType?: string;
450
+ /**
451
+ * GS2-34 — inject the resolved active `provider:model` identity into the assembled system prompt
452
+ * so the agent knows which model is serving it (to answer "what model are you?" and reason about
453
+ * its own capabilities/limits). Default ON (omitted = inject). Opt out with
454
+ * `injectModelContext: false` to keep reproducible / model-agnostic runs (e.g. review) blind to
455
+ * the identity — when off, the assembled prompt is exactly as it is without this feature.
456
+ *
457
+ * EXT-83 — it governs the model identity EVERYWHERE in the prompt, not just the identity line:
458
+ * in `code` mode the same resolved identity decorates the default git commit co-author name
459
+ * ({@link GthConfig.commit}), so turning this off also removes the model from the commit trailer,
460
+ * which degrades to the plain default name. The identity LINE applies in all modes; the trailer
461
+ * it also feeds is code-mode-only, like the cwd/os-shell notes. Defaulted at the read site (not
462
+ * in {@link DEFAULT_CONFIG}) to avoid churning the effective-config snapshot.
463
+ */
464
+ injectModelContext?: boolean;
465
+ /**
466
+ * GS2-47 — controls the shared secret-redaction pass applied to `/debug-dump` archives. Default
467
+ * ON (omitted = redact): secret-named env-var values, inline config secrets, provider-key/auth
468
+ * patterns and sensitive config fields are masked before any artifact hits disk. Set
469
+ * `debugDump.redact: false` (or run `/debug-dump --unsafe-no-redact`) to write a RAW archive, which
470
+ * the command flags with a loud "may contain secrets" warning. Defaulted at the read site (not in
471
+ * {@link DEFAULT_CONFIG}) to avoid churning the effective-config snapshot.
472
+ */
473
+ debugDump?: {
474
+ redact?: boolean;
475
+ };
476
+ /**
477
+ * Transient (runtime-only) extra filesystem roots the agent may read/write for THIS run, in
478
+ * addition to the cwd sandbox. Populated by `gth exec --allow-dir <path>` (repeatable); never
479
+ * persisted to a config file.
480
+ *
481
+ * **Currently inert.** The permission layer that widened the sandbox belonged to the deepagents
482
+ * backend; the filesystem toolkit the lean agent uses is rooted at the cwd and has no notion of
483
+ * extra roots. The field, the flag and the config merge policy are kept so a config and a script
484
+ * that already declare roots keep working when widening returns, and `gth exec` says plainly
485
+ * that the flag does nothing rather than announcing a widening that never happens — a warning
486
+ * about a guardrail that was not actually removed teaches the user to distrust the warnings.
285
487
  */
286
488
  allowDirs?: string[];
287
489
  /**
@@ -290,6 +492,83 @@ export interface GthConfig {
290
492
  * (read/write files, run commands) rather than only chat. Never persisted to a config file.
291
493
  */
292
494
  askWriteMode?: boolean;
495
+ /**
496
+ * GS2-93 — output surface controls.
497
+ *
498
+ * `output.header` grades what a NON-TUI text run (`--no-tui`, `ask`, `exec`, `eval`, `pr`,
499
+ * `review`, piped/CI) opens with, across three rungs:
500
+ *
501
+ * - `debug` — the full technical preamble: the Workdir/Model/Tools/Middleware status block, the
502
+ * `Press Escape or Q to interrupt` hint, and their surrounding blank lines.
503
+ * - `compact` (the DEFAULT, so an unset key opens with this) — no preamble, and one attribution
504
+ * line naming the command and the model that served it. `review`/`pr` render their existing
505
+ * attribution block instead of this line.
506
+ * - `none` — nothing at all, including the review attribution block, for a byte-clean stream a
507
+ * caller can diff or template.
508
+ *
509
+ * The interactive TUI ignores the setting and always shows the full header. Only the opening is
510
+ * graded — never model/tool output, errors, or config-validation warnings, and never the live
511
+ * `Thinking…` indicator. Defaulted at the read site, not in {@link DEFAULT_CONFIG}, to avoid
512
+ * churning the effective-config snapshot.
513
+ */
514
+ output?: {
515
+ header?: GthOutputHeaderRung;
516
+ };
517
+ /**
518
+ * EXT-36 — the tool-loop guard: a repeated-identical-`(tool, args)` / no-progress detector that
519
+ * runs as a lean-backend `beforeModel` middleware, the orthogonal sibling of GS2-36's
520
+ * consecutive-tool-ERROR budget. It catches the case GS2-36 leaves open — a model re-issuing the
521
+ * SAME call verbatim, whether it keeps erroring or keeps "succeeding" with the same result.
522
+ *
523
+ * - `false` disables it entirely.
524
+ * - `true` / omitted → WARN on, HALT off, default threshold ({@link DEFAULT_TOOL_LOOP_THRESHOLD}).
525
+ * - object → per-field: `warn` (default ON) injects a control-flow-free nudge at the threshold;
526
+ * `halt` (default OFF, opt-in) ends the run cleanly (`jumpTo:'end'`, never a throw) at the
527
+ * threshold; `threshold` is the number of consecutive identical calls that trip it.
528
+ *
529
+ * WARN is provably harmless (no routing effect, one nudge per signature per streak). The WARN-on
530
+ * default is applied at the read site (not in {@link DEFAULT_CONFIG}) to avoid churning the
531
+ * effective-config snapshot.
532
+ */
533
+ toolLoopGuard?: boolean | {
534
+ warn?: boolean;
535
+ halt?: boolean;
536
+ threshold?: number;
537
+ };
538
+ /**
539
+ * CFG-37 — persistent surface preference for the `chat`/`code` interactive sessions, settable in
540
+ * both the global and the project config (the project layer wins). `true` asks for the Ink TUI,
541
+ * `false` for the plain readline session, absent leaves the terminal auto-detect in charge —
542
+ * which is why it must stay optional, exactly as {@link useColour}/{@link useMouse} do.
543
+ *
544
+ * This is the CONFIG-FILE preference, one rung of a chain rather than the answer: the
545
+ * `--tui`/`--no-tui` flags and the `GTH_NO_TUI` escape hatch both outrank it, and the capability
546
+ * gates (no TTY, `TERM=dumb`, `ink` not installed) outrank everything because they are checks and
547
+ * not preferences — so `true` degrades to readline rather than forcing a crash. Deliberately NOT
548
+ * in {@link DEFAULT_CONFIG}. The flag arrives separately as
549
+ * {@link CommandLineConfigOverrides.tui}; the two meet only in `shouldUseTui`.
550
+ */
551
+ tui?: boolean;
552
+ /**
553
+ * BATCH-19 — custom `gth eval` reporters, keyed by the NAME they are selected under
554
+ * (`gth eval … --reporter <name>`). Each value is a MODULE PATH, resolved relative to the project
555
+ * dir, whose **default export** is an `EvalReporterFactory` (`() => EvalReporter`). Loaded and
556
+ * registered through the SAME seam the bundled reporters (`text`, `junit`) use, so a config
557
+ * reporter can also override a built-in of the same name (config wins). A missing file, a failed
558
+ * import, or a non-function default export is a hard error (the eval harness exits 2). Trusted:
559
+ * it is the user's own config, which already executes arbitrary JS.
560
+ */
561
+ reporters?: Record<string, string>;
562
+ /**
563
+ * GS2-33 — profile-backed subagents. Each entry names a subagent and the {@link
564
+ * SubagentProfileSpec.profile named config profile} the CHILD resolves when the parent spawns it,
565
+ * so a subagent can run under a different model/tools/prompt than the parent (a cheap profile for
566
+ * recall/search while the parent runs on a strong model). **Currently honored by nothing:** its
567
+ * only consumer was the deep (deepagents) backend, whose `task` tool gained one selectable
568
+ * subagent per entry, and that backend has been removed. The key is still accepted and warns on
569
+ * use; the lean backend's own subagent primitive lands in GS2-25.
570
+ */
571
+ subagents?: SubagentProfileSpec[];
293
572
  }
294
573
  /**
295
574
  * `gth pr` command configuration.
@@ -323,6 +602,13 @@ export type ConsoleLevelInput = StatusLevel | keyof typeof StatusLevel | Lowerca
323
602
  export interface RawGthConfig extends Omit<GthConfig, 'llm' | 'consoleLevel'> {
324
603
  llm: LLMConfig;
325
604
  consoleLevel?: ConsoleLevelInput;
605
+ /**
606
+ * GS2-41 — profile composition. When set on a NAMED profile config, this profile inherits from
607
+ * the named base profile: the base resolves first, then this profile's fields merge on top
608
+ * (last-wins). Raw-config-only — resolved and consumed at load time (`resolveConfigExtends`), so
609
+ * it never appears on the resolved {@link GthConfig}.
610
+ */
611
+ extends?: string;
326
612
  }
327
613
  export type BinaryFormatType = 'image' | 'file' | 'audio' | 'video' | 'binary';
328
614
  export interface BinaryFormatConfig {
@@ -439,7 +725,7 @@ export interface LLMConfig extends Record<string, unknown> {
439
725
  configuration: Record<string, unknown>;
440
726
  apiKeyEnvironmentVariable?: string;
441
727
  }
442
- export declare const availableDefaultConfigs: readonly ["vertexai", "anthropic", "groq", "deepseek", "openai", "google-genai", "xai", "openrouter", "ollama"];
728
+ export declare const availableDefaultConfigs: readonly ['vertexai', 'anthropic', 'groq', 'deepseek', 'openai', 'google-genai', 'xai', 'openrouter', 'huggingface', 'ollama'];
443
729
  export type ConfigType = (typeof availableDefaultConfigs)[number];
444
730
  export interface CommandLineConfigOverrides {
445
731
  /**
@@ -476,12 +762,37 @@ export interface CommandLineConfigOverrides {
476
762
  */
477
763
  identityProfile?: string;
478
764
  /**
479
- * Interactive TUI activation override for chat/code sessions.
480
- * - `true` (`--tui`): force the Ink TUI on where the terminal supports it (also overrides
481
- * the CI auto-off heuristic).
765
+ * Interactive TUI activation override for chat/code sessions, as passed on the command line.
766
+ * - `true` (`--tui`): force the Ink TUI on where the terminal supports it (it outranks the
767
+ * `GTH_NO_TUI` escape hatch, the {@link GthConfig.tui} config key and the CI auto-off
768
+ * heuristic).
482
769
  * - `false` (`--no-tui`): force the plain readline session.
483
- * - `undefined` (default): auto-detect from the terminal.
484
- * The decision itself lives in `gaunt-sloth`'s `shouldUseTui`; this only carries the flag.
770
+ * - `undefined` (default): defer to the next rung down — `GTH_NO_TUI`, then the
771
+ * {@link GthConfig.tui} config key, then terminal auto-detect.
772
+ * This carries only the FLAG; the persistent preference is {@link GthConfig.tui}. The decision
773
+ * that ranks them lives in `gaunt-sloth`'s `shouldUseTui`.
485
774
  */
486
775
  tui?: boolean;
776
+ /**
777
+ * BATCH-1 fix — run with a different model than the configured `llm.model`, just for this
778
+ * `initConfig()` call. Used by `gth batch --models a,b,c` to build one genuinely fresh
779
+ * `GthConfig` (with its own freshly-constructed `.llm`) per distinct model in the matrix,
780
+ * instead of structurally cloning an already-instantiated LangChain model object (unsafe for
781
+ * any provider class that keeps state behind private `#fields`). Applied in
782
+ * {@link tryJsonConfig} by overriding `llmConfig.model` before the provider's
783
+ * `processJsonConfig()` builds the instance, so it flows through the same supported
784
+ * construction path every other model comes from.
785
+ *
786
+ * Only takes effect for JSON (`.gsloth.config.json`) configs — a `configure()`-style JS/MJS/TS
787
+ * module config already returns a fully-built `GthConfig` (LLM included) with no generic seam
788
+ * to re-target its model.
789
+ */
790
+ model?: string;
791
+ /**
792
+ * Run with global configuration only, bypassing project-level configuration.
793
+ * When true, up-tree project config discovery is bypassed, loading configuration
794
+ * solely from ~/.gsloth/ (merged over default fallbacks).
795
+ * If paired with an identity profile, resolves under ~/.gsloth/.gsloth-settings/<name>/.
796
+ */
797
+ global?: boolean;
487
798
  }
@@ -7,6 +7,7 @@ export const availableDefaultConfigs = [
7
7
  'google-genai',
8
8
  'xai',
9
9
  'openrouter',
10
+ 'huggingface',
10
11
  'ollama',
11
12
  ];
12
13
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAwcA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,WAAW;IACX,MAAM;IACN,UAAU;IACV,QAAQ;IACR,cAAc;IACd,KAAK;IACL,YAAY;IACZ,QAAQ;CACA,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAmuBA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,WAAW;IACX,MAAM;IACN,UAAU;IACV,QAAQ;IACR,cAAc;IACd,KAAK;IACL,YAAY;IACZ,aAAa;IACb,QAAQ;CACA,CAAC"}
package/dist/config.d.ts CHANGED
@@ -14,12 +14,46 @@
14
14
  * - `config/shell-policy.ts` — {@link GthDevToolsConfig} + the shell/dev-tools resolvers.
15
15
  * - `config/defaults.ts` — {@link DEFAULT_CONFIG}.
16
16
  * - `config/loader.ts` — discovery + the layered load/merge pipeline.
17
- * - `config/schema.ts` — the Zod schema (single source of truth) + JSON-Schema generator.
17
+ * - `config/providerKeys.ts` — {@link MissingProviderKeyError}, the catchable error a load raises
18
+ * when a provider has no resolvable API key.
19
+ * - `config/configDiscovery.ts` — {@link ConfigDiscoveryError}, the catchable error a load raises
20
+ * when a named identity profile does not resolve or a config layer is malformed.
21
+ * - `config/schema.ts` — the Zod schema (single source of truth) + JSON-Schema generator. Its
22
+ * schema-owned *types* that appear in this barrel's own type surface are re-exported below; its
23
+ * runtime helpers stay behind the `config/schema.js` deep path.
24
+ * - `config/tool-descriptions.ts` — EXT-58: the rung-aware tool-description suffixes (§4.5) and
25
+ * the granted-built-in table the rater's alternative suggestion draws on (§4.4).
26
+ * - `config/filesystem-tools.ts` — the one interpretation of `filesystem`: which filesystem tools
27
+ * it registers, shared by the toolkit filter and the system-prompt notes.
18
28
  *
19
29
  * Every name that was previously exported from `config.ts` is re-exported here, so the
20
30
  * public import path `@gaunt-sloth/core/config.js` (and `#src/config.js`) is unchanged.
21
31
  */
22
32
  export * from '#src/config/types.js';
23
33
  export * from '#src/config/shell-policy.js';
34
+ export * from '#src/config/tool-descriptions.js';
35
+ export * from '#src/config/filesystem-tools.js';
24
36
  export * from '#src/config/defaults.js';
25
37
  export * from '#src/config/loader.js';
38
+ export * from '#src/config/profiles.js';
39
+ export * from '#src/config/providerKeys.js';
40
+ export * from '#src/config/configDiscovery.js';
41
+ /**
42
+ * Schema-owned types that a consumer of this barrel would otherwise be unable to NAME: each one is
43
+ * the declared type of something already reachable here, so leaving it out lets a caller assign a
44
+ * value it cannot type.
45
+ *
46
+ * - {@link GthOutputHeaderRung} — the type of {@link GthConfig}'s `output.header`.
47
+ * - {@link GthAcpSessionMode} — the type of {@link GthConfig}'s `acp.mode`.
48
+ * - {@link RawConfigValidationResult} — the interface {@link ConfigLayerValidationReport} extends.
49
+ *
50
+ * These stay declared in `config/schema.ts` on purpose: `config/types.ts` importing the rung from
51
+ * the Zod schema is what keeps the type and the validator a single source of truth rather than a
52
+ * hand-written twin. The re-export is type-only, so it erases at emit and adds no runtime edge.
53
+ *
54
+ * The schema's runtime surface — `rawGthConfigSchema`, `generateConfigJsonSchema`,
55
+ * `validateRawGthConfig`, the deprecation scanners, `KNOWN_TOP_LEVEL_KEYS` — is deliberately NOT
56
+ * re-exported: it is validator internals, reachable at your own risk via the
57
+ * `@gaunt-sloth/core/config/schema.js` deep path.
58
+ */
59
+ export type { GthAcpSessionMode, GthOutputHeaderRung, RawConfigValidationResult, } from '#src/config/schema.js';
package/dist/config.js CHANGED
@@ -14,13 +14,28 @@
14
14
  * - `config/shell-policy.ts` — {@link GthDevToolsConfig} + the shell/dev-tools resolvers.
15
15
  * - `config/defaults.ts` — {@link DEFAULT_CONFIG}.
16
16
  * - `config/loader.ts` — discovery + the layered load/merge pipeline.
17
- * - `config/schema.ts` — the Zod schema (single source of truth) + JSON-Schema generator.
17
+ * - `config/providerKeys.ts` — {@link MissingProviderKeyError}, the catchable error a load raises
18
+ * when a provider has no resolvable API key.
19
+ * - `config/configDiscovery.ts` — {@link ConfigDiscoveryError}, the catchable error a load raises
20
+ * when a named identity profile does not resolve or a config layer is malformed.
21
+ * - `config/schema.ts` — the Zod schema (single source of truth) + JSON-Schema generator. Its
22
+ * schema-owned *types* that appear in this barrel's own type surface are re-exported below; its
23
+ * runtime helpers stay behind the `config/schema.js` deep path.
24
+ * - `config/tool-descriptions.ts` — EXT-58: the rung-aware tool-description suffixes (§4.5) and
25
+ * the granted-built-in table the rater's alternative suggestion draws on (§4.4).
26
+ * - `config/filesystem-tools.ts` — the one interpretation of `filesystem`: which filesystem tools
27
+ * it registers, shared by the toolkit filter and the system-prompt notes.
18
28
  *
19
29
  * Every name that was previously exported from `config.ts` is re-exported here, so the
20
30
  * public import path `@gaunt-sloth/core/config.js` (and `#src/config.js`) is unchanged.
21
31
  */
22
32
  export * from '#src/config/types.js';
23
33
  export * from '#src/config/shell-policy.js';
34
+ export * from '#src/config/tool-descriptions.js';
35
+ export * from '#src/config/filesystem-tools.js';
24
36
  export * from '#src/config/defaults.js';
25
37
  export * from '#src/config/loader.js';
38
+ export * from '#src/config/profiles.js';
39
+ export * from '#src/config/providerKeys.js';
40
+ export * from '#src/config/configDiscovery.js';
26
41
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;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;AAC5C,cAAc,gCAAgC,CAAC"}