@ai-agent-forge/agent-forge 0.85.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 +5969 -0
- package/README.md +629 -0
- package/dist/artifacts/artifact-store.d.ts +51 -0
- package/dist/artifacts/artifact-store.d.ts.map +1 -0
- package/dist/artifacts/artifact-store.js +87 -0
- package/dist/artifacts/artifact-store.js.map +1 -0
- package/dist/artifacts/paged-read.d.ts +51 -0
- package/dist/artifacts/paged-read.d.ts.map +1 -0
- package/dist/artifacts/paged-read.js +55 -0
- package/dist/artifacts/paged-read.js.map +1 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +11 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/bundle/.build-manifest.json +3566 -0
- package/dist/bundle/chunks/anthropic-messages-RJYU4TCY.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-LESTCUL7.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +78 -0
- package/dist/bundle/chunks/chunk-3QKHSPQL.js +8 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-4NKZMFSZ.js +1579 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-7ZY7IXZD.js +4 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
- package/dist/bundle/chunks/chunk-EWXX34QG.js +2 -0
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
- package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
- package/dist/bundle/chunks/chunk-KQEGUM34.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-MDOTREMR.js +11 -0
- package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-SER2HCLE.js +38 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-V46XUTK3.js +2 -0
- package/dist/bundle/chunks/chunk-WGLBM2BP.js +2 -0
- package/dist/bundle/chunks/chunk-WW3LMV3F.js +2 -0
- package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-NZ66X6K7.js +2 -0
- package/dist/bundle/chunks/google-vertex-2ZZOFBNQ.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-UDEHOBGS.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
- package/dist/bundle/chunks/mistral-conversations-B6DZRMEK.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
- package/dist/bundle/chunks/openai-codex-responses-UFH6O5K6.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-A55GHA4O.js +7 -0
- package/dist/bundle/chunks/openai-responses-TJLXRAXR.js +2 -0
- package/dist/bundle/chunks/openrouter-images-G3GT5BVT.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-SLF355GF.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/client.js +2 -0
- package/dist/bundle/index.js +8 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/capabilities/builtin.d.ts +46 -0
- package/dist/capabilities/builtin.d.ts.map +1 -0
- package/dist/capabilities/builtin.js +68 -0
- package/dist/capabilities/builtin.js.map +1 -0
- package/dist/cli/args.d.ts +102 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +712 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +102 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +23 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +51 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/experimental/auth.d.ts +16 -0
- package/dist/cli/experimental/auth.d.ts.map +1 -0
- package/dist/cli/experimental/auth.js +13 -0
- package/dist/cli/experimental/auth.js.map +1 -0
- package/dist/cli/experimental/cli.d.ts +6 -0
- package/dist/cli/experimental/cli.d.ts.map +1 -0
- package/dist/cli/experimental/cli.js +5 -0
- package/dist/cli/experimental/cli.js.map +1 -0
- package/dist/cli/experimental/command-options.d.ts +17 -0
- package/dist/cli/experimental/command-options.d.ts.map +1 -0
- package/dist/cli/experimental/command-options.js +35 -0
- package/dist/cli/experimental/command-options.js.map +1 -0
- package/dist/cli/experimental/command.d.ts +63 -0
- package/dist/cli/experimental/command.d.ts.map +1 -0
- package/dist/cli/experimental/command.js +130 -0
- package/dist/cli/experimental/command.js.map +1 -0
- package/dist/cli/experimental/commands/client.d.ts +13 -0
- package/dist/cli/experimental/commands/client.d.ts.map +1 -0
- package/dist/cli/experimental/commands/client.js +25 -0
- package/dist/cli/experimental/commands/client.js.map +1 -0
- package/dist/cli/experimental/commands/pi.d.ts +15 -0
- package/dist/cli/experimental/commands/pi.d.ts.map +1 -0
- package/dist/cli/experimental/commands/pi.js +26 -0
- package/dist/cli/experimental/commands/pi.js.map +1 -0
- package/dist/cli/experimental/commands/server.d.ts +13 -0
- package/dist/cli/experimental/commands/server.d.ts.map +1 -0
- package/dist/cli/experimental/commands/server.js +25 -0
- package/dist/cli/experimental/commands/server.js.map +1 -0
- package/dist/cli/experimental/transport-address.d.ts +10 -0
- package/dist/cli/experimental/transport-address.d.ts.map +1 -0
- package/dist/cli/experimental/transport-address.js +38 -0
- package/dist/cli/experimental/transport-address.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +71 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/plugin-command.d.ts +50 -0
- package/dist/cli/plugin-command.d.ts.map +1 -0
- package/dist/cli/plugin-command.js +85 -0
- package/dist/cli/plugin-command.js.map +1 -0
- package/dist/cli/plugin-manager-controller.d.ts +59 -0
- package/dist/cli/plugin-manager-controller.d.ts.map +1 -0
- package/dist/cli/plugin-manager-controller.js +183 -0
- package/dist/cli/plugin-manager-controller.js.map +1 -0
- package/dist/cli/plugin-selection-controller.d.ts +57 -0
- package/dist/cli/plugin-selection-controller.d.ts.map +1 -0
- package/dist/cli/plugin-selection-controller.js +159 -0
- package/dist/cli/plugin-selection-controller.js.map +1 -0
- package/dist/cli/serve.d.ts +39 -0
- package/dist/cli/serve.d.ts.map +1 -0
- package/dist/cli/serve.js +124 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/session-picker.d.ts +30 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +62 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +185 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli/trace-view.d.ts +86 -0
- package/dist/cli/trace-view.d.ts.map +1 -0
- package/dist/cli/trace-view.js +263 -0
- package/dist/cli/trace-view.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/config.d.ts +95 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +459 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-capability-contract.d.ts +322 -0
- package/dist/core/agent-capability-contract.d.ts.map +1 -0
- package/dist/core/agent-capability-contract.js +1154 -0
- package/dist/core/agent-capability-contract.js.map +1 -0
- package/dist/core/agent-session-bash.d.ts +51 -0
- package/dist/core/agent-session-bash.d.ts.map +1 -0
- package/dist/core/agent-session-bash.js +138 -0
- package/dist/core/agent-session-bash.js.map +1 -0
- package/dist/core/agent-session-compaction.d.ts +188 -0
- package/dist/core/agent-session-compaction.d.ts.map +1 -0
- package/dist/core/agent-session-compaction.js +1071 -0
- package/dist/core/agent-session-compaction.js.map +1 -0
- package/dist/core/agent-session-context.d.ts +43 -0
- package/dist/core/agent-session-context.d.ts.map +1 -0
- package/dist/core/agent-session-context.js +170 -0
- package/dist/core/agent-session-context.js.map +1 -0
- package/dist/core/agent-session-extensions.d.ts +30 -0
- package/dist/core/agent-session-extensions.d.ts.map +1 -0
- package/dist/core/agent-session-extensions.js +74 -0
- package/dist/core/agent-session-extensions.js.map +1 -0
- package/dist/core/agent-session-internal.d.ts +290 -0
- package/dist/core/agent-session-internal.d.ts.map +1 -0
- package/dist/core/agent-session-internal.js +40 -0
- package/dist/core/agent-session-internal.js.map +1 -0
- package/dist/core/agent-session-lifecycle.d.ts +242 -0
- package/dist/core/agent-session-lifecycle.d.ts.map +1 -0
- package/dist/core/agent-session-lifecycle.js +699 -0
- package/dist/core/agent-session-lifecycle.js.map +1 -0
- package/dist/core/agent-session-loop-runner.d.ts +52 -0
- package/dist/core/agent-session-loop-runner.d.ts.map +1 -0
- package/dist/core/agent-session-loop-runner.js +168 -0
- package/dist/core/agent-session-loop-runner.js.map +1 -0
- package/dist/core/agent-session-loop.d.ts +39 -0
- package/dist/core/agent-session-loop.d.ts.map +1 -0
- package/dist/core/agent-session-loop.js +155 -0
- package/dist/core/agent-session-loop.js.map +1 -0
- package/dist/core/agent-session-model.d.ts +49 -0
- package/dist/core/agent-session-model.d.ts.map +1 -0
- package/dist/core/agent-session-model.js +155 -0
- package/dist/core/agent-session-model.js.map +1 -0
- package/dist/core/agent-session-paths.d.ts +3 -0
- package/dist/core/agent-session-paths.d.ts.map +1 -0
- package/dist/core/agent-session-paths.js +14 -0
- package/dist/core/agent-session-paths.js.map +1 -0
- package/dist/core/agent-session-projection.d.ts +53 -0
- package/dist/core/agent-session-projection.d.ts.map +1 -0
- package/dist/core/agent-session-projection.js +195 -0
- package/dist/core/agent-session-projection.js.map +1 -0
- package/dist/core/agent-session-retry.d.ts +28 -0
- package/dist/core/agent-session-retry.d.ts.map +1 -0
- package/dist/core/agent-session-retry.js +141 -0
- package/dist/core/agent-session-retry.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +181 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +297 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +281 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +680 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session-store.d.ts +47 -0
- package/dist/core/agent-session-store.d.ts.map +1 -0
- package/dist/core/agent-session-store.js +155 -0
- package/dist/core/agent-session-store.js.map +1 -0
- package/dist/core/agent-session-tools.d.ts +36 -0
- package/dist/core/agent-session-tools.d.ts.map +1 -0
- package/dist/core/agent-session-tools.js +305 -0
- package/dist/core/agent-session-tools.js.map +1 -0
- package/dist/core/agent-session.d.ts +1156 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2550 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +72 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +426 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +220 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +178 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +608 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +49 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +170 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +4 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +11 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/embedded-sdk.d.ts +96 -0
- package/dist/core/embedded-sdk.d.ts.map +1 -0
- package/dist/core/embedded-sdk.js +395 -0
- package/dist/core/embedded-sdk.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +6 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/agent-composition.d.ts +67 -0
- package/dist/core/extensions/agent-composition.d.ts.map +1 -0
- package/dist/core/extensions/agent-composition.js +785 -0
- package/dist/core/extensions/agent-composition.js.map +1 -0
- package/dist/core/extensions/bootstrap-agent-loop.d.ts +203 -0
- package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-agent-loop.js +565 -0
- package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.js +28 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-compaction-policy.js +81 -0
- package/dist/core/extensions/bootstrap-compaction-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-lifecycle.d.ts +26 -0
- package/dist/core/extensions/bootstrap-lifecycle.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-lifecycle.js +181 -0
- package/dist/core/extensions/bootstrap-lifecycle.js.map +1 -0
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-overflow-policy.js +29 -0
- package/dist/core/extensions/bootstrap-overflow-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-retry-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-retry-policy.js +28 -0
- package/dist/core/extensions/bootstrap-retry-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-skills.d.ts +16 -0
- package/dist/core/extensions/bootstrap-skills.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-skills.js +119 -0
- package/dist/core/extensions/bootstrap-skills.js.map +1 -0
- package/dist/core/extensions/bootstrap-tools.d.ts +20 -0
- package/dist/core/extensions/bootstrap-tools.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-tools.js +35 -0
- package/dist/core/extensions/bootstrap-tools.js.map +1 -0
- package/dist/core/extensions/capability-exports.d.ts +5 -0
- package/dist/core/extensions/capability-exports.d.ts.map +1 -0
- package/dist/core/extensions/capability-exports.js +4 -0
- package/dist/core/extensions/capability-exports.js.map +1 -0
- package/dist/core/extensions/capability-plugin.d.ts +69 -0
- package/dist/core/extensions/capability-plugin.d.ts.map +1 -0
- package/dist/core/extensions/capability-plugin.js +485 -0
- package/dist/core/extensions/capability-plugin.js.map +1 -0
- package/dist/core/extensions/capability-runtime-events.d.ts +22 -0
- package/dist/core/extensions/capability-runtime-events.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-events.js +381 -0
- package/dist/core/extensions/capability-runtime-events.js.map +1 -0
- package/dist/core/extensions/capability-runtime-guards.d.ts +93 -0
- package/dist/core/extensions/capability-runtime-guards.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-guards.js +800 -0
- package/dist/core/extensions/capability-runtime-guards.js.map +1 -0
- package/dist/core/extensions/capability-runtime-inspect.d.ts +12 -0
- package/dist/core/extensions/capability-runtime-inspect.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-inspect.js +106 -0
- package/dist/core/extensions/capability-runtime-inspect.js.map +1 -0
- package/dist/core/extensions/capability-runtime-manifest.d.ts +19 -0
- package/dist/core/extensions/capability-runtime-manifest.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-manifest.js +218 -0
- package/dist/core/extensions/capability-runtime-manifest.js.map +1 -0
- package/dist/core/extensions/capability-runtime-operation.d.ts +26 -0
- package/dist/core/extensions/capability-runtime-operation.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-operation.js +88 -0
- package/dist/core/extensions/capability-runtime-operation.js.map +1 -0
- package/dist/core/extensions/capability-runtime-snapshot.d.ts +11 -0
- package/dist/core/extensions/capability-runtime-snapshot.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-snapshot.js +81 -0
- package/dist/core/extensions/capability-runtime-snapshot.js.map +1 -0
- package/dist/core/extensions/capability-runtime-store.d.ts +34 -0
- package/dist/core/extensions/capability-runtime-store.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-store.js +153 -0
- package/dist/core/extensions/capability-runtime-store.js.map +1 -0
- package/dist/core/extensions/capability-runtime-tool.d.ts +10 -0
- package/dist/core/extensions/capability-runtime-tool.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-tool.js +10 -0
- package/dist/core/extensions/capability-runtime-tool.js.map +1 -0
- package/dist/core/extensions/capability-runtime-types.d.ts +303 -0
- package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-types.js +2 -0
- package/dist/core/extensions/capability-runtime-types.js.map +1 -0
- package/dist/core/extensions/capability-runtime-validation.d.ts +35 -0
- package/dist/core/extensions/capability-runtime-validation.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-validation.js +380 -0
- package/dist/core/extensions/capability-runtime-validation.js.map +1 -0
- package/dist/core/extensions/capability-runtime.d.ts +7 -0
- package/dist/core/extensions/capability-runtime.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime.js +2170 -0
- package/dist/core/extensions/capability-runtime.js.map +1 -0
- package/dist/core/extensions/compaction-memory-failure-mode.d.ts +43 -0
- package/dist/core/extensions/compaction-memory-failure-mode.d.ts.map +1 -0
- package/dist/core/extensions/compaction-memory-failure-mode.js +31 -0
- package/dist/core/extensions/compaction-memory-failure-mode.js.map +1 -0
- package/dist/core/extensions/context-strategy-binding.d.ts +12 -0
- package/dist/core/extensions/context-strategy-binding.d.ts.map +1 -0
- package/dist/core/extensions/context-strategy-binding.js +54 -0
- package/dist/core/extensions/context-strategy-binding.js.map +1 -0
- package/dist/core/extensions/index.d.ts +19 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +18 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/lifecycle-catalog.d.ts +584 -0
- package/dist/core/extensions/lifecycle-catalog.d.ts.map +1 -0
- package/dist/core/extensions/lifecycle-catalog.js +1903 -0
- package/dist/core/extensions/lifecycle-catalog.js.map +1 -0
- package/dist/core/extensions/lifecycle-delivery-queue.d.ts +48 -0
- package/dist/core/extensions/lifecycle-delivery-queue.d.ts.map +1 -0
- package/dist/core/extensions/lifecycle-delivery-queue.js +164 -0
- package/dist/core/extensions/lifecycle-delivery-queue.js.map +1 -0
- package/dist/core/extensions/microcompact.d.ts +71 -0
- package/dist/core/extensions/microcompact.d.ts.map +1 -0
- package/dist/core/extensions/microcompact.js +123 -0
- package/dist/core/extensions/microcompact.js.map +1 -0
- package/dist/core/extensions/public-api.d.ts +10 -0
- package/dist/core/extensions/public-api.d.ts.map +1 -0
- package/dist/core/extensions/public-api.js +9 -0
- package/dist/core/extensions/public-api.js.map +1 -0
- package/dist/core/facade/coding-agent-facade.d.ts +338 -0
- package/dist/core/facade/coding-agent-facade.d.ts.map +1 -0
- package/dist/core/facade/coding-agent-facade.js +115 -0
- package/dist/core/facade/coding-agent-facade.js.map +1 -0
- package/dist/core/facade/coding-agent-runtime-facade.d.ts +115 -0
- package/dist/core/facade/coding-agent-runtime-facade.d.ts.map +1 -0
- package/dist/core/facade/coding-agent-runtime-facade.js +63 -0
- package/dist/core/facade/coding-agent-runtime-facade.js.map +1 -0
- package/dist/core/facade/index.d.ts +6 -0
- package/dist/core/facade/index.d.ts.map +1 -0
- package/dist/core/facade/index.js +3 -0
- package/dist/core/facade/index.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +57 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +323 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +98 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input-source.d.ts +9 -0
- package/dist/core/input-source.d.ts.map +1 -0
- package/dist/core/input-source.js +2 -0
- package/dist/core/input-source.js.map +1 -0
- package/dist/core/keybindings.d.ts +442 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +329 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/logger.d.ts +107 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +246 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/messages.d.ts +85 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +146 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-config.d.ts +586 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +258 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +49 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +115 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +124 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +590 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/model-runtime.d.ts +100 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +598 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +115 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +90 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-install-host.d.ts +23 -0
- package/dist/core/package-install-host.d.ts.map +1 -0
- package/dist/core/package-install-host.js +202 -0
- package/dist/core/package-install-host.js.map +1 -0
- package/dist/core/package-manager.d.ts +93 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +947 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/package-process-runner.d.ts +4 -0
- package/dist/core/package-process-runner.d.ts.map +1 -0
- package/dist/core/package-process-runner.js +47 -0
- package/dist/core/package-process-runner.js.map +1 -0
- package/dist/core/package-resource-collection.d.ts +16 -0
- package/dist/core/package-resource-collection.d.ts.map +1 -0
- package/dist/core/package-resource-collection.js +300 -0
- package/dist/core/package-resource-collection.js.map +1 -0
- package/dist/core/package-resource-discovery.d.ts +33 -0
- package/dist/core/package-resource-discovery.d.ts.map +1 -0
- package/dist/core/package-resource-discovery.js +449 -0
- package/dist/core/package-resource-discovery.js.map +1 -0
- package/dist/core/package-source.d.ts +157 -0
- package/dist/core/package-source.d.ts.map +1 -0
- package/dist/core/package-source.js +179 -0
- package/dist/core/package-source.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +7 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +26 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +54 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +236 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-composer.d.ts +58 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +403 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +121 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +211 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +687 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +395 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +1112 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-export.d.ts +7 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +48 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +463 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1583 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/session-start.d.ts +12 -0
- package/dist/core/session-start.d.ts.map +1 -0
- package/dist/core/session-start.js +2 -0
- package/dist/core/session-start.js.map +1 -0
- package/dist/core/session-storage.d.ts +130 -0
- package/dist/core/session-storage.d.ts.map +1 -0
- package/dist/core/session-storage.js +386 -0
- package/dist/core/session-storage.js.map +1 -0
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +352 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +987 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +382 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +33 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +8 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +137 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +11 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +46 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +87 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +409 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +110 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +425 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +55 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +305 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +42 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +303 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +41 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +309 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +44 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +129 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +41 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +173 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts +39 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +282 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +65 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +15 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +36 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/tool-definition.d.ts +123 -0
- package/dist/core/tools/tool-definition.d.ts.map +1 -0
- package/dist/core/tools/tool-definition.js +20 -0
- package/dist/core/tools/tool-definition.js.map +1 -0
- package/dist/core/tools/tool-search.d.ts +30 -0
- package/dist/core/tools/tool-search.d.ts.map +1 -0
- package/dist/core/tools/tool-search.js +99 -0
- package/dist/core/tools/tool-search.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +30 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +202 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trace-retention.d.ts +19 -0
- package/dist/core/trace-retention.d.ts.map +1 -0
- package/dist/core/trace-retention.js +91 -0
- package/dist/core/trace-retention.js.map +1 -0
- package/dist/core/usage-totals.d.ts +21 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +53 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/durable/durable-service.d.ts +136 -0
- package/dist/durable/durable-service.d.ts.map +1 -0
- package/dist/durable/durable-service.js +710 -0
- package/dist/durable/durable-service.js.map +1 -0
- package/dist/e2e/stdio-launcher.d.ts +25 -0
- package/dist/e2e/stdio-launcher.d.ts.map +1 -0
- package/dist/e2e/stdio-launcher.js +244 -0
- package/dist/e2e/stdio-launcher.js.map +1 -0
- package/dist/host/agent-retry-scheduler.d.ts +65 -0
- package/dist/host/agent-retry-scheduler.d.ts.map +1 -0
- package/dist/host/agent-retry-scheduler.js +52 -0
- package/dist/host/agent-retry-scheduler.js.map +1 -0
- package/dist/host/auto-compaction.d.ts +56 -0
- package/dist/host/auto-compaction.d.ts.map +1 -0
- package/dist/host/auto-compaction.js +62 -0
- package/dist/host/auto-compaction.js.map +1 -0
- package/dist/host/branch-reload.d.ts +56 -0
- package/dist/host/branch-reload.d.ts.map +1 -0
- package/dist/host/branch-reload.js +39 -0
- package/dist/host/branch-reload.js.map +1 -0
- package/dist/host/channel-adapter.d.ts +25 -0
- package/dist/host/channel-adapter.d.ts.map +1 -0
- package/dist/host/channel-adapter.js +45 -0
- package/dist/host/channel-adapter.js.map +1 -0
- package/dist/host/checkpoint-commit.d.ts +74 -0
- package/dist/host/checkpoint-commit.d.ts.map +1 -0
- package/dist/host/checkpoint-commit.js +76 -0
- package/dist/host/checkpoint-commit.js.map +1 -0
- package/dist/host/manual-compaction.d.ts +43 -0
- package/dist/host/manual-compaction.d.ts.map +1 -0
- package/dist/host/manual-compaction.js +63 -0
- package/dist/host/manual-compaction.js.map +1 -0
- package/dist/host/output-projection.d.ts +61 -0
- package/dist/host/output-projection.d.ts.map +1 -0
- package/dist/host/output-projection.js +74 -0
- package/dist/host/output-projection.js.map +1 -0
- package/dist/host/output-reducer.d.ts +43 -0
- package/dist/host/output-reducer.d.ts.map +1 -0
- package/dist/host/output-reducer.js +77 -0
- package/dist/host/output-reducer.js.map +1 -0
- package/dist/host/output-serializer.d.ts +31 -0
- package/dist/host/output-serializer.d.ts.map +1 -0
- package/dist/host/output-serializer.js +120 -0
- package/dist/host/output-serializer.js.map +1 -0
- package/dist/host/overflow-recovery.d.ts +55 -0
- package/dist/host/overflow-recovery.d.ts.map +1 -0
- package/dist/host/overflow-recovery.js +89 -0
- package/dist/host/overflow-recovery.js.map +1 -0
- package/dist/host/retry-common.d.ts +29 -0
- package/dist/host/retry-common.d.ts.map +1 -0
- package/dist/host/retry-common.js +12 -0
- package/dist/host/retry-common.js.map +1 -0
- package/dist/host/session-event-translation.d.ts +26 -0
- package/dist/host/session-event-translation.d.ts.map +1 -0
- package/dist/host/session-event-translation.js +61 -0
- package/dist/host/session-event-translation.js.map +1 -0
- package/dist/host/summary-retry.d.ts +54 -0
- package/dist/host/summary-retry.d.ts.map +1 -0
- package/dist/host/summary-retry.js +66 -0
- package/dist/host/summary-retry.js.map +1 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +176 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +36 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +1630 -0
- package/dist/main.js.map +1 -0
- package/dist/migration/migration-tool.d.ts +56 -0
- package/dist/migration/migration-tool.d.ts.map +1 -0
- package/dist/migration/migration-tool.js +72 -0
- package/dist/migration/migration-tool.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +272 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +336 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +25 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +151 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +176 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +56 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +113 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +857 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +19 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +71 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +22 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +87 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +141 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/dialog-editor.d.ts +21 -0
- package/dist/modes/interactive/components/dialog-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-editor.js +98 -0
- package/dist/modes/interactive/components/dialog-editor.js.map +1 -0
- package/dist/modes/interactive/components/dialog-input.d.ts +23 -0
- package/dist/modes/interactive/components/dialog-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-input.js +61 -0
- package/dist/modes/interactive/components/dialog-input.js.map +1 -0
- package/dist/modes/interactive/components/dialog-selector.d.ts +26 -0
- package/dist/modes/interactive/components/dialog-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-selector.js +83 -0
- package/dist/modes/interactive/components/dialog-selector.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +33 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +248 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +35 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +188 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +67 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +381 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts +62 -0
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/plugin-manager-entry.js +294 -0
- package/dist/modes/interactive/components/plugin-manager-entry.js.map +1 -0
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts +82 -0
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/plugin-selection-entry.js +228 -0
- package/dist/modes/interactive/components/plugin-selection-entry.js.map +1 -0
- package/dist/modes/interactive/components/render-types.d.ts +26 -0
- package/dist/modes/interactive/components/render-types.d.ts.map +1 -0
- package/dist/modes/interactive/components/render-types.js +7 -0
- package/dist/modes/interactive/components/render-types.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +46 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +328 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +158 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +143 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +1053 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +88 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +677 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +34 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +109 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +59 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +335 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-list.d.ts +67 -0
- package/dist/modes/interactive/components/tree-list.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-list.js +710 -0
- package/dist/modes/interactive/components/tree-list.js.map +1 -0
- package/dist/modes/interactive/components/tree-render.d.ts +17 -0
- package/dist/modes/interactive/components/tree-render.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-render.js +316 -0
- package/dist/modes/interactive/components/tree-render.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +25 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +235 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/tree-types.d.ts +35 -0
- package/dist/modes/interactive/components/tree-types.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-types.js +2 -0
- package/dist/modes/interactive/components/tree-types.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +49 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +38 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-auth.d.ts +90 -0
- package/dist/modes/interactive/interactive-auth.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-auth.js +492 -0
- package/dist/modes/interactive/interactive-auth.js.map +1 -0
- package/dist/modes/interactive/interactive-commands.d.ts +68 -0
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-commands.js +157 -0
- package/dist/modes/interactive/interactive-commands.js.map +1 -0
- package/dist/modes/interactive/interactive-dialog-ui.d.ts +73 -0
- package/dist/modes/interactive/interactive-dialog-ui.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-dialog-ui.js +189 -0
- package/dist/modes/interactive/interactive-dialog-ui.js.map +1 -0
- package/dist/modes/interactive/interactive-format.d.ts +65 -0
- package/dist/modes/interactive/interactive-format.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-format.js +268 -0
- package/dist/modes/interactive/interactive-format.js.map +1 -0
- package/dist/modes/interactive/interactive-helpers.d.ts +25 -0
- package/dist/modes/interactive/interactive-helpers.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-helpers.js +73 -0
- package/dist/modes/interactive/interactive-helpers.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +640 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4107 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/interactive-selectors.d.ts +95 -0
- package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-selectors.js +356 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +11 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +35 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +90 -0
- package/dist/modes/interactive/theme/light.json +89 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +40 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +126 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +352 -0
- package/dist/modes/interactive/theme/theme.d.ts +122 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1093 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/json-event.d.ts +34 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +29 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +32 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +205 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +254 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +496 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +53 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +540 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +486 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +18 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +944 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/plugins/ecosystem/active-bindings.d.ts +92 -0
- package/dist/plugins/ecosystem/active-bindings.d.ts.map +1 -0
- package/dist/plugins/ecosystem/active-bindings.js +198 -0
- package/dist/plugins/ecosystem/active-bindings.js.map +1 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.d.ts +32 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.d.ts.map +1 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.js +32 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.js.map +1 -0
- package/dist/plugins/ecosystem/catalog.d.ts +38 -0
- package/dist/plugins/ecosystem/catalog.d.ts.map +1 -0
- package/dist/plugins/ecosystem/catalog.js +90 -0
- package/dist/plugins/ecosystem/catalog.js.map +1 -0
- package/dist/plugins/ecosystem/cli.d.ts +102 -0
- package/dist/plugins/ecosystem/cli.d.ts.map +1 -0
- package/dist/plugins/ecosystem/cli.js +970 -0
- package/dist/plugins/ecosystem/cli.js.map +1 -0
- package/dist/plugins/ecosystem/default-active-bindings.d.ts +33 -0
- package/dist/plugins/ecosystem/default-active-bindings.d.ts.map +1 -0
- package/dist/plugins/ecosystem/default-active-bindings.js +105 -0
- package/dist/plugins/ecosystem/default-active-bindings.js.map +1 -0
- package/dist/plugins/ecosystem/default-plugin-market.d.ts +68 -0
- package/dist/plugins/ecosystem/default-plugin-market.d.ts.map +1 -0
- package/dist/plugins/ecosystem/default-plugin-market.js +146 -0
- package/dist/plugins/ecosystem/default-plugin-market.js.map +1 -0
- package/dist/plugins/ecosystem/distribution.d.ts +113 -0
- package/dist/plugins/ecosystem/distribution.d.ts.map +1 -0
- package/dist/plugins/ecosystem/distribution.js +371 -0
- package/dist/plugins/ecosystem/distribution.js.map +1 -0
- package/dist/plugins/ecosystem/index.d.ts +56 -0
- package/dist/plugins/ecosystem/index.d.ts.map +1 -0
- package/dist/plugins/ecosystem/index.js +31 -0
- package/dist/plugins/ecosystem/index.js.map +1 -0
- package/dist/plugins/ecosystem/installer.d.ts +130 -0
- package/dist/plugins/ecosystem/installer.d.ts.map +1 -0
- package/dist/plugins/ecosystem/installer.js +316 -0
- package/dist/plugins/ecosystem/installer.js.map +1 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.d.ts +47 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.js +208 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-distribution-host.d.ts +55 -0
- package/dist/plugins/ecosystem/node-distribution-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-distribution-host.js +423 -0
- package/dist/plugins/ecosystem/node-distribution-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-local-package-source.d.ts +10 -0
- package/dist/plugins/ecosystem/node-local-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-local-package-source.js +97 -0
- package/dist/plugins/ecosystem/node-local-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts +58 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.js +326 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-host.d.ts +91 -0
- package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-host.js +857 -0
- package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.d.ts +34 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.js +221 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-stack.d.ts +28 -0
- package/dist/plugins/ecosystem/node-package-install-stack.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-stack.js +65 -0
- package/dist/plugins/ecosystem/node-package-install-stack.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-media.d.ts +14 -0
- package/dist/plugins/ecosystem/node-package-media.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-media.js +36 -0
- package/dist/plugins/ecosystem/node-package-media.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts +83 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js +423 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts +48 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js +191 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts +26 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.js +120 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.js.map +1 -0
- package/dist/plugins/ecosystem/node-registry-source.d.ts +35 -0
- package/dist/plugins/ecosystem/node-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-registry-source.js +286 -0
- package/dist/plugins/ecosystem/node-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-release-package-source.d.ts +47 -0
- package/dist/plugins/ecosystem/node-release-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-release-package-source.js +336 -0
- package/dist/plugins/ecosystem/node-release-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-tar-package.d.ts +11 -0
- package/dist/plugins/ecosystem/node-tar-package.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-tar-package.js +294 -0
- package/dist/plugins/ecosystem/node-tar-package.js.map +1 -0
- package/dist/plugins/ecosystem/node-tar-writer.d.ts +16 -0
- package/dist/plugins/ecosystem/node-tar-writer.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-tar-writer.js +134 -0
- package/dist/plugins/ecosystem/node-tar-writer.js.map +1 -0
- package/dist/plugins/ecosystem/node-url-package-source.d.ts +31 -0
- package/dist/plugins/ecosystem/node-url-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-url-package-source.js +159 -0
- package/dist/plugins/ecosystem/node-url-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/plugin-acquisition.d.ts +88 -0
- package/dist/plugins/ecosystem/plugin-acquisition.d.ts.map +1 -0
- package/dist/plugins/ecosystem/plugin-acquisition.js +197 -0
- package/dist/plugins/ecosystem/plugin-acquisition.js.map +1 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts +87 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts.map +1 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.js +134 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.js.map +1 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.d.ts +8 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.d.ts.map +1 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.js +16 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.js.map +1 -0
- package/dist/plugins/ecosystem/registry.d.ts +121 -0
- package/dist/plugins/ecosystem/registry.d.ts.map +1 -0
- package/dist/plugins/ecosystem/registry.js +324 -0
- package/dist/plugins/ecosystem/registry.js.map +1 -0
- package/dist/plugins/ecosystem/resolver.d.ts +32 -0
- package/dist/plugins/ecosystem/resolver.d.ts.map +1 -0
- package/dist/plugins/ecosystem/resolver.js +325 -0
- package/dist/plugins/ecosystem/resolver.js.map +1 -0
- package/dist/plugins/ecosystem/selection-store.d.ts +66 -0
- package/dist/plugins/ecosystem/selection-store.d.ts.map +1 -0
- package/dist/plugins/ecosystem/selection-store.js +241 -0
- package/dist/plugins/ecosystem/selection-store.js.map +1 -0
- package/dist/plugins/ecosystem/selection.d.ts +54 -0
- package/dist/plugins/ecosystem/selection.d.ts.map +1 -0
- package/dist/plugins/ecosystem/selection.js +116 -0
- package/dist/plugins/ecosystem/selection.js.map +1 -0
- package/dist/plugins/ecosystem/state.d.ts +96 -0
- package/dist/plugins/ecosystem/state.d.ts.map +1 -0
- package/dist/plugins/ecosystem/state.js +346 -0
- package/dist/plugins/ecosystem/state.js.map +1 -0
- package/dist/plugins/ecosystem/types.d.ts +90 -0
- package/dist/plugins/ecosystem/types.d.ts.map +1 -0
- package/dist/plugins/ecosystem/types.js +8 -0
- package/dist/plugins/ecosystem/types.js.map +1 -0
- package/dist/plugins/ecosystem/updates.d.ts +30 -0
- package/dist/plugins/ecosystem/updates.d.ts.map +1 -0
- package/dist/plugins/ecosystem/updates.js +148 -0
- package/dist/plugins/ecosystem/updates.js.map +1 -0
- package/dist/plugins/integrity-adapter.d.ts +58 -0
- package/dist/plugins/integrity-adapter.d.ts.map +1 -0
- package/dist/plugins/integrity-adapter.js +70 -0
- package/dist/plugins/integrity-adapter.js.map +1 -0
- package/dist/plugins/mcp-http.d.ts +78 -0
- package/dist/plugins/mcp-http.d.ts.map +1 -0
- package/dist/plugins/mcp-http.js +176 -0
- package/dist/plugins/mcp-http.js.map +1 -0
- package/dist/plugins/observability-types.d.ts +9 -0
- package/dist/plugins/observability-types.d.ts.map +1 -0
- package/dist/plugins/observability-types.js +9 -0
- package/dist/plugins/observability-types.js.map +1 -0
- package/dist/plugins/plugin-host.d.ts +46 -0
- package/dist/plugins/plugin-host.d.ts.map +1 -0
- package/dist/plugins/plugin-host.js +80 -0
- package/dist/plugins/plugin-host.js.map +1 -0
- package/dist/plugins/plugin-supervisor.d.ts +77 -0
- package/dist/plugins/plugin-supervisor.d.ts.map +1 -0
- package/dist/plugins/plugin-supervisor.js +82 -0
- package/dist/plugins/plugin-supervisor.js.map +1 -0
- package/dist/plugins/subagent-task/runner-entry.d.ts +35 -0
- package/dist/plugins/subagent-task/runner-entry.d.ts.map +1 -0
- package/dist/plugins/subagent-task/runner-entry.js +39 -0
- package/dist/plugins/subagent-task/runner-entry.js.map +1 -0
- package/dist/plugins/subagent-task/session-factory.d.ts +57 -0
- package/dist/plugins/subagent-task/session-factory.d.ts.map +1 -0
- package/dist/plugins/subagent-task/session-factory.js +51 -0
- package/dist/plugins/subagent-task/session-factory.js.map +1 -0
- package/dist/profile/child-facade.d.ts +44 -0
- package/dist/profile/child-facade.d.ts.map +1 -0
- package/dist/profile/child-facade.js +56 -0
- package/dist/profile/child-facade.js.map +1 -0
- package/dist/profile/dependency-wiring.d.ts +48 -0
- package/dist/profile/dependency-wiring.d.ts.map +1 -0
- package/dist/profile/dependency-wiring.js +56 -0
- package/dist/profile/dependency-wiring.js.map +1 -0
- package/dist/profile/domain-recovery.d.ts +60 -0
- package/dist/profile/domain-recovery.d.ts.map +1 -0
- package/dist/profile/domain-recovery.js +94 -0
- package/dist/profile/domain-recovery.js.map +1 -0
- package/dist/profile/first-roles.d.ts +30 -0
- package/dist/profile/first-roles.d.ts.map +1 -0
- package/dist/profile/first-roles.js +74 -0
- package/dist/profile/first-roles.js.map +1 -0
- package/dist/profile/goal-plugin.d.ts +38 -0
- package/dist/profile/goal-plugin.d.ts.map +1 -0
- package/dist/profile/goal-plugin.js +113 -0
- package/dist/profile/goal-plugin.js.map +1 -0
- package/dist/profile/identity.d.ts +58 -0
- package/dist/profile/identity.d.ts.map +1 -0
- package/dist/profile/identity.js +100 -0
- package/dist/profile/identity.js.map +1 -0
- package/dist/profile/lock.d.ts +59 -0
- package/dist/profile/lock.d.ts.map +1 -0
- package/dist/profile/lock.js +59 -0
- package/dist/profile/lock.js.map +1 -0
- package/dist/profile/plan-plugin.d.ts +44 -0
- package/dist/profile/plan-plugin.d.ts.map +1 -0
- package/dist/profile/plan-plugin.js +144 -0
- package/dist/profile/plan-plugin.js.map +1 -0
- package/dist/profile/plugin-profiles.d.ts +56 -0
- package/dist/profile/plugin-profiles.d.ts.map +1 -0
- package/dist/profile/plugin-profiles.js +192 -0
- package/dist/profile/plugin-profiles.js.map +1 -0
- package/dist/profile/policy-manifest.d.ts +53 -0
- package/dist/profile/policy-manifest.d.ts.map +1 -0
- package/dist/profile/policy-manifest.js +52 -0
- package/dist/profile/policy-manifest.js.map +1 -0
- package/dist/profile/profile-assembly.d.ts +74 -0
- package/dist/profile/profile-assembly.d.ts.map +1 -0
- package/dist/profile/profile-assembly.js +90 -0
- package/dist/profile/profile-assembly.js.map +1 -0
- package/dist/profile/profile-migration.d.ts +56 -0
- package/dist/profile/profile-migration.d.ts.map +1 -0
- package/dist/profile/profile-migration.js +60 -0
- package/dist/profile/profile-migration.js.map +1 -0
- package/dist/profile/profile-registry.d.ts +58 -0
- package/dist/profile/profile-registry.d.ts.map +1 -0
- package/dist/profile/profile-registry.js +74 -0
- package/dist/profile/profile-registry.js.map +1 -0
- package/dist/profile/role-assembly.d.ts +47 -0
- package/dist/profile/role-assembly.d.ts.map +1 -0
- package/dist/profile/role-assembly.js +31 -0
- package/dist/profile/role-assembly.js.map +1 -0
- package/dist/profile/role-catalog.d.ts +44 -0
- package/dist/profile/role-catalog.d.ts.map +1 -0
- package/dist/profile/role-catalog.js +130 -0
- package/dist/profile/role-catalog.js.map +1 -0
- package/dist/profile/role-orchestrator.d.ts +123 -0
- package/dist/profile/role-orchestrator.d.ts.map +1 -0
- package/dist/profile/role-orchestrator.js +194 -0
- package/dist/profile/role-orchestrator.js.map +1 -0
- package/dist/profile/role-runner.d.ts +99 -0
- package/dist/profile/role-runner.d.ts.map +1 -0
- package/dist/profile/role-runner.js +78 -0
- package/dist/profile/role-runner.js.map +1 -0
- package/dist/profile/root-facade.d.ts +36 -0
- package/dist/profile/root-facade.d.ts.map +1 -0
- package/dist/profile/root-facade.js +48 -0
- package/dist/profile/root-facade.js.map +1 -0
- package/dist/profile/skill-discovery-wiring.d.ts +58 -0
- package/dist/profile/skill-discovery-wiring.d.ts.map +1 -0
- package/dist/profile/skill-discovery-wiring.js +75 -0
- package/dist/profile/skill-discovery-wiring.js.map +1 -0
- package/dist/profile/state-store.d.ts +62 -0
- package/dist/profile/state-store.d.ts.map +1 -0
- package/dist/profile/state-store.js +140 -0
- package/dist/profile/state-store.js.map +1 -0
- package/dist/profile/todo-plugin.d.ts +37 -0
- package/dist/profile/todo-plugin.d.ts.map +1 -0
- package/dist/profile/todo-plugin.js +132 -0
- package/dist/profile/todo-plugin.js.map +1 -0
- package/dist/profiles/builtin-suites.d.ts +142 -0
- package/dist/profiles/builtin-suites.d.ts.map +1 -0
- package/dist/profiles/builtin-suites.js +395 -0
- package/dist/profiles/builtin-suites.js.map +1 -0
- package/dist/profiles/resolved-agent-profile.d.ts +83 -0
- package/dist/profiles/resolved-agent-profile.d.ts.map +1 -0
- package/dist/profiles/resolved-agent-profile.js +75 -0
- package/dist/profiles/resolved-agent-profile.js.map +1 -0
- package/dist/profiles/suite-lifecycle.d.ts +158 -0
- package/dist/profiles/suite-lifecycle.d.ts.map +1 -0
- package/dist/profiles/suite-lifecycle.js +447 -0
- package/dist/profiles/suite-lifecycle.js.map +1 -0
- package/dist/profiles/suite-loader.d.ts +410 -0
- package/dist/profiles/suite-loader.d.ts.map +1 -0
- package/dist/profiles/suite-loader.js +823 -0
- package/dist/profiles/suite-loader.js.map +1 -0
- package/dist/remote/server-assembly.d.ts +230 -0
- package/dist/remote/server-assembly.d.ts.map +1 -0
- package/dist/remote/server-assembly.js +1189 -0
- package/dist/remote/server-assembly.js.map +1 -0
- package/dist/remote/server-entry.d.ts +112 -0
- package/dist/remote/server-entry.d.ts.map +1 -0
- package/dist/remote/server-entry.js +239 -0
- package/dist/remote/server-entry.js.map +1 -0
- package/dist/remote/session-source.d.ts +101 -0
- package/dist/remote/session-source.d.ts.map +1 -0
- package/dist/remote/session-source.js +173 -0
- package/dist/remote/session-source.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/server/create-harness.d.ts +26 -0
- package/dist/server/create-harness.d.ts.map +1 -0
- package/dist/server/create-harness.js +106 -0
- package/dist/server/create-harness.js.map +1 -0
- package/dist/share/session-share.d.ts +98 -0
- package/dist/share/session-share.d.ts.map +1 -0
- package/dist/share/session-share.js +89 -0
- package/dist/share/session-share.js.map +1 -0
- package/dist/share/share-viewer.d.ts +43 -0
- package/dist/share/share-viewer.d.ts.map +1 -0
- package/dist/share/share-viewer.js +103 -0
- package/dist/share/share-viewer.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-ai-server.d.ts +77 -0
- package/dist/testing/mock-ai-server.d.ts.map +1 -0
- package/dist/testing/mock-ai-server.js +69 -0
- package/dist/testing/mock-ai-server.js.map +1 -0
- package/dist/testing/plugin-testkit.d.ts +148 -0
- package/dist/testing/plugin-testkit.d.ts.map +1 -0
- package/dist/testing/plugin-testkit.js +493 -0
- package/dist/testing/plugin-testkit.js.map +1 -0
- package/dist/testing/runtime-delivery-queue.d.ts +47 -0
- package/dist/testing/runtime-delivery-queue.d.ts.map +1 -0
- package/dist/testing/runtime-delivery-queue.js +158 -0
- package/dist/testing/runtime-delivery-queue.js.map +1 -0
- package/dist/testing/session-plugin-testkit.d.ts +144 -0
- package/dist/testing/session-plugin-testkit.d.ts.map +1 -0
- package/dist/testing/session-plugin-testkit.js +444 -0
- package/dist/testing/session-plugin-testkit.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +53 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/agent-forge-user-agent.d.ts +2 -0
- package/dist/utils/agent-forge-user-agent.d.ts.map +1 -0
- package/dist/utils/agent-forge-user-agent.js +5 -0
- package/dist/utils/agent-forge-user-agent.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +53 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +165 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +107 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +246 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +22 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +4 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +161 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +27 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +201 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +10 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +45 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +84 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +125 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +100 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +8 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +25 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +54 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +115 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +34 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +114 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +124 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +34 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +216 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/sync-sleep.d.ts +2 -0
- package/dist/utils/sync-sleep.d.ts.map +1 -0
- package/dist/utils/sync-sleep.js +11 -0
- package/dist/utils/sync-sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +13 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +177 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +19 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +45 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +24 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +437 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +21 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +86 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +348 -0
- package/docs/containerization.md +114 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/environment-variables.md +96 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +76 -0
- package/docs/json.md +98 -0
- package/docs/keybindings.md +245 -0
- package/docs/llama-cpp.md +101 -0
- package/docs/models.md +576 -0
- package/docs/packages.md +205 -0
- package/docs/prompt-templates.md +96 -0
- package/docs/providers.md +317 -0
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +1487 -0
- package/docs/sdk.md +1146 -0
- package/docs/security.md +24 -0
- package/docs/session-format.md +438 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +355 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +192 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +320 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +478 -0
- package/docs/usage.md +291 -0
- package/docs/windows.md +39 -0
- package/examples/README.md +21 -0
- package/examples/extensions/README.md +163 -0
- package/examples/extensions/bash-spawn-hook/index.ts +37 -0
- package/examples/extensions/bash-spawn-hook/plugin.json +10 -0
- package/examples/extensions/bookmark/index.ts +67 -0
- package/examples/extensions/bookmark/plugin.json +11 -0
- package/examples/extensions/built-in-tool-renderer/index.ts +262 -0
- package/examples/extensions/built-in-tool-renderer/plugin.json +10 -0
- package/examples/extensions/claude-rules/index.ts +119 -0
- package/examples/extensions/claude-rules/plugin.json +8 -0
- package/examples/extensions/cli-bridge/README.md +27 -0
- package/examples/extensions/cli-bridge/index.ts +320 -0
- package/examples/extensions/cli-bridge/plugin.json +10 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +53 -0
- package/examples/extensions/dynamic-resources/plugin.json +8 -0
- package/examples/extensions/dynamic-tools/index.ts +102 -0
- package/examples/extensions/dynamic-tools/plugin.json +14 -0
- package/examples/extensions/event-bus/index.ts +75 -0
- package/examples/extensions/event-bus/plugin.json +13 -0
- package/examples/extensions/file-trigger/index.ts +65 -0
- package/examples/extensions/file-trigger/plugin.json +13 -0
- package/examples/extensions/goal/README.md +16 -0
- package/examples/extensions/goal/index.ts +134 -0
- package/examples/extensions/goal/plugin.json +12 -0
- package/examples/extensions/hello/index.ts +29 -0
- package/examples/extensions/hello/plugin.json +10 -0
- package/examples/extensions/kimi-deferred-tools/index.ts +93 -0
- package/examples/extensions/kimi-deferred-tools/plugin.json +11 -0
- package/examples/extensions/mcp-stdio/README.md +19 -0
- package/examples/extensions/mcp-stdio/index.d.ts +64 -0
- package/examples/extensions/mcp-stdio/index.d.ts.map +1 -0
- package/examples/extensions/mcp-stdio/index.js +292 -0
- package/examples/extensions/mcp-stdio/index.js.map +1 -0
- package/examples/extensions/mcp-stdio/index.ts +381 -0
- package/examples/extensions/mcp-stdio/plugin.json +10 -0
- package/examples/extensions/memory-backend/index.ts +120 -0
- package/examples/extensions/memory-backend/plugin.json +10 -0
- package/examples/extensions/minimal-mode/index.ts +447 -0
- package/examples/extensions/minimal-mode/plugin.json +10 -0
- package/examples/extensions/multi-agent/README.md +7 -0
- package/examples/extensions/multi-agent/index.ts +592 -0
- package/examples/extensions/multi-agent/plugin.json +13 -0
- package/examples/extensions/notify/index.ts +70 -0
- package/examples/extensions/notify/plugin.json +8 -0
- package/examples/extensions/permission-gate/index.ts +55 -0
- package/examples/extensions/permission-gate/plugin.json +11 -0
- package/examples/extensions/pirate/index.ts +75 -0
- package/examples/extensions/pirate/plugin.json +8 -0
- package/examples/extensions/plan/README.md +16 -0
- package/examples/extensions/plan/index.ts +136 -0
- package/examples/extensions/plan/plugin.json +12 -0
- package/examples/extensions/prompt-customizer/index.ts +117 -0
- package/examples/extensions/prompt-customizer/plugin.json +8 -0
- package/examples/extensions/protected-paths/index.ts +44 -0
- package/examples/extensions/protected-paths/plugin.json +11 -0
- package/examples/extensions/provider-attribution/README.md +12 -0
- package/examples/extensions/provider-attribution/index.ts +86 -0
- package/examples/extensions/provider-attribution/plugin.json +10 -0
- package/examples/extensions/send-user-message/index.ts +118 -0
- package/examples/extensions/send-user-message/plugin.json +11 -0
- package/examples/extensions/session-name/index.ts +31 -0
- package/examples/extensions/session-name/plugin.json +11 -0
- package/examples/extensions/session-share/README.md +15 -0
- package/examples/extensions/session-share/index.ts +170 -0
- package/examples/extensions/session-share/plugin.json +15 -0
- package/examples/extensions/structured-output/index.ts +68 -0
- package/examples/extensions/structured-output/plugin.json +10 -0
- package/examples/extensions/subagent/README.md +177 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +157 -0
- package/examples/extensions/subagent/index.ts +1057 -0
- package/examples/extensions/subagent/plugin.json +13 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/suite-manager/README.md +45 -0
- package/examples/extensions/suite-manager/index.ts +182 -0
- package/examples/extensions/suite-manager/plugin.json +13 -0
- package/examples/extensions/timed-confirm/index.ts +93 -0
- package/examples/extensions/timed-confirm/plugin.json +13 -0
- package/examples/extensions/todo-set/README.md +18 -0
- package/examples/extensions/todo-set/index.ts +133 -0
- package/examples/extensions/todo-set/plugin.json +12 -0
- package/examples/extensions/tool-override/index.ts +159 -0
- package/examples/extensions/tool-override/plugin.json +11 -0
- package/examples/extensions/trigger-compact/index.ts +76 -0
- package/examples/extensions/trigger-compact/plugin.json +14 -0
- package/examples/extensions/truncated-tool/index.ts +204 -0
- package/examples/extensions/truncated-tool/plugin.json +10 -0
- package/examples/extensions/with-deps/index.ts +42 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/with-deps/plugin.json +10 -0
- package/examples/remote-client.ts +66 -0
- package/examples/rpc-extension-ui.ts +641 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +72 -0
- package/examples/sdk/13-session-runtime.ts +71 -0
- package/examples/sdk/14-custom-session-storage.ts +132 -0
- package/examples/sdk/README.md +139 -0
- package/package.json +111 -0
|
@@ -0,0 +1,1903 @@
|
|
|
1
|
+
export const PLUGIN_DISPOSE_EVENT_ID = "plugin.dispose";
|
|
2
|
+
export const PLUGIN_DISPOSE_EVENT_VERSION = 1;
|
|
3
|
+
export const PLUGIN_READY_EVENT_ID = "plugin.ready";
|
|
4
|
+
export const PLUGIN_READY_EVENT_VERSION = 1;
|
|
5
|
+
export const SESSION_CONTEXT_REPLACED_EVENT_ID = "session.context.replaced";
|
|
6
|
+
export const SESSION_CONTEXT_REPLACED_EVENT_VERSION = 1;
|
|
7
|
+
export const SESSION_RELOAD_EVENT_ID = "session.reload";
|
|
8
|
+
export const SESSION_RELOAD_EVENT_VERSION = 1;
|
|
9
|
+
export const AGENT_START_EVENT_ID = "agent.start";
|
|
10
|
+
export const AGENT_START_EVENT_VERSION = 1;
|
|
11
|
+
export const AGENT_SETTLED_EVENT_ID = "agent.settled";
|
|
12
|
+
export const AGENT_SETTLED_EVENT_VERSION = 1;
|
|
13
|
+
export const TURN_START_EVENT_ID = "turn.start";
|
|
14
|
+
export const TURN_START_EVENT_VERSION = 1;
|
|
15
|
+
export const TURN_END_EVENT_ID = "turn.end";
|
|
16
|
+
export const TURN_END_EVENT_VERSION = 1;
|
|
17
|
+
export const MESSAGE_START_EVENT_ID = "message.start";
|
|
18
|
+
export const MESSAGE_START_EVENT_VERSION = 1;
|
|
19
|
+
export const MESSAGE_END_EVENT_ID = "message.end";
|
|
20
|
+
export const MESSAGE_END_EVENT_VERSION = 1;
|
|
21
|
+
export const TOOL_EXECUTION_START_EVENT_ID = "tool.execution.start";
|
|
22
|
+
export const TOOL_EXECUTION_START_EVENT_VERSION = 1;
|
|
23
|
+
export const MODEL_SELECT_EVENT_ID = "model.select";
|
|
24
|
+
export const MODEL_SELECT_EVENT_VERSION = 1;
|
|
25
|
+
export const THINKING_LEVEL_SELECT_EVENT_ID = "thinking_level.select";
|
|
26
|
+
export const THINKING_LEVEL_SELECT_EVENT_VERSION = 1;
|
|
27
|
+
export const SESSION_INFO_CHANGED_EVENT_ID = "session.info.changed";
|
|
28
|
+
export const SESSION_INFO_CHANGED_EVENT_VERSION = 1;
|
|
29
|
+
export const SESSION_ENTRY_APPENDED_EVENT_ID = "session.entry.appended";
|
|
30
|
+
export const SESSION_ENTRY_APPENDED_EVENT_VERSION = 1;
|
|
31
|
+
export const AGENT_END_EVENT_ID = "agent.end";
|
|
32
|
+
export const AGENT_END_EVENT_VERSION = 1;
|
|
33
|
+
export const BEFORE_AGENT_START_EVENT_ID = "before.agent.start";
|
|
34
|
+
export const BEFORE_AGENT_START_EVENT_VERSION = 1;
|
|
35
|
+
export const BEFORE_AGENT_START_EVENT_VERSION_V2 = 2;
|
|
36
|
+
export const UI_PROMPT_START_EVENT_ID = "ui.prompt.start";
|
|
37
|
+
export const UI_PROMPT_START_EVENT_VERSION = 1;
|
|
38
|
+
export const UI_PROMPT_END_EVENT_ID = "ui.prompt.end";
|
|
39
|
+
export const UI_PROMPT_END_EVENT_VERSION = 1;
|
|
40
|
+
export const RESOURCES_DISCOVER_EVENT_ID = "resources.discover";
|
|
41
|
+
export const RESOURCES_DISCOVER_EVENT_VERSION = 1;
|
|
42
|
+
export const RESOURCES_DISCOVER_EVENT_VERSION_V2 = 2;
|
|
43
|
+
export const CONTEXT_ASSEMBLED_EVENT_ID = "context.assembled";
|
|
44
|
+
export const CONTEXT_ASSEMBLED_EVENT_VERSION = 1;
|
|
45
|
+
export const INPUT_RECEIVED_EVENT_ID = "input.received";
|
|
46
|
+
export const INPUT_RECEIVED_EVENT_VERSION = 1;
|
|
47
|
+
export const USER_BASH_EVENT_ID = "user.bash";
|
|
48
|
+
export const USER_BASH_EVENT_VERSION = 1;
|
|
49
|
+
export const SESSION_START_EVENT_ID = "session.start";
|
|
50
|
+
export const SESSION_START_EVENT_VERSION = 1;
|
|
51
|
+
export const MODEL_RESPONSE_EVENT_ID = "model.response";
|
|
52
|
+
export const MODEL_RESPONSE_EVENT_VERSION = 1;
|
|
53
|
+
export const MODEL_STREAM_EVENT_ID = "model.stream";
|
|
54
|
+
export const MODEL_STREAM_EVENT_VERSION = 1;
|
|
55
|
+
export const TOOL_RESULT_EVENT_ID = "tool.result";
|
|
56
|
+
export const TOOL_RESULT_EVENT_VERSION = 1;
|
|
57
|
+
export const TOOL_CALL_EVENT_ID = "tool.call";
|
|
58
|
+
export const TOOL_CALL_EVENT_VERSION = 1;
|
|
59
|
+
export const TOOL_RESULT_RAW_EVENT_ID = "tool.result.raw";
|
|
60
|
+
export const TOOL_RESULT_RAW_EVENT_VERSION = 1;
|
|
61
|
+
export const TOOL_EXECUTE_EVENT_ID = "tool.execute";
|
|
62
|
+
export const TOOL_EXECUTE_EVENT_VERSION = 1;
|
|
63
|
+
export const TOOL_COMMIT_EVENT_ID = "tool.commit";
|
|
64
|
+
export const TOOL_COMMIT_EVENT_VERSION = 1;
|
|
65
|
+
export const TOOL_GATE_BLOCKED_EVENT_ID = "tool.gate.blocked";
|
|
66
|
+
export const TOOL_GATE_BLOCKED_EVENT_VERSION = 1;
|
|
67
|
+
export const INPUT_GATE_BLOCKED_EVENT_ID = "input.gate.blocked";
|
|
68
|
+
export const INPUT_GATE_BLOCKED_EVENT_VERSION = 1;
|
|
69
|
+
export const OPERATION_END_EVENT_ID = "operation.end";
|
|
70
|
+
export const OPERATION_END_EVENT_VERSION = 1;
|
|
71
|
+
function assertString(value, label) {
|
|
72
|
+
if (typeof value !== "string" || value.trim() === "")
|
|
73
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
74
|
+
}
|
|
75
|
+
function assertJsonSafe(value, label, seen = new Set()) {
|
|
76
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
77
|
+
return;
|
|
78
|
+
if (typeof value === "number") {
|
|
79
|
+
if (Number.isFinite(value))
|
|
80
|
+
return;
|
|
81
|
+
throw new Error(`${label} must contain only finite JSON numbers`);
|
|
82
|
+
}
|
|
83
|
+
if (typeof value !== "object")
|
|
84
|
+
throw new Error(`${label} must be JSON-safe`);
|
|
85
|
+
if (seen.has(value))
|
|
86
|
+
throw new Error(`${label} must not contain cycles`);
|
|
87
|
+
seen.add(value);
|
|
88
|
+
if (Array.isArray(value)) {
|
|
89
|
+
for (const [index, entry] of value.entries())
|
|
90
|
+
assertJsonSafe(entry, `${label}[${index}]`, seen);
|
|
91
|
+
}
|
|
92
|
+
else if (isPlainRecord(value)) {
|
|
93
|
+
for (const [key, entry] of Object.entries(value))
|
|
94
|
+
assertJsonSafe(entry, `${label}.${key}`, seen);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
throw new Error(`${label} must contain only JSON arrays and plain objects`);
|
|
98
|
+
}
|
|
99
|
+
seen.delete(value);
|
|
100
|
+
}
|
|
101
|
+
export function validatePluginDisposeEventDataV1(value) {
|
|
102
|
+
if (!value ||
|
|
103
|
+
typeof value !== "object" ||
|
|
104
|
+
Array.isArray(value) ||
|
|
105
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
106
|
+
throw new Error("plugin.dispose data must be a plain object");
|
|
107
|
+
}
|
|
108
|
+
const record = value;
|
|
109
|
+
const keys = Object.keys(record).sort();
|
|
110
|
+
if (keys.join(",") !== "pluginId,pluginVersion,status,version") {
|
|
111
|
+
throw new Error("plugin.dispose data has unsupported fields");
|
|
112
|
+
}
|
|
113
|
+
if (record.version !== 1)
|
|
114
|
+
throw new Error("plugin.dispose data.version must be 1");
|
|
115
|
+
assertString(record.pluginId, "plugin.dispose data.pluginId");
|
|
116
|
+
assertString(record.pluginVersion, "plugin.dispose data.pluginVersion");
|
|
117
|
+
if (record.status !== "disposed" && record.status !== "failed") {
|
|
118
|
+
throw new Error("plugin.dispose data.status is invalid");
|
|
119
|
+
}
|
|
120
|
+
return value;
|
|
121
|
+
}
|
|
122
|
+
export function pluginDisposeEventDefinition() {
|
|
123
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
124
|
+
return {
|
|
125
|
+
id: PLUGIN_DISPOSE_EVENT_ID,
|
|
126
|
+
version: PLUGIN_DISPOSE_EVENT_VERSION,
|
|
127
|
+
phase: "committed",
|
|
128
|
+
schema: "agent-forge/plugin.dispose@1",
|
|
129
|
+
allowedRegistrationKinds,
|
|
130
|
+
validate: validatePluginDisposeEventDataV1,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export function validatePluginReadyEventDataV1(value) {
|
|
134
|
+
if (!value ||
|
|
135
|
+
typeof value !== "object" ||
|
|
136
|
+
Array.isArray(value) ||
|
|
137
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
138
|
+
throw new Error("plugin.ready data must be a plain object");
|
|
139
|
+
}
|
|
140
|
+
const record = value;
|
|
141
|
+
const keys = Object.keys(record).sort();
|
|
142
|
+
if (keys.join(",") !== "pluginId,pluginVersion,version") {
|
|
143
|
+
throw new Error("plugin.ready data has unsupported fields");
|
|
144
|
+
}
|
|
145
|
+
if (record.version !== 1)
|
|
146
|
+
throw new Error("plugin.ready data.version must be 1");
|
|
147
|
+
assertString(record.pluginId, "plugin.ready data.pluginId");
|
|
148
|
+
assertString(record.pluginVersion, "plugin.ready data.pluginVersion");
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
export function pluginReadyEventDefinition() {
|
|
152
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
153
|
+
return {
|
|
154
|
+
id: PLUGIN_READY_EVENT_ID,
|
|
155
|
+
version: PLUGIN_READY_EVENT_VERSION,
|
|
156
|
+
phase: "committed",
|
|
157
|
+
schema: "agent-forge/plugin.ready@1",
|
|
158
|
+
allowedRegistrationKinds,
|
|
159
|
+
validate: validatePluginReadyEventDataV1,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export const PLUGIN_REJECTED_EVENT_ID = "plugin.rejected";
|
|
163
|
+
export const PLUGIN_REJECTED_EVENT_VERSION = 1;
|
|
164
|
+
export function validatePluginRejectedEventDataV1(value) {
|
|
165
|
+
if (!value ||
|
|
166
|
+
typeof value !== "object" ||
|
|
167
|
+
Array.isArray(value) ||
|
|
168
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
169
|
+
throw new Error("plugin.rejected data must be a plain object");
|
|
170
|
+
}
|
|
171
|
+
const record = value;
|
|
172
|
+
const keys = Object.keys(record)
|
|
173
|
+
.filter((key) => key !== "pluginId")
|
|
174
|
+
.sort();
|
|
175
|
+
if (keys.join(",") !== "code,manifestPath,message,version") {
|
|
176
|
+
throw new Error("plugin.rejected data has unsupported fields");
|
|
177
|
+
}
|
|
178
|
+
if (record.version !== 1)
|
|
179
|
+
throw new Error("plugin.rejected data.version must be 1");
|
|
180
|
+
if (record.pluginId !== undefined && typeof record.pluginId !== "string") {
|
|
181
|
+
throw new Error("plugin.rejected data.pluginId must be a string when present");
|
|
182
|
+
}
|
|
183
|
+
assertString(record.manifestPath, "plugin.rejected data.manifestPath");
|
|
184
|
+
assertString(record.message, "plugin.rejected data.message");
|
|
185
|
+
if (record.code !== "invalid_manifest" &&
|
|
186
|
+
record.code !== "duplicate_plugin_id" &&
|
|
187
|
+
record.code !== "missing_dependency" &&
|
|
188
|
+
record.code !== "plugin_load_failed") {
|
|
189
|
+
throw new Error("plugin.rejected data.code is invalid");
|
|
190
|
+
}
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
export function pluginRejectedEventDefinition() {
|
|
194
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
195
|
+
return {
|
|
196
|
+
id: PLUGIN_REJECTED_EVENT_ID,
|
|
197
|
+
version: PLUGIN_REJECTED_EVENT_VERSION,
|
|
198
|
+
phase: "committed",
|
|
199
|
+
schema: "agent-forge/plugin.rejected@1",
|
|
200
|
+
allowedRegistrationKinds,
|
|
201
|
+
validate: validatePluginRejectedEventDataV1,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const contextReasons = new Set([
|
|
205
|
+
"request",
|
|
206
|
+
"reload",
|
|
207
|
+
"session_replace",
|
|
208
|
+
"compaction",
|
|
209
|
+
"overflow_recovery",
|
|
210
|
+
"retry",
|
|
211
|
+
"tree",
|
|
212
|
+
]);
|
|
213
|
+
export function validateSessionContextReplacedEventDataV1(value) {
|
|
214
|
+
if (!value ||
|
|
215
|
+
typeof value !== "object" ||
|
|
216
|
+
Array.isArray(value) ||
|
|
217
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
218
|
+
throw new Error("session.context.replaced data must be a plain object");
|
|
219
|
+
}
|
|
220
|
+
const record = value;
|
|
221
|
+
const allowed = new Set(["version", "sessionId", "reason", "messageCount", "strategyName"]);
|
|
222
|
+
const unsupported = Object.keys(record).filter((key) => !allowed.has(key));
|
|
223
|
+
if (unsupported.length > 0) {
|
|
224
|
+
throw new Error(`session.context.replaced data has unsupported fields: ${unsupported.join(", ")}`);
|
|
225
|
+
}
|
|
226
|
+
for (const key of ["version", "sessionId", "reason", "messageCount"]) {
|
|
227
|
+
if (!(key in record))
|
|
228
|
+
throw new Error(`session.context.replaced data is missing required field: ${key}`);
|
|
229
|
+
}
|
|
230
|
+
if (record.version !== 1)
|
|
231
|
+
throw new Error("session.context.replaced data.version must be 1");
|
|
232
|
+
assertString(record.sessionId, "session.context.replaced data.sessionId");
|
|
233
|
+
if (typeof record.reason !== "string" ||
|
|
234
|
+
!contextReasons.has(record.reason)) {
|
|
235
|
+
throw new Error("session.context.replaced data.reason is invalid");
|
|
236
|
+
}
|
|
237
|
+
if (typeof record.messageCount !== "number" ||
|
|
238
|
+
!Number.isSafeInteger(record.messageCount) ||
|
|
239
|
+
record.messageCount < 0) {
|
|
240
|
+
throw new Error("session.context.replaced data.messageCount must be a non-negative safe integer");
|
|
241
|
+
}
|
|
242
|
+
if (record.strategyName !== undefined) {
|
|
243
|
+
assertString(record.strategyName, "session.context.replaced data.strategyName");
|
|
244
|
+
}
|
|
245
|
+
return value;
|
|
246
|
+
}
|
|
247
|
+
export function sessionContextReplacedEventDefinition() {
|
|
248
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
249
|
+
return {
|
|
250
|
+
id: SESSION_CONTEXT_REPLACED_EVENT_ID,
|
|
251
|
+
version: SESSION_CONTEXT_REPLACED_EVENT_VERSION,
|
|
252
|
+
phase: "committed",
|
|
253
|
+
schema: "agent-forge/session.context.replaced@1",
|
|
254
|
+
allowedRegistrationKinds,
|
|
255
|
+
validate: validateSessionContextReplacedEventDataV1,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
export function validateSessionReloadEventDataV1(value) {
|
|
259
|
+
if (!isPlainRecord(value))
|
|
260
|
+
throw new Error("session.reload data must be a plain object");
|
|
261
|
+
if (Object.keys(value).sort().join(",") !== "generation,reason,sessionId,version") {
|
|
262
|
+
throw new Error("session.reload data has unsupported fields");
|
|
263
|
+
}
|
|
264
|
+
if (value.version !== 1)
|
|
265
|
+
throw new Error("session.reload data.version must be 1");
|
|
266
|
+
assertString(value.sessionId, "session.reload data.sessionId");
|
|
267
|
+
if (typeof value.generation !== "number" || !Number.isSafeInteger(value.generation) || value.generation < 1) {
|
|
268
|
+
throw new Error("session.reload data.generation must be a positive safe integer");
|
|
269
|
+
}
|
|
270
|
+
if (value.reason !== "reload")
|
|
271
|
+
throw new Error("session.reload data.reason is invalid");
|
|
272
|
+
return value;
|
|
273
|
+
}
|
|
274
|
+
export function sessionReloadEventDefinition() {
|
|
275
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
276
|
+
return {
|
|
277
|
+
id: SESSION_RELOAD_EVENT_ID,
|
|
278
|
+
version: SESSION_RELOAD_EVENT_VERSION,
|
|
279
|
+
phase: "committed",
|
|
280
|
+
schema: "agent-forge/session.reload@1",
|
|
281
|
+
allowedRegistrationKinds,
|
|
282
|
+
validate: validateSessionReloadEventDataV1,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
export function validateAgentLifecycleEventDataV1(value) {
|
|
286
|
+
if (!isPlainRecord(value))
|
|
287
|
+
throw new Error("agent lifecycle data must be a plain object");
|
|
288
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,version") {
|
|
289
|
+
throw new Error("agent lifecycle data has unsupported fields");
|
|
290
|
+
}
|
|
291
|
+
if (value.version !== 1)
|
|
292
|
+
throw new Error("agent lifecycle data.version must be 1");
|
|
293
|
+
assertString(value.sessionId, "agent lifecycle data.sessionId");
|
|
294
|
+
return value;
|
|
295
|
+
}
|
|
296
|
+
export function agentStartEventDefinition() {
|
|
297
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
298
|
+
return {
|
|
299
|
+
id: AGENT_START_EVENT_ID,
|
|
300
|
+
version: AGENT_START_EVENT_VERSION,
|
|
301
|
+
phase: "committed",
|
|
302
|
+
schema: "agent-forge/agent.start@1",
|
|
303
|
+
allowedRegistrationKinds,
|
|
304
|
+
validate: validateAgentLifecycleEventDataV1,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
export function agentSettledEventDefinition() {
|
|
308
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
309
|
+
return {
|
|
310
|
+
id: AGENT_SETTLED_EVENT_ID,
|
|
311
|
+
version: AGENT_SETTLED_EVENT_VERSION,
|
|
312
|
+
phase: "committed",
|
|
313
|
+
schema: "agent-forge/agent.settled@1",
|
|
314
|
+
allowedRegistrationKinds,
|
|
315
|
+
validate: validateAgentLifecycleEventDataV1,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
export function validateTurnStartEventDataV1(value) {
|
|
319
|
+
if (!isPlainRecord(value))
|
|
320
|
+
throw new Error("turn.start data must be a plain object");
|
|
321
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,turnIndex,version") {
|
|
322
|
+
throw new Error("turn.start data has unsupported fields");
|
|
323
|
+
}
|
|
324
|
+
if (value.version !== 1)
|
|
325
|
+
throw new Error("turn.start data.version must be 1");
|
|
326
|
+
assertString(value.sessionId, "turn.start data.sessionId");
|
|
327
|
+
if (typeof value.turnIndex !== "number" || !Number.isSafeInteger(value.turnIndex) || value.turnIndex < 0) {
|
|
328
|
+
throw new Error("turn.start data.turnIndex must be a non-negative safe integer");
|
|
329
|
+
}
|
|
330
|
+
return value;
|
|
331
|
+
}
|
|
332
|
+
export function validateTurnEndEventDataV1(value) {
|
|
333
|
+
if (!isPlainRecord(value))
|
|
334
|
+
throw new Error("turn.end data must be a plain object");
|
|
335
|
+
const keys = Object.keys(value).sort().join(",");
|
|
336
|
+
if (keys !== "messageCount,sessionId,turnIndex,version" &&
|
|
337
|
+
keys !== "messageCount,outcome,sessionId,turnIndex,version") {
|
|
338
|
+
throw new Error("turn.end data has unsupported fields");
|
|
339
|
+
}
|
|
340
|
+
if (value.version !== 1)
|
|
341
|
+
throw new Error("turn.end data.version must be 1");
|
|
342
|
+
assertString(value.sessionId, "turn.end data.sessionId");
|
|
343
|
+
if (typeof value.turnIndex !== "number" || !Number.isSafeInteger(value.turnIndex) || value.turnIndex < 0) {
|
|
344
|
+
throw new Error("turn.end data.turnIndex must be a non-negative safe integer");
|
|
345
|
+
}
|
|
346
|
+
if (typeof value.messageCount !== "number" || !Number.isSafeInteger(value.messageCount) || value.messageCount < 0) {
|
|
347
|
+
throw new Error("turn.end data.messageCount must be a non-negative safe integer");
|
|
348
|
+
}
|
|
349
|
+
if (value.outcome !== undefined && value.outcome !== "aborted" && value.outcome !== "error") {
|
|
350
|
+
throw new Error("turn.end data.outcome is invalid");
|
|
351
|
+
}
|
|
352
|
+
return value;
|
|
353
|
+
}
|
|
354
|
+
export function validateMessageBoundaryEventDataV1(value) {
|
|
355
|
+
if (!isPlainRecord(value))
|
|
356
|
+
throw new Error("message lifecycle data must be a plain object");
|
|
357
|
+
if (Object.keys(value).sort().join(",") !== "role,sessionId,version") {
|
|
358
|
+
throw new Error("message lifecycle data has unsupported fields");
|
|
359
|
+
}
|
|
360
|
+
if (value.version !== 1)
|
|
361
|
+
throw new Error("message lifecycle data.version must be 1");
|
|
362
|
+
assertString(value.sessionId, "message lifecycle data.sessionId");
|
|
363
|
+
assertString(value.role, "message lifecycle data.role");
|
|
364
|
+
return value;
|
|
365
|
+
}
|
|
366
|
+
export function turnStartEventDefinition() {
|
|
367
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
368
|
+
return {
|
|
369
|
+
id: TURN_START_EVENT_ID,
|
|
370
|
+
version: TURN_START_EVENT_VERSION,
|
|
371
|
+
phase: "committed",
|
|
372
|
+
schema: "agent-forge/turn.start@1",
|
|
373
|
+
allowedRegistrationKinds,
|
|
374
|
+
validate: validateTurnStartEventDataV1,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
export function turnEndEventDefinition() {
|
|
378
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
379
|
+
return {
|
|
380
|
+
id: TURN_END_EVENT_ID,
|
|
381
|
+
version: TURN_END_EVENT_VERSION,
|
|
382
|
+
phase: "committed",
|
|
383
|
+
schema: "agent-forge/turn.end@1",
|
|
384
|
+
allowedRegistrationKinds,
|
|
385
|
+
validate: validateTurnEndEventDataV1,
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
export function messageStartEventDefinition() {
|
|
389
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
390
|
+
return {
|
|
391
|
+
id: MESSAGE_START_EVENT_ID,
|
|
392
|
+
version: MESSAGE_START_EVENT_VERSION,
|
|
393
|
+
phase: "committed",
|
|
394
|
+
schema: "agent-forge/message.start@1",
|
|
395
|
+
allowedRegistrationKinds,
|
|
396
|
+
validate: validateMessageBoundaryEventDataV1,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
export function messageEndEventDefinition() {
|
|
400
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
401
|
+
return {
|
|
402
|
+
id: MESSAGE_END_EVENT_ID,
|
|
403
|
+
version: MESSAGE_END_EVENT_VERSION,
|
|
404
|
+
phase: "committed",
|
|
405
|
+
schema: "agent-forge/message.end@1",
|
|
406
|
+
allowedRegistrationKinds,
|
|
407
|
+
validate: validateMessageBoundaryEventDataV1,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
export function validateToolExecutionStartEventDataV1(value) {
|
|
411
|
+
if (!isPlainRecord(value))
|
|
412
|
+
throw new Error("tool.execution.start data must be a plain object");
|
|
413
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,toolCallId,toolName,version") {
|
|
414
|
+
throw new Error("tool.execution.start data has unsupported fields");
|
|
415
|
+
}
|
|
416
|
+
if (value.version !== 1)
|
|
417
|
+
throw new Error("tool.execution.start data.version must be 1");
|
|
418
|
+
assertString(value.sessionId, "tool.execution.start data.sessionId");
|
|
419
|
+
assertString(value.toolCallId, "tool.execution.start data.toolCallId");
|
|
420
|
+
assertString(value.toolName, "tool.execution.start data.toolName");
|
|
421
|
+
return value;
|
|
422
|
+
}
|
|
423
|
+
export function toolExecutionStartEventDefinition() {
|
|
424
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
425
|
+
return {
|
|
426
|
+
id: TOOL_EXECUTION_START_EVENT_ID,
|
|
427
|
+
version: TOOL_EXECUTION_START_EVENT_VERSION,
|
|
428
|
+
phase: "committed",
|
|
429
|
+
schema: "agent-forge/tool.execution.start@1",
|
|
430
|
+
allowedRegistrationKinds,
|
|
431
|
+
validate: validateToolExecutionStartEventDataV1,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
export function validateModelSelectEventDataV1(value) {
|
|
435
|
+
if (!isPlainRecord(value))
|
|
436
|
+
throw new Error("model.select data must be a plain object");
|
|
437
|
+
if (Object.keys(value).sort().join(",") !== "id,provider,sessionId,source,version") {
|
|
438
|
+
throw new Error("model.select data has unsupported fields");
|
|
439
|
+
}
|
|
440
|
+
if (value.version !== 1)
|
|
441
|
+
throw new Error("model.select data.version must be 1");
|
|
442
|
+
assertString(value.sessionId, "model.select data.sessionId");
|
|
443
|
+
assertString(value.provider, "model.select data.provider");
|
|
444
|
+
assertString(value.id, "model.select data.id");
|
|
445
|
+
if (value.source !== "set" && value.source !== "cycle" && value.source !== "restore") {
|
|
446
|
+
throw new Error("model.select data.source is invalid");
|
|
447
|
+
}
|
|
448
|
+
return value;
|
|
449
|
+
}
|
|
450
|
+
export function validateThinkingLevelSelectEventDataV1(value) {
|
|
451
|
+
if (!isPlainRecord(value))
|
|
452
|
+
throw new Error("thinking_level.select data must be a plain object");
|
|
453
|
+
if (Object.keys(value).sort().join(",") !== "level,previousLevel,sessionId,version") {
|
|
454
|
+
throw new Error("thinking_level.select data has unsupported fields");
|
|
455
|
+
}
|
|
456
|
+
if (value.version !== 1)
|
|
457
|
+
throw new Error("thinking_level.select data.version must be 1");
|
|
458
|
+
assertString(value.sessionId, "thinking_level.select data.sessionId");
|
|
459
|
+
assertString(value.level, "thinking_level.select data.level");
|
|
460
|
+
assertString(value.previousLevel, "thinking_level.select data.previousLevel");
|
|
461
|
+
return value;
|
|
462
|
+
}
|
|
463
|
+
export function modelSelectEventDefinition() {
|
|
464
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
465
|
+
return {
|
|
466
|
+
id: MODEL_SELECT_EVENT_ID,
|
|
467
|
+
version: MODEL_SELECT_EVENT_VERSION,
|
|
468
|
+
phase: "committed",
|
|
469
|
+
schema: "agent-forge/model.select@1",
|
|
470
|
+
allowedRegistrationKinds,
|
|
471
|
+
validate: validateModelSelectEventDataV1,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
export function thinkingLevelSelectEventDefinition() {
|
|
475
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
476
|
+
return {
|
|
477
|
+
id: THINKING_LEVEL_SELECT_EVENT_ID,
|
|
478
|
+
version: THINKING_LEVEL_SELECT_EVENT_VERSION,
|
|
479
|
+
phase: "committed",
|
|
480
|
+
schema: "agent-forge/thinking_level.select@1",
|
|
481
|
+
allowedRegistrationKinds,
|
|
482
|
+
validate: validateThinkingLevelSelectEventDataV1,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
export function validateSessionInfoChangedEventDataV1(value) {
|
|
486
|
+
if (!isPlainRecord(value))
|
|
487
|
+
throw new Error("session.info.changed data must be a plain object");
|
|
488
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,version" &&
|
|
489
|
+
Object.keys(value).sort().join(",") !== "name,sessionId,version") {
|
|
490
|
+
throw new Error("session.info.changed data has unsupported fields");
|
|
491
|
+
}
|
|
492
|
+
if (value.version !== 1)
|
|
493
|
+
throw new Error("session.info.changed data.version must be 1");
|
|
494
|
+
assertString(value.sessionId, "session.info.changed data.sessionId");
|
|
495
|
+
if (value.name !== undefined)
|
|
496
|
+
assertString(value.name, "session.info.changed data.name");
|
|
497
|
+
return value;
|
|
498
|
+
}
|
|
499
|
+
export function validateSessionEntryAppendedEventDataV1(value) {
|
|
500
|
+
if (!isPlainRecord(value))
|
|
501
|
+
throw new Error("session.entry.appended data must be a plain object");
|
|
502
|
+
if (Object.keys(value).sort().join(",") !== "entryId,entryType,sessionId,version") {
|
|
503
|
+
throw new Error("session.entry.appended data has unsupported fields");
|
|
504
|
+
}
|
|
505
|
+
if (value.version !== 1)
|
|
506
|
+
throw new Error("session.entry.appended data.version must be 1");
|
|
507
|
+
assertString(value.sessionId, "session.entry.appended data.sessionId");
|
|
508
|
+
assertString(value.entryId, "session.entry.appended data.entryId");
|
|
509
|
+
assertString(value.entryType, "session.entry.appended data.entryType");
|
|
510
|
+
return value;
|
|
511
|
+
}
|
|
512
|
+
export function sessionInfoChangedEventDefinition() {
|
|
513
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
514
|
+
return {
|
|
515
|
+
id: SESSION_INFO_CHANGED_EVENT_ID,
|
|
516
|
+
version: SESSION_INFO_CHANGED_EVENT_VERSION,
|
|
517
|
+
phase: "committed",
|
|
518
|
+
schema: "agent-forge/session.info.changed@1",
|
|
519
|
+
allowedRegistrationKinds,
|
|
520
|
+
validate: validateSessionInfoChangedEventDataV1,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
export function sessionEntryAppendedEventDefinition() {
|
|
524
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
525
|
+
return {
|
|
526
|
+
id: SESSION_ENTRY_APPENDED_EVENT_ID,
|
|
527
|
+
version: SESSION_ENTRY_APPENDED_EVENT_VERSION,
|
|
528
|
+
phase: "committed",
|
|
529
|
+
schema: "agent-forge/session.entry.appended@1",
|
|
530
|
+
allowedRegistrationKinds,
|
|
531
|
+
validate: validateSessionEntryAppendedEventDataV1,
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
export function validateAgentEndEventDataV1(value) {
|
|
535
|
+
if (!isPlainRecord(value))
|
|
536
|
+
throw new Error("agent.end data must be a plain object");
|
|
537
|
+
if (Object.keys(value).sort().join(",") !== "messageCount,sessionId,version") {
|
|
538
|
+
throw new Error("agent.end data has unsupported fields");
|
|
539
|
+
}
|
|
540
|
+
if (value.version !== 1)
|
|
541
|
+
throw new Error("agent.end data.version must be 1");
|
|
542
|
+
assertString(value.sessionId, "agent.end data.sessionId");
|
|
543
|
+
if (typeof value.messageCount !== "number" || !Number.isSafeInteger(value.messageCount) || value.messageCount < 0) {
|
|
544
|
+
throw new Error("agent.end data.messageCount must be a non-negative safe integer");
|
|
545
|
+
}
|
|
546
|
+
return value;
|
|
547
|
+
}
|
|
548
|
+
export function validateBeforeAgentStartEventDataV1(value) {
|
|
549
|
+
if (!isPlainRecord(value))
|
|
550
|
+
throw new Error("before.agent.start data must be a plain object");
|
|
551
|
+
if (Object.keys(value).sort().join(",") !== "hasImages,sessionId,version") {
|
|
552
|
+
throw new Error("before.agent.start data has unsupported fields");
|
|
553
|
+
}
|
|
554
|
+
if (value.version !== 1)
|
|
555
|
+
throw new Error("before.agent.start data.version must be 1");
|
|
556
|
+
assertString(value.sessionId, "before.agent.start data.sessionId");
|
|
557
|
+
if (typeof value.hasImages !== "boolean")
|
|
558
|
+
throw new Error("before.agent.start data.hasImages must be a boolean");
|
|
559
|
+
return value;
|
|
560
|
+
}
|
|
561
|
+
export function agentEndEventDefinition() {
|
|
562
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
563
|
+
return {
|
|
564
|
+
id: AGENT_END_EVENT_ID,
|
|
565
|
+
version: AGENT_END_EVENT_VERSION,
|
|
566
|
+
phase: "committed",
|
|
567
|
+
schema: "agent-forge/agent.end@1",
|
|
568
|
+
allowedRegistrationKinds,
|
|
569
|
+
validate: validateAgentEndEventDataV1,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
export function beforeAgentStartEventDefinition() {
|
|
573
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
574
|
+
return {
|
|
575
|
+
id: BEFORE_AGENT_START_EVENT_ID,
|
|
576
|
+
version: BEFORE_AGENT_START_EVENT_VERSION,
|
|
577
|
+
phase: "committed",
|
|
578
|
+
schema: "agent-forge/before.agent.start@1",
|
|
579
|
+
allowedRegistrationKinds,
|
|
580
|
+
validate: validateBeforeAgentStartEventDataV1,
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
export function validateBeforeAgentStartEventDataV2(value) {
|
|
584
|
+
if (!isPlainRecord(value))
|
|
585
|
+
throw new Error("before.agent.start data must be a plain object");
|
|
586
|
+
const allowed = new Set(["version", "sessionId", "systemPrompt", "systemPromptOptions"]);
|
|
587
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
588
|
+
if (unsupported.length > 0) {
|
|
589
|
+
throw new Error(`before.agent.start data has unsupported fields: ${unsupported.join(", ")}`);
|
|
590
|
+
}
|
|
591
|
+
for (const key of ["version", "sessionId", "systemPrompt", "systemPromptOptions"]) {
|
|
592
|
+
if (!(key in value))
|
|
593
|
+
throw new Error(`before.agent.start data is missing required field: ${key}`);
|
|
594
|
+
}
|
|
595
|
+
if (value.version !== 2)
|
|
596
|
+
throw new Error("before.agent.start data.version must be 2");
|
|
597
|
+
assertString(value.sessionId, "before.agent.start data.sessionId");
|
|
598
|
+
if (typeof value.systemPrompt !== "string") {
|
|
599
|
+
throw new Error("before.agent.start data.systemPrompt must be a string");
|
|
600
|
+
}
|
|
601
|
+
// Only the shape is enforced here: JSON-safety (no functions, cycles, or
|
|
602
|
+
// non-finite numbers) is already guaranteed because the dispatcher runs the
|
|
603
|
+
// payload through a detached structured clone before validation, and the
|
|
604
|
+
// build-options snapshot legitimately carries explicit `undefined` fields.
|
|
605
|
+
if (!isPlainRecord(value.systemPromptOptions)) {
|
|
606
|
+
throw new Error("before.agent.start data.systemPromptOptions must be a plain object");
|
|
607
|
+
}
|
|
608
|
+
return value;
|
|
609
|
+
}
|
|
610
|
+
export function beforeAgentStartV2EventDefinition() {
|
|
611
|
+
const allowedRegistrationKinds = ["observe", "transform"];
|
|
612
|
+
return {
|
|
613
|
+
id: BEFORE_AGENT_START_EVENT_ID,
|
|
614
|
+
version: BEFORE_AGENT_START_EVENT_VERSION_V2,
|
|
615
|
+
phase: "candidate",
|
|
616
|
+
schema: "agent-forge/before.agent.start@2",
|
|
617
|
+
allowedRegistrationKinds,
|
|
618
|
+
validate: validateBeforeAgentStartEventDataV2,
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
export function validateUIPromptBoundaryEventDataV1(value) {
|
|
622
|
+
if (!isPlainRecord(value))
|
|
623
|
+
throw new Error("ui.prompt lifecycle data must be a plain object");
|
|
624
|
+
const keys = Object.keys(value).sort();
|
|
625
|
+
if (keys.join(",") !== "kind,sessionId,version" && keys.join(",") !== "kind,sessionId,title,version") {
|
|
626
|
+
throw new Error("ui.prompt lifecycle data has unsupported fields");
|
|
627
|
+
}
|
|
628
|
+
if (value.version !== 1)
|
|
629
|
+
throw new Error("ui.prompt lifecycle data.version must be 1");
|
|
630
|
+
assertString(value.sessionId, "ui.prompt lifecycle data.sessionId");
|
|
631
|
+
assertString(value.kind, "ui.prompt lifecycle data.kind");
|
|
632
|
+
if (value.title !== undefined)
|
|
633
|
+
assertString(value.title, "ui.prompt lifecycle data.title");
|
|
634
|
+
return value;
|
|
635
|
+
}
|
|
636
|
+
export function validateResourcesDiscoverEventDataV1(value) {
|
|
637
|
+
if (!isPlainRecord(value))
|
|
638
|
+
throw new Error("resources.discover data must be a plain object");
|
|
639
|
+
if (Object.keys(value).sort().join(",") !== "cwd,reason,sessionId,version") {
|
|
640
|
+
throw new Error("resources.discover data has unsupported fields");
|
|
641
|
+
}
|
|
642
|
+
if (value.version !== 1)
|
|
643
|
+
throw new Error("resources.discover data.version must be 1");
|
|
644
|
+
assertString(value.sessionId, "resources.discover data.sessionId");
|
|
645
|
+
assertString(value.cwd, "resources.discover data.cwd");
|
|
646
|
+
if (value.reason !== "startup" && value.reason !== "reload") {
|
|
647
|
+
throw new Error("resources.discover data.reason is invalid");
|
|
648
|
+
}
|
|
649
|
+
return value;
|
|
650
|
+
}
|
|
651
|
+
export function uiPromptStartEventDefinition() {
|
|
652
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
653
|
+
return {
|
|
654
|
+
id: UI_PROMPT_START_EVENT_ID,
|
|
655
|
+
version: UI_PROMPT_START_EVENT_VERSION,
|
|
656
|
+
phase: "committed",
|
|
657
|
+
schema: "agent-forge/ui.prompt.start@1",
|
|
658
|
+
allowedRegistrationKinds,
|
|
659
|
+
validate: validateUIPromptBoundaryEventDataV1,
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
export function uiPromptEndEventDefinition() {
|
|
663
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
664
|
+
return {
|
|
665
|
+
id: UI_PROMPT_END_EVENT_ID,
|
|
666
|
+
version: UI_PROMPT_END_EVENT_VERSION,
|
|
667
|
+
phase: "committed",
|
|
668
|
+
schema: "agent-forge/ui.prompt.end@1",
|
|
669
|
+
allowedRegistrationKinds,
|
|
670
|
+
validate: validateUIPromptBoundaryEventDataV1,
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
export function resourcesDiscoverEventDefinition() {
|
|
674
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
675
|
+
return {
|
|
676
|
+
id: RESOURCES_DISCOVER_EVENT_ID,
|
|
677
|
+
version: RESOURCES_DISCOVER_EVENT_VERSION,
|
|
678
|
+
phase: "committed",
|
|
679
|
+
schema: "agent-forge/resources.discover@1",
|
|
680
|
+
allowedRegistrationKinds,
|
|
681
|
+
validate: validateResourcesDiscoverEventDataV1,
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function validateResourcesDiscoverContributionV2(value, label) {
|
|
685
|
+
if (!Array.isArray(value))
|
|
686
|
+
throw new Error(`${label} must be an array`);
|
|
687
|
+
for (const [index, entry] of value.entries()) {
|
|
688
|
+
if (!isPlainRecord(entry))
|
|
689
|
+
throw new Error(`${label}[${index}] must be a plain object`);
|
|
690
|
+
if (Object.keys(entry).sort().join(",") !== "extensionPath,path") {
|
|
691
|
+
throw new Error(`${label}[${index}] has unsupported fields`);
|
|
692
|
+
}
|
|
693
|
+
assertString(entry.path, `${label}[${index}].path`);
|
|
694
|
+
assertString(entry.extensionPath, `${label}[${index}].extensionPath`);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
export function validateResourcesDiscoverEventDataV2(value) {
|
|
698
|
+
if (!isPlainRecord(value))
|
|
699
|
+
throw new Error("resources.discover data must be a plain object");
|
|
700
|
+
const allowed = new Set(["version", "sessionId", "cwd", "reason", "skillPaths", "promptPaths", "themePaths"]);
|
|
701
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
702
|
+
if (unsupported.length > 0) {
|
|
703
|
+
throw new Error(`resources.discover data has unsupported fields: ${unsupported.join(", ")}`);
|
|
704
|
+
}
|
|
705
|
+
for (const key of ["version", "sessionId", "cwd", "reason"]) {
|
|
706
|
+
if (!(key in value))
|
|
707
|
+
throw new Error(`resources.discover data is missing required field: ${key}`);
|
|
708
|
+
}
|
|
709
|
+
if (value.version !== 2)
|
|
710
|
+
throw new Error("resources.discover data.version must be 2");
|
|
711
|
+
assertString(value.sessionId, "resources.discover data.sessionId");
|
|
712
|
+
assertString(value.cwd, "resources.discover data.cwd");
|
|
713
|
+
if (value.reason !== "startup" && value.reason !== "reload") {
|
|
714
|
+
throw new Error("resources.discover data.reason is invalid");
|
|
715
|
+
}
|
|
716
|
+
if (value.skillPaths !== undefined) {
|
|
717
|
+
validateResourcesDiscoverContributionV2(value.skillPaths, "resources.discover data.skillPaths");
|
|
718
|
+
}
|
|
719
|
+
if (value.promptPaths !== undefined) {
|
|
720
|
+
validateResourcesDiscoverContributionV2(value.promptPaths, "resources.discover data.promptPaths");
|
|
721
|
+
}
|
|
722
|
+
if (value.themePaths !== undefined) {
|
|
723
|
+
validateResourcesDiscoverContributionV2(value.themePaths, "resources.discover data.themePaths");
|
|
724
|
+
}
|
|
725
|
+
return value;
|
|
726
|
+
}
|
|
727
|
+
export function resourcesDiscoverV2EventDefinition() {
|
|
728
|
+
const allowedRegistrationKinds = ["observe", "transform"];
|
|
729
|
+
return {
|
|
730
|
+
id: RESOURCES_DISCOVER_EVENT_ID,
|
|
731
|
+
version: RESOURCES_DISCOVER_EVENT_VERSION_V2,
|
|
732
|
+
phase: "candidate",
|
|
733
|
+
schema: "agent-forge/resources.discover@2",
|
|
734
|
+
allowedRegistrationKinds,
|
|
735
|
+
validate: validateResourcesDiscoverEventDataV2,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
export function validateContextAssembledEventDataV1(value) {
|
|
739
|
+
if (!isPlainRecord(value))
|
|
740
|
+
throw new Error("context.assembled data must be a plain object");
|
|
741
|
+
if (Object.keys(value).sort().join(",") !== "messageCount,sessionId,version") {
|
|
742
|
+
throw new Error("context.assembled data has unsupported fields");
|
|
743
|
+
}
|
|
744
|
+
if (value.version !== 1)
|
|
745
|
+
throw new Error("context.assembled data.version must be 1");
|
|
746
|
+
assertString(value.sessionId, "context.assembled data.sessionId");
|
|
747
|
+
if (typeof value.messageCount !== "number" || !Number.isSafeInteger(value.messageCount) || value.messageCount < 0) {
|
|
748
|
+
throw new Error("context.assembled data.messageCount must be a non-negative safe integer");
|
|
749
|
+
}
|
|
750
|
+
return value;
|
|
751
|
+
}
|
|
752
|
+
export function validateInputReceivedEventDataV1(value) {
|
|
753
|
+
if (!isPlainRecord(value))
|
|
754
|
+
throw new Error("input.received data must be a plain object");
|
|
755
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,textLength,version,source".split(",").sort().join(",")) {
|
|
756
|
+
throw new Error("input.received data has unsupported fields");
|
|
757
|
+
}
|
|
758
|
+
if (value.version !== 1)
|
|
759
|
+
throw new Error("input.received data.version must be 1");
|
|
760
|
+
assertString(value.sessionId, "input.received data.sessionId");
|
|
761
|
+
assertString(value.source, "input.received data.source");
|
|
762
|
+
if (typeof value.textLength !== "number" || !Number.isSafeInteger(value.textLength) || value.textLength < 0) {
|
|
763
|
+
throw new Error("input.received data.textLength must be a non-negative safe integer");
|
|
764
|
+
}
|
|
765
|
+
return value;
|
|
766
|
+
}
|
|
767
|
+
export function validateUserBashEventDataV1(value) {
|
|
768
|
+
if (!isPlainRecord(value))
|
|
769
|
+
throw new Error("user.bash data must be a plain object");
|
|
770
|
+
if (Object.keys(value).sort().join(",") !== "cwd,excludeFromContext,sessionId,version") {
|
|
771
|
+
throw new Error("user.bash data has unsupported fields");
|
|
772
|
+
}
|
|
773
|
+
if (value.version !== 1)
|
|
774
|
+
throw new Error("user.bash data.version must be 1");
|
|
775
|
+
assertString(value.sessionId, "user.bash data.sessionId");
|
|
776
|
+
assertString(value.cwd, "user.bash data.cwd");
|
|
777
|
+
if (typeof value.excludeFromContext !== "boolean") {
|
|
778
|
+
throw new Error("user.bash data.excludeFromContext must be a boolean");
|
|
779
|
+
}
|
|
780
|
+
return value;
|
|
781
|
+
}
|
|
782
|
+
export function contextAssembledEventDefinition() {
|
|
783
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
784
|
+
return {
|
|
785
|
+
id: CONTEXT_ASSEMBLED_EVENT_ID,
|
|
786
|
+
version: CONTEXT_ASSEMBLED_EVENT_VERSION,
|
|
787
|
+
phase: "committed",
|
|
788
|
+
schema: "agent-forge/context.assembled@1",
|
|
789
|
+
allowedRegistrationKinds,
|
|
790
|
+
validate: validateContextAssembledEventDataV1,
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
export function inputReceivedEventDefinition() {
|
|
794
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
795
|
+
return {
|
|
796
|
+
id: INPUT_RECEIVED_EVENT_ID,
|
|
797
|
+
version: INPUT_RECEIVED_EVENT_VERSION,
|
|
798
|
+
phase: "committed",
|
|
799
|
+
schema: "agent-forge/input.received@1",
|
|
800
|
+
allowedRegistrationKinds,
|
|
801
|
+
validate: validateInputReceivedEventDataV1,
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
export function userBashEventDefinition() {
|
|
805
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
806
|
+
return {
|
|
807
|
+
id: USER_BASH_EVENT_ID,
|
|
808
|
+
version: USER_BASH_EVENT_VERSION,
|
|
809
|
+
phase: "committed",
|
|
810
|
+
schema: "agent-forge/user.bash@1",
|
|
811
|
+
allowedRegistrationKinds,
|
|
812
|
+
validate: validateUserBashEventDataV1,
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
export function validateSessionStartEventDataV1(value) {
|
|
816
|
+
if (!isPlainRecord(value))
|
|
817
|
+
throw new Error("session.start data must be a plain object");
|
|
818
|
+
const keys = Object.keys(value).sort();
|
|
819
|
+
if (keys.join(",") !== "reason,sessionId,version" &&
|
|
820
|
+
keys.join(",") !== "previousSessionFile,reason,sessionId,version") {
|
|
821
|
+
throw new Error("session.start data has unsupported fields");
|
|
822
|
+
}
|
|
823
|
+
if (value.version !== 1)
|
|
824
|
+
throw new Error("session.start data.version must be 1");
|
|
825
|
+
assertString(value.sessionId, "session.start data.sessionId");
|
|
826
|
+
if (value.reason !== "startup" &&
|
|
827
|
+
value.reason !== "reload" &&
|
|
828
|
+
value.reason !== "new" &&
|
|
829
|
+
value.reason !== "resume" &&
|
|
830
|
+
value.reason !== "fork") {
|
|
831
|
+
throw new Error("session.start data.reason is invalid");
|
|
832
|
+
}
|
|
833
|
+
if (value.previousSessionFile !== undefined)
|
|
834
|
+
assertString(value.previousSessionFile, "session.start data.previousSessionFile");
|
|
835
|
+
return value;
|
|
836
|
+
}
|
|
837
|
+
export function sessionStartEventDefinition() {
|
|
838
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
839
|
+
return {
|
|
840
|
+
id: SESSION_START_EVENT_ID,
|
|
841
|
+
version: SESSION_START_EVENT_VERSION,
|
|
842
|
+
phase: "committed",
|
|
843
|
+
schema: "agent-forge/session.start@1",
|
|
844
|
+
allowedRegistrationKinds,
|
|
845
|
+
validate: validateSessionStartEventDataV1,
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
export function validateModelResponseEventDataV1(value) {
|
|
849
|
+
if (!value ||
|
|
850
|
+
typeof value !== "object" ||
|
|
851
|
+
Array.isArray(value) ||
|
|
852
|
+
Object.getPrototypeOf(value) !== Object.prototype) {
|
|
853
|
+
throw new Error("model.response data must be a plain object");
|
|
854
|
+
}
|
|
855
|
+
const record = value;
|
|
856
|
+
const allowed = new Set([
|
|
857
|
+
"version",
|
|
858
|
+
"sessionId",
|
|
859
|
+
"entryId",
|
|
860
|
+
"revision",
|
|
861
|
+
"provider",
|
|
862
|
+
"model",
|
|
863
|
+
"stopReason",
|
|
864
|
+
"message",
|
|
865
|
+
"errorMessage",
|
|
866
|
+
]);
|
|
867
|
+
const unsupported = Object.keys(record).filter((key) => !allowed.has(key));
|
|
868
|
+
if (unsupported.length > 0)
|
|
869
|
+
throw new Error(`model.response data has unsupported fields: ${unsupported.join(", ")}`);
|
|
870
|
+
for (const key of ["version", "sessionId", "entryId", "revision", "provider", "model", "stopReason", "message"]) {
|
|
871
|
+
if (!(key in record))
|
|
872
|
+
throw new Error(`model.response data is missing required field: ${key}`);
|
|
873
|
+
}
|
|
874
|
+
if (record.version !== 1)
|
|
875
|
+
throw new Error("model.response data.version must be 1");
|
|
876
|
+
assertString(record.sessionId, "model.response data.sessionId");
|
|
877
|
+
assertString(record.entryId, "model.response data.entryId");
|
|
878
|
+
assertString(record.provider, "model.response data.provider");
|
|
879
|
+
assertString(record.model, "model.response data.model");
|
|
880
|
+
if (record.stopReason !== "pending" &&
|
|
881
|
+
record.stopReason !== "stop" &&
|
|
882
|
+
record.stopReason !== "length" &&
|
|
883
|
+
record.stopReason !== "toolUse" &&
|
|
884
|
+
record.stopReason !== "error" &&
|
|
885
|
+
record.stopReason !== "aborted" &&
|
|
886
|
+
record.stopReason !== "deferred") {
|
|
887
|
+
throw new Error("model.response data.stopReason is invalid");
|
|
888
|
+
}
|
|
889
|
+
if (!record.message || typeof record.message !== "object" || Array.isArray(record.message)) {
|
|
890
|
+
throw new Error("model.response data.message must be an assistant message object");
|
|
891
|
+
}
|
|
892
|
+
const message = record.message;
|
|
893
|
+
if (message.role !== "assistant")
|
|
894
|
+
throw new Error("model.response data.message.role must be assistant");
|
|
895
|
+
if (!isPlainRecord(record.revision))
|
|
896
|
+
throw new Error("model.response data.revision must be a plain object");
|
|
897
|
+
const revision = record.revision;
|
|
898
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
899
|
+
throw new Error("model.response data.revision has unsupported fields");
|
|
900
|
+
}
|
|
901
|
+
if (revision.version !== 1)
|
|
902
|
+
throw new Error("model.response data.revision.version must be 1");
|
|
903
|
+
assertString(revision.sessionId, "model.response data.revision.sessionId");
|
|
904
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
905
|
+
throw new Error("model.response data.revision.sequence must be a non-negative safe integer");
|
|
906
|
+
}
|
|
907
|
+
if (revision.leafId !== null)
|
|
908
|
+
assertString(revision.leafId, "model.response data.revision.leafId");
|
|
909
|
+
if (revision.sessionId !== record.sessionId) {
|
|
910
|
+
throw new Error("model.response data.revision.sessionId must match sessionId");
|
|
911
|
+
}
|
|
912
|
+
if (record.errorMessage !== undefined)
|
|
913
|
+
assertString(record.errorMessage, "model.response data.errorMessage");
|
|
914
|
+
return value;
|
|
915
|
+
}
|
|
916
|
+
function isPlainRecord(value) {
|
|
917
|
+
return (typeof value === "object" &&
|
|
918
|
+
value !== null &&
|
|
919
|
+
!Array.isArray(value) &&
|
|
920
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
921
|
+
}
|
|
922
|
+
export function modelResponseEventDefinition() {
|
|
923
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
924
|
+
return {
|
|
925
|
+
id: MODEL_RESPONSE_EVENT_ID,
|
|
926
|
+
version: MODEL_RESPONSE_EVENT_VERSION,
|
|
927
|
+
phase: "committed",
|
|
928
|
+
schema: "agent-forge/model.response@1",
|
|
929
|
+
allowedRegistrationKinds,
|
|
930
|
+
validate: validateModelResponseEventDataV1,
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
const modelStreamEvents = new Set([
|
|
934
|
+
"start",
|
|
935
|
+
"text_start",
|
|
936
|
+
"text_delta",
|
|
937
|
+
"text_end",
|
|
938
|
+
"thinking_start",
|
|
939
|
+
"thinking_delta",
|
|
940
|
+
"thinking_end",
|
|
941
|
+
"toolcall_start",
|
|
942
|
+
"toolcall_delta",
|
|
943
|
+
"toolcall_end",
|
|
944
|
+
"done",
|
|
945
|
+
"error",
|
|
946
|
+
]);
|
|
947
|
+
export function validateModelStreamEventDataV1(value) {
|
|
948
|
+
if (!isPlainRecord(value))
|
|
949
|
+
throw new Error("model.stream data must be a plain object");
|
|
950
|
+
const allowed = new Set([
|
|
951
|
+
"version",
|
|
952
|
+
"sessionId",
|
|
953
|
+
"streamId",
|
|
954
|
+
"sequence",
|
|
955
|
+
"phase",
|
|
956
|
+
"event",
|
|
957
|
+
"partial",
|
|
958
|
+
"terminal",
|
|
959
|
+
"error",
|
|
960
|
+
]);
|
|
961
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
962
|
+
if (unsupported.length > 0)
|
|
963
|
+
throw new Error(`model.stream data has unsupported fields: ${unsupported.join(", ")}`);
|
|
964
|
+
for (const key of [
|
|
965
|
+
"version",
|
|
966
|
+
"sessionId",
|
|
967
|
+
"streamId",
|
|
968
|
+
"sequence",
|
|
969
|
+
"phase",
|
|
970
|
+
"event",
|
|
971
|
+
"partial",
|
|
972
|
+
"terminal",
|
|
973
|
+
"error",
|
|
974
|
+
]) {
|
|
975
|
+
if (!(key in value))
|
|
976
|
+
throw new Error(`model.stream data is missing required field: ${key}`);
|
|
977
|
+
}
|
|
978
|
+
if (value.version !== 1)
|
|
979
|
+
throw new Error("model.stream data.version must be 1");
|
|
980
|
+
assertString(value.sessionId, "model.stream data.sessionId");
|
|
981
|
+
assertString(value.streamId, "model.stream data.streamId");
|
|
982
|
+
if (typeof value.sequence !== "number" || !Number.isSafeInteger(value.sequence) || value.sequence < 1) {
|
|
983
|
+
throw new Error("model.stream data.sequence must be a positive safe integer");
|
|
984
|
+
}
|
|
985
|
+
if (value.phase !== "raw" && value.phase !== "candidate" && value.phase !== "committed") {
|
|
986
|
+
throw new Error("model.stream data.phase is invalid");
|
|
987
|
+
}
|
|
988
|
+
if (typeof value.event !== "string" || !modelStreamEvents.has(value.event)) {
|
|
989
|
+
throw new Error("model.stream data.event is invalid");
|
|
990
|
+
}
|
|
991
|
+
if (value.phase === "committed" && value.event !== "done" && value.event !== "error") {
|
|
992
|
+
throw new Error("model.stream committed phase only permits terminal events");
|
|
993
|
+
}
|
|
994
|
+
const terminal = value.event === "done" || value.event === "error";
|
|
995
|
+
if (value.terminal !== terminal)
|
|
996
|
+
throw new Error("model.stream data.terminal does not match event");
|
|
997
|
+
if (value.partial !== null)
|
|
998
|
+
assertJsonSafe(value.partial, "model.stream data.partial");
|
|
999
|
+
if (terminal && value.event === "done" && value.error !== null) {
|
|
1000
|
+
throw new Error("model.stream done event cannot contain error");
|
|
1001
|
+
}
|
|
1002
|
+
if (terminal && value.event === "error") {
|
|
1003
|
+
if (!isPlainRecord(value.error))
|
|
1004
|
+
throw new Error("model.stream error event requires error object");
|
|
1005
|
+
const errorKeys = Object.keys(value.error);
|
|
1006
|
+
if (errorKeys.some((key) => key !== "code" && key !== "message" && key !== "name")) {
|
|
1007
|
+
throw new Error("model.stream error has unsupported fields");
|
|
1008
|
+
}
|
|
1009
|
+
assertString(value.error.code, "model.stream data.error.code");
|
|
1010
|
+
assertString(value.error.message, "model.stream data.error.message");
|
|
1011
|
+
if (value.error.name !== undefined)
|
|
1012
|
+
assertString(value.error.name, "model.stream data.error.name");
|
|
1013
|
+
}
|
|
1014
|
+
else if (value.error !== null) {
|
|
1015
|
+
throw new Error("model.stream non-terminal event cannot contain error");
|
|
1016
|
+
}
|
|
1017
|
+
return value;
|
|
1018
|
+
}
|
|
1019
|
+
export function modelStreamEventDefinition() {
|
|
1020
|
+
return {
|
|
1021
|
+
id: MODEL_STREAM_EVENT_ID,
|
|
1022
|
+
version: MODEL_STREAM_EVENT_VERSION,
|
|
1023
|
+
phase: "raw",
|
|
1024
|
+
allowedPhases: ["raw", "candidate", "committed"],
|
|
1025
|
+
schema: "agent-forge/model.stream@1",
|
|
1026
|
+
allowedRegistrationKinds: ["observe"],
|
|
1027
|
+
validate: validateModelStreamEventDataV1,
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
export function validateToolResultEventDataV1(value) {
|
|
1031
|
+
if (!isPlainRecord(value))
|
|
1032
|
+
throw new Error("tool.result data must be a plain object");
|
|
1033
|
+
const allowed = new Set([
|
|
1034
|
+
"version",
|
|
1035
|
+
"sessionId",
|
|
1036
|
+
"entryId",
|
|
1037
|
+
"revision",
|
|
1038
|
+
"toolCallId",
|
|
1039
|
+
"toolName",
|
|
1040
|
+
"isError",
|
|
1041
|
+
"message",
|
|
1042
|
+
]);
|
|
1043
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1044
|
+
if (unsupported.length > 0)
|
|
1045
|
+
throw new Error(`tool.result data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1046
|
+
for (const key of ["version", "sessionId", "entryId", "revision", "toolCallId", "toolName", "isError", "message"]) {
|
|
1047
|
+
if (!(key in value))
|
|
1048
|
+
throw new Error(`tool.result data is missing required field: ${key}`);
|
|
1049
|
+
}
|
|
1050
|
+
if (value.version !== 1)
|
|
1051
|
+
throw new Error("tool.result data.version must be 1");
|
|
1052
|
+
assertString(value.sessionId, "tool.result data.sessionId");
|
|
1053
|
+
assertString(value.entryId, "tool.result data.entryId");
|
|
1054
|
+
assertString(value.toolCallId, "tool.result data.toolCallId");
|
|
1055
|
+
assertString(value.toolName, "tool.result data.toolName");
|
|
1056
|
+
if (typeof value.isError !== "boolean")
|
|
1057
|
+
throw new Error("tool.result data.isError must be boolean");
|
|
1058
|
+
if (!isPlainRecord(value.message))
|
|
1059
|
+
throw new Error("tool.result data.message must be a tool result message object");
|
|
1060
|
+
if (value.message.role !== "toolResult")
|
|
1061
|
+
throw new Error("tool.result data.message.role must be toolResult");
|
|
1062
|
+
assertString(value.message.toolCallId, "tool.result data.message.toolCallId");
|
|
1063
|
+
assertString(value.message.toolName, "tool.result data.message.toolName");
|
|
1064
|
+
if (!Array.isArray(value.message.content))
|
|
1065
|
+
throw new Error("tool.result data.message.content must be an array");
|
|
1066
|
+
if (typeof value.message.isError !== "boolean")
|
|
1067
|
+
throw new Error("tool.result data.message.isError must be boolean");
|
|
1068
|
+
if (value.message.toolCallId !== value.toolCallId) {
|
|
1069
|
+
throw new Error("tool.result data.message.toolCallId must match toolCallId");
|
|
1070
|
+
}
|
|
1071
|
+
if (value.message.toolName !== value.toolName) {
|
|
1072
|
+
throw new Error("tool.result data.message.toolName must match toolName");
|
|
1073
|
+
}
|
|
1074
|
+
if (value.message.isError !== value.isError) {
|
|
1075
|
+
throw new Error("tool.result data.message.isError must match isError");
|
|
1076
|
+
}
|
|
1077
|
+
if (!isPlainRecord(value.revision))
|
|
1078
|
+
throw new Error("tool.result data.revision must be a plain object");
|
|
1079
|
+
const revision = value.revision;
|
|
1080
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
1081
|
+
throw new Error("tool.result data.revision has unsupported fields");
|
|
1082
|
+
}
|
|
1083
|
+
if (revision.version !== 1)
|
|
1084
|
+
throw new Error("tool.result data.revision.version must be 1");
|
|
1085
|
+
assertString(revision.sessionId, "tool.result data.revision.sessionId");
|
|
1086
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
1087
|
+
throw new Error("tool.result data.revision.sequence must be a non-negative safe integer");
|
|
1088
|
+
}
|
|
1089
|
+
if (revision.leafId !== null)
|
|
1090
|
+
assertString(revision.leafId, "tool.result data.revision.leafId");
|
|
1091
|
+
if (revision.sessionId !== value.sessionId) {
|
|
1092
|
+
throw new Error("tool.result data.revision.sessionId must match sessionId");
|
|
1093
|
+
}
|
|
1094
|
+
return value;
|
|
1095
|
+
}
|
|
1096
|
+
export function toolResultEventDefinition() {
|
|
1097
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1098
|
+
return {
|
|
1099
|
+
id: TOOL_RESULT_EVENT_ID,
|
|
1100
|
+
version: TOOL_RESULT_EVENT_VERSION,
|
|
1101
|
+
phase: "committed",
|
|
1102
|
+
schema: "agent-forge/tool.result@1",
|
|
1103
|
+
allowedRegistrationKinds,
|
|
1104
|
+
validate: validateToolResultEventDataV1,
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
export function validateToolCallEventDataV1(value) {
|
|
1108
|
+
if (!isPlainRecord(value))
|
|
1109
|
+
throw new Error("tool.call data must be a plain object");
|
|
1110
|
+
const allowed = new Set(["version", "sessionId", "revision", "toolCallId", "toolName", "input"]);
|
|
1111
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1112
|
+
if (unsupported.length > 0)
|
|
1113
|
+
throw new Error(`tool.call data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1114
|
+
for (const key of ["version", "sessionId", "revision", "toolCallId", "toolName", "input"]) {
|
|
1115
|
+
if (!(key in value))
|
|
1116
|
+
throw new Error(`tool.call data is missing required field: ${key}`);
|
|
1117
|
+
}
|
|
1118
|
+
if (value.version !== 1)
|
|
1119
|
+
throw new Error("tool.call data.version must be 1");
|
|
1120
|
+
assertString(value.sessionId, "tool.call data.sessionId");
|
|
1121
|
+
assertString(value.toolCallId, "tool.call data.toolCallId");
|
|
1122
|
+
assertString(value.toolName, "tool.call data.toolName");
|
|
1123
|
+
if (!isPlainRecord(value.revision))
|
|
1124
|
+
throw new Error("tool.call data.revision must be a plain object");
|
|
1125
|
+
const revision = value.revision;
|
|
1126
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
1127
|
+
throw new Error("tool.call data.revision has unsupported fields");
|
|
1128
|
+
}
|
|
1129
|
+
if (revision.version !== 1)
|
|
1130
|
+
throw new Error("tool.call data.revision.version must be 1");
|
|
1131
|
+
assertString(revision.sessionId, "tool.call data.revision.sessionId");
|
|
1132
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
1133
|
+
throw new Error("tool.call data.revision.sequence must be a non-negative safe integer");
|
|
1134
|
+
}
|
|
1135
|
+
if (revision.leafId !== null)
|
|
1136
|
+
assertString(revision.leafId, "tool.call data.revision.leafId");
|
|
1137
|
+
if (revision.sessionId !== value.sessionId)
|
|
1138
|
+
throw new Error("tool.call data.revision.sessionId must match sessionId");
|
|
1139
|
+
assertJsonSafe(value.input, "tool.call data.input");
|
|
1140
|
+
return value;
|
|
1141
|
+
}
|
|
1142
|
+
export function toolCallEventDefinition() {
|
|
1143
|
+
const allowedRegistrationKinds = ["observe", "transform"];
|
|
1144
|
+
return {
|
|
1145
|
+
id: TOOL_CALL_EVENT_ID,
|
|
1146
|
+
version: TOOL_CALL_EVENT_VERSION,
|
|
1147
|
+
phase: "candidate",
|
|
1148
|
+
schema: "agent-forge/tool.call@1",
|
|
1149
|
+
allowedRegistrationKinds,
|
|
1150
|
+
validate: validateToolCallEventDataV1,
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
export function validateToolExecuteEventDataV1(value) {
|
|
1154
|
+
if (!isPlainRecord(value))
|
|
1155
|
+
throw new Error("tool.execute data must be a plain object");
|
|
1156
|
+
const allowed = new Set([
|
|
1157
|
+
"version",
|
|
1158
|
+
"sessionId",
|
|
1159
|
+
"revision",
|
|
1160
|
+
"toolCallId",
|
|
1161
|
+
"toolName",
|
|
1162
|
+
"input",
|
|
1163
|
+
"isError",
|
|
1164
|
+
"content",
|
|
1165
|
+
]);
|
|
1166
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1167
|
+
if (unsupported.length > 0)
|
|
1168
|
+
throw new Error(`tool.execute data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1169
|
+
for (const key of ["version", "sessionId", "revision", "toolCallId", "toolName", "input", "isError", "content"]) {
|
|
1170
|
+
if (!(key in value))
|
|
1171
|
+
throw new Error(`tool.execute data is missing required field: ${key}`);
|
|
1172
|
+
}
|
|
1173
|
+
if (value.version !== 1)
|
|
1174
|
+
throw new Error("tool.execute data.version must be 1");
|
|
1175
|
+
assertString(value.sessionId, "tool.execute data.sessionId");
|
|
1176
|
+
assertString(value.toolCallId, "tool.execute data.toolCallId");
|
|
1177
|
+
assertString(value.toolName, "tool.execute data.toolName");
|
|
1178
|
+
if (typeof value.isError !== "boolean")
|
|
1179
|
+
throw new Error("tool.execute data.isError must be boolean");
|
|
1180
|
+
assertJsonSafe(value.input, "tool.execute data.input");
|
|
1181
|
+
validateToolResultRawEventDataV1({
|
|
1182
|
+
version: 1,
|
|
1183
|
+
sessionId: value.sessionId,
|
|
1184
|
+
revision: value.revision,
|
|
1185
|
+
toolCallId: value.toolCallId,
|
|
1186
|
+
toolName: value.toolName,
|
|
1187
|
+
isError: value.isError,
|
|
1188
|
+
content: value.content,
|
|
1189
|
+
});
|
|
1190
|
+
return value;
|
|
1191
|
+
}
|
|
1192
|
+
export function toolExecuteEventDefinition() {
|
|
1193
|
+
const allowedRegistrationKinds = ["observe", "execute"];
|
|
1194
|
+
return {
|
|
1195
|
+
id: TOOL_EXECUTE_EVENT_ID,
|
|
1196
|
+
version: TOOL_EXECUTE_EVENT_VERSION,
|
|
1197
|
+
phase: "committed",
|
|
1198
|
+
schema: "agent-forge/tool.execute@1",
|
|
1199
|
+
allowedRegistrationKinds,
|
|
1200
|
+
validate: validateToolExecuteEventDataV1,
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
export function validateToolCommitEventDataV1(value) {
|
|
1204
|
+
if (!isPlainRecord(value))
|
|
1205
|
+
throw new Error("tool.commit data must be a plain object");
|
|
1206
|
+
const allowed = new Set(["version", "sessionId", "entryId", "revision", "toolCallId", "toolName", "isError"]);
|
|
1207
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1208
|
+
if (unsupported.length > 0)
|
|
1209
|
+
throw new Error(`tool.commit data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1210
|
+
for (const key of ["version", "sessionId", "entryId", "revision", "toolCallId", "toolName", "isError"]) {
|
|
1211
|
+
if (!(key in value))
|
|
1212
|
+
throw new Error(`tool.commit data is missing required field: ${key}`);
|
|
1213
|
+
}
|
|
1214
|
+
if (value.version !== 1)
|
|
1215
|
+
throw new Error("tool.commit data.version must be 1");
|
|
1216
|
+
assertString(value.sessionId, "tool.commit data.sessionId");
|
|
1217
|
+
assertString(value.entryId, "tool.commit data.entryId");
|
|
1218
|
+
assertString(value.toolCallId, "tool.commit data.toolCallId");
|
|
1219
|
+
assertString(value.toolName, "tool.commit data.toolName");
|
|
1220
|
+
if (typeof value.isError !== "boolean")
|
|
1221
|
+
throw new Error("tool.commit data.isError must be boolean");
|
|
1222
|
+
if (!isPlainRecord(value.revision))
|
|
1223
|
+
throw new Error("tool.commit data.revision must be a plain object");
|
|
1224
|
+
const revision = value.revision;
|
|
1225
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
1226
|
+
throw new Error("tool.commit data.revision has unsupported fields");
|
|
1227
|
+
}
|
|
1228
|
+
if (revision.version !== 1)
|
|
1229
|
+
throw new Error("tool.commit data.revision.version must be 1");
|
|
1230
|
+
assertString(revision.sessionId, "tool.commit data.revision.sessionId");
|
|
1231
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
1232
|
+
throw new Error("tool.commit data.revision.sequence must be a non-negative safe integer");
|
|
1233
|
+
}
|
|
1234
|
+
if (revision.leafId !== null)
|
|
1235
|
+
assertString(revision.leafId, "tool.commit data.revision.leafId");
|
|
1236
|
+
if (revision.sessionId !== value.sessionId)
|
|
1237
|
+
throw new Error("tool.commit data.revision.sessionId must match sessionId");
|
|
1238
|
+
return value;
|
|
1239
|
+
}
|
|
1240
|
+
export function toolCommitEventDefinition() {
|
|
1241
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1242
|
+
return {
|
|
1243
|
+
id: TOOL_COMMIT_EVENT_ID,
|
|
1244
|
+
version: TOOL_COMMIT_EVENT_VERSION,
|
|
1245
|
+
phase: "committed",
|
|
1246
|
+
schema: "agent-forge/tool.commit@1",
|
|
1247
|
+
allowedRegistrationKinds,
|
|
1248
|
+
validate: validateToolCommitEventDataV1,
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1251
|
+
export function validateToolResultRawEventDataV1(value) {
|
|
1252
|
+
if (!isPlainRecord(value))
|
|
1253
|
+
throw new Error("tool.result.raw data must be a plain object");
|
|
1254
|
+
const allowed = new Set(["version", "sessionId", "revision", "toolCallId", "toolName", "isError", "content"]);
|
|
1255
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1256
|
+
if (unsupported.length > 0) {
|
|
1257
|
+
throw new Error(`tool.result.raw data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1258
|
+
}
|
|
1259
|
+
for (const key of ["version", "sessionId", "revision", "toolCallId", "toolName", "isError", "content"]) {
|
|
1260
|
+
if (!(key in value))
|
|
1261
|
+
throw new Error(`tool.result.raw data is missing required field: ${key}`);
|
|
1262
|
+
}
|
|
1263
|
+
if (value.version !== 1)
|
|
1264
|
+
throw new Error("tool.result.raw data.version must be 1");
|
|
1265
|
+
assertString(value.sessionId, "tool.result.raw data.sessionId");
|
|
1266
|
+
assertString(value.toolCallId, "tool.result.raw data.toolCallId");
|
|
1267
|
+
assertString(value.toolName, "tool.result.raw data.toolName");
|
|
1268
|
+
if (typeof value.isError !== "boolean")
|
|
1269
|
+
throw new Error("tool.result.raw data.isError must be boolean");
|
|
1270
|
+
if (!isPlainRecord(value.revision))
|
|
1271
|
+
throw new Error("tool.result.raw data.revision must be a plain object");
|
|
1272
|
+
const revision = value.revision;
|
|
1273
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
1274
|
+
throw new Error("tool.result.raw data.revision has unsupported fields");
|
|
1275
|
+
}
|
|
1276
|
+
if (revision.version !== 1)
|
|
1277
|
+
throw new Error("tool.result.raw data.revision.version must be 1");
|
|
1278
|
+
assertString(revision.sessionId, "tool.result.raw data.revision.sessionId");
|
|
1279
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
1280
|
+
throw new Error("tool.result.raw data.revision.sequence must be a non-negative safe integer");
|
|
1281
|
+
}
|
|
1282
|
+
if (revision.leafId !== null)
|
|
1283
|
+
assertString(revision.leafId, "tool.result.raw data.revision.leafId");
|
|
1284
|
+
if (revision.sessionId !== value.sessionId) {
|
|
1285
|
+
throw new Error("tool.result.raw data.revision.sessionId must match sessionId");
|
|
1286
|
+
}
|
|
1287
|
+
if (!Array.isArray(value.content))
|
|
1288
|
+
throw new Error("tool.result.raw data.content must be an array");
|
|
1289
|
+
for (const [index, content] of value.content.entries()) {
|
|
1290
|
+
if (!isPlainRecord(content))
|
|
1291
|
+
throw new Error(`tool.result.raw data.content[${index}] must be a plain object`);
|
|
1292
|
+
if (content.type === "text") {
|
|
1293
|
+
const keys = Object.keys(content).sort().join(",");
|
|
1294
|
+
if (keys !== "text,type" && keys !== "text,textSignature,type") {
|
|
1295
|
+
throw new Error(`tool.result.raw data.content[${index}] has unsupported text fields`);
|
|
1296
|
+
}
|
|
1297
|
+
assertString(content.text, `tool.result.raw data.content[${index}].text`);
|
|
1298
|
+
if (content.textSignature !== undefined) {
|
|
1299
|
+
assertString(content.textSignature, `tool.result.raw data.content[${index}].textSignature`);
|
|
1300
|
+
}
|
|
1301
|
+
continue;
|
|
1302
|
+
}
|
|
1303
|
+
if (content.type === "image") {
|
|
1304
|
+
if (Object.keys(content).sort().join(",") !== "data,mimeType,type") {
|
|
1305
|
+
throw new Error(`tool.result.raw data.content[${index}] has unsupported image fields`);
|
|
1306
|
+
}
|
|
1307
|
+
assertString(content.data, `tool.result.raw data.content[${index}].data`);
|
|
1308
|
+
assertString(content.mimeType, `tool.result.raw data.content[${index}].mimeType`);
|
|
1309
|
+
continue;
|
|
1310
|
+
}
|
|
1311
|
+
throw new Error(`tool.result.raw data.content[${index}].type is invalid`);
|
|
1312
|
+
}
|
|
1313
|
+
return value;
|
|
1314
|
+
}
|
|
1315
|
+
export function toolResultRawEventDefinition() {
|
|
1316
|
+
const allowedRegistrationKinds = ["observe"];
|
|
1317
|
+
return {
|
|
1318
|
+
id: TOOL_RESULT_RAW_EVENT_ID,
|
|
1319
|
+
version: TOOL_RESULT_RAW_EVENT_VERSION,
|
|
1320
|
+
phase: "raw",
|
|
1321
|
+
schema: "agent-forge/tool.result.raw@1",
|
|
1322
|
+
allowedRegistrationKinds,
|
|
1323
|
+
validate: validateToolResultRawEventDataV1,
|
|
1324
|
+
};
|
|
1325
|
+
}
|
|
1326
|
+
export const TOOL_RESULT_TRANSFORM_EVENT_ID = "tool.result.transform";
|
|
1327
|
+
export const TOOL_RESULT_TRANSFORM_EVENT_VERSION = 1;
|
|
1328
|
+
export function validateToolResultTransformEventDataV1(value) {
|
|
1329
|
+
if (!isPlainRecord(value))
|
|
1330
|
+
throw new Error("tool.result.transform data must be a plain object");
|
|
1331
|
+
const allowed = new Set(["version", "sessionId", "revision", "toolCallId", "toolName", "isError", "content"]);
|
|
1332
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1333
|
+
if (unsupported.length > 0) {
|
|
1334
|
+
throw new Error(`tool.result.transform data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1335
|
+
}
|
|
1336
|
+
for (const key of ["version", "sessionId", "revision", "toolCallId", "toolName", "isError", "content"]) {
|
|
1337
|
+
if (!(key in value))
|
|
1338
|
+
throw new Error(`tool.result.transform data is missing required field: ${key}`);
|
|
1339
|
+
}
|
|
1340
|
+
if (value.version !== 1)
|
|
1341
|
+
throw new Error("tool.result.transform data.version must be 1");
|
|
1342
|
+
assertString(value.sessionId, "tool.result.transform data.sessionId");
|
|
1343
|
+
assertString(value.toolCallId, "tool.result.transform data.toolCallId");
|
|
1344
|
+
assertString(value.toolName, "tool.result.transform data.toolName");
|
|
1345
|
+
if (typeof value.isError !== "boolean")
|
|
1346
|
+
throw new Error("tool.result.transform data.isError must be boolean");
|
|
1347
|
+
if (!isPlainRecord(value.revision))
|
|
1348
|
+
throw new Error("tool.result.transform data.revision must be a plain object");
|
|
1349
|
+
const revision = value.revision;
|
|
1350
|
+
if (Object.keys(revision).sort().join(",") !== "leafId,sequence,sessionId,version") {
|
|
1351
|
+
throw new Error("tool.result.transform data.revision has unsupported fields");
|
|
1352
|
+
}
|
|
1353
|
+
if (revision.version !== 1)
|
|
1354
|
+
throw new Error("tool.result.transform data.revision.version must be 1");
|
|
1355
|
+
assertString(revision.sessionId, "tool.result.transform data.revision.sessionId");
|
|
1356
|
+
if (typeof revision.sequence !== "number" || !Number.isSafeInteger(revision.sequence) || revision.sequence < 0) {
|
|
1357
|
+
throw new Error("tool.result.transform data.revision.sequence must be a non-negative safe integer");
|
|
1358
|
+
}
|
|
1359
|
+
if (revision.leafId !== null)
|
|
1360
|
+
assertString(revision.leafId, "tool.result.transform data.revision.leafId");
|
|
1361
|
+
if (revision.sessionId !== value.sessionId) {
|
|
1362
|
+
throw new Error("tool.result.transform data.revision.sessionId must match sessionId");
|
|
1363
|
+
}
|
|
1364
|
+
if (!Array.isArray(value.content))
|
|
1365
|
+
throw new Error("tool.result.transform data.content must be an array");
|
|
1366
|
+
for (const [index, content] of value.content.entries()) {
|
|
1367
|
+
if (!isPlainRecord(content)) {
|
|
1368
|
+
throw new Error(`tool.result.transform data.content[${index}] must be a plain object`);
|
|
1369
|
+
}
|
|
1370
|
+
if (content.type === "text") {
|
|
1371
|
+
const keys = Object.keys(content).sort().join(",");
|
|
1372
|
+
if (keys !== "text,type" && keys !== "text,textSignature,type") {
|
|
1373
|
+
throw new Error(`tool.result.transform data.content[${index}] has unsupported text fields`);
|
|
1374
|
+
}
|
|
1375
|
+
assertString(content.text, `tool.result.transform data.content[${index}].text`);
|
|
1376
|
+
if (content.textSignature !== undefined) {
|
|
1377
|
+
assertString(content.textSignature, `tool.result.transform data.content[${index}].textSignature`);
|
|
1378
|
+
}
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
if (content.type === "image") {
|
|
1382
|
+
if (Object.keys(content).sort().join(",") !== "data,mimeType,type") {
|
|
1383
|
+
throw new Error(`tool.result.transform data.content[${index}] has unsupported image fields`);
|
|
1384
|
+
}
|
|
1385
|
+
assertString(content.data, `tool.result.transform data.content[${index}].data`);
|
|
1386
|
+
assertString(content.mimeType, `tool.result.transform data.content[${index}].mimeType`);
|
|
1387
|
+
continue;
|
|
1388
|
+
}
|
|
1389
|
+
throw new Error(`tool.result.transform data.content[${index}].type is invalid`);
|
|
1390
|
+
}
|
|
1391
|
+
return value;
|
|
1392
|
+
}
|
|
1393
|
+
export function toolResultTransformEventDefinition() {
|
|
1394
|
+
const allowedRegistrationKinds = ["observe", "transform"];
|
|
1395
|
+
return {
|
|
1396
|
+
id: TOOL_RESULT_TRANSFORM_EVENT_ID,
|
|
1397
|
+
version: TOOL_RESULT_TRANSFORM_EVENT_VERSION,
|
|
1398
|
+
phase: "candidate",
|
|
1399
|
+
schema: "agent-forge/tool.result.transform@1",
|
|
1400
|
+
allowedRegistrationKinds,
|
|
1401
|
+
validate: validateToolResultTransformEventDataV1,
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
export function validateOperationEndEventDataV1(value) {
|
|
1405
|
+
if (!isPlainRecord(value))
|
|
1406
|
+
throw new Error("operation.end data must be a plain object");
|
|
1407
|
+
const allowed = new Set(["version", "operationId", "operationKind", "status", "errorMessage", "reason"]);
|
|
1408
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1409
|
+
if (unsupported.length > 0)
|
|
1410
|
+
throw new Error(`operation.end data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1411
|
+
for (const key of ["version", "operationId", "operationKind", "status"]) {
|
|
1412
|
+
if (!(key in value))
|
|
1413
|
+
throw new Error(`operation.end data is missing required field: ${key}`);
|
|
1414
|
+
}
|
|
1415
|
+
if (value.version !== 1)
|
|
1416
|
+
throw new Error("operation.end data.version must be 1");
|
|
1417
|
+
assertString(value.operationId, "operation.end data.operationId");
|
|
1418
|
+
assertString(value.operationKind, "operation.end data.operationKind");
|
|
1419
|
+
if (value.status !== "succeeded" && value.status !== "failed" && value.status !== "cancelled") {
|
|
1420
|
+
throw new Error("operation.end data.status is invalid");
|
|
1421
|
+
}
|
|
1422
|
+
if (value.errorMessage !== undefined)
|
|
1423
|
+
assertString(value.errorMessage, "operation.end data.errorMessage");
|
|
1424
|
+
if (value.reason !== undefined)
|
|
1425
|
+
assertString(value.reason, "operation.end data.reason");
|
|
1426
|
+
return value;
|
|
1427
|
+
}
|
|
1428
|
+
export function operationEndEventDefinition() {
|
|
1429
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1430
|
+
return {
|
|
1431
|
+
id: OPERATION_END_EVENT_ID,
|
|
1432
|
+
version: OPERATION_END_EVENT_VERSION,
|
|
1433
|
+
phase: "committed",
|
|
1434
|
+
schema: "agent-forge/operation.end@1",
|
|
1435
|
+
allowedRegistrationKinds,
|
|
1436
|
+
validate: validateOperationEndEventDataV1,
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
export const CAPABILITY_CALL_EVENT_ID = "capability.call";
|
|
1440
|
+
export const CAPABILITY_CALL_EVENT_VERSION = 1;
|
|
1441
|
+
const capabilityCallEvents = new Set(["start", "cancel", "end"]);
|
|
1442
|
+
const capabilityCallStatuses = new Set(["succeeded", "failed", "cancelled"]);
|
|
1443
|
+
export function validateCapabilityCallEventDataV1(value) {
|
|
1444
|
+
if (!isPlainRecord(value))
|
|
1445
|
+
throw new Error("capability.call data must be a plain object");
|
|
1446
|
+
const allowed = new Set([
|
|
1447
|
+
"version",
|
|
1448
|
+
"operationId",
|
|
1449
|
+
"capabilityId",
|
|
1450
|
+
"capabilityVersion",
|
|
1451
|
+
"capabilityKind",
|
|
1452
|
+
"callerPluginId",
|
|
1453
|
+
"providerPluginId",
|
|
1454
|
+
"event",
|
|
1455
|
+
"status",
|
|
1456
|
+
"error",
|
|
1457
|
+
]);
|
|
1458
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1459
|
+
if (unsupported.length > 0) {
|
|
1460
|
+
throw new Error(`capability.call data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1461
|
+
}
|
|
1462
|
+
for (const key of [
|
|
1463
|
+
"version",
|
|
1464
|
+
"operationId",
|
|
1465
|
+
"capabilityId",
|
|
1466
|
+
"capabilityVersion",
|
|
1467
|
+
"capabilityKind",
|
|
1468
|
+
"callerPluginId",
|
|
1469
|
+
"providerPluginId",
|
|
1470
|
+
"event",
|
|
1471
|
+
]) {
|
|
1472
|
+
if (!(key in value))
|
|
1473
|
+
throw new Error(`capability.call data is missing required field: ${key}`);
|
|
1474
|
+
}
|
|
1475
|
+
if (value.version !== 1)
|
|
1476
|
+
throw new Error("capability.call data.version must be 1");
|
|
1477
|
+
assertString(value.operationId, "capability.call data.operationId");
|
|
1478
|
+
assertString(value.capabilityId, "capability.call data.capabilityId");
|
|
1479
|
+
if (typeof value.capabilityVersion !== "number" ||
|
|
1480
|
+
!Number.isSafeInteger(value.capabilityVersion) ||
|
|
1481
|
+
value.capabilityVersion < 1) {
|
|
1482
|
+
throw new Error("capability.call data.capabilityVersion must be a positive safe integer");
|
|
1483
|
+
}
|
|
1484
|
+
if (value.capabilityKind !== "service" &&
|
|
1485
|
+
value.capabilityKind !== "contribution" &&
|
|
1486
|
+
value.capabilityKind !== "transform") {
|
|
1487
|
+
throw new Error("capability.call data.capabilityKind is invalid");
|
|
1488
|
+
}
|
|
1489
|
+
assertString(value.callerPluginId, "capability.call data.callerPluginId");
|
|
1490
|
+
assertString(value.providerPluginId, "capability.call data.providerPluginId");
|
|
1491
|
+
if (typeof value.event !== "string" || !capabilityCallEvents.has(value.event)) {
|
|
1492
|
+
throw new Error("capability.call data.event is invalid");
|
|
1493
|
+
}
|
|
1494
|
+
if ((value.event === "start" || value.event === "cancel") && value.status !== undefined) {
|
|
1495
|
+
throw new Error("capability.call start/cancel must not include status");
|
|
1496
|
+
}
|
|
1497
|
+
if (value.event === "end" && value.status === undefined) {
|
|
1498
|
+
throw new Error("capability.call end requires status");
|
|
1499
|
+
}
|
|
1500
|
+
if (value.status !== undefined) {
|
|
1501
|
+
if (typeof value.status !== "string" || !capabilityCallStatuses.has(value.status)) {
|
|
1502
|
+
throw new Error("capability.call data.status is invalid");
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (value.error !== undefined) {
|
|
1506
|
+
if (!isPlainRecord(value.error))
|
|
1507
|
+
throw new Error("capability.call data.error must be a plain object");
|
|
1508
|
+
const errorKeys = Object.keys(value.error);
|
|
1509
|
+
if (errorKeys.some((key) => key !== "code" && key !== "message" && key !== "name")) {
|
|
1510
|
+
throw new Error("capability.call data.error has unsupported fields");
|
|
1511
|
+
}
|
|
1512
|
+
if (!("code" in value.error))
|
|
1513
|
+
throw new Error("capability.call data.error is missing required field: code");
|
|
1514
|
+
if (!("message" in value.error))
|
|
1515
|
+
throw new Error("capability.call data.error is missing required field: message");
|
|
1516
|
+
assertString(value.error.code, "capability.call data.error.code");
|
|
1517
|
+
assertString(value.error.message, "capability.call data.error.message");
|
|
1518
|
+
if (value.error.name !== undefined)
|
|
1519
|
+
assertString(value.error.name, "capability.call data.error.name");
|
|
1520
|
+
}
|
|
1521
|
+
if (value.event !== "end" && value.error !== undefined) {
|
|
1522
|
+
throw new Error("capability.call start/cancel must not include error");
|
|
1523
|
+
}
|
|
1524
|
+
if (value.event === "end" && value.status === "succeeded" && value.error !== undefined) {
|
|
1525
|
+
throw new Error("capability.call succeeded end must not include error");
|
|
1526
|
+
}
|
|
1527
|
+
return value;
|
|
1528
|
+
}
|
|
1529
|
+
export function capabilityCallEventDefinition() {
|
|
1530
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1531
|
+
return {
|
|
1532
|
+
id: CAPABILITY_CALL_EVENT_ID,
|
|
1533
|
+
version: CAPABILITY_CALL_EVENT_VERSION,
|
|
1534
|
+
phase: "committed",
|
|
1535
|
+
schema: "agent-forge/capability.call@1",
|
|
1536
|
+
allowedRegistrationKinds,
|
|
1537
|
+
validate: validateCapabilityCallEventDataV1,
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
export const OPERATION_START_EVENT_ID = "operation.start";
|
|
1541
|
+
export const OPERATION_START_EVENT_VERSION = 1;
|
|
1542
|
+
export const OPERATION_STEP_EVENT_ID = "operation.step";
|
|
1543
|
+
export const OPERATION_STEP_EVENT_VERSION = 1;
|
|
1544
|
+
export function validateOperationStartEventDataV1(value) {
|
|
1545
|
+
if (!isPlainRecord(value))
|
|
1546
|
+
throw new Error("operation.start data must be a plain object");
|
|
1547
|
+
const keys = Object.keys(value).sort().join(",");
|
|
1548
|
+
if (keys !== "operationId,operationKind,version") {
|
|
1549
|
+
throw new Error("operation.start data has unsupported fields");
|
|
1550
|
+
}
|
|
1551
|
+
if (value.version !== 1)
|
|
1552
|
+
throw new Error("operation.start data.version must be 1");
|
|
1553
|
+
assertString(value.operationId, "operation.start data.operationId");
|
|
1554
|
+
assertString(value.operationKind, "operation.start data.operationKind");
|
|
1555
|
+
return value;
|
|
1556
|
+
}
|
|
1557
|
+
export function operationStartEventDefinition() {
|
|
1558
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1559
|
+
return {
|
|
1560
|
+
id: OPERATION_START_EVENT_ID,
|
|
1561
|
+
version: OPERATION_START_EVENT_VERSION,
|
|
1562
|
+
phase: "committed",
|
|
1563
|
+
schema: "agent-forge/operation.start@1",
|
|
1564
|
+
allowedRegistrationKinds,
|
|
1565
|
+
validate: validateOperationStartEventDataV1,
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
export function validateOperationStepEventDataV1(value) {
|
|
1569
|
+
if (!isPlainRecord(value))
|
|
1570
|
+
throw new Error("operation.step data must be a plain object");
|
|
1571
|
+
const allowed = new Set(["version", "operationId", "operationKind", "step", "message", "data"]);
|
|
1572
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1573
|
+
if (unsupported.length > 0)
|
|
1574
|
+
throw new Error("operation.step data has unsupported fields");
|
|
1575
|
+
if (value.version !== 1)
|
|
1576
|
+
throw new Error("operation.step data.version must be 1");
|
|
1577
|
+
assertString(value.operationId, "operation.step data.operationId");
|
|
1578
|
+
assertString(value.operationKind, "operation.step data.operationKind");
|
|
1579
|
+
if (typeof value.step !== "number" || !Number.isSafeInteger(value.step) || value.step < 1) {
|
|
1580
|
+
throw new Error("operation.step data.step must be a positive safe integer");
|
|
1581
|
+
}
|
|
1582
|
+
if (value.message !== undefined)
|
|
1583
|
+
assertString(value.message, "operation.step data.message");
|
|
1584
|
+
if (value.data !== undefined)
|
|
1585
|
+
assertJsonSafe(value.data, "operation.step data.data");
|
|
1586
|
+
return value;
|
|
1587
|
+
}
|
|
1588
|
+
export function operationStepEventDefinition() {
|
|
1589
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1590
|
+
return {
|
|
1591
|
+
id: OPERATION_STEP_EVENT_ID,
|
|
1592
|
+
version: OPERATION_STEP_EVENT_VERSION,
|
|
1593
|
+
phase: "committed",
|
|
1594
|
+
schema: "agent-forge/operation.step@1",
|
|
1595
|
+
allowedRegistrationKinds,
|
|
1596
|
+
validate: validateOperationStepEventDataV1,
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
export const OPERATION_CANCEL_EVENT_ID = "operation.cancel";
|
|
1600
|
+
export const OPERATION_CANCEL_EVENT_VERSION = 1;
|
|
1601
|
+
export function validateOperationCancelEventDataV1(value) {
|
|
1602
|
+
if (!isPlainRecord(value))
|
|
1603
|
+
throw new Error("operation.cancel data must be a plain object");
|
|
1604
|
+
const keys = Object.keys(value).sort().join(",");
|
|
1605
|
+
if (keys !== "operationId,operationKind,version") {
|
|
1606
|
+
throw new Error("operation.cancel data has unsupported fields");
|
|
1607
|
+
}
|
|
1608
|
+
if (value.version !== 1)
|
|
1609
|
+
throw new Error("operation.cancel data.version must be 1");
|
|
1610
|
+
assertString(value.operationId, "operation.cancel data.operationId");
|
|
1611
|
+
assertString(value.operationKind, "operation.cancel data.operationKind");
|
|
1612
|
+
return value;
|
|
1613
|
+
}
|
|
1614
|
+
export function operationCancelEventDefinition() {
|
|
1615
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1616
|
+
return {
|
|
1617
|
+
id: OPERATION_CANCEL_EVENT_ID,
|
|
1618
|
+
version: OPERATION_CANCEL_EVENT_VERSION,
|
|
1619
|
+
phase: "committed",
|
|
1620
|
+
schema: "agent-forge/operation.cancel@1",
|
|
1621
|
+
allowedRegistrationKinds,
|
|
1622
|
+
validate: validateOperationCancelEventDataV1,
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
export const SESSION_AUTO_RETRY_EVENT_ID = "session.auto.retry";
|
|
1626
|
+
export const SESSION_AUTO_RETRY_EVENT_VERSION = 1;
|
|
1627
|
+
export const SESSION_COMPACTION_DECISION_EVENT_ID = "session.compaction.decision";
|
|
1628
|
+
export const SESSION_COMPACTION_DECISION_EVENT_VERSION = 1;
|
|
1629
|
+
export const SESSION_COMPACTION_FAILED_EVENT_ID = "session.compaction.failed";
|
|
1630
|
+
export const SESSION_COMPACTION_FAILED_EVENT_VERSION = 1;
|
|
1631
|
+
function assertNonNegativeSafeInteger(value, label) {
|
|
1632
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {
|
|
1633
|
+
throw new Error(`${label} must be a non-negative safe integer`);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
function assertPositiveSafeInteger(value, label) {
|
|
1637
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1) {
|
|
1638
|
+
throw new Error(`${label} must be a positive safe integer`);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
export function validateSessionAutoRetryEventDataV1(value) {
|
|
1642
|
+
if (!isPlainRecord(value))
|
|
1643
|
+
throw new Error("session.auto.retry data must be a plain object");
|
|
1644
|
+
const allowed = new Set(["version", "sessionId", "attempt", "maxAttempts", "delayMs", "errorMessage"]);
|
|
1645
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1646
|
+
if (unsupported.length > 0) {
|
|
1647
|
+
throw new Error(`session.auto.retry data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1648
|
+
}
|
|
1649
|
+
for (const key of ["version", "sessionId", "attempt", "maxAttempts", "delayMs", "errorMessage"]) {
|
|
1650
|
+
if (!(key in value))
|
|
1651
|
+
throw new Error(`session.auto.retry data is missing required field: ${key}`);
|
|
1652
|
+
}
|
|
1653
|
+
if (value.version !== 1)
|
|
1654
|
+
throw new Error("session.auto.retry data.version must be 1");
|
|
1655
|
+
assertString(value.sessionId, "session.auto.retry data.sessionId");
|
|
1656
|
+
assertPositiveSafeInteger(value.attempt, "session.auto.retry data.attempt");
|
|
1657
|
+
assertPositiveSafeInteger(value.maxAttempts, "session.auto.retry data.maxAttempts");
|
|
1658
|
+
assertNonNegativeSafeInteger(value.delayMs, "session.auto.retry data.delayMs");
|
|
1659
|
+
assertString(value.errorMessage, "session.auto.retry data.errorMessage");
|
|
1660
|
+
return value;
|
|
1661
|
+
}
|
|
1662
|
+
export function sessionAutoRetryEventDefinition() {
|
|
1663
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1664
|
+
return {
|
|
1665
|
+
id: SESSION_AUTO_RETRY_EVENT_ID,
|
|
1666
|
+
version: SESSION_AUTO_RETRY_EVENT_VERSION,
|
|
1667
|
+
phase: "committed",
|
|
1668
|
+
schema: "agent-forge/session.auto.retry@1",
|
|
1669
|
+
allowedRegistrationKinds,
|
|
1670
|
+
validate: validateSessionAutoRetryEventDataV1,
|
|
1671
|
+
};
|
|
1672
|
+
}
|
|
1673
|
+
const sessionCompactionDecisionReasons = new Set(["overflow", "threshold"]);
|
|
1674
|
+
function assertOptionalPositiveSafeInteger(value, label) {
|
|
1675
|
+
if (value === undefined)
|
|
1676
|
+
return;
|
|
1677
|
+
assertPositiveSafeInteger(value, label);
|
|
1678
|
+
}
|
|
1679
|
+
export function validateSessionCompactionDecisionEventDataV1(value) {
|
|
1680
|
+
if (!isPlainRecord(value))
|
|
1681
|
+
throw new Error("session.compaction.decision data must be a plain object");
|
|
1682
|
+
const allowed = new Set([
|
|
1683
|
+
"version",
|
|
1684
|
+
"sessionId",
|
|
1685
|
+
"reason",
|
|
1686
|
+
"compact",
|
|
1687
|
+
"willRetry",
|
|
1688
|
+
"contextTokens",
|
|
1689
|
+
"contextWindow",
|
|
1690
|
+
"reserveTokens",
|
|
1691
|
+
"failureMessage",
|
|
1692
|
+
]);
|
|
1693
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1694
|
+
if (unsupported.length > 0) {
|
|
1695
|
+
throw new Error(`session.compaction.decision data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1696
|
+
}
|
|
1697
|
+
for (const key of ["version", "sessionId", "reason", "compact", "willRetry"]) {
|
|
1698
|
+
if (!(key in value))
|
|
1699
|
+
throw new Error(`session.compaction.decision data is missing required field: ${key}`);
|
|
1700
|
+
}
|
|
1701
|
+
if (value.version !== 1)
|
|
1702
|
+
throw new Error("session.compaction.decision data.version must be 1");
|
|
1703
|
+
assertString(value.sessionId, "session.compaction.decision data.sessionId");
|
|
1704
|
+
if (typeof value.reason !== "string" ||
|
|
1705
|
+
!sessionCompactionDecisionReasons.has(value.reason)) {
|
|
1706
|
+
throw new Error("session.compaction.decision data.reason is invalid");
|
|
1707
|
+
}
|
|
1708
|
+
if (typeof value.compact !== "boolean") {
|
|
1709
|
+
throw new Error("session.compaction.decision data.compact must be a boolean");
|
|
1710
|
+
}
|
|
1711
|
+
if (typeof value.willRetry !== "boolean") {
|
|
1712
|
+
throw new Error("session.compaction.decision data.willRetry must be a boolean");
|
|
1713
|
+
}
|
|
1714
|
+
assertOptionalPositiveSafeInteger(value.contextTokens, "session.compaction.decision data.contextTokens");
|
|
1715
|
+
assertOptionalPositiveSafeInteger(value.contextWindow, "session.compaction.decision data.contextWindow");
|
|
1716
|
+
assertOptionalPositiveSafeInteger(value.reserveTokens, "session.compaction.decision data.reserveTokens");
|
|
1717
|
+
if (value.failureMessage !== undefined) {
|
|
1718
|
+
assertString(value.failureMessage, "session.compaction.decision data.failureMessage");
|
|
1719
|
+
}
|
|
1720
|
+
return value;
|
|
1721
|
+
}
|
|
1722
|
+
export function sessionCompactionDecisionEventDefinition() {
|
|
1723
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1724
|
+
return {
|
|
1725
|
+
id: SESSION_COMPACTION_DECISION_EVENT_ID,
|
|
1726
|
+
version: SESSION_COMPACTION_DECISION_EVENT_VERSION,
|
|
1727
|
+
phase: "committed",
|
|
1728
|
+
schema: "agent-forge/session.compaction.decision@1",
|
|
1729
|
+
allowedRegistrationKinds,
|
|
1730
|
+
validate: validateSessionCompactionDecisionEventDataV1,
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
const sessionCompactionFailedReasons = new Set(["manual", "overflow", "threshold"]);
|
|
1734
|
+
export function validateSessionCompactionFailedEventDataV1(value) {
|
|
1735
|
+
if (!isPlainRecord(value))
|
|
1736
|
+
throw new Error("session.compaction.failed data must be a plain object");
|
|
1737
|
+
const allowed = new Set(["version", "sessionId", "reason", "errorMessage"]);
|
|
1738
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1739
|
+
if (unsupported.length > 0) {
|
|
1740
|
+
throw new Error(`session.compaction.failed data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1741
|
+
}
|
|
1742
|
+
for (const key of ["version", "sessionId", "reason", "errorMessage"]) {
|
|
1743
|
+
if (!(key in value))
|
|
1744
|
+
throw new Error(`session.compaction.failed data is missing required field: ${key}`);
|
|
1745
|
+
}
|
|
1746
|
+
if (value.version !== 1)
|
|
1747
|
+
throw new Error("session.compaction.failed data.version must be 1");
|
|
1748
|
+
assertString(value.sessionId, "session.compaction.failed data.sessionId");
|
|
1749
|
+
if (typeof value.reason !== "string" ||
|
|
1750
|
+
!sessionCompactionFailedReasons.has(value.reason)) {
|
|
1751
|
+
throw new Error("session.compaction.failed data.reason is invalid");
|
|
1752
|
+
}
|
|
1753
|
+
assertString(value.errorMessage, "session.compaction.failed data.errorMessage");
|
|
1754
|
+
return value;
|
|
1755
|
+
}
|
|
1756
|
+
export function sessionCompactionFailedEventDefinition() {
|
|
1757
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1758
|
+
return {
|
|
1759
|
+
id: SESSION_COMPACTION_FAILED_EVENT_ID,
|
|
1760
|
+
version: SESSION_COMPACTION_FAILED_EVENT_VERSION,
|
|
1761
|
+
phase: "committed",
|
|
1762
|
+
schema: "agent-forge/session.compaction.failed@1",
|
|
1763
|
+
allowedRegistrationKinds,
|
|
1764
|
+
validate: validateSessionCompactionFailedEventDataV1,
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
export const SESSION_END_EVENT_ID = "session.end";
|
|
1768
|
+
export const SESSION_END_EVENT_VERSION = 1;
|
|
1769
|
+
export function validateSessionEndEventDataV1(value) {
|
|
1770
|
+
if (!isPlainRecord(value))
|
|
1771
|
+
throw new Error("session.end data must be a plain object");
|
|
1772
|
+
if (Object.keys(value).sort().join(",") !== "sessionId,version") {
|
|
1773
|
+
throw new Error("session.end data has unsupported fields");
|
|
1774
|
+
}
|
|
1775
|
+
if (value.version !== 1)
|
|
1776
|
+
throw new Error("session.end data.version must be 1");
|
|
1777
|
+
assertString(value.sessionId, "session.end data.sessionId");
|
|
1778
|
+
return value;
|
|
1779
|
+
}
|
|
1780
|
+
export function sessionEndEventDefinition() {
|
|
1781
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1782
|
+
return {
|
|
1783
|
+
id: SESSION_END_EVENT_ID,
|
|
1784
|
+
version: SESSION_END_EVENT_VERSION,
|
|
1785
|
+
phase: "committed",
|
|
1786
|
+
schema: "agent-forge/session.end@1",
|
|
1787
|
+
allowedRegistrationKinds,
|
|
1788
|
+
validate: validateSessionEndEventDataV1,
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
export const AGENT_TASK_SETTLED_EVENT_ID = "agent.task.settled";
|
|
1792
|
+
export const AGENT_TASK_SETTLED_EVENT_VERSION = 1;
|
|
1793
|
+
const agentTaskSettledStatuses = new Set([
|
|
1794
|
+
"queued",
|
|
1795
|
+
"admitted",
|
|
1796
|
+
"running",
|
|
1797
|
+
"succeeded",
|
|
1798
|
+
"failed",
|
|
1799
|
+
"cancelled",
|
|
1800
|
+
"timed_out",
|
|
1801
|
+
"drain_timeout",
|
|
1802
|
+
"runner_lost",
|
|
1803
|
+
]);
|
|
1804
|
+
export function validateAgentTaskSettledEventDataV1(value) {
|
|
1805
|
+
if (!isPlainRecord(value))
|
|
1806
|
+
throw new Error("agent.task.settled data must be a plain object");
|
|
1807
|
+
const allowed = new Set(["version", "sessionId", "taskSessionId", "taskId", "status", "reasonCode"]);
|
|
1808
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1809
|
+
if (unsupported.length > 0) {
|
|
1810
|
+
throw new Error(`agent.task.settled data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1811
|
+
}
|
|
1812
|
+
for (const key of ["version", "sessionId", "taskSessionId", "taskId", "status"]) {
|
|
1813
|
+
if (!(key in value))
|
|
1814
|
+
throw new Error(`agent.task.settled data is missing required field: ${key}`);
|
|
1815
|
+
}
|
|
1816
|
+
if (value.version !== 1)
|
|
1817
|
+
throw new Error("agent.task.settled data.version must be 1");
|
|
1818
|
+
assertString(value.sessionId, "agent.task.settled data.sessionId");
|
|
1819
|
+
assertString(value.taskSessionId, "agent.task.settled data.taskSessionId");
|
|
1820
|
+
assertString(value.taskId, "agent.task.settled data.taskId");
|
|
1821
|
+
if (typeof value.status !== "string" || !agentTaskSettledStatuses.has(value.status)) {
|
|
1822
|
+
throw new Error("agent.task.settled data.status is invalid");
|
|
1823
|
+
}
|
|
1824
|
+
if (value.reasonCode !== undefined)
|
|
1825
|
+
assertString(value.reasonCode, "agent.task.settled data.reasonCode");
|
|
1826
|
+
return value;
|
|
1827
|
+
}
|
|
1828
|
+
export function agentTaskSettledEventDefinition() {
|
|
1829
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1830
|
+
return {
|
|
1831
|
+
id: AGENT_TASK_SETTLED_EVENT_ID,
|
|
1832
|
+
version: AGENT_TASK_SETTLED_EVENT_VERSION,
|
|
1833
|
+
phase: "committed",
|
|
1834
|
+
schema: "agent-forge/agent.task.settled@1",
|
|
1835
|
+
allowedRegistrationKinds,
|
|
1836
|
+
validate: validateAgentTaskSettledEventDataV1,
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1839
|
+
export function validateToolGateBlockedEventDataV1(value) {
|
|
1840
|
+
if (!isPlainRecord(value))
|
|
1841
|
+
throw new Error("tool.gate.blocked data must be a plain object");
|
|
1842
|
+
const allowed = new Set(["version", "sessionId", "toolCallId", "toolName", "reason"]);
|
|
1843
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1844
|
+
if (unsupported.length > 0)
|
|
1845
|
+
throw new Error(`tool.gate.blocked data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1846
|
+
for (const key of ["version", "sessionId", "toolCallId", "toolName"]) {
|
|
1847
|
+
if (!(key in value))
|
|
1848
|
+
throw new Error(`tool.gate.blocked data is missing required field: ${key}`);
|
|
1849
|
+
}
|
|
1850
|
+
if (value.version !== 1)
|
|
1851
|
+
throw new Error("tool.gate.blocked data.version must be 1");
|
|
1852
|
+
assertString(value.sessionId, "tool.gate.blocked data.sessionId");
|
|
1853
|
+
assertString(value.toolCallId, "tool.gate.blocked data.toolCallId");
|
|
1854
|
+
assertString(value.toolName, "tool.gate.blocked data.toolName");
|
|
1855
|
+
if (value.reason !== undefined)
|
|
1856
|
+
assertString(value.reason, "tool.gate.blocked data.reason");
|
|
1857
|
+
return value;
|
|
1858
|
+
}
|
|
1859
|
+
export function toolGateBlockedEventDefinition() {
|
|
1860
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1861
|
+
return {
|
|
1862
|
+
id: TOOL_GATE_BLOCKED_EVENT_ID,
|
|
1863
|
+
version: TOOL_GATE_BLOCKED_EVENT_VERSION,
|
|
1864
|
+
phase: "committed",
|
|
1865
|
+
schema: "agent-forge/tool.gate.blocked@1",
|
|
1866
|
+
allowedRegistrationKinds,
|
|
1867
|
+
validate: validateToolGateBlockedEventDataV1,
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
export function validateInputGateBlockedEventDataV1(value) {
|
|
1871
|
+
if (!isPlainRecord(value))
|
|
1872
|
+
throw new Error("input.gate.blocked data must be a plain object");
|
|
1873
|
+
const allowed = new Set(["version", "sessionId", "source", "textLength", "reason"]);
|
|
1874
|
+
const unsupported = Object.keys(value).filter((key) => !allowed.has(key));
|
|
1875
|
+
if (unsupported.length > 0)
|
|
1876
|
+
throw new Error(`input.gate.blocked data has unsupported fields: ${unsupported.join(", ")}`);
|
|
1877
|
+
for (const key of ["version", "sessionId", "source", "textLength"]) {
|
|
1878
|
+
if (!(key in value))
|
|
1879
|
+
throw new Error(`input.gate.blocked data is missing required field: ${key}`);
|
|
1880
|
+
}
|
|
1881
|
+
if (value.version !== 1)
|
|
1882
|
+
throw new Error("input.gate.blocked data.version must be 1");
|
|
1883
|
+
assertString(value.sessionId, "input.gate.blocked data.sessionId");
|
|
1884
|
+
assertString(value.source, "input.gate.blocked data.source");
|
|
1885
|
+
if (typeof value.textLength !== "number" || !Number.isInteger(value.textLength) || value.textLength < 0) {
|
|
1886
|
+
throw new Error("input.gate.blocked data.textLength must be a non-negative integer");
|
|
1887
|
+
}
|
|
1888
|
+
if (value.reason !== undefined)
|
|
1889
|
+
assertString(value.reason, "input.gate.blocked data.reason");
|
|
1890
|
+
return value;
|
|
1891
|
+
}
|
|
1892
|
+
export function inputGateBlockedEventDefinition() {
|
|
1893
|
+
const allowedRegistrationKinds = ["observe", "after-commit"];
|
|
1894
|
+
return {
|
|
1895
|
+
id: INPUT_GATE_BLOCKED_EVENT_ID,
|
|
1896
|
+
version: INPUT_GATE_BLOCKED_EVENT_VERSION,
|
|
1897
|
+
phase: "committed",
|
|
1898
|
+
schema: "agent-forge/input.gate.blocked@1",
|
|
1899
|
+
allowedRegistrationKinds,
|
|
1900
|
+
validate: validateInputGateBlockedEventDataV1,
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
//# sourceMappingURL=lifecycle-catalog.js.map
|