@gaunt-sloth/core 2.0.0-alpha.4 → 2.0.0-alpha.40

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 (289) hide show
  1. package/README.md +71 -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/configDiscovery.d.ts +79 -0
  6. package/dist/config/configDiscovery.js +80 -0
  7. package/dist/config/configDiscovery.js.map +1 -0
  8. package/dist/config/defaults.d.ts +21 -21
  9. package/dist/config/defaults.js +11 -9
  10. package/dist/config/defaults.js.map +1 -1
  11. package/dist/config/filesystem-tools.d.ts +41 -0
  12. package/dist/config/filesystem-tools.js +56 -0
  13. package/dist/config/filesystem-tools.js.map +1 -0
  14. package/dist/config/jsonc.d.ts +12 -0
  15. package/dist/config/jsonc.js +41 -0
  16. package/dist/config/jsonc.js.map +1 -0
  17. package/dist/config/loader.d.ts +165 -6
  18. package/dist/config/loader.js +963 -109
  19. package/dist/config/loader.js.map +1 -1
  20. package/dist/config/mouse.d.ts +50 -0
  21. package/dist/config/mouse.js +44 -0
  22. package/dist/config/mouse.js.map +1 -0
  23. package/dist/config/profiles.d.ts +68 -0
  24. package/dist/config/profiles.js +93 -0
  25. package/dist/config/profiles.js.map +1 -0
  26. package/dist/config/providerKeys.d.ts +69 -0
  27. package/dist/config/providerKeys.js +69 -0
  28. package/dist/config/providerKeys.js.map +1 -0
  29. package/dist/config/schema.d.ts +2695 -130
  30. package/dist/config/schema.js +1385 -68
  31. package/dist/config/schema.js.map +1 -1
  32. package/dist/config/shell-policy.d.ts +899 -111
  33. package/dist/config/shell-policy.js +800 -70
  34. package/dist/config/shell-policy.js.map +1 -1
  35. package/dist/config/tool-descriptions.d.ts +211 -0
  36. package/dist/config/tool-descriptions.js +272 -0
  37. package/dist/config/tool-descriptions.js.map +1 -0
  38. package/dist/config/types.d.ts +372 -34
  39. package/dist/config/types.js +1 -0
  40. package/dist/config/types.js.map +1 -1
  41. package/dist/config.d.ts +35 -1
  42. package/dist/config.js +16 -1
  43. package/dist/config.js.map +1 -1
  44. package/dist/constants.d.ts +45 -0
  45. package/dist/constants.js +45 -0
  46. package/dist/constants.js.map +1 -1
  47. package/dist/core/GthAbstractAgent.d.ts +190 -11
  48. package/dist/core/GthAbstractAgent.js +551 -35
  49. package/dist/core/GthAbstractAgent.js.map +1 -1
  50. package/dist/core/GthAgentRunner.d.ts +565 -57
  51. package/dist/core/GthAgentRunner.js +1546 -140
  52. package/dist/core/GthAgentRunner.js.map +1 -1
  53. package/dist/core/GthLangChainAgent.d.ts +117 -2
  54. package/dist/core/GthLangChainAgent.js +644 -18
  55. package/dist/core/GthLangChainAgent.js.map +1 -1
  56. package/dist/core/approvals/annotations.d.ts +122 -0
  57. package/dist/core/approvals/annotations.js +137 -0
  58. package/dist/core/approvals/annotations.js.map +1 -0
  59. package/dist/core/approvals/grants.d.ts +216 -0
  60. package/dist/core/approvals/grants.js +469 -0
  61. package/dist/core/approvals/grants.js.map +1 -0
  62. package/dist/core/approvals/matcher.d.ts +202 -0
  63. package/dist/core/approvals/matcher.js +267 -0
  64. package/dist/core/approvals/matcher.js.map +1 -0
  65. package/dist/core/approvals/mcpSubjects.d.ts +40 -0
  66. package/dist/core/approvals/mcpSubjects.js +99 -0
  67. package/dist/core/approvals/mcpSubjects.js.map +1 -0
  68. package/dist/core/approvals/promptHeader.d.ts +28 -0
  69. package/dist/core/approvals/promptHeader.js +62 -0
  70. package/dist/core/approvals/promptHeader.js.map +1 -0
  71. package/dist/core/approvals/toolAnnotationSources.d.ts +105 -0
  72. package/dist/core/approvals/toolAnnotationSources.js +277 -0
  73. package/dist/core/approvals/toolAnnotationSources.js.map +1 -0
  74. package/dist/core/approvals/toolHost.d.ts +46 -0
  75. package/dist/core/approvals/toolHost.js +108 -0
  76. package/dist/core/approvals/toolHost.js.map +1 -0
  77. package/dist/core/debugCapture.d.ts +74 -0
  78. package/dist/core/debugCapture.js +100 -0
  79. package/dist/core/debugCapture.js.map +1 -0
  80. package/dist/core/gthLeanAgentFactory.d.ts +9 -0
  81. package/dist/core/gthLeanAgentFactory.js +10 -0
  82. package/dist/core/gthLeanAgentFactory.js.map +1 -0
  83. package/dist/core/launchBanner.d.ts +127 -0
  84. package/dist/core/launchBanner.js +414 -0
  85. package/dist/core/launchBanner.js.map +1 -0
  86. package/dist/core/modelLabel.d.ts +19 -0
  87. package/dist/core/modelLabel.js +26 -0
  88. package/dist/core/modelLabel.js.map +1 -0
  89. package/dist/core/plainToolIndication.d.ts +15 -0
  90. package/dist/core/plainToolIndication.js +174 -0
  91. package/dist/core/plainToolIndication.js.map +1 -0
  92. package/dist/core/reasoningBlocks.d.ts +65 -0
  93. package/dist/core/reasoningBlocks.js +103 -0
  94. package/dist/core/reasoningBlocks.js.map +1 -0
  95. package/dist/core/refusal.d.ts +53 -0
  96. package/dist/core/refusal.js +133 -0
  97. package/dist/core/refusal.js.map +1 -0
  98. package/dist/core/runHeader.d.ts +38 -0
  99. package/dist/core/runHeader.js +42 -0
  100. package/dist/core/runHeader.js.map +1 -0
  101. package/dist/core/runStats.d.ts +52 -0
  102. package/dist/core/runStats.js +118 -0
  103. package/dist/core/runStats.js.map +1 -0
  104. package/dist/core/shell/ShellCommandFailedError.d.ts +53 -0
  105. package/dist/core/shell/ShellCommandFailedError.js +67 -0
  106. package/dist/core/shell/ShellCommandFailedError.js.map +1 -0
  107. package/dist/core/shell/abstention.d.ts +88 -0
  108. package/dist/core/shell/abstention.js +184 -0
  109. package/dist/core/shell/abstention.js.map +1 -0
  110. package/dist/core/shell/approvalCapture.d.ts +271 -0
  111. package/dist/core/shell/approvalCapture.js +108 -0
  112. package/dist/core/shell/approvalCapture.js.map +1 -0
  113. package/dist/core/shell/approvalStop.d.ts +123 -0
  114. package/dist/core/shell/approvalStop.js +269 -0
  115. package/dist/core/shell/approvalStop.js.map +1 -0
  116. package/dist/core/shell/arity.d.ts +6 -0
  117. package/dist/core/shell/arity.js +20 -6
  118. package/dist/core/shell/arity.js.map +1 -1
  119. package/dist/core/shell/denylist.d.ts +11 -0
  120. package/dist/core/shell/denylist.js +37 -0
  121. package/dist/core/shell/denylist.js.map +1 -0
  122. package/dist/core/shell/escalationSeverity.d.ts +141 -0
  123. package/dist/core/shell/escalationSeverity.js +89 -0
  124. package/dist/core/shell/escalationSeverity.js.map +1 -0
  125. package/dist/core/shell/framing.d.ts +190 -0
  126. package/dist/core/shell/framing.js +633 -0
  127. package/dist/core/shell/framing.js.map +1 -0
  128. package/dist/core/shell/hardline.d.ts +103 -0
  129. package/dist/core/shell/hardline.js +780 -0
  130. package/dist/core/shell/hardline.js.map +1 -0
  131. package/dist/core/shell/negotiation.d.ts +328 -0
  132. package/dist/core/shell/negotiation.js +488 -0
  133. package/dist/core/shell/negotiation.js.map +1 -0
  134. package/dist/core/shell/normalize.d.ts +44 -4
  135. package/dist/core/shell/normalize.js +61 -7
  136. package/dist/core/shell/normalize.js.map +1 -1
  137. package/dist/core/shell/openWorld.d.ts +263 -0
  138. package/dist/core/shell/openWorld.js +1188 -0
  139. package/dist/core/shell/openWorld.js.map +1 -0
  140. package/dist/core/shell/rater.d.ts +873 -0
  141. package/dist/core/shell/rater.js +1454 -0
  142. package/dist/core/shell/rater.js.map +1 -0
  143. package/dist/core/shell/raterModel.d.ts +41 -0
  144. package/dist/core/shell/raterModel.js +51 -0
  145. package/dist/core/shell/raterModel.js.map +1 -0
  146. package/dist/core/shell/raterVocabulary.d.ts +121 -0
  147. package/dist/core/shell/raterVocabulary.js +116 -0
  148. package/dist/core/shell/raterVocabulary.js.map +1 -0
  149. package/dist/core/shell/rejection.d.ts +69 -0
  150. package/dist/core/shell/rejection.js +38 -0
  151. package/dist/core/shell/rejection.js.map +1 -0
  152. package/dist/core/toolCallRepair/grammar.d.ts +41 -0
  153. package/dist/core/toolCallRepair/grammar.js +116 -0
  154. package/dist/core/toolCallRepair/grammar.js.map +1 -0
  155. package/dist/core/toolCallRepair/index.d.ts +2 -0
  156. package/dist/core/toolCallRepair/index.js +7 -0
  157. package/dist/core/toolCallRepair/index.js.map +1 -0
  158. package/dist/core/toolCallRepair/payload.d.ts +36 -0
  159. package/dist/core/toolCallRepair/payload.js +341 -0
  160. package/dist/core/toolCallRepair/payload.js.map +1 -0
  161. package/dist/core/toolCallRepair/promote.d.ts +45 -0
  162. package/dist/core/toolCallRepair/promote.js +90 -0
  163. package/dist/core/toolCallRepair/promote.js.map +1 -0
  164. package/dist/core/toolDisplay.d.ts +123 -0
  165. package/dist/core/toolDisplay.js +451 -0
  166. package/dist/core/toolDisplay.js.map +1 -0
  167. package/dist/core/toolOutputChannel.d.ts +95 -0
  168. package/dist/core/toolOutputChannel.js +165 -0
  169. package/dist/core/toolOutputChannel.js.map +1 -0
  170. package/dist/core/types.d.ts +378 -16
  171. package/dist/core/types.js.map +1 -1
  172. package/dist/history/historyFormat.d.ts +28 -0
  173. package/dist/history/historyFormat.js +127 -0
  174. package/dist/history/historyFormat.js.map +1 -0
  175. package/dist/history/historyStore.d.ts +198 -0
  176. package/dist/history/historyStore.js +482 -0
  177. package/dist/history/historyStore.js.map +1 -0
  178. package/dist/history/recordSession.d.ts +37 -0
  179. package/dist/history/recordSession.js +56 -0
  180. package/dist/history/recordSession.js.map +1 -0
  181. package/dist/index.d.ts +4 -0
  182. package/dist/index.js +4 -0
  183. package/dist/index.js.map +1 -1
  184. package/dist/providers/anthropic.d.ts +1 -1
  185. package/dist/providers/anthropic.js +17 -10
  186. package/dist/providers/anthropic.js.map +1 -1
  187. package/dist/providers/configurationPassthrough.d.ts +107 -0
  188. package/dist/providers/configurationPassthrough.js +148 -0
  189. package/dist/providers/configurationPassthrough.js.map +1 -0
  190. package/dist/providers/deepseek.d.ts +1 -1
  191. package/dist/providers/deepseek.js +5 -10
  192. package/dist/providers/deepseek.js.map +1 -1
  193. package/dist/providers/geminiSchemaSanitizer.d.ts +55 -0
  194. package/dist/providers/geminiSchemaSanitizer.js +347 -0
  195. package/dist/providers/geminiSchemaSanitizer.js.map +1 -0
  196. package/dist/providers/geminiThinking.d.ts +60 -0
  197. package/dist/providers/geminiThinking.js +92 -0
  198. package/dist/providers/geminiThinking.js.map +1 -0
  199. package/dist/providers/google-genai.d.ts +1 -1
  200. package/dist/providers/google-genai.js +23 -11
  201. package/dist/providers/google-genai.js.map +1 -1
  202. package/dist/providers/groq.d.ts +1 -1
  203. package/dist/providers/groq.js +17 -10
  204. package/dist/providers/groq.js.map +1 -1
  205. package/dist/providers/huggingface.d.ts +25 -0
  206. package/dist/providers/huggingface.js +69 -0
  207. package/dist/providers/huggingface.js.map +1 -0
  208. package/dist/providers/modelCatalog.d.ts +109 -0
  209. package/dist/providers/modelCatalog.js +245 -0
  210. package/dist/providers/modelCatalog.js.map +1 -0
  211. package/dist/providers/modelDiscovery.d.ts +153 -6
  212. package/dist/providers/modelDiscovery.js +295 -41
  213. package/dist/providers/modelDiscovery.js.map +1 -1
  214. package/dist/providers/ollama.d.ts +19 -5
  215. package/dist/providers/ollama.js +72 -52
  216. package/dist/providers/ollama.js.map +1 -1
  217. package/dist/providers/openai.d.ts +1 -1
  218. package/dist/providers/openai.js +39 -10
  219. package/dist/providers/openai.js.map +1 -1
  220. package/dist/providers/openrouter.d.ts +27 -5
  221. package/dist/providers/openrouter.js +88 -36
  222. package/dist/providers/openrouter.js.map +1 -1
  223. package/dist/providers/vertexai.d.ts +1 -1
  224. package/dist/providers/vertexai.js +24 -11
  225. package/dist/providers/vertexai.js.map +1 -1
  226. package/dist/providers/xai.d.ts +1 -1
  227. package/dist/providers/xai.js +25 -10
  228. package/dist/providers/xai.js.map +1 -1
  229. package/dist/runtime/askStructured.d.ts +105 -0
  230. package/dist/runtime/askStructured.js +120 -0
  231. package/dist/runtime/askStructured.js.map +1 -0
  232. package/dist/runtime/conversation.d.ts +64 -0
  233. package/dist/runtime/conversation.js +171 -0
  234. package/dist/runtime/conversation.js.map +1 -0
  235. package/dist/runtime/singleShot.d.ts +39 -5
  236. package/dist/runtime/singleShot.js +115 -36
  237. package/dist/runtime/singleShot.js.map +1 -1
  238. package/dist/runtime/structuredOutput.d.ts +104 -0
  239. package/dist/runtime/structuredOutput.js +393 -0
  240. package/dist/runtime/structuredOutput.js.map +1 -0
  241. package/dist/utils/ProgressIndicator.d.ts +21 -0
  242. package/dist/utils/ProgressIndicator.js +30 -3
  243. package/dist/utils/ProgressIndicator.js.map +1 -1
  244. package/dist/utils/aiignoreUtils.js.map +1 -1
  245. package/dist/utils/binaryOutputUtils.js.map +1 -1
  246. package/dist/utils/consoleUtils.d.ts +95 -0
  247. package/dist/utils/consoleUtils.js +112 -2
  248. package/dist/utils/consoleUtils.js.map +1 -1
  249. package/dist/utils/crashHandler.d.ts +87 -0
  250. package/dist/utils/crashHandler.js +128 -0
  251. package/dist/utils/crashHandler.js.map +1 -0
  252. package/dist/utils/debugDump.d.ts +134 -0
  253. package/dist/utils/debugDump.js +381 -0
  254. package/dist/utils/debugDump.js.map +1 -0
  255. package/dist/utils/debugUtils.d.ts +13 -4
  256. package/dist/utils/debugUtils.js +36 -13
  257. package/dist/utils/debugUtils.js.map +1 -1
  258. package/dist/utils/displayWidth.d.ts +53 -0
  259. package/dist/utils/displayWidth.js +195 -0
  260. package/dist/utils/displayWidth.js.map +1 -0
  261. package/dist/utils/fileUtils.d.ts +20 -1
  262. package/dist/utils/fileUtils.js +35 -2
  263. package/dist/utils/fileUtils.js.map +1 -1
  264. package/dist/utils/llmUtils.d.ts +39 -8
  265. package/dist/utils/llmUtils.js +76 -8
  266. package/dist/utils/llmUtils.js.map +1 -1
  267. package/dist/utils/redactSecrets.d.ts +63 -0
  268. package/dist/utils/redactSecrets.js +286 -0
  269. package/dist/utils/redactSecrets.js.map +1 -0
  270. package/dist/utils/systemPromptNotes.d.ts +222 -0
  271. package/dist/utils/systemPromptNotes.js +338 -0
  272. package/dist/utils/systemPromptNotes.js.map +1 -0
  273. package/dist/utils/systemUtils.d.ts +18 -1
  274. package/dist/utils/systemUtils.js +38 -3
  275. package/dist/utils/systemUtils.js.map +1 -1
  276. package/dist/utils/toolMatching.d.ts +30 -0
  277. package/dist/utils/toolMatching.js +44 -0
  278. package/dist/utils/toolMatching.js.map +1 -0
  279. package/dist/utils/untrustedText.d.ts +86 -0
  280. package/dist/utils/untrustedText.js +101 -0
  281. package/dist/utils/untrustedText.js.map +1 -0
  282. package/package.json +21 -6
  283. package/schema/gsloth-config.schema.json +1979 -353
  284. package/dist/core/shell/allowlist.d.ts +0 -75
  285. package/dist/core/shell/allowlist.js +0 -187
  286. package/dist/core/shell/allowlist.js.map +0 -1
  287. package/dist/core/shell/judge.d.ts +0 -161
  288. package/dist/core/shell/judge.js +0 -261
  289. 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
  *
@@ -31,6 +101,39 @@ export interface CommandToolingConfig {
31
101
  */
32
102
  export interface GthConfig {
33
103
  llm: BaseChatModel;
104
+ /**
105
+ * Selects the agent backend.
106
+ *
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.
116
+ */
117
+ agent?: {
118
+ backend?: 'lean';
119
+ };
120
+ /**
121
+ * GS2-7 (B20) — local, opt-in session history store. DEFAULT OFF (absent = disabled): a default
122
+ * run persists nothing and behaves exactly as before. When `enabled`, each run is recorded to a
123
+ * local SQLite DB (`~/.gsloth/history.db` by default, overridable via `dbPath`) for
124
+ * `gth history search` / `gth insights`. Local only — no telemetry leaves the machine.
125
+ */
126
+ history?: {
127
+ enabled?: boolean;
128
+ dbPath?: string;
129
+ };
130
+ /**
131
+ * GS2-7 (B21) — opt-in file-backed memory (MEMORY.md / USER.md). DEFAULT OFF. Forward-compat
132
+ * toggle only; the feature is a deferred follow-up.
133
+ */
134
+ memory?: {
135
+ enabled?: boolean;
136
+ };
34
137
  /**
35
138
  * Binary format support configuration.
36
139
  * Disabled by default unless explicitly configured.
@@ -47,11 +150,12 @@ export interface GthConfig {
47
150
  */
48
151
  requirementSource: string;
49
152
  /**
50
- * Path to project-specific guidelines.
51
- * The default is `.gsloth.guidelines.md`; this config may be used to point Gaunt Sloth to a different file,
52
- * 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.
53
157
  */
54
- projectGuidelines: string;
158
+ prompts?: PromptsConfig;
55
159
  /**
56
160
  * Separate identity profile.
57
161
  * May include separate identity, guidelines and command protocol,
@@ -75,7 +179,6 @@ export interface GthConfig {
75
179
  locale?: string;
76
180
  timezone?: string;
77
181
  };
78
- projectReviewInstructions: string;
79
182
  /**
80
183
  * If true, only use user-provided system prompts. Do not fall back to the
81
184
  * bundled `.gsloth.*.md` prompt files shipped with the installation.
@@ -83,7 +186,32 @@ export interface GthConfig {
83
186
  */
84
187
  noDefaultPrompts?: boolean;
85
188
  filesystem: string[] | 'all' | 'read' | 'none';
86
- 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;
87
215
  tools?: StructuredToolInterface[] | BaseToolkit[] | ServerTool[];
88
216
  /**
89
217
  * Restrict the agent to this allow-list of tool names, applied after every tool source
@@ -141,6 +269,8 @@ export interface GthConfig {
141
269
  /**
142
270
  * Should the output be written to md file.
143
271
  * (e.g. gth_2025-07-26_22-59-06_REVIEW.md).
272
+ * Defaults to `false` (no file is written); set to `true` for the standard
273
+ * `gth_<timestamp>_<COMMAND>.md` name.
144
274
  * Can be set to false with `-wn` or `-w0`
145
275
  * Can be set to a specific filename or path by passing a string:
146
276
  * - Bare filenames (e.g. `"review.md"`) are placed in `.gsloth/` when it exists, otherwise project root
@@ -157,6 +287,13 @@ export interface GthConfig {
157
287
  * Use colour in output
158
288
  */
159
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;
160
297
  /**
161
298
  * Stream session log instead of writing it when inference streaming is complete.
162
299
  * (only works when {@link streamOutput} is true)
@@ -193,6 +330,24 @@ export interface GthConfig {
193
330
  * @see {@link https://modelcontextprotocol.io/}
194
331
  */
195
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
+ };
196
351
  /**
197
352
  * A2A (Agent-to-Agent) protocol agents configuration.
198
353
  * Enables delegation of tasks to external AI agents.
@@ -213,27 +368,27 @@ export interface GthConfig {
213
368
  requirementSource?: string;
214
369
  rating?: RatingConfig;
215
370
  };
216
- ask?: CommandToolingConfig & {
217
- /**
218
- * Dev tools (run commands etc.) for `ask --write` runs. Normally inherited from
219
- * `commands.exec` / `commands.code` by the `--write` flag rather than set directly.
220
- */
221
- devTools?: GthDevToolsConfig;
222
- };
371
+ ask?: CommandToolingConfig;
223
372
  chat?: CommandToolingConfig;
224
- code?: CommandToolingConfig & {
225
- devTools?: GthDevToolsConfig;
226
- };
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;
227
378
  /**
228
379
  * `gth exec` — prompt-as-script runtime. Like `code`, an exec run may need to actually
229
380
  * do the job (read/write files, run commands), so it carries the same tool/filesystem knobs.
230
381
  */
231
- exec?: CommandToolingConfig & {
232
- devTools?: GthDevToolsConfig;
233
- };
382
+ exec?: CommandToolingConfig;
234
383
  api?: {
235
384
  filesystem?: string[] | 'all' | 'read' | 'none';
236
- 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;
237
392
  port?: number;
238
393
  cors?: {
239
394
  allowOrigin?: string;
@@ -242,14 +397,93 @@ export interface GthConfig {
242
397
  };
243
398
  };
244
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
+ };
245
437
  modelDisplayName?: string;
246
438
  /**
247
- * Transient (runtime-only) extra filesystem roots the agent is allowed to read/write for
248
- * THIS run, in addition to the cwd sandbox. Populated by `gth exec --allow-dir <path>`
249
- * (repeatable); never persisted to a config file. When set, the deep agent's
250
- * {@link FilesystemBackend} drops `virtualMode` (so absolute paths and `..` resolve on the
251
- * real filesystem) and access is constrained to cwd + these dirs via permission allow-rules.
252
- * 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.
253
487
  */
254
488
  allowDirs?: string[];
255
489
  /**
@@ -258,6 +492,83 @@ export interface GthConfig {
258
492
  * (read/write files, run commands) rather than only chat. Never persisted to a config file.
259
493
  */
260
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[];
261
572
  }
262
573
  /**
263
574
  * `gth pr` command configuration.
@@ -291,6 +602,13 @@ export type ConsoleLevelInput = StatusLevel | keyof typeof StatusLevel | Lowerca
291
602
  export interface RawGthConfig extends Omit<GthConfig, 'llm' | 'consoleLevel'> {
292
603
  llm: LLMConfig;
293
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;
294
612
  }
295
613
  export type BinaryFormatType = 'image' | 'file' | 'audio' | 'video' | 'binary';
296
614
  export interface BinaryFormatConfig {
@@ -407,7 +725,7 @@ export interface LLMConfig extends Record<string, unknown> {
407
725
  configuration: Record<string, unknown>;
408
726
  apiKeyEnvironmentVariable?: string;
409
727
  }
410
- 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'];
411
729
  export type ConfigType = (typeof availableDefaultConfigs)[number];
412
730
  export interface CommandLineConfigOverrides {
413
731
  /**
@@ -423,6 +741,8 @@ export interface CommandLineConfigOverrides {
423
741
  /**
424
742
  * Should the output be written to md file.
425
743
  * (e.g. gth_2025-07-26_22-59-06_REVIEW.md).
744
+ * Defaults to `false` (no file is written); set to `true` for the standard
745
+ * `gth_<timestamp>_<COMMAND>.md` name.
426
746
  * Can be set to false with `-wn` or `-w0`
427
747
  * Can be set to a specific filename or path by passing a string:
428
748
  * - Bare filenames (e.g. `"review.md"`) are placed in `.gsloth/` when it exists, otherwise project root
@@ -442,12 +762,30 @@ export interface CommandLineConfigOverrides {
442
762
  */
443
763
  identityProfile?: string;
444
764
  /**
445
- * Interactive TUI activation override for chat/code sessions.
446
- * - `true` (`--tui`): force the Ink TUI on where the terminal supports it (also overrides
447
- * 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).
448
769
  * - `false` (`--no-tui`): force the plain readline session.
449
- * - `undefined` (default): auto-detect from the terminal.
450
- * 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`.
451
774
  */
452
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;
453
791
  }
@@ -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":"AA+aA,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"}