@ai-agent-forge/agent-forge 0.86.7 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +10 -11
- package/dist/artifacts/artifact-store.d.ts.map +1 -1
- package/dist/artifacts/artifact-store.js +9 -5
- package/dist/artifacts/artifact-store.js.map +1 -1
- package/dist/bundle/.build-manifest.json +430 -413
- package/dist/bundle/chunks/{chunk-A7GUOX2H.js → chunk-6ZKDNZHA.js} +5 -1
- package/dist/bundle/chunks/chunk-HLJEVRWP.js +13 -0
- package/dist/bundle/chunks/chunk-YGHQME4V.js +1456 -0
- package/dist/bundle/chunks/image-resize-worker.js +12 -1
- package/dist/bundle/chunks/{virtual-modules-3IZ4MYSQ.js → virtual-modules-KZ5DRH7Q.js} +1 -1
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/client.js +1 -1
- package/dist/bundle/index.js +2 -2
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +231 -185
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js +17 -4
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +15 -9
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +14 -7
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/experimental/command.d.ts.map +1 -1
- package/dist/cli/experimental/command.js +6 -5
- package/dist/cli/experimental/command.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +9 -8
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/plugin-manager-controller.d.ts.map +1 -1
- package/dist/cli/plugin-manager-controller.js +2 -1
- package/dist/cli/plugin-manager-controller.js.map +1 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +8 -5
- package/dist/cli/serve.js.map +1 -1
- package/dist/client/remote-session.d.ts.map +1 -1
- package/dist/client/remote-session.js +16 -9
- package/dist/client/remote-session.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -3
- package/dist/config.js.map +1 -1
- package/dist/core/agent-capability-contract.d.ts +0 -7
- package/dist/core/agent-capability-contract.d.ts.map +1 -1
- package/dist/core/agent-capability-contract.js +72 -68
- package/dist/core/agent-capability-contract.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +5 -4
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts +6 -10
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +35 -133
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-context.d.ts.map +1 -1
- package/dist/core/agent-session-context.js +18 -13
- package/dist/core/agent-session-context.js.map +1 -1
- package/dist/core/agent-session-internal.d.ts +0 -6
- package/dist/core/agent-session-internal.d.ts.map +1 -1
- package/dist/core/agent-session-internal.js.map +1 -1
- package/dist/core/agent-session-model.d.ts.map +1 -1
- package/dist/core/agent-session-model.js +2 -1
- package/dist/core/agent-session-model.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +3 -3
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +7 -6
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-tools.d.ts.map +1 -1
- package/dist/core/agent-session-tools.js +3 -2
- package/dist/core/agent-session-tools.js.map +1 -1
- package/dist/core/agent-session.d.ts +40 -22
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +147 -67
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-guidance.js +11 -5
- package/dist/core/auth-guidance.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +9 -6
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +2 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/embedded-sdk.d.ts.map +1 -1
- package/dist/core/embedded-sdk.js +10 -6
- package/dist/core/embedded-sdk.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +9 -4
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/agent-composition.d.ts.map +1 -1
- package/dist/core/extensions/agent-composition.js +26 -19
- package/dist/core/extensions/agent-composition.js.map +1 -1
- package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-agent-loop.js +3 -2
- package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -1
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-compaction-policy.js +0 -34
- package/dist/core/extensions/bootstrap-compaction-policy.js.map +1 -1
- package/dist/core/extensions/bootstrap-lifecycle.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-lifecycle.js +20 -17
- package/dist/core/extensions/bootstrap-lifecycle.js.map +1 -1
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-overflow-policy.js +2 -1
- package/dist/core/extensions/bootstrap-overflow-policy.js.map +1 -1
- package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-retry-policy.js +4 -3
- package/dist/core/extensions/bootstrap-retry-policy.js.map +1 -1
- package/dist/core/extensions/bootstrap-skills.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-skills.js +7 -6
- package/dist/core/extensions/bootstrap-skills.js.map +1 -1
- package/dist/core/extensions/bootstrap-tools.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-tools.js +2 -1
- package/dist/core/extensions/bootstrap-tools.js.map +1 -1
- package/dist/core/extensions/capability-plugin.d.ts.map +1 -1
- package/dist/core/extensions/capability-plugin.js +37 -13
- package/dist/core/extensions/capability-plugin.js.map +1 -1
- package/dist/core/extensions/capability-runtime-events.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-events.js +17 -13
- package/dist/core/extensions/capability-runtime-events.js.map +1 -1
- package/dist/core/extensions/capability-runtime-guards.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-guards.js +16 -15
- package/dist/core/extensions/capability-runtime-guards.js.map +1 -1
- package/dist/core/extensions/capability-runtime-manifest.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-manifest.js +52 -30
- package/dist/core/extensions/capability-runtime-manifest.js.map +1 -1
- package/dist/core/extensions/capability-runtime-validation.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-validation.js +66 -65
- package/dist/core/extensions/capability-runtime-validation.js.map +1 -1
- package/dist/core/extensions/capability-runtime.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime.js +147 -127
- package/dist/core/extensions/capability-runtime.js.map +1 -1
- package/dist/core/extensions/compaction-memory-failure-mode.d.ts.map +1 -1
- package/dist/core/extensions/compaction-memory-failure-mode.js +3 -2
- package/dist/core/extensions/compaction-memory-failure-mode.js.map +1 -1
- package/dist/core/extensions/context-strategy-binding.d.ts.map +1 -1
- package/dist/core/extensions/context-strategy-binding.js +7 -4
- package/dist/core/extensions/context-strategy-binding.js.map +1 -1
- package/dist/core/extensions/lifecycle-catalog.d.ts.map +1 -1
- package/dist/core/extensions/lifecycle-catalog.js +290 -279
- package/dist/core/extensions/lifecycle-catalog.js.map +1 -1
- package/dist/core/extensions/lifecycle-delivery-queue.d.ts.map +1 -1
- package/dist/core/extensions/lifecycle-delivery-queue.js +3 -2
- package/dist/core/extensions/lifecycle-delivery-queue.js.map +1 -1
- package/dist/core/extensions/provider-failover.d.ts +7 -3
- package/dist/core/extensions/provider-failover.d.ts.map +1 -1
- package/dist/core/extensions/provider-failover.js +9 -8
- package/dist/core/extensions/provider-failover.js.map +1 -1
- package/dist/core/facade/coding-agent-facade.d.ts +6 -6
- package/dist/core/facade/coding-agent-facade.d.ts.map +1 -1
- package/dist/core/facade/coding-agent-facade.js +2 -3
- package/dist/core/facade/coding-agent-facade.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/i18n/index.d.ts +14 -0
- package/dist/core/i18n/index.d.ts.map +1 -0
- package/dist/core/i18n/index.js +67 -0
- package/dist/core/i18n/index.js.map +1 -0
- package/dist/core/i18n/locales/en/example.d.ts +7 -0
- package/dist/core/i18n/locales/en/example.d.ts.map +1 -0
- package/dist/core/i18n/locales/en/example.js +7 -0
- package/dist/core/i18n/locales/en/example.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/cli.d.ts +8 -0
- package/dist/core/i18n/locales/zh-cn/cli.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/cli.js +229 -0
- package/dist/core/i18n/locales/zh-cn/cli.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/common.d.ts +6 -0
- package/dist/core/i18n/locales/zh-cn/common.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/common.js +6 -0
- package/dist/core/i18n/locales/zh-cn/common.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts +13 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-core.js +173 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-core.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts +12 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js +582 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts +9 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-final.js +55 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-final.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.d.ts +11 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js +455 -0
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-errors.d.ts +9 -0
- package/dist/core/i18n/locales/zh-cn/core-errors.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/core-errors.js +191 -0
- package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/example.d.ts +7 -0
- package/dist/core/i18n/locales/zh-cn/example.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/example.js +10 -0
- package/dist/core/i18n/locales/zh-cn/example.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/index.d.ts +2 -0
- package/dist/core/i18n/locales/zh-cn/index.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/index.js +41 -0
- package/dist/core/i18n/locales/zh-cn/index.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts +10 -0
- package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js +267 -0
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/keybindings.d.ts +11 -0
- package/dist/core/i18n/locales/zh-cn/keybindings.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/keybindings.js +67 -0
- package/dist/core/i18n/locales/zh-cn/keybindings.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.d.ts +7 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.js +39 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-builtin.d.ts +10 -0
- package/dist/core/i18n/locales/zh-cn/tui-builtin.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-builtin.js +15 -0
- package/dist/core/i18n/locales/zh-cn/tui-builtin.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.d.ts +13 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.js +102 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-selectors.d.ts +12 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-selectors.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js +286 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-selectors.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.d.ts +9 -0
- package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.js +79 -0
- package/dist/core/i18n/locales/zh-cn/tui-interactive-misc.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-self-owned.d.ts +8 -0
- package/dist/core/i18n/locales/zh-cn/tui-self-owned.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/tui-self-owned.js +72 -0
- package/dist/core/i18n/locales/zh-cn/tui-self-owned.js.map +1 -0
- package/dist/core/keybindings.d.ts +15 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +18 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +5 -1
- package/dist/core/logger.js.map +1 -1
- package/dist/core/model-config.d.ts +0 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +9 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +11 -7
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-install-host.d.ts.map +1 -1
- package/dist/core/package-install-host.js +4 -3
- package/dist/core/package-install-host.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +15 -10
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-resource-collection.d.ts.map +1 -1
- package/dist/core/package-resource-collection.js +2 -1
- package/dist/core/package-resource-collection.js.map +1 -1
- package/dist/core/package-source.d.ts.map +1 -1
- package/dist/core/package-source.js +3 -2
- package/dist/core/package-source.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -2
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +29 -21
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +6 -2
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +15 -5
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/sdk.d.ts +27 -5
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +80 -55
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +5 -2
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js +2 -1
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +39 -29
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-storage.d.ts.map +1 -1
- package/dist/core/session-storage.js +3 -3
- package/dist/core/session-storage.js.map +1 -1
- package/dist/core/settings-manager.d.ts +20 -20
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +47 -59
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +53 -32
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +25 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +11 -7
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +9 -4
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +3 -2
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +2 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +6 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +2 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/durable/durable-service.d.ts.map +1 -1
- package/dist/durable/durable-service.js +25 -18
- package/dist/durable/durable-service.js.map +1 -1
- package/dist/host/checkpoint-commit.d.ts.map +1 -1
- package/dist/host/checkpoint-commit.js +2 -1
- package/dist/host/checkpoint-commit.js.map +1 -1
- package/dist/host/manual-compaction.d.ts.map +1 -1
- package/dist/host/manual-compaction.js +2 -1
- package/dist/host/manual-compaction.js.map +1 -1
- package/dist/host/output-projection.d.ts +0 -13
- package/dist/host/output-projection.d.ts.map +1 -1
- package/dist/host/output-projection.js +16 -2
- package/dist/host/output-projection.js.map +1 -1
- package/dist/host/summary-retry.d.ts.map +1 -1
- package/dist/host/summary-retry.js +3 -2
- package/dist/host/summary-retry.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +97 -60
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/agents-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/agents-view.js +18 -15
- package/dist/modes/interactive/components/agents-view.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +6 -5
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +12 -7
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +2 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +6 -5
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +9 -5
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +18 -15
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/dialog-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-editor.js +5 -4
- package/dist/modes/interactive/components/dialog-editor.js.map +1 -1
- package/dist/modes/interactive/components/dialog-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-input.js +2 -1
- package/dist/modes/interactive/components/dialog-input.js.map +1 -1
- package/dist/modes/interactive/components/dialog-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-selector.js +4 -3
- package/dist/modes/interactive/components/dialog-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +11 -10
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +0 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -10
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +3 -2
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +12 -11
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +6 -2
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +28 -16
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +10 -9
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/plugin-manager-entry.js +22 -13
- package/dist/modes/interactive/components/plugin-manager-entry.js.map +1 -1
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/plugin-selection-entry.js +27 -12
- package/dist/modes/interactive/components/plugin-selection-entry.js.map +1 -1
- package/dist/modes/interactive/components/queue-manager-selector.d.ts +60 -0
- package/dist/modes/interactive/components/queue-manager-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/queue-manager-selector.js +166 -0
- package/dist/modes/interactive/components/queue-manager-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +16 -14
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +43 -31
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -6
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +115 -120
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +5 -4
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +3 -2
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +4 -3
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +14 -5
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +2 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +11 -4
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +8 -3
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-list.js +7 -6
- package/dist/modes/interactive/components/tree-list.js.map +1 -1
- package/dist/modes/interactive/components/tree-render.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-render.js +28 -23
- package/dist/modes/interactive/components/tree-render.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +9 -7
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +5 -4
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/workflow-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/workflow-view.js +36 -21
- package/dist/modes/interactive/components/workflow-view.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-auth.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth.js +71 -40
- package/dist/modes/interactive/interactive-auth.js.map +1 -1
- package/dist/modes/interactive/interactive-commands.d.ts +1 -0
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-commands.js +3 -0
- package/dist/modes/interactive/interactive-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-dialog-ui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-dialog-ui.js +5 -5
- package/dist/modes/interactive/interactive-dialog-ui.js.map +1 -1
- package/dist/modes/interactive/interactive-format.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-format.js +34 -18
- package/dist/modes/interactive/interactive-format.js.map +1 -1
- package/dist/modes/interactive/interactive-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-helpers.js +7 -2
- package/dist/modes/interactive/interactive-helpers.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +4 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +350 -279
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.d.ts +9 -0
- package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +79 -25
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +5 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +26 -23
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +3 -2
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +3 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +0 -8
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +3 -14
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +0 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +0 -19
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +28 -13
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/plugins/ecosystem/catalog.d.ts.map +1 -1
- package/dist/plugins/ecosystem/catalog.js +3 -2
- package/dist/plugins/ecosystem/catalog.js.map +1 -1
- package/dist/plugins/ecosystem/cli.d.ts.map +1 -1
- package/dist/plugins/ecosystem/cli.js +2 -1
- package/dist/plugins/ecosystem/cli.js.map +1 -1
- package/dist/plugins/ecosystem/default-plugin-market.d.ts.map +1 -1
- package/dist/plugins/ecosystem/default-plugin-market.js +3 -2
- package/dist/plugins/ecosystem/default-plugin-market.js.map +1 -1
- package/dist/plugins/ecosystem/distribution.d.ts.map +1 -1
- package/dist/plugins/ecosystem/distribution.js +2 -1
- package/dist/plugins/ecosystem/distribution.js.map +1 -1
- package/dist/plugins/ecosystem/installer.d.ts.map +1 -1
- package/dist/plugins/ecosystem/installer.js +3 -2
- package/dist/plugins/ecosystem/installer.js.map +1 -1
- package/dist/plugins/ecosystem/node-disk-registry-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-disk-registry-source.js +20 -17
- package/dist/plugins/ecosystem/node-disk-registry-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-distribution-host.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-distribution-host.js +35 -34
- package/dist/plugins/ecosystem/node-distribution-host.js.map +1 -1
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-npm-registry-source.js +35 -34
- package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.js +9 -8
- package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-persistence.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-persistence.js +4 -3
- package/dist/plugins/ecosystem/node-package-install-persistence.js.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts +9 -2
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js +44 -5
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-trust-root.js +10 -9
- package/dist/plugins/ecosystem/node-plugin-trust-root.js.map +1 -1
- package/dist/plugins/ecosystem/node-registry-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-registry-source.js +31 -30
- package/dist/plugins/ecosystem/node-registry-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-release-package-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-release-package-source.js +30 -29
- package/dist/plugins/ecosystem/node-release-package-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-tar-writer.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-tar-writer.js +11 -10
- package/dist/plugins/ecosystem/node-tar-writer.js.map +1 -1
- package/dist/plugins/ecosystem/node-url-package-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-url-package-source.js +21 -20
- package/dist/plugins/ecosystem/node-url-package-source.js.map +1 -1
- package/dist/plugins/ecosystem/plugin-acquisition.d.ts.map +1 -1
- package/dist/plugins/ecosystem/plugin-acquisition.js +3 -2
- package/dist/plugins/ecosystem/plugin-acquisition.js.map +1 -1
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts +9 -1
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts.map +1 -1
- package/dist/plugins/ecosystem/plugin-bootstrap.js +5 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.js.map +1 -1
- package/dist/plugins/ecosystem/registry-cli-adapter.d.ts.map +1 -1
- package/dist/plugins/ecosystem/registry-cli-adapter.js +2 -1
- package/dist/plugins/ecosystem/registry-cli-adapter.js.map +1 -1
- package/dist/plugins/ecosystem/registry.d.ts.map +1 -1
- package/dist/plugins/ecosystem/registry.js +35 -32
- package/dist/plugins/ecosystem/registry.js.map +1 -1
- package/dist/plugins/ecosystem/resolver.d.ts.map +1 -1
- package/dist/plugins/ecosystem/resolver.js +3 -2
- package/dist/plugins/ecosystem/resolver.js.map +1 -1
- package/dist/plugins/ecosystem/selection-store.d.ts.map +1 -1
- package/dist/plugins/ecosystem/selection-store.js +11 -10
- package/dist/plugins/ecosystem/selection-store.js.map +1 -1
- package/dist/plugins/ecosystem/selection.d.ts.map +1 -1
- package/dist/plugins/ecosystem/selection.js +8 -7
- package/dist/plugins/ecosystem/selection.js.map +1 -1
- package/dist/plugins/ecosystem/state.d.ts.map +1 -1
- package/dist/plugins/ecosystem/state.js +24 -23
- package/dist/plugins/ecosystem/state.js.map +1 -1
- package/dist/plugins/ecosystem/updates.d.ts.map +1 -1
- package/dist/plugins/ecosystem/updates.js +5 -4
- package/dist/plugins/ecosystem/updates.js.map +1 -1
- package/dist/plugins/mcp-http.d.ts +0 -17
- package/dist/plugins/mcp-http.d.ts.map +1 -1
- package/dist/plugins/mcp-http.js +30 -7
- package/dist/plugins/mcp-http.js.map +1 -1
- package/dist/plugins/plugin-supervisor.d.ts.map +1 -1
- package/dist/plugins/plugin-supervisor.js +19 -1
- package/dist/plugins/plugin-supervisor.js.map +1 -1
- package/dist/profile/first-roles.d.ts.map +1 -1
- package/dist/profile/first-roles.js +10 -1
- package/dist/profile/first-roles.js.map +1 -1
- package/dist/profile/goal-plugin.d.ts.map +1 -1
- package/dist/profile/goal-plugin.js +24 -5
- package/dist/profile/goal-plugin.js.map +1 -1
- package/dist/profile/identity.d.ts.map +1 -1
- package/dist/profile/identity.js +7 -6
- package/dist/profile/identity.js.map +1 -1
- package/dist/profile/lock.d.ts.map +1 -1
- package/dist/profile/lock.js +15 -1
- package/dist/profile/lock.js.map +1 -1
- package/dist/profile/plan-plugin.d.ts.map +1 -1
- package/dist/profile/plan-plugin.js +26 -13
- package/dist/profile/plan-plugin.js.map +1 -1
- package/dist/profile/plugin-profiles.d.ts.map +1 -1
- package/dist/profile/plugin-profiles.js +2 -1
- package/dist/profile/plugin-profiles.js.map +1 -1
- package/dist/profile/policy-manifest.d.ts.map +1 -1
- package/dist/profile/policy-manifest.js +5 -4
- package/dist/profile/policy-manifest.js.map +1 -1
- package/dist/profile/profile-registry.d.ts +0 -12
- package/dist/profile/profile-registry.d.ts.map +1 -1
- package/dist/profile/profile-registry.js +14 -1
- package/dist/profile/profile-registry.js.map +1 -1
- package/dist/profile/role-catalog.d.ts +0 -1
- package/dist/profile/role-catalog.d.ts.map +1 -1
- package/dist/profile/role-catalog.js +17 -15
- package/dist/profile/role-catalog.js.map +1 -1
- package/dist/profile/role-orchestrator.d.ts.map +1 -1
- package/dist/profile/role-orchestrator.js +8 -7
- package/dist/profile/role-orchestrator.js.map +1 -1
- package/dist/profile/role-runner.d.ts.map +1 -1
- package/dist/profile/role-runner.js +3 -2
- package/dist/profile/role-runner.js.map +1 -1
- package/dist/profile/root-facade.d.ts.map +1 -1
- package/dist/profile/root-facade.js +2 -1
- package/dist/profile/root-facade.js.map +1 -1
- package/dist/profile/skill-discovery-wiring.d.ts.map +1 -1
- package/dist/profile/skill-discovery-wiring.js +7 -2
- package/dist/profile/skill-discovery-wiring.js.map +1 -1
- package/dist/profile/state-store.d.ts.map +1 -1
- package/dist/profile/state-store.js +13 -9
- package/dist/profile/state-store.js.map +1 -1
- package/dist/profile/todo-plugin.d.ts.map +1 -1
- package/dist/profile/todo-plugin.js +9 -4
- package/dist/profile/todo-plugin.js.map +1 -1
- package/dist/profiles/builtin-suites.d.ts +13 -6
- package/dist/profiles/builtin-suites.d.ts.map +1 -1
- package/dist/profiles/builtin-suites.js +15 -6
- package/dist/profiles/builtin-suites.js.map +1 -1
- package/dist/profiles/suite-loader.d.ts +25 -1
- package/dist/profiles/suite-loader.d.ts.map +1 -1
- package/dist/profiles/suite-loader.js +34 -9
- package/dist/profiles/suite-loader.js.map +1 -1
- package/dist/remote/server-entry.d.ts.map +1 -1
- package/dist/remote/server-entry.js +3 -2
- package/dist/remote/server-entry.js.map +1 -1
- package/dist/remote/session-source.d.ts.map +1 -1
- package/dist/remote/session-source.js +8 -4
- package/dist/remote/session-source.js.map +1 -1
- package/dist/share/session-share.d.ts.map +1 -1
- package/dist/share/session-share.js +14 -2
- package/dist/share/session-share.js.map +1 -1
- package/dist/testing/plugin-testkit.d.ts.map +1 -1
- package/dist/testing/plugin-testkit.js +4 -3
- package/dist/testing/plugin-testkit.js.map +1 -1
- package/dist/testing/runtime-delivery-queue.d.ts.map +1 -1
- package/dist/testing/runtime-delivery-queue.js +2 -1
- package/dist/testing/runtime-delivery-queue.js.map +1 -1
- package/dist/testing/session-plugin-testkit.d.ts.map +1 -1
- package/dist/testing/session-plugin-testkit.js +10 -7
- package/dist/testing/session-plugin-testkit.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +2 -1
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +7 -6
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/image-resize-worker.d.ts.map +1 -1
- package/dist/utils/image-resize-worker.js +3 -2
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/photon.d.ts +2 -2
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/photon.js +2 -2
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +9 -8
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +23 -13
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +5 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +1 -3
- package/docs/docs.json +4 -0
- package/docs/index.md +1 -0
- package/docs/keybindings.md +3 -0
- package/docs/mcp.md +103 -0
- package/docs/models.md +14 -22
- package/docs/providers.md +0 -1
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +1 -26
- package/docs/sdk.md +4 -6
- package/docs/settings.md +10 -12
- package/docs/skills.md +1 -9
- package/docs/terminal-setup.md +2 -3
- package/docs/usage.md +7 -6
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/with-deps/plugin.json +1 -1
- package/examples/sdk/10-settings.ts +2 -4
- package/examples/sdk/12-full-control.ts +1 -2
- package/package.json +1 -3
- package/dist/bundle/chunks/chunk-EALJ5DDX.js +0 -1452
- package/dist/core/extensions/microcompact.d.ts +0 -80
- package/dist/core/extensions/microcompact.d.ts.map +0 -1
- package/dist/core/extensions/microcompact.js +0 -134
- package/dist/core/extensions/microcompact.js.map +0 -1
- package/dist/server/create-harness.d.ts +0 -26
- package/dist/server/create-harness.d.ts.map +0 -1
- package/dist/server/create-harness.js +0 -106
- package/dist/server/create-harness.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t } from "../i18n/index.js";
|
|
1
2
|
import { loadCapabilityPluginSync } from "./capability-plugin.js";
|
|
2
3
|
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
4
|
import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
|
|
@@ -12,12 +13,12 @@ function assertJsonSafe(value, label, seen = new Set()) {
|
|
|
12
13
|
if (typeof value === "number") {
|
|
13
14
|
if (Number.isFinite(value))
|
|
14
15
|
return;
|
|
15
|
-
throw new Error(
|
|
16
|
+
throw new Error(t("{label} must contain only finite JSON numbers", { label }));
|
|
16
17
|
}
|
|
17
18
|
if (typeof value !== "object")
|
|
18
|
-
throw new Error(
|
|
19
|
+
throw new Error(t("{label} must be JSON-safe", { label }));
|
|
19
20
|
if (seen.has(value))
|
|
20
|
-
throw new Error(
|
|
21
|
+
throw new Error(t("{label} must not contain cycles", { label }));
|
|
21
22
|
seen.add(value);
|
|
22
23
|
if (Array.isArray(value)) {
|
|
23
24
|
for (const [index, entry] of value.entries())
|
|
@@ -28,27 +29,27 @@ function assertJsonSafe(value, label, seen = new Set()) {
|
|
|
28
29
|
assertJsonSafe(entry, `${label}.${key}`, seen);
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
|
-
throw new Error(
|
|
32
|
+
throw new Error(t("{label} must contain only JSON arrays and plain objects", { label }));
|
|
32
33
|
}
|
|
33
34
|
seen.delete(value);
|
|
34
35
|
}
|
|
35
36
|
function assertString(value, label) {
|
|
36
37
|
if (typeof value !== "string" || value.trim() === "")
|
|
37
|
-
throw new Error(
|
|
38
|
+
throw new Error(t("{label} must be a non-empty string", { label }));
|
|
38
39
|
}
|
|
39
40
|
function assertRevision(value) {
|
|
40
41
|
if (!isPlainRecord(value))
|
|
41
|
-
throw new Error("session.compaction.commit.revision must be a plain object");
|
|
42
|
+
throw new Error(t("session.compaction.commit.revision must be a plain object"));
|
|
42
43
|
const keys = Object.keys(value).sort();
|
|
43
44
|
if (keys.join(",") !== "leafId,sequence,sessionId,version") {
|
|
44
|
-
throw new Error("session.compaction.commit.revision has unsupported fields");
|
|
45
|
+
throw new Error(t("session.compaction.commit.revision has unsupported fields"));
|
|
45
46
|
}
|
|
46
47
|
if (value.version !== 1)
|
|
47
|
-
throw new Error("session.compaction.commit.revision.version must be 1");
|
|
48
|
+
throw new Error(t("session.compaction.commit.revision.version must be 1"));
|
|
48
49
|
assertString(value.sessionId, "session.compaction.commit.revision.sessionId");
|
|
49
50
|
const sequence = value.sequence;
|
|
50
51
|
if (typeof sequence !== "number" || !Number.isSafeInteger(sequence) || sequence < 0) {
|
|
51
|
-
throw new Error("session.compaction.commit.revision.sequence must be a non-negative safe integer");
|
|
52
|
+
throw new Error(t("session.compaction.commit.revision.sequence must be a non-negative safe integer"));
|
|
52
53
|
}
|
|
53
54
|
if (value.leafId !== null)
|
|
54
55
|
assertString(value.leafId, "session.compaction.commit.revision.leafId");
|
|
@@ -56,7 +57,7 @@ function assertRevision(value) {
|
|
|
56
57
|
/** Strict validator for the committed compaction lifecycle payload. */
|
|
57
58
|
export function validateSessionCompactionCommitEventDataV1(value) {
|
|
58
59
|
if (!isPlainRecord(value))
|
|
59
|
-
throw new Error("session.compaction.commit data must be a plain object");
|
|
60
|
+
throw new Error(t("session.compaction.commit data must be a plain object"));
|
|
60
61
|
const allowed = new Set([
|
|
61
62
|
"version",
|
|
62
63
|
"status",
|
|
@@ -73,7 +74,9 @@ export function validateSessionCompactionCommitEventDataV1(value) {
|
|
|
73
74
|
]);
|
|
74
75
|
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
75
76
|
if (unsupported.length > 0) {
|
|
76
|
-
throw new Error(
|
|
77
|
+
throw new Error(t("session.compaction.commit data has unsupported fields: {unsupported}", {
|
|
78
|
+
unsupported: unsupported.join(", "),
|
|
79
|
+
}));
|
|
77
80
|
}
|
|
78
81
|
for (const key of [
|
|
79
82
|
"version",
|
|
@@ -88,26 +91,26 @@ export function validateSessionCompactionCommitEventDataV1(value) {
|
|
|
88
91
|
"fromHook",
|
|
89
92
|
]) {
|
|
90
93
|
if (!(key in value))
|
|
91
|
-
throw new Error(
|
|
94
|
+
throw new Error(t("session.compaction.commit data is missing required field: {key}", { key }));
|
|
92
95
|
}
|
|
93
96
|
if (value.version !== 1)
|
|
94
|
-
throw new Error("session.compaction.commit data.version must be 1");
|
|
97
|
+
throw new Error(t("session.compaction.commit data.version must be 1"));
|
|
95
98
|
if (value.status !== "committed" && value.status !== "replayed") {
|
|
96
|
-
throw new Error("session.compaction.commit data.status is invalid");
|
|
99
|
+
throw new Error(t("session.compaction.commit data.status is invalid"));
|
|
97
100
|
}
|
|
98
101
|
assertString(value.entryId, "session.compaction.commit data.entryId");
|
|
99
102
|
assertString(value.operationId, "session.compaction.commit data.operationId");
|
|
100
103
|
assertRevision(value.revision);
|
|
101
104
|
if (value.reason !== "manual" && value.reason !== "threshold" && value.reason !== "overflow") {
|
|
102
|
-
throw new Error("session.compaction.commit data.reason is invalid");
|
|
105
|
+
throw new Error(t("session.compaction.commit data.reason is invalid"));
|
|
103
106
|
}
|
|
104
107
|
assertString(value.summary, "session.compaction.commit data.summary");
|
|
105
108
|
assertString(value.firstKeptEntryId, "session.compaction.commit data.firstKeptEntryId");
|
|
106
109
|
if (typeof value.tokensBefore !== "number" || !Number.isFinite(value.tokensBefore) || value.tokensBefore < 0) {
|
|
107
|
-
throw new Error("session.compaction.commit data.tokensBefore must be a non-negative finite number");
|
|
110
|
+
throw new Error(t("session.compaction.commit data.tokensBefore must be a non-negative finite number"));
|
|
108
111
|
}
|
|
109
112
|
if (typeof value.fromHook !== "boolean")
|
|
110
|
-
throw new Error("session.compaction.commit data.fromHook must be boolean");
|
|
113
|
+
throw new Error(t("session.compaction.commit data.fromHook must be boolean"));
|
|
111
114
|
if ("usage" in value)
|
|
112
115
|
assertJsonSafe(value.usage, "session.compaction.commit data.usage");
|
|
113
116
|
if ("details" in value)
|
|
@@ -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,EAO5B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,0CAA0C,EAC1C,wCAAwC,EACxC,uCAAuC,EAGvC,gCAAgC,EAChC,kCAAkC,EAUlC,+BAA+B,EAC/B,wCAAwC,EACxC,sCAAsC,EACtC,qCAAqC,EACrC,yBAAyB,EACzB,mCAAmC,EACnC,iCAAiC,EACjC,4BAA4B,E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S,CAAC,MAAM,CAA4B,6BAA6B,EAAE,CAAC,CAAC;QACjF,GAAG,CAAC,SAAS,CAAC,MAAM,CAAsB,uBAAuB,EAAE,CAAC,CAAC;QACrE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAyB,0BAA0B,EAAE,CAAC,CAAC;QAC3E,GAAG,CAAC,SAAS,CAAC,MAAM,CAAwB,yBAAyB,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,SAAS,CAAC,MAAM,CAA2B,4BAA4B,EAAE,CAAC,CAAC;QAC/E,GAAG,CAAC,SAAS,CAAC,MAAM,CAAwB,yBAAyB,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAiC,kCAAkC,EAAE,CAAC,CAAC;QAC3F,GAAG,CAAC,SAAS,CAAC,MAAM,CAA0B,2BAA2B,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\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionContextReplacedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionReloadEventDefinition,\n\tsessionStartEventDefinition,\n\ttype ThinkingLevelSelectEventDataV1,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolCallEventDefinition,\n\ttoolCommitEventDefinition,\n\ttoolExecuteEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\ttoolResultEventDefinition,\n\ttoolResultRawEventDefinition,\n\ttoolResultTransformEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\ttype UIPromptBoundaryEventDataV1,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n} from \"./lifecycle-catalog.ts\";\n\nexport type { CapabilityCallEventNameV1, CapabilityCallStatusV1, ModelStreamEventNameV1 } from \"./lifecycle-catalog.ts\";\n\nimport type { SessionRevisionV1 } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport {\n\tAGENT_END_EVENT_ID,\n\tAGENT_END_EVENT_VERSION,\n\tAGENT_SETTLED_EVENT_ID,\n\tAGENT_SETTLED_EVENT_VERSION,\n\tAGENT_START_EVENT_ID,\n\tAGENT_START_EVENT_VERSION,\n\tAGENT_TASK_SETTLED_EVENT_ID,\n\tAGENT_TASK_SETTLED_EVENT_VERSION,\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\tBEFORE_AGENT_START_EVENT_ID,\n\tBEFORE_AGENT_START_EVENT_VERSION,\n\tBEFORE_AGENT_START_EVENT_VERSION_V2,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\tCAPABILITY_CALL_EVENT_ID,\n\tCAPABILITY_CALL_EVENT_VERSION,\n\ttype CapabilityCallEventDataV1,\n\tCONTEXT_ASSEMBLED_EVENT_ID,\n\tCONTEXT_ASSEMBLED_EVENT_VERSION,\n\ttype ContextAssembledEventDataV1,\n\tcontextAssembledEventDefinition,\n\tINPUT_GATE_BLOCKED_EVENT_ID,\n\tINPUT_GATE_BLOCKED_EVENT_VERSION,\n\tINPUT_RECEIVED_EVENT_ID,\n\tINPUT_RECEIVED_EVENT_VERSION,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\tMESSAGE_END_EVENT_ID,\n\tMESSAGE_END_EVENT_VERSION,\n\tMESSAGE_START_EVENT_ID,\n\tMESSAGE_START_EVENT_VERSION,\n\ttype MessageBoundaryEventDataV1,\n\tMODEL_RESPONSE_EVENT_ID,\n\tMODEL_RESPONSE_EVENT_VERSION,\n\tMODEL_SELECT_EVENT_ID,\n\tMODEL_SELECT_EVENT_VERSION,\n\tMODEL_STREAM_EVENT_ID,\n\tMODEL_STREAM_EVENT_VERSION,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelSelectEventDefinition,\n\tOPERATION_CANCEL_EVENT_ID,\n\tOPERATION_CANCEL_EVENT_VERSION,\n\tOPERATION_END_EVENT_ID,\n\tOPERATION_END_EVENT_VERSION,\n\tOPERATION_START_EVENT_ID,\n\tOPERATION_START_EVENT_VERSION,\n\tOPERATION_STEP_EVENT_ID,\n\tOPERATION_STEP_EVENT_VERSION,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\tPLUGIN_REJECTED_EVENT_ID,\n\tPLUGIN_REJECTED_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_ID,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_ID,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_VERSION,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\tRESOURCES_DISCOVER_EVENT_ID,\n\tRESOURCES_DISCOVER_EVENT_VERSION,\n\tRESOURCES_DISCOVER_EVENT_VERSION_V2,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\tSESSION_AUTO_RETRY_EVENT_ID,\n\tSESSION_AUTO_RETRY_EVENT_VERSION,\n\tSESSION_COMPACTION_DECISION_EVENT_ID,\n\tSESSION_COMPACTION_DECISION_EVENT_VERSION,\n\tSESSION_COMPACTION_FAILED_EVENT_ID,\n\tSESSION_COMPACTION_FAILED_EVENT_VERSION,\n\tSESSION_CONTEXT_REPLACED_EVENT_ID,\n\tSESSION_CONTEXT_REPLACED_EVENT_VERSION,\n\tSESSION_END_EVENT_ID,\n\tSESSION_END_EVENT_VERSION,\n\tSESSION_ENTRY_APPENDED_EVENT_ID,\n\tSESSION_ENTRY_APPENDED_EVENT_VERSION,\n\tSESSION_INFO_CHANGED_EVENT_ID,\n\tSESSION_INFO_CHANGED_EVENT_VERSION,\n\tSESSION_RELOAD_EVENT_ID,\n\tSESSION_RELOAD_EVENT_VERSION,\n\tSESSION_START_EVENT_ID,\n\tSESSION_START_EVENT_VERSION,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionStartEventDefinition,\n\tTHINKING_LEVEL_SELECT_EVENT_ID,\n\tTHINKING_LEVEL_SELECT_EVENT_VERSION,\n\ttype ThinkingLevelSelectEventDataV1,\n\tTOOL_CALL_EVENT_ID,\n\tTOOL_CALL_EVENT_VERSION,\n\tTOOL_COMMIT_EVENT_ID,\n\tTOOL_COMMIT_EVENT_VERSION,\n\tTOOL_EXECUTE_EVENT_ID,\n\tTOOL_EXECUTE_EVENT_VERSION,\n\tTOOL_EXECUTION_START_EVENT_ID,\n\tTOOL_EXECUTION_START_EVENT_VERSION,\n\tTOOL_GATE_BLOCKED_EVENT_ID,\n\tTOOL_GATE_BLOCKED_EVENT_VERSION,\n\tTOOL_RESULT_EVENT_ID,\n\tTOOL_RESULT_EVENT_VERSION,\n\tTOOL_RESULT_RAW_EVENT_ID,\n\tTOOL_RESULT_RAW_EVENT_VERSION,\n\tTOOL_RESULT_TRANSFORM_EVENT_ID,\n\tTOOL_RESULT_TRANSFORM_EVENT_VERSION,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\tTURN_END_EVENT_ID,\n\tTURN_END_EVENT_VERSION,\n\tTURN_START_EVENT_ID,\n\tTURN_START_EVENT_VERSION,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\tUI_PROMPT_END_EVENT_ID,\n\tUI_PROMPT_END_EVENT_VERSION,\n\tUI_PROMPT_START_EVENT_ID,\n\tUI_PROMPT_START_EVENT_VERSION,\n\ttype UIPromptBoundaryEventDataV1,\n\tUSER_BASH_EVENT_ID,\n\tUSER_BASH_EVENT_VERSION,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n\tvalidateAgentEndEventDataV1,\n\tvalidateAgentLifecycleEventDataV1,\n\tvalidateAgentTaskSettledEventDataV1,\n\tvalidateBeforeAgentStartEventDataV1,\n\tvalidateBeforeAgentStartEventDataV2,\n\tvalidateCapabilityCallEventDataV1,\n\tvalidateContextAssembledEventDataV1,\n\tvalidateInputReceivedEventDataV1,\n\tvalidateMessageBoundaryEventDataV1,\n\tvalidateModelResponseEventDataV1,\n\tvalidateModelSelectEventDataV1,\n\tvalidateModelStreamEventDataV1,\n\tvalidateOperationCancelEventDataV1,\n\tvalidateOperationEndEventDataV1,\n\tvalidateOperationStartEventDataV1,\n\tvalidateOperationStepEventDataV1,\n\tvalidatePluginDisposeEventDataV1,\n\tvalidatePluginReadyEventDataV1,\n\tvalidateProviderFailoverProbeFailedEventDataV1,\n\tvalidateProviderFailoverRecoveredEventDataV1,\n\tvalidateProviderFailoverSwitchedEventDataV1,\n\tvalidateResourcesDiscoverEventDataV1,\n\tvalidateResourcesDiscoverEventDataV2,\n\tvalidateSessionAutoRetryEventDataV1,\n\tvalidateSessionCompactionDecisionEventDataV1,\n\tvalidateSessionCompactionFailedEventDataV1,\n\tvalidateSessionContextReplacedEventDataV1,\n\tvalidateSessionEndEventDataV1,\n\tvalidateSessionEntryAppendedEventDataV1,\n\tvalidateSessionInfoChangedEventDataV1,\n\tvalidateSessionReloadEventDataV1,\n\tvalidateSessionStartEventDataV1,\n\tvalidateThinkingLevelSelectEventDataV1,\n\tvalidateToolCallEventDataV1,\n\tvalidateToolCommitEventDataV1,\n\tvalidateToolExecuteEventDataV1,\n\tvalidateToolExecutionStartEventDataV1,\n\tvalidateToolGateBlockedEventDataV1,\n\tvalidateToolResultEventDataV1,\n\tvalidateToolResultRawEventDataV1,\n\tvalidateToolResultTransformEventDataV1,\n\tvalidateTurnEndEventDataV1,\n\tvalidateTurnStartEventDataV1,\n\tvalidateUIPromptBoundaryEventDataV1,\n\tvalidateUserBashEventDataV1,\n} from \"./lifecycle-catalog.ts\";\n\nexport const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = \"agent-forge.bootstrap-lifecycle\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_ID = \"session.compaction.commit\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;\n\nexport interface SessionCompactionCommitEventDataV1 {\n\tversion: 1;\n\tstatus: \"committed\" | \"replayed\";\n\tentryId: string;\n\toperationId: string;\n\trevision: SessionRevisionV1;\n\treason: \"manual\" | \"threshold\" | \"overflow\";\n\tsummary: string;\n\tfirstKeptEntryId: string;\n\ttokensBefore: number;\n\tfromHook: boolean;\n\tusage?: unknown;\n\tdetails?: unknown;\n}\n\nconst isPlainRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype;\n\nfunction assertJsonSafe(value: unknown, label: string, seen = new Set<object>()): void {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return;\n\t\tthrow new Error(`${label} must contain only finite JSON numbers`);\n\t}\n\tif (typeof value !== \"object\") throw new Error(`${label} must be JSON-safe`);\n\tif (seen.has(value)) throw new Error(`${label} must not contain cycles`);\n\tseen.add(value);\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, entry] of value.entries()) assertJsonSafe(entry, `${label}[${index}]`, seen);\n\t} else if (isPlainRecord(value)) {\n\t\tfor (const [key, entry] of Object.entries(value)) assertJsonSafe(entry, `${label}.${key}`, seen);\n\t} else {\n\t\tthrow new Error(`${label} must contain only JSON arrays and plain objects`);\n\t}\n\tseen.delete(value);\n}\n\nfunction assertString(value: unknown, label: string): asserts value is string {\n\tif (typeof value !== \"string\" || value.trim() === \"\") throw new Error(`${label} must be a non-empty string`);\n}\n\nfunction assertRevision(value: unknown): asserts value is SessionRevisionV1 {\n\tif (!isPlainRecord(value)) throw new Error(\"session.compaction.commit.revision must be a plain object\");\n\tconst keys = Object.keys(value).sort();\n\tif (keys.join(\",\") !== \"leafId,sequence,sessionId,version\") {\n\t\tthrow new Error(\"session.compaction.commit.revision has unsupported fields\");\n\t}\n\tif (value.version !== 1) throw new Error(\"session.compaction.commit.revision.version must be 1\");\n\tassertString(value.sessionId, \"session.compaction.commit.revision.sessionId\");\n\tconst sequence = value.sequence;\n\tif (typeof sequence !== \"number\" || !Number.isSafeInteger(sequence) || sequence < 0) {\n\t\tthrow new Error(\"session.compaction.commit.revision.sequence must be a non-negative safe integer\");\n\t}\n\tif (value.leafId !== null) assertString(value.leafId, \"session.compaction.commit.revision.leafId\");\n}\n\n/** Strict validator for the committed compaction lifecycle payload. */\nexport function validateSessionCompactionCommitEventDataV1(value: unknown): SessionCompactionCommitEventDataV1 {\n\tif (!isPlainRecord(value)) throw new Error(\"session.compaction.commit data must be a plain object\");\n\tconst allowed = new Set([\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t\t\"usage\",\n\t\t\"details\",\n\t]);\n\tconst unsupported = Object.keys(value).filter((key) => !allowed.has(key));\n\tif (unsupported.length > 0) {\n\t\tthrow new Error(`session.compaction.commit data has unsupported fields: ${unsupported.join(\", \")}`);\n\t}\n\tfor (const key of [\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t]) {\n\t\tif (!(key in value)) throw new Error(`session.compaction.commit data is missing required field: ${key}`);\n\t}\n\tif (value.version !== 1) throw new Error(\"session.compaction.commit data.version must be 1\");\n\tif (value.status !== \"committed\" && value.status !== \"replayed\") {\n\t\tthrow new Error(\"session.compaction.commit data.status is invalid\");\n\t}\n\tassertString(value.entryId, \"session.compaction.commit data.entryId\");\n\tassertString(value.operationId, \"session.compaction.commit data.operationId\");\n\tassertRevision(value.revision);\n\tif (value.reason !== \"manual\" && value.reason !== \"threshold\" && value.reason !== \"overflow\") {\n\t\tthrow new Error(\"session.compaction.commit data.reason is invalid\");\n\t}\n\tassertString(value.summary, \"session.compaction.commit data.summary\");\n\tassertString(value.firstKeptEntryId, \"session.compaction.commit data.firstKeptEntryId\");\n\tif (typeof value.tokensBefore !== \"number\" || !Number.isFinite(value.tokensBefore) || value.tokensBefore < 0) {\n\t\tthrow new Error(\"session.compaction.commit data.tokensBefore must be a non-negative finite number\");\n\t}\n\tif (typeof value.fromHook !== \"boolean\") throw new Error(\"session.compaction.commit data.fromHook must be boolean\");\n\tif (\"usage\" in value) assertJsonSafe(value.usage, \"session.compaction.commit data.usage\");\n\tif (\"details\" in value) assertJsonSafe(value.details, \"session.compaction.commit data.details\");\n\treturn value as unknown as SessionCompactionCommitEventDataV1;\n}\n\nexport function installBootstrapLifecycle(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_LIFECYCLE_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-lifecycle>\",\n\t\t},\n\t\t(api) => {\n\t\t\tapi.lifecycle.define<SessionCompactionCommitEventDataV1>({\n\t\t\t\tid: SESSION_COMPACTION_COMMIT_EVENT_ID,\n\t\t\t\tversion: SESSION_COMPACTION_COMMIT_EVENT_VERSION,\n\t\t\t\tphase: \"committed\",\n\t\t\t\tschema: \"agent-forge/session.compaction.commit@1\",\n\t\t\t\tallowedRegistrationKinds: [\"observe\", \"after-commit\"],\n\t\t\t\tvalidate: validateSessionCompactionCommitEventDataV1,\n\t\t\t});\n\t\t\tapi.lifecycle.define<SessionAutoRetryEventDataV1>(sessionAutoRetryEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionDecisionEventDataV1>(sessionCompactionDecisionEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionFailedEventDataV1>(sessionCompactionFailedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEndEventDataV1>(sessionEndEventDefinition());\n\t\t\tapi.lifecycle.define<AgentTaskSettledEventDataV1>(agentTaskSettledEventDefinition());\n\t\t\tapi.lifecycle.define<ToolGateBlockedEventDataV1>(toolGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<InputGateBlockedEventDataV1>(inputGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverSwitchedEventDataV1>(providerFailoverSwitchedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverRecoveredEventDataV1>(providerFailoverRecoveredEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverProbeFailedEventDataV1>(providerFailoverProbeFailedEventDefinition());\n\t\t\tapi.lifecycle.define<PluginDisposeEventDataV1>(pluginDisposeEventDefinition());\n\t\t\tapi.lifecycle.define<PluginReadyEventDataV1>(pluginReadyEventDefinition());\n\t\t\tapi.lifecycle.define<PluginRejectedEventDataV1>(pluginRejectedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionContextReplacedEventDataV1>(sessionContextReplacedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionReloadEventDataV1>(sessionReloadEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentStartEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentSettledEventDefinition());\n\t\t\tapi.lifecycle.define<TurnStartEventDataV1>(turnStartEventDefinition());\n\t\t\tapi.lifecycle.define<TurnEndEventDataV1>(turnEndEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageStartEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageEndEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecutionStartEventDataV1>(toolExecutionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelSelectEventDataV1>(modelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<ThinkingLevelSelectEventDataV1>(thinkingLevelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<SessionInfoChangedEventDataV1>(sessionInfoChangedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEntryAppendedEventDataV1>(sessionEntryAppendedEventDefinition());\n\t\t\tapi.lifecycle.define<AgentEndEventDataV1>(agentEndEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV1>(beforeAgentStartEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV2>(beforeAgentStartV2EventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptStartEventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptEndEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV1>(resourcesDiscoverEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV2>(resourcesDiscoverV2EventDefinition());\n\t\t\tapi.lifecycle.define<ContextAssembledEventDataV1>(contextAssembledEventDefinition());\n\t\t\tapi.lifecycle.define<InputReceivedEventDataV1>(inputReceivedEventDefinition());\n\t\t\tapi.lifecycle.define<UserBashEventDataV1>(userBashEventDefinition());\n\t\t\tapi.lifecycle.define<SessionStartEventDataV1>(sessionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelResponseEventDataV1>(modelResponseEventDefinition());\n\t\t\tapi.lifecycle.define<ModelStreamEventDataV1>(modelStreamEventDefinition());\n\t\t\tapi.lifecycle.define<CapabilityCallEventDataV1>(capabilityCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCallEventDataV1>(toolCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecuteEventDataV1>(toolExecuteEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCommitEventDataV1>(toolCommitEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultRawEventDataV1>(toolResultRawEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultEventDataV1>(toolResultEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultTransformEventDataV1>(toolResultTransformEventDefinition());\n\t\t\tapi.lifecycle.define<OperationEndEventDataV1>(operationEndEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStartEventDataV1>(operationStartEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStepEventDataV1>(operationStepEventDefinition());\n\t\t\tapi.lifecycle.define<OperationCancelEventDataV1>(operationCancelEventDefinition());\n\t\t},\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bootstrap-lifecycle.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAIN,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,+BAA+B,EAG/B,+BAA+B,EAC/B,iCAAiC,EAGjC,6BAA6B,EAC7B,+BAA+B,EAG/B,+BAA+B,EAC/B,4BAA4B,EAK5B,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAK1B,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAO5B,4BAA4B,EAC5B,0BAA0B,EAC1B,6BAA6B,EAC7B,0CAA0C,EAC1C,wCAAwC,EACxC,uCAAuC,EAGvC,gCAAgC,EAChC,kCAAkC,EAUlC,+BAA+B,EAC/B,wCAAwC,EACxC,sCAAsC,EACtC,qCAAqC,EACrC,yBAAyB,EACzB,mCAAmC,EACnC,iCAAiC,EACjC,4BAA4B,EAC5B,2BAA2B,EAY3B,kCAAkC,EAClC,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,yBAAyB,EACzB,4BAA4B,EAC5B,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,EAGxB,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,GACvB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EACN,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B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B,EAAE,CAAC,CAAC;QACjF,GAAG,CAAC,SAAS,CAAC,MAAM,CAAsB,uBAAuB,EAAE,CAAC,CAAC;QACrE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAyB,0BAA0B,EAAE,CAAC,CAAC;QAC3E,GAAG,CAAC,SAAS,CAAC,MAAM,CAAwB,yBAAyB,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,SAAS,CAAC,MAAM,CAA2B,4BAA4B,EAAE,CAAC,CAAC;QAC/E,GAAG,CAAC,SAAS,CAAC,MAAM,CAAwB,yBAAyB,EAAE,CAAC,CAAC;QACzE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAiC,kCAAkC,EAAE,CAAC,CAAC;QAC3F,GAAG,CAAC,SAAS,CAAC,MAAM,CAA0B,2BAA2B,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 { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport {\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\ttype CapabilityCallEventDataV1,\n\ttype ContextAssembledEventDataV1,\n\tcapabilityCallEventDefinition,\n\tcontextAssembledEventDefinition,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\ttype MessageBoundaryEventDataV1,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelResponseEventDefinition,\n\tmodelSelectEventDefinition,\n\tmodelStreamEventDefinition,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\toperationCancelEventDefinition,\n\toperationEndEventDefinition,\n\toperationStartEventDefinition,\n\toperationStepEventDefinition,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tpluginDisposeEventDefinition,\n\tpluginReadyEventDefinition,\n\tpluginRejectedEventDefinition,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionContextReplacedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionReloadEventDefinition,\n\tsessionStartEventDefinition,\n\ttype ThinkingLevelSelectEventDataV1,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolCallEventDefinition,\n\ttoolCommitEventDefinition,\n\ttoolExecuteEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\ttoolResultEventDefinition,\n\ttoolResultRawEventDefinition,\n\ttoolResultTransformEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\ttype UIPromptBoundaryEventDataV1,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n} from \"./lifecycle-catalog.ts\";\n\nexport type { CapabilityCallEventNameV1, CapabilityCallStatusV1, ModelStreamEventNameV1 } from \"./lifecycle-catalog.ts\";\n\nimport type { SessionRevisionV1 } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport {\n\tAGENT_END_EVENT_ID,\n\tAGENT_END_EVENT_VERSION,\n\tAGENT_SETTLED_EVENT_ID,\n\tAGENT_SETTLED_EVENT_VERSION,\n\tAGENT_START_EVENT_ID,\n\tAGENT_START_EVENT_VERSION,\n\tAGENT_TASK_SETTLED_EVENT_ID,\n\tAGENT_TASK_SETTLED_EVENT_VERSION,\n\ttype AgentEndEventDataV1,\n\ttype AgentLifecycleEventDataV1,\n\ttype AgentTaskSettledEventDataV1,\n\tagentEndEventDefinition,\n\tagentSettledEventDefinition,\n\tagentStartEventDefinition,\n\tagentTaskSettledEventDefinition,\n\tBEFORE_AGENT_START_EVENT_ID,\n\tBEFORE_AGENT_START_EVENT_VERSION,\n\tBEFORE_AGENT_START_EVENT_VERSION_V2,\n\ttype BeforeAgentStartEventDataV1,\n\ttype BeforeAgentStartEventDataV2,\n\tbeforeAgentStartEventDefinition,\n\tbeforeAgentStartV2EventDefinition,\n\tCAPABILITY_CALL_EVENT_ID,\n\tCAPABILITY_CALL_EVENT_VERSION,\n\ttype CapabilityCallEventDataV1,\n\tCONTEXT_ASSEMBLED_EVENT_ID,\n\tCONTEXT_ASSEMBLED_EVENT_VERSION,\n\ttype ContextAssembledEventDataV1,\n\tcontextAssembledEventDefinition,\n\tINPUT_GATE_BLOCKED_EVENT_ID,\n\tINPUT_GATE_BLOCKED_EVENT_VERSION,\n\tINPUT_RECEIVED_EVENT_ID,\n\tINPUT_RECEIVED_EVENT_VERSION,\n\ttype InputGateBlockedEventDataV1,\n\ttype InputReceivedEventDataV1,\n\tinputGateBlockedEventDefinition,\n\tinputReceivedEventDefinition,\n\tMESSAGE_END_EVENT_ID,\n\tMESSAGE_END_EVENT_VERSION,\n\tMESSAGE_START_EVENT_ID,\n\tMESSAGE_START_EVENT_VERSION,\n\ttype MessageBoundaryEventDataV1,\n\tMODEL_RESPONSE_EVENT_ID,\n\tMODEL_RESPONSE_EVENT_VERSION,\n\tMODEL_SELECT_EVENT_ID,\n\tMODEL_SELECT_EVENT_VERSION,\n\tMODEL_STREAM_EVENT_ID,\n\tMODEL_STREAM_EVENT_VERSION,\n\ttype ModelResponseEventDataV1,\n\ttype ModelSelectEventDataV1,\n\ttype ModelStreamEventDataV1,\n\tmessageEndEventDefinition,\n\tmessageStartEventDefinition,\n\tmodelSelectEventDefinition,\n\tOPERATION_CANCEL_EVENT_ID,\n\tOPERATION_CANCEL_EVENT_VERSION,\n\tOPERATION_END_EVENT_ID,\n\tOPERATION_END_EVENT_VERSION,\n\tOPERATION_START_EVENT_ID,\n\tOPERATION_START_EVENT_VERSION,\n\tOPERATION_STEP_EVENT_ID,\n\tOPERATION_STEP_EVENT_VERSION,\n\ttype OperationCancelEventDataV1,\n\ttype OperationEndEventDataV1,\n\ttype OperationStartEventDataV1,\n\ttype OperationStepEventDataV1,\n\tPLUGIN_DISPOSE_EVENT_ID,\n\tPLUGIN_DISPOSE_EVENT_VERSION,\n\tPLUGIN_READY_EVENT_ID,\n\tPLUGIN_READY_EVENT_VERSION,\n\tPLUGIN_REJECTED_EVENT_ID,\n\tPLUGIN_REJECTED_EVENT_VERSION,\n\ttype PluginDisposeEventDataV1,\n\ttype PluginReadyEventDataV1,\n\ttype PluginRejectedEventDataV1,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_ID,\n\tPROVIDER_FAILOVER_PROBE_FAILED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_ID,\n\tPROVIDER_FAILOVER_RECOVERED_EVENT_VERSION,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_ID,\n\tPROVIDER_FAILOVER_SWITCHED_EVENT_VERSION,\n\ttype ProviderFailoverProbeFailedEventDataV1,\n\ttype ProviderFailoverRecoveredEventDataV1,\n\ttype ProviderFailoverSwitchedEventDataV1,\n\tproviderFailoverProbeFailedEventDefinition,\n\tproviderFailoverRecoveredEventDefinition,\n\tproviderFailoverSwitchedEventDefinition,\n\tRESOURCES_DISCOVER_EVENT_ID,\n\tRESOURCES_DISCOVER_EVENT_VERSION,\n\tRESOURCES_DISCOVER_EVENT_VERSION_V2,\n\ttype ResourcesDiscoverEventDataV1,\n\ttype ResourcesDiscoverEventDataV2,\n\tresourcesDiscoverEventDefinition,\n\tresourcesDiscoverV2EventDefinition,\n\tSESSION_AUTO_RETRY_EVENT_ID,\n\tSESSION_AUTO_RETRY_EVENT_VERSION,\n\tSESSION_COMPACTION_DECISION_EVENT_ID,\n\tSESSION_COMPACTION_DECISION_EVENT_VERSION,\n\tSESSION_COMPACTION_FAILED_EVENT_ID,\n\tSESSION_COMPACTION_FAILED_EVENT_VERSION,\n\tSESSION_CONTEXT_REPLACED_EVENT_ID,\n\tSESSION_CONTEXT_REPLACED_EVENT_VERSION,\n\tSESSION_END_EVENT_ID,\n\tSESSION_END_EVENT_VERSION,\n\tSESSION_ENTRY_APPENDED_EVENT_ID,\n\tSESSION_ENTRY_APPENDED_EVENT_VERSION,\n\tSESSION_INFO_CHANGED_EVENT_ID,\n\tSESSION_INFO_CHANGED_EVENT_VERSION,\n\tSESSION_RELOAD_EVENT_ID,\n\tSESSION_RELOAD_EVENT_VERSION,\n\tSESSION_START_EVENT_ID,\n\tSESSION_START_EVENT_VERSION,\n\ttype SessionAutoRetryEventDataV1,\n\ttype SessionCompactionDecisionEventDataV1,\n\ttype SessionCompactionFailedEventDataV1,\n\ttype SessionContextReplacedEventDataV1,\n\ttype SessionEndEventDataV1,\n\ttype SessionEntryAppendedEventDataV1,\n\ttype SessionInfoChangedEventDataV1,\n\ttype SessionReloadEventDataV1,\n\ttype SessionStartEventDataV1,\n\tsessionAutoRetryEventDefinition,\n\tsessionCompactionDecisionEventDefinition,\n\tsessionCompactionFailedEventDefinition,\n\tsessionEndEventDefinition,\n\tsessionEntryAppendedEventDefinition,\n\tsessionInfoChangedEventDefinition,\n\tsessionStartEventDefinition,\n\tTHINKING_LEVEL_SELECT_EVENT_ID,\n\tTHINKING_LEVEL_SELECT_EVENT_VERSION,\n\ttype ThinkingLevelSelectEventDataV1,\n\tTOOL_CALL_EVENT_ID,\n\tTOOL_CALL_EVENT_VERSION,\n\tTOOL_COMMIT_EVENT_ID,\n\tTOOL_COMMIT_EVENT_VERSION,\n\tTOOL_EXECUTE_EVENT_ID,\n\tTOOL_EXECUTE_EVENT_VERSION,\n\tTOOL_EXECUTION_START_EVENT_ID,\n\tTOOL_EXECUTION_START_EVENT_VERSION,\n\tTOOL_GATE_BLOCKED_EVENT_ID,\n\tTOOL_GATE_BLOCKED_EVENT_VERSION,\n\tTOOL_RESULT_EVENT_ID,\n\tTOOL_RESULT_EVENT_VERSION,\n\tTOOL_RESULT_RAW_EVENT_ID,\n\tTOOL_RESULT_RAW_EVENT_VERSION,\n\tTOOL_RESULT_TRANSFORM_EVENT_ID,\n\tTOOL_RESULT_TRANSFORM_EVENT_VERSION,\n\ttype ToolCallEventDataV1,\n\ttype ToolCommitEventDataV1,\n\ttype ToolExecuteEventDataV1,\n\ttype ToolExecutionStartEventDataV1,\n\ttype ToolGateBlockedEventDataV1,\n\ttype ToolResultEventDataV1,\n\ttype ToolResultRawEventDataV1,\n\ttype ToolResultTransformEventDataV1,\n\tTURN_END_EVENT_ID,\n\tTURN_END_EVENT_VERSION,\n\tTURN_START_EVENT_ID,\n\tTURN_START_EVENT_VERSION,\n\ttype TurnEndEventDataV1,\n\ttype TurnStartEventDataV1,\n\tthinkingLevelSelectEventDefinition,\n\ttoolExecutionStartEventDefinition,\n\ttoolGateBlockedEventDefinition,\n\tturnEndEventDefinition,\n\tturnStartEventDefinition,\n\tUI_PROMPT_END_EVENT_ID,\n\tUI_PROMPT_END_EVENT_VERSION,\n\tUI_PROMPT_START_EVENT_ID,\n\tUI_PROMPT_START_EVENT_VERSION,\n\ttype UIPromptBoundaryEventDataV1,\n\tUSER_BASH_EVENT_ID,\n\tUSER_BASH_EVENT_VERSION,\n\ttype UserBashEventDataV1,\n\tuiPromptEndEventDefinition,\n\tuiPromptStartEventDefinition,\n\tuserBashEventDefinition,\n\tvalidateAgentEndEventDataV1,\n\tvalidateAgentLifecycleEventDataV1,\n\tvalidateAgentTaskSettledEventDataV1,\n\tvalidateBeforeAgentStartEventDataV1,\n\tvalidateBeforeAgentStartEventDataV2,\n\tvalidateCapabilityCallEventDataV1,\n\tvalidateContextAssembledEventDataV1,\n\tvalidateInputReceivedEventDataV1,\n\tvalidateMessageBoundaryEventDataV1,\n\tvalidateModelResponseEventDataV1,\n\tvalidateModelSelectEventDataV1,\n\tvalidateModelStreamEventDataV1,\n\tvalidateOperationCancelEventDataV1,\n\tvalidateOperationEndEventDataV1,\n\tvalidateOperationStartEventDataV1,\n\tvalidateOperationStepEventDataV1,\n\tvalidatePluginDisposeEventDataV1,\n\tvalidatePluginReadyEventDataV1,\n\tvalidateProviderFailoverProbeFailedEventDataV1,\n\tvalidateProviderFailoverRecoveredEventDataV1,\n\tvalidateProviderFailoverSwitchedEventDataV1,\n\tvalidateResourcesDiscoverEventDataV1,\n\tvalidateResourcesDiscoverEventDataV2,\n\tvalidateSessionAutoRetryEventDataV1,\n\tvalidateSessionCompactionDecisionEventDataV1,\n\tvalidateSessionCompactionFailedEventDataV1,\n\tvalidateSessionContextReplacedEventDataV1,\n\tvalidateSessionEndEventDataV1,\n\tvalidateSessionEntryAppendedEventDataV1,\n\tvalidateSessionInfoChangedEventDataV1,\n\tvalidateSessionReloadEventDataV1,\n\tvalidateSessionStartEventDataV1,\n\tvalidateThinkingLevelSelectEventDataV1,\n\tvalidateToolCallEventDataV1,\n\tvalidateToolCommitEventDataV1,\n\tvalidateToolExecuteEventDataV1,\n\tvalidateToolExecutionStartEventDataV1,\n\tvalidateToolGateBlockedEventDataV1,\n\tvalidateToolResultEventDataV1,\n\tvalidateToolResultRawEventDataV1,\n\tvalidateToolResultTransformEventDataV1,\n\tvalidateTurnEndEventDataV1,\n\tvalidateTurnStartEventDataV1,\n\tvalidateUIPromptBoundaryEventDataV1,\n\tvalidateUserBashEventDataV1,\n} from \"./lifecycle-catalog.ts\";\n\nexport const BOOTSTRAP_LIFECYCLE_PLUGIN_ID = \"agent-forge.bootstrap-lifecycle\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_ID = \"session.compaction.commit\";\nexport const SESSION_COMPACTION_COMMIT_EVENT_VERSION = 1;\n\nexport interface SessionCompactionCommitEventDataV1 {\n\tversion: 1;\n\tstatus: \"committed\" | \"replayed\";\n\tentryId: string;\n\toperationId: string;\n\trevision: SessionRevisionV1;\n\treason: \"manual\" | \"threshold\" | \"overflow\";\n\tsummary: string;\n\tfirstKeptEntryId: string;\n\ttokensBefore: number;\n\tfromHook: boolean;\n\tusage?: unknown;\n\tdetails?: unknown;\n}\n\nconst isPlainRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === \"object\" && value !== null && Object.getPrototypeOf(value) === Object.prototype;\n\nfunction assertJsonSafe(value: unknown, label: string, seen = new Set<object>()): void {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return;\n\tif (typeof value === \"number\") {\n\t\tif (Number.isFinite(value)) return;\n\t\tthrow new Error(t(\"{label} must contain only finite JSON numbers\", { label }));\n\t}\n\tif (typeof value !== \"object\") throw new Error(t(\"{label} must be JSON-safe\", { label }));\n\tif (seen.has(value)) throw new Error(t(\"{label} must not contain cycles\", { label }));\n\tseen.add(value);\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, entry] of value.entries()) assertJsonSafe(entry, `${label}[${index}]`, seen);\n\t} else if (isPlainRecord(value)) {\n\t\tfor (const [key, entry] of Object.entries(value)) assertJsonSafe(entry, `${label}.${key}`, seen);\n\t} else {\n\t\tthrow new Error(t(\"{label} must contain only JSON arrays and plain objects\", { label }));\n\t}\n\tseen.delete(value);\n}\n\nfunction assertString(value: unknown, label: string): asserts value is string {\n\tif (typeof value !== \"string\" || value.trim() === \"\")\n\t\tthrow new Error(t(\"{label} must be a non-empty string\", { label }));\n}\n\nfunction assertRevision(value: unknown): asserts value is SessionRevisionV1 {\n\tif (!isPlainRecord(value)) throw new Error(t(\"session.compaction.commit.revision must be a plain object\"));\n\tconst keys = Object.keys(value).sort();\n\tif (keys.join(\",\") !== \"leafId,sequence,sessionId,version\") {\n\t\tthrow new Error(t(\"session.compaction.commit.revision has unsupported fields\"));\n\t}\n\tif (value.version !== 1) throw new Error(t(\"session.compaction.commit.revision.version must be 1\"));\n\tassertString(value.sessionId, \"session.compaction.commit.revision.sessionId\");\n\tconst sequence = value.sequence;\n\tif (typeof sequence !== \"number\" || !Number.isSafeInteger(sequence) || sequence < 0) {\n\t\tthrow new Error(t(\"session.compaction.commit.revision.sequence must be a non-negative safe integer\"));\n\t}\n\tif (value.leafId !== null) assertString(value.leafId, \"session.compaction.commit.revision.leafId\");\n}\n\n/** Strict validator for the committed compaction lifecycle payload. */\nexport function validateSessionCompactionCommitEventDataV1(value: unknown): SessionCompactionCommitEventDataV1 {\n\tif (!isPlainRecord(value)) throw new Error(t(\"session.compaction.commit data must be a plain object\"));\n\tconst allowed = new Set([\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t\t\"usage\",\n\t\t\"details\",\n\t]);\n\tconst unsupported = Object.keys(value).filter((key) => !allowed.has(key));\n\tif (unsupported.length > 0) {\n\t\tthrow new Error(\n\t\t\tt(\"session.compaction.commit data has unsupported fields: {unsupported}\", {\n\t\t\t\tunsupported: unsupported.join(\", \"),\n\t\t\t}),\n\t\t);\n\t}\n\tfor (const key of [\n\t\t\"version\",\n\t\t\"status\",\n\t\t\"entryId\",\n\t\t\"operationId\",\n\t\t\"revision\",\n\t\t\"reason\",\n\t\t\"summary\",\n\t\t\"firstKeptEntryId\",\n\t\t\"tokensBefore\",\n\t\t\"fromHook\",\n\t]) {\n\t\tif (!(key in value))\n\t\t\tthrow new Error(t(\"session.compaction.commit data is missing required field: {key}\", { key }));\n\t}\n\tif (value.version !== 1) throw new Error(t(\"session.compaction.commit data.version must be 1\"));\n\tif (value.status !== \"committed\" && value.status !== \"replayed\") {\n\t\tthrow new Error(t(\"session.compaction.commit data.status is invalid\"));\n\t}\n\tassertString(value.entryId, \"session.compaction.commit data.entryId\");\n\tassertString(value.operationId, \"session.compaction.commit data.operationId\");\n\tassertRevision(value.revision);\n\tif (value.reason !== \"manual\" && value.reason !== \"threshold\" && value.reason !== \"overflow\") {\n\t\tthrow new Error(t(\"session.compaction.commit data.reason is invalid\"));\n\t}\n\tassertString(value.summary, \"session.compaction.commit data.summary\");\n\tassertString(value.firstKeptEntryId, \"session.compaction.commit data.firstKeptEntryId\");\n\tif (typeof value.tokensBefore !== \"number\" || !Number.isFinite(value.tokensBefore) || value.tokensBefore < 0) {\n\t\tthrow new Error(t(\"session.compaction.commit data.tokensBefore must be a non-negative finite number\"));\n\t}\n\tif (typeof value.fromHook !== \"boolean\")\n\t\tthrow new Error(t(\"session.compaction.commit data.fromHook must be boolean\"));\n\tif (\"usage\" in value) assertJsonSafe(value.usage, \"session.compaction.commit data.usage\");\n\tif (\"details\" in value) assertJsonSafe(value.details, \"session.compaction.commit data.details\");\n\treturn value as unknown as SessionCompactionCommitEventDataV1;\n}\n\nexport function installBootstrapLifecycle(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_LIFECYCLE_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-lifecycle>\",\n\t\t},\n\t\t(api) => {\n\t\t\tapi.lifecycle.define<SessionCompactionCommitEventDataV1>({\n\t\t\t\tid: SESSION_COMPACTION_COMMIT_EVENT_ID,\n\t\t\t\tversion: SESSION_COMPACTION_COMMIT_EVENT_VERSION,\n\t\t\t\tphase: \"committed\",\n\t\t\t\tschema: \"agent-forge/session.compaction.commit@1\",\n\t\t\t\tallowedRegistrationKinds: [\"observe\", \"after-commit\"],\n\t\t\t\tvalidate: validateSessionCompactionCommitEventDataV1,\n\t\t\t});\n\t\t\tapi.lifecycle.define<SessionAutoRetryEventDataV1>(sessionAutoRetryEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionDecisionEventDataV1>(sessionCompactionDecisionEventDefinition());\n\t\t\tapi.lifecycle.define<SessionCompactionFailedEventDataV1>(sessionCompactionFailedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEndEventDataV1>(sessionEndEventDefinition());\n\t\t\tapi.lifecycle.define<AgentTaskSettledEventDataV1>(agentTaskSettledEventDefinition());\n\t\t\tapi.lifecycle.define<ToolGateBlockedEventDataV1>(toolGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<InputGateBlockedEventDataV1>(inputGateBlockedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverSwitchedEventDataV1>(providerFailoverSwitchedEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverRecoveredEventDataV1>(providerFailoverRecoveredEventDefinition());\n\t\t\tapi.lifecycle.define<ProviderFailoverProbeFailedEventDataV1>(providerFailoverProbeFailedEventDefinition());\n\t\t\tapi.lifecycle.define<PluginDisposeEventDataV1>(pluginDisposeEventDefinition());\n\t\t\tapi.lifecycle.define<PluginReadyEventDataV1>(pluginReadyEventDefinition());\n\t\t\tapi.lifecycle.define<PluginRejectedEventDataV1>(pluginRejectedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionContextReplacedEventDataV1>(sessionContextReplacedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionReloadEventDataV1>(sessionReloadEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentStartEventDefinition());\n\t\t\tapi.lifecycle.define<AgentLifecycleEventDataV1>(agentSettledEventDefinition());\n\t\t\tapi.lifecycle.define<TurnStartEventDataV1>(turnStartEventDefinition());\n\t\t\tapi.lifecycle.define<TurnEndEventDataV1>(turnEndEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageStartEventDefinition());\n\t\t\tapi.lifecycle.define<MessageBoundaryEventDataV1>(messageEndEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecutionStartEventDataV1>(toolExecutionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelSelectEventDataV1>(modelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<ThinkingLevelSelectEventDataV1>(thinkingLevelSelectEventDefinition());\n\t\t\tapi.lifecycle.define<SessionInfoChangedEventDataV1>(sessionInfoChangedEventDefinition());\n\t\t\tapi.lifecycle.define<SessionEntryAppendedEventDataV1>(sessionEntryAppendedEventDefinition());\n\t\t\tapi.lifecycle.define<AgentEndEventDataV1>(agentEndEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV1>(beforeAgentStartEventDefinition());\n\t\t\tapi.lifecycle.define<BeforeAgentStartEventDataV2>(beforeAgentStartV2EventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptStartEventDefinition());\n\t\t\tapi.lifecycle.define<UIPromptBoundaryEventDataV1>(uiPromptEndEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV1>(resourcesDiscoverEventDefinition());\n\t\t\tapi.lifecycle.define<ResourcesDiscoverEventDataV2>(resourcesDiscoverV2EventDefinition());\n\t\t\tapi.lifecycle.define<ContextAssembledEventDataV1>(contextAssembledEventDefinition());\n\t\t\tapi.lifecycle.define<InputReceivedEventDataV1>(inputReceivedEventDefinition());\n\t\t\tapi.lifecycle.define<UserBashEventDataV1>(userBashEventDefinition());\n\t\t\tapi.lifecycle.define<SessionStartEventDataV1>(sessionStartEventDefinition());\n\t\t\tapi.lifecycle.define<ModelResponseEventDataV1>(modelResponseEventDefinition());\n\t\t\tapi.lifecycle.define<ModelStreamEventDataV1>(modelStreamEventDefinition());\n\t\t\tapi.lifecycle.define<CapabilityCallEventDataV1>(capabilityCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCallEventDataV1>(toolCallEventDefinition());\n\t\t\tapi.lifecycle.define<ToolExecuteEventDataV1>(toolExecuteEventDefinition());\n\t\t\tapi.lifecycle.define<ToolCommitEventDataV1>(toolCommitEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultRawEventDataV1>(toolResultRawEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultEventDataV1>(toolResultEventDefinition());\n\t\t\tapi.lifecycle.define<ToolResultTransformEventDataV1>(toolResultTransformEventDefinition());\n\t\t\tapi.lifecycle.define<OperationEndEventDataV1>(operationEndEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStartEventDataV1>(operationStartEventDefinition());\n\t\t\tapi.lifecycle.define<OperationStepEventDataV1>(operationStepEventDefinition());\n\t\t\tapi.lifecycle.define<OperationCancelEventDataV1>(operationCancelEventDefinition());\n\t\t},\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-overflow-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-overflow-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAC7E,eAAO,MAAM,4BAA4B,YAAY,CAAC;AAEtD,wFAAwF;AACxF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAyBjG","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(t(\"Overflow policy requires an assistant message object\"));\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isContextOverflow, isRecoverableLength } from "@agent-forge/ai/compat";
|
|
2
|
+
import { t } from "../i18n/index.js";
|
|
2
3
|
import { loadCapabilityPluginSync } from "./capability-plugin.js";
|
|
3
4
|
import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
|
|
4
5
|
export const BOOTSTRAP_OVERFLOW_PLUGIN_ID = "agent-forge.bootstrap-overflow";
|
|
@@ -15,7 +16,7 @@ export function installBootstrapOverflowPolicy(runtime) {
|
|
|
15
16
|
api.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {
|
|
16
17
|
decide: (request) => {
|
|
17
18
|
if (!request.message || typeof request.message !== "object") {
|
|
18
|
-
throw new Error("Overflow policy requires an assistant message object");
|
|
19
|
+
throw new Error(t("Overflow policy requires an assistant message object"));
|
|
19
20
|
}
|
|
20
21
|
const message = request.message;
|
|
21
22
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-overflow-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,4BAA4B,GAAG,gCAAgC,CAAC;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAEtD,wFAAwF;AACxF,MAAM,UAAU,8BAA8B,CAAC,OAA0B,EAA0B;IAClG,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,4BAA4B;QAChC,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,+BAA+B;QACtC,oBAAoB,EAAE,CAAC,iBAAiB,CAAC;KACzC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,CAAC,sBAAsB,CAAC,4BAA4B,EAAE;YACxD,MAAM,EAAE,CAAC,OAA8B,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC7D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-overflow-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-overflow-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvG,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAG/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,4BAA4B,GAAG,gCAAgC,CAAC;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC;AAEtD,wFAAwF;AACxF,MAAM,UAAU,8BAA8B,CAAC,OAA0B,EAA0B;IAClG,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,4BAA4B;QAChC,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,+BAA+B;QACtC,oBAAoB,EAAE,CAAC,iBAAiB,CAAC;KACzC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,CAAC,sBAAsB,CAAC,4BAA4B,EAAE;YACxD,MAAM,EAAE,CAAC,OAA8B,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC;gBAC5E,CAAC;gBACD,MAAM,OAAO,GAAG,OAAO,CAAC,OAA2B,CAAC;gBACpD,OAAO;oBACN,eAAe,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,aAAa,CAAC;oBAClE,iBAAiB,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC;iBACzE,CAAC;YAAA,CACF;SACD,CAAC,CAAC;IAAA,CACH,CACD,CAAC;AAAA,CACF","sourcesContent":["import { type AssistantMessage, isContextOverflow, isRecoverableLength } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport type { OverflowPolicyRequest } from \"./public-api.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_OVERFLOW_PLUGIN_ID = \"agent-forge.bootstrap-overflow\";\nexport const DEFAULT_OVERFLOW_POLICY_NAME = \"default\";\n\n/** Register the current provider classification as a replaceable first-party policy. */\nexport function installBootstrapOverflowPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_OVERFLOW_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-overflow>\",\n\t\t\trequiredCapabilities: [\"overflow-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerOverflowPolicy(DEFAULT_OVERFLOW_POLICY_NAME, {\n\t\t\t\tdecide: (request: OverflowPolicyRequest) => {\n\t\t\t\t\tif (!request.message || typeof request.message !== \"object\") {\n\t\t\t\t\t\tthrow new Error(t(\"Overflow policy requires an assistant message object\"));\n\t\t\t\t\t}\n\t\t\t\t\tconst message = request.message as AssistantMessage;\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontextOverflow: isContextOverflow(message, request.contextWindow),\n\t\t\t\t\t\trecoverableLength: isRecoverableLength(message, request.desiredMaxOutput),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-retry-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-retry-policy.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,iBAAiB,GAAG,sBAAsB,CAwB9F","sourcesContent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(t(\"Retry classification requires an assistant message object\"));\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isRetryableAssistantError } from "@agent-forge/ai/compat";
|
|
2
|
+
import { t } from "../i18n/index.js";
|
|
2
3
|
import { loadCapabilityPluginSync } from "./capability-plugin.js";
|
|
3
4
|
import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
|
|
4
5
|
export const BOOTSTRAP_RETRY_PLUGIN_ID = "agent-forge.bootstrap-retry";
|
|
@@ -15,11 +16,11 @@ export function installBootstrapRetryPolicy(runtime) {
|
|
|
15
16
|
api.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {
|
|
16
17
|
classify: ({ message }) => {
|
|
17
18
|
if (!message || typeof message !== "object")
|
|
18
|
-
throw new Error("Retry classification requires an assistant message object");
|
|
19
|
+
throw new Error(t("Retry classification requires an assistant message object"));
|
|
19
20
|
return isRetryableAssistantError(message);
|
|
20
21
|
},
|
|
21
|
-
decide: ({ retryable,
|
|
22
|
-
retry:
|
|
22
|
+
decide: ({ retryable, attempt, maxAttempts, baseDelayMs }) => ({
|
|
23
|
+
retry: retryable && attempt <= maxAttempts,
|
|
23
24
|
delayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),
|
|
24
25
|
}),
|
|
25
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-retry-policy.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-retry-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AACvE,MAAM,CAAC,MAAM,yBAAyB,GAAG,SAAS,CAAC;AAEnD,gFAAgF;AAChF,MAAM,UAAU,2BAA2B,CAAC,OAA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E,OAAO,EAAE,EAAE,EAAE,CAAC;gBAC1B,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;oBAC1C,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,2DAA2D,CAAC,CAAC,CAAC;gBACjF,OAAO,yBAAyB,CAAC,OAA0D,CAAC,CAAC;YAAA,CAC7F;YACD,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC9D,KAAK,EAAE,SAAS,IAAI,OAAO,IAAI,WAAW;gBAC1C,OAAO,EAAE,WAAW,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;aACpD,CAAC;SACF,CAAC,CAAC;IAAA,CACH,CACD,CAAC;AAAA,CACF","sourcesContent":["import { isRetryableAssistantError } from \"@agent-forge/ai/compat\";\nimport { t } from \"../i18n/index.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_RETRY_PLUGIN_ID = \"agent-forge.bootstrap-retry\";\nexport const DEFAULT_RETRY_POLICY_NAME = \"default\";\n\n/** Register the built-in retry decision as a replaceable first-party policy. */\nexport function installBootstrapRetryPolicy(runtime: CapabilityRuntime): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_RETRY_PLUGIN_ID,\n\t\t\tversion: \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-retry>\",\n\t\t\trequiredCapabilities: [\"retry-policy\"],\n\t\t},\n\t\t(api) => {\n\t\t\tapi.registerRetryPolicy(DEFAULT_RETRY_POLICY_NAME, {\n\t\t\t\tclassify: ({ message }) => {\n\t\t\t\t\tif (!message || typeof message !== \"object\")\n\t\t\t\t\t\tthrow new Error(t(\"Retry classification requires an assistant message object\"));\n\t\t\t\t\treturn isRetryableAssistantError(message as Parameters<typeof isRetryableAssistantError>[0]);\n\t\t\t\t},\n\t\t\t\tdecide: ({ retryable, attempt, maxAttempts, baseDelayMs }) => ({\n\t\t\t\t\tretry: retryable && attempt <= maxAttempts,\n\t\t\t\t\tdelayMs: baseDelayMs * 2 ** Math.max(0, attempt - 1),\n\t\t\t\t}),\n\t\t\t});\n\t\t},\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-skills.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-skills.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAwB,MAAM,iBAAiB,CAAC;AAEvG,eAAO,MAAM,0BAA0B,iCAAiC,CAAC;AACzE,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AACjE,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AA6CD,wEAAwE;AACxE,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,GAAE,sBAA2B,GAClC,sBAAsB,CAuExB;AAED,uFAAuF;AACvF,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAIf","sourcesContent":["import { t } from \"../i18n/index.ts\";\nimport type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(t(\"SkillDefinitionV1 validation failed\"));\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(t(\"SkillDefinitionV1 validation failed\"));\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(t(\"Bootstrap skills plugin is already installed\"));\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name))\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: skill.name }));\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: definition.name }));\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(t(\"Bootstrap skills plugin is not installed\"));\n\tawait controller.refresh(skills);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t } from "../i18n/index.js";
|
|
1
2
|
import { loadCapabilityPluginSync } from "./capability-plugin.js";
|
|
2
3
|
import { EXPERIMENTAL_PUBLIC_API_VERSION } from "./public-api.js";
|
|
3
4
|
export const BOOTSTRAP_SKILLS_PLUGIN_ID = "agent-forge.bootstrap-skills";
|
|
@@ -15,7 +16,7 @@ function toSkillDefinition(skill) {
|
|
|
15
16
|
}
|
|
16
17
|
function validateSkillDefinition(value) {
|
|
17
18
|
if (!value || typeof value !== "object")
|
|
18
|
-
throw new Error("SkillDefinitionV1 validation failed");
|
|
19
|
+
throw new Error(t("SkillDefinitionV1 validation failed"));
|
|
19
20
|
const candidate = value;
|
|
20
21
|
if (typeof candidate.name !== "string" ||
|
|
21
22
|
!candidate.name.trim() ||
|
|
@@ -26,7 +27,7 @@ function validateSkillDefinition(value) {
|
|
|
26
27
|
typeof candidate.baseDir !== "string" ||
|
|
27
28
|
!candidate.baseDir ||
|
|
28
29
|
(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== "boolean")) {
|
|
29
|
-
throw new Error("SkillDefinitionV1 validation failed");
|
|
30
|
+
throw new Error(t("SkillDefinitionV1 validation failed"));
|
|
30
31
|
}
|
|
31
32
|
return {
|
|
32
33
|
name: candidate.name,
|
|
@@ -42,7 +43,7 @@ function validateSkillDefinition(value) {
|
|
|
42
43
|
export function installSessionBootstrapSkills(runtime, skills, options = {}) {
|
|
43
44
|
const existing = controllers.get(runtime);
|
|
44
45
|
if (existing) {
|
|
45
|
-
throw new Error("Bootstrap skills plugin is already installed");
|
|
46
|
+
throw new Error(t("Bootstrap skills plugin is already installed"));
|
|
46
47
|
}
|
|
47
48
|
let controller;
|
|
48
49
|
const handle = loadCapabilityPluginSync(runtime, {
|
|
@@ -66,7 +67,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
|
|
|
66
67
|
const seen = new Set();
|
|
67
68
|
for (const skill of nextSkills) {
|
|
68
69
|
if (seen.has(skill.name))
|
|
69
|
-
throw new Error(
|
|
70
|
+
throw new Error(t("Skill conflicts in contribution point: {name}", { name: skill.name }));
|
|
70
71
|
seen.add(skill.name);
|
|
71
72
|
}
|
|
72
73
|
};
|
|
@@ -75,7 +76,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
|
|
|
75
76
|
const definition = toSkillDefinition(skill);
|
|
76
77
|
validateSkillDefinition(definition);
|
|
77
78
|
if (point.list().some((entry) => entry.value.name === definition.name)) {
|
|
78
|
-
throw new Error(
|
|
79
|
+
throw new Error(t("Skill conflicts in contribution point: {name}", { name: definition.name }));
|
|
79
80
|
}
|
|
80
81
|
// ContributionPoint.add commits its validated entry before awaiting
|
|
81
82
|
// observer delivery, so the host can consume a complete snapshot during
|
|
@@ -113,7 +114,7 @@ export function installSessionBootstrapSkills(runtime, skills, options = {}) {
|
|
|
113
114
|
export async function refreshSessionBootstrapSkills(runtime, skills) {
|
|
114
115
|
const controller = controllers.get(runtime);
|
|
115
116
|
if (!controller)
|
|
116
|
-
throw new Error("Bootstrap skills plugin is not installed");
|
|
117
|
+
throw new Error(t("Bootstrap skills plugin is not installed"));
|
|
117
118
|
await controller.refresh(skills);
|
|
118
119
|
}
|
|
119
120
|
//# sourceMappingURL=bootstrap-skills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-skills.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-skills.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAErC,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAuC,MAAM,iBAAiB,CAAC;AAEvG,MAAM,CAAC,MAAM,0BAA0B,GAAG,8BAA8B,CAAC;AACzE,MAA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;YACZ,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;gBAC9B,cAAc,CAAC,UAAU,CAAC,CAAC;gBAC3B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;oBAClC,IAAI,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;wBAAE,MAAM,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACrE,CAAC;gBACD,cAAc,CAAC,UAAU,CAAC,CAAC;YAAA,CAC3B;SACD,CAAC;QACF,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAAA,CACrC,CACD,CAAC;IACF,OAAO;QACN,GAAG,MAAM;QACT,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC;gBACJ,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACxB,CAAC;oBAAS,CAAC;gBACV,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC;QAAA,CACD;KACD,CAAC;AAAA,CACF;AAED,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAClD,OAA0B,EAC1B,MAAwB,EACR;IAChB,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAChF,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAAA,CACjC","sourcesContent":["import { t } from \"../i18n/index.ts\";\nimport type { Skill } from \"../skills.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode, type SkillDefinition } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_SKILLS_PLUGIN_ID = \"agent-forge.bootstrap-skills\";\nexport const SKILL_CONTRIBUTION_POINT_ID = \"skill-loader.skills\";\nexport const SKILL_CONTRIBUTION_POINT_VERSION = 1;\n\nexport interface BootstrapSkillsOptions {\n\tversion?: string;\n\tmode?: HostMode;\n}\n\ninterface BootstrapSkillsController {\n\trefresh(skills: readonly Skill[]): Promise<void>;\n}\n\nconst controllers = new WeakMap<CapabilityRuntime, BootstrapSkillsController>();\n\nfunction toSkillDefinition(skill: Skill): SkillDefinition {\n\treturn {\n\t\tname: skill.name,\n\t\tdescription: skill.description,\n\t\tfilePath: skill.filePath,\n\t\tbaseDir: skill.baseDir,\n\t\tdisableModelInvocation: skill.disableModelInvocation,\n\t};\n}\n\nfunction validateSkillDefinition(value: unknown): SkillDefinition {\n\tif (!value || typeof value !== \"object\") throw new Error(t(\"SkillDefinitionV1 validation failed\"));\n\tconst candidate = value as Partial<SkillDefinition>;\n\tif (\n\t\ttypeof candidate.name !== \"string\" ||\n\t\t!candidate.name.trim() ||\n\t\ttypeof candidate.description !== \"string\" ||\n\t\t!candidate.description.trim() ||\n\t\ttypeof candidate.filePath !== \"string\" ||\n\t\t!candidate.filePath ||\n\t\ttypeof candidate.baseDir !== \"string\" ||\n\t\t!candidate.baseDir ||\n\t\t(candidate.disableModelInvocation !== undefined && typeof candidate.disableModelInvocation !== \"boolean\")\n\t) {\n\t\tthrow new Error(t(\"SkillDefinitionV1 validation failed\"));\n\t}\n\treturn {\n\t\tname: candidate.name,\n\t\tdescription: candidate.description,\n\t\tfilePath: candidate.filePath,\n\t\tbaseDir: candidate.baseDir,\n\t\t...(candidate.disableModelInvocation === undefined\n\t\t\t? {}\n\t\t\t: { disableModelInvocation: candidate.disableModelInvocation }),\n\t};\n}\n\n/** Install discovered skills through the generic contribution point. */\nexport function installSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n\toptions: BootstrapSkillsOptions = {},\n): CapabilityPluginHandle {\n\tconst existing = controllers.get(runtime);\n\tif (existing) {\n\t\tthrow new Error(t(\"Bootstrap skills plugin is already installed\"));\n\t}\n\tlet controller: BootstrapSkillsController | undefined;\n\tconst handle = loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_SKILLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-skills>\",\n\t\t\trequiredCapabilities: [\"skills\"],\n\t\t\tprovides: [\n\t\t\t\t{ id: SKILL_CONTRIBUTION_POINT_ID, version: SKILL_CONTRIBUTION_POINT_VERSION, kind: \"contribution\" },\n\t\t\t],\n\t\t},\n\t\t(api) => {\n\t\t\tconst point = api.contributions.define<SkillDefinition>({\n\t\t\t\tid: SKILL_CONTRIBUTION_POINT_ID,\n\t\t\t\tversion: SKILL_CONTRIBUTION_POINT_VERSION,\n\t\t\t\tschema: \"SkillDefinitionV1\",\n\t\t\t\tlifecycle: \"execute\",\n\t\t\t\tvalidate: validateSkillDefinition,\n\t\t\t});\n\t\t\tconst validateSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tconst seen = new Set<string>();\n\t\t\t\tfor (const skill of nextSkills) {\n\t\t\t\t\tif (seen.has(skill.name))\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: skill.name }));\n\t\t\t\t\tseen.add(skill.name);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst registerSkills = (nextSkills: readonly Skill[]): void => {\n\t\t\t\tfor (const skill of [...nextSkills].sort((left, right) => left.name.localeCompare(right.name))) {\n\t\t\t\t\tconst definition = toSkillDefinition(skill);\n\t\t\t\t\tvalidateSkillDefinition(definition);\n\t\t\t\t\tif (point.list().some((entry) => entry.value.name === definition.name)) {\n\t\t\t\t\t\tthrow new Error(t(\"Skill conflicts in contribution point: {name}\", { name: definition.name }));\n\t\t\t\t\t}\n\t\t\t\t\t// ContributionPoint.add commits its validated entry before awaiting\n\t\t\t\t\t// observer delivery, so the host can consume a complete snapshot during\n\t\t\t\t\t// synchronous session construction without a private Skill registry.\n\t\t\t\t\tvoid point.add({ id: `bootstrap:${skill.name}`, value: definition });\n\t\t\t\t}\n\t\t\t};\n\t\t\tvalidateSkills(skills);\n\t\t\tregisterSkills(skills);\n\t\t\tcontroller = {\n\t\t\t\trefresh: async (nextSkills) => {\n\t\t\t\t\tvalidateSkills(nextSkills);\n\t\t\t\t\tfor (const entry of point.list()) {\n\t\t\t\t\t\tif (entry.id.startsWith(\"bootstrap:\")) await point.remove(entry.id);\n\t\t\t\t\t}\n\t\t\t\t\tregisterSkills(nextSkills);\n\t\t\t\t},\n\t\t\t};\n\t\t\tcontrollers.set(runtime, controller);\n\t\t},\n\t);\n\treturn {\n\t\t...handle,\n\t\tdispose: async () => {\n\t\t\ttry {\n\t\t\t\tawait handle.dispose();\n\t\t\t} finally {\n\t\t\t\tcontrollers.delete(runtime);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** Replace only bootstrap-owned contributions while preserving third-party entries. */\nexport async function refreshSessionBootstrapSkills(\n\truntime: CapabilityRuntime,\n\tskills: readonly Skill[],\n): Promise<void> {\n\tconst controller = controllers.get(runtime);\n\tif (!controller) throw new Error(t(\"Bootstrap skills plugin is not installed\"));\n\tawait controller.refresh(skills);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-tools.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap-tools.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAA2D,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,sBAAsB,EAA4B,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEjF,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IAC1E,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;CAChB;AAkBD,mFAAmF;AACnF,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,SAAS,cAAc,EAAE,EACtC,OAAO,GAAE,qBAA0B,GACjC,sBAAsB,CAcxB;AAED,uGAAuG;AACvG,wBAAgB,4BAA4B,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,4BAAiC,EAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAC3C,sBAAsB,CAGxB","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { t } from \"../i18n/index.ts\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(t(\"Readonly mode does not allow base tool overrides\"));\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t } from "../i18n/index.js";
|
|
1
2
|
import { createAllToolDefinitions, createReadOnlyToolDefinitions } from "../tools/index.js";
|
|
2
3
|
import { createToolDefinitionFromAgentTool } from "../tools/tool-definition-wrapper.js";
|
|
3
4
|
import { loadCapabilityPluginSync } from "./capability-plugin.js";
|
|
@@ -10,7 +11,7 @@ function resolveSessionToolDefinitions(cwd, options, baseToolsOverride) {
|
|
|
10
11
|
: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));
|
|
11
12
|
}
|
|
12
13
|
if (options.mode === "readonly") {
|
|
13
|
-
throw new Error("Readonly mode does not allow base tool overrides");
|
|
14
|
+
throw new Error(t("Readonly mode does not allow base tool overrides"));
|
|
14
15
|
}
|
|
15
16
|
return Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-tools.js","sourceRoot":"","sources":["../../../src/core/extensions/bootstrap-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAqB,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAA+B,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAE,+BAA+B,EAAiB,MAAM,iBAAiB,CAAC;AAEjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAYvE,SAAS,6BAA6B,CACrC,GAAW,EACX,OAAqC,EACrC,iBAA6C,EACjB;IAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC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;IAC7F,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,kDAAkD,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC,CAAC;AAAA,CAC/F;AAED,mFAAmF;AACnF,MAAM,UAAU,qBAAqB,CACpC,OAA0B,EAC1B,WAAsC,EACtC,OAAO,GAA0B,EAAE,EACV;IACzB,OAAO,wBAAwB,CAC9B,OAAO,EACP;QACC,EAAE,EAAE,yBAAyB;QAC7B,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO;QACnC,UAAU,EAAE,+BAA+B;QAC3C,KAAK,EAAE,4BAA4B;QACnC,oBAAoB,EAAE,CAAC,OAAO,CAAC;KAC/B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC;QACR,KAAK,MAAM,UAAU,IAAI,WAAW;YAAE,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAAA,CACnE,CACD,CAAC;AAAA,CACF;AAED,uGAAuG;AACvG,MAAM,UAAU,4BAA4B,CAC3C,OAA0B,EAC1B,GAAW,EACX,OAAO,GAAiC,EAAE,EAC1C,iBAA6C,EACpB;IACzB,MAAM,WAAW,GAAG,6BAA6B,CAAC,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACnF,OAAO,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAAA,CAC5D","sourcesContent":["import type { AgentTool } from \"@agent-forge/agent-core\";\nimport { t } from \"../i18n/index.ts\";\nimport { createAllToolDefinitions, createReadOnlyToolDefinitions, type ToolsOptions } from \"../tools/index.ts\";\nimport type { ToolDefinition } from \"../tools/tool-definition.ts\";\nimport { createToolDefinitionFromAgentTool } from \"../tools/tool-definition-wrapper.ts\";\nimport { type CapabilityPluginHandle, loadCapabilityPluginSync } from \"./capability-plugin.ts\";\nimport type { CapabilityRuntime } from \"./capability-runtime.ts\";\nimport { EXPERIMENTAL_PUBLIC_API_VERSION, type HostMode } from \"./public-api.ts\";\n\nexport const BOOTSTRAP_TOOLS_PLUGIN_ID = \"agent-forge.bootstrap-tools\";\n\nexport interface BootstrapToolsOptions {\n\tversion?: string;\n}\n\nexport interface SessionBootstrapToolsOptions extends BootstrapToolsOptions {\n\tread?: ToolsOptions[\"read\"];\n\tbash?: ToolsOptions[\"bash\"];\n\tmode?: HostMode;\n}\n\nfunction resolveSessionToolDefinitions(\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions,\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): readonly ToolDefinition[] {\n\tif (!baseToolsOverride) {\n\t\treturn options.mode === \"readonly\"\n\t\t\t? createReadOnlyToolDefinitions(cwd, { read: options.read })\n\t\t\t: Object.values(createAllToolDefinitions(cwd, { read: options.read, bash: options.bash }));\n\t}\n\tif (options.mode === \"readonly\") {\n\t\tthrow new Error(t(\"Readonly mode does not allow base tool overrides\"));\n\t}\n\treturn Object.values(baseToolsOverride).map((tool) => createToolDefinitionFromAgentTool(tool));\n}\n\n/** Install the default coding tools through the same facade available to users. */\nexport function installBootstrapTools(\n\truntime: CapabilityRuntime,\n\tdefinitions: readonly ToolDefinition[],\n\toptions: BootstrapToolsOptions = {},\n): CapabilityPluginHandle {\n\treturn loadCapabilityPluginSync(\n\t\truntime,\n\t\t{\n\t\t\tid: BOOTSTRAP_TOOLS_PLUGIN_ID,\n\t\t\tversion: options.version ?? \"0.0.0\",\n\t\t\tapiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,\n\t\t\tentry: \"<embedded:bootstrap-tools>\",\n\t\t\trequiredCapabilities: [\"tools\"],\n\t\t},\n\t\t(api) => {\n\t\t\tfor (const definition of definitions) api.registerTool(definition);\n\t\t},\n\t);\n}\n\n/** Build and install the standard coding tools without exposing their construction to AgentSession. */\nexport function installSessionBootstrapTools(\n\truntime: CapabilityRuntime,\n\tcwd: string,\n\toptions: SessionBootstrapToolsOptions = {},\n\tbaseToolsOverride?: Record<string, AgentTool>,\n): CapabilityPluginHandle {\n\tconst definitions = resolveSessionToolDefinitions(cwd, options, baseToolsOverride);\n\treturn installBootstrapTools(runtime, definitions, options);\n}\n"]}
|