@ai-agent-forge/agent-forge 0.86.4 → 0.86.5

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 (220) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/bundle/.build-manifest.json +470 -404
  3. package/dist/bundle/chunks/anthropic-messages-ALDZBUKI.js +6 -0
  4. package/dist/bundle/chunks/anthropic.js +2 -2
  5. package/dist/bundle/chunks/{azure-openai-responses-WQCZWFAH.js → azure-openai-responses-A2WJWZFB.js} +1 -1
  6. package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
  7. package/dist/bundle/chunks/chunk-A7GUOX2H.js +141 -0
  8. package/dist/bundle/chunks/{chunk-WGLBM2BP.js → chunk-CIX3FSBK.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-ZV3W36HK.js → chunk-EALJ5DDX.js} +99 -92
  10. package/dist/bundle/chunks/chunk-OO6DJ3CL.js +31 -0
  11. package/dist/bundle/chunks/{chunk-PE3XUHPT.js → chunk-SQFG22WN.js} +1 -1
  12. package/dist/bundle/chunks/{chunk-V46XUTK3.js → chunk-Y7HXTASS.js} +1 -1
  13. package/dist/bundle/chunks/{chunk-3WE3W52L.js → chunk-YJCQVXW5.js} +1 -1
  14. package/dist/bundle/chunks/github-copilot.js +1 -1
  15. package/dist/bundle/chunks/{google-generative-ai-LQ375GYC.js → google-generative-ai-NIB4WONV.js} +1 -1
  16. package/dist/bundle/chunks/{google-vertex-HXSRAKEZ.js → google-vertex-DCPYUEUO.js} +1 -1
  17. package/dist/bundle/chunks/{mistral-conversations-CSNMFR4J.js → mistral-conversations-OC6LA5XL.js} +1 -1
  18. package/dist/bundle/chunks/{openai-codex-responses-YDJSZOIH.js → openai-codex-responses-IO2X4Y7L.js} +1 -1
  19. package/dist/bundle/chunks/openai-codex.js +2 -2
  20. package/dist/bundle/chunks/{openai-completions-UPRWTQPT.js → openai-completions-XYQQHETU.js} +1 -1
  21. package/dist/bundle/chunks/{openai-responses-O63W6HQ3.js → openai-responses-DLIRN3CI.js} +1 -1
  22. package/dist/bundle/chunks/{openrouter-images-G3GT5BVT.js → openrouter-images-G4GQRUSG.js} +1 -1
  23. package/dist/bundle/chunks/openrouter.js +2 -2
  24. package/dist/bundle/chunks/{pi-messages-SLF355GF.js → pi-messages-E6RRYBO7.js} +1 -1
  25. package/dist/bundle/chunks/radius.js +2 -2
  26. package/dist/bundle/chunks/{virtual-modules-O72ICTMQ.js → virtual-modules-3IZ4MYSQ.js} +1 -1
  27. package/dist/bundle/cli.js +1 -1
  28. package/dist/bundle/index.js +1 -1
  29. package/dist/bundle/rpc-entry.js +1 -1
  30. package/dist/capabilities/builtin.d.ts +4 -2
  31. package/dist/capabilities/builtin.d.ts.map +1 -1
  32. package/dist/capabilities/builtin.js +5 -1
  33. package/dist/capabilities/builtin.js.map +1 -1
  34. package/dist/cli/plugin-command.d.ts.map +1 -1
  35. package/dist/cli/plugin-command.js +51 -5
  36. package/dist/cli/plugin-command.js.map +1 -1
  37. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  38. package/dist/core/agent-session-compaction.js +13 -5
  39. package/dist/core/agent-session-compaction.js.map +1 -1
  40. package/dist/core/agent-session-internal.d.ts +2 -4
  41. package/dist/core/agent-session-internal.d.ts.map +1 -1
  42. package/dist/core/agent-session-internal.js.map +1 -1
  43. package/dist/core/agent-session-paths.d.ts +2 -0
  44. package/dist/core/agent-session-paths.d.ts.map +1 -1
  45. package/dist/core/agent-session-paths.js +2 -1
  46. package/dist/core/agent-session-paths.js.map +1 -1
  47. package/dist/core/agent-session-projection.d.ts +10 -4
  48. package/dist/core/agent-session-projection.d.ts.map +1 -1
  49. package/dist/core/agent-session-projection.js +17 -4
  50. package/dist/core/agent-session-projection.js.map +1 -1
  51. package/dist/core/agent-session.d.ts +19 -5
  52. package/dist/core/agent-session.d.ts.map +1 -1
  53. package/dist/core/agent-session.js +30 -4
  54. package/dist/core/agent-session.js.map +1 -1
  55. package/dist/core/extensions/bootstrap-lifecycle.d.ts +1 -1
  56. package/dist/core/extensions/bootstrap-lifecycle.d.ts.map +1 -1
  57. package/dist/core/extensions/bootstrap-lifecycle.js +5 -2
  58. package/dist/core/extensions/bootstrap-lifecycle.js.map +1 -1
  59. package/dist/core/extensions/capability-runtime-store.d.ts.map +1 -1
  60. package/dist/core/extensions/capability-runtime-store.js +1 -0
  61. package/dist/core/extensions/capability-runtime-store.js.map +1 -1
  62. package/dist/core/extensions/capability-runtime-types.d.ts +16 -1
  63. package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -1
  64. package/dist/core/extensions/capability-runtime-types.js.map +1 -1
  65. package/dist/core/extensions/capability-runtime.d.ts.map +1 -1
  66. package/dist/core/extensions/capability-runtime.js +38 -2
  67. package/dist/core/extensions/capability-runtime.js.map +1 -1
  68. package/dist/core/extensions/index.d.ts +1 -1
  69. package/dist/core/extensions/index.d.ts.map +1 -1
  70. package/dist/core/extensions/index.js.map +1 -1
  71. package/dist/core/extensions/lifecycle-catalog.d.ts +46 -0
  72. package/dist/core/extensions/lifecycle-catalog.d.ts.map +1 -1
  73. package/dist/core/extensions/lifecycle-catalog.js +101 -0
  74. package/dist/core/extensions/lifecycle-catalog.js.map +1 -1
  75. package/dist/core/extensions/provider-failover.d.ts +106 -0
  76. package/dist/core/extensions/provider-failover.d.ts.map +1 -0
  77. package/dist/core/extensions/provider-failover.js +692 -0
  78. package/dist/core/extensions/provider-failover.js.map +1 -0
  79. package/dist/core/facade/coding-agent-facade.d.ts +13 -6
  80. package/dist/core/facade/coding-agent-facade.d.ts.map +1 -1
  81. package/dist/core/facade/coding-agent-facade.js +3 -1
  82. package/dist/core/facade/coding-agent-facade.js.map +1 -1
  83. package/dist/core/keybindings.d.ts +6 -6
  84. package/dist/core/keybindings.d.ts.map +1 -1
  85. package/dist/core/keybindings.js +23 -6
  86. package/dist/core/keybindings.js.map +1 -1
  87. package/dist/core/model-config.d.ts +102 -0
  88. package/dist/core/model-config.d.ts.map +1 -1
  89. package/dist/core/model-config.js +46 -14
  90. package/dist/core/model-config.js.map +1 -1
  91. package/dist/core/model-resolver.d.ts.map +1 -1
  92. package/dist/core/model-resolver.js +1 -1
  93. package/dist/core/model-resolver.js.map +1 -1
  94. package/dist/core/model-runtime.d.ts +15 -0
  95. package/dist/core/model-runtime.d.ts.map +1 -1
  96. package/dist/core/model-runtime.js +30 -18
  97. package/dist/core/model-runtime.js.map +1 -1
  98. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  99. package/dist/core/remote-catalog-provider.js +4 -9
  100. package/dist/core/remote-catalog-provider.js.map +1 -1
  101. package/dist/core/sdk.d.ts.map +1 -1
  102. package/dist/core/sdk.js +107 -24
  103. package/dist/core/sdk.js.map +1 -1
  104. package/dist/core/session-manager.d.ts +2 -0
  105. package/dist/core/session-manager.d.ts.map +1 -1
  106. package/dist/core/session-manager.js +10 -5
  107. package/dist/core/session-manager.js.map +1 -1
  108. package/dist/core/settings-manager.d.ts +71 -5
  109. package/dist/core/settings-manager.d.ts.map +1 -1
  110. package/dist/core/settings-manager.js +138 -9
  111. package/dist/core/settings-manager.js.map +1 -1
  112. package/dist/core/slash-commands.d.ts.map +1 -1
  113. package/dist/core/slash-commands.js +17 -2
  114. package/dist/core/slash-commands.js.map +1 -1
  115. package/dist/core/tools/render-utils.d.ts +6 -0
  116. package/dist/core/tools/render-utils.d.ts.map +1 -1
  117. package/dist/core/tools/render-utils.js +26 -0
  118. package/dist/core/tools/render-utils.js.map +1 -1
  119. package/dist/core/tools/tool-definition.d.ts +21 -2
  120. package/dist/core/tools/tool-definition.d.ts.map +1 -1
  121. package/dist/core/tools/tool-definition.js.map +1 -1
  122. package/dist/main.d.ts.map +1 -1
  123. package/dist/main.js +3 -6
  124. package/dist/main.js.map +1 -1
  125. package/dist/modes/interactive/components/agents-view.d.ts +57 -0
  126. package/dist/modes/interactive/components/agents-view.d.ts.map +1 -0
  127. package/dist/modes/interactive/components/agents-view.js +260 -0
  128. package/dist/modes/interactive/components/agents-view.js.map +1 -0
  129. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  130. package/dist/modes/interactive/components/custom-editor.js +2 -2
  131. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  132. package/dist/modes/interactive/components/footer.d.ts +7 -0
  133. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  134. package/dist/modes/interactive/components/footer.js +51 -6
  135. package/dist/modes/interactive/components/footer.js.map +1 -1
  136. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
  137. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  138. package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
  139. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  140. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  141. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  142. package/dist/modes/interactive/components/settings-selector.js +12 -2
  143. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  144. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  145. package/dist/modes/interactive/components/thinking-selector.js +1 -1
  146. package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
  147. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  148. package/dist/modes/interactive/components/tool-execution.js +89 -10
  149. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  150. package/dist/modes/interactive/components/user-message-selector.d.ts +3 -0
  151. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  152. package/dist/modes/interactive/components/user-message-selector.js +9 -3
  153. package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
  154. package/dist/modes/interactive/components/workflow-view.d.ts +119 -0
  155. package/dist/modes/interactive/components/workflow-view.d.ts.map +1 -0
  156. package/dist/modes/interactive/components/workflow-view.js +638 -0
  157. package/dist/modes/interactive/components/workflow-view.js.map +1 -0
  158. package/dist/modes/interactive/interactive-commands.d.ts +22 -0
  159. package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
  160. package/dist/modes/interactive/interactive-commands.js +56 -0
  161. package/dist/modes/interactive/interactive-commands.js.map +1 -1
  162. package/dist/modes/interactive/interactive-mode.d.ts +51 -1
  163. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  164. package/dist/modes/interactive/interactive-mode.js +218 -37
  165. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  166. package/dist/modes/interactive/interactive-selectors.d.ts +2 -4
  167. package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
  168. package/dist/modes/interactive/interactive-selectors.js +10 -1
  169. package/dist/modes/interactive/interactive-selectors.js.map +1 -1
  170. package/dist/modes/print-mode.d.ts.map +1 -1
  171. package/dist/modes/print-mode.js +5 -0
  172. package/dist/modes/print-mode.js.map +1 -1
  173. package/dist/modes/rpc/rpc-client.d.ts +3 -1
  174. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  175. package/dist/modes/rpc/rpc-client.js +4 -2
  176. package/dist/modes/rpc/rpc-client.js.map +1 -1
  177. package/dist/modes/rpc/rpc-types.d.ts +1 -0
  178. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  179. package/dist/modes/rpc/rpc-types.js.map +1 -1
  180. package/dist/plugins/ecosystem/bootstrap-factory-manifest.d.ts.map +1 -1
  181. package/dist/plugins/ecosystem/bootstrap-factory-manifest.js +7 -0
  182. package/dist/plugins/ecosystem/bootstrap-factory-manifest.js.map +1 -1
  183. package/dist/plugins/ecosystem/cli.d.ts.map +1 -1
  184. package/dist/plugins/ecosystem/cli.js +1 -1
  185. package/dist/plugins/ecosystem/cli.js.map +1 -1
  186. package/dist/plugins/ecosystem/install-store-paths.d.ts +15 -0
  187. package/dist/plugins/ecosystem/install-store-paths.d.ts.map +1 -0
  188. package/dist/plugins/ecosystem/install-store-paths.js +58 -0
  189. package/dist/plugins/ecosystem/install-store-paths.js.map +1 -0
  190. package/dist/plugins/ecosystem/node-disk-registry-source.d.ts.map +1 -1
  191. package/dist/plugins/ecosystem/node-disk-registry-source.js +3 -8
  192. package/dist/plugins/ecosystem/node-disk-registry-source.js.map +1 -1
  193. package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -1
  194. package/dist/plugins/ecosystem/node-package-install-host.js +9 -1
  195. package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -1
  196. package/dist/plugins/ecosystem/node-package-install-persistence.d.ts.map +1 -1
  197. package/dist/plugins/ecosystem/node-package-install-persistence.js +3 -8
  198. package/dist/plugins/ecosystem/node-package-install-persistence.js.map +1 -1
  199. package/dist/profile/plugin-profiles.d.ts +2 -0
  200. package/dist/profile/plugin-profiles.d.ts.map +1 -1
  201. package/dist/profile/plugin-profiles.js +4 -0
  202. package/dist/profile/plugin-profiles.js.map +1 -1
  203. package/dist/profiles/builtin-suites.d.ts +19 -2
  204. package/dist/profiles/builtin-suites.d.ts.map +1 -1
  205. package/dist/profiles/builtin-suites.js +20 -2
  206. package/dist/profiles/builtin-suites.js.map +1 -1
  207. package/dist/profiles/suite-loader.d.ts.map +1 -1
  208. package/dist/profiles/suite-loader.js +4 -1
  209. package/dist/profiles/suite-loader.js.map +1 -1
  210. package/dist/utils/clipboard.d.ts.map +1 -1
  211. package/dist/utils/clipboard.js +10 -10
  212. package/dist/utils/clipboard.js.map +1 -1
  213. package/docs/keybindings.md +8 -8
  214. package/docs/models.md +1 -1
  215. package/docs/rpc.md +3 -1
  216. package/docs/settings.md +2 -1
  217. package/package.json +4 -4
  218. package/dist/bundle/chunks/anthropic-messages-EVFQ6MLR.js +0 -6
  219. package/dist/bundle/chunks/chunk-F6SBZUJG.js +0 -141
  220. package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
@@ -2,7 +2,7 @@ import { type CapabilityPluginHandle } from "./capability-plugin.ts";
2
2
  import type { CapabilityRuntime } from "./capability-runtime.ts";
3
3
  export type { CapabilityCallEventNameV1, CapabilityCallStatusV1, ModelStreamEventNameV1 } from "./lifecycle-catalog.ts";
4
4
  import type { SessionRevisionV1 } from "./public-api.ts";
5
- export { AGENT_END_EVENT_ID, AGENT_END_EVENT_VERSION, AGENT_SETTLED_EVENT_ID, AGENT_SETTLED_EVENT_VERSION, AGENT_START_EVENT_ID, AGENT_START_EVENT_VERSION, AGENT_TASK_SETTLED_EVENT_ID, AGENT_TASK_SETTLED_EVENT_VERSION, type AgentEndEventDataV1, type AgentLifecycleEventDataV1, type AgentTaskSettledEventDataV1, agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, BEFORE_AGENT_START_EVENT_ID, BEFORE_AGENT_START_EVENT_VERSION, BEFORE_AGENT_START_EVENT_VERSION_V2, type BeforeAgentStartEventDataV1, type BeforeAgentStartEventDataV2, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, type CapabilityCallEventDataV1, CONTEXT_ASSEMBLED_EVENT_ID, CONTEXT_ASSEMBLED_EVENT_VERSION, type ContextAssembledEventDataV1, contextAssembledEventDefinition, INPUT_GATE_BLOCKED_EVENT_ID, INPUT_GATE_BLOCKED_EVENT_VERSION, INPUT_RECEIVED_EVENT_ID, INPUT_RECEIVED_EVENT_VERSION, type InputGateBlockedEventDataV1, type InputReceivedEventDataV1, inputGateBlockedEventDefinition, inputReceivedEventDefinition, MESSAGE_END_EVENT_ID, MESSAGE_END_EVENT_VERSION, MESSAGE_START_EVENT_ID, MESSAGE_START_EVENT_VERSION, type MessageBoundaryEventDataV1, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_SELECT_EVENT_ID, MODEL_SELECT_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, type ModelResponseEventDataV1, type ModelSelectEventDataV1, type ModelStreamEventDataV1, messageEndEventDefinition, messageStartEventDefinition, modelSelectEventDefinition, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, type OperationCancelEventDataV1, type OperationEndEventDataV1, type OperationStartEventDataV1, type OperationStepEventDataV1, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION, type PluginDisposeEventDataV1, type PluginReadyEventDataV1, type PluginRejectedEventDataV1, RESOURCES_DISCOVER_EVENT_ID, RESOURCES_DISCOVER_EVENT_VERSION, RESOURCES_DISCOVER_EVENT_VERSION_V2, type ResourcesDiscoverEventDataV1, type ResourcesDiscoverEventDataV2, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, SESSION_AUTO_RETRY_EVENT_ID, SESSION_AUTO_RETRY_EVENT_VERSION, SESSION_COMPACTION_DECISION_EVENT_ID, SESSION_COMPACTION_DECISION_EVENT_VERSION, SESSION_COMPACTION_FAILED_EVENT_ID, SESSION_COMPACTION_FAILED_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_END_EVENT_ID, SESSION_END_EVENT_VERSION, SESSION_ENTRY_APPENDED_EVENT_ID, SESSION_ENTRY_APPENDED_EVENT_VERSION, SESSION_INFO_CHANGED_EVENT_ID, SESSION_INFO_CHANGED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, SESSION_START_EVENT_ID, SESSION_START_EVENT_VERSION, type SessionAutoRetryEventDataV1, type SessionCompactionDecisionEventDataV1, type SessionCompactionFailedEventDataV1, type SessionContextReplacedEventDataV1, type SessionEndEventDataV1, type SessionEntryAppendedEventDataV1, type SessionInfoChangedEventDataV1, type SessionReloadEventDataV1, type SessionStartEventDataV1, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionStartEventDefinition, THINKING_LEVEL_SELECT_EVENT_ID, THINKING_LEVEL_SELECT_EVENT_VERSION, type ThinkingLevelSelectEventDataV1, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_EXECUTION_START_EVENT_ID, TOOL_EXECUTION_START_EVENT_VERSION, TOOL_GATE_BLOCKED_EVENT_ID, TOOL_GATE_BLOCKED_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, type ToolCallEventDataV1, type ToolCommitEventDataV1, type ToolExecuteEventDataV1, type ToolExecutionStartEventDataV1, type ToolGateBlockedEventDataV1, type ToolResultEventDataV1, type ToolResultRawEventDataV1, type ToolResultTransformEventDataV1, TURN_END_EVENT_ID, TURN_END_EVENT_VERSION, TURN_START_EVENT_ID, TURN_START_EVENT_VERSION, type TurnEndEventDataV1, type TurnStartEventDataV1, thinkingLevelSelectEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, turnEndEventDefinition, turnStartEventDefinition, UI_PROMPT_END_EVENT_ID, UI_PROMPT_END_EVENT_VERSION, UI_PROMPT_START_EVENT_ID, UI_PROMPT_START_EVENT_VERSION, type UIPromptBoundaryEventDataV1, USER_BASH_EVENT_ID, USER_BASH_EVENT_VERSION, type UserBashEventDataV1, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, validateAgentEndEventDataV1, validateAgentLifecycleEventDataV1, validateAgentTaskSettledEventDataV1, validateBeforeAgentStartEventDataV1, validateBeforeAgentStartEventDataV2, validateCapabilityCallEventDataV1, validateContextAssembledEventDataV1, validateInputReceivedEventDataV1, validateMessageBoundaryEventDataV1, validateModelResponseEventDataV1, validateModelSelectEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateResourcesDiscoverEventDataV1, validateResourcesDiscoverEventDataV2, validateSessionAutoRetryEventDataV1, validateSessionCompactionDecisionEventDataV1, validateSessionCompactionFailedEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionEndEventDataV1, validateSessionEntryAppendedEventDataV1, validateSessionInfoChangedEventDataV1, validateSessionReloadEventDataV1, validateSessionStartEventDataV1, validateThinkingLevelSelectEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolExecutionStartEventDataV1, validateToolGateBlockedEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, validateTurnEndEventDataV1, validateTurnStartEventDataV1, validateUIPromptBoundaryEventDataV1, validateUserBashEventDataV1, } from "./lifecycle-catalog.ts";
5
+ export { AGENT_END_EVENT_ID, AGENT_END_EVENT_VERSION, AGENT_SETTLED_EVENT_ID, AGENT_SETTLED_EVENT_VERSION, AGENT_START_EVENT_ID, AGENT_START_EVENT_VERSION, AGENT_TASK_SETTLED_EVENT_ID, AGENT_TASK_SETTLED_EVENT_VERSION, type AgentEndEventDataV1, type AgentLifecycleEventDataV1, type AgentTaskSettledEventDataV1, agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, BEFORE_AGENT_START_EVENT_ID, BEFORE_AGENT_START_EVENT_VERSION, BEFORE_AGENT_START_EVENT_VERSION_V2, type BeforeAgentStartEventDataV1, type BeforeAgentStartEventDataV2, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, type CapabilityCallEventDataV1, CONTEXT_ASSEMBLED_EVENT_ID, CONTEXT_ASSEMBLED_EVENT_VERSION, type ContextAssembledEventDataV1, contextAssembledEventDefinition, INPUT_GATE_BLOCKED_EVENT_ID, INPUT_GATE_BLOCKED_EVENT_VERSION, INPUT_RECEIVED_EVENT_ID, INPUT_RECEIVED_EVENT_VERSION, type InputGateBlockedEventDataV1, type InputReceivedEventDataV1, inputGateBlockedEventDefinition, inputReceivedEventDefinition, MESSAGE_END_EVENT_ID, MESSAGE_END_EVENT_VERSION, MESSAGE_START_EVENT_ID, MESSAGE_START_EVENT_VERSION, type MessageBoundaryEventDataV1, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_SELECT_EVENT_ID, MODEL_SELECT_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, type ModelResponseEventDataV1, type ModelSelectEventDataV1, type ModelStreamEventDataV1, messageEndEventDefinition, messageStartEventDefinition, modelSelectEventDefinition, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, type OperationCancelEventDataV1, type OperationEndEventDataV1, type OperationStartEventDataV1, type OperationStepEventDataV1, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION, type PluginDisposeEventDataV1, type PluginReadyEventDataV1, type PluginRejectedEventDataV1, PROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID, PROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION, PROVIDER_FAILOVER_RECOVERED_EVENT_ID, PROVIDER_FAILOVER_RECOVERED_EVENT_VERSION, PROVIDER_FAILOVER_SWITCHED_EVENT_ID, PROVIDER_FAILOVER_SWITCHED_EVENT_VERSION, type ProviderFailoverProbeFailedEventDataV1, type ProviderFailoverRecoveredEventDataV1, type ProviderFailoverSwitchedEventDataV1, providerFailoverProbeFailedEventDefinition, providerFailoverRecoveredEventDefinition, providerFailoverSwitchedEventDefinition, RESOURCES_DISCOVER_EVENT_ID, RESOURCES_DISCOVER_EVENT_VERSION, RESOURCES_DISCOVER_EVENT_VERSION_V2, type ResourcesDiscoverEventDataV1, type ResourcesDiscoverEventDataV2, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, SESSION_AUTO_RETRY_EVENT_ID, SESSION_AUTO_RETRY_EVENT_VERSION, SESSION_COMPACTION_DECISION_EVENT_ID, SESSION_COMPACTION_DECISION_EVENT_VERSION, SESSION_COMPACTION_FAILED_EVENT_ID, SESSION_COMPACTION_FAILED_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_END_EVENT_ID, SESSION_END_EVENT_VERSION, SESSION_ENTRY_APPENDED_EVENT_ID, SESSION_ENTRY_APPENDED_EVENT_VERSION, SESSION_INFO_CHANGED_EVENT_ID, SESSION_INFO_CHANGED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, SESSION_START_EVENT_ID, SESSION_START_EVENT_VERSION, type SessionAutoRetryEventDataV1, type SessionCompactionDecisionEventDataV1, type SessionCompactionFailedEventDataV1, type SessionContextReplacedEventDataV1, type SessionEndEventDataV1, type SessionEntryAppendedEventDataV1, type SessionInfoChangedEventDataV1, type SessionReloadEventDataV1, type SessionStartEventDataV1, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionStartEventDefinition, THINKING_LEVEL_SELECT_EVENT_ID, THINKING_LEVEL_SELECT_EVENT_VERSION, type ThinkingLevelSelectEventDataV1, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_EXECUTION_START_EVENT_ID, TOOL_EXECUTION_START_EVENT_VERSION, TOOL_GATE_BLOCKED_EVENT_ID, TOOL_GATE_BLOCKED_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, type ToolCallEventDataV1, type ToolCommitEventDataV1, type ToolExecuteEventDataV1, type ToolExecutionStartEventDataV1, type ToolGateBlockedEventDataV1, type ToolResultEventDataV1, type ToolResultRawEventDataV1, type ToolResultTransformEventDataV1, TURN_END_EVENT_ID, TURN_END_EVENT_VERSION, TURN_START_EVENT_ID, TURN_START_EVENT_VERSION, type TurnEndEventDataV1, type TurnStartEventDataV1, thinkingLevelSelectEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, turnEndEventDefinition, turnStartEventDefinition, UI_PROMPT_END_EVENT_ID, UI_PROMPT_END_EVENT_VERSION, UI_PROMPT_START_EVENT_ID, UI_PROMPT_START_EVENT_VERSION, type UIPromptBoundaryEventDataV1, USER_BASH_EVENT_ID, USER_BASH_EVENT_VERSION, type UserBashEventDataV1, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, validateAgentEndEventDataV1, validateAgentLifecycleEventDataV1, validateAgentTaskSettledEventDataV1, validateBeforeAgentStartEventDataV1, validateBeforeAgentStartEventDataV2, validateCapabilityCallEventDataV1, validateContextAssembledEventDataV1, validateInputReceivedEventDataV1, validateMessageBoundaryEventDataV1, validateModelResponseEventDataV1, validateModelSelectEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateProviderFailoverProbeFailedEventDataV1, validateProviderFailoverRecoveredEventDataV1, validateProviderFailoverSwitchedEventDataV1, validateResourcesDiscoverEventDataV1, validateResourcesDiscoverEventDataV2, validateSessionAutoRetryEventDataV1, validateSessionCompactionDecisionEventDataV1, validateSessionCompactionFailedEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionEndEventDataV1, validateSessionEntryAppendedEventDataV1, validateSessionInfoChangedEventDataV1, validateSessionReloadEventDataV1, validateSessionStartEventDataV1, validateThinkingLevelSelectEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolExecutionStartEventDataV1, validateToolGateBlockedEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, validateTurnEndEventDataV1, validateTurnStartEventDataV1, validateUIPromptBoundaryEventDataV1, validateUserBashEventDataV1, } from "./lifecycle-catalog.ts";
6
6
  export declare const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = "agent-forge.bootstrap-lifecycle";
7
7
  export declare const SESSION_COMPACTION_COMMIT_EVENT_ID = "session.compaction.commit";
8
8
  export declare const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA+FjE,YAAY,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExH,OAAO,KAAK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AAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA2CD,uEAAuE;AACvE,wBAAgB,0CAA0C,CAAC,KAAK,EAAE,OAAO,GAAG,kCAAkC,CAqD7G;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAmE5F","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\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\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\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\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<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.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqGjE,YAAY,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,gCAAgC,EAChC,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAC/B,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,EACnC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,+BAA+B,EAC/B,iCAAiC,EACjC,wBAAwB,EACxB,6BAA6B,EAC7B,KAAK,yBAAyB,EAC9B,0BAA0B,EAC1B,+BAA+B,EAC/B,KAAK,2BAA2B,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,gCAAgC,EAChC,uBAAuB,EACvB,4BAA4B,EAC5B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,+BAA+B,EAC/B,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,0BAA0B,EAC/B,uBAAuB,EACvB,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,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,mCAAmC,EACnC,4CAA4C,EAC5C,0CAA0C,EAC1C,yCAAyC,EACzC,6BAA6B,EAC7B,uCAAuC,EACvC,qCAAqC,EACrC,gCAAgC,EAChC,+BAA+B,EAC/B,sCAAsC,EACtC,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,qCAAqC,EACrC,kCAAkC,EAClC,6BAA6B,EAC7B,gCAAgC,EAChC,sCAAsC,EACtC,0BAA0B,EAC1B,4BAA4B,EAC5B,mCAAmC,EACnC,2BAA2B,GAC3B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAC/E,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,eAAO,MAAM,uCAAuC,IAAI,CAAC;AAEzD,MAAM,WAAW,kCAAkC;IAClD,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,WAAW,GAAG,UAAU,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AA2CD,uEAAuE;AACvE,wBAAgB,0CAA0C,CAAC,KAAK,EAAE,OAAO,GAAG,kCAAkC,CAqD7G;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAsE5F","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,7 +1,7 @@
1
1
  import { loadCapabilityPluginSync } from "./capability-plugin.js";
2
- import { agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, capabilityCallEventDefinition, contextAssembledEventDefinition, inputGateBlockedEventDefinition, inputReceivedEventDefinition, messageEndEventDefinition, messageStartEventDefinition, modelResponseEventDefinition, modelSelectEventDefinition, modelStreamEventDefinition, operationCancelEventDefinition, operationEndEventDefinition, operationStartEventDefinition, operationStepEventDefinition, pluginDisposeEventDefinition, pluginReadyEventDefinition, pluginRejectedEventDefinition, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionContextReplacedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionReloadEventDefinition, sessionStartEventDefinition, thinkingLevelSelectEventDefinition, toolCallEventDefinition, toolCommitEventDefinition, toolExecuteEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, toolResultEventDefinition, toolResultRawEventDefinition, toolResultTransformEventDefinition, turnEndEventDefinition, turnStartEventDefinition, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, } from "./lifecycle-catalog.js";
2
+ import { agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, capabilityCallEventDefinition, contextAssembledEventDefinition, inputGateBlockedEventDefinition, inputReceivedEventDefinition, messageEndEventDefinition, messageStartEventDefinition, modelResponseEventDefinition, modelSelectEventDefinition, modelStreamEventDefinition, operationCancelEventDefinition, operationEndEventDefinition, operationStartEventDefinition, operationStepEventDefinition, pluginDisposeEventDefinition, pluginReadyEventDefinition, pluginRejectedEventDefinition, providerFailoverProbeFailedEventDefinition, providerFailoverRecoveredEventDefinition, providerFailoverSwitchedEventDefinition, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionContextReplacedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionReloadEventDefinition, sessionStartEventDefinition, thinkingLevelSelectEventDefinition, toolCallEventDefinition, toolCommitEventDefinition, toolExecuteEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, toolResultEventDefinition, toolResultRawEventDefinition, toolResultTransformEventDefinition, turnEndEventDefinition, turnStartEventDefinition, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, } from "./lifecycle-catalog.js";
3
3
  import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
4
- export { AGENT_END_EVENT_ID, AGENT_END_EVENT_VERSION, AGENT_SETTLED_EVENT_ID, AGENT_SETTLED_EVENT_VERSION, AGENT_START_EVENT_ID, AGENT_START_EVENT_VERSION, AGENT_TASK_SETTLED_EVENT_ID, AGENT_TASK_SETTLED_EVENT_VERSION, agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, BEFORE_AGENT_START_EVENT_ID, BEFORE_AGENT_START_EVENT_VERSION, BEFORE_AGENT_START_EVENT_VERSION_V2, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, CONTEXT_ASSEMBLED_EVENT_ID, CONTEXT_ASSEMBLED_EVENT_VERSION, contextAssembledEventDefinition, INPUT_GATE_BLOCKED_EVENT_ID, INPUT_GATE_BLOCKED_EVENT_VERSION, INPUT_RECEIVED_EVENT_ID, INPUT_RECEIVED_EVENT_VERSION, inputGateBlockedEventDefinition, inputReceivedEventDefinition, MESSAGE_END_EVENT_ID, MESSAGE_END_EVENT_VERSION, MESSAGE_START_EVENT_ID, MESSAGE_START_EVENT_VERSION, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_SELECT_EVENT_ID, MODEL_SELECT_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, messageEndEventDefinition, messageStartEventDefinition, modelSelectEventDefinition, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION, RESOURCES_DISCOVER_EVENT_ID, RESOURCES_DISCOVER_EVENT_VERSION, RESOURCES_DISCOVER_EVENT_VERSION_V2, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, SESSION_AUTO_RETRY_EVENT_ID, SESSION_AUTO_RETRY_EVENT_VERSION, SESSION_COMPACTION_DECISION_EVENT_ID, SESSION_COMPACTION_DECISION_EVENT_VERSION, SESSION_COMPACTION_FAILED_EVENT_ID, SESSION_COMPACTION_FAILED_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_END_EVENT_ID, SESSION_END_EVENT_VERSION, SESSION_ENTRY_APPENDED_EVENT_ID, SESSION_ENTRY_APPENDED_EVENT_VERSION, SESSION_INFO_CHANGED_EVENT_ID, SESSION_INFO_CHANGED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, SESSION_START_EVENT_ID, SESSION_START_EVENT_VERSION, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionStartEventDefinition, THINKING_LEVEL_SELECT_EVENT_ID, THINKING_LEVEL_SELECT_EVENT_VERSION, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_EXECUTION_START_EVENT_ID, TOOL_EXECUTION_START_EVENT_VERSION, TOOL_GATE_BLOCKED_EVENT_ID, TOOL_GATE_BLOCKED_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, TURN_END_EVENT_ID, TURN_END_EVENT_VERSION, TURN_START_EVENT_ID, TURN_START_EVENT_VERSION, thinkingLevelSelectEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, turnEndEventDefinition, turnStartEventDefinition, UI_PROMPT_END_EVENT_ID, UI_PROMPT_END_EVENT_VERSION, UI_PROMPT_START_EVENT_ID, UI_PROMPT_START_EVENT_VERSION, USER_BASH_EVENT_ID, USER_BASH_EVENT_VERSION, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, validateAgentEndEventDataV1, validateAgentLifecycleEventDataV1, validateAgentTaskSettledEventDataV1, validateBeforeAgentStartEventDataV1, validateBeforeAgentStartEventDataV2, validateCapabilityCallEventDataV1, validateContextAssembledEventDataV1, validateInputReceivedEventDataV1, validateMessageBoundaryEventDataV1, validateModelResponseEventDataV1, validateModelSelectEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateResourcesDiscoverEventDataV1, validateResourcesDiscoverEventDataV2, validateSessionAutoRetryEventDataV1, validateSessionCompactionDecisionEventDataV1, validateSessionCompactionFailedEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionEndEventDataV1, validateSessionEntryAppendedEventDataV1, validateSessionInfoChangedEventDataV1, validateSessionReloadEventDataV1, validateSessionStartEventDataV1, validateThinkingLevelSelectEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolExecutionStartEventDataV1, validateToolGateBlockedEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, validateTurnEndEventDataV1, validateTurnStartEventDataV1, validateUIPromptBoundaryEventDataV1, validateUserBashEventDataV1, } from "./lifecycle-catalog.js";
4
+ export { AGENT_END_EVENT_ID, AGENT_END_EVENT_VERSION, AGENT_SETTLED_EVENT_ID, AGENT_SETTLED_EVENT_VERSION, AGENT_START_EVENT_ID, AGENT_START_EVENT_VERSION, AGENT_TASK_SETTLED_EVENT_ID, AGENT_TASK_SETTLED_EVENT_VERSION, agentEndEventDefinition, agentSettledEventDefinition, agentStartEventDefinition, agentTaskSettledEventDefinition, BEFORE_AGENT_START_EVENT_ID, BEFORE_AGENT_START_EVENT_VERSION, BEFORE_AGENT_START_EVENT_VERSION_V2, beforeAgentStartEventDefinition, beforeAgentStartV2EventDefinition, CAPABILITY_CALL_EVENT_ID, CAPABILITY_CALL_EVENT_VERSION, CONTEXT_ASSEMBLED_EVENT_ID, CONTEXT_ASSEMBLED_EVENT_VERSION, contextAssembledEventDefinition, INPUT_GATE_BLOCKED_EVENT_ID, INPUT_GATE_BLOCKED_EVENT_VERSION, INPUT_RECEIVED_EVENT_ID, INPUT_RECEIVED_EVENT_VERSION, inputGateBlockedEventDefinition, inputReceivedEventDefinition, MESSAGE_END_EVENT_ID, MESSAGE_END_EVENT_VERSION, MESSAGE_START_EVENT_ID, MESSAGE_START_EVENT_VERSION, MODEL_RESPONSE_EVENT_ID, MODEL_RESPONSE_EVENT_VERSION, MODEL_SELECT_EVENT_ID, MODEL_SELECT_EVENT_VERSION, MODEL_STREAM_EVENT_ID, MODEL_STREAM_EVENT_VERSION, messageEndEventDefinition, messageStartEventDefinition, modelSelectEventDefinition, OPERATION_CANCEL_EVENT_ID, OPERATION_CANCEL_EVENT_VERSION, OPERATION_END_EVENT_ID, OPERATION_END_EVENT_VERSION, OPERATION_START_EVENT_ID, OPERATION_START_EVENT_VERSION, OPERATION_STEP_EVENT_ID, OPERATION_STEP_EVENT_VERSION, PLUGIN_DISPOSE_EVENT_ID, PLUGIN_DISPOSE_EVENT_VERSION, PLUGIN_READY_EVENT_ID, PLUGIN_READY_EVENT_VERSION, PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION, PROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID, PROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION, PROVIDER_FAILOVER_RECOVERED_EVENT_ID, PROVIDER_FAILOVER_RECOVERED_EVENT_VERSION, PROVIDER_FAILOVER_SWITCHED_EVENT_ID, PROVIDER_FAILOVER_SWITCHED_EVENT_VERSION, providerFailoverProbeFailedEventDefinition, providerFailoverRecoveredEventDefinition, providerFailoverSwitchedEventDefinition, RESOURCES_DISCOVER_EVENT_ID, RESOURCES_DISCOVER_EVENT_VERSION, RESOURCES_DISCOVER_EVENT_VERSION_V2, resourcesDiscoverEventDefinition, resourcesDiscoverV2EventDefinition, SESSION_AUTO_RETRY_EVENT_ID, SESSION_AUTO_RETRY_EVENT_VERSION, SESSION_COMPACTION_DECISION_EVENT_ID, SESSION_COMPACTION_DECISION_EVENT_VERSION, SESSION_COMPACTION_FAILED_EVENT_ID, SESSION_COMPACTION_FAILED_EVENT_VERSION, SESSION_CONTEXT_REPLACED_EVENT_ID, SESSION_CONTEXT_REPLACED_EVENT_VERSION, SESSION_END_EVENT_ID, SESSION_END_EVENT_VERSION, SESSION_ENTRY_APPENDED_EVENT_ID, SESSION_ENTRY_APPENDED_EVENT_VERSION, SESSION_INFO_CHANGED_EVENT_ID, SESSION_INFO_CHANGED_EVENT_VERSION, SESSION_RELOAD_EVENT_ID, SESSION_RELOAD_EVENT_VERSION, SESSION_START_EVENT_ID, SESSION_START_EVENT_VERSION, sessionAutoRetryEventDefinition, sessionCompactionDecisionEventDefinition, sessionCompactionFailedEventDefinition, sessionEndEventDefinition, sessionEntryAppendedEventDefinition, sessionInfoChangedEventDefinition, sessionStartEventDefinition, THINKING_LEVEL_SELECT_EVENT_ID, THINKING_LEVEL_SELECT_EVENT_VERSION, TOOL_CALL_EVENT_ID, TOOL_CALL_EVENT_VERSION, TOOL_COMMIT_EVENT_ID, TOOL_COMMIT_EVENT_VERSION, TOOL_EXECUTE_EVENT_ID, TOOL_EXECUTE_EVENT_VERSION, TOOL_EXECUTION_START_EVENT_ID, TOOL_EXECUTION_START_EVENT_VERSION, TOOL_GATE_BLOCKED_EVENT_ID, TOOL_GATE_BLOCKED_EVENT_VERSION, TOOL_RESULT_EVENT_ID, TOOL_RESULT_EVENT_VERSION, TOOL_RESULT_RAW_EVENT_ID, TOOL_RESULT_RAW_EVENT_VERSION, TOOL_RESULT_TRANSFORM_EVENT_ID, TOOL_RESULT_TRANSFORM_EVENT_VERSION, TURN_END_EVENT_ID, TURN_END_EVENT_VERSION, TURN_START_EVENT_ID, TURN_START_EVENT_VERSION, thinkingLevelSelectEventDefinition, toolExecutionStartEventDefinition, toolGateBlockedEventDefinition, turnEndEventDefinition, turnStartEventDefinition, UI_PROMPT_END_EVENT_ID, UI_PROMPT_END_EVENT_VERSION, UI_PROMPT_START_EVENT_ID, UI_PROMPT_START_EVENT_VERSION, USER_BASH_EVENT_ID, USER_BASH_EVENT_VERSION, uiPromptEndEventDefinition, uiPromptStartEventDefinition, userBashEventDefinition, validateAgentEndEventDataV1, validateAgentLifecycleEventDataV1, validateAgentTaskSettledEventDataV1, validateBeforeAgentStartEventDataV1, validateBeforeAgentStartEventDataV2, validateCapabilityCallEventDataV1, validateContextAssembledEventDataV1, validateInputReceivedEventDataV1, validateMessageBoundaryEventDataV1, validateModelResponseEventDataV1, validateModelSelectEventDataV1, validateModelStreamEventDataV1, validateOperationCancelEventDataV1, validateOperationEndEventDataV1, validateOperationStartEventDataV1, validateOperationStepEventDataV1, validatePluginDisposeEventDataV1, validatePluginReadyEventDataV1, validateProviderFailoverProbeFailedEventDataV1, validateProviderFailoverRecoveredEventDataV1, validateProviderFailoverSwitchedEventDataV1, validateResourcesDiscoverEventDataV1, validateResourcesDiscoverEventDataV2, validateSessionAutoRetryEventDataV1, validateSessionCompactionDecisionEventDataV1, validateSessionCompactionFailedEventDataV1, validateSessionContextReplacedEventDataV1, validateSessionEndEventDataV1, validateSessionEntryAppendedEventDataV1, validateSessionInfoChangedEventDataV1, validateSessionReloadEventDataV1, validateSessionStartEventDataV1, validateThinkingLevelSelectEventDataV1, validateToolCallEventDataV1, validateToolCommitEventDataV1, validateToolExecuteEventDataV1, validateToolExecutionStartEventDataV1, validateToolGateBlockedEventDataV1, validateToolResultEventDataV1, validateToolResultRawEventDataV1, validateToolResultTransformEventDataV1, validateTurnEndEventDataV1, validateTurnStartEventDataV1, validateUIPromptBoundaryEventDataV1, validateUserBashEventDataV1, } from "./lifecycle-catalog.js";
5
5
  export const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = "agent-forge.bootstrap-lifecycle";
6
6
  export const SESSION_COMPACTION_COMMIT_EVENT_ID = "session.compaction.commit";
7
7
  export const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;
@@ -136,6 +136,9 @@ export function installBootstrapLifecycle(runtime) {
136
136
  api.lifecycle.define(agentTaskSettledEventDefinition());
137
137
  api.lifecycle.define(toolGateBlockedEventDefinition());
138
138
  api.lifecycle.define(inputGateBlockedEventDefinition());
139
+ api.lifecycle.define(providerFailoverSwitchedEventDefinition());
140
+ api.lifecycle.define(providerFailoverRecoveredEventDefinition());
141
+ api.lifecycle.define(providerFailoverProbeFailedEventDefinition());
139
142
  api.lifecycle.define(pluginDisposeEventDefinition());
140
143
  api.lifecycle.define(pluginReadyEventDefinition());
141
144
  api.lifecycle.define(pluginRejectedEventDefinition());
@@ -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,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,EAI5B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAG7B,gCAAgC,EAChC,kCAAkC,EAUlC,+BAA+B,EAC/B,wCAAwC,EACxC,sCAAsC,EACtC,qCAAqC,EACrC,yBAAyB,EACzB,mCAAmC,EACnC,iCAAiC,EACjC,4BAA4B,EAC5B,2BAA2B,EAY3B,kCAAkC,EAClC,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,yBAAyB,EACzB,4BA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B,EAAE,CAAC,CAAC;QAC7E,GAAG,CAAC,SAAS,CAAC,MAAM,CAA4B,6BAA6B,EAAE,CAAC,CAAC;QACjF,GAAG,CAAC,SAAS,CAAC,MAAM,CAA2B,4BAA4B,EAAE,CAAC,CAAC;QAC/E,GAAG,CAAC,SAAS,CAAC,MAAM,CAA6B,8BAA8B,EAAE,CAAC,CAAC;IAAA,CACnF,CACD,CAAC;AAAA,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\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\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\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\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<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,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,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G,CAAC,SAAS,CAAC,MAAM,CAA6B,8BAA8B,EAAE,CAAC,CAAC;IAAA,CACnF,CACD,CAAC;AAAA,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 +1 @@
1
- {"version":3,"file":"capability-runtime-store.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/capability-runtime-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,sBAAsB,EAGtB,oBAAoB,EACpB,0BAA0B,EAO1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAaX,eAAe,EAQf,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,sBAAsB,CAuCrE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAI/F;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAEjE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhE;AAED,wBAAgB,gCAAgC,CAAC,CAAC,EACjD,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,GACjC,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,EAC1D,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;GAIG;AACH,wBAAsB,oCAAoC,CAAC,CAAC,EAAE,OAAO,EACpE,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,EACnC,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC,CAalB;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EACnD,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,0BAA0B,EACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,WAAW,GACjB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED,wBAAgB,cAAc,CAAC,OAAO,EACrC,KAAK,EAAE,sBAAsB,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,GAC9B,eAAe,CAAC,OAAO,CAAC,CAgB1B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM5G","sourcesContent":["import { cancellationError } from \"./capability-runtime-operation.ts\";\nimport { detachedSnapshot } from \"./capability-runtime-snapshot.ts\";\nimport type {\n\tAPIState,\n\tCapabilityRuntimeState,\n\tOperationHandler,\n\tQueuedLifecycleDelivery,\n\tRegisteredCapability,\n\tRegisteredPluginCapability,\n\tStateWatcher,\n\tStoredContributionPoint,\n\tStoredLifecycleDefinition,\n\tStoredLifecycleRegistration,\n\tStoredOutputArtifact,\n\tStoredState,\n} from \"./capability-runtime-types.ts\";\nimport type { LifecycleDeliveryQueue } from \"./lifecycle-delivery-queue.ts\";\nimport type {\n\tAgentLoopHookHandlerV1,\n\tAgentLoopHookPositionV1,\n\tAgentRunLoopStrategyV1,\n\tBranchSummaryPolicy,\n\tCapabilityAPI,\n\tCapabilityCommandDefinition,\n\tCompactionPolicy,\n\tContextStrategy,\n\tDiagnosticsSpanSnapshot,\n\tDisposableRegistration,\n\tEventEnvelope,\n\tLoggerRecord,\n\tOperationHandle,\n\tOperationStatus,\n\tOverflowPolicy,\n\tPluginRejection,\n\tProviderHeaderTransform,\n\tRetryPolicy,\n\tRuntimeInspectorLifecycleDeliveryReportSnapshot,\n\tSkillDefinition,\n} from \"./public-api.ts\";\n\n/**\n * Create the mutable state container for one capability runtime. Every map,\n * set, and array is created once and mutated in place; `eventSequence` is the\n * single mutable primitive shared with the lifecycle dispatch module.\n */\nexport function createCapabilityRuntimeState(): CapabilityRuntimeState {\n\treturn {\n\t\ttools: new Map<string, RegisteredCapability<unknown>>(),\n\t\tskills: new Map<string, RegisteredCapability<SkillDefinition>>(),\n\t\tretryPolicies: new Map<string, RegisteredCapability<RetryPolicy>>(),\n\t\tcompactionPolicies: new Map<string, RegisteredCapability<CompactionPolicy>>(),\n\t\toverflowPolicies: new Map<string, RegisteredCapability<OverflowPolicy>>(),\n\t\tbranchSummaryPolicies: new Map<string, RegisteredCapability<BranchSummaryPolicy>>(),\n\t\trunLoopStrategies: new Map<string, RegisteredCapability<AgentRunLoopStrategyV1>>(),\n\t\tloopHooks: new Map<AgentLoopHookPositionV1, RegisteredCapability<AgentLoopHookHandlerV1>[]>(),\n\t\tcommands: new Map<string, RegisteredCapability<CapabilityCommandDefinition>>(),\n\t\toperations: new Map<string, RegisteredCapability<OperationHandler>>(),\n\t\trpcMethods: new Map<string, RegisteredCapability<(input: unknown) => unknown | Promise<unknown>>>(),\n\t\tcontextStrategies: new Map<string, RegisteredCapability<ContextStrategy>>(),\n\t\tpluginCapabilities: new Map<string, RegisteredPluginCapability>(),\n\t\tproviderHeaderTransforms: new Map<string, RegisteredCapability<ProviderHeaderTransform>>(),\n\t\tcontributionPoints: new Map<string, StoredContributionPoint<unknown>>(),\n\t\tlifecycleDefinitions: new Map<string, StoredLifecycleDefinition>(),\n\t\tlifecycleRegistrations: new Map<string, Map<string, StoredLifecycleRegistration>>(),\n\t\tsubscribers: new Map<string, Map<string, RegisteredCapability<(event: EventEnvelope) => void | Promise<void>>>>(),\n\t\tstatuses: new Map<string, OperationStatus>(),\n\t\tactiveOperationsByOwnerToken: new Map<symbol, Set<OperationHandle<unknown>>>(),\n\t\tpluginRegistrations: new Map<string, Set<DisposableRegistration>>(),\n\t\tapiStates: new Map<CapabilityAPI, APIState>(),\n\t\tactiveOwnerTokens: new Set<symbol>(),\n\t\toutputArtifacts: new Map<string, StoredOutputArtifact>(),\n\t\tstateByOwner: new Map<string, Map<string, StoredState>>(),\n\t\tstateRevisionsByOwner: new Map<string, Map<string, number>>(),\n\t\tstateWatchers: new Map<string, Map<string, StateWatcher>>(),\n\t\tstateByInstance: new Map<string, Map<string, Map<string, StoredState>>>(),\n\t\tstateRevisionsByInstance: new Map<string, Map<string, Map<string, number>>>(),\n\t\tstateWatchersByInstance: new Map<string, Map<string, Map<string, StateWatcher>>>(),\n\t\tlogs: [] as LoggerRecord[],\n\t\tspans: new Map<string, DiagnosticsSpanSnapshot>(),\n\t\tlifecycleReports: [] as RuntimeInspectorLifecycleDeliveryReportSnapshot[],\n\t\tlifecycleDeliveryQueues: new Set<LifecycleDeliveryQueue<QueuedLifecycleDelivery<unknown>>>(),\n\t\tpluginRejections: [] as PluginRejection[],\n\t\teventSequence: 0,\n\t};\n}\n\n/**\n * A synchronous bootstrap plugin violated its lifecycle contract after its\n * disposer had already run. The synchronous caller receives a contract error;\n * observe a later rejection too so it cannot become an unhandled promise.\n */\nexport function observeUnexpectedAsyncCleanup(result: PromiseLike<void>, pluginId: string): void {\n\tvoid Promise.resolve(result).catch((error) => {\n\t\tconsole.error(`Asynchronous cleanup rejected after synchronous plugin disposal was rejected: ${pluginId}`, error);\n\t});\n}\n\nexport function createRevokedCapabilityError(owner: string): Error {\n\treturn new Error(`Capability API is revoked: ${owner}`);\n}\n\nexport function isRevokedCapabilityError(error: unknown): boolean {\n\treturn error instanceof Error && error.message.startsWith(\"Capability API is revoked: \");\n}\n\nexport function assertRegisteredCapabilityActive<T>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n): void {\n\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\tthrow createRevokedCapabilityError(registered.owner);\n\t}\n}\n\n/**\n * Invoke an extension-owned callback with a lifecycle check before and after\n * awaiting it. A callback that resolves after its owner is revoked must not\n * publish a late result, and its rejection is normalized to the lifecycle\n * error so callers can distinguish revocation from plugin failures.\n */\nexport async function invokeRegisteredCapability<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered);\n\ttry {\n\t\tconst result = await invoke(registered.value);\n\t\tassertRegisteredCapabilityActive(state, registered);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/**\n * Invoke a policy with its optional host cancellation signal. The signal is\n * checked before dispatch and after the policy settles; revocation remains\n * the stronger lifecycle error when both happen during one invocation.\n */\nexport async function invokeRegisteredCapabilityWithSignal<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tsignal: AbortSignal | undefined,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tif (signal?.aborted) throw cancellationError(signal.reason);\n\ttry {\n\t\tconst result = await invokeRegisteredCapability(state, registered, invoke);\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\tthrow error;\n\t}\n}\n\nexport async function invokePluginCapability<TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredPluginCapability,\n\tinput: unknown,\n\tsignal: AbortSignal,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\ttry {\n\t\tconst result = await registered.handler(detachedSnapshot(input), { signal });\n\t\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\t\treturn detachedSnapshot(result) as TResult;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) throw createRevokedCapabilityError(registered.owner);\n\t\tthrow error;\n\t}\n}\n\nexport function trackOperation<TResult>(\n\tstate: CapabilityRuntimeState,\n\townerTokens: readonly symbol[],\n\thandle: OperationHandle<TResult>,\n): OperationHandle<TResult> {\n\tfor (const ownerToken of ownerTokens) {\n\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken) ?? new Set<OperationHandle<unknown>>();\n\t\thandles.add(handle as OperationHandle<unknown>);\n\t\tstate.activeOperationsByOwnerToken.set(ownerToken, handles);\n\t}\n\tconst remove = () => {\n\t\tfor (const ownerToken of ownerTokens) {\n\t\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\t\t\tif (!handles) continue;\n\t\t\thandles.delete(handle as OperationHandle<unknown>);\n\t\t\tif (handles.size === 0) state.activeOperationsByOwnerToken.delete(ownerToken);\n\t\t}\n\t};\n\tvoid handle.result.then(remove, remove);\n\treturn handle;\n}\n\nexport function cancelOwnedOperations(state: CapabilityRuntimeState, ownerToken: symbol, owner: string): void {\n\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\tif (!handles) return;\n\tstate.activeOperationsByOwnerToken.delete(ownerToken);\n\tconst reason = createRevokedCapabilityError(owner);\n\tfor (const handle of handles) void handle.cancel(reason.message);\n}\n"]}
1
+ {"version":3,"file":"capability-runtime-store.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/capability-runtime-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,sBAAsB,EAGtB,oBAAoB,EACpB,0BAA0B,EAO1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAaX,eAAe,EASf,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,sBAAsB,CAwCrE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAI/F;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAEjE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEhE;AAED,wBAAgB,gCAAgC,CAAC,CAAC,EACjD,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,GACjC,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,CAAC,EAAE,OAAO,EAC1D,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;GAIG;AACH,wBAAsB,oCAAoC,CAAC,CAAC,EAAE,OAAO,EACpE,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC,EACnC,MAAM,EAAE,WAAW,GAAG,SAAS,EAC/B,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAClD,OAAO,CAAC,OAAO,CAAC,CAalB;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EACnD,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,0BAA0B,EACtC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,WAAW,GACjB,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED,wBAAgB,cAAc,CAAC,OAAO,EACrC,KAAK,EAAE,sBAAsB,EAC7B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,GAC9B,eAAe,CAAC,OAAO,CAAC,CAgB1B;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM5G","sourcesContent":["import { cancellationError } from \"./capability-runtime-operation.ts\";\nimport { detachedSnapshot } from \"./capability-runtime-snapshot.ts\";\nimport type {\n\tAPIState,\n\tCapabilityRuntimeState,\n\tOperationHandler,\n\tQueuedLifecycleDelivery,\n\tRegisteredCapability,\n\tRegisteredPluginCapability,\n\tStateWatcher,\n\tStoredContributionPoint,\n\tStoredLifecycleDefinition,\n\tStoredLifecycleRegistration,\n\tStoredOutputArtifact,\n\tStoredState,\n} from \"./capability-runtime-types.ts\";\nimport type { LifecycleDeliveryQueue } from \"./lifecycle-delivery-queue.ts\";\nimport type {\n\tAgentLoopHookHandlerV1,\n\tAgentLoopHookPositionV1,\n\tAgentRunLoopStrategyV1,\n\tBranchSummaryPolicy,\n\tCapabilityAPI,\n\tCapabilityCommandDefinition,\n\tCompactionPolicy,\n\tContextStrategy,\n\tDiagnosticsSpanSnapshot,\n\tDisposableRegistration,\n\tEventEnvelope,\n\tLoggerRecord,\n\tOperationHandle,\n\tOperationStatus,\n\tOverflowPolicy,\n\tPluginRejection,\n\tProviderHeaderTransform,\n\tRetryPolicy,\n\tRuntimeInspectorLifecycleDeliveryReportSnapshot,\n\tSkillDefinition,\n\tStreamFnWrapper,\n} from \"./public-api.ts\";\n\n/**\n * Create the mutable state container for one capability runtime. Every map,\n * set, and array is created once and mutated in place; `eventSequence` is the\n * single mutable primitive shared with the lifecycle dispatch module.\n */\nexport function createCapabilityRuntimeState(): CapabilityRuntimeState {\n\treturn {\n\t\ttools: new Map<string, RegisteredCapability<unknown>>(),\n\t\tskills: new Map<string, RegisteredCapability<SkillDefinition>>(),\n\t\tretryPolicies: new Map<string, RegisteredCapability<RetryPolicy>>(),\n\t\tcompactionPolicies: new Map<string, RegisteredCapability<CompactionPolicy>>(),\n\t\toverflowPolicies: new Map<string, RegisteredCapability<OverflowPolicy>>(),\n\t\tbranchSummaryPolicies: new Map<string, RegisteredCapability<BranchSummaryPolicy>>(),\n\t\trunLoopStrategies: new Map<string, RegisteredCapability<AgentRunLoopStrategyV1>>(),\n\t\tloopHooks: new Map<AgentLoopHookPositionV1, RegisteredCapability<AgentLoopHookHandlerV1>[]>(),\n\t\tcommands: new Map<string, RegisteredCapability<CapabilityCommandDefinition>>(),\n\t\toperations: new Map<string, RegisteredCapability<OperationHandler>>(),\n\t\trpcMethods: new Map<string, RegisteredCapability<(input: unknown) => unknown | Promise<unknown>>>(),\n\t\tcontextStrategies: new Map<string, RegisteredCapability<ContextStrategy>>(),\n\t\tpluginCapabilities: new Map<string, RegisteredPluginCapability>(),\n\t\tproviderHeaderTransforms: new Map<string, RegisteredCapability<ProviderHeaderTransform>>(),\n\t\tstreamFnWrappers: new Map<string, RegisteredCapability<StreamFnWrapper>>(),\n\t\tcontributionPoints: new Map<string, StoredContributionPoint<unknown>>(),\n\t\tlifecycleDefinitions: new Map<string, StoredLifecycleDefinition>(),\n\t\tlifecycleRegistrations: new Map<string, Map<string, StoredLifecycleRegistration>>(),\n\t\tsubscribers: new Map<string, Map<string, RegisteredCapability<(event: EventEnvelope) => void | Promise<void>>>>(),\n\t\tstatuses: new Map<string, OperationStatus>(),\n\t\tactiveOperationsByOwnerToken: new Map<symbol, Set<OperationHandle<unknown>>>(),\n\t\tpluginRegistrations: new Map<string, Set<DisposableRegistration>>(),\n\t\tapiStates: new Map<CapabilityAPI, APIState>(),\n\t\tactiveOwnerTokens: new Set<symbol>(),\n\t\toutputArtifacts: new Map<string, StoredOutputArtifact>(),\n\t\tstateByOwner: new Map<string, Map<string, StoredState>>(),\n\t\tstateRevisionsByOwner: new Map<string, Map<string, number>>(),\n\t\tstateWatchers: new Map<string, Map<string, StateWatcher>>(),\n\t\tstateByInstance: new Map<string, Map<string, Map<string, StoredState>>>(),\n\t\tstateRevisionsByInstance: new Map<string, Map<string, Map<string, number>>>(),\n\t\tstateWatchersByInstance: new Map<string, Map<string, Map<string, StateWatcher>>>(),\n\t\tlogs: [] as LoggerRecord[],\n\t\tspans: new Map<string, DiagnosticsSpanSnapshot>(),\n\t\tlifecycleReports: [] as RuntimeInspectorLifecycleDeliveryReportSnapshot[],\n\t\tlifecycleDeliveryQueues: new Set<LifecycleDeliveryQueue<QueuedLifecycleDelivery<unknown>>>(),\n\t\tpluginRejections: [] as PluginRejection[],\n\t\teventSequence: 0,\n\t};\n}\n\n/**\n * A synchronous bootstrap plugin violated its lifecycle contract after its\n * disposer had already run. The synchronous caller receives a contract error;\n * observe a later rejection too so it cannot become an unhandled promise.\n */\nexport function observeUnexpectedAsyncCleanup(result: PromiseLike<void>, pluginId: string): void {\n\tvoid Promise.resolve(result).catch((error) => {\n\t\tconsole.error(`Asynchronous cleanup rejected after synchronous plugin disposal was rejected: ${pluginId}`, error);\n\t});\n}\n\nexport function createRevokedCapabilityError(owner: string): Error {\n\treturn new Error(`Capability API is revoked: ${owner}`);\n}\n\nexport function isRevokedCapabilityError(error: unknown): boolean {\n\treturn error instanceof Error && error.message.startsWith(\"Capability API is revoked: \");\n}\n\nexport function assertRegisteredCapabilityActive<T>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n): void {\n\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\tthrow createRevokedCapabilityError(registered.owner);\n\t}\n}\n\n/**\n * Invoke an extension-owned callback with a lifecycle check before and after\n * awaiting it. A callback that resolves after its owner is revoked must not\n * publish a late result, and its rejection is normalized to the lifecycle\n * error so callers can distinguish revocation from plugin failures.\n */\nexport async function invokeRegisteredCapability<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered);\n\ttry {\n\t\tconst result = await invoke(registered.value);\n\t\tassertRegisteredCapabilityActive(state, registered);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/**\n * Invoke a policy with its optional host cancellation signal. The signal is\n * checked before dispatch and after the policy settles; revocation remains\n * the stronger lifecycle error when both happen during one invocation.\n */\nexport async function invokeRegisteredCapabilityWithSignal<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tsignal: AbortSignal | undefined,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tif (signal?.aborted) throw cancellationError(signal.reason);\n\ttry {\n\t\tconst result = await invokeRegisteredCapability(state, registered, invoke);\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\tthrow error;\n\t}\n}\n\nexport async function invokePluginCapability<TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredPluginCapability,\n\tinput: unknown,\n\tsignal: AbortSignal,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\ttry {\n\t\tconst result = await registered.handler(detachedSnapshot(input), { signal });\n\t\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\t\treturn detachedSnapshot(result) as TResult;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) throw createRevokedCapabilityError(registered.owner);\n\t\tthrow error;\n\t}\n}\n\nexport function trackOperation<TResult>(\n\tstate: CapabilityRuntimeState,\n\townerTokens: readonly symbol[],\n\thandle: OperationHandle<TResult>,\n): OperationHandle<TResult> {\n\tfor (const ownerToken of ownerTokens) {\n\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken) ?? new Set<OperationHandle<unknown>>();\n\t\thandles.add(handle as OperationHandle<unknown>);\n\t\tstate.activeOperationsByOwnerToken.set(ownerToken, handles);\n\t}\n\tconst remove = () => {\n\t\tfor (const ownerToken of ownerTokens) {\n\t\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\t\t\tif (!handles) continue;\n\t\t\thandles.delete(handle as OperationHandle<unknown>);\n\t\t\tif (handles.size === 0) state.activeOperationsByOwnerToken.delete(ownerToken);\n\t\t}\n\t};\n\tvoid handle.result.then(remove, remove);\n\treturn handle;\n}\n\nexport function cancelOwnedOperations(state: CapabilityRuntimeState, ownerToken: symbol, owner: string): void {\n\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\tif (!handles) return;\n\tstate.activeOperationsByOwnerToken.delete(ownerToken);\n\tconst reason = createRevokedCapabilityError(owner);\n\tfor (const handle of handles) void handle.cancel(reason.message);\n}\n"]}
@@ -21,6 +21,7 @@ export function createCapabilityRuntimeState() {
21
21
  contextStrategies: new Map(),
22
22
  pluginCapabilities: new Map(),
23
23
  providerHeaderTransforms: new Map(),
24
+ streamFnWrappers: new Map(),
24
25
  contributionPoints: new Map(),
25
26
  lifecycleDefinitions: new Map(),
26
27
  lifecycleRegistrations: new Map(),
@@ -1 +1 @@
1
- {"version":3,"file":"capability-runtime-store.js","sourceRoot":"","sources":["../../../src/core/extensions/capability-runtime-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAuCpE;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,GAA2B;IACtE,OAAO;QACN,KAAK,EAAE,IAAI,GAAG,EAAyC;QACvD,MAAM,EAAE,IAAI,GAAG,EAAiD;QAChE,aAAa,EAAE,IAAI,GAAG,EAA6C;QACnE,kBAAkB,EAAE,IAAI,GAAG,EAAkD;QAC7E,gBAAgB,EAAE,IAAI,GAAG,EAAgD;QACzE,qBAAqB,EAAE,IAAI,GAAG,EAAqD;QACnF,iBAAiB,EAAE,IAAI,GAAG,EAAwD;QAClF,SAAS,EAAE,IAAI,GAAG,EAA2E;QAC7F,QAAQ,EAAE,IAAI,GAAG,EAA6D;QAC9E,UAAU,EAAE,IAAI,GAAG,EAAkD;QACrE,UAAU,EAAE,IAAI,GAAG,EAAgF;QACnG,iBAAiB,EAAE,IAAI,GAAG,EAAiD;QAC3E,kBAAkB,EAAE,IAAI,GAAG,EAAsC;QACjE,wBAAwB,EAAE,IAAI,GAAG,EAAyD;QAC1F,kBAAkB,EAAE,IAAI,GAAG,EAA4C;QACvE,oBAAoB,EAAE,IAAI,GAAG,EAAqC;QAClE,sBAAsB,EAAE,IAAI,GAAG,EAAoD;QACnF,WAAW,EAAE,IAAI,GAAG,EAA6F;QACjH,QAAQ,EAAE,IAAI,GAAG,EAA2B;QAC5C,4BAA4B,EAAE,IAAI,GAAG,EAAyC;QAC9E,mBAAmB,EAAE,IAAI,GAAG,EAAuC;QACnE,SAAS,EAAE,IAAI,GAAG,EAA2B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AAG,KAAK,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACnE,IAAI,CAAC,OAAO;gBAAE,SAAS;YACvB,OAAO,CAAC,MAAM,CAAC,MAAkC,CAAC,CAAC;YACnD,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;gBAAE,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC/E,CAAC;IAAA,CACD,CAAC;IACF,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAAA,CACd;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA6B,EAAE,UAAkB,EAAE,KAAa,EAAQ;IAC7G,MAAM,OAAO,GAAG,KAAK,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnE,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IACnD,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAAA,CACjE","sourcesContent":["import { cancellationError } from \"./capability-runtime-operation.ts\";\nimport { detachedSnapshot } from \"./capability-runtime-snapshot.ts\";\nimport type {\n\tAPIState,\n\tCapabilityRuntimeState,\n\tOperationHandler,\n\tQueuedLifecycleDelivery,\n\tRegisteredCapability,\n\tRegisteredPluginCapability,\n\tStateWatcher,\n\tStoredContributionPoint,\n\tStoredLifecycleDefinition,\n\tStoredLifecycleRegistration,\n\tStoredOutputArtifact,\n\tStoredState,\n} from \"./capability-runtime-types.ts\";\nimport type { LifecycleDeliveryQueue } from \"./lifecycle-delivery-queue.ts\";\nimport type {\n\tAgentLoopHookHandlerV1,\n\tAgentLoopHookPositionV1,\n\tAgentRunLoopStrategyV1,\n\tBranchSummaryPolicy,\n\tCapabilityAPI,\n\tCapabilityCommandDefinition,\n\tCompactionPolicy,\n\tContextStrategy,\n\tDiagnosticsSpanSnapshot,\n\tDisposableRegistration,\n\tEventEnvelope,\n\tLoggerRecord,\n\tOperationHandle,\n\tOperationStatus,\n\tOverflowPolicy,\n\tPluginRejection,\n\tProviderHeaderTransform,\n\tRetryPolicy,\n\tRuntimeInspectorLifecycleDeliveryReportSnapshot,\n\tSkillDefinition,\n} from \"./public-api.ts\";\n\n/**\n * Create the mutable state container for one capability runtime. Every map,\n * set, and array is created once and mutated in place; `eventSequence` is the\n * single mutable primitive shared with the lifecycle dispatch module.\n */\nexport function createCapabilityRuntimeState(): CapabilityRuntimeState {\n\treturn {\n\t\ttools: new Map<string, RegisteredCapability<unknown>>(),\n\t\tskills: new Map<string, RegisteredCapability<SkillDefinition>>(),\n\t\tretryPolicies: new Map<string, RegisteredCapability<RetryPolicy>>(),\n\t\tcompactionPolicies: new Map<string, RegisteredCapability<CompactionPolicy>>(),\n\t\toverflowPolicies: new Map<string, RegisteredCapability<OverflowPolicy>>(),\n\t\tbranchSummaryPolicies: new Map<string, RegisteredCapability<BranchSummaryPolicy>>(),\n\t\trunLoopStrategies: new Map<string, RegisteredCapability<AgentRunLoopStrategyV1>>(),\n\t\tloopHooks: new Map<AgentLoopHookPositionV1, RegisteredCapability<AgentLoopHookHandlerV1>[]>(),\n\t\tcommands: new Map<string, RegisteredCapability<CapabilityCommandDefinition>>(),\n\t\toperations: new Map<string, RegisteredCapability<OperationHandler>>(),\n\t\trpcMethods: new Map<string, RegisteredCapability<(input: unknown) => unknown | Promise<unknown>>>(),\n\t\tcontextStrategies: new Map<string, RegisteredCapability<ContextStrategy>>(),\n\t\tpluginCapabilities: new Map<string, RegisteredPluginCapability>(),\n\t\tproviderHeaderTransforms: new Map<string, RegisteredCapability<ProviderHeaderTransform>>(),\n\t\tcontributionPoints: new Map<string, StoredContributionPoint<unknown>>(),\n\t\tlifecycleDefinitions: new Map<string, StoredLifecycleDefinition>(),\n\t\tlifecycleRegistrations: new Map<string, Map<string, StoredLifecycleRegistration>>(),\n\t\tsubscribers: new Map<string, Map<string, RegisteredCapability<(event: EventEnvelope) => void | Promise<void>>>>(),\n\t\tstatuses: new Map<string, OperationStatus>(),\n\t\tactiveOperationsByOwnerToken: new Map<symbol, Set<OperationHandle<unknown>>>(),\n\t\tpluginRegistrations: new Map<string, Set<DisposableRegistration>>(),\n\t\tapiStates: new Map<CapabilityAPI, APIState>(),\n\t\tactiveOwnerTokens: new Set<symbol>(),\n\t\toutputArtifacts: new Map<string, StoredOutputArtifact>(),\n\t\tstateByOwner: new Map<string, Map<string, StoredState>>(),\n\t\tstateRevisionsByOwner: new Map<string, Map<string, number>>(),\n\t\tstateWatchers: new Map<string, Map<string, StateWatcher>>(),\n\t\tstateByInstance: new Map<string, Map<string, Map<string, StoredState>>>(),\n\t\tstateRevisionsByInstance: new Map<string, Map<string, Map<string, number>>>(),\n\t\tstateWatchersByInstance: new Map<string, Map<string, Map<string, StateWatcher>>>(),\n\t\tlogs: [] as LoggerRecord[],\n\t\tspans: new Map<string, DiagnosticsSpanSnapshot>(),\n\t\tlifecycleReports: [] as RuntimeInspectorLifecycleDeliveryReportSnapshot[],\n\t\tlifecycleDeliveryQueues: new Set<LifecycleDeliveryQueue<QueuedLifecycleDelivery<unknown>>>(),\n\t\tpluginRejections: [] as PluginRejection[],\n\t\teventSequence: 0,\n\t};\n}\n\n/**\n * A synchronous bootstrap plugin violated its lifecycle contract after its\n * disposer had already run. The synchronous caller receives a contract error;\n * observe a later rejection too so it cannot become an unhandled promise.\n */\nexport function observeUnexpectedAsyncCleanup(result: PromiseLike<void>, pluginId: string): void {\n\tvoid Promise.resolve(result).catch((error) => {\n\t\tconsole.error(`Asynchronous cleanup rejected after synchronous plugin disposal was rejected: ${pluginId}`, error);\n\t});\n}\n\nexport function createRevokedCapabilityError(owner: string): Error {\n\treturn new Error(`Capability API is revoked: ${owner}`);\n}\n\nexport function isRevokedCapabilityError(error: unknown): boolean {\n\treturn error instanceof Error && error.message.startsWith(\"Capability API is revoked: \");\n}\n\nexport function assertRegisteredCapabilityActive<T>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n): void {\n\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\tthrow createRevokedCapabilityError(registered.owner);\n\t}\n}\n\n/**\n * Invoke an extension-owned callback with a lifecycle check before and after\n * awaiting it. A callback that resolves after its owner is revoked must not\n * publish a late result, and its rejection is normalized to the lifecycle\n * error so callers can distinguish revocation from plugin failures.\n */\nexport async function invokeRegisteredCapability<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered);\n\ttry {\n\t\tconst result = await invoke(registered.value);\n\t\tassertRegisteredCapabilityActive(state, registered);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/**\n * Invoke a policy with its optional host cancellation signal. The signal is\n * checked before dispatch and after the policy settles; revocation remains\n * the stronger lifecycle error when both happen during one invocation.\n */\nexport async function invokeRegisteredCapabilityWithSignal<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tsignal: AbortSignal | undefined,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tif (signal?.aborted) throw cancellationError(signal.reason);\n\ttry {\n\t\tconst result = await invokeRegisteredCapability(state, registered, invoke);\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\tthrow error;\n\t}\n}\n\nexport async function invokePluginCapability<TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredPluginCapability,\n\tinput: unknown,\n\tsignal: AbortSignal,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\ttry {\n\t\tconst result = await registered.handler(detachedSnapshot(input), { signal });\n\t\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\t\treturn detachedSnapshot(result) as TResult;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) throw createRevokedCapabilityError(registered.owner);\n\t\tthrow error;\n\t}\n}\n\nexport function trackOperation<TResult>(\n\tstate: CapabilityRuntimeState,\n\townerTokens: readonly symbol[],\n\thandle: OperationHandle<TResult>,\n): OperationHandle<TResult> {\n\tfor (const ownerToken of ownerTokens) {\n\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken) ?? new Set<OperationHandle<unknown>>();\n\t\thandles.add(handle as OperationHandle<unknown>);\n\t\tstate.activeOperationsByOwnerToken.set(ownerToken, handles);\n\t}\n\tconst remove = () => {\n\t\tfor (const ownerToken of ownerTokens) {\n\t\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\t\t\tif (!handles) continue;\n\t\t\thandles.delete(handle as OperationHandle<unknown>);\n\t\t\tif (handles.size === 0) state.activeOperationsByOwnerToken.delete(ownerToken);\n\t\t}\n\t};\n\tvoid handle.result.then(remove, remove);\n\treturn handle;\n}\n\nexport function cancelOwnedOperations(state: CapabilityRuntimeState, ownerToken: symbol, owner: string): void {\n\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\tif (!handles) return;\n\tstate.activeOperationsByOwnerToken.delete(ownerToken);\n\tconst reason = createRevokedCapabilityError(owner);\n\tfor (const handle of handles) void handle.cancel(reason.message);\n}\n"]}
1
+ {"version":3,"file":"capability-runtime-store.js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AAO,CAAC,MAAM,CAAC,MAAkC,CAAC,CAAC;YACnD,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;gBAAE,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC/E,CAAC;IAAA,CACD,CAAC;IACF,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAAA,CACd;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA6B,EAAE,UAAkB,EAAE,KAAa,EAAQ;IAC7G,MAAM,OAAO,GAAG,KAAK,CAAC,4BAA4B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnE,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IACnD,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAAA,CACjE","sourcesContent":["import { cancellationError } from \"./capability-runtime-operation.ts\";\nimport { detachedSnapshot } from \"./capability-runtime-snapshot.ts\";\nimport type {\n\tAPIState,\n\tCapabilityRuntimeState,\n\tOperationHandler,\n\tQueuedLifecycleDelivery,\n\tRegisteredCapability,\n\tRegisteredPluginCapability,\n\tStateWatcher,\n\tStoredContributionPoint,\n\tStoredLifecycleDefinition,\n\tStoredLifecycleRegistration,\n\tStoredOutputArtifact,\n\tStoredState,\n} from \"./capability-runtime-types.ts\";\nimport type { LifecycleDeliveryQueue } from \"./lifecycle-delivery-queue.ts\";\nimport type {\n\tAgentLoopHookHandlerV1,\n\tAgentLoopHookPositionV1,\n\tAgentRunLoopStrategyV1,\n\tBranchSummaryPolicy,\n\tCapabilityAPI,\n\tCapabilityCommandDefinition,\n\tCompactionPolicy,\n\tContextStrategy,\n\tDiagnosticsSpanSnapshot,\n\tDisposableRegistration,\n\tEventEnvelope,\n\tLoggerRecord,\n\tOperationHandle,\n\tOperationStatus,\n\tOverflowPolicy,\n\tPluginRejection,\n\tProviderHeaderTransform,\n\tRetryPolicy,\n\tRuntimeInspectorLifecycleDeliveryReportSnapshot,\n\tSkillDefinition,\n\tStreamFnWrapper,\n} from \"./public-api.ts\";\n\n/**\n * Create the mutable state container for one capability runtime. Every map,\n * set, and array is created once and mutated in place; `eventSequence` is the\n * single mutable primitive shared with the lifecycle dispatch module.\n */\nexport function createCapabilityRuntimeState(): CapabilityRuntimeState {\n\treturn {\n\t\ttools: new Map<string, RegisteredCapability<unknown>>(),\n\t\tskills: new Map<string, RegisteredCapability<SkillDefinition>>(),\n\t\tretryPolicies: new Map<string, RegisteredCapability<RetryPolicy>>(),\n\t\tcompactionPolicies: new Map<string, RegisteredCapability<CompactionPolicy>>(),\n\t\toverflowPolicies: new Map<string, RegisteredCapability<OverflowPolicy>>(),\n\t\tbranchSummaryPolicies: new Map<string, RegisteredCapability<BranchSummaryPolicy>>(),\n\t\trunLoopStrategies: new Map<string, RegisteredCapability<AgentRunLoopStrategyV1>>(),\n\t\tloopHooks: new Map<AgentLoopHookPositionV1, RegisteredCapability<AgentLoopHookHandlerV1>[]>(),\n\t\tcommands: new Map<string, RegisteredCapability<CapabilityCommandDefinition>>(),\n\t\toperations: new Map<string, RegisteredCapability<OperationHandler>>(),\n\t\trpcMethods: new Map<string, RegisteredCapability<(input: unknown) => unknown | Promise<unknown>>>(),\n\t\tcontextStrategies: new Map<string, RegisteredCapability<ContextStrategy>>(),\n\t\tpluginCapabilities: new Map<string, RegisteredPluginCapability>(),\n\t\tproviderHeaderTransforms: new Map<string, RegisteredCapability<ProviderHeaderTransform>>(),\n\t\tstreamFnWrappers: new Map<string, RegisteredCapability<StreamFnWrapper>>(),\n\t\tcontributionPoints: new Map<string, StoredContributionPoint<unknown>>(),\n\t\tlifecycleDefinitions: new Map<string, StoredLifecycleDefinition>(),\n\t\tlifecycleRegistrations: new Map<string, Map<string, StoredLifecycleRegistration>>(),\n\t\tsubscribers: new Map<string, Map<string, RegisteredCapability<(event: EventEnvelope) => void | Promise<void>>>>(),\n\t\tstatuses: new Map<string, OperationStatus>(),\n\t\tactiveOperationsByOwnerToken: new Map<symbol, Set<OperationHandle<unknown>>>(),\n\t\tpluginRegistrations: new Map<string, Set<DisposableRegistration>>(),\n\t\tapiStates: new Map<CapabilityAPI, APIState>(),\n\t\tactiveOwnerTokens: new Set<symbol>(),\n\t\toutputArtifacts: new Map<string, StoredOutputArtifact>(),\n\t\tstateByOwner: new Map<string, Map<string, StoredState>>(),\n\t\tstateRevisionsByOwner: new Map<string, Map<string, number>>(),\n\t\tstateWatchers: new Map<string, Map<string, StateWatcher>>(),\n\t\tstateByInstance: new Map<string, Map<string, Map<string, StoredState>>>(),\n\t\tstateRevisionsByInstance: new Map<string, Map<string, Map<string, number>>>(),\n\t\tstateWatchersByInstance: new Map<string, Map<string, Map<string, StateWatcher>>>(),\n\t\tlogs: [] as LoggerRecord[],\n\t\tspans: new Map<string, DiagnosticsSpanSnapshot>(),\n\t\tlifecycleReports: [] as RuntimeInspectorLifecycleDeliveryReportSnapshot[],\n\t\tlifecycleDeliveryQueues: new Set<LifecycleDeliveryQueue<QueuedLifecycleDelivery<unknown>>>(),\n\t\tpluginRejections: [] as PluginRejection[],\n\t\teventSequence: 0,\n\t};\n}\n\n/**\n * A synchronous bootstrap plugin violated its lifecycle contract after its\n * disposer had already run. The synchronous caller receives a contract error;\n * observe a later rejection too so it cannot become an unhandled promise.\n */\nexport function observeUnexpectedAsyncCleanup(result: PromiseLike<void>, pluginId: string): void {\n\tvoid Promise.resolve(result).catch((error) => {\n\t\tconsole.error(`Asynchronous cleanup rejected after synchronous plugin disposal was rejected: ${pluginId}`, error);\n\t});\n}\n\nexport function createRevokedCapabilityError(owner: string): Error {\n\treturn new Error(`Capability API is revoked: ${owner}`);\n}\n\nexport function isRevokedCapabilityError(error: unknown): boolean {\n\treturn error instanceof Error && error.message.startsWith(\"Capability API is revoked: \");\n}\n\nexport function assertRegisteredCapabilityActive<T>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n): void {\n\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\tthrow createRevokedCapabilityError(registered.owner);\n\t}\n}\n\n/**\n * Invoke an extension-owned callback with a lifecycle check before and after\n * awaiting it. A callback that resolves after its owner is revoked must not\n * publish a late result, and its rejection is normalized to the lifecycle\n * error so callers can distinguish revocation from plugin failures.\n */\nexport async function invokeRegisteredCapability<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered);\n\ttry {\n\t\tconst result = await invoke(registered.value);\n\t\tassertRegisteredCapabilityActive(state, registered);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\n/**\n * Invoke a policy with its optional host cancellation signal. The signal is\n * checked before dispatch and after the policy settles; revocation remains\n * the stronger lifecycle error when both happen during one invocation.\n */\nexport async function invokeRegisteredCapabilityWithSignal<T, TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredCapability<T>,\n\tsignal: AbortSignal | undefined,\n\tinvoke: (value: T) => TResult | PromiseLike<TResult>,\n): Promise<TResult> {\n\tif (signal?.aborted) throw cancellationError(signal.reason);\n\ttry {\n\t\tconst result = await invokeRegisteredCapability(state, registered, invoke);\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\treturn result;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) {\n\t\t\tthrow createRevokedCapabilityError(registered.owner);\n\t\t}\n\t\tif (signal?.aborted) throw cancellationError(signal.reason);\n\t\tthrow error;\n\t}\n}\n\nexport async function invokePluginCapability<TResult>(\n\tstate: CapabilityRuntimeState,\n\tregistered: RegisteredPluginCapability,\n\tinput: unknown,\n\tsignal: AbortSignal,\n): Promise<TResult> {\n\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\ttry {\n\t\tconst result = await registered.handler(detachedSnapshot(input), { signal });\n\t\tassertRegisteredCapabilityActive(state, registered as unknown as RegisteredCapability<unknown>);\n\t\treturn detachedSnapshot(result) as TResult;\n\t} catch (error) {\n\t\tif (!state.activeOwnerTokens.has(registered.ownerToken)) throw createRevokedCapabilityError(registered.owner);\n\t\tthrow error;\n\t}\n}\n\nexport function trackOperation<TResult>(\n\tstate: CapabilityRuntimeState,\n\townerTokens: readonly symbol[],\n\thandle: OperationHandle<TResult>,\n): OperationHandle<TResult> {\n\tfor (const ownerToken of ownerTokens) {\n\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken) ?? new Set<OperationHandle<unknown>>();\n\t\thandles.add(handle as OperationHandle<unknown>);\n\t\tstate.activeOperationsByOwnerToken.set(ownerToken, handles);\n\t}\n\tconst remove = () => {\n\t\tfor (const ownerToken of ownerTokens) {\n\t\t\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\t\t\tif (!handles) continue;\n\t\t\thandles.delete(handle as OperationHandle<unknown>);\n\t\t\tif (handles.size === 0) state.activeOperationsByOwnerToken.delete(ownerToken);\n\t\t}\n\t};\n\tvoid handle.result.then(remove, remove);\n\treturn handle;\n}\n\nexport function cancelOwnedOperations(state: CapabilityRuntimeState, ownerToken: symbol, owner: string): void {\n\tconst handles = state.activeOperationsByOwnerToken.get(ownerToken);\n\tif (!handles) return;\n\tstate.activeOperationsByOwnerToken.delete(ownerToken);\n\tconst reason = createRevokedCapabilityError(owner);\n\tfor (const handle of handles) void handle.cancel(reason.message);\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { DurableServiceV1 } from "../../durable/durable-service.ts";
2
2
  import type { ObservabilityHostAdapterV1, TraceSinkOptionsV1 } from "../../plugins/observability-types.ts";
3
3
  import type { LifecycleDeliveryQueue } from "./lifecycle-delivery-queue.ts";
4
- import type { AgentCompositionAPI, AgentDefinition, AgentInstance, AgentLoopHookForV1, AgentLoopHookHandlerV1, AgentLoopHookPositionV1, AgentModelInvocationResultV1, AgentRunLoopStrategyDecisionV1, AgentRunLoopStrategyRequestV1, AgentRunLoopStrategyV1, AgentTaskAdapter, AgentTaskSessionSummaryV1, AgentTaskSessionViewV1, BranchSummaryPolicy, BranchSummaryResult, CapabilityAPI, CapabilityCommandContext, CapabilityCommandDefinition, CapabilityCommandResult, CapabilityProviderHandler, CapabilityToolContext, CompactionPolicy, CompactionPolicyDecision, CompactionPolicyRequest, CompactionPreparationRequest, CompactionSummaryRequest, CompactionSummaryResult, ContextOperationOptions, ContextStrategy, ContributionChangeEvent, ContributionEntry, ContributionLifecycle, ContributionPointDefinition, CredentialAPI, DiagnosticsSpanSnapshot, DisposableRegistration, EventEnvelope, ExecutionFactsV1, HostCapabilities, InteractionHostV1, LifecycleAfterCommitHandler, LifecycleDeliverySnapshot, LifecycleDispatchRequest, LifecycleDispatchResult, LifecycleEvent, LifecycleEventDefinition, LifecycleExecuteHandler, LifecycleObserveHandler, LifecycleRegistrationKind, LifecycleTransformHandler, LoggerRecord, OperationExecutionContext, OperationHandle, OperationStatus, OutputArtifactRef, OverflowPolicy, OverflowPolicyDecision, OverflowPolicyRequest, PluginCapabilityDeclaration, PluginConfigValue, PluginManifest, PluginRejection, ProviderHeaderTransform, ProviderHeaderTransformRequest, RetryClassificationRequest, RetryPolicy, RetryPolicyDecision, RetryPolicyRequest, RetryScheduleV1, RuntimeInspectorLifecycleDeliveryReportSnapshot, RuntimeInspectorSnapshot, SessionAPI, SkillDefinition, StateChange } from "./public-api.ts";
4
+ import type { AgentCompositionAPI, AgentDefinition, AgentInstance, AgentLoopHookForV1, AgentLoopHookHandlerV1, AgentLoopHookPositionV1, AgentModelInvocationResultV1, AgentRunLoopStrategyDecisionV1, AgentRunLoopStrategyRequestV1, AgentRunLoopStrategyV1, AgentTaskAdapter, AgentTaskSessionSummaryV1, AgentTaskSessionViewV1, BranchSummaryPolicy, BranchSummaryResult, CapabilityAPI, CapabilityCommandContext, CapabilityCommandDefinition, CapabilityCommandResult, CapabilityProviderHandler, CapabilityToolContext, CompactionPolicy, CompactionPolicyDecision, CompactionPolicyRequest, CompactionPreparationRequest, CompactionSummaryRequest, CompactionSummaryResult, ContextOperationOptions, ContextStrategy, ContributionChangeEvent, ContributionEntry, ContributionLifecycle, ContributionPointDefinition, CredentialAPI, DiagnosticsSpanSnapshot, DisposableRegistration, EventEnvelope, ExecutionFactsV1, HostCapabilities, InteractionHostV1, LifecycleAfterCommitHandler, LifecycleDeliverySnapshot, LifecycleDispatchRequest, LifecycleDispatchResult, LifecycleEvent, LifecycleEventDefinition, LifecycleExecuteHandler, LifecycleObserveHandler, LifecycleRegistrationKind, LifecycleTransformHandler, LoggerRecord, OperationExecutionContext, OperationHandle, OperationStatus, OutputArtifactRef, OverflowPolicy, OverflowPolicyDecision, OverflowPolicyRequest, PluginCapabilityDeclaration, PluginConfigValue, PluginManifest, PluginRejection, ProviderHeaderTransform, ProviderHeaderTransformRequest, RetryClassificationRequest, RetryPolicy, RetryPolicyDecision, RetryPolicyRequest, RetryScheduleV1, RuntimeInspectorLifecycleDeliveryReportSnapshot, RuntimeInspectorSnapshot, SessionAPI, SkillDefinition, StateChange, StreamFnWrapper } from "./public-api.ts";
5
5
  /** Host trace service injection (D-075 S4 second batch observability host contract). */
6
6
  export interface TraceServiceV1 {
7
7
  readonly adapter: ObservabilityHostAdapterV1;
@@ -238,6 +238,12 @@ export interface CapabilityRuntime {
238
238
  getLoopHookChain<P extends AgentLoopHookPositionV1>(position: P): readonly AgentLoopHookForV1<P>[];
239
239
  hasRunLoopStrategy(name: string): boolean;
240
240
  decideRunLoop(name: string, request: AgentRunLoopStrategyRequestV1): Promise<AgentRunLoopStrategyDecisionV1>;
241
+ /**
242
+ * 活跃后台委派数(设计 子代理运行时 §4.2 中断分级,2026-10-02):活任务
243
+ * 集合(创建即入;终态经投影按状态过滤,成员随 dispose 释放)的有界投影,供宿主做 Esc 分级提示与
244
+ * /stop-agents 反馈;无 agents feature 的 runtime 恒为 0。
245
+ */
246
+ getActiveAgentTaskCount(): number;
241
247
  invokeTool(name: string, input: unknown, options?: {
242
248
  readonly signal?: AbortSignal;
243
249
  }): Promise<unknown>;
@@ -251,6 +257,14 @@ export interface CapabilityRuntime {
251
257
  restoreContext(name: string, snapshot: unknown, options?: ContextOperationOptions): Promise<unknown>;
252
258
  replaceContext(name: string, context: unknown, options?: ContextOperationOptions): Promise<unknown>;
253
259
  transformProviderHeaders(request: ProviderHeaderTransformRequest): Promise<Record<string, string | null>>;
260
+ /**
261
+ * Ordered stream-function wrappers registered through the public
262
+ * `registerStreamFnWrapper` face (provider-failover family), filtered by
263
+ * active owners, in registration order (first registered = outermost).
264
+ * The host's default stream assembly composes them around its own stream
265
+ * call at request time.
266
+ */
267
+ getStreamFnWrappers(): readonly StreamFnWrapper[];
254
268
  getOperationStatus(id: string): OperationStatus | undefined;
255
269
  drainLifecycleDeliveries(): Promise<void>;
256
270
  inspect(): RuntimeInspectorSnapshot;
@@ -275,6 +289,7 @@ export interface CapabilityRuntimeState {
275
289
  readonly contextStrategies: Map<string, RegisteredCapability<ContextStrategy>>;
276
290
  readonly pluginCapabilities: Map<string, RegisteredPluginCapability>;
277
291
  readonly providerHeaderTransforms: Map<string, RegisteredCapability<ProviderHeaderTransform>>;
292
+ readonly streamFnWrappers: Map<string, RegisteredCapability<StreamFnWrapper>>;
278
293
  readonly contributionPoints: Map<string, StoredContributionPoint<unknown>>;
279
294
  readonly lifecycleDefinitions: Map<string, StoredLifecycleDefinition>;
280
295
  readonly lifecycleRegistrations: Map<string, Map<string, StoredLifecycleRegistration>>;