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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (665) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/README.md +8 -9
  3. package/dist/artifacts/artifact-store.d.ts.map +1 -1
  4. package/dist/artifacts/artifact-store.js +9 -5
  5. package/dist/artifacts/artifact-store.js.map +1 -1
  6. package/dist/bundle/.build-manifest.json +410 -371
  7. package/dist/bundle/chunks/{chunk-A7GUOX2H.js → chunk-6ZKDNZHA.js} +5 -1
  8. package/dist/bundle/chunks/chunk-BFC2BDVJ.js +13 -0
  9. package/dist/bundle/chunks/chunk-MOHOLL3F.js +1456 -0
  10. package/dist/bundle/chunks/image-resize-worker.js +12 -1
  11. package/dist/bundle/chunks/{virtual-modules-3IZ4MYSQ.js → virtual-modules-KZ5DRH7Q.js} +1 -1
  12. package/dist/bundle/cli.js +1 -1
  13. package/dist/bundle/client.js +1 -1
  14. package/dist/bundle/index.js +2 -2
  15. package/dist/bundle/rpc-entry.js +1 -1
  16. package/dist/cli/args.d.ts.map +1 -1
  17. package/dist/cli/args.js +231 -185
  18. package/dist/cli/args.js.map +1 -1
  19. package/dist/cli/auth-check.d.ts.map +1 -1
  20. package/dist/cli/auth-check.js +3 -2
  21. package/dist/cli/auth-check.js.map +1 -1
  22. package/dist/cli/auth-command.d.ts.map +1 -1
  23. package/dist/cli/auth-command.js +15 -9
  24. package/dist/cli/auth-command.js.map +1 -1
  25. package/dist/cli/credential-print.d.ts.map +1 -1
  26. package/dist/cli/credential-print.js +14 -7
  27. package/dist/cli/credential-print.js.map +1 -1
  28. package/dist/cli/experimental/command.d.ts.map +1 -1
  29. package/dist/cli/experimental/command.js +6 -5
  30. package/dist/cli/experimental/command.js.map +1 -1
  31. package/dist/cli/list-models.d.ts.map +1 -1
  32. package/dist/cli/list-models.js +9 -8
  33. package/dist/cli/list-models.js.map +1 -1
  34. package/dist/cli/plugin-manager-controller.d.ts.map +1 -1
  35. package/dist/cli/plugin-manager-controller.js +2 -1
  36. package/dist/cli/plugin-manager-controller.js.map +1 -1
  37. package/dist/cli/serve.d.ts.map +1 -1
  38. package/dist/cli/serve.js +8 -5
  39. package/dist/cli/serve.js.map +1 -1
  40. package/dist/client/remote-session.d.ts.map +1 -1
  41. package/dist/client/remote-session.js +16 -9
  42. package/dist/client/remote-session.js.map +1 -1
  43. package/dist/config.d.ts.map +1 -1
  44. package/dist/config.js +2 -1
  45. package/dist/config.js.map +1 -1
  46. package/dist/core/agent-capability-contract.d.ts +0 -7
  47. package/dist/core/agent-capability-contract.d.ts.map +1 -1
  48. package/dist/core/agent-capability-contract.js +72 -68
  49. package/dist/core/agent-capability-contract.js.map +1 -1
  50. package/dist/core/agent-session-bash.d.ts.map +1 -1
  51. package/dist/core/agent-session-bash.js +5 -4
  52. package/dist/core/agent-session-bash.js.map +1 -1
  53. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  54. package/dist/core/agent-session-compaction.js +28 -22
  55. package/dist/core/agent-session-compaction.js.map +1 -1
  56. package/dist/core/agent-session-context.d.ts.map +1 -1
  57. package/dist/core/agent-session-context.js +18 -13
  58. package/dist/core/agent-session-context.js.map +1 -1
  59. package/dist/core/agent-session-model.d.ts.map +1 -1
  60. package/dist/core/agent-session-model.js +2 -1
  61. package/dist/core/agent-session-model.js.map +1 -1
  62. package/dist/core/agent-session-retry.d.ts.map +1 -1
  63. package/dist/core/agent-session-retry.js +3 -2
  64. package/dist/core/agent-session-retry.js.map +1 -1
  65. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  66. package/dist/core/agent-session-runtime.js +7 -6
  67. package/dist/core/agent-session-runtime.js.map +1 -1
  68. package/dist/core/agent-session-services.d.ts +1 -1
  69. package/dist/core/agent-session-services.d.ts.map +1 -1
  70. package/dist/core/agent-session-services.js.map +1 -1
  71. package/dist/core/agent-session-tools.d.ts.map +1 -1
  72. package/dist/core/agent-session-tools.js +3 -2
  73. package/dist/core/agent-session-tools.js.map +1 -1
  74. package/dist/core/agent-session.d.ts +40 -2
  75. package/dist/core/agent-session.d.ts.map +1 -1
  76. package/dist/core/agent-session.js +142 -34
  77. package/dist/core/agent-session.js.map +1 -1
  78. package/dist/core/auth-guidance.d.ts.map +1 -1
  79. package/dist/core/auth-guidance.js +11 -5
  80. package/dist/core/auth-guidance.js.map +1 -1
  81. package/dist/core/auth-storage.d.ts.map +1 -1
  82. package/dist/core/auth-storage.js +9 -6
  83. package/dist/core/auth-storage.js.map +1 -1
  84. package/dist/core/compaction/compaction.d.ts.map +1 -1
  85. package/dist/core/compaction/compaction.js +2 -1
  86. package/dist/core/compaction/compaction.js.map +1 -1
  87. package/dist/core/embedded-sdk.d.ts.map +1 -1
  88. package/dist/core/embedded-sdk.js +10 -6
  89. package/dist/core/embedded-sdk.js.map +1 -1
  90. package/dist/core/export-html/index.d.ts.map +1 -1
  91. package/dist/core/export-html/index.js +9 -4
  92. package/dist/core/export-html/index.js.map +1 -1
  93. package/dist/core/extensions/agent-composition.d.ts.map +1 -1
  94. package/dist/core/extensions/agent-composition.js +26 -19
  95. package/dist/core/extensions/agent-composition.js.map +1 -1
  96. package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -1
  97. package/dist/core/extensions/bootstrap-agent-loop.js +3 -2
  98. package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -1
  99. package/dist/core/extensions/bootstrap-lifecycle.d.ts.map +1 -1
  100. package/dist/core/extensions/bootstrap-lifecycle.js +20 -17
  101. package/dist/core/extensions/bootstrap-lifecycle.js.map +1 -1
  102. package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +1 -1
  103. package/dist/core/extensions/bootstrap-overflow-policy.js +2 -1
  104. package/dist/core/extensions/bootstrap-overflow-policy.js.map +1 -1
  105. package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +1 -1
  106. package/dist/core/extensions/bootstrap-retry-policy.js +2 -1
  107. package/dist/core/extensions/bootstrap-retry-policy.js.map +1 -1
  108. package/dist/core/extensions/bootstrap-skills.d.ts.map +1 -1
  109. package/dist/core/extensions/bootstrap-skills.js +7 -6
  110. package/dist/core/extensions/bootstrap-skills.js.map +1 -1
  111. package/dist/core/extensions/bootstrap-tools.d.ts.map +1 -1
  112. package/dist/core/extensions/bootstrap-tools.js +2 -1
  113. package/dist/core/extensions/bootstrap-tools.js.map +1 -1
  114. package/dist/core/extensions/capability-plugin.d.ts.map +1 -1
  115. package/dist/core/extensions/capability-plugin.js +37 -13
  116. package/dist/core/extensions/capability-plugin.js.map +1 -1
  117. package/dist/core/extensions/capability-runtime-events.d.ts.map +1 -1
  118. package/dist/core/extensions/capability-runtime-events.js +17 -13
  119. package/dist/core/extensions/capability-runtime-events.js.map +1 -1
  120. package/dist/core/extensions/capability-runtime-guards.d.ts.map +1 -1
  121. package/dist/core/extensions/capability-runtime-guards.js +16 -15
  122. package/dist/core/extensions/capability-runtime-guards.js.map +1 -1
  123. package/dist/core/extensions/capability-runtime-manifest.d.ts.map +1 -1
  124. package/dist/core/extensions/capability-runtime-manifest.js +52 -30
  125. package/dist/core/extensions/capability-runtime-manifest.js.map +1 -1
  126. package/dist/core/extensions/capability-runtime-validation.d.ts.map +1 -1
  127. package/dist/core/extensions/capability-runtime-validation.js +66 -65
  128. package/dist/core/extensions/capability-runtime-validation.js.map +1 -1
  129. package/dist/core/extensions/capability-runtime.d.ts.map +1 -1
  130. package/dist/core/extensions/capability-runtime.js +147 -127
  131. package/dist/core/extensions/capability-runtime.js.map +1 -1
  132. package/dist/core/extensions/compaction-memory-failure-mode.d.ts.map +1 -1
  133. package/dist/core/extensions/compaction-memory-failure-mode.js +3 -2
  134. package/dist/core/extensions/compaction-memory-failure-mode.js.map +1 -1
  135. package/dist/core/extensions/context-strategy-binding.d.ts.map +1 -1
  136. package/dist/core/extensions/context-strategy-binding.js +7 -4
  137. package/dist/core/extensions/context-strategy-binding.js.map +1 -1
  138. package/dist/core/extensions/lifecycle-catalog.d.ts.map +1 -1
  139. package/dist/core/extensions/lifecycle-catalog.js +290 -279
  140. package/dist/core/extensions/lifecycle-catalog.js.map +1 -1
  141. package/dist/core/extensions/lifecycle-delivery-queue.d.ts.map +1 -1
  142. package/dist/core/extensions/lifecycle-delivery-queue.js +3 -2
  143. package/dist/core/extensions/lifecycle-delivery-queue.js.map +1 -1
  144. package/dist/core/facade/coding-agent-facade.d.ts +6 -0
  145. package/dist/core/facade/coding-agent-facade.d.ts.map +1 -1
  146. package/dist/core/facade/coding-agent-facade.js +2 -0
  147. package/dist/core/facade/coding-agent-facade.js.map +1 -1
  148. package/dist/core/http-dispatcher.d.ts.map +1 -1
  149. package/dist/core/http-dispatcher.js +2 -1
  150. package/dist/core/http-dispatcher.js.map +1 -1
  151. package/dist/core/i18n/index.d.ts +14 -0
  152. package/dist/core/i18n/index.d.ts.map +1 -0
  153. package/dist/core/i18n/index.js +67 -0
  154. package/dist/core/i18n/index.js.map +1 -0
  155. package/dist/core/i18n/locales/en/example.d.ts +7 -0
  156. package/dist/core/i18n/locales/en/example.d.ts.map +1 -0
  157. package/dist/core/i18n/locales/en/example.js +7 -0
  158. package/dist/core/i18n/locales/en/example.js.map +1 -0
  159. package/dist/core/i18n/locales/zh-cn/cli.d.ts +8 -0
  160. package/dist/core/i18n/locales/zh-cn/cli.d.ts.map +1 -0
  161. package/dist/core/i18n/locales/zh-cn/cli.js +227 -0
  162. package/dist/core/i18n/locales/zh-cn/cli.js.map +1 -0
  163. package/dist/core/i18n/locales/zh-cn/common.d.ts +6 -0
  164. package/dist/core/i18n/locales/zh-cn/common.d.ts.map +1 -0
  165. package/dist/core/i18n/locales/zh-cn/common.js +6 -0
  166. package/dist/core/i18n/locales/zh-cn/common.js.map +1 -0
  167. package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts +13 -0
  168. package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts.map +1 -0
  169. package/dist/core/i18n/locales/zh-cn/core-contract-core.js +173 -0
  170. package/dist/core/i18n/locales/zh-cn/core-contract-core.js.map +1 -0
  171. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts +12 -0
  172. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts.map +1 -0
  173. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js +582 -0
  174. package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js.map +1 -0
  175. package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts +9 -0
  176. package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts.map +1 -0
  177. package/dist/core/i18n/locales/zh-cn/core-contract-final.js +55 -0
  178. package/dist/core/i18n/locales/zh-cn/core-contract-final.js.map +1 -0
  179. package/dist/core/i18n/locales/zh-cn/core-contract-plugins.d.ts +11 -0
  180. package/dist/core/i18n/locales/zh-cn/core-contract-plugins.d.ts.map +1 -0
  181. package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js +455 -0
  182. package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js.map +1 -0
  183. package/dist/core/i18n/locales/zh-cn/core-errors.d.ts +9 -0
  184. package/dist/core/i18n/locales/zh-cn/core-errors.d.ts.map +1 -0
  185. package/dist/core/i18n/locales/zh-cn/core-errors.js +191 -0
  186. package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -0
  187. package/dist/core/i18n/locales/zh-cn/example.d.ts +7 -0
  188. package/dist/core/i18n/locales/zh-cn/example.d.ts.map +1 -0
  189. package/dist/core/i18n/locales/zh-cn/example.js +10 -0
  190. package/dist/core/i18n/locales/zh-cn/example.js.map +1 -0
  191. package/dist/core/i18n/locales/zh-cn/index.d.ts +2 -0
  192. package/dist/core/i18n/locales/zh-cn/index.d.ts.map +1 -0
  193. package/dist/core/i18n/locales/zh-cn/index.js +41 -0
  194. package/dist/core/i18n/locales/zh-cn/index.js.map +1 -0
  195. package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts +10 -0
  196. package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts.map +1 -0
  197. package/dist/core/i18n/locales/zh-cn/interactive-mode.js +265 -0
  198. package/dist/core/i18n/locales/zh-cn/interactive-mode.js.map +1 -0
  199. package/dist/core/i18n/locales/zh-cn/keybindings.d.ts +11 -0
  200. package/dist/core/i18n/locales/zh-cn/keybindings.d.ts.map +1 -0
  201. package/dist/core/i18n/locales/zh-cn/keybindings.js +67 -0
  202. package/dist/core/i18n/locales/zh-cn/keybindings.js.map +1 -0
  203. package/dist/core/i18n/locales/zh-cn/slash-commands.d.ts +7 -0
  204. package/dist/core/i18n/locales/zh-cn/slash-commands.d.ts.map +1 -0
  205. package/dist/core/i18n/locales/zh-cn/slash-commands.js +39 -0
  206. package/dist/core/i18n/locales/zh-cn/slash-commands.js.map +1 -0
  207. package/dist/core/i18n/locales/zh-cn/tui-builtin.d.ts +10 -0
  208. package/dist/core/i18n/locales/zh-cn/tui-builtin.d.ts.map +1 -0
  209. package/dist/core/i18n/locales/zh-cn/tui-builtin.js +15 -0
  210. package/dist/core/i18n/locales/zh-cn/tui-builtin.js.map +1 -0
  211. package/dist/core/i18n/locales/zh-cn/tui-components-misc.d.ts +13 -0
  212. package/dist/core/i18n/locales/zh-cn/tui-components-misc.d.ts.map +1 -0
  213. package/dist/core/i18n/locales/zh-cn/tui-components-misc.js +102 -0
  214. package/dist/core/i18n/locales/zh-cn/tui-components-misc.js.map +1 -0
  215. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.d.ts +12 -0
  216. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.d.ts.map +1 -0
  217. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js +288 -0
  218. package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js.map +1 -0
  219. package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.d.ts +9 -0
  220. package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.d.ts.map +1 -0
  221. package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.js +79 -0
  222. package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.js.map +1 -0
  223. package/dist/core/i18n/locales/zh-cn/tui-self-owned.d.ts +8 -0
  224. package/dist/core/i18n/locales/zh-cn/tui-self-owned.d.ts.map +1 -0
  225. package/dist/core/i18n/locales/zh-cn/tui-self-owned.js +72 -0
  226. package/dist/core/i18n/locales/zh-cn/tui-self-owned.js.map +1 -0
  227. package/dist/core/keybindings.d.ts +15 -0
  228. package/dist/core/keybindings.d.ts.map +1 -1
  229. package/dist/core/keybindings.js +18 -0
  230. package/dist/core/keybindings.js.map +1 -1
  231. package/dist/core/logger.d.ts.map +1 -1
  232. package/dist/core/logger.js +5 -1
  233. package/dist/core/logger.js.map +1 -1
  234. package/dist/core/model-registry.d.ts.map +1 -1
  235. package/dist/core/model-registry.js +2 -1
  236. package/dist/core/model-registry.js.map +1 -1
  237. package/dist/core/model-runtime.d.ts.map +1 -1
  238. package/dist/core/model-runtime.js +8 -4
  239. package/dist/core/model-runtime.js.map +1 -1
  240. package/dist/core/package-install-host.d.ts.map +1 -1
  241. package/dist/core/package-install-host.js +4 -3
  242. package/dist/core/package-install-host.js.map +1 -1
  243. package/dist/core/package-manager.d.ts.map +1 -1
  244. package/dist/core/package-manager.js +15 -10
  245. package/dist/core/package-manager.js.map +1 -1
  246. package/dist/core/package-resource-collection.d.ts.map +1 -1
  247. package/dist/core/package-resource-collection.js +2 -1
  248. package/dist/core/package-resource-collection.js.map +1 -1
  249. package/dist/core/package-source.d.ts.map +1 -1
  250. package/dist/core/package-source.js +3 -2
  251. package/dist/core/package-source.js.map +1 -1
  252. package/dist/core/provider-composer.d.ts.map +1 -1
  253. package/dist/core/provider-composer.js +22 -13
  254. package/dist/core/provider-composer.js.map +1 -1
  255. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  256. package/dist/core/remote-catalog-provider.js +6 -2
  257. package/dist/core/remote-catalog-provider.js.map +1 -1
  258. package/dist/core/resolve-config-value.d.ts.map +1 -1
  259. package/dist/core/resolve-config-value.js +15 -5
  260. package/dist/core/resolve-config-value.js.map +1 -1
  261. package/dist/core/sdk.d.ts +19 -5
  262. package/dist/core/sdk.d.ts.map +1 -1
  263. package/dist/core/sdk.js +74 -54
  264. package/dist/core/sdk.js.map +1 -1
  265. package/dist/core/session-cwd.d.ts.map +1 -1
  266. package/dist/core/session-cwd.js +5 -2
  267. package/dist/core/session-cwd.js.map +1 -1
  268. package/dist/core/session-export.d.ts.map +1 -1
  269. package/dist/core/session-export.js +2 -1
  270. package/dist/core/session-export.js.map +1 -1
  271. package/dist/core/session-manager.d.ts.map +1 -1
  272. package/dist/core/session-manager.js +39 -29
  273. package/dist/core/session-manager.js.map +1 -1
  274. package/dist/core/session-storage.d.ts.map +1 -1
  275. package/dist/core/session-storage.js +3 -3
  276. package/dist/core/session-storage.js.map +1 -1
  277. package/dist/core/settings-manager.d.ts +11 -0
  278. package/dist/core/settings-manager.d.ts.map +1 -1
  279. package/dist/core/settings-manager.js +27 -5
  280. package/dist/core/settings-manager.js.map +1 -1
  281. package/dist/core/slash-commands.d.ts.map +1 -1
  282. package/dist/core/slash-commands.js +53 -32
  283. package/dist/core/slash-commands.js.map +1 -1
  284. package/dist/core/system-prompt.d.ts.map +1 -1
  285. package/dist/core/system-prompt.js +25 -2
  286. package/dist/core/system-prompt.js.map +1 -1
  287. package/dist/core/tools/bash.d.ts.map +1 -1
  288. package/dist/core/tools/bash.js +11 -7
  289. package/dist/core/tools/bash.js.map +1 -1
  290. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  291. package/dist/core/tools/edit-diff.js +9 -4
  292. package/dist/core/tools/edit-diff.js.map +1 -1
  293. package/dist/core/tools/edit.d.ts.map +1 -1
  294. package/dist/core/tools/edit.js +4 -3
  295. package/dist/core/tools/edit.js.map +1 -1
  296. package/dist/core/tools/index.d.ts.map +1 -1
  297. package/dist/core/tools/index.js +3 -2
  298. package/dist/core/tools/index.js.map +1 -1
  299. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  300. package/dist/core/tools/output-accumulator.js +2 -1
  301. package/dist/core/tools/output-accumulator.js.map +1 -1
  302. package/dist/core/tools/read.d.ts.map +1 -1
  303. package/dist/core/tools/read.js +6 -2
  304. package/dist/core/tools/read.js.map +1 -1
  305. package/dist/core/tools/write.d.ts.map +1 -1
  306. package/dist/core/tools/write.js +2 -1
  307. package/dist/core/tools/write.js.map +1 -1
  308. package/dist/durable/durable-service.d.ts.map +1 -1
  309. package/dist/durable/durable-service.js +25 -18
  310. package/dist/durable/durable-service.js.map +1 -1
  311. package/dist/host/checkpoint-commit.d.ts.map +1 -1
  312. package/dist/host/checkpoint-commit.js +2 -1
  313. package/dist/host/checkpoint-commit.js.map +1 -1
  314. package/dist/host/manual-compaction.d.ts.map +1 -1
  315. package/dist/host/manual-compaction.js +2 -1
  316. package/dist/host/manual-compaction.js.map +1 -1
  317. package/dist/host/output-projection.d.ts +0 -13
  318. package/dist/host/output-projection.d.ts.map +1 -1
  319. package/dist/host/output-projection.js +16 -2
  320. package/dist/host/output-projection.js.map +1 -1
  321. package/dist/host/summary-retry.d.ts.map +1 -1
  322. package/dist/host/summary-retry.js +3 -2
  323. package/dist/host/summary-retry.js.map +1 -1
  324. package/dist/main.d.ts.map +1 -1
  325. package/dist/main.js +94 -58
  326. package/dist/main.js.map +1 -1
  327. package/dist/modes/interactive/components/agents-view.d.ts.map +1 -1
  328. package/dist/modes/interactive/components/agents-view.js +18 -15
  329. package/dist/modes/interactive/components/agents-view.js.map +1 -1
  330. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  331. package/dist/modes/interactive/components/assistant-message.js +6 -5
  332. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  333. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  334. package/dist/modes/interactive/components/bash-execution.js +12 -7
  335. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  336. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  337. package/dist/modes/interactive/components/bordered-loader.js +2 -1
  338. package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
  339. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  340. package/dist/modes/interactive/components/branch-summary-message.js +6 -5
  341. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  342. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  343. package/dist/modes/interactive/components/compaction-summary-message.js +9 -5
  344. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  345. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  346. package/dist/modes/interactive/components/config-selector.js +18 -15
  347. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  348. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  349. package/dist/modes/interactive/components/custom-entry.js +2 -1
  350. package/dist/modes/interactive/components/custom-entry.js.map +1 -1
  351. package/dist/modes/interactive/components/dialog-editor.d.ts.map +1 -1
  352. package/dist/modes/interactive/components/dialog-editor.js +5 -4
  353. package/dist/modes/interactive/components/dialog-editor.js.map +1 -1
  354. package/dist/modes/interactive/components/dialog-input.d.ts.map +1 -1
  355. package/dist/modes/interactive/components/dialog-input.js +2 -1
  356. package/dist/modes/interactive/components/dialog-input.js.map +1 -1
  357. package/dist/modes/interactive/components/dialog-selector.d.ts.map +1 -1
  358. package/dist/modes/interactive/components/dialog-selector.js +4 -3
  359. package/dist/modes/interactive/components/dialog-selector.js.map +1 -1
  360. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  361. package/dist/modes/interactive/components/first-time-setup.js +11 -10
  362. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  363. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  364. package/dist/modes/interactive/components/footer.js +7 -4
  365. package/dist/modes/interactive/components/footer.js.map +1 -1
  366. package/dist/modes/interactive/components/index.d.ts +1 -0
  367. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  368. package/dist/modes/interactive/components/index.js +1 -0
  369. package/dist/modes/interactive/components/index.js.map +1 -1
  370. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  371. package/dist/modes/interactive/components/keybinding-hints.js +3 -2
  372. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  373. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  374. package/dist/modes/interactive/components/login-dialog.js +12 -11
  375. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  376. package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
  377. package/dist/modes/interactive/components/mermaid.js +6 -2
  378. package/dist/modes/interactive/components/mermaid.js.map +1 -1
  379. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  380. package/dist/modes/interactive/components/model-selector.js +28 -16
  381. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  382. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  383. package/dist/modes/interactive/components/oauth-selector.js +10 -9
  384. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  385. package/dist/modes/interactive/components/plugin-manager-entry.d.ts.map +1 -1
  386. package/dist/modes/interactive/components/plugin-manager-entry.js +22 -13
  387. package/dist/modes/interactive/components/plugin-manager-entry.js.map +1 -1
  388. package/dist/modes/interactive/components/plugin-selection-entry.d.ts.map +1 -1
  389. package/dist/modes/interactive/components/plugin-selection-entry.js +27 -12
  390. package/dist/modes/interactive/components/plugin-selection-entry.js.map +1 -1
  391. package/dist/modes/interactive/components/queue-manager-selector.d.ts +60 -0
  392. package/dist/modes/interactive/components/queue-manager-selector.d.ts.map +1 -0
  393. package/dist/modes/interactive/components/queue-manager-selector.js +166 -0
  394. package/dist/modes/interactive/components/queue-manager-selector.js.map +1 -0
  395. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  396. package/dist/modes/interactive/components/scoped-models-selector.js +16 -14
  397. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  398. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  399. package/dist/modes/interactive/components/session-selector.js +43 -31
  400. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  401. package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
  402. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  403. package/dist/modes/interactive/components/settings-selector.js +113 -96
  404. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  405. package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
  406. package/dist/modes/interactive/components/settings-submenu.js +5 -4
  407. package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
  408. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  409. package/dist/modes/interactive/components/show-images-selector.js +3 -2
  410. package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
  411. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  412. package/dist/modes/interactive/components/skill-invocation-message.js +4 -3
  413. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  414. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  415. package/dist/modes/interactive/components/status-indicator.js +14 -5
  416. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  417. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  418. package/dist/modes/interactive/components/theme-selector.js +2 -1
  419. package/dist/modes/interactive/components/theme-selector.js.map +1 -1
  420. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  421. package/dist/modes/interactive/components/thinking-selector.js +11 -4
  422. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  423. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  424. package/dist/modes/interactive/components/tool-execution.js +8 -3
  425. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  426. package/dist/modes/interactive/components/tree-list.d.ts.map +1 -1
  427. package/dist/modes/interactive/components/tree-list.js +7 -6
  428. package/dist/modes/interactive/components/tree-list.js.map +1 -1
  429. package/dist/modes/interactive/components/tree-render.d.ts.map +1 -1
  430. package/dist/modes/interactive/components/tree-render.js +28 -23
  431. package/dist/modes/interactive/components/tree-render.js.map +1 -1
  432. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  433. package/dist/modes/interactive/components/tree-selector.js +9 -7
  434. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  435. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  436. package/dist/modes/interactive/components/user-message-selector.js +5 -4
  437. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  438. package/dist/modes/interactive/components/workflow-view.d.ts.map +1 -1
  439. package/dist/modes/interactive/components/workflow-view.js +36 -21
  440. package/dist/modes/interactive/components/workflow-view.js.map +1 -1
  441. package/dist/modes/interactive/external-editor.d.ts.map +1 -1
  442. package/dist/modes/interactive/external-editor.js +2 -1
  443. package/dist/modes/interactive/external-editor.js.map +1 -1
  444. package/dist/modes/interactive/interactive-auth.d.ts.map +1 -1
  445. package/dist/modes/interactive/interactive-auth.js +71 -40
  446. package/dist/modes/interactive/interactive-auth.js.map +1 -1
  447. package/dist/modes/interactive/interactive-commands.d.ts +1 -0
  448. package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
  449. package/dist/modes/interactive/interactive-commands.js +3 -0
  450. package/dist/modes/interactive/interactive-commands.js.map +1 -1
  451. package/dist/modes/interactive/interactive-dialog-ui.d.ts.map +1 -1
  452. package/dist/modes/interactive/interactive-dialog-ui.js +5 -5
  453. package/dist/modes/interactive/interactive-dialog-ui.js.map +1 -1
  454. package/dist/modes/interactive/interactive-format.d.ts.map +1 -1
  455. package/dist/modes/interactive/interactive-format.js +34 -18
  456. package/dist/modes/interactive/interactive-format.js.map +1 -1
  457. package/dist/modes/interactive/interactive-helpers.d.ts.map +1 -1
  458. package/dist/modes/interactive/interactive-helpers.js +7 -2
  459. package/dist/modes/interactive/interactive-helpers.js.map +1 -1
  460. package/dist/modes/interactive/interactive-mode.d.ts +4 -1
  461. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  462. package/dist/modes/interactive/interactive-mode.js +327 -243
  463. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  464. package/dist/modes/interactive/interactive-selectors.d.ts +9 -0
  465. package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
  466. package/dist/modes/interactive/interactive-selectors.js +79 -25
  467. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  468. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  469. package/dist/modes/interactive/theme/theme-controller.js +5 -1
  470. package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
  471. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  472. package/dist/modes/interactive/theme/theme.js +26 -23
  473. package/dist/modes/interactive/theme/theme.js.map +1 -1
  474. package/dist/modes/json-event.d.ts.map +1 -1
  475. package/dist/modes/json-event.js +3 -2
  476. package/dist/modes/json-event.js.map +1 -1
  477. package/dist/modes/print-mode.d.ts.map +1 -1
  478. package/dist/modes/print-mode.js +3 -2
  479. package/dist/modes/print-mode.js.map +1 -1
  480. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  481. package/dist/modes/rpc/rpc-client.js +3 -2
  482. package/dist/modes/rpc/rpc-client.js.map +1 -1
  483. package/dist/package-manager-cli.d.ts.map +1 -1
  484. package/dist/package-manager-cli.js +28 -13
  485. package/dist/package-manager-cli.js.map +1 -1
  486. package/dist/plugins/ecosystem/catalog.d.ts.map +1 -1
  487. package/dist/plugins/ecosystem/catalog.js +3 -2
  488. package/dist/plugins/ecosystem/catalog.js.map +1 -1
  489. package/dist/plugins/ecosystem/cli.d.ts.map +1 -1
  490. package/dist/plugins/ecosystem/cli.js +2 -1
  491. package/dist/plugins/ecosystem/cli.js.map +1 -1
  492. package/dist/plugins/ecosystem/default-plugin-market.d.ts.map +1 -1
  493. package/dist/plugins/ecosystem/default-plugin-market.js +3 -2
  494. package/dist/plugins/ecosystem/default-plugin-market.js.map +1 -1
  495. package/dist/plugins/ecosystem/distribution.d.ts.map +1 -1
  496. package/dist/plugins/ecosystem/distribution.js +2 -1
  497. package/dist/plugins/ecosystem/distribution.js.map +1 -1
  498. package/dist/plugins/ecosystem/installer.d.ts.map +1 -1
  499. package/dist/plugins/ecosystem/installer.js +3 -2
  500. package/dist/plugins/ecosystem/installer.js.map +1 -1
  501. package/dist/plugins/ecosystem/node-disk-registry-source.d.ts.map +1 -1
  502. package/dist/plugins/ecosystem/node-disk-registry-source.js +20 -17
  503. package/dist/plugins/ecosystem/node-disk-registry-source.js.map +1 -1
  504. package/dist/plugins/ecosystem/node-distribution-host.d.ts.map +1 -1
  505. package/dist/plugins/ecosystem/node-distribution-host.js +35 -34
  506. package/dist/plugins/ecosystem/node-distribution-host.js.map +1 -1
  507. package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -1
  508. package/dist/plugins/ecosystem/node-npm-registry-source.js +35 -34
  509. package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -1
  510. package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -1
  511. package/dist/plugins/ecosystem/node-package-install-host.js +9 -8
  512. package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -1
  513. package/dist/plugins/ecosystem/node-package-install-persistence.d.ts.map +1 -1
  514. package/dist/plugins/ecosystem/node-package-install-persistence.js +4 -3
  515. package/dist/plugins/ecosystem/node-package-install-persistence.js.map +1 -1
  516. package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -1
  517. package/dist/plugins/ecosystem/node-plugin-bootstrap.js +21 -5
  518. package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -1
  519. package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts.map +1 -1
  520. package/dist/plugins/ecosystem/node-plugin-trust-root.js +10 -9
  521. package/dist/plugins/ecosystem/node-plugin-trust-root.js.map +1 -1
  522. package/dist/plugins/ecosystem/node-registry-source.d.ts.map +1 -1
  523. package/dist/plugins/ecosystem/node-registry-source.js +31 -30
  524. package/dist/plugins/ecosystem/node-registry-source.js.map +1 -1
  525. package/dist/plugins/ecosystem/node-release-package-source.d.ts.map +1 -1
  526. package/dist/plugins/ecosystem/node-release-package-source.js +30 -29
  527. package/dist/plugins/ecosystem/node-release-package-source.js.map +1 -1
  528. package/dist/plugins/ecosystem/node-tar-writer.d.ts.map +1 -1
  529. package/dist/plugins/ecosystem/node-tar-writer.js +11 -10
  530. package/dist/plugins/ecosystem/node-tar-writer.js.map +1 -1
  531. package/dist/plugins/ecosystem/node-url-package-source.d.ts.map +1 -1
  532. package/dist/plugins/ecosystem/node-url-package-source.js +21 -20
  533. package/dist/plugins/ecosystem/node-url-package-source.js.map +1 -1
  534. package/dist/plugins/ecosystem/plugin-acquisition.d.ts.map +1 -1
  535. package/dist/plugins/ecosystem/plugin-acquisition.js +3 -2
  536. package/dist/plugins/ecosystem/plugin-acquisition.js.map +1 -1
  537. package/dist/plugins/ecosystem/registry-cli-adapter.d.ts.map +1 -1
  538. package/dist/plugins/ecosystem/registry-cli-adapter.js +2 -1
  539. package/dist/plugins/ecosystem/registry-cli-adapter.js.map +1 -1
  540. package/dist/plugins/ecosystem/registry.d.ts.map +1 -1
  541. package/dist/plugins/ecosystem/registry.js +35 -32
  542. package/dist/plugins/ecosystem/registry.js.map +1 -1
  543. package/dist/plugins/ecosystem/resolver.d.ts.map +1 -1
  544. package/dist/plugins/ecosystem/resolver.js +3 -2
  545. package/dist/plugins/ecosystem/resolver.js.map +1 -1
  546. package/dist/plugins/ecosystem/selection-store.d.ts.map +1 -1
  547. package/dist/plugins/ecosystem/selection-store.js +11 -10
  548. package/dist/plugins/ecosystem/selection-store.js.map +1 -1
  549. package/dist/plugins/ecosystem/selection.d.ts.map +1 -1
  550. package/dist/plugins/ecosystem/selection.js +8 -7
  551. package/dist/plugins/ecosystem/selection.js.map +1 -1
  552. package/dist/plugins/ecosystem/state.d.ts.map +1 -1
  553. package/dist/plugins/ecosystem/state.js +24 -23
  554. package/dist/plugins/ecosystem/state.js.map +1 -1
  555. package/dist/plugins/ecosystem/updates.d.ts.map +1 -1
  556. package/dist/plugins/ecosystem/updates.js +5 -4
  557. package/dist/plugins/ecosystem/updates.js.map +1 -1
  558. package/dist/plugins/mcp-http.d.ts +0 -17
  559. package/dist/plugins/mcp-http.d.ts.map +1 -1
  560. package/dist/plugins/mcp-http.js +30 -7
  561. package/dist/plugins/mcp-http.js.map +1 -1
  562. package/dist/plugins/plugin-supervisor.d.ts.map +1 -1
  563. package/dist/plugins/plugin-supervisor.js +19 -1
  564. package/dist/plugins/plugin-supervisor.js.map +1 -1
  565. package/dist/profile/first-roles.d.ts.map +1 -1
  566. package/dist/profile/first-roles.js +10 -1
  567. package/dist/profile/first-roles.js.map +1 -1
  568. package/dist/profile/goal-plugin.d.ts.map +1 -1
  569. package/dist/profile/goal-plugin.js +24 -5
  570. package/dist/profile/goal-plugin.js.map +1 -1
  571. package/dist/profile/identity.d.ts.map +1 -1
  572. package/dist/profile/identity.js +7 -6
  573. package/dist/profile/identity.js.map +1 -1
  574. package/dist/profile/lock.d.ts.map +1 -1
  575. package/dist/profile/lock.js +15 -1
  576. package/dist/profile/lock.js.map +1 -1
  577. package/dist/profile/plan-plugin.d.ts.map +1 -1
  578. package/dist/profile/plan-plugin.js +26 -13
  579. package/dist/profile/plan-plugin.js.map +1 -1
  580. package/dist/profile/plugin-profiles.d.ts.map +1 -1
  581. package/dist/profile/plugin-profiles.js +2 -1
  582. package/dist/profile/plugin-profiles.js.map +1 -1
  583. package/dist/profile/policy-manifest.d.ts.map +1 -1
  584. package/dist/profile/policy-manifest.js +5 -4
  585. package/dist/profile/policy-manifest.js.map +1 -1
  586. package/dist/profile/profile-registry.d.ts +0 -12
  587. package/dist/profile/profile-registry.d.ts.map +1 -1
  588. package/dist/profile/profile-registry.js +14 -1
  589. package/dist/profile/profile-registry.js.map +1 -1
  590. package/dist/profile/role-catalog.d.ts +0 -1
  591. package/dist/profile/role-catalog.d.ts.map +1 -1
  592. package/dist/profile/role-catalog.js +17 -15
  593. package/dist/profile/role-catalog.js.map +1 -1
  594. package/dist/profile/role-orchestrator.d.ts.map +1 -1
  595. package/dist/profile/role-orchestrator.js +8 -7
  596. package/dist/profile/role-orchestrator.js.map +1 -1
  597. package/dist/profile/role-runner.d.ts.map +1 -1
  598. package/dist/profile/role-runner.js +3 -2
  599. package/dist/profile/role-runner.js.map +1 -1
  600. package/dist/profile/root-facade.d.ts.map +1 -1
  601. package/dist/profile/root-facade.js +2 -1
  602. package/dist/profile/root-facade.js.map +1 -1
  603. package/dist/profile/skill-discovery-wiring.d.ts.map +1 -1
  604. package/dist/profile/skill-discovery-wiring.js +7 -2
  605. package/dist/profile/skill-discovery-wiring.js.map +1 -1
  606. package/dist/profile/state-store.d.ts.map +1 -1
  607. package/dist/profile/state-store.js +13 -9
  608. package/dist/profile/state-store.js.map +1 -1
  609. package/dist/profile/todo-plugin.d.ts.map +1 -1
  610. package/dist/profile/todo-plugin.js +9 -4
  611. package/dist/profile/todo-plugin.js.map +1 -1
  612. package/dist/profiles/builtin-suites.d.ts +13 -6
  613. package/dist/profiles/builtin-suites.d.ts.map +1 -1
  614. package/dist/profiles/builtin-suites.js +15 -6
  615. package/dist/profiles/builtin-suites.js.map +1 -1
  616. package/dist/profiles/suite-loader.d.ts +25 -1
  617. package/dist/profiles/suite-loader.d.ts.map +1 -1
  618. package/dist/profiles/suite-loader.js +34 -9
  619. package/dist/profiles/suite-loader.js.map +1 -1
  620. package/dist/remote/server-entry.d.ts.map +1 -1
  621. package/dist/remote/server-entry.js +3 -2
  622. package/dist/remote/server-entry.js.map +1 -1
  623. package/dist/remote/session-source.d.ts.map +1 -1
  624. package/dist/remote/session-source.js +8 -4
  625. package/dist/remote/session-source.js.map +1 -1
  626. package/dist/share/session-share.d.ts.map +1 -1
  627. package/dist/share/session-share.js +14 -2
  628. package/dist/share/session-share.js.map +1 -1
  629. package/dist/testing/plugin-testkit.d.ts.map +1 -1
  630. package/dist/testing/plugin-testkit.js +4 -3
  631. package/dist/testing/plugin-testkit.js.map +1 -1
  632. package/dist/testing/runtime-delivery-queue.d.ts.map +1 -1
  633. package/dist/testing/runtime-delivery-queue.js +2 -1
  634. package/dist/testing/runtime-delivery-queue.js.map +1 -1
  635. package/dist/testing/session-plugin-testkit.d.ts.map +1 -1
  636. package/dist/testing/session-plugin-testkit.js +10 -7
  637. package/dist/testing/session-plugin-testkit.js.map +1 -1
  638. package/dist/utils/ansi.d.ts.map +1 -1
  639. package/dist/utils/ansi.js +2 -1
  640. package/dist/utils/ansi.js.map +1 -1
  641. package/dist/utils/clipboard.d.ts.map +1 -1
  642. package/dist/utils/clipboard.js +7 -6
  643. package/dist/utils/clipboard.js.map +1 -1
  644. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  645. package/dist/utils/image-resize-worker.js +3 -2
  646. package/dist/utils/image-resize-worker.js.map +1 -1
  647. package/dist/utils/shell.d.ts.map +1 -1
  648. package/dist/utils/shell.js +9 -8
  649. package/dist/utils/shell.js.map +1 -1
  650. package/dist/utils/tools-manager.d.ts.map +1 -1
  651. package/dist/utils/tools-manager.js +23 -13
  652. package/dist/utils/tools-manager.js.map +1 -1
  653. package/dist/utils/version-check.d.ts.map +1 -1
  654. package/dist/utils/version-check.js +5 -1
  655. package/dist/utils/version-check.js.map +1 -1
  656. package/docs/keybindings.md +3 -0
  657. package/docs/quickstart.md +1 -1
  658. package/docs/settings.md +1 -0
  659. package/docs/terminal-setup.md +2 -3
  660. package/docs/usage.md +6 -5
  661. package/examples/extensions/with-deps/package-lock.json +2 -2
  662. package/examples/extensions/with-deps/package.json +1 -1
  663. package/examples/extensions/with-deps/plugin.json +1 -1
  664. package/package.json +1 -1
  665. package/dist/bundle/chunks/chunk-EALJ5DDX.js +0 -1452
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-lifecycle.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAIN,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAG/B,+BAA+B,EAC/B,i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CACF","sourcesContent":["import { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport {\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\ttype CapabilityCallEventDataV1,\n\ttype ContextAssembledEventDataV1,\n\tcapabilityCallEventDefinition,\n\tcontextAssembledEventDefinition,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\ttype MessageBoundaryEventDataV1,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelResponseEventDefinition,\n\tmodelSelectEventDefinition,\n\tmodelStreamEventDefinition,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\toperationCancelEventDefinition,\n\toperationEndEventDefinition,\n\toperationStartEventDefinition,\n\toperationStepEventDefinition,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionContextReplacedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionReloadEventDefinition,\n\tsessionStartEventDefinition,\n\ttype ThinkingLevelSelectEventDataV1,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolCallEventDefinition,\n\ttoolCommitEventDefinition,\n\ttoolExecuteEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\ttoolResultEventDefinition,\n\ttoolResultRawEventDefinition,\n\ttoolResultTransformEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\ttype UIPromptBoundaryEventDataV1,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n} from \"./lifecycle-catalog.ts\";\n\nexport type { CapabilityCallEventNameV1, CapabilityCallStatusV1, ModelStreamEventNameV1 } from \"./lifecycle-catalog.ts\";\n\nimport type { SessionRevisionV1 } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport {\n\tAGENT_END_EVENT_ID,\n\tAGENT_END_EVENT_VERSION,\n\tAGENT_SETTLED_EVENT_ID,\n\tAGENT_SETTLED_EVENT_VERSION,\n\tAGENT_START_EVENT_ID,\n\tAGENT_START_EVENT_VERSION,\n\tAGENT_TASK_SETTLED_EVENT_ID,\n\tAGENT_TASK_SETTLED_EVENT_VERSION,\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\tBEFORE_AGENT_START_EVENT_ID,\n\tBEFORE_AGENT_START_EVENT_VERSION,\n\tBEFORE_AGENT_START_EVENT_VERSION_V2,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\tCAPABILITY_CALL_EVENT_ID,\n\tCAPABILITY_CALL_EVENT_VERSION,\n\ttype CapabilityCallEventDataV1,\n\tCONTEXT_ASSEMBLED_EVENT_ID,\n\tCONTEXT_ASSEMBLED_EVENT_VERSION,\n\ttype ContextAssembledEventDataV1,\n\tcontextAssembledEventDefinition,\n\tINPUT_GATE_BLOCKED_EVENT_ID,\n\tINPUT_GATE_BLOCKED_EVENT_VERSION,\n\tINPUT_RECEIVED_EVENT_ID,\n\tINPUT_RECEIVED_EVENT_VERSION,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\tMESSAGE_END_EVENT_ID,\n\tMESSAGE_END_EVENT_VERSION,\n\tMESSAGE_START_EVENT_ID,\n\tMESSAGE_START_EVENT_VERSION,\n\ttype MessageBoundaryEventDataV1,\n\tMODEL_RESPONSE_EVENT_ID,\n\tMODEL_RESPONSE_EVENT_VERSION,\n\tMODEL_SELECT_EVENT_ID,\n\tMODEL_SELECT_EVENT_VERSION,\n\tMODEL_STREAM_EVENT_ID,\n\tMODEL_STREAM_EVENT_VERSION,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelSelectEventDefinition,\n\tOPERATION_CANCEL_EVENT_ID,\n\tOPERATION_CANCEL_EVENT_VERSION,\n\tOPERATION_END_EVENT_ID,\n\tOPERATION_END_EVENT_VERSION,\n\tOPERATION_START_EVENT_ID,\n\tOPERATION_START_EVENT_VERSION,\n\tOPERATION_STEP_EVENT_ID,\n\tOPERATION_STEP_EVENT_VERSION,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\tPLUGIN_REJECTED_EVENT_ID,\n\tPLUGIN_REJECTED_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_ID,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_ID,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_VERSION,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\tRESOURCES_DISCOVER_EVENT_ID,\n\tRESOURCES_DISCOVER_EVENT_VERSION,\n\tRESOURCES_DISCOVER_EVENT_VERSION_V2,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\tSESSION_AUTO_RETRY_EVENT_ID,\n\tSESSION_AUTO_RETRY_EVENT_VERSION,\n\tSESSION_COMPACTION_DECISION_EVENT_ID,\n\tSESSION_COMPACTION_DECISION_EVENT_VERSION,\n\tSESSION_COMPACTION_FAILED_EVENT_ID,\n\tSESSION_COMPACTION_FAILED_EVENT_VERSION,\n\tSESSION_CONTEXT_REPLACED_EVENT_ID,\n\tSESSION_CONTEXT_REPLACED_EVENT_VERSION,\n\tSESSION_END_EVENT_ID,\n\tSESSION_END_EVENT_VERSION,\n\tSESSION_ENTRY_APPENDED_EVENT_ID,\n\tSESSION_ENTRY_APPENDED_EVENT_VERSION,\n\tSESSION_INFO_CHANGED_EVENT_ID,\n\tSESSION_INFO_CHANGED_EVENT_VERSION,\n\tSESSION_RELOAD_EVENT_ID,\n\tSESSION_RELOAD_EVENT_VERSION,\n\tSESSION_START_EVENT_ID,\n\tSESSION_START_EVENT_VERSION,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionStartEventDefinition,\n\tTHINKING_LEVEL_SELECT_EVENT_ID,\n\tTHINKING_LEVEL_SELECT_EVENT_VERSION,\n\ttype ThinkingLevelSelectEventDataV1,\n\tTOOL_CALL_EVENT_ID,\n\tTOOL_CALL_EVENT_VERSION,\n\tTOOL_COMMIT_EVENT_ID,\n\tTOOL_COMMIT_EVENT_VERSION,\n\tTOOL_EXECUTE_EVENT_ID,\n\tTOOL_EXECUTE_EVENT_VERSION,\n\tTOOL_EXECUTION_START_EVENT_ID,\n\tTOOL_EXECUTION_START_EVENT_VERSION,\n\tTOOL_GATE_BLOCKED_EVENT_ID,\n\tTOOL_GATE_BLOCKED_EVENT_VERSION,\n\tTOOL_RESULT_EVENT_ID,\n\tTOOL_RESULT_EVENT_VERSION,\n\tTOOL_RESULT_RAW_EVENT_ID,\n\tTOOL_RESULT_RAW_EVENT_VERSION,\n\tTOOL_RESULT_TRANSFORM_EVENT_ID,\n\tTOOL_RESULT_TRANSFORM_EVENT_VERSION,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\tTURN_END_EVENT_ID,\n\tTURN_END_EVENT_VERSION,\n\tTURN_START_EVENT_ID,\n\tTURN_START_EVENT_VERSION,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\tUI_PROMPT_END_EVENT_ID,\n\tUI_PROMPT_END_EVENT_VERSION,\n\tUI_PROMPT_START_EVENT_ID,\n\tUI_PROMPT_START_EVENT_VERSION,\n\ttype UIPromptBoundaryEventDataV1,\n\tUSER_BASH_EVENT_ID,\n\tUSER_BASH_EVENT_VERSION,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n\tvalidateAgentEndEventDataV1,\n\tvalidateAgentLifecycleEventDataV1,\n\tvalidateAgentTaskSettledEventDataV1,\n\tvalidateBeforeAgentStartEventDataV1,\n\tvalidateBeforeAgentStartEventDataV2,\n\tvalidateCapabilityCallEventDataV1,\n\tvalidateContextAssembledEventDataV1,\n\tvalidateInputReceivedEventDataV1,\n\tvalidateMessageBoundaryEventDataV1,\n\tvalidateModelResponseEventDataV1,\n\tvalidateModelSelectEventDataV1,\n\tvalidateModelStreamEventDataV1,\n\tvalidateOperationCancelEventDataV1,\n\tvalidateOperationEndEventDataV1,\n\tvalidateOperationStartEventDataV1,\n\tvalidateOperationStepEventDataV1,\n\tvalidatePluginDisposeEventDataV1,\n\tvalidatePluginReadyEventDataV1,\n\tvalidateProviderFailoverProbeFailedEventDataV1,\n\tvalidateProviderFailoverRecoveredEventDataV1,\n\tvalidateProviderFailoverSwitchedEventDataV1,\n\tvalidateResourcesDiscoverEventDataV1,\n\tvalidateResourcesDiscoverEventDataV2,\n\tvalidateSessionAutoRetryEventDataV1,\n\tvalidateSessionCompactionDecisionEventDataV1,\n\tvalidateSessionCompactionFailedEventDataV1,\n\tvalidateSessionContextReplacedEventDataV1,\n\tvalidateSessionEndEventDataV1,\n\tvalidateSessionEntryAppendedEventDataV1,\n\tvalidateSessionInfoChangedEventDataV1,\n\tvalidateSessionReloadEventDataV1,\n\tvalidateSessionStartEventDataV1,\n\tvalidateThinkingLevelSelectEventDataV1,\n\tvalidateToolCallEventDataV1,\n\tvalidateToolCommitEventDataV1,\n\tvalidateToolExecuteEventDataV1,\n\tvalidateToolExecutionStartEventDataV1,\n\tvalidateToolGateBlockedEventDataV1,\n\tvalidateToolResultEventDataV1,\n\tvalidateToolResultRawEventDataV1,\n\tvalidateToolResultTransformEventDataV1,\n\tvalidateTurnEndEventDataV1,\n\tvalidateTurnStartEventDataV1,\n\tvalidateUIPromptBoundaryEventDataV1,\n\tvalidateUserBashEventDataV1,\n} from \"./lifecycle-catalog.ts\";\n\nexport const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = \"agent-forge.bootstrap-lifecycle\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_ID = \"session.compaction.commit\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;\n\nexport interface SessionCompactionCommitEventDataV1 {\n\tversion: 1;\n\tstatus: \"committed\" | \"replayed\";\n\tentryId: string;\n\toperationId: string;\n\trevision: SessionRevisionV1;\n\treason: \"manual\" | \"threshold\" | \"overflow\";\n\tsummary: string;\n\tfirstKeptEntryId: string;\n\ttokensBefore: number;\n\tfromHook: boolean;\n\tusage?: unknown;\n\tdetails?: unknown;\n}\n\nconst isPlainRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype;\n\nfunction assertJsonSafe(value: unknown, label: string, seen = new Set<object>()): void {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return;\n\t\tthrow new Error(`${label} must contain only finite JSON numbers`);\n\t}\n\tif (typeof value !== \"object\") throw new Error(`${label} must be JSON-safe`);\n\tif (seen.has(value)) throw new Error(`${label} must not contain cycles`);\n\tseen.add(value);\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, entry] of value.entries()) assertJsonSafe(entry, `${label}[${index}]`, seen);\n\t} else if (isPlainRecord(value)) {\n\t\tfor (const [key, entry] of Object.entries(value)) assertJsonSafe(entry, `${label}.${key}`, seen);\n\t} else {\n\t\tthrow new Error(`${label} must contain only JSON arrays and plain objects`);\n\t}\n\tseen.delete(value);\n}\n\nfunction assertString(value: unknown, label: string): asserts value is string {\n\tif (typeof value !== \"string\" || value.trim() === \"\") throw new Error(`${label} must be a non-empty string`);\n}\n\nfunction assertRevision(value: unknown): asserts value is SessionRevisionV1 {\n\tif (!isPlainRecord(value)) throw new Error(\"session.compaction.commit.revision must be a plain object\");\n\tconst keys = Object.keys(value).sort();\n\tif (keys.join(\",\") !== \"leafId,sequence,sessionId,version\") {\n\t\tthrow new Error(\"session.compaction.commit.revision has unsupported fields\");\n\t}\n\tif (value.version !== 1) throw new Error(\"session.compaction.commit.revision.version must be 1\");\n\tassertString(value.sessionId, \"session.compaction.commit.revision.sessionId\");\n\tconst sequence = value.sequence;\n\tif (typeof sequence !== \"number\" || !Number.isSafeInteger(sequence) || sequence < 0) {\n\t\tthrow new Error(\"session.compaction.commit.revision.sequence must be a non-negative safe integer\");\n\t}\n\tif (value.leafId !== null) assertString(value.leafId, \"session.compaction.commit.revision.leafId\");\n}\n\n/** Strict validator for the committed compaction lifecycle payload. */\nexport function validateSessionCompactionCommitEventDataV1(value: unknown): SessionCompactionCommitEventDataV1 {\n\tif (!isPlainRecord(value)) throw new Error(\"session.compaction.commit data must be a plain object\");\n\tconst allowed = new Set([\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t\t\"usage\",\n\t\t\"details\",\n\t]);\n\tconst unsupported = Object.keys(value).filter((key) => !allowed.has(key));\n\tif (unsupported.length > 0) {\n\t\tthrow new Error(`session.compaction.commit data has unsupported fields: ${unsupported.join(\", \")}`);\n\t}\n\tfor (const key of [\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t]) {\n\t\tif (!(key in value)) throw new Error(`session.compaction.commit data is missing required field: ${key}`);\n\t}\n\tif (value.version !== 1) throw new Error(\"session.compaction.commit data.version must be 1\");\n\tif (value.status !== \"committed\" && value.status !== \"replayed\") {\n\t\tthrow new Error(\"session.compaction.commit data.status is invalid\");\n\t}\n\tassertString(value.entryId, \"session.compaction.commit data.entryId\");\n\tassertString(value.operationId, \"session.compaction.commit data.operationId\");\n\tassertRevision(value.revision);\n\tif (value.reason !== \"manual\" && value.reason !== \"threshold\" && value.reason !== \"overflow\") {\n\t\tthrow new Error(\"session.compaction.commit data.reason is invalid\");\n\t}\n\tassertString(value.summary, \"session.compaction.commit data.summary\");\n\tassertString(value.firstKeptEntryId, \"session.compaction.commit data.firstKeptEntryId\");\n\tif (typeof value.tokensBefore !== \"number\" || !Number.isFinite(value.tokensBefore) || value.tokensBefore < 0) {\n\t\tthrow new Error(\"session.compaction.commit data.tokensBefore must be a non-negative finite number\");\n\t}\n\tif (typeof value.fromHook !== \"boolean\") throw new Error(\"session.compaction.commit data.fromHook must be boolean\");\n\tif (\"usage\" in value) assertJsonSafe(value.usage, \"session.compaction.commit data.usage\");\n\tif (\"details\" in value) assertJsonSafe(value.details, \"session.compaction.commit data.details\");\n\treturn value as unknown as SessionCompactionCommitEventDataV1;\n}\n\nexport function installBootstrapLifecycle(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_LIFECYCLE_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-lifecycle>\",\n\t\t},\n\t\t(api) => {\n\t\t\tapi.lifecycle.define<SessionCompactionCommitEventDataV1>({\n\t\t\t\tid: SESSION_COMPACTION_COMMIT_EVENT_ID,\n\t\t\t\tversion: SESSION_COMPACTION_COMMIT_EVENT_VERSION,\n\t\t\t\tphase: \"committed\",\n\t\t\t\tschema: \"agent-forge/session.compaction.commit@1\",\n\t\t\t\tallowedRegistrationKinds: [\"observe\", \"after-commit\"],\n\t\t\t\tvalidate: validateSessionCompactionCommitEventDataV1,\n\t\t\t});\n\t\t\tapi.lifecycle.define<SessionAutoRetryEventDataV1>(sessionAutoRetryEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionDecisionEventDataV1>(sessionCompactionDecisionEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionFailedEventDataV1>(sessionCompactionFailedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEndEventDataV1>(sessionEndEventDefinition());\n\t\t\tapi.lifecycle.define<AgentTaskSettledEventDataV1>(agentTaskSettledEventDefinition());\n\t\t\tapi.lifecycle.define<ToolGateBlockedEventDataV1>(toolGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<InputGateBlockedEventDataV1>(inputGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverSwitchedEventDataV1>(providerFailoverSwitchedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverRecoveredEventDataV1>(providerFailoverRecoveredEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverProbeFailedEventDataV1>(providerFailoverProbeFailedEventDefinition());\n\t\t\tapi.lifecycle.define<PluginDisposeEventDataV1>(pluginDisposeEventDefinition());\n\t\t\tapi.lifecycle.define<PluginReadyEventDataV1>(pluginReadyEventDefinition());\n\t\t\tapi.lifecycle.define<PluginRejectedEventDataV1>(pluginRejectedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionContextReplacedEventDataV1>(sessionContextReplacedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionReloadEventDataV1>(sessionReloadEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentStartEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentSettledEventDefinition());\n\t\t\tapi.lifecycle.define<TurnStartEventDataV1>(turnStartEventDefinition());\n\t\t\tapi.lifecycle.define<TurnEndEventDataV1>(turnEndEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageStartEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageEndEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecutionStartEventDataV1>(toolExecutionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelSelectEventDataV1>(modelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<ThinkingLevelSelectEventDataV1>(thinkingLevelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<SessionInfoChangedEventDataV1>(sessionInfoChangedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEntryAppendedEventDataV1>(sessionEntryAppendedEventDefinition());\n\t\t\tapi.lifecycle.define<AgentEndEventDataV1>(agentEndEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV1>(beforeAgentStartEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV2>(beforeAgentStartV2EventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptStartEventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptEndEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV1>(resourcesDiscoverEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV2>(resourcesDiscoverV2EventDefinition());\n\t\t\tapi.lifecycle.define<ContextAssembledEventDataV1>(contextAssembledEventDefinition());\n\t\t\tapi.lifecycle.define<InputReceivedEventDataV1>(inputReceivedEventDefinition());\n\t\t\tapi.lifecycle.define<UserBashEventDataV1>(userBashEventDefinition());\n\t\t\tapi.lifecycle.define<SessionStartEventDataV1>(sessionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelResponseEventDataV1>(modelResponseEventDefinition());\n\t\t\tapi.lifecycle.define<ModelStreamEventDataV1>(modelStreamEventDefinition());\n\t\t\tapi.lifecycle.define<CapabilityCallEventDataV1>(capabilityCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCallEventDataV1>(toolCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecuteEventDataV1>(toolExecuteEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCommitEventDataV1>(toolCommitEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultRawEventDataV1>(toolResultRawEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultEventDataV1>(toolResultEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultTransformEventDataV1>(toolResultTransformEventDefinition());\n\t\t\tapi.lifecycle.define<OperationEndEventDataV1>(operationEndEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStartEventDataV1>(operationStartEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStepEventDataV1>(operationStepEventDefinition());\n\t\t\tapi.lifecycle.define<OperationCancelEventDataV1>(operationCancelEventDefinition());\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-lifecycle.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAIN,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAG/B,+BAA+B,EAC/B,iCAAiC,EAGjC,6BAA6B,EAC7B,+BAA+B,EAG/B,+BAA+B,EAC/B,4BAA4B,EAK5B,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAK1B,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAO5B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,0CAA0C,EAC1C,wCAAwC,EACxC,uCAAuC,EAGvC,gCAAgC,EAChC,kCAAkC,EAUlC,+BAA+B,EAC/B,wCAAwC,EACxC,sCAAsC,EACtC,qCAAqC,EACrC,yBAAyB,EACzB,mCAAmC,EACnC,iCAA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";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport {\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\ttype CapabilityCallEventDataV1,\n\ttype ContextAssembledEventDataV1,\n\tcapabilityCallEventDefinition,\n\tcontextAssembledEventDefinition,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\ttype MessageBoundaryEventDataV1,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelResponseEventDefinition,\n\tmodelSelectEventDefinition,\n\tmodelStreamEventDefinition,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\toperationCancelEventDefinition,\n\toperationEndEventDefinition,\n\toperationStartEventDefinition,\n\toperationStepEventDefinition,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionContextReplacedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionReloadEventDefinition,\n\tsessionStartEventDefinition,\n\ttype ThinkingLevelSelectEventDataV1,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolCallEventDefinition,\n\ttoolCommitEventDefinition,\n\ttoolExecuteEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\ttoolResultEventDefinition,\n\ttoolResultRawEventDefinition,\n\ttoolResultTransformEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\ttype UIPromptBoundaryEventDataV1,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n} from \"./lifecycle-catalog.ts\";\n\nexport type { CapabilityCallEventNameV1, CapabilityCallStatusV1, ModelStreamEventNameV1 } from \"./lifecycle-catalog.ts\";\n\nimport type { SessionRevisionV1 } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport {\n\tAGENT_END_EVENT_ID,\n\tAGENT_END_EVENT_VERSION,\n\tAGENT_SETTLED_EVENT_ID,\n\tAGENT_SETTLED_EVENT_VERSION,\n\tAGENT_START_EVENT_ID,\n\tAGENT_START_EVENT_VERSION,\n\tAGENT_TASK_SETTLED_EVENT_ID,\n\tAGENT_TASK_SETTLED_EVENT_VERSION,\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\tBEFORE_AGENT_START_EVENT_ID,\n\tBEFORE_AGENT_START_EVENT_VERSION,\n\tBEFORE_AGENT_START_EVENT_VERSION_V2,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\tCAPABILITY_CALL_EVENT_ID,\n\tCAPABILITY_CALL_EVENT_VERSION,\n\ttype CapabilityCallEventDataV1,\n\tCONTEXT_ASSEMBLED_EVENT_ID,\n\tCONTEXT_ASSEMBLED_EVENT_VERSION,\n\ttype ContextAssembledEventDataV1,\n\tcontextAssembledEventDefinition,\n\tINPUT_GATE_BLOCKED_EVENT_ID,\n\tINPUT_GATE_BLOCKED_EVENT_VERSION,\n\tINPUT_RECEIVED_EVENT_ID,\n\tINPUT_RECEIVED_EVENT_VERSION,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\tMESSAGE_END_EVENT_ID,\n\tMESSAGE_END_EVENT_VERSION,\n\tMESSAGE_START_EVENT_ID,\n\tMESSAGE_START_EVENT_VERSION,\n\ttype MessageBoundaryEventDataV1,\n\tMODEL_RESPONSE_EVENT_ID,\n\tMODEL_RESPONSE_EVENT_VERSION,\n\tMODEL_SELECT_EVENT_ID,\n\tMODEL_SELECT_EVENT_VERSION,\n\tMODEL_STREAM_EVENT_ID,\n\tMODEL_STREAM_EVENT_VERSION,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelSelectEventDefinition,\n\tOPERATION_CANCEL_EVENT_ID,\n\tOPERATION_CANCEL_EVENT_VERSION,\n\tOPERATION_END_EVENT_ID,\n\tOPERATION_END_EVENT_VERSION,\n\tOPERATION_START_EVENT_ID,\n\tOPERATION_START_EVENT_VERSION,\n\tOPERATION_STEP_EVENT_ID,\n\tOPERATION_STEP_EVENT_VERSION,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\tPLUGIN_REJECTED_EVENT_ID,\n\tPLUGIN_REJECTED_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_ID,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_ID,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_VERSION,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\tRESOURCES_DISCOVER_EVENT_ID,\n\tRESOURCES_DISCOVER_EVENT_VERSION,\n\tRESOURCES_DISCOVER_EVENT_VERSION_V2,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\tSESSION_AUTO_RETRY_EVENT_ID,\n\tSESSION_AUTO_RETRY_EVENT_VERSION,\n\tSESSION_COMPACTION_DECISION_EVENT_ID,\n\tSESSION_COMPACTION_DECISION_EVENT_VERSION,\n\tSESSION_COMPACTION_FAILED_EVENT_ID,\n\tSESSION_COMPACTION_FAILED_EVENT_VERSION,\n\tSESSION_CONTEXT_REPLACED_EVENT_ID,\n\tSESSION_CONTEXT_REPLACED_EVENT_VERSION,\n\tSESSION_END_EVENT_ID,\n\tSESSION_END_EVENT_VERSION,\n\tSESSION_ENTRY_APPENDED_EVENT_ID,\n\tSESSION_ENTRY_APPENDED_EVENT_VERSION,\n\tSESSION_INFO_CHANGED_EVENT_ID,\n\tSESSION_INFO_CHANGED_EVENT_VERSION,\n\tSESSION_RELOAD_EVENT_ID,\n\tSESSION_RELOAD_EVENT_VERSION,\n\tSESSION_START_EVENT_ID,\n\tSESSION_START_EVENT_VERSION,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionStartEventDefinition,\n\tTHINKING_LEVEL_SELECT_EVENT_ID,\n\tTHINKING_LEVEL_SELECT_EVENT_VERSION,\n\ttype ThinkingLevelSelectEventDataV1,\n\tTOOL_CALL_EVENT_ID,\n\tTOOL_CALL_EVENT_VERSION,\n\tTOOL_COMMIT_EVENT_ID,\n\tTOOL_COMMIT_EVENT_VERSION,\n\tTOOL_EXECUTE_EVENT_ID,\n\tTOOL_EXECUTE_EVENT_VERSION,\n\tTOOL_EXECUTION_START_EVENT_ID,\n\tTOOL_EXECUTION_START_EVENT_VERSION,\n\tTOOL_GATE_BLOCKED_EVENT_ID,\n\tTOOL_GATE_BLOCKED_EVENT_VERSION,\n\tTOOL_RESULT_EVENT_ID,\n\tTOOL_RESULT_EVENT_VERSION,\n\tTOOL_RESULT_RAW_EVENT_ID,\n\tTOOL_RESULT_RAW_EVENT_VERSION,\n\tTOOL_RESULT_TRANSFORM_EVENT_ID,\n\tTOOL_RESULT_TRANSFORM_EVENT_VERSION,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\tTURN_END_EVENT_ID,\n\tTURN_END_EVENT_VERSION,\n\tTURN_START_EVENT_ID,\n\tTURN_START_EVENT_VERSION,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\tUI_PROMPT_END_EVENT_ID,\n\tUI_PROMPT_END_EVENT_VERSION,\n\tUI_PROMPT_START_EVENT_ID,\n\tUI_PROMPT_START_EVENT_VERSION,\n\ttype UIPromptBoundaryEventDataV1,\n\tUSER_BASH_EVENT_ID,\n\tUSER_BASH_EVENT_VERSION,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n\tvalidateAgentEndEventDataV1,\n\tvalidateAgentLifecycleEventDataV1,\n\tvalidateAgentTaskSettledEventDataV1,\n\tvalidateBeforeAgentStartEventDataV1,\n\tvalidateBeforeAgentStartEventDataV2,\n\tvalidateCapabilityCallEventDataV1,\n\tvalidateContextAssembledEventDataV1,\n\tvalidateInputReceivedEventDataV1,\n\tvalidateMessageBoundaryEventDataV1,\n\tvalidateModelResponseEventDataV1,\n\tvalidateModelSelectEventDataV1,\n\tvalidateModelStreamEventDataV1,\n\tvalidateOperationCancelEventDataV1,\n\tvalidateOperationEndEventDataV1,\n\tvalidateOperationStartEventDataV1,\n\tvalidateOperationStepEventDataV1,\n\tvalidatePluginDisposeEventDataV1,\n\tvalidatePluginReadyEventDataV1,\n\tvalidateProviderFailoverProbeFailedEventDataV1,\n\tvalidateProviderFailoverRecoveredEventDataV1,\n\tvalidateProviderFailoverSwitchedEventDataV1,\n\tvalidateResourcesDiscoverEventDataV1,\n\tvalidateResourcesDiscoverEventDataV2,\n\tvalidateSessionAutoRetryEventDataV1,\n\tvalidateSessionCompactionDecisionEventDataV1,\n\tvalidateSessionCompactionFailedEventDataV1,\n\tvalidateSessionContextReplacedEventDataV1,\n\tvalidateSessionEndEventDataV1,\n\tvalidateSessionEntryAppendedEventDataV1,\n\tvalidateSessionInfoChangedEventDataV1,\n\tvalidateSessionReloadEventDataV1,\n\tvalidateSessionStartEventDataV1,\n\tvalidateThinkingLevelSelectEventDataV1,\n\tvalidateToolCallEventDataV1,\n\tvalidateToolCommitEventDataV1,\n\tvalidateToolExecuteEventDataV1,\n\tvalidateToolExecutionStartEventDataV1,\n\tvalidateToolGateBlockedEventDataV1,\n\tvalidateToolResultEventDataV1,\n\tvalidateToolResultRawEventDataV1,\n\tvalidateToolResultTransformEventDataV1,\n\tvalidateTurnEndEventDataV1,\n\tvalidateTurnStartEventDataV1,\n\tvalidateUIPromptBoundaryEventDataV1,\n\tvalidateUserBashEventDataV1,\n} from \"./lifecycle-catalog.ts\";\n\nexport const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = \"agent-forge.bootstrap-lifecycle\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_ID = \"session.compaction.commit\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;\n\nexport interface SessionCompactionCommitEventDataV1 {\n\tversion: 1;\n\tstatus: \"committed\" | \"replayed\";\n\tentryId: string;\n\toperationId: string;\n\trevision: SessionRevisionV1;\n\treason: \"manual\" | \"threshold\" | \"overflow\";\n\tsummary: string;\n\tfirstKeptEntryId: string;\n\ttokensBefore: number;\n\tfromHook: boolean;\n\tusage?: unknown;\n\tdetails?: unknown;\n}\n\nconst isPlainRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype;\n\nfunction assertJsonSafe(value: unknown, label: string, seen = new Set<object>()): void {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return;\n\t\tthrow new Error(t(\"{label} must contain only finite JSON numbers\", { label }));\n\t}\n\tif (typeof value !== \"object\") throw new Error(t(\"{label} must be JSON-safe\", { label }));\n\tif (seen.has(value)) throw new Error(t(\"{label} must not contain cycles\", { label }));\n\tseen.add(value);\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, entry] of value.entries()) assertJsonSafe(entry, `${label}[${index}]`, seen);\n\t} else if (isPlainRecord(value)) {\n\t\tfor (const [key, entry] of Object.entries(value)) assertJsonSafe(entry, `${label}.${key}`, seen);\n\t} else {\n\t\tthrow new Error(t(\"{label} must contain only JSON arrays and plain objects\", { label }));\n\t}\n\tseen.delete(value);\n}\n\nfunction assertString(value: unknown, label: string): asserts value is string {\n\tif (typeof value !== \"string\" || value.trim() === \"\")\n\t\tthrow new Error(t(\"{label} must be a non-empty string\", { label }));\n}\n\nfunction assertRevision(value: unknown): asserts value is SessionRevisionV1 {\n\tif (!isPlainRecord(value)) throw new Error(t(\"session.compaction.commit.revision must be a plain object\"));\n\tconst keys = Object.keys(value).sort();\n\tif (keys.join(\",\") !== \"leafId,sequence,sessionId,version\") {\n\t\tthrow new Error(t(\"session.compaction.commit.revision has unsupported fields\"));\n\t}\n\tif (value.version !== 1) throw new Error(t(\"session.compaction.commit.revision.version must be 1\"));\n\tassertString(value.sessionId, \"session.compaction.commit.revision.sessionId\");\n\tconst sequence = value.sequence;\n\tif (typeof sequence !== \"number\" || !Number.isSafeInteger(sequence) || sequence < 0) {\n\t\tthrow new Error(t(\"session.compaction.commit.revision.sequence must be a non-negative safe integer\"));\n\t}\n\tif (value.leafId !== null) assertString(value.leafId, \"session.compaction.commit.revision.leafId\");\n}\n\n/** Strict validator for the committed compaction lifecycle payload. */\nexport function validateSessionCompactionCommitEventDataV1(value: unknown): SessionCompactionCommitEventDataV1 {\n\tif (!isPlainRecord(value)) throw new Error(t(\"session.compaction.commit data must be a plain object\"));\n\tconst allowed = new Set([\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t\t\"usage\",\n\t\t\"details\",\n\t]);\n\tconst unsupported = Object.keys(value).filter((key) => !allowed.has(key));\n\tif (unsupported.length > 0) {\n\t\tthrow new Error(\n\t\t\tt(\"session.compaction.commit data has unsupported fields: {unsupported}\", {\n\t\t\t\tunsupported: unsupported.join(\", \"),\n\t\t\t}),\n\t\t);\n\t}\n\tfor (const key of [\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t]) {\n\t\tif (!(key in value))\n\t\t\tthrow new Error(t(\"session.compaction.commit data is missing required field: {key}\", { key }));\n\t}\n\tif (value.version !== 1) throw new Error(t(\"session.compaction.commit data.version must be 1\"));\n\tif (value.status !== \"committed\" && value.status !== \"replayed\") {\n\t\tthrow new Error(t(\"session.compaction.commit data.status is invalid\"));\n\t}\n\tassertString(value.entryId, \"session.compaction.commit data.entryId\");\n\tassertString(value.operationId, \"session.compaction.commit data.operationId\");\n\tassertRevision(value.revision);\n\tif (value.reason !== \"manual\" && value.reason !== \"threshold\" && value.reason !== \"overflow\") {\n\t\tthrow new Error(t(\"session.compaction.commit data.reason is invalid\"));\n\t}\n\tassertString(value.summary, \"session.compaction.commit data.summary\");\n\tassertString(value.firstKeptEntryId, \"session.compaction.commit data.firstKeptEntryId\");\n\tif (typeof value.tokensBefore !== \"number\" || !Number.isFinite(value.tokensBefore) || value.tokensBefore < 0) {\n\t\tthrow new Error(t(\"session.compaction.commit data.tokensBefore must be a non-negative finite number\"));\n\t}\n\tif (typeof value.fromHook !== \"boolean\")\n\t\tthrow new Error(t(\"session.compaction.commit data.fromHook must be boolean\"));\n\tif (\"usage\" in value) assertJsonSafe(value.usage, \"session.compaction.commit data.usage\");\n\tif (\"details\" in value) assertJsonSafe(value.details, \"session.compaction.commit data.details\");\n\treturn value as unknown as SessionCompactionCommitEventDataV1;\n}\n\nexport function installBootstrapLifecycle(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_LIFECYCLE_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-lifecycle>\",\n\t\t},\n\t\t(api) => {\n\t\t\tapi.lifecycle.define<SessionCompactionCommitEventDataV1>({\n\t\t\t\tid: SESSION_COMPACTION_COMMIT_EVENT_ID,\n\t\t\t\tversion: SESSION_COMPACTION_COMMIT_EVENT_VERSION,\n\t\t\t\tphase: \"committed\",\n\t\t\t\tschema: \"agent-forge/session.compaction.commit@1\",\n\t\t\t\tallowedRegistrationKinds: [\"observe\", \"after-commit\"],\n\t\t\t\tvalidate: validateSessionCompactionCommitEventDataV1,\n\t\t\t});\n\t\t\tapi.lifecycle.define<SessionAutoRetryEventDataV1>(sessionAutoRetryEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionDecisionEventDataV1>(sessionCompactionDecisionEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionFailedEventDataV1>(sessionCompactionFailedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEndEventDataV1>(sessionEndEventDefinition());\n\t\t\tapi.lifecycle.define<AgentTaskSettledEventDataV1>(agentTaskSettledEventDefinition());\n\t\t\tapi.lifecycle.define<ToolGateBlockedEventDataV1>(toolGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<InputGateBlockedEventDataV1>(inputGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverSwitchedEventDataV1>(providerFailoverSwitchedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverRecoveredEventDataV1>(providerFailoverRecoveredEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverProbeFailedEventDataV1>(providerFailoverProbeFailedEventDefinition());\n\t\t\tapi.lifecycle.define<PluginDisposeEventDataV1>(pluginDisposeEventDefinition());\n\t\t\tapi.lifecycle.define<PluginReadyEventDataV1>(pluginReadyEventDefinition());\n\t\t\tapi.lifecycle.define<PluginRejectedEventDataV1>(pluginRejectedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionContextReplacedEventDataV1>(sessionContextReplacedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionReloadEventDataV1>(sessionReloadEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentStartEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentSettledEventDefinition());\n\t\t\tapi.lifecycle.define<TurnStartEventDataV1>(turnStartEventDefinition());\n\t\t\tapi.lifecycle.define<TurnEndEventDataV1>(turnEndEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageStartEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageEndEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecutionStartEventDataV1>(toolExecutionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelSelectEventDataV1>(modelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<ThinkingLevelSelectEventDataV1>(thinkingLevelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<SessionInfoChangedEventDataV1>(sessionInfoChangedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEntryAppendedEventDataV1>(sessionEntryAppendedEventDefinition());\n\t\t\tapi.lifecycle.define<AgentEndEventDataV1>(agentEndEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV1>(beforeAgentStartEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV2>(beforeAgentStartV2EventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptStartEventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptEndEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV1>(resourcesDiscoverEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV2>(resourcesDiscoverV2EventDefinition());\n\t\t\tapi.lifecycle.define<ContextAssembledEventDataV1>(contextAssembledEventDefinition());\n\t\t\tapi.lifecycle.define<InputReceivedEventDataV1>(inputReceivedEventDefinition());\n\t\t\tapi.lifecycle.define<UserBashEventDataV1>(userBashEventDefinition());\n\t\t\tapi.lifecycle.define<SessionStartEventDataV1>(sessionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelResponseEventDataV1>(modelResponseEventDefinition());\n\t\t\tapi.lifecycle.define<ModelStreamEventDataV1>(modelStreamEventDefinition());\n\t\t\tapi.lifecycle.define<CapabilityCallEventDataV1>(capabilityCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCallEventDataV1>(toolCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecuteEventDataV1>(toolExecuteEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCommitEventDataV1>(toolCommitEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultRawEventDataV1>(toolResultRawEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultEventDataV1>(toolResultEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultTransformEventDataV1>(toolResultTransformEventDefinition());\n\t\t\tapi.lifecycle.define<OperationEndEventDataV1>(operationEndEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStartEventDataV1>(operationStartEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStepEventDataV1>(operationStepEventDefinition());\n\t\t\tapi.lifecycle.define<OperationCancelEventDataV1>(operationCancelEventDefinition());\n\t\t},\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-overflow-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAC7E,eAAO,MAAM,4BAA4B,YAAY,CAAC;AAEtD,wFAAwF;AACxF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAyBjG","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(\"Overflow policy requires an assistant message object\");\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-overflow-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAC7E,eAAO,MAAM,4BAA4B,YAAY,CAAC;AAEtD,wFAAwF;AACxF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAyBjG","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(t(\"Overflow policy requires an assistant message object\"));\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { isContextOverflow, isRecoverableLength } from "@agent-forge/ai/compat";
2
+ import { t } from "../i18n/index.js";
2
3
  import { loadCapabilityPluginSync } from "./capability-plugin.js";
3
4
  import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
4
5
  export const BOOTSTRAP_OVERFLOW_PLUGIN_ID = "agent-forge.bootstrap-overflow";
@@ -15,7 +16,7 @@ export function installBootstrapOverflowPolicy(runtime) {
15
16
  api.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {
16
17
  decide: (request) => {
17
18
  if (!request.message || typeof request.message !== "object") {
18
- throw new Error("Overflow policy requires an assistant message object");
19
+ throw new Error(t("Overflow policy requires an assistant message object"));
19
20
  }
20
21
  const message = request.message;
21
22
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-overflow-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,4BAA4B,GAAG,gCAAgC,CAAC;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAEtD,wFAAwF;AACxF,MAAM,UAAU,8BAA8B,CAAC,OAA0B,EAA0B;IAClG,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,4BAA4B;QAChC,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,+BAA+B;QACtC,oBAAoB,EAAE,CAAC,iBAAiB,CAAC;KACzC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,CAAC,sBAAsB,CAAC,4BAA4B,EAAE;YACxD,MAAM,EAAE,CAAC,OAA8B,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC7D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;gBACzE,CAAC;gBACD,MAAM,OAAO,GAAG,OAAO,CAAC,OAA2B,CAAC;gBACpD,OAAO;oBACN,eAAe,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;oBAClE,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC;iBACzE,CAAC;YAAA,CACF;SACD,CAAC,CAAC;IAAA,CACH,CACD,CAAC;AAAA,CACF","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(\"Overflow policy requires an assistant message object\");\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-overflow-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,4BAA4B,GAAG,gCAAgC,CAAC;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAEtD,wFAAwF;AACxF,MAAM,UAAU,8BAA8B,CAAC,OAA0B,EAA0B;IAClG,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,4BAA4B;QAChC,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,+BAA+B;QACtC,oBAAoB,EAAE,CAAC,iBAAiB,CAAC;KACzC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,CAAC,sBAAsB,CAAC,4BAA4B,EAAE;YACxD,MAAM,EAAE,CAAC,OAA8B,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC;gBAC5E,CAAC;gBACD,MAAM,OAAO,GAAG,OAAO,CAAC,OAA2B,CAAC;gBACpD,OAAO;oBACN,eAAe,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;oBAClE,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC;iBACzE,CAAC;YAAA,CACF;SACD,CAAC,CAAC;IAAA,CACH,CACD,CAAC;AAAA,CACF","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(t(\"Overflow policy requires an assistant message object\"));\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-retry-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAwB9F","sourcesContent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(\"Retry classification requires an assistant message object\");\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, enabled, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: enabled && retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-retry-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAwB9F","sourcesContent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(t(\"Retry classification requires an assistant message object\"));\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, enabled, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: enabled && retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { isRetryableAssistantError } from "@agent-forge/ai/compat";
2
+ import { t } from "../i18n/index.js";
2
3
  import { loadCapabilityPluginSync } from "./capability-plugin.js";
3
4
  import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
4
5
  export const BOOTSTRAP_RETRY_PLUGIN_ID = "agent-forge.bootstrap-retry";
@@ -15,7 +16,7 @@ export function installBootstrapRetryPolicy(runtime) {
15
16
  api.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {
16
17
  classify: ({ message }) => {
17
18
  if (!message || typeof message !== "object")
18
- throw new Error("Retry classification requires an assistant message object");
19
+ throw new Error(t("Retry classification requires an assistant message object"));
19
20
  return isRetryableAssistantError(message);
20
21
  },
21
22
  decide: ({ retryable, enabled, attempt, maxAttempts, baseDelayMs }) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-retry-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAC;AAEnD,gFAAgF;AAChF,MAAM,UAAU,2BAA2B,CAAC,OAA0B,EAA0B;IAC/F,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,yBAAyB;QAC7B,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,4BAA4B;QACnC,oBAAoB,EAAE,CAAC,cAAc,CAAC;KACtC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,CAAC,mBAAmB,CAAC,yBAAyB,EAAE;YAClD,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;gBAC1B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;oBAC1C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;gBAC9E,OAAO,yBAAyB,CAAC,OAA0D,CAAC,CAAC;YAAA,CAC7F;YACD,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;gBACvE,KAAK,EAAE,OAAO,IAAI,SAAS,IAAI,OAAO,IAAI,WAAW;gBACrD,OAAO,EAAE,WAAW,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;aACpD,CAAC;SACF,CAAC,CAAC;IAAA,CACH,CACD,CAAC;AAAA,CACF","sourcesContent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(\"Retry classification requires an assistant message object\");\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, enabled, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: enabled && retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-retry-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AAAA,OAAO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ent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(t(\"Retry classification requires an assistant message object\"));\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, enabled, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: enabled && retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-skills.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAwB,MAAM,iBAAiB,CAAC;AAEvG,eAAO,MAAM,0BAA0B,iCAAiC,CAAC;AACzE,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AACjE,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AA6CD,wEAAwE;AACxE,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,GAAE,sBAA2B,GAClC,sBAAsB,CAsExB;AAED,uFAAuF;AACvF,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAIf","sourcesContent":["import type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(\"SkillDefinitionV1 validation failed\");\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(\"SkillDefinitionV1 validation failed\");\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(\"Bootstrap skills plugin is already installed\");\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name)) throw new Error(`Skill conflicts in contribution point: ${skill.name}`);\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(`Skill conflicts in contribution point: ${definition.name}`);\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(\"Bootstrap skills plugin is not installed\");\n\tawait controller.refresh(skills);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-skills.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAwB,MAAM,iBAAiB,CAAC;AAEvG,eAAO,MAAM,0BAA0B,iCAAiC,CAAC;AACzE,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AACjE,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AA6CD,wEAAwE;AACxE,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,GAAE,sBAA2B,GAClC,sBAAsB,CAuExB;AAED,uFAAuF;AACvF,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAIf","sourcesContent":["import { t } from \"../i18n/index.ts\";\nimport type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(t(\"SkillDefinitionV1 validation failed\"));\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(t(\"SkillDefinitionV1 validation failed\"));\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(t(\"Bootstrap skills plugin is already installed\"));\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name))\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: skill.name }));\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: definition.name }));\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(t(\"Bootstrap skills plugin is not installed\"));\n\tawait controller.refresh(skills);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { t } from "../i18n/index.js";
1
2
  import { loadCapabilityPluginSync } from "./capability-plugin.js";
2
3
  import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
3
4
  export const BOOTSTRAP_SKILLS_PLUGIN_ID = "agent-forge.bootstrap-skills";
@@ -15,7 +16,7 @@ function toSkillDefinition(skill) {
15
16
  }
16
17
  function validateSkillDefinition(value) {
17
18
  if (!value || typeof value !== "object")
18
- throw new Error("SkillDefinitionV1 validation failed");
19
+ throw new Error(t("SkillDefinitionV1 validation failed"));
19
20
  const candidate = value;
20
21
  if (typeof candidate.name !== "string" ||
21
22
  !candidate.name.trim() ||
@@ -26,7 +27,7 @@ function validateSkillDefinition(value) {
26
27
  typeof candidate.baseDir !== "string" ||
27
28
  !candidate.baseDir ||
28
29
  (candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== "boolean")) {
29
- throw new Error("SkillDefinitionV1 validation failed");
30
+ throw new Error(t("SkillDefinitionV1 validation failed"));
30
31
  }
31
32
  return {
32
33
  name: candidate.name,
@@ -42,7 +43,7 @@ function validateSkillDefinition(value) {
42
43
  export function installSessionBootstrapSkills(runtime, skills, options = {}) {
43
44
  const existing = controllers.get(runtime);
44
45
  if (existing) {
45
- throw new Error("Bootstrap skills plugin is already installed");
46
+ throw new Error(t("Bootstrap skills plugin is already installed"));
46
47
  }
47
48
  let controller;
48
49
  const handle = loadCapabilityPluginSync(runtime, {
@@ -66,7 +67,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
66
67
  const seen = new Set();
67
68
  for (const skill of nextSkills) {
68
69
  if (seen.has(skill.name))
69
- throw new Error(`Skill conflicts in contribution point: ${skill.name}`);
70
+ throw new Error(t("Skill conflicts in contribution point: {name}", { name: skill.name }));
70
71
  seen.add(skill.name);
71
72
  }
72
73
  };
@@ -75,7 +76,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
75
76
  const definition = toSkillDefinition(skill);
76
77
  validateSkillDefinition(definition);
77
78
  if (point.list().some((entry) => entry.value.name === definition.name)) {
78
- throw new Error(`Skill conflicts in contribution point: ${definition.name}`);
79
+ throw new Error(t("Skill conflicts in contribution point: {name}", { name: definition.name }));
79
80
  }
80
81
  // ContributionPoint.add commits its validated entry before awaiting
81
82
  // observer delivery, so the host can consume a complete snapshot during
@@ -113,7 +114,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
113
114
  export async function refreshSessionBootstrapSkills(runtime, skills) {
114
115
  const controller = controllers.get(runtime);
115
116
  if (!controller)
116
- throw new Error("Bootstrap skills plugin is not installed");
117
+ throw new Error(t("Bootstrap skills plugin is not installed"));
117
118
  await controller.refresh(skills);
118
119
  }
119
120
  //# sourceMappingURL=bootstrap-skills.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-skills.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAuC,MAAM,iBAAiB,CAAC;AAEvG,MAAM,CAAC,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AACjE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAWlD,MAAM,WAAW,GAAG,IAAI,OAAO,EAAgD,CAAC;AAEhF,SAAS,iBAAiB,CAAC,KAAY,EAAmB;IACzD,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;KACpD,CAAC;AAAA,CACF;AAED,SAAS,uBAAuB,CAAC,KAAc,EAAmB;IACjE,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,MAAM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C7B,CAAC;QAAA,CACD;KACD,CAAC;AAAA,CACF;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,OAA0B,EAC1B,MAAwB,EACR;IAChB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC7E,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAAA,CACjC","sourcesContent":["import type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(\"SkillDefinitionV1 validation failed\");\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(\"SkillDefinitionV1 validation failed\");\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(\"Bootstrap skills plugin is already installed\");\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name)) throw new Error(`Skill conflicts in contribution point: ${skill.name}`);\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(`Skill conflicts in contribution point: ${definition.name}`);\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(\"Bootstrap skills plugin is not installed\");\n\tawait controller.refresh(skills);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-skills.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAErC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAuC,MAAM,iBAAiB,CAAC;AAEvG,MAAM,CAAC,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AACzE,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AACjE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAWlD,MAAM,WAAW,GAAG,IAAI,OAAO,EAAgD,CAAC;AAEhF,SAAS,iBAAiB,CAAC,KAAY,EAAmB;IACzD,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;KACpD,CAAC;AAAA,CACF;AAED,SAAS,uBAAuB,CAAC,KAAc,EAAmB;IACjE,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC;IACnG,MAAM,SAAS,GAAG,KAAiC,CAAC;IACpD,IACC,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;QAClC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC,WAAW,KAAK,QAAQ;QACzC,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,EAA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AAU,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAChF,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAAA,CACjC","sourcesContent":["import { t } from \"../i18n/index.ts\";\nimport type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(t(\"SkillDefinitionV1 validation failed\"));\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(t(\"SkillDefinitionV1 validation failed\"));\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(t(\"Bootstrap skills plugin is already installed\"));\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name))\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: skill.name }));\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: definition.name }));\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(t(\"Bootstrap skills plugin is not installed\"));\n\tawait controller.refresh(skills);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-tools.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAA2D,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IAC1E,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAkBD,mFAAmF;AACnF,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,SAAS,cAAc,EAAE,EACtC,OAAO,GAAE,qBAA0B,GACjC,sBAAsB,CAcxB;AAED,uGAAuG;AACvG,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,4BAAiC,EAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAC3C,sBAAsB,CAGxB","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(\"Readonly mode does not allow base tool overrides\");\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-tools.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAA2D,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IAC1E,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAkBD,mFAAmF;AACnF,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,SAAS,cAAc,EAAE,EACtC,OAAO,GAAE,qBAA0B,GACjC,sBAAsB,CAcxB;AAED,uGAAuG;AACvG,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,4BAAiC,EAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAC3C,sBAAsB,CAGxB","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { t } from \"../i18n/index.ts\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(t(\"Readonly mode does not allow base tool overrides\"));\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { t } from "../i18n/index.js";
1
2
  import { createAllToolDefinitions, createReadOnlyToolDefinitions } from "../tools/index.js";
2
3
  import { createToolDefinitionFromAgentTool } from "../tools/tool-definition-wrapper.js";
3
4
  import { loadCapabilityPluginSync } from "./capability-plugin.js";
@@ -10,7 +11,7 @@ function resolveSessionToolDefinitions(cwd, options, baseToolsOverride) {
10
11
  : Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));
11
12
  }
12
13
  if (options.mode === "readonly") {
13
- throw new Error("Readonly mode does not allow base tool overrides");
14
+ throw new Error(t("Readonly mode does not allow base tool overrides"));
14
15
  }
15
16
  return Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-tools.js","sourceRoot":"","sources":["../../../src/core/extensions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A+B;QAC3C,KAAK,EAAE,4BAA4B;QACnC,oBAAoB,EAAE,CAAC,OAAO,CAAC;KAC/B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,KAAK,MAAM,UAAU,IAAI,WAAW;YAAE,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAAA,CACnE,CACD,CAAC;AAAA,CACF;AAED,uGAAuG;AACvG,MAAM,UAAU,4BAA4B,CAC3C,OAA0B,EAC1B,GAAW,EACX,OAAO,GAAiC,EAAE,EAC1C,iBAA6C,EACpB;IACzB,MAAM,WAAW,GAAG,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACnF,OAAO,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAAA,CAC5D","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(\"Readonly mode does not allow base tool overrides\");\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
1
+ {"version":3,"file":"bootstrap-tools.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAqB,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CA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CAAC,CAAC;IAAA,CACnE,CACD,CAAC;AAAA,CACF;AAED,uGAAuG;AACvG,MAAM,UAAU,4BAA4B,CAC3C,OAA0B,EAC1B,GAAW,EACX,OAAO,GAAiC,EAAE,EAC1C,iBAA6C,EACpB;IACzB,MAAM,WAAW,GAAG,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACnF,OAAO,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAAA,CAC5D","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { t } from \"../i18n/index.ts\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(t(\"Readonly mode does not allow base tool overrides\"));\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"capability-plugin.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/capability-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,KAAK,uBAAuB,EAE5B,KAAK,2BAA2B,EAGhC,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAInF,YAAY,EACX,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAA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E,GAClD,OAAO,CAAC,sBAAsB,CAAC,CAsDjC","sourcesContent":["import type { Dirent } from \"node:fs\";\nimport { lstatSync, readdirSync, realpathSync, statSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport {\n\ttype CapabilityPluginFactory,\n\ttype CapabilityPluginInstance,\n\ttype CapabilityPluginSyncFactory,\n\ttype CapabilityPluginSyncInstance,\n\tparseCapabilityPluginManifest,\n} from \"@agent-forge/plugin-sdk\";\n// Type-only: the runtime dependency stays deferred until the first plugin\n// load (getCreateJiti below).\nimport type { createJiti } from \"jiti/static\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport {\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n} from \"./lifecycle-catalog.ts\";\nimport type { CapabilityAPI, PluginConfig, PluginManifest } from \"./public-api.ts\";\n\n// Authoring-surface symbols moved to @agent-forge/plugin-sdk (D-075 S2);\n// re-exported here so existing host imports keep resolving.\nexport type {\n\tCapabilityPluginFactory,\n\tCapabilityPluginFactoryResult,\n\tCapabilityPluginInstance,\n\tCapabilityPluginSyncFactory,\n\tCapabilityPluginSyncInstance,\n} from \"@agent-forge/plugin-sdk\";\nexport { parseCapabilityPluginManifest } from \"@agent-forge/plugin-sdk\";\n\nexport interface CapabilityPluginHandle {\n\treadonly manifest: PluginManifest;\n\treadonly api: CapabilityAPI;\n\t/** Resolves once the plugin.ready lifecycle delivery has settled. */\n\treadonly ready: Promise<void>;\n\tdispose(): Promise<void>;\n}\n\nconst activePlugins = new WeakMap<CapabilityRuntime, Map<string, symbol>>();\n\n// Upstream pi 40c256ccc parity: importing this module sits on every startup\n// path, so the jiti transform pipeline (Babel included) and the bundled\n// virtual modules stay deferred until the first plugin actually loads. The\n// dynamic imports below are deliberate lazy-load points; the thin\n// jiti-static-loader entry keeps jiti/static statically reachable for the\n// Bun and Node bundlers that must embed it.\nlet createJitiPromise: Promise<typeof createJiti> | undefined;\n\nfunction getCreateJiti(): Promise<typeof createJiti> {\n\tcreateJitiPromise ??= import(\"./jiti-static-loader.ts\").then((module) => module.createJiti);\n\treturn createJitiPromise;\n}\n\nlet virtualModulesPromise: Promise<Record<string, unknown>> | undefined;\n\nfunction getVirtualModules(): Promise<Record<string, unknown>> {\n\tvirtualModulesPromise ??= import(\"./virtual-modules.ts\").then((module) => module.VIRTUAL_MODULES);\n\treturn virtualModulesPromise;\n}\n\n// Host-resolved heavy-dependency aliases (D-075 S4 fourth batch, installed-\n// code-loading): the memory plugin package carries its vector stack pinned in\n// its own package.json, but an npm-installed tarball ships no node_modules —\n// the same void the SDK/protocol virtual modules below fill. Unlike those,\n// lancedb/transformers are NATIVE/lazy packages the host must not bundle or\n// import here: they stay host dependencies, and each specifier is resolved\n// ONCE (module-level cache, successes only) to the host's own entry file\n// path and handed to jiti as an alias. The alias reliably intercepts only\n// STATIC imports on the entry chain of files jiti transforms — lazy\n// `await import()` calls inside an installed ESM dist bypass the transform\n// pipeline and hit the native resolver, so those lazy paths are supplied by\n// the hostDependencyPaths absolute-path channel instead (hostDependencyPaths-\n// Config below plus the plugin-side host-module-import). Resolution failures\n// are tolerated on both channels: the alias table is a best-effort supply\n// path, and heavy-dependency failures must surface at the plugin's point of\n// use, where the memory plugin reports structured failures with an action\n// list.\nconst hostHeavyDependencyAliases: ReadonlySet<string> = new Set([\n\t\"@lancedb/lancedb\",\n\t\"@huggingface/transformers\",\n\t// memory 的 onnxruntime 预检(nativeBinaryCheck)在插件内直接 resolve 该传递\n\t// 依赖;安装店副本无 node_modules,必须与 transformers 同走宿主 alias 通道。\n\t\"onnxruntime-node\",\n]);\n\nconst resolvedHeavyDependencyAliases: Map<string, string> = new Map();\n\n/**\n * Explicit injection object for {@link buildHostDependencyAliases}. Both fields\n * are required on purpose: with optional positional parameters a test could\n * inject only `resolve` and silently write its fake results into the\n * module-level production cache (`resolvedHeavyDependencyAliases`), hijacking\n * every later real plugin load in the same vitest worker. Making the object\n * mandatory means a test cannot supply a resolver without also supplying the\n * cache it pollutes.\n */\nexport interface HostDependencyAliasResolution {\n\treadonly resolve: (specifier: string) => string;\n\treadonly cache: Map<string, string>;\n}\n\nconst defaultHostDependencyAliasResolution: HostDependencyAliasResolution = {\n\tresolve: (specifier) => createRequire(import.meta.url).resolve(specifier),\n\tcache: resolvedHeavyDependencyAliases,\n};\n\n/**\n * Tolerant heavy-dependency resolution shared by the jiti alias channel and\n * the hostDependencyPaths config channel: each specifier is resolved against\n * the host installation (successes cached module-level), and a specifier that\n * fails to resolve is simply absent from the result. The alias table is a\n * best-effort supply path — heavy-dependency failures must surface at the\n * plugin's point of use, where the memory plugin reports structured failures\n * with an action list. Exported for deterministic tests; production callers\n * pass {@link defaultHostDependencyAliasResolution} explicitly.\n */\nexport function buildHostDependencyAliases(\n\tspecifiers: ReadonlySet<string> | readonly string[],\n\tresolution: HostDependencyAliasResolution,\n): Record<string, string> {\n\tconst aliases: Record<string, string> = {};\n\tfor (const specifier of specifiers) {\n\t\tconst cached = resolution.cache.get(specifier);\n\t\tif (cached !== undefined) {\n\t\t\taliases[specifier] = cached;\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst resolved = resolution.resolve(specifier);\n\t\t\tresolution.cache.set(specifier, resolved);\n\t\t\taliases[specifier] = resolved;\n\t\t} catch {\n\t\t\t// Tolerant by contract: absent entry = plugin-side fallback.\n\t\t}\n\t}\n\treturn aliases;\n}\n\n/**\n * Host-resolved heavy-dependency entry paths (specifier → absolute path) for\n * the config channel that feeds the lazy `await import()` paths the jiti\n * alias channel cannot reach (installed ESM dists bypass the transform\n * pipeline). Tolerant like the alias table: a specifier the host installation\n * cannot resolve is simply absent, and plugin code falls back to its own\n * resolution (or reports the structured failure). camelCase keys keep the\n * JSON config channel idiomatic for plugin consumers.\n */\nfunction hostDependencyPathsConfig(): Record<string, string> {\n\tconst paths: Record<string, string> = {};\n\tfor (const [specifier, entryPath] of Object.entries(\n\t\tbuildHostDependencyAliases(hostHeavyDependencyAliases, defaultHostDependencyAliasResolution),\n\t)) {\n\t\tpaths[camelCaseDependencyKey(specifier)] = entryPath;\n\t}\n\treturn paths;\n}\n\nfunction camelCaseDependencyKey(specifier: string): string {\n\tconst scoped = specifier.replace(/^@[^/]+\\//, \"\");\n\treturn scoped.replace(/[-.](.)/g, (_, character: string) => character.toUpperCase());\n}\n\nfunction isPluginInstance(value: unknown): value is CapabilityPluginInstance {\n\treturn typeof value === \"object\" && value !== null && typeof (value as { dispose?: unknown }).dispose === \"function\";\n}\n\nfunction normalizePluginInstance(value: unknown, manifest: PluginManifest): CapabilityPluginInstance | undefined {\n\tif (value === undefined) return undefined;\n\tif (!isPluginInstance(value)) {\n\t\tthrow new Error(`Capability plugin factory must return void or an instance with dispose(): ${manifest.id}`);\n\t}\n\treturn value;\n}\n\nfunction normalizePluginSyncInstance(\n\tvalue: unknown,\n\tmanifest: PluginManifest,\n): CapabilityPluginSyncInstance | undefined {\n\tif (value === undefined) return undefined;\n\tif (!isPluginInstance(value)) {\n\t\tthrow new Error(\n\t\t\t`Synchronous capability plugin factory must return void or an instance with dispose(): ${manifest.id}`,\n\t\t);\n\t}\n\treturn value as CapabilityPluginSyncInstance;\n}\n\nfunction throwCleanupErrors(errors: unknown[], manifestId: string): void {\n\tif (errors.length === 0) return;\n\tif (errors.length === 1) throw errors[0];\n\tthrow new AggregateError(errors, `Capability plugin cleanup failed: ${manifestId}`);\n}\n\nasync function dispatchPluginDisposeEvent(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tstatus: PluginDisposeEventDataV1[\"status\"],\n): Promise<void> {\n\tif (!runtime.hasLifecycleEvent(PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION)) return;\n\tawait runtime.dispatchLifecycle({\n\t\ttype: PLUGIN_DISPOSE_EVENT_ID,\n\t\tversion: PLUGIN_DISPOSE_EVENT_VERSION,\n\t\tphase: \"committed\",\n\t\tdata: {\n\t\t\tversion: 1,\n\t\t\tpluginId: manifest.id,\n\t\t\tpluginVersion: manifest.version,\n\t\t\tstatus,\n\t\t},\n\t\tsource: \"capability-plugin\",\n\t});\n}\n\nasync function dispatchPluginReadyEvent(runtime: CapabilityRuntime, manifest: PluginManifest): Promise<void> {\n\tif (!runtime.hasLifecycleEvent(PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION)) return;\n\tawait runtime.dispatchLifecycle({\n\t\ttype: PLUGIN_READY_EVENT_ID,\n\t\tversion: PLUGIN_READY_EVENT_VERSION,\n\t\tphase: \"committed\",\n\t\tdata: {\n\t\t\tversion: 1,\n\t\t\tpluginId: manifest.id,\n\t\t\tpluginVersion: manifest.version,\n\t\t},\n\t\tsource: \"capability-plugin\",\n\t});\n}\n\nfunction isMissingPathError(error: unknown): boolean {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n\nfunction compareNames(left: string, right: string): number {\n\treturn left < right ? -1 : left > right ? 1 : 0;\n}\n\n/**\n * Find installed capability manifests below the given plugin directories.\n *\n * Directories are visited in caller order; entries in each directory use a\n * stable lexical order. Missing roots are normal for a first-run host.\n * Existing unreadable or malformed filesystem paths fail explicitly rather\n * than silently changing the loaded plugin set. Dependency and hidden\n * directories are never traversed.\n */\nexport function discoverCapabilityPluginManifests(pluginDirectories: readonly string[]): string[] {\n\tconst manifests: string[] = [];\n\tconst seenDirectories = new Set<string>();\n\tconst seenManifests = new Set<string>();\n\n\tconst visit = (directory: string, optional: boolean): void => {\n\t\tconst resolvedDirectory = path.resolve(directory);\n\t\tlet stats: ReturnType<typeof statSync>;\n\t\ttry {\n\t\t\tstats = statSync(resolvedDirectory);\n\t\t} catch (error) {\n\t\t\tif (optional && isMissingPathError(error)) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!lstatSync(resolvedDirectory).isSymbolicLink()) return;\n\t\t\t\t} catch (linkError) {\n\t\t\t\t\tif (isMissingPathError(linkError)) return;\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Failed to inspect capability plugin directory ${resolvedDirectory}: ${\n\t\t\t\t\t\t\tlinkError instanceof Error ? linkError.message : String(linkError)\n\t\t\t\t\t\t}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to inspect capability plugin directory ${resolvedDirectory}: ${\n\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t}`,\n\t\t\t);\n\t\t}\n\t\tif (!stats.isDirectory()) {\n\t\t\tthrow new Error(`Capability plugin path must be a directory: ${resolvedDirectory}`);\n\t\t}\n\n\t\tlet canonicalDirectory: string;\n\t\ttry {\n\t\t\tcanonicalDirectory = realpathSync(resolvedDirectory);\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to resolve capability plugin directory ${resolvedDirectory}: ${\n\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t}`,\n\t\t\t);\n\t\t}\n\t\tif (seenDirectories.has(canonicalDirectory)) return;\n\t\tseenDirectories.add(canonicalDirectory);\n\n\t\tlet entries: Dirent<string>[];\n\t\ttry {\n\t\t\tentries = readdirSync(resolvedDirectory, { withFileTypes: true, encoding: \"utf8\" });\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to read capability plugin directory ${resolvedDirectory}: ${\n\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t}`,\n\t\t\t);\n\t\t}\n\n\t\tfor (const entry of entries.sort((left, right) => compareNames(left.name, right.name))) {\n\t\t\tif (entry.name === \"node_modules\" || entry.name.startsWith(\".\")) continue;\n\t\t\tconst entryPath = path.join(resolvedDirectory, entry.name);\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tvisit(entryPath, false);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!entry.isFile() || entry.name !== \"plugin.json\") continue;\n\n\t\t\tlet canonicalManifest: string;\n\t\t\ttry {\n\t\t\t\tcanonicalManifest = realpathSync(entryPath);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to resolve capability plugin manifest ${entryPath}: ${\n\t\t\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t\t\t}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (seenManifests.has(canonicalManifest)) continue;\n\t\t\tseenManifests.add(canonicalManifest);\n\t\t\tmanifests.push(canonicalManifest);\n\t\t}\n\t};\n\n\tfor (const pluginDirectory of pluginDirectories) visit(pluginDirectory, true);\n\treturn manifests;\n}\n\n/**\n * Load a capability plugin through the public facade only.\n * Filesystem discovery and package installation stay outside this mechanism.\n */\nexport async function loadCapabilityPlugin(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tfactory: CapabilityPluginFactory,\n): Promise<CapabilityPluginHandle> {\n\tconst active = activePlugins.get(runtime) ?? new Map<string, symbol>();\n\tif (active.has(manifest.id)) throw new Error(`Capability plugin is already loaded: ${manifest.id}`);\n\tconst ownerToken = Symbol(manifest.id);\n\tactive.set(manifest.id, ownerToken);\n\tactivePlugins.set(runtime, active);\n\tlet api: CapabilityAPI | undefined;\n\tlet instance: CapabilityPluginInstance | undefined;\n\tconst cleanup = async (notifyDispose: boolean): Promise<void> => {\n\t\tconst errors: unknown[] = [];\n\t\tif (api) runtime.revokeAPI(api);\n\t\ttry {\n\t\t\tawait runtime.disposePlugin(manifest.id);\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\ttry {\n\t\t\tawait instance?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tif (notifyDispose) {\n\t\t\ttry {\n\t\t\t\tawait dispatchPluginDisposeEvent(runtime, manifest, errors.length === 0 ? \"disposed\" : \"failed\");\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\t\tthrowCleanupErrors(errors, manifest.id);\n\t};\n\ttry {\n\t\tapi = runtime.createAPI(manifest);\n\t\tinstance = normalizePluginInstance(await factory(api), manifest);\n\t\tawait dispatchPluginReadyEvent(runtime, manifest);\n\t\tconst pluginApi = api;\n\t\tlet disposePromise: Promise<void> | undefined;\n\t\treturn {\n\t\t\tmanifest,\n\t\t\tapi: pluginApi,\n\t\t\tready: Promise.resolve(),\n\t\t\tdispose: async () => {\n\t\t\t\tdisposePromise ??= (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait cleanup(true);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\treturn disposePromise;\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\ttry {\n\t\t\tawait cleanup(false);\n\t\t} catch (cleanupError) {\n\t\t\tthrow new AggregateError([error, cleanupError], `Capability plugin startup cleanup failed: ${manifest.id}`);\n\t\t} finally {\n\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/** Load a synchronous embedded plugin during host construction. */\nexport function loadCapabilityPluginSync(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tfactory: CapabilityPluginSyncFactory,\n): CapabilityPluginHandle {\n\tconst active = activePlugins.get(runtime) ?? new Map<string, symbol>();\n\tif (active.has(manifest.id)) throw new Error(`Capability plugin is already loaded: ${manifest.id}`);\n\tconst ownerToken = Symbol(manifest.id);\n\tactive.set(manifest.id, ownerToken);\n\tactivePlugins.set(runtime, active);\n\tlet api: CapabilityAPI | undefined;\n\tlet instance: CapabilityPluginSyncInstance | undefined;\n\tconst cleanupRegistrationsSync = (): unknown[] => {\n\t\tconst errors: unknown[] = [];\n\t\tif (api) runtime.revokeAPI(api);\n\t\ttry {\n\t\t\truntime.disposePluginSync(manifest.id);\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\treturn errors;\n\t};\n\tconst cleanupSync = async (): Promise<void> => {\n\t\tconst errors = cleanupRegistrationsSync();\n\t\tlet result: unknown;\n\t\ttry {\n\t\t\tresult = instance?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tif (result && typeof (result as PromiseLike<void>).then === \"function\") {\n\t\t\tconst contractError = new Error(\n\t\t\t\t`Synchronous capability plugin disposer must not return a Promise: ${manifest.id}`,\n\t\t\t);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t\terrors.push(contractError);\n\t\t}\n\t\ttry {\n\t\t\tawait dispatchPluginDisposeEvent(runtime, manifest, errors.length === 0 ? \"disposed\" : \"failed\");\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tthrowCleanupErrors(errors, manifest.id);\n\t};\n\ttry {\n\t\tapi = runtime.createAPI(manifest);\n\t\tinstance = normalizePluginSyncInstance(factory(api), manifest);\n\t} catch (error) {\n\t\ttry {\n\t\t\tthrowCleanupErrors(cleanupRegistrationsSync(), manifest.id);\n\t\t} catch (cleanupError) {\n\t\t\tthrow new AggregateError([error, cleanupError], `Capability plugin startup cleanup failed: ${manifest.id}`);\n\t\t} finally {\n\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t}\n\t\tthrow error;\n\t}\n\tconst ready = dispatchPluginReadyEvent(runtime, manifest);\n\t// The embedded constructor API is synchronous; retain a handled promise so\n\t// hosts may explicitly await lifecycle delivery without risking an unhandled rejection.\n\tvoid ready.catch(() => undefined);\n\tlet disposePromise: Promise<void> | undefined;\n\treturn {\n\t\tmanifest,\n\t\tapi: api!,\n\t\tready,\n\t\tdispose: async () => {\n\t\t\tdisposePromise ??= (async () => {\n\t\t\t\tlet readyError: unknown;\n\t\t\t\ttry {\n\t\t\t\t\tawait ready;\n\t\t\t\t} catch (error) {\n\t\t\t\t\treadyError = error;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait cleanupSync();\n\t\t\t\t\tif (readyError !== undefined) throw readyError;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (readyError !== undefined && error !== readyError) {\n\t\t\t\t\t\tthrow new AggregateError([readyError, error], `Capability plugin cleanup failed: ${manifest.id}`);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t\t\t}\n\t\t\t})();\n\t\t\treturn disposePromise;\n\t\t},\n\t};\n}\n\n/**\n * Load a plugin from its JSON manifest. This is intentionally separate from\n * legacy extension discovery until both systems share the same public facade.\n *\n * `options.configOverride` (D-075 S4 third batch) merges host-declared values\n * over the manifest's own `config` defaults before the plugin API is built —\n * a public channel (first-party and third-party plugins alike) for hosts that\n * vouch for facts the manifest cannot know, e.g. the CLI declaring its own\n * process entry trustworthy so the subagent-delegate package auto-pools. It\n * stays below any plugin-side config channel: the agent-dir config file the\n * plugin entry reads merges over whatever the host injected here.\n */\nexport async function loadCapabilityPluginFromManifest(\n\truntime: CapabilityRuntime,\n\tmanifestPath: string,\n\toptions?: { readonly configOverride?: PluginConfig },\n): Promise<CapabilityPluginHandle> {\n\tlet raw: unknown;\n\ttry {\n\t\traw = JSON.parse(await readFile(manifestPath, \"utf8\"));\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to read capability plugin manifest ${manifestPath}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t}\n\tconst parsed = parseCapabilityPluginManifest(raw, manifestPath);\n\t// hostDependencyPaths (安装店重依赖可见性): 宿主已解析的重依赖入口绝对路径\n\t// 并进 manifest config——安装店副本无 node_modules, 插件内 createRequire 自\n\t// 解析不可达 (memory 的 onnxruntime native 预检实证); 与 jiti alias 通道互补\n\t// (alias 拦截 import, 本通道喂插件内的路径式消费)。公共同道: 第一方与第三方\n\t// 插件同样可读。仍低于插件侧 config 文件通道 (agent-dir 配置合并在其上)。\n\tconst hostDependencyOverride = { hostDependencyPaths: hostDependencyPathsConfig() };\n\tconst callerOverride = options?.configOverride;\n\tconst manifest =\n\t\tcallerOverride === undefined || Object.keys(callerOverride).length === 0\n\t\t\t? { ...parsed, config: { ...parsed.config, ...hostDependencyOverride } }\n\t\t\t: { ...parsed, config: { ...parsed.config, ...hostDependencyOverride, ...callerOverride } };\n\tconst entryPath = path.resolve(path.dirname(manifestPath), manifest.entry);\n\t// Host-resolved authoring dependencies (D-075 §4.1): installed plugin\n\t// packages live in the install store, which carries no node_modules (npm\n\t// tarballs never include dependencies), so their bare imports of the SDK\n\t// and the pinned typebox dependency resolve against the host's own copies\n\t// through jiti virtual modules (./virtual-modules.ts, lazy). Works\n\t// identically in the bundle and Bun binaries where no source-tree\n\t// node_modules exists at all. D-075 S4 third batch: the protocol package\n\t// joins — the subagent-delegate package's runtime imports\n\t// (`@agent-forge/protocol`) resolve the same way. S4 fourth batch: the\n\t// memory package's native vector stack (`@lancedb/lancedb`,\n\t// `@huggingface/transformers`) resolves through the jiti alias channel\n\t// instead — those stay real host node_modules entries, so plugins load the\n\t// host's native builds rather than a virtual copy.\n\tconst [createJitiImpl, virtualModules] = await Promise.all([getCreateJiti(), getVirtualModules()]);\n\tconst jiti = createJitiImpl(import.meta.url, {\n\t\tmoduleCache: false,\n\t\ttsconfigPaths: true,\n\t\talias: buildHostDependencyAliases(hostHeavyDependencyAliases, defaultHostDependencyAliasResolution),\n\t\tvirtualModules,\n\t});\n\tlet factory: unknown;\n\ttry {\n\t\tfactory = await jiti.import(entryPath, { default: true });\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to import capability plugin entry ${entryPath}: ${error instanceof Error ? error.message : String(error)}`,\n\t\t);\n\t}\n\tif (typeof factory !== \"function\") {\n\t\tthrow new Error(`Capability plugin entry must default-export a factory function: ${entryPath}`);\n\t}\n\treturn loadCapabilityPlugin(runtime, manifest, factory as CapabilityPluginFactory);\n}\n"]}
1
+ {"version":3,"file":"capability-plugin.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/capability-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,KAAK,uBAAuB,EAE5B,KAAK,2BAA2B,EAGhC,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAInF,YAAY,EACX,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAmDD;;;;;;;;GAQG;AACH,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAOD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACzC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,MAAM,EAAE,EACnD,UAAU,EAAE,6BAA6B,GACvC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBxB;AAwGD;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CA2FhG;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC,sBAAsB,CAAC,CA6DjC;AAED,mEAAmE;AACnE,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,2BAA2B,GAClC,sBAAsB,CAyFxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,YAAY,CAAA;CAAE,GAClD,OAAO,CAAC,sBAAsB,CAAC,CA4DjC","sourcesContent":["import type { Dirent } from \"node:fs\";\nimport { lstatSync, readdirSync, realpathSync, statSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport * as path from \"node:path\";\nimport {\n\ttype CapabilityPluginFactory,\n\ttype CapabilityPluginInstance,\n\ttype CapabilityPluginSyncFactory,\n\ttype CapabilityPluginSyncInstance,\n\tparseCapabilityPluginManifest,\n} from \"@agent-forge/plugin-sdk\";\n// Type-only: the runtime dependency stays deferred until the first plugin\n// load (getCreateJiti below).\nimport type { createJiti } from \"jiti/static\";\nimport { t } from \"../i18n/index.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport {\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n} from \"./lifecycle-catalog.ts\";\nimport type { CapabilityAPI, PluginConfig, PluginManifest } from \"./public-api.ts\";\n\n// Authoring-surface symbols moved to @agent-forge/plugin-sdk (D-075 S2);\n// re-exported here so existing host imports keep resolving.\nexport type {\n\tCapabilityPluginFactory,\n\tCapabilityPluginFactoryResult,\n\tCapabilityPluginInstance,\n\tCapabilityPluginSyncFactory,\n\tCapabilityPluginSyncInstance,\n} from \"@agent-forge/plugin-sdk\";\nexport { parseCapabilityPluginManifest } from \"@agent-forge/plugin-sdk\";\n\nexport interface CapabilityPluginHandle {\n\treadonly manifest: PluginManifest;\n\treadonly api: CapabilityAPI;\n\t/** Resolves once the plugin.ready lifecycle delivery has settled. */\n\treadonly ready: Promise<void>;\n\tdispose(): Promise<void>;\n}\n\nconst activePlugins = new WeakMap<CapabilityRuntime, Map<string, symbol>>();\n\n// Upstream pi 40c256ccc parity: importing this module sits on every startup\n// path, so the jiti transform pipeline (Babel included) and the bundled\n// virtual modules stay deferred until the first plugin actually loads. The\n// dynamic imports below are deliberate lazy-load points; the thin\n// jiti-static-loader entry keeps jiti/static statically reachable for the\n// Bun and Node bundlers that must embed it.\nlet createJitiPromise: Promise<typeof createJiti> | undefined;\n\nfunction getCreateJiti(): Promise<typeof createJiti> {\n\tcreateJitiPromise ??= import(\"./jiti-static-loader.ts\").then((module) => module.createJiti);\n\treturn createJitiPromise;\n}\n\nlet virtualModulesPromise: Promise<Record<string, unknown>> | undefined;\n\nfunction getVirtualModules(): Promise<Record<string, unknown>> {\n\tvirtualModulesPromise ??= import(\"./virtual-modules.ts\").then((module) => module.VIRTUAL_MODULES);\n\treturn virtualModulesPromise;\n}\n\n// Host-resolved heavy-dependency aliases (D-075 S4 fourth batch, installed-\n// code-loading): the memory plugin package carries its vector stack pinned in\n// its own package.json, but an npm-installed tarball ships no node_modules —\n// the same void the SDK/protocol virtual modules below fill. Unlike those,\n// lancedb/transformers are NATIVE/lazy packages the host must not bundle or\n// import here: they stay host dependencies, and each specifier is resolved\n// ONCE (module-level cache, successes only) to the host's own entry file\n// path and handed to jiti as an alias. The alias reliably intercepts only\n// STATIC imports on the entry chain of files jiti transforms — lazy\n// `await import()` calls inside an installed ESM dist bypass the transform\n// pipeline and hit the native resolver, so those lazy paths are supplied by\n// the hostDependencyPaths absolute-path channel instead (hostDependencyPaths-\n// Config below plus the plugin-side host-module-import). Resolution failures\n// are tolerated on both channels: the alias table is a best-effort supply\n// path, and heavy-dependency failures must surface at the plugin's point of\n// use, where the memory plugin reports structured failures with an action\n// list.\nconst hostHeavyDependencyAliases: ReadonlySet<string> = new Set([\n\t\"@lancedb/lancedb\",\n\t\"@huggingface/transformers\",\n\t// memory 的 onnxruntime 预检(nativeBinaryCheck)在插件内直接 resolve 该传递\n\t// 依赖;安装店副本无 node_modules,必须与 transformers 同走宿主 alias 通道。\n\t\"onnxruntime-node\",\n]);\n\nconst resolvedHeavyDependencyAliases: Map<string, string> = new Map();\n\n/**\n * Explicit injection object for {@link buildHostDependencyAliases}. Both fields\n * are required on purpose: with optional positional parameters a test could\n * inject only `resolve` and silently write its fake results into the\n * module-level production cache (`resolvedHeavyDependencyAliases`), hijacking\n * every later real plugin load in the same vitest worker. Making the object\n * mandatory means a test cannot supply a resolver without also supplying the\n * cache it pollutes.\n */\nexport interface HostDependencyAliasResolution {\n\treadonly resolve: (specifier: string) => string;\n\treadonly cache: Map<string, string>;\n}\n\nconst defaultHostDependencyAliasResolution: HostDependencyAliasResolution = {\n\tresolve: (specifier) => createRequire(import.meta.url).resolve(specifier),\n\tcache: resolvedHeavyDependencyAliases,\n};\n\n/**\n * Tolerant heavy-dependency resolution shared by the jiti alias channel and\n * the hostDependencyPaths config channel: each specifier is resolved against\n * the host installation (successes cached module-level), and a specifier that\n * fails to resolve is simply absent from the result. The alias table is a\n * best-effort supply path — heavy-dependency failures must surface at the\n * plugin's point of use, where the memory plugin reports structured failures\n * with an action list. Exported for deterministic tests; production callers\n * pass {@link defaultHostDependencyAliasResolution} explicitly.\n */\nexport function buildHostDependencyAliases(\n\tspecifiers: ReadonlySet<string> | readonly string[],\n\tresolution: HostDependencyAliasResolution,\n): Record<string, string> {\n\tconst aliases: Record<string, string> = {};\n\tfor (const specifier of specifiers) {\n\t\tconst cached = resolution.cache.get(specifier);\n\t\tif (cached !== undefined) {\n\t\t\taliases[specifier] = cached;\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst resolved = resolution.resolve(specifier);\n\t\t\tresolution.cache.set(specifier, resolved);\n\t\t\taliases[specifier] = resolved;\n\t\t} catch {\n\t\t\t// Tolerant by contract: absent entry = plugin-side fallback.\n\t\t}\n\t}\n\treturn aliases;\n}\n\n/**\n * Host-resolved heavy-dependency entry paths (specifier → absolute path) for\n * the config channel that feeds the lazy `await import()` paths the jiti\n * alias channel cannot reach (installed ESM dists bypass the transform\n * pipeline). Tolerant like the alias table: a specifier the host installation\n * cannot resolve is simply absent, and plugin code falls back to its own\n * resolution (or reports the structured failure). camelCase keys keep the\n * JSON config channel idiomatic for plugin consumers.\n */\nfunction hostDependencyPathsConfig(): Record<string, string> {\n\tconst paths: Record<string, string> = {};\n\tfor (const [specifier, entryPath] of Object.entries(\n\t\tbuildHostDependencyAliases(hostHeavyDependencyAliases, defaultHostDependencyAliasResolution),\n\t)) {\n\t\tpaths[camelCaseDependencyKey(specifier)] = entryPath;\n\t}\n\treturn paths;\n}\n\nfunction camelCaseDependencyKey(specifier: string): string {\n\tconst scoped = specifier.replace(/^@[^/]+\\//, \"\");\n\treturn scoped.replace(/[-.](.)/g, (_, character: string) => character.toUpperCase());\n}\n\nfunction isPluginInstance(value: unknown): value is CapabilityPluginInstance {\n\treturn typeof value === \"object\" && value !== null && typeof (value as { dispose?: unknown }).dispose === \"function\";\n}\n\nfunction normalizePluginInstance(value: unknown, manifest: PluginManifest): CapabilityPluginInstance | undefined {\n\tif (value === undefined) return undefined;\n\tif (!isPluginInstance(value)) {\n\t\tthrow new Error(\n\t\t\tt(\"Capability plugin factory must return void or an instance with dispose(): {id}\", { id: manifest.id }),\n\t\t);\n\t}\n\treturn value;\n}\n\nfunction normalizePluginSyncInstance(\n\tvalue: unknown,\n\tmanifest: PluginManifest,\n): CapabilityPluginSyncInstance | undefined {\n\tif (value === undefined) return undefined;\n\tif (!isPluginInstance(value)) {\n\t\tthrow new Error(\n\t\t\tt(\"Synchronous capability plugin factory must return void or an instance with dispose(): {id}\", {\n\t\t\t\tid: manifest.id,\n\t\t\t}),\n\t\t);\n\t}\n\treturn value as CapabilityPluginSyncInstance;\n}\n\nfunction throwCleanupErrors(errors: unknown[], manifestId: string): void {\n\tif (errors.length === 0) return;\n\tif (errors.length === 1) throw errors[0];\n\tthrow new AggregateError(errors, `Capability plugin cleanup failed: ${manifestId}`);\n}\n\nasync function dispatchPluginDisposeEvent(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tstatus: PluginDisposeEventDataV1[\"status\"],\n): Promise<void> {\n\tif (!runtime.hasLifecycleEvent(PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION)) return;\n\tawait runtime.dispatchLifecycle({\n\t\ttype: PLUGIN_DISPOSE_EVENT_ID,\n\t\tversion: PLUGIN_DISPOSE_EVENT_VERSION,\n\t\tphase: \"committed\",\n\t\tdata: {\n\t\t\tversion: 1,\n\t\t\tpluginId: manifest.id,\n\t\t\tpluginVersion: manifest.version,\n\t\t\tstatus,\n\t\t},\n\t\tsource: \"capability-plugin\",\n\t});\n}\n\nasync function dispatchPluginReadyEvent(runtime: CapabilityRuntime, manifest: PluginManifest): Promise<void> {\n\tif (!runtime.hasLifecycleEvent(PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION)) return;\n\tawait runtime.dispatchLifecycle({\n\t\ttype: PLUGIN_READY_EVENT_ID,\n\t\tversion: PLUGIN_READY_EVENT_VERSION,\n\t\tphase: \"committed\",\n\t\tdata: {\n\t\t\tversion: 1,\n\t\t\tpluginId: manifest.id,\n\t\t\tpluginVersion: manifest.version,\n\t\t},\n\t\tsource: \"capability-plugin\",\n\t});\n}\n\nfunction isMissingPathError(error: unknown): boolean {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"ENOENT\";\n}\n\nfunction compareNames(left: string, right: string): number {\n\treturn left < right ? -1 : left > right ? 1 : 0;\n}\n\n/**\n * Find installed capability manifests below the given plugin directories.\n *\n * Directories are visited in caller order; entries in each directory use a\n * stable lexical order. Missing roots are normal for a first-run host.\n * Existing unreadable or malformed filesystem paths fail explicitly rather\n * than silently changing the loaded plugin set. Dependency and hidden\n * directories are never traversed.\n */\nexport function discoverCapabilityPluginManifests(pluginDirectories: readonly string[]): string[] {\n\tconst manifests: string[] = [];\n\tconst seenDirectories = new Set<string>();\n\tconst seenManifests = new Set<string>();\n\n\tconst visit = (directory: string, optional: boolean): void => {\n\t\tconst resolvedDirectory = path.resolve(directory);\n\t\tlet stats: ReturnType<typeof statSync>;\n\t\ttry {\n\t\t\tstats = statSync(resolvedDirectory);\n\t\t} catch (error) {\n\t\t\tif (optional && isMissingPathError(error)) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!lstatSync(resolvedDirectory).isSymbolicLink()) return;\n\t\t\t\t} catch (linkError) {\n\t\t\t\t\tif (isMissingPathError(linkError)) return;\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\tt(\"Failed to inspect capability plugin directory {directory}: {reason}\", {\n\t\t\t\t\t\t\tdirectory: resolvedDirectory,\n\t\t\t\t\t\t\treason: linkError instanceof Error ? linkError.message : String(linkError),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\tt(\"Failed to inspect capability plugin directory {directory}: {reason}\", {\n\t\t\t\t\tdirectory: resolvedDirectory,\n\t\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tif (!stats.isDirectory()) {\n\t\t\tthrow new Error(\n\t\t\t\tt(\"Capability plugin path must be a directory: {directory}\", { directory: resolvedDirectory }),\n\t\t\t);\n\t\t}\n\n\t\tlet canonicalDirectory: string;\n\t\ttry {\n\t\t\tcanonicalDirectory = realpathSync(resolvedDirectory);\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\tt(\"Failed to resolve capability plugin directory {directory}: {reason}\", {\n\t\t\t\t\tdirectory: resolvedDirectory,\n\t\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tif (seenDirectories.has(canonicalDirectory)) return;\n\t\tseenDirectories.add(canonicalDirectory);\n\n\t\tlet entries: Dirent<string>[];\n\t\ttry {\n\t\t\tentries = readdirSync(resolvedDirectory, { withFileTypes: true, encoding: \"utf8\" });\n\t\t} catch (error) {\n\t\t\tthrow new Error(\n\t\t\t\tt(\"Failed to read capability plugin directory {directory}: {reason}\", {\n\t\t\t\t\tdirectory: resolvedDirectory,\n\t\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\n\t\tfor (const entry of entries.sort((left, right) => compareNames(left.name, right.name))) {\n\t\t\tif (entry.name === \"node_modules\" || entry.name.startsWith(\".\")) continue;\n\t\t\tconst entryPath = path.join(resolvedDirectory, entry.name);\n\t\t\tif (entry.isDirectory()) {\n\t\t\t\tvisit(entryPath, false);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!entry.isFile() || entry.name !== \"plugin.json\") continue;\n\n\t\t\tlet canonicalManifest: string;\n\t\t\ttry {\n\t\t\t\tcanonicalManifest = realpathSync(entryPath);\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\tt(\"Failed to resolve capability plugin manifest {path}: {reason}\", {\n\t\t\t\t\t\tpath: entryPath,\n\t\t\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (seenManifests.has(canonicalManifest)) continue;\n\t\t\tseenManifests.add(canonicalManifest);\n\t\t\tmanifests.push(canonicalManifest);\n\t\t}\n\t};\n\n\tfor (const pluginDirectory of pluginDirectories) visit(pluginDirectory, true);\n\treturn manifests;\n}\n\n/**\n * Load a capability plugin through the public facade only.\n * Filesystem discovery and package installation stay outside this mechanism.\n */\nexport async function loadCapabilityPlugin(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tfactory: CapabilityPluginFactory,\n): Promise<CapabilityPluginHandle> {\n\tconst active = activePlugins.get(runtime) ?? new Map<string, symbol>();\n\tif (active.has(manifest.id)) throw new Error(t(\"Capability plugin is already loaded: {id}\", { id: manifest.id }));\n\tconst ownerToken = Symbol(manifest.id);\n\tactive.set(manifest.id, ownerToken);\n\tactivePlugins.set(runtime, active);\n\tlet api: CapabilityAPI | undefined;\n\tlet instance: CapabilityPluginInstance | undefined;\n\tconst cleanup = async (notifyDispose: boolean): Promise<void> => {\n\t\tconst errors: unknown[] = [];\n\t\tif (api) runtime.revokeAPI(api);\n\t\ttry {\n\t\t\tawait runtime.disposePlugin(manifest.id);\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\ttry {\n\t\t\tawait instance?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tif (notifyDispose) {\n\t\t\ttry {\n\t\t\t\tawait dispatchPluginDisposeEvent(runtime, manifest, errors.length === 0 ? \"disposed\" : \"failed\");\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\t\tthrowCleanupErrors(errors, manifest.id);\n\t};\n\ttry {\n\t\tapi = runtime.createAPI(manifest);\n\t\tinstance = normalizePluginInstance(await factory(api), manifest);\n\t\tawait dispatchPluginReadyEvent(runtime, manifest);\n\t\tconst pluginApi = api;\n\t\tlet disposePromise: Promise<void> | undefined;\n\t\treturn {\n\t\t\tmanifest,\n\t\t\tapi: pluginApi,\n\t\t\tready: Promise.resolve(),\n\t\t\tdispose: async () => {\n\t\t\t\tdisposePromise ??= (async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait cleanup(true);\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t\treturn disposePromise;\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\ttry {\n\t\t\tawait cleanup(false);\n\t\t} catch (cleanupError) {\n\t\t\tthrow new AggregateError([error, cleanupError], `Capability plugin startup cleanup failed: ${manifest.id}`);\n\t\t} finally {\n\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/** Load a synchronous embedded plugin during host construction. */\nexport function loadCapabilityPluginSync(\n\truntime: CapabilityRuntime,\n\tmanifest: PluginManifest,\n\tfactory: CapabilityPluginSyncFactory,\n): CapabilityPluginHandle {\n\tconst active = activePlugins.get(runtime) ?? new Map<string, symbol>();\n\tif (active.has(manifest.id)) throw new Error(t(\"Capability plugin is already loaded: {id}\", { id: manifest.id }));\n\tconst ownerToken = Symbol(manifest.id);\n\tactive.set(manifest.id, ownerToken);\n\tactivePlugins.set(runtime, active);\n\tlet api: CapabilityAPI | undefined;\n\tlet instance: CapabilityPluginSyncInstance | undefined;\n\tconst cleanupRegistrationsSync = (): unknown[] => {\n\t\tconst errors: unknown[] = [];\n\t\tif (api) runtime.revokeAPI(api);\n\t\ttry {\n\t\t\truntime.disposePluginSync(manifest.id);\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\treturn errors;\n\t};\n\tconst cleanupSync = async (): Promise<void> => {\n\t\tconst errors = cleanupRegistrationsSync();\n\t\tlet result: unknown;\n\t\ttry {\n\t\t\tresult = instance?.dispose();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tif (result && typeof (result as PromiseLike<void>).then === \"function\") {\n\t\t\tconst contractError = new Error(\n\t\t\t\t`Synchronous capability plugin disposer must not return a Promise: ${manifest.id}`,\n\t\t\t);\n\t\t\ttry {\n\t\t\t\tawait result;\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t\terrors.push(contractError);\n\t\t}\n\t\ttry {\n\t\t\tawait dispatchPluginDisposeEvent(runtime, manifest, errors.length === 0 ? \"disposed\" : \"failed\");\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t\tthrowCleanupErrors(errors, manifest.id);\n\t};\n\ttry {\n\t\tapi = runtime.createAPI(manifest);\n\t\tinstance = normalizePluginSyncInstance(factory(api), manifest);\n\t} catch (error) {\n\t\ttry {\n\t\t\tthrowCleanupErrors(cleanupRegistrationsSync(), manifest.id);\n\t\t} catch (cleanupError) {\n\t\t\tthrow new AggregateError([error, cleanupError], `Capability plugin startup cleanup failed: ${manifest.id}`);\n\t\t} finally {\n\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t}\n\t\tthrow error;\n\t}\n\tconst ready = dispatchPluginReadyEvent(runtime, manifest);\n\t// The embedded constructor API is synchronous; retain a handled promise so\n\t// hosts may explicitly await lifecycle delivery without risking an unhandled rejection.\n\tvoid ready.catch(() => undefined);\n\tlet disposePromise: Promise<void> | undefined;\n\treturn {\n\t\tmanifest,\n\t\tapi: api!,\n\t\tready,\n\t\tdispose: async () => {\n\t\t\tdisposePromise ??= (async () => {\n\t\t\t\tlet readyError: unknown;\n\t\t\t\ttry {\n\t\t\t\t\tawait ready;\n\t\t\t\t} catch (error) {\n\t\t\t\t\treadyError = error;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tawait cleanupSync();\n\t\t\t\t\tif (readyError !== undefined) throw readyError;\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (readyError !== undefined && error !== readyError) {\n\t\t\t\t\t\tthrow new AggregateError([readyError, error], `Capability plugin cleanup failed: ${manifest.id}`);\n\t\t\t\t\t}\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (active.get(manifest.id) === ownerToken) active.delete(manifest.id);\n\t\t\t\t}\n\t\t\t})();\n\t\t\treturn disposePromise;\n\t\t},\n\t};\n}\n\n/**\n * Load a plugin from its JSON manifest. This is intentionally separate from\n * legacy extension discovery until both systems share the same public facade.\n *\n * `options.configOverride` (D-075 S4 third batch) merges host-declared values\n * over the manifest's own `config` defaults before the plugin API is built —\n * a public channel (first-party and third-party plugins alike) for hosts that\n * vouch for facts the manifest cannot know, e.g. the CLI declaring its own\n * process entry trustworthy so the subagent-delegate package auto-pools. It\n * stays below any plugin-side config channel: the agent-dir config file the\n * plugin entry reads merges over whatever the host injected here.\n */\nexport async function loadCapabilityPluginFromManifest(\n\truntime: CapabilityRuntime,\n\tmanifestPath: string,\n\toptions?: { readonly configOverride?: PluginConfig },\n): Promise<CapabilityPluginHandle> {\n\tlet raw: unknown;\n\ttry {\n\t\traw = JSON.parse(await readFile(manifestPath, \"utf8\"));\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\tt(\"Failed to read capability plugin manifest {path}: {reason}\", {\n\t\t\t\tpath: manifestPath,\n\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t}),\n\t\t);\n\t}\n\tconst parsed = parseCapabilityPluginManifest(raw, manifestPath);\n\t// hostDependencyPaths (安装店重依赖可见性): 宿主已解析的重依赖入口绝对路径\n\t// 并进 manifest config——安装店副本无 node_modules, 插件内 createRequire 自\n\t// 解析不可达 (memory 的 onnxruntime native 预检实证); 与 jiti alias 通道互补\n\t// (alias 拦截 import, 本通道喂插件内的路径式消费)。公共同道: 第一方与第三方\n\t// 插件同样可读。仍低于插件侧 config 文件通道 (agent-dir 配置合并在其上)。\n\tconst hostDependencyOverride = { hostDependencyPaths: hostDependencyPathsConfig() };\n\tconst callerOverride = options?.configOverride;\n\tconst manifest =\n\t\tcallerOverride === undefined || Object.keys(callerOverride).length === 0\n\t\t\t? { ...parsed, config: { ...parsed.config, ...hostDependencyOverride } }\n\t\t\t: { ...parsed, config: { ...parsed.config, ...hostDependencyOverride, ...callerOverride } };\n\tconst entryPath = path.resolve(path.dirname(manifestPath), manifest.entry);\n\t// Host-resolved authoring dependencies (D-075 §4.1): installed plugin\n\t// packages live in the install store, which carries no node_modules (npm\n\t// tarballs never include dependencies), so their bare imports of the SDK\n\t// and the pinned typebox dependency resolve against the host's own copies\n\t// through jiti virtual modules (./virtual-modules.ts, lazy). Works\n\t// identically in the bundle and Bun binaries where no source-tree\n\t// node_modules exists at all. D-075 S4 third batch: the protocol package\n\t// joins — the subagent-delegate package's runtime imports\n\t// (`@agent-forge/protocol`) resolve the same way. S4 fourth batch: the\n\t// memory package's native vector stack (`@lancedb/lancedb`,\n\t// `@huggingface/transformers`) resolves through the jiti alias channel\n\t// instead — those stay real host node_modules entries, so plugins load the\n\t// host's native builds rather than a virtual copy.\n\tconst [createJitiImpl, virtualModules] = await Promise.all([getCreateJiti(), getVirtualModules()]);\n\tconst jiti = createJitiImpl(import.meta.url, {\n\t\tmoduleCache: false,\n\t\ttsconfigPaths: true,\n\t\talias: buildHostDependencyAliases(hostHeavyDependencyAliases, defaultHostDependencyAliasResolution),\n\t\tvirtualModules,\n\t});\n\tlet factory: unknown;\n\ttry {\n\t\tfactory = await jiti.import(entryPath, { default: true });\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\tt(\"Failed to import capability plugin entry {path}: {reason}\", {\n\t\t\t\tpath: entryPath,\n\t\t\t\treason: error instanceof Error ? error.message : String(error),\n\t\t\t}),\n\t\t);\n\t}\n\tif (typeof factory !== \"function\") {\n\t\tthrow new Error(t(\"Capability plugin entry must default-export a factory function: {entryPath}\", { entryPath }));\n\t}\n\treturn loadCapabilityPlugin(runtime, manifest, factory as CapabilityPluginFactory);\n}\n"]}