@ikarmic/forge-core 4.5.0 → 5.1.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 (643) hide show
  1. package/LICENSE +44 -21
  2. package/README.md +1 -1
  3. package/dist/agent/agent.d.ts +8 -1
  4. package/dist/agent/agent.js +143 -23
  5. package/dist/agent/architect.d.ts +0 -1
  6. package/dist/agent/architect.js +0 -1
  7. package/dist/agent/background.d.ts +58 -0
  8. package/dist/agent/background.js +139 -0
  9. package/dist/agent/cache-hints.d.ts +0 -1
  10. package/dist/agent/cache-hints.js +0 -1
  11. package/dist/agent/cost-router.d.ts +0 -1
  12. package/dist/agent/cost-router.js +0 -1
  13. package/dist/agent/enhance-prompt.d.ts +9 -0
  14. package/dist/agent/enhance-prompt.js +34 -0
  15. package/dist/agent/goal.d.ts +54 -0
  16. package/dist/agent/goal.js +65 -0
  17. package/dist/agent/index.d.ts +0 -1
  18. package/dist/agent/index.js +0 -1
  19. package/dist/agent/loop-guard.d.ts +21 -0
  20. package/dist/agent/loop-guard.js +41 -0
  21. package/dist/agent/prompts.d.ts +0 -1
  22. package/dist/agent/prompts.js +0 -1
  23. package/dist/agent/think-tags.d.ts +0 -1
  24. package/dist/agent/think-tags.js +0 -1
  25. package/dist/agent/verify.d.ts +0 -1
  26. package/dist/agent/verify.js +0 -1
  27. package/dist/agents/agent-files.d.ts +43 -0
  28. package/dist/agents/agent-files.js +109 -0
  29. package/dist/ai-comments/index.d.ts +0 -1
  30. package/dist/ai-comments/index.js +0 -1
  31. package/dist/attachments.d.ts +0 -1
  32. package/dist/attachments.js +0 -1
  33. package/dist/browser/cdp.d.ts +0 -1
  34. package/dist/browser/cdp.js +0 -1
  35. package/dist/browser/chrome.d.ts +0 -1
  36. package/dist/browser/chrome.js +0 -1
  37. package/dist/browser/session.d.ts +0 -1
  38. package/dist/browser/session.js +0 -1
  39. package/dist/checkpoints/index.d.ts +0 -1
  40. package/dist/checkpoints/index.js +0 -1
  41. package/dist/checkpoints/store.d.ts +0 -1
  42. package/dist/checkpoints/store.js +5 -2
  43. package/dist/checkpoints/types.d.ts +0 -1
  44. package/dist/checkpoints/types.js +0 -1
  45. package/dist/code-index/builder.d.ts +0 -1
  46. package/dist/code-index/builder.js +0 -1
  47. package/dist/code-index/index-store.d.ts +0 -1
  48. package/dist/code-index/index-store.js +0 -1
  49. package/dist/code-index/parser.d.ts +0 -1
  50. package/dist/code-index/parser.js +0 -1
  51. package/dist/code-index/types.d.ts +0 -1
  52. package/dist/code-index/types.js +0 -1
  53. package/dist/commands/custom-commands.d.ts +9 -5
  54. package/dist/commands/custom-commands.js +13 -3
  55. package/dist/config-file.d.ts +47 -1
  56. package/dist/config-file.js +249 -6
  57. package/dist/config-merge.d.ts +13 -0
  58. package/dist/config-merge.js +67 -0
  59. package/dist/config-schema.d.ts +340 -0
  60. package/dist/config-schema.js +126 -0
  61. package/dist/config.d.ts +0 -1
  62. package/dist/config.js +2 -2
  63. package/dist/context/compaction.d.ts +0 -1
  64. package/dist/context/compaction.js +10 -2
  65. package/dist/context/mask.d.ts +0 -1
  66. package/dist/context/mask.js +1 -2
  67. package/dist/credentials/index.d.ts +0 -1
  68. package/dist/credentials/index.js +0 -1
  69. package/dist/credentials/types.d.ts +0 -1
  70. package/dist/credentials/types.js +0 -1
  71. package/dist/custom-providers.d.ts +95 -0
  72. package/dist/custom-providers.js +120 -0
  73. package/dist/diff/index.d.ts +0 -1
  74. package/dist/diff/index.js +0 -1
  75. package/dist/diff/unified-diff.d.ts +0 -1
  76. package/dist/diff/unified-diff.js +0 -1
  77. package/dist/git/auto-commit.d.ts +3 -4
  78. package/dist/git/auto-commit.js +8 -7
  79. package/dist/git/index.d.ts +0 -1
  80. package/dist/git/index.js +0 -1
  81. package/dist/github/github-tools.d.ts +2 -3
  82. package/dist/github/github-tools.js +0 -1
  83. package/dist/hooks/agent-runner.d.ts +0 -1
  84. package/dist/hooks/agent-runner.js +0 -1
  85. package/dist/hooks/bus.d.ts +0 -1
  86. package/dist/hooks/bus.js +0 -1
  87. package/dist/hooks/config.d.ts +0 -1
  88. package/dist/hooks/config.js +0 -1
  89. package/dist/hooks/events.d.ts +0 -1
  90. package/dist/hooks/events.js +0 -1
  91. package/dist/hooks/index.d.ts +0 -1
  92. package/dist/hooks/index.js +0 -1
  93. package/dist/hooks/loader.d.ts +0 -1
  94. package/dist/hooks/loader.js +0 -1
  95. package/dist/hooks/runner.d.ts +0 -1
  96. package/dist/hooks/runner.js +3 -3
  97. package/dist/hooks/watch-coalescer.d.ts +0 -1
  98. package/dist/hooks/watch-coalescer.js +0 -1
  99. package/dist/hooks/watch-ignore.d.ts +0 -1
  100. package/dist/hooks/watch-ignore.js +0 -1
  101. package/dist/hooks/watcher.d.ts +0 -1
  102. package/dist/hooks/watcher.js +0 -1
  103. package/dist/import/claude-code.d.ts +39 -0
  104. package/dist/import/claude-code.js +254 -0
  105. package/dist/index.d.ts +37 -7
  106. package/dist/index.js +28 -5
  107. package/dist/lazy-model.d.ts +0 -1
  108. package/dist/lazy-model.js +0 -1
  109. package/dist/lint/auto-lint.d.ts +0 -1
  110. package/dist/lint/auto-lint.js +0 -1
  111. package/dist/lint/index.d.ts +0 -1
  112. package/dist/lint/index.js +0 -1
  113. package/dist/lsp/client.d.ts +5 -1
  114. package/dist/lsp/client.js +39 -4
  115. package/dist/lsp/diagnostics.d.ts +0 -1
  116. package/dist/lsp/diagnostics.js +0 -1
  117. package/dist/lsp/index.d.ts +0 -1
  118. package/dist/lsp/index.js +0 -1
  119. package/dist/mcp/catalog.d.ts +0 -1
  120. package/dist/mcp/catalog.js +0 -1
  121. package/dist/mcp/index.d.ts +5 -2
  122. package/dist/mcp/index.js +3 -2
  123. package/dist/mcp/json-schema-to-zod.d.ts +0 -1
  124. package/dist/mcp/json-schema-to-zod.js +0 -1
  125. package/dist/mcp/manager.d.ts +17 -4
  126. package/dist/mcp/manager.js +27 -3
  127. package/dist/mcp/marketplace-types.d.ts +0 -1
  128. package/dist/mcp/marketplace-types.js +0 -1
  129. package/dist/mcp/marketplace.d.ts +2 -1
  130. package/dist/mcp/marketplace.js +10 -5
  131. package/dist/mcp/mcp-client.d.ts +12 -3
  132. package/dist/mcp/mcp-client.js +74 -18
  133. package/dist/mcp/mcp-config.d.ts +2 -1
  134. package/dist/mcp/mcp-config.js +1 -1
  135. package/dist/mcp/oauth.d.ts +55 -0
  136. package/dist/mcp/oauth.js +197 -0
  137. package/dist/mcp/registry.d.ts +0 -1
  138. package/dist/mcp/registry.js +0 -1
  139. package/dist/mcp/resource-tools.d.ts +8 -0
  140. package/dist/mcp/resource-tools.js +56 -0
  141. package/dist/memory/memory-store.d.ts +0 -1
  142. package/dist/memory/memory-store.js +0 -1
  143. package/dist/memory/rank.d.ts +0 -1
  144. package/dist/memory/rank.js +0 -1
  145. package/dist/memory/session-digest.d.ts +12 -0
  146. package/dist/memory/session-digest.js +47 -0
  147. package/dist/memory/stale.d.ts +0 -1
  148. package/dist/memory/stale.js +2 -2
  149. package/dist/model-alias.d.ts +18 -3
  150. package/dist/model-alias.js +27 -4
  151. package/dist/model-catalog.d.ts +0 -1
  152. package/dist/model-catalog.js +0 -2
  153. package/dist/model-list.d.ts +0 -1
  154. package/dist/model-list.js +2 -2
  155. package/dist/model-overrides.d.ts +30 -0
  156. package/dist/model-overrides.js +48 -0
  157. package/dist/orchestrator/board-tools.d.ts +0 -1
  158. package/dist/orchestrator/board-tools.js +0 -1
  159. package/dist/orchestrator/board.d.ts +0 -1
  160. package/dist/orchestrator/board.js +0 -1
  161. package/dist/orchestrator/index.d.ts +0 -1
  162. package/dist/orchestrator/index.js +0 -1
  163. package/dist/orchestrator/orchestrator.d.ts +0 -1
  164. package/dist/orchestrator/orchestrator.js +0 -1
  165. package/dist/orchestrator/router.d.ts +0 -1
  166. package/dist/orchestrator/router.js +0 -1
  167. package/dist/orchestrator/specialists-registry.d.ts +0 -1
  168. package/dist/orchestrator/specialists-registry.js +2 -4
  169. package/dist/orchestrator/specialists.d.ts +0 -1
  170. package/dist/orchestrator/specialists.js +4 -5
  171. package/dist/orchestrator/types.d.ts +0 -1
  172. package/dist/orchestrator/types.js +0 -1
  173. package/dist/plugins/index.d.ts +0 -1
  174. package/dist/plugins/index.js +0 -1
  175. package/dist/plugins/install.d.ts +0 -1
  176. package/dist/plugins/install.js +0 -1
  177. package/dist/plugins/loader.d.ts +0 -1
  178. package/dist/plugins/loader.js +0 -1
  179. package/dist/policy/audit.d.ts +0 -1
  180. package/dist/policy/audit.js +0 -1
  181. package/dist/policy/ca-certs.d.ts +8 -0
  182. package/dist/policy/ca-certs.js +30 -0
  183. package/dist/policy/policy.d.ts +0 -1
  184. package/dist/policy/policy.js +0 -1
  185. package/dist/policy/proxy.d.ts +10 -4
  186. package/dist/policy/proxy.js +33 -7
  187. package/dist/pricing.d.ts +0 -1
  188. package/dist/pricing.js +4 -1
  189. package/dist/providers.d.ts +7 -1
  190. package/dist/providers.js +39 -6
  191. package/dist/repomap/index.d.ts +0 -1
  192. package/dist/repomap/index.js +0 -1
  193. package/dist/repomap/repo-map.d.ts +0 -1
  194. package/dist/repomap/repo-map.js +0 -1
  195. package/dist/semantic/chunker.d.ts +0 -1
  196. package/dist/semantic/chunker.js +0 -1
  197. package/dist/semantic/embedder.d.ts +15 -1
  198. package/dist/semantic/embedder.js +25 -1
  199. package/dist/semantic/semantic-index.d.ts +10 -3
  200. package/dist/semantic/semantic-index.js +16 -8
  201. package/dist/semantic/vector-store.d.ts +0 -1
  202. package/dist/semantic/vector-store.js +0 -1
  203. package/dist/sessions/index.d.ts +1 -1
  204. package/dist/sessions/index.js +1 -1
  205. package/dist/sessions/prune.d.ts +23 -0
  206. package/dist/sessions/prune.js +35 -0
  207. package/dist/sessions/search.d.ts +0 -1
  208. package/dist/sessions/search.js +0 -1
  209. package/dist/sessions/session-export.d.ts +0 -1
  210. package/dist/sessions/session-export.js +0 -1
  211. package/dist/sessions/session-store.d.ts +0 -1
  212. package/dist/sessions/session-store.js +2 -2
  213. package/dist/sessions/watch.d.ts +0 -1
  214. package/dist/sessions/watch.js +0 -1
  215. package/dist/settings-export.d.ts +0 -1
  216. package/dist/settings-export.js +0 -1
  217. package/dist/skills/activator.d.ts +0 -1
  218. package/dist/skills/activator.js +0 -1
  219. package/dist/skills/builtin.d.ts +2 -0
  220. package/dist/skills/builtin.js +68 -0
  221. package/dist/skills/index.d.ts +2 -1
  222. package/dist/skills/index.js +2 -1
  223. package/dist/skills/loader.d.ts +10 -4
  224. package/dist/skills/loader.js +20 -8
  225. package/dist/skills/marketplace-types.d.ts +0 -1
  226. package/dist/skills/marketplace-types.js +0 -1
  227. package/dist/skills/marketplace.d.ts +0 -1
  228. package/dist/skills/marketplace.js +2 -2
  229. package/dist/skills/parser.d.ts +0 -1
  230. package/dist/skills/parser.js +0 -1
  231. package/dist/skills/remote.d.ts +14 -0
  232. package/dist/skills/remote.js +131 -0
  233. package/dist/skills/types.d.ts +10 -1
  234. package/dist/skills/types.js +0 -1
  235. package/dist/specs/generate.d.ts +0 -1
  236. package/dist/specs/generate.js +0 -1
  237. package/dist/specs/index.d.ts +0 -1
  238. package/dist/specs/index.js +0 -1
  239. package/dist/specs/store.d.ts +0 -1
  240. package/dist/specs/store.js +0 -1
  241. package/dist/specs/sync.d.ts +0 -1
  242. package/dist/specs/sync.js +0 -1
  243. package/dist/specs/tasks-parser.d.ts +0 -1
  244. package/dist/specs/tasks-parser.js +0 -1
  245. package/dist/specs/types.d.ts +0 -1
  246. package/dist/specs/types.js +0 -1
  247. package/dist/steering/extra-instructions.d.ts +8 -0
  248. package/dist/steering/extra-instructions.js +104 -0
  249. package/dist/steering/folder-instructions.d.ts +8 -0
  250. package/dist/steering/folder-instructions.js +28 -0
  251. package/dist/steering/glob.d.ts +0 -1
  252. package/dist/steering/glob.js +0 -1
  253. package/dist/steering/index.d.ts +0 -1
  254. package/dist/steering/index.js +0 -1
  255. package/dist/steering/loader.d.ts +0 -1
  256. package/dist/steering/loader.js +0 -1
  257. package/dist/steering/project-instructions.d.ts +0 -1
  258. package/dist/steering/project-instructions.js +0 -1
  259. package/dist/steering/select.d.ts +0 -1
  260. package/dist/steering/select.js +2 -2
  261. package/dist/steering/types.d.ts +0 -1
  262. package/dist/steering/types.js +0 -1
  263. package/dist/structured/index.d.ts +0 -1
  264. package/dist/structured/index.js +0 -1
  265. package/dist/structured/retry.d.ts +0 -1
  266. package/dist/structured/retry.js +0 -1
  267. package/dist/structured/schema.d.ts +0 -1
  268. package/dist/structured/schema.js +0 -1
  269. package/dist/timed-fetch.d.ts +12 -0
  270. package/dist/timed-fetch.js +83 -0
  271. package/dist/tools/apply-patch.d.ts +52 -0
  272. package/dist/tools/apply-patch.js +197 -0
  273. package/dist/tools/ask-user.d.ts +27 -0
  274. package/dist/tools/ask-user.js +32 -0
  275. package/dist/tools/browser-tools.d.ts +6 -7
  276. package/dist/tools/browser-tools.js +3 -14
  277. package/dist/tools/codebase-search.d.ts +4 -3
  278. package/dist/tools/codebase-search.js +2 -3
  279. package/dist/tools/command-allow.d.ts +0 -1
  280. package/dist/tools/command-allow.js +0 -1
  281. package/dist/tools/edit-file.d.ts +0 -1
  282. package/dist/tools/edit-file.js +5 -4
  283. package/dist/tools/fetch-url.d.ts +7 -1
  284. package/dist/tools/fetch-url.js +52 -20
  285. package/dist/tools/find-references.d.ts +0 -1
  286. package/dist/tools/find-references.js +0 -1
  287. package/dist/tools/find-symbol.d.ts +2 -3
  288. package/dist/tools/find-symbol.js +0 -1
  289. package/dist/tools/ignore-rules.d.ts +0 -1
  290. package/dist/tools/ignore-rules.js +2 -2
  291. package/dist/tools/index.d.ts +5 -2
  292. package/dist/tools/index.js +10 -2
  293. package/dist/tools/list-files.d.ts +0 -1
  294. package/dist/tools/list-files.js +0 -1
  295. package/dist/tools/list-symbols.d.ts +0 -1
  296. package/dist/tools/list-symbols.js +0 -1
  297. package/dist/tools/memory.d.ts +6 -7
  298. package/dist/tools/memory.js +0 -1
  299. package/dist/tools/notebook.d.ts +2 -3
  300. package/dist/tools/notebook.js +0 -1
  301. package/dist/tools/permission-rules.d.ts +32 -0
  302. package/dist/tools/permission-rules.js +182 -0
  303. package/dist/tools/policy.d.ts +0 -1
  304. package/dist/tools/policy.js +0 -1
  305. package/dist/tools/read-file.d.ts +5 -1
  306. package/dist/tools/read-file.js +7 -3
  307. package/dist/tools/read-image.d.ts +0 -1
  308. package/dist/tools/read-image.js +0 -1
  309. package/dist/tools/read-only.d.ts +1 -2
  310. package/dist/tools/read-only.js +2 -1
  311. package/dist/tools/redact.d.ts +0 -1
  312. package/dist/tools/redact.js +0 -1
  313. package/dist/tools/result-cache.d.ts +0 -1
  314. package/dist/tools/result-cache.js +0 -1
  315. package/dist/tools/run-command.d.ts +4 -3
  316. package/dist/tools/run-command.js +12 -9
  317. package/dist/tools/sandbox-loader.d.ts +0 -1
  318. package/dist/tools/sandbox-loader.js +3 -14
  319. package/dist/tools/search-files.d.ts +8 -3
  320. package/dist/tools/search-files.js +43 -1
  321. package/dist/tools/shared.d.ts +5 -1
  322. package/dist/tools/shared.js +30 -3
  323. package/dist/tools/shell-env.d.ts +7 -0
  324. package/dist/tools/shell-env.js +9 -0
  325. package/dist/tools/sub-agent-wait.d.ts +29 -0
  326. package/dist/tools/sub-agent-wait.js +60 -0
  327. package/dist/tools/sub-agent.d.ts +50 -5
  328. package/dist/tools/sub-agent.js +210 -126
  329. package/dist/tools/text-encoding.d.ts +10 -0
  330. package/dist/tools/text-encoding.js +40 -0
  331. package/dist/tools/todo.d.ts +36 -0
  332. package/dist/tools/todo.js +42 -0
  333. package/dist/tools/web-search.d.ts +0 -1
  334. package/dist/tools/web-search.js +0 -1
  335. package/dist/tools/write-file.d.ts +0 -1
  336. package/dist/tools/write-file.js +15 -10
  337. package/dist/tools/write-tools.d.ts +12 -0
  338. package/dist/tools/write-tools.js +18 -0
  339. package/dist/types.d.ts +85 -2
  340. package/dist/types.js +0 -1
  341. package/dist/verify/detect.d.ts +0 -1
  342. package/dist/verify/detect.js +0 -1
  343. package/dist/verify/index.d.ts +0 -1
  344. package/dist/verify/index.js +0 -1
  345. package/dist/worktree/branch-ops.d.ts +0 -1
  346. package/dist/worktree/branch-ops.js +0 -1
  347. package/dist/worktree/index.d.ts +0 -1
  348. package/dist/worktree/index.js +0 -1
  349. package/dist/worktree/worktree.d.ts +3 -1
  350. package/dist/worktree/worktree.js +22 -1
  351. package/package.json +3 -2
  352. package/dist/agent/agent.d.ts.map +0 -1
  353. package/dist/agent/agent.js.map +0 -1
  354. package/dist/agent/architect.d.ts.map +0 -1
  355. package/dist/agent/architect.js.map +0 -1
  356. package/dist/agent/cache-hints.d.ts.map +0 -1
  357. package/dist/agent/cache-hints.js.map +0 -1
  358. package/dist/agent/cost-router.d.ts.map +0 -1
  359. package/dist/agent/cost-router.js.map +0 -1
  360. package/dist/agent/index.d.ts.map +0 -1
  361. package/dist/agent/index.js.map +0 -1
  362. package/dist/agent/prompts.d.ts.map +0 -1
  363. package/dist/agent/prompts.js.map +0 -1
  364. package/dist/agent/think-tags.d.ts.map +0 -1
  365. package/dist/agent/think-tags.js.map +0 -1
  366. package/dist/agent/verify.d.ts.map +0 -1
  367. package/dist/agent/verify.js.map +0 -1
  368. package/dist/ai-comments/index.d.ts.map +0 -1
  369. package/dist/ai-comments/index.js.map +0 -1
  370. package/dist/attachments.d.ts.map +0 -1
  371. package/dist/attachments.js.map +0 -1
  372. package/dist/browser/cdp.d.ts.map +0 -1
  373. package/dist/browser/cdp.js.map +0 -1
  374. package/dist/browser/chrome.d.ts.map +0 -1
  375. package/dist/browser/chrome.js.map +0 -1
  376. package/dist/browser/session.d.ts.map +0 -1
  377. package/dist/browser/session.js.map +0 -1
  378. package/dist/checkpoints/index.d.ts.map +0 -1
  379. package/dist/checkpoints/index.js.map +0 -1
  380. package/dist/checkpoints/store.d.ts.map +0 -1
  381. package/dist/checkpoints/store.js.map +0 -1
  382. package/dist/checkpoints/types.d.ts.map +0 -1
  383. package/dist/checkpoints/types.js.map +0 -1
  384. package/dist/code-index/builder.d.ts.map +0 -1
  385. package/dist/code-index/builder.js.map +0 -1
  386. package/dist/code-index/index-store.d.ts.map +0 -1
  387. package/dist/code-index/index-store.js.map +0 -1
  388. package/dist/code-index/parser.d.ts.map +0 -1
  389. package/dist/code-index/parser.js.map +0 -1
  390. package/dist/code-index/types.d.ts.map +0 -1
  391. package/dist/code-index/types.js.map +0 -1
  392. package/dist/commands/custom-commands.d.ts.map +0 -1
  393. package/dist/commands/custom-commands.js.map +0 -1
  394. package/dist/config-file.d.ts.map +0 -1
  395. package/dist/config-file.js.map +0 -1
  396. package/dist/config.d.ts.map +0 -1
  397. package/dist/config.js.map +0 -1
  398. package/dist/context/compaction.d.ts.map +0 -1
  399. package/dist/context/compaction.js.map +0 -1
  400. package/dist/context/mask.d.ts.map +0 -1
  401. package/dist/context/mask.js.map +0 -1
  402. package/dist/credentials/index.d.ts.map +0 -1
  403. package/dist/credentials/index.js.map +0 -1
  404. package/dist/credentials/types.d.ts.map +0 -1
  405. package/dist/credentials/types.js.map +0 -1
  406. package/dist/diff/index.d.ts.map +0 -1
  407. package/dist/diff/index.js.map +0 -1
  408. package/dist/diff/unified-diff.d.ts.map +0 -1
  409. package/dist/diff/unified-diff.js.map +0 -1
  410. package/dist/git/auto-commit.d.ts.map +0 -1
  411. package/dist/git/auto-commit.js.map +0 -1
  412. package/dist/git/index.d.ts.map +0 -1
  413. package/dist/git/index.js.map +0 -1
  414. package/dist/github/github-tools.d.ts.map +0 -1
  415. package/dist/github/github-tools.js.map +0 -1
  416. package/dist/hooks/agent-runner.d.ts.map +0 -1
  417. package/dist/hooks/agent-runner.js.map +0 -1
  418. package/dist/hooks/bus.d.ts.map +0 -1
  419. package/dist/hooks/bus.js.map +0 -1
  420. package/dist/hooks/config.d.ts.map +0 -1
  421. package/dist/hooks/config.js.map +0 -1
  422. package/dist/hooks/events.d.ts.map +0 -1
  423. package/dist/hooks/events.js.map +0 -1
  424. package/dist/hooks/index.d.ts.map +0 -1
  425. package/dist/hooks/index.js.map +0 -1
  426. package/dist/hooks/loader.d.ts.map +0 -1
  427. package/dist/hooks/loader.js.map +0 -1
  428. package/dist/hooks/runner.d.ts.map +0 -1
  429. package/dist/hooks/runner.js.map +0 -1
  430. package/dist/hooks/watch-coalescer.d.ts.map +0 -1
  431. package/dist/hooks/watch-coalescer.js.map +0 -1
  432. package/dist/hooks/watch-ignore.d.ts.map +0 -1
  433. package/dist/hooks/watch-ignore.js.map +0 -1
  434. package/dist/hooks/watcher.d.ts.map +0 -1
  435. package/dist/hooks/watcher.js.map +0 -1
  436. package/dist/index.d.ts.map +0 -1
  437. package/dist/index.js.map +0 -1
  438. package/dist/lazy-model.d.ts.map +0 -1
  439. package/dist/lazy-model.js.map +0 -1
  440. package/dist/lint/auto-lint.d.ts.map +0 -1
  441. package/dist/lint/auto-lint.js.map +0 -1
  442. package/dist/lint/index.d.ts.map +0 -1
  443. package/dist/lint/index.js.map +0 -1
  444. package/dist/lsp/client.d.ts.map +0 -1
  445. package/dist/lsp/client.js.map +0 -1
  446. package/dist/lsp/diagnostics.d.ts.map +0 -1
  447. package/dist/lsp/diagnostics.js.map +0 -1
  448. package/dist/lsp/index.d.ts.map +0 -1
  449. package/dist/lsp/index.js.map +0 -1
  450. package/dist/mcp/catalog.d.ts.map +0 -1
  451. package/dist/mcp/catalog.js.map +0 -1
  452. package/dist/mcp/index.d.ts.map +0 -1
  453. package/dist/mcp/index.js.map +0 -1
  454. package/dist/mcp/json-schema-to-zod.d.ts.map +0 -1
  455. package/dist/mcp/json-schema-to-zod.js.map +0 -1
  456. package/dist/mcp/manager.d.ts.map +0 -1
  457. package/dist/mcp/manager.js.map +0 -1
  458. package/dist/mcp/marketplace-types.d.ts.map +0 -1
  459. package/dist/mcp/marketplace-types.js.map +0 -1
  460. package/dist/mcp/marketplace.d.ts.map +0 -1
  461. package/dist/mcp/marketplace.js.map +0 -1
  462. package/dist/mcp/mcp-client.d.ts.map +0 -1
  463. package/dist/mcp/mcp-client.js.map +0 -1
  464. package/dist/mcp/mcp-config.d.ts.map +0 -1
  465. package/dist/mcp/mcp-config.js.map +0 -1
  466. package/dist/mcp/registry.d.ts.map +0 -1
  467. package/dist/mcp/registry.js.map +0 -1
  468. package/dist/memory/memory-store.d.ts.map +0 -1
  469. package/dist/memory/memory-store.js.map +0 -1
  470. package/dist/memory/rank.d.ts.map +0 -1
  471. package/dist/memory/rank.js.map +0 -1
  472. package/dist/memory/stale.d.ts.map +0 -1
  473. package/dist/memory/stale.js.map +0 -1
  474. package/dist/model-alias.d.ts.map +0 -1
  475. package/dist/model-alias.js.map +0 -1
  476. package/dist/model-catalog.d.ts.map +0 -1
  477. package/dist/model-catalog.js.map +0 -1
  478. package/dist/model-list.d.ts.map +0 -1
  479. package/dist/model-list.js.map +0 -1
  480. package/dist/orchestrator/board-tools.d.ts.map +0 -1
  481. package/dist/orchestrator/board-tools.js.map +0 -1
  482. package/dist/orchestrator/board.d.ts.map +0 -1
  483. package/dist/orchestrator/board.js.map +0 -1
  484. package/dist/orchestrator/index.d.ts.map +0 -1
  485. package/dist/orchestrator/index.js.map +0 -1
  486. package/dist/orchestrator/orchestrator.d.ts.map +0 -1
  487. package/dist/orchestrator/orchestrator.js.map +0 -1
  488. package/dist/orchestrator/router.d.ts.map +0 -1
  489. package/dist/orchestrator/router.js.map +0 -1
  490. package/dist/orchestrator/specialists-registry.d.ts.map +0 -1
  491. package/dist/orchestrator/specialists-registry.js.map +0 -1
  492. package/dist/orchestrator/specialists.d.ts.map +0 -1
  493. package/dist/orchestrator/specialists.js.map +0 -1
  494. package/dist/orchestrator/types.d.ts.map +0 -1
  495. package/dist/orchestrator/types.js.map +0 -1
  496. package/dist/plugins/index.d.ts.map +0 -1
  497. package/dist/plugins/index.js.map +0 -1
  498. package/dist/plugins/install.d.ts.map +0 -1
  499. package/dist/plugins/install.js.map +0 -1
  500. package/dist/plugins/loader.d.ts.map +0 -1
  501. package/dist/plugins/loader.js.map +0 -1
  502. package/dist/policy/audit.d.ts.map +0 -1
  503. package/dist/policy/audit.js.map +0 -1
  504. package/dist/policy/policy.d.ts.map +0 -1
  505. package/dist/policy/policy.js.map +0 -1
  506. package/dist/policy/proxy.d.ts.map +0 -1
  507. package/dist/policy/proxy.js.map +0 -1
  508. package/dist/pricing.d.ts.map +0 -1
  509. package/dist/pricing.js.map +0 -1
  510. package/dist/providers.d.ts.map +0 -1
  511. package/dist/providers.js.map +0 -1
  512. package/dist/repomap/index.d.ts.map +0 -1
  513. package/dist/repomap/index.js.map +0 -1
  514. package/dist/repomap/repo-map.d.ts.map +0 -1
  515. package/dist/repomap/repo-map.js.map +0 -1
  516. package/dist/semantic/chunker.d.ts.map +0 -1
  517. package/dist/semantic/chunker.js.map +0 -1
  518. package/dist/semantic/embedder.d.ts.map +0 -1
  519. package/dist/semantic/embedder.js.map +0 -1
  520. package/dist/semantic/semantic-index.d.ts.map +0 -1
  521. package/dist/semantic/semantic-index.js.map +0 -1
  522. package/dist/semantic/vector-store.d.ts.map +0 -1
  523. package/dist/semantic/vector-store.js.map +0 -1
  524. package/dist/sessions/index.d.ts.map +0 -1
  525. package/dist/sessions/index.js.map +0 -1
  526. package/dist/sessions/search.d.ts.map +0 -1
  527. package/dist/sessions/search.js.map +0 -1
  528. package/dist/sessions/session-export.d.ts.map +0 -1
  529. package/dist/sessions/session-export.js.map +0 -1
  530. package/dist/sessions/session-store.d.ts.map +0 -1
  531. package/dist/sessions/session-store.js.map +0 -1
  532. package/dist/sessions/watch.d.ts.map +0 -1
  533. package/dist/sessions/watch.js.map +0 -1
  534. package/dist/settings-export.d.ts.map +0 -1
  535. package/dist/settings-export.js.map +0 -1
  536. package/dist/skills/activator.d.ts.map +0 -1
  537. package/dist/skills/activator.js.map +0 -1
  538. package/dist/skills/index.d.ts.map +0 -1
  539. package/dist/skills/index.js.map +0 -1
  540. package/dist/skills/loader.d.ts.map +0 -1
  541. package/dist/skills/loader.js.map +0 -1
  542. package/dist/skills/marketplace-types.d.ts.map +0 -1
  543. package/dist/skills/marketplace-types.js.map +0 -1
  544. package/dist/skills/marketplace.d.ts.map +0 -1
  545. package/dist/skills/marketplace.js.map +0 -1
  546. package/dist/skills/parser.d.ts.map +0 -1
  547. package/dist/skills/parser.js.map +0 -1
  548. package/dist/skills/types.d.ts.map +0 -1
  549. package/dist/skills/types.js.map +0 -1
  550. package/dist/specs/generate.d.ts.map +0 -1
  551. package/dist/specs/generate.js.map +0 -1
  552. package/dist/specs/index.d.ts.map +0 -1
  553. package/dist/specs/index.js.map +0 -1
  554. package/dist/specs/store.d.ts.map +0 -1
  555. package/dist/specs/store.js.map +0 -1
  556. package/dist/specs/sync.d.ts.map +0 -1
  557. package/dist/specs/sync.js.map +0 -1
  558. package/dist/specs/tasks-parser.d.ts.map +0 -1
  559. package/dist/specs/tasks-parser.js.map +0 -1
  560. package/dist/specs/types.d.ts.map +0 -1
  561. package/dist/specs/types.js.map +0 -1
  562. package/dist/steering/glob.d.ts.map +0 -1
  563. package/dist/steering/glob.js.map +0 -1
  564. package/dist/steering/index.d.ts.map +0 -1
  565. package/dist/steering/index.js.map +0 -1
  566. package/dist/steering/loader.d.ts.map +0 -1
  567. package/dist/steering/loader.js.map +0 -1
  568. package/dist/steering/project-instructions.d.ts.map +0 -1
  569. package/dist/steering/project-instructions.js.map +0 -1
  570. package/dist/steering/select.d.ts.map +0 -1
  571. package/dist/steering/select.js.map +0 -1
  572. package/dist/steering/types.d.ts.map +0 -1
  573. package/dist/steering/types.js.map +0 -1
  574. package/dist/structured/index.d.ts.map +0 -1
  575. package/dist/structured/index.js.map +0 -1
  576. package/dist/structured/retry.d.ts.map +0 -1
  577. package/dist/structured/retry.js.map +0 -1
  578. package/dist/structured/schema.d.ts.map +0 -1
  579. package/dist/structured/schema.js.map +0 -1
  580. package/dist/tools/browser-tools.d.ts.map +0 -1
  581. package/dist/tools/browser-tools.js.map +0 -1
  582. package/dist/tools/codebase-search.d.ts.map +0 -1
  583. package/dist/tools/codebase-search.js.map +0 -1
  584. package/dist/tools/command-allow.d.ts.map +0 -1
  585. package/dist/tools/command-allow.js.map +0 -1
  586. package/dist/tools/edit-file.d.ts.map +0 -1
  587. package/dist/tools/edit-file.js.map +0 -1
  588. package/dist/tools/fetch-url.d.ts.map +0 -1
  589. package/dist/tools/fetch-url.js.map +0 -1
  590. package/dist/tools/find-references.d.ts.map +0 -1
  591. package/dist/tools/find-references.js.map +0 -1
  592. package/dist/tools/find-symbol.d.ts.map +0 -1
  593. package/dist/tools/find-symbol.js.map +0 -1
  594. package/dist/tools/ignore-rules.d.ts.map +0 -1
  595. package/dist/tools/ignore-rules.js.map +0 -1
  596. package/dist/tools/index.d.ts.map +0 -1
  597. package/dist/tools/index.js.map +0 -1
  598. package/dist/tools/list-files.d.ts.map +0 -1
  599. package/dist/tools/list-files.js.map +0 -1
  600. package/dist/tools/list-symbols.d.ts.map +0 -1
  601. package/dist/tools/list-symbols.js.map +0 -1
  602. package/dist/tools/memory.d.ts.map +0 -1
  603. package/dist/tools/memory.js.map +0 -1
  604. package/dist/tools/notebook.d.ts.map +0 -1
  605. package/dist/tools/notebook.js.map +0 -1
  606. package/dist/tools/policy.d.ts.map +0 -1
  607. package/dist/tools/policy.js.map +0 -1
  608. package/dist/tools/read-file.d.ts.map +0 -1
  609. package/dist/tools/read-file.js.map +0 -1
  610. package/dist/tools/read-image.d.ts.map +0 -1
  611. package/dist/tools/read-image.js.map +0 -1
  612. package/dist/tools/read-only.d.ts.map +0 -1
  613. package/dist/tools/read-only.js.map +0 -1
  614. package/dist/tools/redact.d.ts.map +0 -1
  615. package/dist/tools/redact.js.map +0 -1
  616. package/dist/tools/result-cache.d.ts.map +0 -1
  617. package/dist/tools/result-cache.js.map +0 -1
  618. package/dist/tools/run-command.d.ts.map +0 -1
  619. package/dist/tools/run-command.js.map +0 -1
  620. package/dist/tools/sandbox-loader.d.ts.map +0 -1
  621. package/dist/tools/sandbox-loader.js.map +0 -1
  622. package/dist/tools/search-files.d.ts.map +0 -1
  623. package/dist/tools/search-files.js.map +0 -1
  624. package/dist/tools/shared.d.ts.map +0 -1
  625. package/dist/tools/shared.js.map +0 -1
  626. package/dist/tools/sub-agent.d.ts.map +0 -1
  627. package/dist/tools/sub-agent.js.map +0 -1
  628. package/dist/tools/web-search.d.ts.map +0 -1
  629. package/dist/tools/web-search.js.map +0 -1
  630. package/dist/tools/write-file.d.ts.map +0 -1
  631. package/dist/tools/write-file.js.map +0 -1
  632. package/dist/types.d.ts.map +0 -1
  633. package/dist/types.js.map +0 -1
  634. package/dist/verify/detect.d.ts.map +0 -1
  635. package/dist/verify/detect.js.map +0 -1
  636. package/dist/verify/index.d.ts.map +0 -1
  637. package/dist/verify/index.js.map +0 -1
  638. package/dist/worktree/branch-ops.d.ts.map +0 -1
  639. package/dist/worktree/branch-ops.js.map +0 -1
  640. package/dist/worktree/index.d.ts.map +0 -1
  641. package/dist/worktree/index.js.map +0 -1
  642. package/dist/worktree/worktree.d.ts.map +0 -1
  643. package/dist/worktree/worktree.js.map +0 -1
@@ -12,4 +12,3 @@ export declare function setMcpServerDisabled(params: {
12
12
  disabled: boolean;
13
13
  userMcpPath?: string;
14
14
  }): Promise<boolean>;
15
- //# sourceMappingURL=registry.d.ts.map
@@ -33,4 +33,3 @@ export async function setMcpServerDisabled(params) {
33
33
  await writeUserMcpRegistry(file, registry);
34
34
  return true;
35
35
  }
36
- //# sourceMappingURL=registry.js.map
@@ -0,0 +1,8 @@
1
+ import type { ConnectedMcpServer } from './mcp-client.js';
2
+ import type { ToolDefinition } from '../types.js';
3
+ /**
4
+ * `mcp_list_resources` and `mcp_read_resource`: let the model see and read what connected MCP servers publish
5
+ * (notes, files, schemas). Both only read, so neither asks for approval. `servers` is a function because
6
+ * servers connect, fail and reconnect while a chat is open.
7
+ */
8
+ export declare function createMcpResourceTools(servers: () => readonly ConnectedMcpServer[]): ToolDefinition[];
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ const MAX_RESOURCE_CHARS = 100_000;
3
+ /**
4
+ * `mcp_list_resources` and `mcp_read_resource`: let the model see and read what connected MCP servers publish
5
+ * (notes, files, schemas). Both only read, so neither asks for approval. `servers` is a function because
6
+ * servers connect, fail and reconnect while a chat is open.
7
+ */
8
+ export function createMcpResourceTools(servers) {
9
+ const listParams = z.object({ server: z.string().optional().describe('Only this MCP server. Omit for every server.') });
10
+ const readParams = z.object({
11
+ server: z.string().describe('MCP server name, as shown by mcp_list_resources.'),
12
+ uri: z.string().describe('Resource URI, as shown by mcp_list_resources.'),
13
+ });
14
+ const list = {
15
+ name: 'mcp_list_resources',
16
+ description: 'List the resources (documents, data, files) that connected MCP servers publish. Returns each resource server, uri, name and description.',
17
+ parameters: listParams,
18
+ execute: async (args) => {
19
+ const out = [];
20
+ for (const s of servers()) {
21
+ if (args.server && s.name !== args.server)
22
+ continue;
23
+ try {
24
+ const { resources } = await s.client.listResources();
25
+ for (const r of resources) {
26
+ out.push({ server: s.name, uri: r.uri, name: r.name, ...(r.description ? { description: r.description } : {}), ...(r.mimeType ? { mimeType: r.mimeType } : {}) });
27
+ }
28
+ }
29
+ catch {
30
+ // A server without resources support (or one that is down) just contributes nothing.
31
+ }
32
+ }
33
+ return { resources: out };
34
+ },
35
+ };
36
+ const read = {
37
+ name: 'mcp_read_resource',
38
+ description: 'Read one resource from a connected MCP server by its server name and uri (see mcp_list_resources).',
39
+ parameters: readParams,
40
+ execute: async (args) => {
41
+ const server = servers().find((s) => s.name === args.server);
42
+ if (!server)
43
+ throw new Error(`No MCP server "${args.server}" is connected.`);
44
+ const result = await server.client.readResource({ uri: args.uri });
45
+ const text = result.contents
46
+ .map((c) => ('text' in c && typeof c.text === 'string' ? c.text : `[binary content${c.mimeType ? `, ${c.mimeType}` : ''}]`))
47
+ .join('\n');
48
+ return {
49
+ server: args.server,
50
+ uri: args.uri,
51
+ text: text.length > MAX_RESOURCE_CHARS ? `${text.slice(0, MAX_RESOURCE_CHARS)}\n…(truncated)` : text,
52
+ };
53
+ },
54
+ };
55
+ return [list, read];
56
+ }
@@ -171,4 +171,3 @@ export declare function capMemory(content: string, maxBytes: number, keepHeading
171
171
  */
172
172
  export declare function trimToBytes(content: string, maxBytes: number): string;
173
173
  export { PROJECT_MEMORY_DIR as _PROJECT_MEMORY_DIR, PROJECT_MEMORY_FILE as _PROJECT_MEMORY_FILE };
174
- //# sourceMappingURL=memory-store.d.ts.map
@@ -472,4 +472,3 @@ export function trimToBytes(content, maxBytes) {
472
472
  }
473
473
  // Re-export for tests / downstream consumers.
474
474
  export { PROJECT_MEMORY_DIR as _PROJECT_MEMORY_DIR, PROJECT_MEMORY_FILE as _PROJECT_MEMORY_FILE };
475
- //# sourceMappingURL=memory-store.js.map
@@ -18,4 +18,3 @@ export interface ScoredSection {
18
18
  * the order degrades to v1's "later sections win").
19
19
  */
20
20
  export declare function scoreSections(sections: MemorySection[], task: string): ScoredSection[];
21
- //# sourceMappingURL=rank.d.ts.map
@@ -62,4 +62,3 @@ export function scoreSections(sections, task) {
62
62
  b.index - a.index);
63
63
  return scored.map(({ section, score }) => ({ section, score }));
64
64
  }
65
- //# sourceMappingURL=rank.js.map
@@ -0,0 +1,12 @@
1
+ import type { LanguageModel } from 'ai';
2
+ import type { ModelConfig } from '../types.js';
3
+ export interface DigestItem {
4
+ role: 'user' | 'assistant';
5
+ text: string;
6
+ }
7
+ /** A conversation with fewer than two user messages is a question, not work worth remembering. */
8
+ export declare function shouldDigest(items: readonly DigestItem[]): boolean;
9
+ /** The model's reply as a digest: think block, fences and quotes removed; undefined when nothing usable is left (RB-1). */
10
+ export declare function cleanDigest(reply: string): string | undefined;
11
+ /** Summarise a finished chat for project memory with `model` (usually the cheap model); never throws. */
12
+ export declare function generateSessionDigest(items: readonly DigestItem[], model: ModelConfig | undefined, modelFactory?: (cfg: ModelConfig) => LanguageModel): Promise<string | undefined>;
@@ -0,0 +1,47 @@
1
+ import { generateText } from 'ai';
2
+ import { stripThinkTags } from '../agent/think-tags.js';
3
+ import { createLanguageModel } from '../providers.js';
4
+ const MAX_DIGEST_CHARS = 600;
5
+ const MAX_INPUT_CHARS = 12_000;
6
+ const INSTRUCTION = 'Below is a conversation between a user and a coding agent. Write what a later session needs to know: what was changed or decided, which files were involved, and anything left undone. ' +
7
+ 'Two to five short bullet lines, each starting with "- ". Do not copy code. Reply with the bullets only, no preface, no code fences.';
8
+ /** A conversation with fewer than two user messages is a question, not work worth remembering. */
9
+ export function shouldDigest(items) {
10
+ return items.filter((i) => i.role === 'user').length >= 2;
11
+ }
12
+ /** The model's reply as a digest: think block, fences and quotes removed; undefined when nothing usable is left (RB-1). */
13
+ export function cleanDigest(reply) {
14
+ const text = stripThinkTags(reply)
15
+ .trim()
16
+ .replace(/^```[a-z]*\s*\n?/i, '')
17
+ .replace(/\n?```$/, '')
18
+ .trim()
19
+ .replace(/^["'“”](.*)["'“”]$/s, '$1')
20
+ .trim();
21
+ if (!text)
22
+ return undefined;
23
+ return text.length > MAX_DIGEST_CHARS ? `${text.slice(0, MAX_DIGEST_CHARS - 1).trimEnd()}…` : text;
24
+ }
25
+ /** The end of the conversation, which is where its outcome is, within the input budget. */
26
+ function transcript(items) {
27
+ const lines = items.map((i) => `${i.role === 'user' ? 'User' : 'Agent'}: ${i.text.trim()}`);
28
+ let out = '';
29
+ for (let i = lines.length - 1; i >= 0; i--) {
30
+ if (out.length + lines[i].length > MAX_INPUT_CHARS)
31
+ break;
32
+ out = `${lines[i]}\n\n${out}`;
33
+ }
34
+ return out.trim();
35
+ }
36
+ /** Summarise a finished chat for project memory with `model` (usually the cheap model); never throws. */
37
+ export async function generateSessionDigest(items, model, modelFactory = createLanguageModel) {
38
+ if (!model || !shouldDigest(items))
39
+ return undefined;
40
+ try {
41
+ const result = await generateText({ model: modelFactory(model), prompt: `${INSTRUCTION}\n\nConversation:\n${transcript(items)}` });
42
+ return cleanDigest(result.text);
43
+ }
44
+ catch {
45
+ return undefined;
46
+ }
47
+ }
@@ -16,4 +16,3 @@ export declare function staleKey(s: Pick<MemorySection, 'source' | 'heading'>):
16
16
  * the filesystem, so a memory file cannot be used to probe other paths.
17
17
  */
18
18
  export declare function checkStale(sections: MemorySection[], root: string, opts?: StaleOptions): Promise<Map<string, string[]>>;
19
- //# sourceMappingURL=stale.d.ts.map
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { stat } from 'node:fs/promises';
7
7
  import path from 'node:path';
8
+ import { isOutsideRel } from '../tools/shared.js';
8
9
  /** Key a section in the stale map. */
9
10
  export function staleKey(s) {
10
11
  return `${s.source}#${s.heading}`;
@@ -23,7 +24,7 @@ export async function checkStale(sections, root, opts = {}) {
23
24
  const file = hash === -1 ? ref : ref.slice(0, hash);
24
25
  const symbol = hash === -1 ? '' : ref.slice(hash + 1);
25
26
  const rel = path.relative(root, path.resolve(root, file));
26
- if (path.isAbsolute(file) || rel.startsWith('..') || path.isAbsolute(rel)) {
27
+ if (path.isAbsolute(file) || isOutsideRel(rel)) {
27
28
  reasons.push(`${ref} is outside the project`);
28
29
  continue;
29
30
  }
@@ -43,4 +44,3 @@ export async function checkStale(sections, root, opts = {}) {
43
44
  }
44
45
  return out;
45
46
  }
46
- //# sourceMappingURL=stale.js.map
@@ -1,4 +1,11 @@
1
- import type { ProviderName } from './types.js';
1
+ /**
2
+ * User-defined model aliases from `~/.forge/config.json`:
3
+ * "aliases": { "fast": "anthropic:claude-haiku-4-5", "big": "opus" }
4
+ * A value is `provider:model` or a bare model id (current provider), and may
5
+ * name another alias.
6
+ */
7
+ import { type CustomProviderConfig, type ProviderEndpoint } from './custom-providers.js';
8
+ import type { ModelConfig, ProviderName } from './types.js';
2
9
  export type ModelAliases = Record<string, string>;
3
10
  /** Follow alias links from `name`. Names that are not aliases come back unchanged. */
4
11
  export declare function expandModelAlias(name: string, aliases: ModelAliases | undefined): string;
@@ -7,10 +14,18 @@ export declare function splitModelRef(ref: string): {
7
14
  provider?: ProviderName;
8
15
  model: string;
9
16
  };
10
- export declare function resolveModelAlias(name: string, aliases: ModelAliases | undefined, defaultProvider: ProviderName): {
17
+ /**
18
+ * `provider:model` for the eleven built-in providers, and `id:model` for a preset or `customProviders` id
19
+ * (`groq:llama-3.3-70b-versatile`), which resolves to an openai-compatible model with its endpoint. Ollama and
20
+ * LM Studio use `name:tag` model ids (`mistral:7b`), so for them only a prefix the user defined counts.
21
+ */
22
+ export declare function resolveModelAlias(name: string, aliases: ModelAliases | undefined, defaultProvider: ProviderName, custom?: Record<string, CustomProviderConfig>): {
11
23
  provider: ProviderName;
12
24
  model: string;
25
+ endpoint?: ProviderEndpoint;
13
26
  };
27
+ export type ResolvedModelRef = ReturnType<typeof resolveModelAlias>;
28
+ /** A resolved model reference laid over a base model: the base's other settings stay, its endpoint never leaks into a different provider. */
29
+ export declare function applyResolved(base: ModelConfig, resolved: ResolvedModelRef): ModelConfig;
14
30
  /** Human-readable alias list for `forge config`; '' when there are none. */
15
31
  export declare function formatAliasTable(aliases: ModelAliases | undefined): string;
16
- //# sourceMappingURL=model-alias.d.ts.map
@@ -4,6 +4,7 @@
4
4
  * A value is `provider:model` or a bare model id (current provider), and may
5
5
  * name another alias.
6
6
  */
7
+ import { PROVIDER_PRESETS, apiModelId, registeredCustomProviders, resolveProviderEndpoint } from './custom-providers.js';
7
8
  import { MODEL_CATALOG } from './model-catalog.js';
8
9
  const MAX_HOPS = 5;
9
10
  const PROVIDERS = new Set(Object.keys(MODEL_CATALOG));
@@ -34,9 +35,32 @@ export function splitModelRef(ref) {
34
35
  }
35
36
  return { model: ref };
36
37
  }
37
- export function resolveModelAlias(name, aliases, defaultProvider) {
38
- const { provider, model } = splitModelRef(expandModelAlias(name, aliases));
39
- return { provider: provider ?? defaultProvider, model };
38
+ /**
39
+ * `provider:model` for the eleven built-in providers, and `id:model` for a preset or `customProviders` id
40
+ * (`groq:llama-3.3-70b-versatile`), which resolves to an openai-compatible model with its endpoint. Ollama and
41
+ * LM Studio use `name:tag` model ids (`mistral:7b`), so for them only a prefix the user defined counts.
42
+ */
43
+ export function resolveModelAlias(name, aliases, defaultProvider, custom) {
44
+ const providers = custom ?? registeredCustomProviders();
45
+ const expanded = expandModelAlias(name, aliases);
46
+ const { provider, model } = splitModelRef(expanded);
47
+ if (provider)
48
+ return { provider, model };
49
+ const idx = expanded.indexOf(':');
50
+ if (idx > 0) {
51
+ const prefix = expanded.slice(0, idx);
52
+ const local = defaultProvider === 'ollama' || defaultProvider === 'lmstudio';
53
+ const known = Object.prototype.hasOwnProperty.call(providers ?? {}, prefix) || (!local && Object.prototype.hasOwnProperty.call(PROVIDER_PRESETS, prefix));
54
+ const endpoint = known ? resolveProviderEndpoint(prefix, providers) : undefined;
55
+ if (endpoint)
56
+ return { provider: 'openai-compatible', model: apiModelId(prefix, expanded.slice(idx + 1), providers), endpoint };
57
+ }
58
+ return { provider: defaultProvider, model };
59
+ }
60
+ /** A resolved model reference laid over a base model: the base's other settings stay, its endpoint never leaks into a different provider. */
61
+ export function applyResolved(base, resolved) {
62
+ const { endpoint: _stale, ...rest } = base;
63
+ return { ...rest, ...resolved };
40
64
  }
41
65
  /** Human-readable alias list for `forge config`; '' when there are none. */
42
66
  export function formatAliasTable(aliases) {
@@ -47,4 +71,3 @@ export function formatAliasTable(aliases) {
47
71
  const rows = names.map((n) => ` ${n.padEnd(width)} → ${aliases[n]}`);
48
72
  return ['Model aliases (~/.forge/config.json):', ...rows].join('\n');
49
73
  }
50
- //# sourceMappingURL=model-alias.js.map
@@ -11,4 +11,3 @@ export interface ModelCatalogEntry {
11
11
  * short and prefer aliases; anything else is typed as a custom id.
12
12
  */
13
13
  export declare const MODEL_CATALOG: Record<ProviderName, ModelCatalogEntry[]>;
14
- //# sourceMappingURL=model-catalog.d.ts.map
@@ -38,7 +38,6 @@ export const MODEL_CATALOG = {
38
38
  { id: 'MiniMax-M3', label: 'MiniMax M3' },
39
39
  { id: 'MiniMax-M2.7', label: 'MiniMax M2.7' },
40
40
  { id: 'MiniMax-M2.7-highspeed', label: 'MiniMax M2.7 highspeed' },
41
- { id: 'MiniMax-M2', label: 'MiniMax M2' },
42
41
  ],
43
42
  bedrock: [
44
43
  { id: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0', label: 'Claude Sonnet 4.5 (Bedrock, US)' },
@@ -55,4 +54,3 @@ export const MODEL_CATALOG = {
55
54
  lmstudio: [{ id: 'local-model', label: 'Whatever model is loaded in LM Studio' }],
56
55
  'openai-compatible': [{ id: 'default', label: 'Model id your endpoint expects' }],
57
56
  };
58
- //# sourceMappingURL=model-catalog.js.map
@@ -13,4 +13,3 @@ export declare const LISTABLE_PROVIDERS: readonly ProviderName[];
13
13
  export declare function parseModels(provider: ProviderName, body: unknown): ModelCatalogEntry[];
14
14
  /** Asks the provider which models this key can use. Throws a readable message when it cannot. */
15
15
  export declare function fetchProviderModels(provider: ProviderName, opts?: FetchModelsOptions): Promise<ModelCatalogEntry[]>;
16
- //# sourceMappingURL=model-list.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { installedFetch } from './policy/proxy.js';
1
2
  /** Providers whose catalog can be listed over HTTP. Bedrock, Vertex and Azure list per account, not per key. */
2
3
  export const LISTABLE_PROVIDERS = ['openai', 'anthropic', 'google', 'openrouter', 'minimax', 'ollama', 'lmstudio', 'openai-compatible'];
3
4
  /** OpenAI's `/models` also returns embeddings, speech, images and moderation models; none can chat. */
@@ -68,7 +69,7 @@ export async function fetchProviderModels(provider, opts = {}) {
68
69
  if (needsKey && !opts.apiKey)
69
70
  throw new Error('Add an API key to see the current models.');
70
71
  const { url, headers } = requestFor(provider, opts);
71
- const doFetch = opts.fetch ?? fetch;
72
+ const doFetch = opts.fetch ?? installedFetch() ?? fetch;
72
73
  let res;
73
74
  try {
74
75
  res = await doFetch(url, { headers, ...(opts.signal ? { signal: opts.signal } : {}) });
@@ -85,4 +86,3 @@ export async function fetchProviderModels(provider, opts = {}) {
85
86
  throw new Error('The provider returned no models.');
86
87
  return models;
87
88
  }
88
- //# sourceMappingURL=model-list.js.map
@@ -0,0 +1,30 @@
1
+ import type { CustomProviderConfig } from './custom-providers.js';
2
+ import type { ModelConfig } from './types.js';
3
+ /**
4
+ * Per-model numbers the user knows better than the built-in tables: context and output limits and prices.
5
+ * Keys are `provider:model`, `<named provider id>:model`, or a bare model id (any provider). The hosts register
6
+ * the map at the start of every run; the context-window and pricing lookups consult it first.
7
+ */
8
+ export interface ModelOverride {
9
+ limit?: {
10
+ context?: number;
11
+ output?: number;
12
+ };
13
+ cost?: {
14
+ input?: number;
15
+ output?: number;
16
+ };
17
+ }
18
+ export type ModelOverrides = Record<string, ModelOverride>;
19
+ export declare function registerModelOverrides(map: ModelOverrides | undefined): void;
20
+ /** The override for a model, trying the named provider's key, then `provider:model`, then the bare model id. */
21
+ export declare function getModelOverride(model: string | ModelConfig): ModelOverride | undefined;
22
+ /** The context window an override sets, or undefined (zero, negative and non-numbers are ignored). */
23
+ export declare function overrideContextTokens(model: string | ModelConfig): number | undefined;
24
+ /** The prices an override sets; both rates must be given and not negative. */
25
+ export declare function overrideCost(model: string | ModelConfig): {
26
+ input: number;
27
+ output: number;
28
+ } | undefined;
29
+ /** Overrides from the `limit` and `cost` of each model under `customProviders`, keyed by provider id and API model id. */
30
+ export declare function overridesFromProviders(custom: Record<string, CustomProviderConfig> | undefined): ModelOverrides;
@@ -0,0 +1,48 @@
1
+ import { apiModelId } from './custom-providers.js';
2
+ let current = {};
3
+ export function registerModelOverrides(map) {
4
+ current = map ?? {};
5
+ }
6
+ const lower = (map) => new Map(Object.entries(map).map(([k, v]) => [k.toLowerCase(), v]));
7
+ /** The override for a model, trying the named provider's key, then `provider:model`, then the bare model id. */
8
+ export function getModelOverride(model) {
9
+ if (Object.keys(current).length === 0)
10
+ return undefined;
11
+ const table = lower(current);
12
+ const id = (typeof model === 'string' ? model : model.model).toLowerCase();
13
+ if (typeof model !== 'string') {
14
+ if (model.endpoint) {
15
+ const named = table.get(`${model.endpoint.id}:${id}`.toLowerCase());
16
+ if (named)
17
+ return named;
18
+ }
19
+ const scoped = table.get(`${model.provider}:${id}`);
20
+ if (scoped)
21
+ return scoped;
22
+ }
23
+ return table.get(id);
24
+ }
25
+ const positive = (n) => typeof n === 'number' && Number.isFinite(n) && n > 0;
26
+ const nonNegative = (n) => typeof n === 'number' && Number.isFinite(n) && n >= 0;
27
+ /** The context window an override sets, or undefined (zero, negative and non-numbers are ignored). */
28
+ export function overrideContextTokens(model) {
29
+ const c = getModelOverride(model)?.limit?.context;
30
+ return positive(c) ? c : undefined;
31
+ }
32
+ /** The prices an override sets; both rates must be given and not negative. */
33
+ export function overrideCost(model) {
34
+ const c = getModelOverride(model)?.cost;
35
+ return c && nonNegative(c.input) && nonNegative(c.output) ? { input: c.input, output: c.output } : undefined;
36
+ }
37
+ /** Overrides from the `limit` and `cost` of each model under `customProviders`, keyed by provider id and API model id. */
38
+ export function overridesFromProviders(custom) {
39
+ const out = {};
40
+ for (const [id, provider] of Object.entries(custom ?? {})) {
41
+ for (const [key, m] of Object.entries(provider.models ?? {})) {
42
+ if (!m.limit && !m.cost)
43
+ continue;
44
+ out[`${id}:${apiModelId(id, key, custom)}`] = { ...(m.limit ? { limit: m.limit } : {}), ...(m.cost ? { cost: m.cost } : {}) };
45
+ }
46
+ }
47
+ return out;
48
+ }
@@ -4,4 +4,3 @@ import type { SpecialistId } from './types.js';
4
4
  export declare const BOARD_TOOL_NAMES: readonly ["board_post", "board_read"];
5
5
  /** Board tools for one specialist; `from` and the read cursor live in the closure. */
6
6
  export declare function createBoardTools(board: MessageBoard, selfId: SpecialistId): ToolDefinition[];
7
- //# sourceMappingURL=board-tools.d.ts.map
@@ -46,4 +46,3 @@ export function createBoardTools(board, selfId) {
46
46
  };
47
47
  return [post, read];
48
48
  }
49
- //# sourceMappingURL=board-tools.js.map
@@ -38,4 +38,3 @@ export declare class MessageBoard {
38
38
  /** How many early messages the ring buffer has dropped. */
39
39
  get trimmed(): number;
40
40
  }
41
- //# sourceMappingURL=board.d.ts.map
@@ -39,4 +39,3 @@ export class MessageBoard {
39
39
  return this.dropped;
40
40
  }
41
41
  }
42
- //# sourceMappingURL=board.js.map
@@ -12,4 +12,3 @@ export { MessageBoard, DEFAULT_BOARD_CAP, type BoardMessage } from './board.js';
12
12
  export { createBoardTools, BOARD_TOOL_NAMES } from './board-tools.js';
13
13
  export { registerSpecialist, unregisterSpecialist, listSpecialists, getRegisteredSpecialist, loadSpecialistsFromConfig, saveSpecialistsToConfig, validateSpecialistConfig, defaultConfigPath, _resetSpecialistsForTests, _customSpecialistCount, type CustomSpecialistConfig, type SpecialistsConfigFile, type LoadSpecialistsResult, } from './specialists-registry.js';
14
14
  export type { BuiltInSpecialistId, OrchestratorPlan, OrchestratorRunResult, OrchestratorStep, OrchestratorStepResult, SpecialistConfig, SpecialistId, } from './types.js';
15
- //# sourceMappingURL=index.d.ts.map
@@ -11,4 +11,3 @@ export { runOrchestrator, runRouter, groupStepsByParallel, resolveEffectiveModel
11
11
  export { MessageBoard, DEFAULT_BOARD_CAP } from './board.js';
12
12
  export { createBoardTools, BOARD_TOOL_NAMES } from './board-tools.js';
13
13
  export { registerSpecialist, unregisterSpecialist, listSpecialists, getRegisteredSpecialist, loadSpecialistsFromConfig, saveSpecialistsToConfig, validateSpecialistConfig, defaultConfigPath, _resetSpecialistsForTests, _customSpecialistCount, } from './specialists-registry.js';
14
- //# sourceMappingURL=index.js.map
@@ -233,4 +233,3 @@ export declare function runRouter(args: {
233
233
  * without going through `Agent.run()`.
234
234
  */
235
235
  export declare function resolveEffectiveModel(spec: SpecialistConfig, baseModel: ModelConfig): ModelConfig;
236
- //# sourceMappingURL=orchestrator.d.ts.map
@@ -494,4 +494,3 @@ async function runSpecialist(args) {
494
494
  const agent = new Agent(config);
495
495
  return agent.run({ task: args.task });
496
496
  }
497
- //# sourceMappingURL=orchestrator.js.map
@@ -24,4 +24,3 @@ export declare const ROUTER_SYSTEM_PROMPT = "You are the IKarmic Forge ORCHESTRA
24
24
  * user's task to the 'code' specialist - better than crashing.
25
25
  */
26
26
  export declare function parseRouterOutput(raw: string, fallbackTask: string): OrchestratorPlan;
27
- //# sourceMappingURL=router.d.ts.map
@@ -120,4 +120,3 @@ function fallbackPlan(task, reason = 'unparseable') {
120
120
  steps: [{ specialist: 'code', task }],
121
121
  };
122
122
  }
123
- //# sourceMappingURL=router.js.map
@@ -131,4 +131,3 @@ export declare function saveSpecialistsToConfig(entries: CustomSpecialistConfig[
131
131
  * callers can use this without touching the registry.
132
132
  */
133
133
  export declare function validateSpecialistConfig(input: CustomSpecialistConfig | SpecialistConfig, configDir?: string): SpecialistConfig;
134
- //# sourceMappingURL=specialists-registry.d.ts.map
@@ -28,11 +28,11 @@
28
28
  * are fine (Map operations are atomic in V8); we don't need locks.
29
29
  */
30
30
  import { readFileSync } from 'node:fs';
31
- import { mkdir, writeFile } from 'node:fs/promises';
32
31
  import { homedir } from 'node:os';
33
32
  import { resolve as resolvePath } from 'node:path';
34
33
  import { SUPPORTED_PROVIDERS } from '../config.js';
35
34
  import { BUILTIN_SPECIALISTS } from './specialists.js';
35
+ import { updateJsonFile } from '../config-file.js';
36
36
  /** Sentinel key the module-level Map lives behind. */
37
37
  const REGISTRY = new Map();
38
38
  /**
@@ -167,8 +167,7 @@ export async function saveSpecialistsToConfig(entries, configPath) {
167
167
  validateSpecialistConfig(entry, configDir);
168
168
  }
169
169
  const file = { version: 1, specialists: entries };
170
- await mkdir(configDir, { recursive: true });
171
- await writeFile(path, JSON.stringify(file, null, 2) + '\n', 'utf8');
170
+ await updateJsonFile(path, () => file);
172
171
  }
173
172
  /**
174
173
  * Pure validator: returns a normalized {@link SpecialistConfig}.
@@ -264,4 +263,3 @@ export function validateSpecialistConfig(input, configDir) {
264
263
  ...(inputProvider !== undefined ? { provider: inputProvider } : {}),
265
264
  };
266
265
  }
267
- //# sourceMappingURL=specialists-registry.js.map
@@ -36,4 +36,3 @@ export declare function getSpecialist(id: SpecialistId): SpecialistConfig | unde
36
36
  * `toolSandbox`.
37
37
  */
38
38
  export declare function effectiveToolsFor(spec: SpecialistConfig): string[];
39
- //# sourceMappingURL=specialists.d.ts.map
@@ -31,7 +31,7 @@ Strict rules:
31
31
 
32
32
  Output format: plain markdown. The orchestrator will pass your plan to the CODE specialist.`,
33
33
  allowedTools: ['read_file', 'list_files', 'search_files', 'run_command', 'memory_read'],
34
- forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'sub_agent'],
34
+ forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'apply_patch', 'sub_agent'],
35
35
  maxIterations: 8,
36
36
  auto: false,
37
37
  },
@@ -67,7 +67,7 @@ Strict rules:
67
67
 
68
68
  Output format: plain markdown.`,
69
69
  allowedTools: ['read_file', 'list_files', 'search_files', 'run_command', 'memory_read'],
70
- forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'sub_agent'],
70
+ forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'apply_patch', 'sub_agent'],
71
71
  maxIterations: 15,
72
72
  auto: false,
73
73
  },
@@ -84,7 +84,7 @@ Strict rules:
84
84
 
85
85
  Output format: plain markdown.`,
86
86
  allowedTools: ['read_file', 'list_files', 'search_files', 'fetch_url', 'memory_read'],
87
- forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'run_command', 'sub_agent'],
87
+ forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'apply_patch', 'run_command', 'sub_agent'],
88
88
  maxIterations: 5,
89
89
  auto: false,
90
90
  },
@@ -102,7 +102,7 @@ Strict rules:
102
102
 
103
103
  Output format: plain markdown.`,
104
104
  allowedTools: ['read_file', 'list_files', 'search_files', 'memory_read'],
105
- forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'run_command', 'sub_agent'],
105
+ forbiddenTools: ['write_file', 'edit_file', 'edit_notebook', 'apply_patch', 'run_command', 'sub_agent'],
106
106
  maxIterations: 6,
107
107
  auto: false,
108
108
  },
@@ -130,4 +130,3 @@ export function effectiveToolsFor(spec) {
130
130
  const forbidden = new Set(spec.forbiddenTools);
131
131
  return spec.allowedTools.filter((t) => !forbidden.has(t));
132
132
  }
133
- //# sourceMappingURL=specialists.js.map
@@ -118,4 +118,3 @@ export interface OrchestratorStepResult {
118
118
  /** Files changed by that commit. */
119
119
  changedFiles?: string[];
120
120
  }
121
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -2,4 +2,3 @@ export { discoverPlugins, findManifest, loadPlugin, loadPluginMcpServers, PLUGIN
2
2
  export type { Plugin, PluginScope } from './loader.js';
3
3
  export { installPlugin, removePlugin } from './install.js';
4
4
  export type { InstallPluginOptions } from './install.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { discoverPlugins, findManifest, loadPlugin, loadPluginMcpServers, PLUGIN_NAME_PATTERN, pluginRoots } from './loader.js';
2
2
  export { installPlugin, removePlugin } from './install.js';
3
- //# sourceMappingURL=index.js.map
@@ -10,4 +10,3 @@ export interface InstallPluginOptions {
10
10
  export declare function installPlugin(source: string, opts: InstallPluginOptions): Promise<Plugin>;
11
11
  /** Removes an installed plugin; returns false when it was not installed. */
12
12
  export declare function removePlugin(name: string, opts: Pick<InstallPluginOptions, 'scope' | 'cwd' | 'home'>): Promise<boolean>;
13
- //# sourceMappingURL=install.d.ts.map
@@ -64,4 +64,3 @@ export async function removePlugin(name, opts) {
64
64
  await rm(target, { recursive: true, force: true });
65
65
  return true;
66
66
  }
67
- //# sourceMappingURL=install.js.map
@@ -27,4 +27,3 @@ export declare function loadPlugin(root: string, scope: PluginScope): Promise<Pl
27
27
  export declare function discoverPlugins(cwd: string, home?: string): Promise<Plugin[]>;
28
28
  /** MCP servers contributed by global plugins only; project plugins are untrusted. */
29
29
  export declare function loadPluginMcpServers(cwd: string, home?: string): Promise<Record<string, McpServerSpec>>;
30
- //# sourceMappingURL=loader.d.ts.map
@@ -125,4 +125,3 @@ export async function loadPluginMcpServers(cwd, home = homedir()) {
125
125
  }
126
126
  return out;
127
127
  }
128
- //# sourceMappingURL=loader.js.map
@@ -28,4 +28,3 @@ export declare function defaultAuditFile(): string;
28
28
  /** Redacted, size-capped rendering of tool arguments. */
29
29
  export declare function scrubArgs(args: unknown): unknown;
30
30
  export declare function createFileAuditSink(file?: string, now?: () => Date): AuditSink;
31
- //# sourceMappingURL=audit.d.ts.map
@@ -66,4 +66,3 @@ export function createFileAuditSink(file = defaultAuditFile(), now = () => new D
66
66
  },
67
67
  };
68
68
  }
69
- //# sourceMappingURL=audit.js.map
@@ -0,0 +1,8 @@
1
+ export interface CaCertificates {
2
+ /** The contents of each readable file that holds at least one PEM certificate. */
3
+ pems: string[];
4
+ warnings: string[];
5
+ }
6
+ export declare function readCaCertificates(files: readonly string[], opts?: {
7
+ home?: string;
8
+ }): CaCertificates;