@ai-agent-forge/agent-forge 0.87.0 → 0.88.1

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 (451) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +2 -2
  3. package/bundled-plugins/agent-loop-policy/agent-forge.json +19 -0
  4. package/bundled-plugins/agent-loop-policy/dist/entry.d.ts +28 -0
  5. package/bundled-plugins/agent-loop-policy/dist/entry.d.ts.map +1 -0
  6. package/bundled-plugins/agent-loop-policy/dist/entry.js +69 -0
  7. package/bundled-plugins/agent-loop-policy/dist/entry.js.map +1 -0
  8. package/bundled-plugins/agent-loop-policy/dist/loop-guard.d.ts +199 -0
  9. package/bundled-plugins/agent-loop-policy/dist/loop-guard.d.ts.map +1 -0
  10. package/bundled-plugins/agent-loop-policy/dist/loop-guard.js +208 -0
  11. package/bundled-plugins/agent-loop-policy/dist/loop-guard.js.map +1 -0
  12. package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.d.ts +17 -0
  13. package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.d.ts.map +1 -0
  14. package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.js +18 -0
  15. package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.js.map +1 -0
  16. package/bundled-plugins/agent-loop-policy/plugin.json +7 -0
  17. package/bundled-plugins/coding-tools/agent-forge.json +19 -0
  18. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/bash.d.ts +5 -44
  19. package/bundled-plugins/coding-tools/dist/bash.d.ts.map +1 -0
  20. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/bash.js +15 -119
  21. package/bundled-plugins/coding-tools/dist/bash.js.map +1 -0
  22. package/bundled-plugins/coding-tools/dist/capability.d.ts +25 -0
  23. package/bundled-plugins/coding-tools/dist/capability.d.ts.map +1 -0
  24. package/bundled-plugins/coding-tools/dist/capability.js +98 -0
  25. package/bundled-plugins/coding-tools/dist/capability.js.map +1 -0
  26. package/bundled-plugins/coding-tools/dist/config.d.ts +8 -0
  27. package/bundled-plugins/coding-tools/dist/config.d.ts.map +1 -0
  28. package/bundled-plugins/coding-tools/dist/config.js +8 -0
  29. package/bundled-plugins/coding-tools/dist/config.js.map +1 -0
  30. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/edit.d.ts +3 -3
  31. package/bundled-plugins/coding-tools/dist/edit.d.ts.map +1 -0
  32. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/edit.js +12 -10
  33. package/bundled-plugins/coding-tools/dist/edit.js.map +1 -0
  34. package/bundled-plugins/coding-tools/dist/entry.d.ts +14 -0
  35. package/bundled-plugins/coding-tools/dist/entry.d.ts.map +1 -0
  36. package/bundled-plugins/coding-tools/dist/entry.js +23 -0
  37. package/bundled-plugins/coding-tools/dist/entry.js.map +1 -0
  38. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/find.d.ts +4 -4
  39. package/bundled-plugins/coding-tools/dist/find.d.ts.map +1 -0
  40. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/find.js +10 -8
  41. package/bundled-plugins/coding-tools/dist/find.js.map +1 -0
  42. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/grep.d.ts +3 -3
  43. package/bundled-plugins/coding-tools/dist/grep.d.ts.map +1 -0
  44. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/grep.js +10 -8
  45. package/bundled-plugins/coding-tools/dist/grep.js.map +1 -0
  46. package/bundled-plugins/coding-tools/dist/index.d.ts +17 -0
  47. package/bundled-plugins/coding-tools/dist/index.d.ts.map +1 -0
  48. package/bundled-plugins/coding-tools/dist/index.js +17 -0
  49. package/bundled-plugins/coding-tools/dist/index.js.map +1 -0
  50. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.d.ts +3 -3
  51. package/bundled-plugins/coding-tools/dist/ls.d.ts.map +1 -0
  52. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.js +8 -6
  53. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.js.map +1 -1
  54. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/powershell.d.ts +2 -1
  55. package/bundled-plugins/coding-tools/dist/powershell.d.ts.map +1 -0
  56. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/powershell.js +6 -3
  57. package/bundled-plugins/coding-tools/dist/powershell.js.map +1 -0
  58. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/read.d.ts +3 -3
  59. package/bundled-plugins/coding-tools/dist/read.d.ts.map +1 -0
  60. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/read.js +15 -13
  61. package/bundled-plugins/coding-tools/dist/read.js.map +1 -0
  62. package/bundled-plugins/coding-tools/dist/types.d.ts +74 -0
  63. package/bundled-plugins/coding-tools/dist/types.d.ts.map +1 -0
  64. package/bundled-plugins/coding-tools/dist/types.js +28 -0
  65. package/bundled-plugins/coding-tools/dist/types.js.map +1 -0
  66. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/write.d.ts +2 -2
  67. package/bundled-plugins/coding-tools/dist/write.d.ts.map +1 -0
  68. package/{dist/core/tools → bundled-plugins/coding-tools/dist}/write.js +11 -9
  69. package/bundled-plugins/coding-tools/dist/write.js.map +1 -0
  70. package/bundled-plugins/coding-tools/plugin.json +10 -0
  71. package/bundled-plugins/compaction-policy/agent-forge.json +19 -0
  72. package/bundled-plugins/compaction-policy/dist/branch-summary-policy.d.ts +6 -0
  73. package/bundled-plugins/compaction-policy/dist/branch-summary-policy.d.ts.map +1 -0
  74. package/bundled-plugins/compaction-policy/dist/branch-summary-policy.js +19 -0
  75. package/bundled-plugins/compaction-policy/dist/branch-summary-policy.js.map +1 -0
  76. package/bundled-plugins/compaction-policy/dist/compaction-policy.d.ts +6 -0
  77. package/bundled-plugins/compaction-policy/dist/compaction-policy.d.ts.map +1 -0
  78. package/bundled-plugins/compaction-policy/dist/compaction-policy.js +38 -0
  79. package/bundled-plugins/compaction-policy/dist/compaction-policy.js.map +1 -0
  80. package/bundled-plugins/compaction-policy/dist/entry.d.ts +13 -0
  81. package/bundled-plugins/compaction-policy/dist/entry.d.ts.map +1 -0
  82. package/bundled-plugins/compaction-policy/dist/entry.js +23 -0
  83. package/bundled-plugins/compaction-policy/dist/entry.js.map +1 -0
  84. package/bundled-plugins/compaction-policy/plugin.json +10 -0
  85. package/bundled-plugins/mcp-http/dist/index.d.ts +8 -0
  86. package/bundled-plugins/mcp-http/dist/index.d.ts.map +1 -0
  87. package/bundled-plugins/mcp-http/dist/index.js +8 -0
  88. package/bundled-plugins/mcp-http/dist/index.js.map +1 -0
  89. package/bundled-plugins/mcp-http/dist/mcp-http.d.ts.map +1 -0
  90. package/{dist/plugins → bundled-plugins/mcp-http/dist}/mcp-http.js +1 -1
  91. package/bundled-plugins/mcp-http/dist/mcp-http.js.map +1 -0
  92. package/bundled-plugins/overflow-policy/agent-forge.json +19 -0
  93. package/bundled-plugins/overflow-policy/dist/entry.d.ts +16 -0
  94. package/bundled-plugins/overflow-policy/dist/entry.d.ts.map +1 -0
  95. package/bundled-plugins/overflow-policy/dist/entry.js +35 -0
  96. package/bundled-plugins/overflow-policy/dist/entry.js.map +1 -0
  97. package/bundled-plugins/overflow-policy/plugin.json +10 -0
  98. package/bundled-plugins/provider-failover/agent-forge.json +19 -0
  99. package/bundled-plugins/provider-failover/dist/entry.d.ts +8 -0
  100. package/bundled-plugins/provider-failover/dist/entry.d.ts.map +1 -0
  101. package/bundled-plugins/provider-failover/dist/entry.js +8 -0
  102. package/bundled-plugins/provider-failover/dist/entry.js.map +1 -0
  103. package/bundled-plugins/provider-failover/dist/provider-failover.d.ts +122 -0
  104. package/bundled-plugins/provider-failover/dist/provider-failover.d.ts.map +1 -0
  105. package/{dist/core/extensions → bundled-plugins/provider-failover/dist}/provider-failover.js +149 -61
  106. package/bundled-plugins/provider-failover/dist/provider-failover.js.map +1 -0
  107. package/bundled-plugins/provider-failover/plugin.json +7 -0
  108. package/bundled-plugins/retry-policy/agent-forge.json +19 -0
  109. package/bundled-plugins/retry-policy/dist/entry.d.ts +16 -0
  110. package/bundled-plugins/retry-policy/dist/entry.d.ts.map +1 -0
  111. package/bundled-plugins/retry-policy/dist/entry.js +34 -0
  112. package/bundled-plugins/retry-policy/dist/entry.js.map +1 -0
  113. package/bundled-plugins/retry-policy/plugin.json +10 -0
  114. package/dist/bundle/.build-manifest.json +105 -183
  115. package/dist/bundle/chunks/{anthropic-messages-ALDZBUKI.js → anthropic-messages-PLAKXR73.js} +1 -1
  116. package/dist/bundle/chunks/{azure-openai-responses-A2WJWZFB.js → azure-openai-responses-OUWQ2AZD.js} +1 -1
  117. package/dist/bundle/chunks/{chunk-CIX3FSBK.js → chunk-A3JYRWB6.js} +1 -1
  118. package/dist/bundle/chunks/{chunk-SQFG22WN.js → chunk-AC2FIS4G.js} +1 -1
  119. package/dist/bundle/chunks/chunk-AQLNTW2B.js +664 -0
  120. package/dist/bundle/chunks/chunk-D3ARGZFR.js +13 -0
  121. package/dist/bundle/chunks/{chunk-YJCQVXW5.js → chunk-HTEVUY7F.js} +1 -1
  122. package/dist/bundle/chunks/{chunk-Y7HXTASS.js → chunk-HV64ASMT.js} +1 -1
  123. package/dist/bundle/chunks/chunk-LZOEQITZ.js +855 -0
  124. package/dist/bundle/chunks/{chunk-7ZY7IXZD.js → chunk-TRDNDS6A.js} +1 -1
  125. package/dist/bundle/chunks/chunk-Z72JWUZ4.js +4 -0
  126. package/dist/bundle/chunks/{google-generative-ai-NIB4WONV.js → google-generative-ai-DLII6DAT.js} +1 -1
  127. package/dist/bundle/chunks/{google-vertex-DCPYUEUO.js → google-vertex-G7BZL7GM.js} +1 -1
  128. package/dist/bundle/chunks/image-resize-worker.js +3 -3
  129. package/dist/bundle/chunks/{mistral-conversations-OC6LA5XL.js → mistral-conversations-JXUK24ID.js} +1 -1
  130. package/dist/bundle/chunks/{openai-codex-responses-IO2X4Y7L.js → openai-codex-responses-5GSGFIPG.js} +1 -1
  131. package/dist/bundle/chunks/{openai-completions-XYQQHETU.js → openai-completions-EI2I6DTG.js} +1 -1
  132. package/dist/bundle/chunks/{openai-responses-DLIRN3CI.js → openai-responses-AUJQ3NWT.js} +1 -1
  133. package/dist/bundle/chunks/{pi-messages-E6RRYBO7.js → pi-messages-PWU2VJMR.js} +1 -1
  134. package/dist/bundle/chunks/virtual-modules-WF6WRHP7.js +5 -0
  135. package/dist/bundle/cli.js +1 -1
  136. package/dist/bundle/client.js +1 -1
  137. package/dist/bundle/index.js +3 -3
  138. package/dist/bundle/rpc-entry.js +1 -1
  139. package/dist/capabilities/builtin.d.ts +1 -1
  140. package/dist/capabilities/builtin.d.ts.map +1 -1
  141. package/dist/capabilities/builtin.js +5 -0
  142. package/dist/capabilities/builtin.js.map +1 -1
  143. package/dist/cli/auth-check.d.ts.map +1 -1
  144. package/dist/cli/auth-check.js +14 -2
  145. package/dist/cli/auth-check.js.map +1 -1
  146. package/dist/cli/auth-command.d.ts.map +1 -1
  147. package/dist/cli/auth-command.js +1 -1
  148. package/dist/cli/auth-command.js.map +1 -1
  149. package/dist/cli/plugin-command.d.ts.map +1 -1
  150. package/dist/cli/plugin-command.js +17 -1
  151. package/dist/cli/plugin-command.js.map +1 -1
  152. package/dist/config.d.ts +2 -3
  153. package/dist/config.d.ts.map +1 -1
  154. package/dist/config.js +5 -6
  155. package/dist/config.js.map +1 -1
  156. package/dist/core/agent-session-bash.d.ts +1 -1
  157. package/dist/core/agent-session-bash.d.ts.map +1 -1
  158. package/dist/core/agent-session-bash.js +1 -1
  159. package/dist/core/agent-session-bash.js.map +1 -1
  160. package/dist/core/agent-session-compaction.d.ts +6 -10
  161. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  162. package/dist/core/agent-session-compaction.js +21 -112
  163. package/dist/core/agent-session-compaction.js.map +1 -1
  164. package/dist/core/agent-session-internal.d.ts +1 -7
  165. package/dist/core/agent-session-internal.d.ts.map +1 -1
  166. package/dist/core/agent-session-internal.js.map +1 -1
  167. package/dist/core/agent-session-loop.d.ts +4 -3
  168. package/dist/core/agent-session-loop.d.ts.map +1 -1
  169. package/dist/core/agent-session-loop.js +9 -6
  170. package/dist/core/agent-session-loop.js.map +1 -1
  171. package/dist/core/agent-session-retry.d.ts +1 -1
  172. package/dist/core/agent-session-retry.d.ts.map +1 -1
  173. package/dist/core/agent-session-retry.js +32 -4
  174. package/dist/core/agent-session-retry.js.map +1 -1
  175. package/dist/core/agent-session-services.d.ts.map +1 -1
  176. package/dist/core/agent-session-services.js +30 -9
  177. package/dist/core/agent-session-services.js.map +1 -1
  178. package/dist/core/agent-session-tools.d.ts.map +1 -1
  179. package/dist/core/agent-session-tools.js +5 -1
  180. package/dist/core/agent-session-tools.js.map +1 -1
  181. package/dist/core/agent-session.d.ts +12 -33
  182. package/dist/core/agent-session.d.ts.map +1 -1
  183. package/dist/core/agent-session.js +61 -67
  184. package/dist/core/agent-session.js.map +1 -1
  185. package/dist/core/bash-executor.d.ts +1 -1
  186. package/dist/core/bash-executor.d.ts.map +1 -1
  187. package/dist/core/bash-executor.js.map +1 -1
  188. package/dist/core/extensions/bootstrap-agent-loop.d.ts +23 -151
  189. package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -1
  190. package/dist/core/extensions/bootstrap-agent-loop.js +28 -290
  191. package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -1
  192. package/dist/core/extensions/capability-runtime-types.d.ts +5 -3
  193. package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -1
  194. package/dist/core/extensions/capability-runtime-types.js.map +1 -1
  195. package/dist/core/extensions/capability-runtime.d.ts.map +1 -1
  196. package/dist/core/extensions/capability-runtime.js +42 -6
  197. package/dist/core/extensions/capability-runtime.js.map +1 -1
  198. package/dist/core/extensions/index.d.ts +12 -5
  199. package/dist/core/extensions/index.d.ts.map +1 -1
  200. package/dist/core/extensions/index.js +12 -5
  201. package/dist/core/extensions/index.js.map +1 -1
  202. package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
  203. package/dist/core/extensions/virtual-modules.js +65 -0
  204. package/dist/core/extensions/virtual-modules.js.map +1 -1
  205. package/dist/core/facade/coding-agent-facade.d.ts +1 -7
  206. package/dist/core/facade/coding-agent-facade.d.ts.map +1 -1
  207. package/dist/core/facade/coding-agent-facade.js +0 -3
  208. package/dist/core/facade/coding-agent-facade.js.map +1 -1
  209. package/dist/core/i18n/locales/zh-cn/cli.d.ts.map +1 -1
  210. package/dist/core/i18n/locales/zh-cn/cli.js +3 -1
  211. package/dist/core/i18n/locales/zh-cn/cli.js.map +1 -1
  212. package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts +1 -1
  213. package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts.map +1 -1
  214. package/dist/core/i18n/locales/zh-cn/core-contract-core.js +1 -1
  215. package/dist/core/i18n/locales/zh-cn/core-contract-core.js.map +1 -1
  216. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts.map +1 -1
  217. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js +2 -4
  218. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js.map +1 -1
  219. package/dist/core/i18n/locales/zh-cn/core-errors.d.ts.map +1 -1
  220. package/dist/core/i18n/locales/zh-cn/core-errors.js +3 -1
  221. package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -1
  222. package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts.map +1 -1
  223. package/dist/core/i18n/locales/zh-cn/interactive-mode.js +2 -0
  224. package/dist/core/i18n/locales/zh-cn/interactive-mode.js.map +1 -1
  225. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.d.ts.map +1 -1
  226. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js +0 -2
  227. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js.map +1 -1
  228. package/dist/core/model-config.d.ts +0 -1
  229. package/dist/core/model-config.d.ts.map +1 -1
  230. package/dist/core/model-config.js +9 -1
  231. package/dist/core/model-config.js.map +1 -1
  232. package/dist/core/model-runtime.d.ts.map +1 -1
  233. package/dist/core/model-runtime.js +3 -3
  234. package/dist/core/model-runtime.js.map +1 -1
  235. package/dist/core/provider-composer.d.ts +2 -2
  236. package/dist/core/provider-composer.d.ts.map +1 -1
  237. package/dist/core/provider-composer.js +7 -8
  238. package/dist/core/provider-composer.js.map +1 -1
  239. package/dist/core/sdk.d.ts +18 -3
  240. package/dist/core/sdk.d.ts.map +1 -1
  241. package/dist/core/sdk.js +267 -76
  242. package/dist/core/sdk.js.map +1 -1
  243. package/dist/core/settings-manager.d.ts +9 -20
  244. package/dist/core/settings-manager.d.ts.map +1 -1
  245. package/dist/core/settings-manager.js +20 -54
  246. package/dist/core/settings-manager.js.map +1 -1
  247. package/dist/core/tools/bash-operations.d.ts +41 -0
  248. package/dist/core/tools/bash-operations.d.ts.map +1 -0
  249. package/dist/core/tools/bash-operations.js +113 -0
  250. package/dist/core/tools/bash-operations.js.map +1 -0
  251. package/dist/core/tools/index.d.ts +12 -36
  252. package/dist/core/tools/index.d.ts.map +1 -1
  253. package/dist/core/tools/index.js +1 -117
  254. package/dist/core/tools/index.js.map +1 -1
  255. package/dist/core/tools/readme-path.d.ts +3 -0
  256. package/dist/core/tools/readme-path.d.ts.map +1 -0
  257. package/dist/core/tools/readme-path.js +15 -0
  258. package/dist/core/tools/readme-path.js.map +1 -0
  259. package/dist/index.d.ts +3 -19
  260. package/dist/index.d.ts.map +1 -1
  261. package/dist/index.js +6 -39
  262. package/dist/index.js.map +1 -1
  263. package/dist/main.d.ts.map +1 -1
  264. package/dist/main.js +3 -2
  265. package/dist/main.js.map +1 -1
  266. package/dist/modes/interactive/components/footer.d.ts +0 -2
  267. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  268. package/dist/modes/interactive/components/footer.js +2 -7
  269. package/dist/modes/interactive/components/footer.js.map +1 -1
  270. package/dist/modes/interactive/components/settings-selector.d.ts +2 -6
  271. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  272. package/dist/modes/interactive/components/settings-selector.js +6 -28
  273. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  274. package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
  275. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  276. package/dist/modes/interactive/components/tool-execution.js +9 -25
  277. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  278. package/dist/modes/interactive/interactive-mode.d.ts +0 -1
  279. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  280. package/dist/modes/interactive/interactive-mode.js +23 -36
  281. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  282. package/dist/modes/rpc/rpc-client.d.ts +0 -8
  283. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  284. package/dist/modes/rpc/rpc-client.js +0 -12
  285. package/dist/modes/rpc/rpc-client.js.map +1 -1
  286. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  287. package/dist/modes/rpc/rpc-mode.js +0 -9
  288. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  289. package/dist/modes/rpc/rpc-types.d.ts +0 -19
  290. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  291. package/dist/modes/rpc/rpc-types.js.map +1 -1
  292. package/dist/plugins/ecosystem/cli.d.ts.map +1 -1
  293. package/dist/plugins/ecosystem/cli.js +14 -2
  294. package/dist/plugins/ecosystem/cli.js.map +1 -1
  295. package/dist/plugins/ecosystem/node-npm-registry-source.d.ts +7 -2
  296. package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -1
  297. package/dist/plugins/ecosystem/node-npm-registry-source.js +64 -9
  298. package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -1
  299. package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts.map +1 -1
  300. package/dist/plugins/ecosystem/node-plugin-acquisition-host.js +6 -0
  301. package/dist/plugins/ecosystem/node-plugin-acquisition-host.js.map +1 -1
  302. package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts +9 -2
  303. package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -1
  304. package/dist/plugins/ecosystem/node-plugin-bootstrap.js +23 -0
  305. package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -1
  306. package/dist/plugins/ecosystem/plugin-bootstrap.d.ts +9 -1
  307. package/dist/plugins/ecosystem/plugin-bootstrap.d.ts.map +1 -1
  308. package/dist/plugins/ecosystem/plugin-bootstrap.js +5 -0
  309. package/dist/plugins/ecosystem/plugin-bootstrap.js.map +1 -1
  310. package/dist/profiles/builtin-suites.d.ts +5 -1
  311. package/dist/profiles/builtin-suites.d.ts.map +1 -1
  312. package/dist/profiles/builtin-suites.js +6 -1
  313. package/dist/profiles/builtin-suites.js.map +1 -1
  314. package/dist/utils/photon.d.ts +2 -2
  315. package/dist/utils/photon.d.ts.map +1 -1
  316. package/dist/utils/photon.js +2 -2
  317. package/dist/utils/photon.js.map +1 -1
  318. package/docs/compaction.md +1 -3
  319. package/docs/docs.json +4 -0
  320. package/docs/index.md +1 -0
  321. package/docs/mcp.md +103 -0
  322. package/docs/models.md +14 -22
  323. package/docs/providers.md +0 -1
  324. package/docs/rpc.md +1 -26
  325. package/docs/sdk.md +4 -6
  326. package/docs/settings.md +9 -12
  327. package/docs/skills.md +1 -9
  328. package/docs/usage.md +1 -1
  329. package/examples/extensions/bash-spawn-hook/index.ts +7 -2
  330. package/examples/extensions/built-in-tool-renderer/index.ts +4 -2
  331. package/examples/extensions/minimal-mode/index.ts +2 -2
  332. package/examples/extensions/truncated-tool/index.ts +1 -1
  333. package/examples/extensions/with-deps/package-lock.json +2 -2
  334. package/examples/extensions/with-deps/package.json +1 -1
  335. package/examples/extensions/with-deps/plugin.json +1 -1
  336. package/examples/sdk/10-settings.ts +2 -4
  337. package/examples/sdk/12-full-control.ts +1 -2
  338. package/package.json +3 -4
  339. package/dist/bundle/chunks/chunk-6ZKDNZHA.js +0 -145
  340. package/dist/bundle/chunks/chunk-BFC2BDVJ.js +0 -13
  341. package/dist/bundle/chunks/chunk-MOHOLL3F.js +0 -1456
  342. package/dist/bundle/chunks/virtual-modules-KZ5DRH7Q.js +0 -2
  343. package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts +0 -7
  344. package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts.map +0 -1
  345. package/dist/core/extensions/bootstrap-branch-summary-policy.js +0 -28
  346. package/dist/core/extensions/bootstrap-branch-summary-policy.js.map +0 -1
  347. package/dist/core/extensions/bootstrap-compaction-policy.d.ts +0 -7
  348. package/dist/core/extensions/bootstrap-compaction-policy.d.ts.map +0 -1
  349. package/dist/core/extensions/bootstrap-compaction-policy.js +0 -82
  350. package/dist/core/extensions/bootstrap-compaction-policy.js.map +0 -1
  351. package/dist/core/extensions/bootstrap-overflow-policy.d.ts +0 -7
  352. package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +0 -1
  353. package/dist/core/extensions/bootstrap-overflow-policy.js +0 -30
  354. package/dist/core/extensions/bootstrap-overflow-policy.js.map +0 -1
  355. package/dist/core/extensions/bootstrap-retry-policy.d.ts +0 -7
  356. package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +0 -1
  357. package/dist/core/extensions/bootstrap-retry-policy.js +0 -29
  358. package/dist/core/extensions/bootstrap-retry-policy.js.map +0 -1
  359. package/dist/core/extensions/bootstrap-tools.d.ts +0 -20
  360. package/dist/core/extensions/bootstrap-tools.d.ts.map +0 -1
  361. package/dist/core/extensions/bootstrap-tools.js +0 -36
  362. package/dist/core/extensions/bootstrap-tools.js.map +0 -1
  363. package/dist/core/extensions/microcompact.d.ts +0 -80
  364. package/dist/core/extensions/microcompact.d.ts.map +0 -1
  365. package/dist/core/extensions/microcompact.js +0 -134
  366. package/dist/core/extensions/microcompact.js.map +0 -1
  367. package/dist/core/extensions/provider-failover.d.ts +0 -106
  368. package/dist/core/extensions/provider-failover.d.ts.map +0 -1
  369. package/dist/core/extensions/provider-failover.js.map +0 -1
  370. package/dist/core/tools/bash.d.ts.map +0 -1
  371. package/dist/core/tools/bash.js.map +0 -1
  372. package/dist/core/tools/edit.d.ts.map +0 -1
  373. package/dist/core/tools/edit.js.map +0 -1
  374. package/dist/core/tools/find.d.ts.map +0 -1
  375. package/dist/core/tools/find.js.map +0 -1
  376. package/dist/core/tools/grep.d.ts.map +0 -1
  377. package/dist/core/tools/grep.js.map +0 -1
  378. package/dist/core/tools/ls.d.ts.map +0 -1
  379. package/dist/core/tools/powershell.d.ts.map +0 -1
  380. package/dist/core/tools/powershell.js.map +0 -1
  381. package/dist/core/tools/read.d.ts.map +0 -1
  382. package/dist/core/tools/read.js.map +0 -1
  383. package/dist/core/tools/write.d.ts.map +0 -1
  384. package/dist/core/tools/write.js.map +0 -1
  385. package/dist/plugins/mcp-http.d.ts.map +0 -1
  386. package/dist/plugins/mcp-http.js.map +0 -1
  387. package/dist/profile/child-facade.d.ts +0 -44
  388. package/dist/profile/child-facade.d.ts.map +0 -1
  389. package/dist/profile/child-facade.js +0 -56
  390. package/dist/profile/child-facade.js.map +0 -1
  391. package/dist/profile/dependency-wiring.d.ts +0 -48
  392. package/dist/profile/dependency-wiring.d.ts.map +0 -1
  393. package/dist/profile/dependency-wiring.js +0 -56
  394. package/dist/profile/dependency-wiring.js.map +0 -1
  395. package/dist/profile/domain-recovery.d.ts +0 -60
  396. package/dist/profile/domain-recovery.d.ts.map +0 -1
  397. package/dist/profile/domain-recovery.js +0 -94
  398. package/dist/profile/domain-recovery.js.map +0 -1
  399. package/dist/profile/first-roles.d.ts +0 -30
  400. package/dist/profile/first-roles.d.ts.map +0 -1
  401. package/dist/profile/first-roles.js +0 -83
  402. package/dist/profile/first-roles.js.map +0 -1
  403. package/dist/profile/goal-plugin.d.ts +0 -38
  404. package/dist/profile/goal-plugin.d.ts.map +0 -1
  405. package/dist/profile/goal-plugin.js +0 -132
  406. package/dist/profile/goal-plugin.js.map +0 -1
  407. package/dist/profile/plan-plugin.d.ts +0 -44
  408. package/dist/profile/plan-plugin.d.ts.map +0 -1
  409. package/dist/profile/plan-plugin.js +0 -157
  410. package/dist/profile/plan-plugin.js.map +0 -1
  411. package/dist/profile/policy-manifest.d.ts +0 -53
  412. package/dist/profile/policy-manifest.d.ts.map +0 -1
  413. package/dist/profile/policy-manifest.js +0 -53
  414. package/dist/profile/policy-manifest.js.map +0 -1
  415. package/dist/profile/role-assembly.d.ts +0 -47
  416. package/dist/profile/role-assembly.d.ts.map +0 -1
  417. package/dist/profile/role-assembly.js +0 -31
  418. package/dist/profile/role-assembly.js.map +0 -1
  419. package/dist/profile/role-catalog.d.ts +0 -43
  420. package/dist/profile/role-catalog.d.ts.map +0 -1
  421. package/dist/profile/role-catalog.js +0 -132
  422. package/dist/profile/role-catalog.js.map +0 -1
  423. package/dist/profile/role-orchestrator.d.ts +0 -123
  424. package/dist/profile/role-orchestrator.d.ts.map +0 -1
  425. package/dist/profile/role-orchestrator.js +0 -195
  426. package/dist/profile/role-orchestrator.js.map +0 -1
  427. package/dist/profile/role-runner.d.ts +0 -99
  428. package/dist/profile/role-runner.d.ts.map +0 -1
  429. package/dist/profile/role-runner.js +0 -79
  430. package/dist/profile/role-runner.js.map +0 -1
  431. package/dist/profile/root-facade.d.ts +0 -36
  432. package/dist/profile/root-facade.d.ts.map +0 -1
  433. package/dist/profile/root-facade.js +0 -49
  434. package/dist/profile/root-facade.js.map +0 -1
  435. package/dist/profile/skill-discovery-wiring.d.ts +0 -58
  436. package/dist/profile/skill-discovery-wiring.d.ts.map +0 -1
  437. package/dist/profile/skill-discovery-wiring.js +0 -80
  438. package/dist/profile/skill-discovery-wiring.js.map +0 -1
  439. package/dist/profile/state-store.d.ts +0 -62
  440. package/dist/profile/state-store.d.ts.map +0 -1
  441. package/dist/profile/state-store.js +0 -144
  442. package/dist/profile/state-store.js.map +0 -1
  443. package/dist/profile/todo-plugin.d.ts +0 -37
  444. package/dist/profile/todo-plugin.d.ts.map +0 -1
  445. package/dist/profile/todo-plugin.js +0 -137
  446. package/dist/profile/todo-plugin.js.map +0 -1
  447. package/dist/server/create-harness.d.ts +0 -26
  448. package/dist/server/create-harness.d.ts.map +0 -1
  449. package/dist/server/create-harness.js +0 -106
  450. package/dist/server/create-harness.js.map +0 -1
  451. /package/{dist/plugins → bundled-plugins/mcp-http/dist}/mcp-http.d.ts +0 -0
@@ -0,0 +1,113 @@
1
+ import { constants } from "node:fs";
2
+ import { access as fsAccess } from "node:fs/promises";
3
+ import { constants as osConstants } from "node:os";
4
+ import { spawn } from "child_process";
5
+ import { waitForChildProcess } from "../../utils/child-process.js";
6
+ import { getShellConfig, getShellEnv, killProcessTree, trackDetachedChildPid, untrackDetachedChildPid, } from "../../utils/shell.js";
7
+ import { t } from "../i18n/index.js";
8
+ const MAX_TIMEOUT_MS = 2_147_483_647;
9
+ const MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;
10
+ function resolveTimeoutMs(timeout) {
11
+ if (timeout === undefined)
12
+ return undefined;
13
+ if (!Number.isFinite(timeout) || timeout <= 0) {
14
+ throw new Error(t("Invalid timeout: must be a finite number of seconds"));
15
+ }
16
+ const timeoutMs = timeout * 1000;
17
+ if (timeoutMs > MAX_TIMEOUT_MS) {
18
+ throw new Error(t("Invalid timeout: maximum is {maxSeconds} seconds", { maxSeconds: MAX_TIMEOUT_SECONDS }));
19
+ }
20
+ return timeoutMs;
21
+ }
22
+ /** Shared process execution used by the built-in shell tools. */
23
+ export function createLocalShellOperations(shellName, resolveShellConfig) {
24
+ return {
25
+ exec: async (command, cwd, { onData, signal, timeout, env }) => {
26
+ const timeoutMs = resolveTimeoutMs(timeout);
27
+ if (signal?.aborted) {
28
+ throw new Error("aborted");
29
+ }
30
+ const shellConfig = resolveShellConfig();
31
+ try {
32
+ await fsAccess(cwd, constants.F_OK);
33
+ }
34
+ catch {
35
+ throw new Error(t("Working directory does not exist: {cwd}\nCannot execute {shellName} commands.", {
36
+ cwd,
37
+ shellName,
38
+ }));
39
+ }
40
+ const commandFromStdin = shellConfig.commandTransport === "stdin";
41
+ const child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {
42
+ cwd,
43
+ detached: process.platform !== "win32",
44
+ env: env ?? getShellEnv(),
45
+ stdio: [commandFromStdin ? "pipe" : "ignore", "pipe", "pipe"],
46
+ windowsHide: true,
47
+ });
48
+ if (commandFromStdin) {
49
+ child.stdin?.on("error", () => { });
50
+ child.stdin?.end(command);
51
+ }
52
+ if (child.pid)
53
+ trackDetachedChildPid(child.pid);
54
+ let timedOut = false;
55
+ let timeoutHandle;
56
+ const onAbort = () => {
57
+ if (child.pid)
58
+ killProcessTree(child.pid);
59
+ };
60
+ try {
61
+ // Set timeout if provided.
62
+ if (timeoutMs !== undefined) {
63
+ timeoutHandle = setTimeout(() => {
64
+ timedOut = true;
65
+ if (child.pid)
66
+ killProcessTree(child.pid);
67
+ }, timeoutMs);
68
+ }
69
+ // Stream stdout and stderr.
70
+ child.stdout?.on("data", onData);
71
+ child.stderr?.on("data", onData);
72
+ // Handle abort signal by killing the entire process tree.
73
+ if (signal) {
74
+ if (signal.aborted)
75
+ onAbort();
76
+ else
77
+ signal.addEventListener("abort", onAbort, { once: true });
78
+ }
79
+ // Handle shell spawn errors and wait for the process to terminate without hanging
80
+ // on inherited stdio handles held by detached descendants.
81
+ const exitCode = await waitForChildProcess(child);
82
+ if (signal?.aborted) {
83
+ throw new Error("aborted");
84
+ }
85
+ if (timedOut) {
86
+ throw new Error(`timeout:${timeout}`);
87
+ }
88
+ // A signal-killed shell has no exit code. Use the standard shell convention so
89
+ // callers do not mistake the termination for a successful command.
90
+ const signalCode = child.signalCode;
91
+ return { exitCode: exitCode ?? (signalCode ? 128 + (osConstants.signals[signalCode] ?? 0) : 1) };
92
+ }
93
+ finally {
94
+ if (child.pid)
95
+ untrackDetachedChildPid(child.pid);
96
+ if (timeoutHandle)
97
+ clearTimeout(timeoutHandle);
98
+ if (signal)
99
+ signal.removeEventListener("abort", onAbort);
100
+ }
101
+ },
102
+ };
103
+ }
104
+ /**
105
+ * Create bash operations using Agent Forge's built-in local shell execution backend.
106
+ *
107
+ * This is useful for extensions that intercept user_bash and still want Agent Forge's
108
+ * standard local shell behavior while wrapping or rewriting commands.
109
+ */
110
+ export function createLocalBashOperations(options) {
111
+ return createLocalShellOperations("bash", () => getShellConfig(options?.shellPath));
112
+ }
113
+ //# sourceMappingURL=bash-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash-operations.js","sourceRoot":"","sources":["../../../src/core/tools/bash-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,WAAW,EACX,eAAe,EAEf,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAErC,MAAM,cAAc,GAAG,aAAa,CAAC;AACrC,MAAM,mBAAmB,GAAG,cAAc,GAAG,IAAI,CAAC;AAElD,SAAS,gBAAgB,CAAC,OAA2B,EAAsB;IAC1E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,qDAAqD,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;IACjC,IAAI,SAAS,GAAG,cAAc,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,kDAAkD,EAAE,EAAE,UAAU,EAAE,mBAAmB,E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,CAAC,KAAK,CAAC,CAAC;gBAClD,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;oBACrB,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;gBAC5B,CAAC;gBACD,IAAI,QAAQ,EAAE,CAAC;oBACd,MAAM,IAAI,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,CAAC;gBACvC,CAAC;gBACD,+EAA+E;gBAC/E,mEAAmE;gBACnE,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;gBACpC,OAAO,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClG,CAAC;oBAAS,CAAC;gBACV,IAAI,KAAK,CAAC,GAAG;oBAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClD,IAAI,aAAa;oBAAE,YAAY,CAAC,aAAa,CAAC,CAAC;gBAC/C,IAAI,MAAM;oBAAE,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1D,CAAC;QAAA,CACD;KACD,CAAC;AAAA,CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgC,EAAkB;IAC3F,OAAO,0BAA0B,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAAA,CACpF","sourcesContent":["import { constants } from \"node:fs\";\nimport { access as fsAccess } from \"node:fs/promises\";\nimport { constants as osConstants } from \"node:os\";\nimport { spawn } from \"child_process\";\nimport { waitForChildProcess } from \"../../utils/child-process.ts\";\nimport {\n\tgetShellConfig,\n\tgetShellEnv,\n\tkillProcessTree,\n\ttype ShellConfig,\n\ttrackDetachedChildPid,\n\tuntrackDetachedChildPid,\n} from \"../../utils/shell.ts\";\nimport { t } from \"../i18n/index.ts\";\n\nconst MAX_TIMEOUT_MS = 2_147_483_647;\nconst MAX_TIMEOUT_SECONDS = MAX_TIMEOUT_MS / 1000;\n\nfunction resolveTimeoutMs(timeout: number | undefined): number | undefined {\n\tif (timeout === undefined) return undefined;\n\tif (!Number.isFinite(timeout) || timeout <= 0) {\n\t\tthrow new Error(t(\"Invalid timeout: must be a finite number of seconds\"));\n\t}\n\n\tconst timeoutMs = timeout * 1000;\n\tif (timeoutMs > MAX_TIMEOUT_MS) {\n\t\tthrow new Error(t(\"Invalid timeout: maximum is {maxSeconds} seconds\", { maxSeconds: MAX_TIMEOUT_SECONDS }));\n\t}\n\treturn timeoutMs;\n}\n\n/**\n * Pluggable operations for the bash tool.\n * Override these to delegate command execution to remote systems (for example SSH).\n */\nexport interface BashOperations {\n\t/**\n\t * Execute a command and stream output.\n\t * @param command The command to execute\n\t * @param cwd Working directory\n\t * @param options Execution options\n\t * @returns Promise resolving to the exit code. Report signal terminations as 128 + signal number;\n\t * a null exit code is treated as a failed command.\n\t */\n\texec: (\n\t\tcommand: string,\n\t\tcwd: string,\n\t\toptions: {\n\t\t\tonData: (data: Buffer) => void;\n\t\t\tsignal?: AbortSignal;\n\t\t\ttimeout?: number;\n\t\t\tenv?: NodeJS.ProcessEnv;\n\t\t},\n\t) => Promise<{ exitCode: number | null }>;\n}\n\n/** Shared process execution used by the built-in shell tools. */\nexport function createLocalShellOperations(shellName: string, resolveShellConfig: () => ShellConfig): BashOperations {\n\treturn {\n\t\texec: async (command, cwd, { onData, signal, timeout, env }) => {\n\t\t\tconst timeoutMs = resolveTimeoutMs(timeout);\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t}\n\t\t\tconst shellConfig = resolveShellConfig();\n\t\t\ttry {\n\t\t\t\tawait fsAccess(cwd, constants.F_OK);\n\t\t\t} catch {\n\t\t\t\tthrow new Error(\n\t\t\t\t\tt(\"Working directory does not exist: {cwd}\\nCannot execute {shellName} commands.\", {\n\t\t\t\t\t\tcwd,\n\t\t\t\t\t\tshellName,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst commandFromStdin = shellConfig.commandTransport === \"stdin\";\n\t\t\tconst child = spawn(shellConfig.shell, commandFromStdin ? shellConfig.args : [...shellConfig.args, command], {\n\t\t\t\tcwd,\n\t\t\t\tdetached: process.platform !== \"win32\",\n\t\t\t\tenv: env ?? getShellEnv(),\n\t\t\t\tstdio: [commandFromStdin ? \"pipe\" : \"ignore\", \"pipe\", \"pipe\"],\n\t\t\t\twindowsHide: true,\n\t\t\t});\n\t\t\tif (commandFromStdin) {\n\t\t\t\tchild.stdin?.on(\"error\", () => {});\n\t\t\t\tchild.stdin?.end(command);\n\t\t\t}\n\t\t\tif (child.pid) trackDetachedChildPid(child.pid);\n\t\t\tlet timedOut = false;\n\t\t\tlet timeoutHandle: NodeJS.Timeout | undefined;\n\t\t\tconst onAbort = () => {\n\t\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\t// Set timeout if provided.\n\t\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\t\ttimeoutHandle = setTimeout(() => {\n\t\t\t\t\t\ttimedOut = true;\n\t\t\t\t\t\tif (child.pid) killProcessTree(child.pid);\n\t\t\t\t\t}, timeoutMs);\n\t\t\t\t}\n\t\t\t\t// Stream stdout and stderr.\n\t\t\t\tchild.stdout?.on(\"data\", onData);\n\t\t\t\tchild.stderr?.on(\"data\", onData);\n\t\t\t\t// Handle abort signal by killing the entire process tree.\n\t\t\t\tif (signal) {\n\t\t\t\t\tif (signal.aborted) onAbort();\n\t\t\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\t\t\t\t// Handle shell spawn errors and wait for the process to terminate without hanging\n\t\t\t\t// on inherited stdio handles held by detached descendants.\n\t\t\t\tconst exitCode = await waitForChildProcess(child);\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new Error(\"aborted\");\n\t\t\t\t}\n\t\t\t\tif (timedOut) {\n\t\t\t\t\tthrow new Error(`timeout:${timeout}`);\n\t\t\t\t}\n\t\t\t\t// A signal-killed shell has no exit code. Use the standard shell convention so\n\t\t\t\t// callers do not mistake the termination for a successful command.\n\t\t\t\tconst signalCode = child.signalCode;\n\t\t\t\treturn { exitCode: exitCode ?? (signalCode ? 128 + (osConstants.signals[signalCode] ?? 0) : 1) };\n\t\t\t} finally {\n\t\t\t\tif (child.pid) untrackDetachedChildPid(child.pid);\n\t\t\t\tif (timeoutHandle) clearTimeout(timeoutHandle);\n\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Create bash operations using Agent Forge's built-in local shell execution backend.\n *\n * This is useful for extensions that intercept user_bash and still want Agent Forge's\n * standard local shell behavior while wrapping or rewriting commands.\n */\nexport function createLocalBashOperations(options?: { shellPath?: string }): BashOperations {\n\treturn createLocalShellOperations(\"bash\", () => getShellConfig(options?.shellPath));\n}\n\nexport interface BashSpawnContext {\n\tcommand: string;\n\tcwd: string;\n\tenv: NodeJS.ProcessEnv;\n}\n\nexport type BashSpawnHook = (context: BashSpawnContext) => BashSpawnContext;\n"]}
@@ -1,44 +1,20 @@
1
- export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashTool, createBashToolDefinition, createLocalBashOperations, } from "./bash.ts";
2
- export { createEditTool, createEditToolDefinition, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, } from "./edit.ts";
3
- export { withFileMutationQueue } from "./file-mutation-queue.ts";
4
- export { createFindTool, createFindToolDefinition, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, } from "./find.ts";
5
- export { createGrepTool, createGrepToolDefinition, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, } from "./grep.ts";
6
- export { createLsTool, createLsToolDefinition, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, } from "./ls.ts";
7
- export { createLocalPowerShellOperations, createPowerShellTool, createPowerShellToolDefinition, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, } from "./powershell.ts";
8
- export { createReadTool, createReadToolDefinition, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, } from "./read.ts";
9
- export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, } from "./truncate.ts";
10
- export { createWriteTool, createWriteToolDefinition, type WriteOperations, type WriteToolInput, type WriteToolOptions, } from "./write.ts";
1
+ /**
2
+ * Host-retained tool support surface (D-082 批 1, S6 工具批): the eight default
3
+ * coding tool definitions moved to the `plugins/coding-tools` package; what
4
+ * stays here is the shared mechanism and support face the host (and every
5
+ * plugin through the `@agent-forge/host/*` supply keys) builds on — the
6
+ * definition contract, render/format helpers, truncation, diff generation,
7
+ * mutation queueing, output accumulation, path utils, bash operations, the
8
+ * tool_search factory, and the default tool name vocabulary.
9
+ */
11
10
  import type { AgentTool } from "@agent-forge/agent-core";
12
11
  import type { TSchema } from "typebox";
13
- import { type BashToolOptions } from "./bash.ts";
14
- import { type EditToolOptions } from "./edit.ts";
15
- import { type FindToolOptions } from "./find.ts";
16
- import { type GrepToolOptions } from "./grep.ts";
17
- import { type LsToolOptions } from "./ls.ts";
18
- import { type PowerShellToolOptions } from "./powershell.ts";
19
- import { type ReadToolOptions } from "./read.ts";
20
12
  import type { ToolDefinition } from "./tool-definition.ts";
21
- import { type WriteToolOptions } from "./write.ts";
13
+ export { type BashOperations, type BashSpawnContext, type BashSpawnHook, createLocalBashOperations, createLocalShellOperations, } from "./bash-operations.ts";
14
+ export { withFileMutationQueue } from "./file-mutation-queue.ts";
15
+ export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, } from "./truncate.ts";
22
16
  export type Tool = AgentTool<TSchema>;
23
17
  export type ToolDef = ToolDefinition;
24
18
  export type ToolName = "read" | "bash" | "powershell" | "edit" | "write" | "grep" | "find" | "ls";
25
19
  export declare const allToolNames: Set<ToolName>;
26
- export interface ToolsOptions {
27
- read?: ReadToolOptions;
28
- bash?: BashToolOptions;
29
- powershell?: PowerShellToolOptions;
30
- write?: WriteToolOptions;
31
- edit?: EditToolOptions;
32
- grep?: GrepToolOptions;
33
- find?: FindToolOptions;
34
- ls?: LsToolOptions;
35
- }
36
- export declare function createToolDefinition(toolName: ToolName, cwd: string, options?: ToolsOptions): ToolDef;
37
- export declare function createTool(toolName: ToolName, cwd: string, options?: ToolsOptions): Tool;
38
- export declare function createCodingToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[];
39
- export declare function createReadOnlyToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[];
40
- export declare function createAllToolDefinitions(cwd: string, options?: ToolsOptions): Record<ToolName, ToolDef>;
41
- export declare function createCodingTools(cwd: string, options?: ToolsOptions): Tool[];
42
- export declare function createReadOnlyTools(cwd: string, options?: ToolsOptions): Tool[];
43
- export declare function createAllTools(cwd: string, options?: ToolsOptions): Record<ToolName, Tool>;
44
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,cAAc,EACd,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,wBAAwB,EACxB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,GACpB,MAAM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C,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAqBxF;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,EAAE,CAO1F;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,EAAE,CAO5F;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAWvG;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAO7E;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAO/E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAW1F","sourcesContent":["export {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashTool,\n\tcreateBashToolDefinition,\n\tcreateLocalBashOperations,\n} from \"./bash.ts\";\nexport {\n\tcreateEditTool,\n\tcreateEditToolDefinition,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n} from \"./edit.ts\";\nexport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nexport {\n\tcreateFindTool,\n\tcreateFindToolDefinition,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n} from \"./find.ts\";\nexport {\n\tcreateGrepTool,\n\tcreateGrepToolDefinition,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n} from \"./grep.ts\";\nexport {\n\tcreateLsTool,\n\tcreateLsToolDefinition,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n} from \"./ls.ts\";\nexport {\n\tcreateLocalPowerShellOperations,\n\tcreatePowerShellTool,\n\tcreatePowerShellToolDefinition,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n} from \"./powershell.ts\";\nexport {\n\tcreateReadTool,\n\tcreateReadToolDefinition,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n} from \"./read.ts\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.ts\";\nexport {\n\tcreateWriteTool,\n\tcreateWriteToolDefinition,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n} from \"./write.ts\";\n\nimport type { AgentTool } from \"@agent-forge/agent-core\";\nimport type { TSchema } from \"typebox\";\nimport { t } from \"../i18n/index.ts\";\nimport { type BashToolOptions, createBashTool, createBashToolDefinition } from \"./bash.ts\";\nimport { createEditTool, createEditToolDefinition, type EditToolOptions } from \"./edit.ts\";\nimport { createFindTool, createFindToolDefinition, type FindToolOptions } from \"./find.ts\";\nimport { createGrepTool, createGrepToolDefinition, type GrepToolOptions } from \"./grep.ts\";\nimport { createLsTool, createLsToolDefinition, type LsToolOptions } from \"./ls.ts\";\nimport { createPowerShellTool, createPowerShellToolDefinition, type PowerShellToolOptions } from \"./powershell.ts\";\nimport { createReadTool, createReadToolDefinition, type ReadToolOptions } from \"./read.ts\";\nimport type { ToolDefinition } from \"./tool-definition.ts\";\nimport { createWriteTool, createWriteToolDefinition, type WriteToolOptions } from \"./write.ts\";\n\nexport type Tool = AgentTool<TSchema>;\nexport type ToolDef = ToolDefinition;\nexport type ToolName = \"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\";\nexport const allToolNames: Set<ToolName> = new Set([\n\t\"read\",\n\t\"bash\",\n\t\"powershell\",\n\t\"edit\",\n\t\"write\",\n\t\"grep\",\n\t\"find\",\n\t\"ls\",\n]);\n\nexport interface ToolsOptions {\n\tread?: ReadToolOptions;\n\tbash?: BashToolOptions;\n\tpowershell?: PowerShellToolOptions;\n\twrite?: WriteToolOptions;\n\tedit?: EditToolOptions;\n\tgrep?: GrepToolOptions;\n\tfind?: FindToolOptions;\n\tls?: LsToolOptions;\n}\n\nexport function createToolDefinition(toolName: ToolName, cwd: string, options?: ToolsOptions): ToolDef {\n\tswitch (toolName) {\n\t\tcase \"read\":\n\t\t\treturn createReadToolDefinition(cwd, options?.read);\n\t\tcase \"bash\":\n\t\t\treturn createBashToolDefinition(cwd, options?.bash);\n\t\tcase \"powershell\":\n\t\t\treturn createPowerShellToolDefinition(cwd, options?.powershell);\n\t\tcase \"edit\":\n\t\t\treturn createEditToolDefinition(cwd, options?.edit);\n\t\tcase \"write\":\n\t\t\treturn createWriteToolDefinition(cwd, options?.write);\n\t\tcase \"grep\":\n\t\t\treturn createGrepToolDefinition(cwd, options?.grep);\n\t\tcase \"find\":\n\t\t\treturn createFindToolDefinition(cwd, options?.find);\n\t\tcase \"ls\":\n\t\t\treturn createLsToolDefinition(cwd, options?.ls);\n\t\tdefault:\n\t\t\tthrow new Error(t(\"Unknown tool name: {toolName}\", { toolName }));\n\t}\n}\n\nexport function createTool(toolName: ToolName, cwd: string, options?: ToolsOptions): Tool {\n\tswitch (toolName) {\n\t\tcase \"read\":\n\t\t\treturn createReadTool(cwd, options?.read);\n\t\tcase \"bash\":\n\t\t\treturn createBashTool(cwd, options?.bash);\n\t\tcase \"powershell\":\n\t\t\treturn createPowerShellTool(cwd, options?.powershell);\n\t\tcase \"edit\":\n\t\t\treturn createEditTool(cwd, options?.edit);\n\t\tcase \"write\":\n\t\t\treturn createWriteTool(cwd, options?.write);\n\t\tcase \"grep\":\n\t\t\treturn createGrepTool(cwd, options?.grep);\n\t\tcase \"find\":\n\t\t\treturn createFindTool(cwd, options?.find);\n\t\tcase \"ls\":\n\t\t\treturn createLsTool(cwd, options?.ls);\n\t\tdefault:\n\t\t\tthrow new Error(t(\"Unknown tool name: {toolName}\", { toolName }));\n\t}\n}\n\nexport function createCodingToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[] {\n\treturn [\n\t\tcreateReadToolDefinition(cwd, options?.read),\n\t\tcreateBashToolDefinition(cwd, options?.bash),\n\t\tcreateEditToolDefinition(cwd, options?.edit),\n\t\tcreateWriteToolDefinition(cwd, options?.write),\n\t];\n}\n\nexport function createReadOnlyToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[] {\n\treturn [\n\t\tcreateReadToolDefinition(cwd, options?.read),\n\t\tcreateGrepToolDefinition(cwd, options?.grep),\n\t\tcreateFindToolDefinition(cwd, options?.find),\n\t\tcreateLsToolDefinition(cwd, options?.ls),\n\t];\n}\n\nexport function createAllToolDefinitions(cwd: string, options?: ToolsOptions): Record<ToolName, ToolDef> {\n\treturn {\n\t\tread: createReadToolDefinition(cwd, options?.read),\n\t\tbash: createBashToolDefinition(cwd, options?.bash),\n\t\tpowershell: createPowerShellToolDefinition(cwd, options?.powershell),\n\t\tedit: createEditToolDefinition(cwd, options?.edit),\n\t\twrite: createWriteToolDefinition(cwd, options?.write),\n\t\tgrep: createGrepToolDefinition(cwd, options?.grep),\n\t\tfind: createFindToolDefinition(cwd, options?.find),\n\t\tls: createLsToolDefinition(cwd, options?.ls),\n\t};\n}\n\nexport function createCodingTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateBashTool(cwd, options?.bash),\n\t\tcreateEditTool(cwd, options?.edit),\n\t\tcreateWriteTool(cwd, options?.write),\n\t];\n}\n\nexport function createReadOnlyTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateGrepTool(cwd, options?.grep),\n\t\tcreateFindTool(cwd, options?.find),\n\t\tcreateLsTool(cwd, options?.ls),\n\t];\n}\n\nexport function createAllTools(cwd: string, options?: ToolsOptions): Record<ToolName, Tool> {\n\treturn {\n\t\tread: createReadTool(cwd, options?.read),\n\t\tbash: createBashTool(cwd, options?.bash),\n\t\tpowershell: createPowerShellTool(cwd, options?.powershell),\n\t\tedit: createEditTool(cwd, options?.edit),\n\t\twrite: createWriteTool(cwd, options?.write),\n\t\tgrep: createGrepTool(cwd, options?.grep),\n\t\tfind: createFindTool(cwd, options?.find),\n\t\tls: createLsTool(cwd, options?.ls),\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,YAAY,EACZ,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AACtC,MAAM,MAAM,OAAO,GAAG,cAAc,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AAClG,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC,QAAQ,CASrC,CAAC","sourcesContent":["/**\n * Host-retained tool support surface (D-082 批 1, S6 工具批): the eight default\n * coding tool definitions moved to the `plugins/coding-tools` package; what\n * stays here is the shared mechanism and support face the host (and every\n * plugin through the `@agent-forge/host/*` supply keys) builds on — the\n * definition contract, render/format helpers, truncation, diff generation,\n * mutation queueing, output accumulation, path utils, bash operations, the\n * tool_search factory, and the default tool name vocabulary.\n */\nimport type { AgentTool } from \"@agent-forge/agent-core\";\nimport type { TSchema } from \"typebox\";\nimport type { ToolDefinition } from \"./tool-definition.ts\";\n\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\tcreateLocalBashOperations,\n\tcreateLocalShellOperations,\n} from \"./bash-operations.ts\";\nexport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.ts\";\n\nexport type Tool = AgentTool<TSchema>;\nexport type ToolDef = ToolDefinition;\nexport type ToolName = \"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\";\nexport const allToolNames: Set<ToolName> = new Set([\n\t\"read\",\n\t\"bash\",\n\t\"powershell\",\n\t\"edit\",\n\t\"write\",\n\t\"grep\",\n\t\"find\",\n\t\"ls\",\n]);\n"]}
@@ -1,22 +1,6 @@
1
- export { createBashTool, createBashToolDefinition, createLocalBashOperations, } from "./bash.js";
2
- export { createEditTool, createEditToolDefinition, } from "./edit.js";
1
+ export { createLocalBashOperations, createLocalShellOperations, } from "./bash-operations.js";
3
2
  export { withFileMutationQueue } from "./file-mutation-queue.js";
4
- export { createFindTool, createFindToolDefinition, } from "./find.js";
5
- export { createGrepTool, createGrepToolDefinition, } from "./grep.js";
6
- export { createLsTool, createLsToolDefinition, } from "./ls.js";
7
- export { createLocalPowerShellOperations, createPowerShellTool, createPowerShellToolDefinition, } from "./powershell.js";
8
- export { createReadTool, createReadToolDefinition, } from "./read.js";
9
3
  export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, } from "./truncate.js";
10
- export { createWriteTool, createWriteToolDefinition, } from "./write.js";
11
- import { t } from "../i18n/index.js";
12
- import { createBashTool, createBashToolDefinition } from "./bash.js";
13
- import { createEditTool, createEditToolDefinition } from "./edit.js";
14
- import { createFindTool, createFindToolDefinition } from "./find.js";
15
- import { createGrepTool, createGrepToolDefinition } from "./grep.js";
16
- import { createLsTool, createLsToolDefinition } from "./ls.js";
17
- import { createPowerShellTool, createPowerShellToolDefinition } from "./powershell.js";
18
- import { createReadTool, createReadToolDefinition } from "./read.js";
19
- import { createWriteTool, createWriteToolDefinition } from "./write.js";
20
4
  export const allToolNames = new Set([
21
5
  "read",
22
6
  "bash",
@@ -27,104 +11,4 @@ export const allToolNames = new Set([
27
11
  "find",
28
12
  "ls",
29
13
  ]);
30
- export function createToolDefinition(toolName, cwd, options) {
31
- switch (toolName) {
32
- case "read":
33
- return createReadToolDefinition(cwd, options?.read);
34
- case "bash":
35
- return createBashToolDefinition(cwd, options?.bash);
36
- case "powershell":
37
- return createPowerShellToolDefinition(cwd, options?.powershell);
38
- case "edit":
39
- return createEditToolDefinition(cwd, options?.edit);
40
- case "write":
41
- return createWriteToolDefinition(cwd, options?.write);
42
- case "grep":
43
- return createGrepToolDefinition(cwd, options?.grep);
44
- case "find":
45
- return createFindToolDefinition(cwd, options?.find);
46
- case "ls":
47
- return createLsToolDefinition(cwd, options?.ls);
48
- default:
49
- throw new Error(t("Unknown tool name: {toolName}", { toolName }));
50
- }
51
- }
52
- export function createTool(toolName, cwd, options) {
53
- switch (toolName) {
54
- case "read":
55
- return createReadTool(cwd, options?.read);
56
- case "bash":
57
- return createBashTool(cwd, options?.bash);
58
- case "powershell":
59
- return createPowerShellTool(cwd, options?.powershell);
60
- case "edit":
61
- return createEditTool(cwd, options?.edit);
62
- case "write":
63
- return createWriteTool(cwd, options?.write);
64
- case "grep":
65
- return createGrepTool(cwd, options?.grep);
66
- case "find":
67
- return createFindTool(cwd, options?.find);
68
- case "ls":
69
- return createLsTool(cwd, options?.ls);
70
- default:
71
- throw new Error(t("Unknown tool name: {toolName}", { toolName }));
72
- }
73
- }
74
- export function createCodingToolDefinitions(cwd, options) {
75
- return [
76
- createReadToolDefinition(cwd, options?.read),
77
- createBashToolDefinition(cwd, options?.bash),
78
- createEditToolDefinition(cwd, options?.edit),
79
- createWriteToolDefinition(cwd, options?.write),
80
- ];
81
- }
82
- export function createReadOnlyToolDefinitions(cwd, options) {
83
- return [
84
- createReadToolDefinition(cwd, options?.read),
85
- createGrepToolDefinition(cwd, options?.grep),
86
- createFindToolDefinition(cwd, options?.find),
87
- createLsToolDefinition(cwd, options?.ls),
88
- ];
89
- }
90
- export function createAllToolDefinitions(cwd, options) {
91
- return {
92
- read: createReadToolDefinition(cwd, options?.read),
93
- bash: createBashToolDefinition(cwd, options?.bash),
94
- powershell: createPowerShellToolDefinition(cwd, options?.powershell),
95
- edit: createEditToolDefinition(cwd, options?.edit),
96
- write: createWriteToolDefinition(cwd, options?.write),
97
- grep: createGrepToolDefinition(cwd, options?.grep),
98
- find: createFindToolDefinition(cwd, options?.find),
99
- ls: createLsToolDefinition(cwd, options?.ls),
100
- };
101
- }
102
- export function createCodingTools(cwd, options) {
103
- return [
104
- createReadTool(cwd, options?.read),
105
- createBashTool(cwd, options?.bash),
106
- createEditTool(cwd, options?.edit),
107
- createWriteTool(cwd, options?.write),
108
- ];
109
- }
110
- export function createReadOnlyTools(cwd, options) {
111
- return [
112
- createReadTool(cwd, options?.read),
113
- createGrepTool(cwd, options?.grep),
114
- createFindTool(cwd, options?.find),
115
- createLsTool(cwd, options?.ls),
116
- ];
117
- }
118
- export function createAllTools(cwd, options) {
119
- return {
120
- read: createReadTool(cwd, options?.read),
121
- bash: createBashTool(cwd, options?.bash),
122
- powershell: createPowerShellTool(cwd, options?.powershell),
123
- edit: createEditTool(cwd, options?.edit),
124
- write: createWriteTool(cwd, options?.write),
125
- grep: createGrepTool(cwd, options?.grep),
126
- find: createFindTool(cwd, options?.find),
127
- ls: createLsTool(cwd, options?.ls),
128
- };
129
- }
130
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAON,cAAc,EACd,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,wBAAwB,GAKxB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACN,cAAc,EACd,wBAAwB,GAKxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,wBAAwB,GAKxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,YAAY,EACZ,sBAAsB,GAKtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,+BAA+B,EAC/B,oBAAoB,EACpB,8BAA8B,GAO9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,cAAc,EACd,wBAAwB,GAKxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EAGV,YAAY,EACZ,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,eAAe,EACf,yB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AAE,IAAI,CAAC;QACxC,IAAI,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC;QACxC,EAAE,EAAE,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC;KAClC,CAAC;AAAA,CACF","sourcesContent":["export {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashTool,\n\tcreateBashToolDefinition,\n\tcreateLocalBashOperations,\n} from \"./bash.ts\";\nexport {\n\tcreateEditTool,\n\tcreateEditToolDefinition,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n} from \"./edit.ts\";\nexport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nexport {\n\tcreateFindTool,\n\tcreateFindToolDefinition,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n} from \"./find.ts\";\nexport {\n\tcreateGrepTool,\n\tcreateGrepToolDefinition,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n} from \"./grep.ts\";\nexport {\n\tcreateLsTool,\n\tcreateLsToolDefinition,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n} from \"./ls.ts\";\nexport {\n\tcreateLocalPowerShellOperations,\n\tcreatePowerShellTool,\n\tcreatePowerShellToolDefinition,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n} from \"./powershell.ts\";\nexport {\n\tcreateReadTool,\n\tcreateReadToolDefinition,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n} from \"./read.ts\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.ts\";\nexport {\n\tcreateWriteTool,\n\tcreateWriteToolDefinition,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n} from \"./write.ts\";\n\nimport type { AgentTool } from \"@agent-forge/agent-core\";\nimport type { TSchema } from \"typebox\";\nimport { t } from \"../i18n/index.ts\";\nimport { type BashToolOptions, createBashTool, createBashToolDefinition } from \"./bash.ts\";\nimport { createEditTool, createEditToolDefinition, type EditToolOptions } from \"./edit.ts\";\nimport { createFindTool, createFindToolDefinition, type FindToolOptions } from \"./find.ts\";\nimport { createGrepTool, createGrepToolDefinition, type GrepToolOptions } from \"./grep.ts\";\nimport { createLsTool, createLsToolDefinition, type LsToolOptions } from \"./ls.ts\";\nimport { createPowerShellTool, createPowerShellToolDefinition, type PowerShellToolOptions } from \"./powershell.ts\";\nimport { createReadTool, createReadToolDefinition, type ReadToolOptions } from \"./read.ts\";\nimport type { ToolDefinition } from \"./tool-definition.ts\";\nimport { createWriteTool, createWriteToolDefinition, type WriteToolOptions } from \"./write.ts\";\n\nexport type Tool = AgentTool<TSchema>;\nexport type ToolDef = ToolDefinition;\nexport type ToolName = \"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\";\nexport const allToolNames: Set<ToolName> = new Set([\n\t\"read\",\n\t\"bash\",\n\t\"powershell\",\n\t\"edit\",\n\t\"write\",\n\t\"grep\",\n\t\"find\",\n\t\"ls\",\n]);\n\nexport interface ToolsOptions {\n\tread?: ReadToolOptions;\n\tbash?: BashToolOptions;\n\tpowershell?: PowerShellToolOptions;\n\twrite?: WriteToolOptions;\n\tedit?: EditToolOptions;\n\tgrep?: GrepToolOptions;\n\tfind?: FindToolOptions;\n\tls?: LsToolOptions;\n}\n\nexport function createToolDefinition(toolName: ToolName, cwd: string, options?: ToolsOptions): ToolDef {\n\tswitch (toolName) {\n\t\tcase \"read\":\n\t\t\treturn createReadToolDefinition(cwd, options?.read);\n\t\tcase \"bash\":\n\t\t\treturn createBashToolDefinition(cwd, options?.bash);\n\t\tcase \"powershell\":\n\t\t\treturn createPowerShellToolDefinition(cwd, options?.powershell);\n\t\tcase \"edit\":\n\t\t\treturn createEditToolDefinition(cwd, options?.edit);\n\t\tcase \"write\":\n\t\t\treturn createWriteToolDefinition(cwd, options?.write);\n\t\tcase \"grep\":\n\t\t\treturn createGrepToolDefinition(cwd, options?.grep);\n\t\tcase \"find\":\n\t\t\treturn createFindToolDefinition(cwd, options?.find);\n\t\tcase \"ls\":\n\t\t\treturn createLsToolDefinition(cwd, options?.ls);\n\t\tdefault:\n\t\t\tthrow new Error(t(\"Unknown tool name: {toolName}\", { toolName }));\n\t}\n}\n\nexport function createTool(toolName: ToolName, cwd: string, options?: ToolsOptions): Tool {\n\tswitch (toolName) {\n\t\tcase \"read\":\n\t\t\treturn createReadTool(cwd, options?.read);\n\t\tcase \"bash\":\n\t\t\treturn createBashTool(cwd, options?.bash);\n\t\tcase \"powershell\":\n\t\t\treturn createPowerShellTool(cwd, options?.powershell);\n\t\tcase \"edit\":\n\t\t\treturn createEditTool(cwd, options?.edit);\n\t\tcase \"write\":\n\t\t\treturn createWriteTool(cwd, options?.write);\n\t\tcase \"grep\":\n\t\t\treturn createGrepTool(cwd, options?.grep);\n\t\tcase \"find\":\n\t\t\treturn createFindTool(cwd, options?.find);\n\t\tcase \"ls\":\n\t\t\treturn createLsTool(cwd, options?.ls);\n\t\tdefault:\n\t\t\tthrow new Error(t(\"Unknown tool name: {toolName}\", { toolName }));\n\t}\n}\n\nexport function createCodingToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[] {\n\treturn [\n\t\tcreateReadToolDefinition(cwd, options?.read),\n\t\tcreateBashToolDefinition(cwd, options?.bash),\n\t\tcreateEditToolDefinition(cwd, options?.edit),\n\t\tcreateWriteToolDefinition(cwd, options?.write),\n\t];\n}\n\nexport function createReadOnlyToolDefinitions(cwd: string, options?: ToolsOptions): ToolDef[] {\n\treturn [\n\t\tcreateReadToolDefinition(cwd, options?.read),\n\t\tcreateGrepToolDefinition(cwd, options?.grep),\n\t\tcreateFindToolDefinition(cwd, options?.find),\n\t\tcreateLsToolDefinition(cwd, options?.ls),\n\t];\n}\n\nexport function createAllToolDefinitions(cwd: string, options?: ToolsOptions): Record<ToolName, ToolDef> {\n\treturn {\n\t\tread: createReadToolDefinition(cwd, options?.read),\n\t\tbash: createBashToolDefinition(cwd, options?.bash),\n\t\tpowershell: createPowerShellToolDefinition(cwd, options?.powershell),\n\t\tedit: createEditToolDefinition(cwd, options?.edit),\n\t\twrite: createWriteToolDefinition(cwd, options?.write),\n\t\tgrep: createGrepToolDefinition(cwd, options?.grep),\n\t\tfind: createFindToolDefinition(cwd, options?.find),\n\t\tls: createLsToolDefinition(cwd, options?.ls),\n\t};\n}\n\nexport function createCodingTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateBashTool(cwd, options?.bash),\n\t\tcreateEditTool(cwd, options?.edit),\n\t\tcreateWriteTool(cwd, options?.write),\n\t];\n}\n\nexport function createReadOnlyTools(cwd: string, options?: ToolsOptions): Tool[] {\n\treturn [\n\t\tcreateReadTool(cwd, options?.read),\n\t\tcreateGrepTool(cwd, options?.grep),\n\t\tcreateFindTool(cwd, options?.find),\n\t\tcreateLsTool(cwd, options?.ls),\n\t];\n}\n\nexport function createAllTools(cwd: string, options?: ToolsOptions): Record<ToolName, Tool> {\n\treturn {\n\t\tread: createReadTool(cwd, options?.read),\n\t\tbash: createBashTool(cwd, options?.bash),\n\t\tpowershell: createPowerShellTool(cwd, options?.powershell),\n\t\tedit: createEditTool(cwd, options?.edit),\n\t\twrite: createWriteTool(cwd, options?.write),\n\t\tgrep: createGrepTool(cwd, options?.grep),\n\t\tfind: createFindTool(cwd, options?.find),\n\t\tls: createLsTool(cwd, options?.ls),\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAIN,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EAGV,YAAY,EACZ,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC;AAKvB,MAAM,CAAC,MAAM,YAAY,GAAkB,IAAI,GAAG,CAAC;IAClD,MAAM;IACN,MAAM;IACN,YAAY;IACZ,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,IAAI;CACJ,CAAC,CAAC","sourcesContent":["/**\n * Host-retained tool support surface (D-082 批 1, S6 工具批): the eight default\n * coding tool definitions moved to the `plugins/coding-tools` package; what\n * stays here is the shared mechanism and support face the host (and every\n * plugin through the `@agent-forge/host/*` supply keys) builds on — the\n * definition contract, render/format helpers, truncation, diff generation,\n * mutation queueing, output accumulation, path utils, bash operations, the\n * tool_search factory, and the default tool name vocabulary.\n */\nimport type { AgentTool } from \"@agent-forge/agent-core\";\nimport type { TSchema } from \"typebox\";\nimport type { ToolDefinition } from \"./tool-definition.ts\";\n\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\tcreateLocalBashOperations,\n\tcreateLocalShellOperations,\n} from \"./bash-operations.ts\";\nexport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nexport {\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tformatSize,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n} from \"./truncate.ts\";\n\nexport type Tool = AgentTool<TSchema>;\nexport type ToolDef = ToolDefinition;\nexport type ToolName = \"read\" | \"bash\" | \"powershell\" | \"edit\" | \"write\" | \"grep\" | \"find\" | \"ls\";\nexport const allToolNames: Set<ToolName> = new Set([\n\t\"read\",\n\t\"bash\",\n\t\"powershell\",\n\t\"edit\",\n\t\"write\",\n\t\"grep\",\n\t\"find\",\n\t\"ls\",\n]);\n"]}
@@ -0,0 +1,3 @@
1
+ /** Get path to README.md */
2
+ export declare function getReadmePath(): string;
3
+ //# sourceMappingURL=readme-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme-path.d.ts","sourceRoot":"","sources":["../../../src/core/tools/readme-path.ts"],"names":[],"mappings":"AAWA,4BAA4B;AAC5B,wBAAgB,aAAa,IAAI,MAAM,CAEtC","sourcesContent":["/**\n * README anchor (D-082 批 1 supply-key extraction): package-doc classification\n * needs the host package root, and the coding-tools plugin consumes the same\n * fact through the `@agent-forge/host/readme-path` supply key. The logic lived\n * inline in `src/config.ts`; it moves here so host and plugin share one truth\n * (`getPackageDir` keeps the env override, Bun-binary and dist-parent\n * resolution in `config.ts`).\n */\nimport { join, resolve } from \"node:path\";\nimport { getPackageDir } from \"../../config.ts\";\n\n/** Get path to README.md */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * README anchor (D-082 批 1 supply-key extraction): package-doc classification
3
+ * needs the host package root, and the coding-tools plugin consumes the same
4
+ * fact through the `@agent-forge/host/readme-path` supply key. The logic lived
5
+ * inline in `src/config.ts`; it moves here so host and plugin share one truth
6
+ * (`getPackageDir` keeps the env override, Bun-binary and dist-parent
7
+ * resolution in `config.ts`).
8
+ */
9
+ import { join, resolve } from "node:path";
10
+ import { getPackageDir } from "../../config.js";
11
+ /** Get path to README.md */
12
+ export function getReadmePath() {
13
+ return resolve(join(getPackageDir(), "README.md"));
14
+ }
15
+ //# sourceMappingURL=readme-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readme-path.js","sourceRoot":"","sources":["../../../src/core/tools/readme-path.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,4BAA4B;AAC5B,MAAM,UAAU,aAAa,GAAW;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;AAAA,CACnD","sourcesContent":["/**\n * README anchor (D-082 批 1 supply-key extraction): package-doc classification\n * needs the host package root, and the coding-tools plugin consumes the same\n * fact through the `@agent-forge/host/readme-path` supply key. The logic lived\n * inline in `src/config.ts`; it moves here so host and plugin share one truth\n * (`getPackageDir` keeps the env override, Bun-binary and dist-parent\n * resolution in `config.ts`).\n */\nimport { join, resolve } from \"node:path\";\nimport { getPackageDir } from \"../../config.ts\";\n\n/** Get path to README.md */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesRe
14
14
  export { createEmbeddedSdkBinding, createEmbeddedSdkBindingV1, type EmbeddedAgentDefinitionV1, type EmbeddedAgentInstanceV1, type EmbeddedAgentResultV1, type EmbeddedControllerLeaseV1, type EmbeddedOperationHandleV1, type EmbeddedSdkBindingV1, type EmbeddedSdkEventListenerV1, type EmbeddedSdkOptionsV1, type EmbeddedSdkSubscriptionV1, type EmbeddedSessionBindingV1, } from "./core/embedded-sdk.ts";
15
15
  export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
16
16
  export type { ExecOptions, ExecResult } from "./core/exec.ts";
17
- export { type AgentCompositionAPI, type AgentCompositionDefinitionBinding, type AgentCompositionHostBinding, type AgentCompositionLifecycleBinding, type AgentCompositionLifecycleDispatcher, type AgentCompositionLifecycleEvent, type AgentCompositionLifecycleEventName, type AgentCompositionLifecycleTerminalStatus, AgentCompositionRuntime, type AgentCompositionRuntimeOptions, type AgentCompositionScopedHostBinding, type AgentContextCommitRequestV1, type AgentContextCommitResultV1, type AgentContextFacadeV1, type AgentContextSnapshotV1, type AgentControllerLease, type AgentControllerRole, type AgentDefinition, type AgentDefinitionDeclaration, type AgentExecutionContext, type AgentHostPrimitivesFactory, type AgentHostPrimitivesFactoryContext, type AgentHostPrimitivesV1, type AgentInstance, type AgentInstanceResult, type AgentInstanceSnapshot, type AgentInstanceStatus, type AgentOperationFacadeV1, type AgentSessionFacadeV1, type AgentTaskAdapter, type AgentTaskAPI, type AgentTaskCreateRequest, type AgentTaskHandle, type AgentTaskHost, type AgentTaskResultV1, type AgentTaskStatus, type AgentTaskWaitResult, BOOTSTRAP_COMPACTION_PLUGIN_ID, BOOTSTRAP_LIFECYCLE_PLUGIN_ID, BOOTSTRAP_RETRY_PLUGIN_ID, BOOTSTRAP_TOOLS_PLUGIN_ID, type BootstrapToolsOptions, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, type CapabilityAPI, type CapabilityCallEventDataV1, type CapabilityCallEventNameV1, type CapabilityCallStatusV1, type CapabilityCommandContext, type CapabilityCommandDefinition, type CapabilityCommandLink, type CapabilityCommandResult, type CapabilityDirectoryAPI, type CapabilityHandle, type CapabilityPluginFactory, type CapabilityPluginFactoryResult, type CapabilityPluginHandle, type CapabilityPluginInstance, type CapabilityPluginSyncFactory, type CapabilityPluginSyncInstance, type CapabilityProviderHandler, type CapabilityRuntime, type CompactionCommitAppliedV1, type CompactionCommitRequestV1, type CompactionCommitResultV1, type CompactionCommitRevisionConflictV1, type CompactionPolicy, type CompactionPolicyDecision, type CompactionPolicyRequest, type CompactionSummaryRequest, type CompactionSummaryResult, type ContextStrategy, type ContributionAPI, type ContributionChangeEvent, type ContributionEntry, type ContributionHandle, type ContributionLifecycle, type ContributionPoint, type ContributionPointDefinition, type CredentialAPI, type CredentialResolution, type CredentialResolveRequest, createAgentCompositionRuntime, createCapabilityRuntime, createDisposableRegistration, createEventEnvelope, DEFAULT_COMPACTION_POLICY_NAME, DEFAULT_RETRY_POLICY_NAME, type DiagnosticsAPI, type DiagnosticsSpan, type DiagnosticsSpanEnd, type DiagnosticsSpanSnapshot, type DisposableRegistration, discoverCapabilityPluginManifests, type EventEnvelope, EXPERIMENTAL_PUBLIC_API_VERSION, type ExecutionFactsV1, type ExecutionPhaseV1, type HostCapabilities, type HostMode, installBootstrapCompactionPolicy, installBootstrapLifecycle, installBootstrapRetryPolicy, installBootstrapTools, installSessionBootstrapTools, type LifecycleAfterCommitHandler, type LifecycleAPI, type LifecycleDeliveryFailure, type LifecycleDeliveryMode, type LifecycleDeliveryOptions, type LifecycleDeliveryReport, type LifecycleDeliverySnapshot, type LifecycleDispatchRequest, type LifecycleDispatchResult, type LifecycleEvent, type LifecycleEventDefinition, type LifecycleEventReference, LifecycleExecuteError, type LifecycleExecuteHandler, type LifecycleObserveHandler, type LifecyclePhase, type LifecycleRegistrationKind, LifecycleTransformError, type LifecycleTransformHandler, type LoggerAPI, type LoggerLevel, type LoggerRecord, loadCapabilityPlugin, loadCapabilityPluginFromManifest, loadCapabilityPluginSync, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, type ModelResponseEventDataV1, type ModelStreamEventDataV1, type ModelStreamEventNameV1, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, type OperationCancelEventDataV1, type OperationEndEventDataV1, type OperationExecutionContext, type OperationHandle, type OperationProgress, type OperationStartEventDataV1, type OperationStatus, type OperationStepEventDataV1, type OutputArtifactAPI, type OutputArtifactChunk, type OutputArtifactErrorCode, type OutputArtifactPutInput, type OutputArtifactRef, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, type PluginAgentRole, type PluginCapabilityDeclaration, type PluginCapabilityRequirement, type PluginConfig, type PluginConfigValue, type PluginDisposeEventDataV1, type PluginManifest, type PluginReadyEventDataV1, type PolicyInvocationContextV1, type ProviderHeaderTransform, type ProviderHeaderTransformRequest, parseCapabilityPluginManifest, type RetryPolicy, type RetryPolicyDecision, type RetryPolicyRequest, type RetryScheduleV1, type RuntimeInspectorAPI, type RuntimeInspectorErrorSnapshot, type RuntimeInspectorLifecycleDeliveryFailureSnapshot, type RuntimeInspectorLifecycleDeliveryReportSnapshot, type RuntimeInspectorSnapshot, resolvePluginCapabilityOrder, SESSION_COMPACTION_COMMIT_EVENT_ID, SESSION_COMPACTION_COMMIT_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, type SessionAPI, type SessionCompactionCommitEventDataV1, type SessionContextReplacedEventDataV1, type SessionEntryView, type SessionExportArtifact, type SessionExportRequest, type SessionReloadEventDataV1, type SkillDefinition, type StateAPI, type StateChange, type StateEntry, type StateSetOptions, SUMMARY_MODEL_INVOCATION_ERROR_CODES, type SummaryModelFactsV1, type SummaryModelInvocationRequestV1, type SummaryModelInvocationResultV1, type SummaryModelInvocationV1, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, type ToolCallEventDataV1, type ToolCommitEventDataV1, type ToolExecuteEventDataV1, type ToolResultEventDataV1, type ToolResultRawEventDataV1, type ToolResultTransformEventDataV1, validateCapabilityCallEventDataV1, validateExecutionFactsV1, validateModelResponseEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateRetryScheduleV1, validateSessionCompactionCommitEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionReloadEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, } from "./core/extensions/index.ts";
17
+ export { type AgentCompositionAPI, type AgentCompositionDefinitionBinding, type AgentCompositionHostBinding, type AgentCompositionLifecycleBinding, type AgentCompositionLifecycleDispatcher, type AgentCompositionLifecycleEvent, type AgentCompositionLifecycleEventName, type AgentCompositionLifecycleTerminalStatus, AgentCompositionRuntime, type AgentCompositionRuntimeOptions, type AgentCompositionScopedHostBinding, type AgentContextCommitRequestV1, type AgentContextCommitResultV1, type AgentContextFacadeV1, type AgentContextSnapshotV1, type AgentControllerLease, type AgentControllerRole, type AgentDefinition, type AgentDefinitionDeclaration, type AgentExecutionContext, type AgentHostPrimitivesFactory, type AgentHostPrimitivesFactoryContext, type AgentHostPrimitivesV1, type AgentInstance, type AgentInstanceResult, type AgentInstanceSnapshot, type AgentInstanceStatus, type AgentOperationFacadeV1, type AgentSessionFacadeV1, type AgentTaskAdapter, type AgentTaskAPI, type AgentTaskCreateRequest, type AgentTaskHandle, type AgentTaskHost, type AgentTaskResultV1, type AgentTaskStatus, type AgentTaskWaitResult, BOOTSTRAP_LIFECYCLE_PLUGIN_ID, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, type CapabilityAPI, type CapabilityCallEventDataV1, type CapabilityCallEventNameV1, type CapabilityCallStatusV1, type CapabilityCommandContext, type CapabilityCommandDefinition, type CapabilityCommandLink, type CapabilityCommandResult, type CapabilityDirectoryAPI, type CapabilityHandle, type CapabilityPluginFactory, type CapabilityPluginFactoryResult, type CapabilityPluginHandle, type CapabilityPluginInstance, type CapabilityPluginSyncFactory, type CapabilityPluginSyncInstance, type CapabilityProviderHandler, type CapabilityRuntime, type CompactionCommitAppliedV1, type CompactionCommitRequestV1, type CompactionCommitResultV1, type CompactionCommitRevisionConflictV1, type CompactionPolicy, type CompactionPolicyDecision, type CompactionPolicyRequest, type CompactionSummaryRequest, type CompactionSummaryResult, type ContextStrategy, type ContributionAPI, type ContributionChangeEvent, type ContributionEntry, type ContributionHandle, type ContributionLifecycle, type ContributionPoint, type ContributionPointDefinition, type CredentialAPI, type CredentialResolution, type CredentialResolveRequest, createAgentCompositionRuntime, createCapabilityRuntime, createDisposableRegistration, createEventEnvelope, DEFAULT_COMPACTION_POLICY_NAME, DEFAULT_RETRY_POLICY_NAME, type DiagnosticsAPI, type DiagnosticsSpan, type DiagnosticsSpanEnd, type DiagnosticsSpanSnapshot, type DisposableRegistration, discoverCapabilityPluginManifests, type EventEnvelope, EXPERIMENTAL_PUBLIC_API_VERSION, type ExecutionFactsV1, type ExecutionPhaseV1, type HostCapabilities, type HostMode, installBootstrapLifecycle, type LifecycleAfterCommitHandler, type LifecycleAPI, type LifecycleDeliveryFailure, type LifecycleDeliveryMode, type LifecycleDeliveryOptions, type LifecycleDeliveryReport, type LifecycleDeliverySnapshot, type LifecycleDispatchRequest, type LifecycleDispatchResult, type LifecycleEvent, type LifecycleEventDefinition, type LifecycleEventReference, LifecycleExecuteError, type LifecycleExecuteHandler, type LifecycleObserveHandler, type LifecyclePhase, type LifecycleRegistrationKind, LifecycleTransformError, type LifecycleTransformHandler, type LoggerAPI, type LoggerLevel, type LoggerRecord, loadCapabilityPlugin, loadCapabilityPluginFromManifest, loadCapabilityPluginSync, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, type ModelResponseEventDataV1, type ModelStreamEventDataV1, type ModelStreamEventNameV1, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, type OperationCancelEventDataV1, type OperationEndEventDataV1, type OperationExecutionContext, type OperationHandle, type OperationProgress, type OperationStartEventDataV1, type OperationStatus, type OperationStepEventDataV1, type OutputArtifactAPI, type OutputArtifactChunk, type OutputArtifactErrorCode, type OutputArtifactPutInput, type OutputArtifactRef, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, type PluginAgentRole, type PluginCapabilityDeclaration, type PluginCapabilityRequirement, type PluginConfig, type PluginConfigValue, type PluginDisposeEventDataV1, type PluginManifest, type PluginReadyEventDataV1, type PolicyInvocationContextV1, type ProviderHeaderTransform, type ProviderHeaderTransformRequest, parseCapabilityPluginManifest, type RetryPolicy, type RetryPolicyDecision, type RetryPolicyRequest, type RetryScheduleV1, type RuntimeInspectorAPI, type RuntimeInspectorErrorSnapshot, type RuntimeInspectorLifecycleDeliveryFailureSnapshot, type RuntimeInspectorLifecycleDeliveryReportSnapshot, type RuntimeInspectorSnapshot, resolvePluginCapabilityOrder, SESSION_COMPACTION_COMMIT_EVENT_ID, SESSION_COMPACTION_COMMIT_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, type SessionAPI, type SessionCompactionCommitEventDataV1, type SessionContextReplacedEventDataV1, type SessionEntryView, type SessionExportArtifact, type SessionExportRequest, type SessionReloadEventDataV1, type SkillDefinition, type StateAPI, type StateChange, type StateEntry, type StateSetOptions, SUMMARY_MODEL_INVOCATION_ERROR_CODES, type SummaryModelFactsV1, type SummaryModelInvocationRequestV1, type SummaryModelInvocationResultV1, type SummaryModelInvocationV1, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, type ToolCallEventDataV1, type ToolCommitEventDataV1, type ToolExecuteEventDataV1, type ToolResultEventDataV1, type ToolResultRawEventDataV1, type ToolResultTransformEventDataV1, validateCapabilityCallEventDataV1, validateExecutionFactsV1, validateModelResponseEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateRetryScheduleV1, validateSessionCompactionCommitEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionReloadEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, } from "./core/extensions/index.ts";
18
18
  export type { ContextUsage } from "./core/extensions/public-api.ts";
19
19
  export { detachedSessionSnapshot } from "./core/extensions/public-api.ts";
20
20
  export type { CodingAgentFacadeV1 } from "./core/facade/coding-agent-facade.ts";
@@ -29,7 +29,7 @@ export type { PackageManager, PathMetadata, ProgressCallback, ProgressEvent, Res
29
29
  export { DefaultPackageManager } from "./core/package-manager.ts";
30
30
  export type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from "./core/resource-loader.ts";
31
31
  export { DefaultResourceLoader, loadProjectContextFiles } from "./core/resource-loader.ts";
32
- export { AgentSessionRuntime, type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionOptions, type CreateAgentSessionResult, type CreateAgentSessionRuntimeFactory, type CreateAgentSessionRuntimeResult, type CreateAgentSessionServicesOptions, type CreateStableAgentSessionResult, type CreateStableAgentSessionRuntimeResult, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createPowerShellTool, createReadOnlyTools, createReadTool, createStableAgentSession, createStableAgentSessionRuntime, createWriteTool, type PromptTemplate, } from "./core/sdk.ts";
32
+ export { AgentSessionRuntime, type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionOptions, type CreateAgentSessionResult, type CreateAgentSessionRuntimeFactory, type CreateAgentSessionRuntimeResult, type CreateAgentSessionServicesOptions, type CreateStableAgentSessionResult, type CreateStableAgentSessionRuntimeResult, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createStableAgentSession, createStableAgentSessionRuntime, type PromptTemplate, } from "./core/sdk.ts";
33
33
  export { type BranchSummaryEntry, buildContextEntries, buildSessionContext, type CompactionEntry, CURRENT_SESSION_VERSION, type CustomEntry, type CustomMessageEntry, type FileEntry, getLatestCompactionEntry, type ModelChangeEntry, migrateSessionEntries, type NewSessionOptions, parseSessionEntries, type SessionContext, type SessionEntry, type SessionEntryBase, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type SessionTreeNode, sessionEntryToContextMessages, type ThinkingLevelChangeEntry, } from "./core/session-manager.ts";
34
34
  export { FileSessionStorageProvider, SessionHeaderScanLimitError, type SessionStorageProvider, type SessionWriteGuardV1, } from "./core/session-storage.ts";
35
35
  export { type CompactionSettings, type FullscreenExitOutput, type ImageSettings, type PackageSource, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, type TuiMode, } from "./core/settings-manager.ts";
@@ -39,7 +39,7 @@ export type { SourceInfo } from "./core/source-info.ts";
39
39
  export { createSyntheticSourceInfo } from "./core/source-info.ts";
40
40
  export type { BuildSystemPromptOptions } from "./core/system-prompt.ts";
41
41
  export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
42
- export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
42
+ export { type BashOperations, type BashSpawnContext, type BashSpawnHook, createLocalBashOperations, createLocalShellOperations, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.ts";
43
43
  export type { ToolDefinition, ToolExecuteContext, ToolInfo, ToolRenderContext, ToolRenderResultOptions, } from "./core/tools/tool-definition.ts";
44
44
  export { defineTool } from "./core/tools/tool-definition.ts";
45
45
  export { createDurableService, createFileDurableStoreBackend, type DurableArtifactRecordV1, type DurableOperationRecordV1, type DurableReplayDiagnosticsV1, type DurableServiceErrorCodeV1, DurableServiceErrorV1, type DurableServiceOptionsV1, type DurableServiceV1, type DurableSessionRecordV1, type DurableSnapshotV1, type DurableStoreBackend, type DurableStoreLoadResultV1, type DurableStoreOperationV1, type DurableWriterClaimV1, type DurableWriterRecoveryV1, durableLogPath, } from "./durable/durable-service.ts";
@@ -62,30 +62,14 @@ export { getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsL
62
62
  export * as PluginEcosystemV1 from "./plugins/ecosystem/index.ts";
63
63
  export type { HostFactsV1 } from "./plugins/ecosystem/types.ts";
64
64
  export { createIntegrityAdapter, type IntegrityAdapterV1, type ManifestExpectationV1, type ManifestVerdictV1, type SealedManifestV1, } from "./plugins/integrity-adapter.ts";
65
- export { createMcpHttpTransport, type McpHttpTransportEventV1, type McpHttpTransportOptionsV1, type McpHttpTransportV1, type McpRequestOptions, } from "./plugins/mcp-http.ts";
66
65
  export { createPluginHost, type HostedPluginV1, type PluginHostErrorV1, type PluginHostResourceV1, type PluginHostStateV1, type PluginHostV1, } from "./plugins/plugin-host.ts";
67
66
  export { createPluginSupervisor, type PluginHealthV1, type PluginSupervisorV1, type SupervisorEntryV1, type SupervisorEventV1, type SupervisorPolicyV1, } from "./plugins/plugin-supervisor.ts";
68
- export { type ChildAgentFacadeV1, type ChildAgentResultRefV1, type ChildAgentTurnV1, createChildAgentFacade, } from "./profile/child-facade.ts";
69
- export { type AvailableCapabilityV1, type MissingDependencyV1, type PluginWiringResultV1, type ProfileDependencyWiringV1, wireProfileDependencies, } from "./profile/dependency-wiring.ts";
70
- export { buildRestartReport, type DomainRestartRecordV1, type DomainRestartReportV1, type PlanBranchRecoveryEntryV1, type PlanBranchRecoveryReportV1, recoverPlansForBranch, } from "./profile/domain-recovery.ts";
71
- export { createFirstBatchRoleSlices, FIRST_BATCH_ROLES, type FirstBatchRoleV1 } from "./profile/first-roles.ts";
72
- export { createGoalPlugin, type GoalPluginV1, type GoalStatusV1, type GoalV1, } from "./profile/goal-plugin.ts";
73
67
  export { buildProfileIdentityV1, type ProfileIdentityV1, profileIdentitiesCompatible, type ResolvedPluginManifestV1, stableJsonDigest, } from "./profile/identity.ts";
74
68
  export { createProfileLock, type ProfileLockReplaceResultV1, type ProfileLockV1, type ProfileLockVerificationV1, replaceProfileLock, verifyProfileLock, } from "./profile/lock.ts";
75
- export { createPlanPlugin, type PlanPluginV1, type PlanStatusV1, type PlanStepV1, type PlanV1, } from "./profile/plan-plugin.ts";
76
69
  export { type BuiltinPluginManifestOverridesV1, type BuiltinPluginProfileIdV1, type BuiltinPluginProfileResolutionV1, type BuiltinPluginProfileV1, listBuiltinPluginManifestsV1, listBuiltinPluginProfilesV1, resolveBuiltinPluginProfileV1, } from "./profile/plugin-profiles.ts";
77
- export { createPolicyManifestBuilder, type PolicyChangeRecordV1, type PolicyDeclarationV1, type PolicyKindV1, type PolicyManifestBuilderV1, type PolicyManifestV1, } from "./profile/policy-manifest.ts";
78
70
  export { assembleProfile, type PluginReplacementRecordV1, type ProfileAssemblyResultV1, type ProfileAssemblyV1, type ProfileReplacementResultV1, replaceProfilePlugin, type VerifiedToolPluginV1, } from "./profile/profile-assembly.ts";
79
71
  export { createProfileMigrationPolicy, type ProfileMigrationPlanV1, type ProfileMigrationPolicyV1, type ProfileMigrationResultV1, } from "./profile/profile-migration.ts";
80
72
  export { createProfileRegistry, type ProfileRegistryV1, type ProfileResolutionV1, type ProfileVersionRangeV1, type RegistryProfileEntryV1, type RegistrySourceV1, } from "./profile/profile-registry.ts";
81
- export { assembleRoles, type MountedRoleSummaryV1, type RegisteredRoleMetaV1, type RoleAssemblyDiagnosticsV1, type RoleAssemblyV1, } from "./profile/role-assembly.ts";
82
- export { createRoleCatalog, type RoleCapabilityDependencyV1, type RoleCatalogV1, type RoleIOSchemaRefV1, type RoleMetadataV1, type RoleWritableScopeV1, validateRoleMetadataV1, } from "./profile/role-catalog.ts";
83
- export { createRoleOrchestrator, DEFAULT_ROLE_AGGREGATION_LIMIT_BYTES, type RoleCompletionCheckV1, type RoleCompletionEvaluatorV1, type RoleOrchestrationEntryV1, type RoleOrchestrationResultV1, type RoleOrchestrationStatusV1, type RoleOrchestratorOptionsV1, type RoleOrchestratorRunRequestV1, type RoleOrchestratorV1, } from "./profile/role-orchestrator.ts";
84
- export { createRoleRunner, type RoleCapabilityCheckV1, type RoleMissingCapabilityV1, type RoleRunCallbackV1, type RoleRunnerInputV1, type RoleRunnerOptionsV1, type RoleRunnerResultV1, type RoleRunnerV1, type RoleRunResolverV1, runFirstBatchRole, } from "./profile/role-runner.ts";
85
- export { createRootAgentFacade, type RootAgentFacadeTurnResultV1, type RootAgentFacadeV1, } from "./profile/root-facade.ts";
86
- export { createSkillDiscoveryWiring, type DiscoveredItemV1, type DiscoverySourceKindV1, type DiscoveryVersionConflictV1, type DiscoveryWiringV1, } from "./profile/skill-discovery-wiring.ts";
87
- export { createTransitionStore, type TransitionEvidenceRefV1, type TransitionInputV1, type TransitionRecordV1, type TransitionResultV1, type TransitionStoreV1, } from "./profile/state-store.ts";
88
- export { createTodoPlugin, type TodoPluginV1, type TodoStatusV1, type TodoV1, } from "./profile/todo-plugin.ts";
89
73
  export { isBuiltinSuiteId } from "./profiles/builtin-suites.ts";
90
74
  export { buildResolvedAgentProfileV1, type PluginProfileResolutionSummaryV1, type ResolvedAgentProfileV1, type ResolvedProfileDiagnosticV1, } from "./profiles/resolved-agent-profile.ts";
91
75
  export { clearDanglingSuiteSettings, createSuite, deleteSuite, findSuiteSessionRefs, resetSuite, SUITE_DELETE_CONFIRM_TOKEN, type SuiteCreateOptions, type SuiteCreateResult, type SuiteDeleteOptions, type SuiteDeleteResult, SuiteLifecycleError, type SuiteLifecycleOperation, type SuiteResetPlan, type SuiteSessionRef, type SuiteSettingsCleanup, } from "./profiles/suite-lifecycle.ts";