@ai-agent-forge/agent-forge 0.88.2 → 0.88.4
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 +33 -0
- package/README.md +1 -1
- package/bundled-plugins/agent-loop-policy/agent-forge.json +1 -1
- package/bundled-plugins/agent-loop-policy/plugin.json +1 -1
- package/bundled-plugins/coding-tools/agent-forge.json +1 -1
- package/bundled-plugins/coding-tools/plugin.json +1 -1
- package/bundled-plugins/compaction-policy/agent-forge.json +1 -1
- package/bundled-plugins/compaction-policy/plugin.json +1 -1
- package/bundled-plugins/overflow-policy/agent-forge.json +1 -1
- package/bundled-plugins/overflow-policy/plugin.json +1 -1
- package/bundled-plugins/provider-failover/agent-forge.json +1 -1
- package/bundled-plugins/provider-failover/plugin.json +1 -1
- package/bundled-plugins/retry-policy/agent-forge.json +1 -1
- package/bundled-plugins/retry-policy/plugin.json +1 -1
- package/dist/artifacts/paged-read.d.ts +6 -1
- package/dist/artifacts/paged-read.d.ts.map +1 -1
- package/dist/artifacts/paged-read.js.map +1 -1
- package/dist/bundle/.build-manifest.json +244 -234
- package/dist/bundle/chunks/{anthropic-messages-PLAKXR73.js → anthropic-messages-3FJHRAJL.js} +2 -2
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-OUWQ2AZD.js → azure-openai-responses-GCL47IDS.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-6F5JWGKE.js → chunk-32YDZI4J.js} +1 -1
- package/dist/bundle/chunks/{chunk-LSP24WNH.js → chunk-755VNWIF.js} +12 -12
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-BVVSHK6W.js} +1 -1
- package/dist/bundle/chunks/{chunk-HTC5K5SM.js → chunk-HEL6TAWE.js} +95 -90
- package/dist/bundle/chunks/{chunk-6R7UI4IY.js → chunk-QDLOMKF6.js} +1 -1
- package/dist/bundle/chunks/{chunk-44I47ACN.js → chunk-V3ACW7VD.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-DLII6DAT.js → google-generative-ai-6BMXWA44.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-G7BZL7GM.js → google-vertex-6H7NLRTK.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{mistral-conversations-JXUK24ID.js → mistral-conversations-IXUHSFSJ.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-5GSGFIPG.js → openai-codex-responses-YHUAEVCM.js} +1 -1
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/{openai-completions-EI2I6DTG.js → openai-completions-ULQCFC72.js} +1 -1
- package/dist/bundle/chunks/openai-responses-NLLAJDPS.js +2 -0
- package/dist/bundle/chunks/{openrouter-images-G4GQRUSG.js → openrouter-images-GZZQZXMS.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +1 -1
- package/dist/bundle/chunks/{pi-messages-PWU2VJMR.js → pi-messages-EJTI2EJ3.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-TQWEGNNZ.js +5 -0
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/client.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts +0 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/experimental/cli.d.ts +3 -3
- package/dist/cli/experimental/cli.d.ts.map +1 -1
- package/dist/cli/experimental/cli.js +2 -2
- package/dist/cli/experimental/cli.js.map +1 -1
- package/dist/cli/experimental/commands/agent-forge.d.ts +15 -0
- package/dist/cli/experimental/commands/agent-forge.d.ts.map +1 -0
- package/dist/cli/experimental/commands/{pi.js → agent-forge.js} +4 -4
- package/dist/cli/experimental/commands/agent-forge.js.map +1 -0
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/config.d.ts +4 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -7
- package/dist/config.js.map +1 -1
- package/dist/core/agent-forge-manifest.d.ts +7 -0
- package/dist/core/agent-forge-manifest.d.ts.map +1 -0
- package/dist/core/{pi-manifest.js → agent-forge-manifest.js} +4 -4
- package/dist/core/agent-forge-manifest.js.map +1 -0
- package/dist/core/agent-session-compaction.d.ts +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +3 -3
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-lifecycle.d.ts.map +1 -1
- package/dist/core/agent-session-lifecycle.js +12 -1
- package/dist/core/agent-session-lifecycle.js.map +1 -1
- package/dist/core/agent-session-projection.d.ts.map +1 -1
- package/dist/core/agent-session-projection.js +3 -3
- package/dist/core/agent-session-projection.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +1 -3
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/extensions/capability-plugin.d.ts.map +1 -1
- package/dist/core/extensions/capability-plugin.js +15 -8
- package/dist/core/extensions/capability-plugin.js.map +1 -1
- package/dist/core/extensions/capability-runtime-store.d.ts +20 -1
- package/dist/core/extensions/capability-runtime-store.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-store.js +67 -0
- package/dist/core/extensions/capability-runtime-store.js.map +1 -1
- package/dist/core/extensions/capability-runtime-types.d.ts +14 -0
- package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime-types.js +7 -1
- package/dist/core/extensions/capability-runtime-types.js.map +1 -1
- package/dist/core/extensions/capability-runtime.d.ts.map +1 -1
- package/dist/core/extensions/capability-runtime.js +144 -42
- package/dist/core/extensions/capability-runtime.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +12 -4
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/facade/coding-agent-facade.d.ts +1 -1
- package/dist/core/facade/coding-agent-facade.d.ts.map +1 -1
- package/dist/core/facade/coding-agent-facade.js +1 -1
- package/dist/core/facade/coding-agent-facade.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-final.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-final.js +3 -3
- package/dist/core/i18n/locales/zh-cn/core-contract-final.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-plugins.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.js +1 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.js +2 -0
- package/dist/core/i18n/locales/zh-cn/tui-components-misc.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-resource-collection.d.ts.map +1 -1
- package/dist/core/package-resource-collection.js +5 -5
- package/dist/core/package-resource-collection.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +3 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +1 -1
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +6 -7
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +4 -4
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +5 -10
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +1 -3
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition.d.ts +1 -1
- package/dist/core/tools/tool-definition.d.ts.map +1 -1
- package/dist/core/tools/tool-definition.js.map +1 -1
- package/dist/core/trace-retention.d.ts +16 -1
- package/dist/core/trace-retention.d.ts.map +1 -1
- package/dist/core/trace-retention.js +43 -20
- package/dist/core/trace-retention.js.map +1 -1
- package/dist/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/export-html/ansi-to-html.js.map +1 -0
- package/dist/{core/export-html → export-html}/index.d.ts +1 -1
- package/dist/export-html/index.d.ts.map +1 -0
- package/dist/{core/export-html → export-html}/index.js +5 -5
- package/dist/export-html/index.js.map +1 -0
- package/dist/{core/export-html → export-html}/tool-renderer.d.ts +2 -2
- package/dist/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/export-html/tool-renderer.js.map +1 -0
- package/dist/{modes/interactive → host}/model-catalog-refresh.d.ts +1 -1
- package/dist/host/model-catalog-refresh.d.ts.map +1 -0
- package/dist/{modes/interactive → host}/model-catalog-refresh.js +1 -1
- package/dist/host/model-catalog-refresh.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +25 -14
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/agents-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/agents-view.js +1 -1
- package/dist/modes/interactive/components/agents-view.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +3 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +83 -24
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +1 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dialog-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-editor.js +1 -1
- package/dist/modes/interactive/components/dialog-editor.js.map +1 -1
- package/dist/modes/interactive/components/dialog-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-input.js +1 -1
- package/dist/modes/interactive/components/dialog-input.js.map +1 -1
- package/dist/modes/interactive/components/dialog-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/dialog-selector.js +1 -1
- package/dist/modes/interactive/components/dialog-selector.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +1 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +2 -2
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/plugin-manager-entry.js +1 -1
- package/dist/modes/interactive/components/plugin-manager-entry.js.map +1 -1
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/plugin-selection-entry.js +1 -1
- package/dist/modes/interactive/components/plugin-selection-entry.js.map +1 -1
- package/dist/modes/interactive/components/queue-manager-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/queue-manager-selector.js +1 -1
- package/dist/modes/interactive/components/queue-manager-selector.js.map +1 -1
- package/dist/modes/interactive/components/render-types.d.ts +1 -1
- package/dist/modes/interactive/components/render-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/render-types.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +2 -2
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +1 -1
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +1 -1
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +96 -4
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-run-group.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-run-group.js +1 -1
- package/dist/modes/interactive/components/tool-run-group.js.map +1 -1
- package/dist/modes/interactive/components/tree-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-list.js +1 -1
- package/dist/modes/interactive/components/tree-list.js.map +1 -1
- package/dist/modes/interactive/components/tree-render.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-render.js +1 -1
- package/dist/modes/interactive/components/tree-render.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/workflow-view.d.ts.map +1 -1
- package/dist/modes/interactive/components/workflow-view.js +1 -1
- package/dist/modes/interactive/components/workflow-view.js.map +1 -1
- package/dist/modes/interactive/interactive-auth.d.ts +1 -1
- package/dist/modes/interactive/interactive-auth.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth.js +1 -1
- package/dist/modes/interactive/interactive-auth.js.map +1 -1
- package/dist/modes/interactive/interactive-commands.d.ts +123 -6
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-commands.js +691 -4
- package/dist/modes/interactive/interactive-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-events.d.ts +174 -0
- package/dist/modes/interactive/interactive-events.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-events.js +704 -0
- package/dist/modes/interactive/interactive-events.js.map +1 -0
- package/dist/modes/interactive/interactive-format.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-format.js +1 -1
- package/dist/modes/interactive/interactive-format.js.map +1 -1
- package/dist/modes/interactive/interactive-lifecycle.d.ts +94 -0
- package/dist/modes/interactive/interactive-lifecycle.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-lifecycle.js +177 -0
- package/dist/modes/interactive/interactive-lifecycle.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +240 -133
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +251 -2159
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/interactive-queues.d.ts +96 -0
- package/dist/modes/interactive/interactive-queues.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-queues.js +183 -0
- package/dist/modes/interactive/interactive-queues.js.map +1 -0
- package/dist/modes/interactive/interactive-selectors.d.ts +95 -5
- package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +517 -6
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/startup-services.d.ts +31 -0
- package/dist/modes/interactive/startup-services.d.ts.map +1 -0
- package/dist/modes/interactive/startup-services.js +123 -0
- package/dist/modes/interactive/startup-services.js.map +1 -0
- package/dist/modes/memory-preheat.d.ts +11 -0
- package/dist/modes/memory-preheat.d.ts.map +1 -0
- package/dist/modes/memory-preheat.js +20 -0
- package/dist/modes/memory-preheat.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +3 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.d.ts +9 -1
- package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.js +79 -0
- package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -1
- package/dist/remote/server-assembly.d.ts.map +1 -1
- package/dist/remote/server-assembly.js +7 -2
- package/dist/remote/server-assembly.js.map +1 -1
- package/dist/suites/builtin-suites.d.ts.map +1 -0
- package/dist/suites/builtin-suites.js.map +1 -0
- package/dist/suites/resolved-agent-profile.d.ts.map +1 -0
- package/dist/suites/resolved-agent-profile.js.map +1 -0
- package/dist/suites/suite-lifecycle.d.ts.map +1 -0
- package/dist/suites/suite-lifecycle.js.map +1 -0
- package/dist/suites/suite-loader.d.ts.map +1 -0
- package/dist/suites/suite-loader.js.map +1 -0
- package/dist/{modes/interactive/theme → theme}/dark.json +1 -1
- package/dist/{modes/interactive/theme → theme}/light.json +1 -1
- package/dist/{modes/interactive/theme → theme}/theme-controller.d.ts +1 -1
- package/dist/theme/theme-controller.d.ts.map +1 -0
- package/dist/{modes/interactive/theme → theme}/theme-controller.js +1 -1
- package/dist/theme/theme-controller.js.map +1 -0
- package/dist/{modes/interactive/theme → theme}/theme.d.ts +1 -1
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/{modes/interactive/theme → theme}/theme.js +5 -5
- package/dist/theme/theme.js.map +1 -0
- package/docs/compaction.md +7 -7
- package/docs/environment-variables.md +10 -4
- package/docs/keybindings.md +3 -3
- package/docs/models.md +17 -17
- package/docs/packages.md +1 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/rpc.md +2 -2
- package/docs/sdk.md +5 -5
- package/docs/session-format.md +3 -3
- package/docs/settings.md +15 -1
- package/docs/shell-aliases.md +1 -1
- package/docs/skills.md +1 -1
- package/docs/terminal-setup.md +17 -17
- package/docs/themes.md +5 -5
- package/docs/tmux.md +4 -4
- package/docs/tui.md +1 -1
- package/docs/usage.md +292 -292
- package/docs/windows.md +1 -1
- package/examples/extensions/bash-spawn-hook/index.ts +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- 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/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -6
- package/examples/extensions/with-deps/plugin.json +1 -1
- package/package.json +2 -2
- package/dist/bundle/chunks/openai-responses-AUJQ3NWT.js +0 -2
- package/dist/bundle/chunks/virtual-modules-MRXD3RWG.js +0 -5
- package/dist/cli/experimental/commands/pi.d.ts +0 -15
- package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
- package/dist/cli/experimental/commands/pi.js.map +0 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/dist/core/export-html/index.d.ts.map +0 -1
- package/dist/core/export-html/index.js.map +0 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/dist/core/export-html/tool-renderer.js.map +0 -1
- package/dist/core/pi-manifest.d.ts +0 -7
- package/dist/core/pi-manifest.d.ts.map +0 -1
- package/dist/core/pi-manifest.js.map +0 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +0 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-controller.js.map +0 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme.js.map +0 -1
- package/dist/profiles/builtin-suites.d.ts.map +0 -1
- package/dist/profiles/builtin-suites.js.map +0 -1
- package/dist/profiles/resolved-agent-profile.d.ts.map +0 -1
- package/dist/profiles/resolved-agent-profile.js.map +0 -1
- package/dist/profiles/suite-lifecycle.d.ts.map +0 -1
- package/dist/profiles/suite-lifecycle.js.map +0 -1
- package/dist/profiles/suite-loader.d.ts.map +0 -1
- package/dist/profiles/suite-loader.js.map +0 -1
- package/dist/utils/deprecation.d.ts +0 -4
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js +0 -13
- package/dist/utils/deprecation.js.map +0 -1
- /package/dist/{core/export-html → export-html}/ansi-to-html.d.ts +0 -0
- /package/dist/{core/export-html → export-html}/ansi-to-html.js +0 -0
- /package/dist/{core/export-html → export-html}/template.css +0 -0
- /package/dist/{core/export-html → export-html}/template.html +0 -0
- /package/dist/{core/export-html → export-html}/template.js +0 -0
- /package/dist/{core/export-html → export-html}/tool-renderer.js +0 -0
- /package/dist/{core/export-html → export-html}/vendor/highlight.min.js +0 -0
- /package/dist/{core/export-html → export-html}/vendor/marked.min.js +0 -0
- /package/dist/{profiles → suites}/builtin-suites.d.ts +0 -0
- /package/dist/{profiles → suites}/builtin-suites.js +0 -0
- /package/dist/{profiles → suites}/resolved-agent-profile.d.ts +0 -0
- /package/dist/{profiles → suites}/resolved-agent-profile.js +0 -0
- /package/dist/{profiles → suites}/suite-lifecycle.d.ts +0 -0
- /package/dist/{profiles → suites}/suite-lifecycle.js +0 -0
- /package/dist/{profiles → suites}/suite-loader.d.ts +0 -0
- /package/dist/{profiles → suites}/suite-loader.js +0 -0
- /package/dist/{modes/interactive/theme → theme}/theme-schema.json +0 -0
|
@@ -7,8 +7,9 @@ import { createRuntimeInspector } from "./capability-runtime-inspect.js";
|
|
|
7
7
|
import { assertManifest, assertPluginCapabilityDeclarations, assertPluginCapabilityId, assertPluginCapabilityVersion, capabilityKey, createPluginConfig, isPluginConfigValue, resolvePluginCapabilityOrder, } from "./capability-runtime-manifest.js";
|
|
8
8
|
import { OutputArtifactError, RuntimeOperation } from "./capability-runtime-operation.js";
|
|
9
9
|
import { definitionSnapshot, detachedSnapshot } from "./capability-runtime-snapshot.js";
|
|
10
|
-
import { assertRegisteredCapabilityActive as assertRegisteredCapabilityState, cancelOwnedOperations as cancelOwnedOperationsState, createCapabilityRuntimeState, createRevokedCapabilityError, invokePluginCapability as invokePluginCapabilityState, invokeRegisteredCapability as invokeRegisteredCapabilityState, invokeRegisteredCapabilityWithSignal as invokeRegisteredCapabilityWithSignalState, isRevokedCapabilityError, observeUnexpectedAsyncCleanup, trackOperation as trackOperationState, } from "./capability-runtime-store.js";
|
|
10
|
+
import { assertRegisteredCapabilityActive as assertRegisteredCapabilityState, cancelOwnedOperations as cancelOwnedOperationsState, createCapabilityRuntimeState, createRevokedCapabilityError, invokePluginCapability as invokePluginCapabilityState, invokeRegisteredCapability as invokeRegisteredCapabilityState, invokeRegisteredCapabilityWithSignal as invokeRegisteredCapabilityWithSignalState, isRevokedCapabilityError, observeUnexpectedAsyncCleanup, pushPluginRejection, pushRuntimeLog, setDiagnosticsSpan, setOperationStatus, trackOperation as trackOperationState, } from "./capability-runtime-store.js";
|
|
11
11
|
import { invokeCapabilityTool } from "./capability-runtime-tool.js";
|
|
12
|
+
import { OUTPUT_ARTIFACT_MAX_BUFFER_BYTES } from "./capability-runtime-types.js";
|
|
12
13
|
import { asHandler, assertAgentTaskRequest, assertHost, capabilityName, contributionPointKey, lifecycleEventKey, lifecycleRegistrationKinds, stableTextCompare, toolReadonlySafe, validateCommandDefinition, validateCommandResult, validateContributionPointDefinition, validateExecutionFactsV1, validateLifecycleEventDefinition, validateProviderHeaders, validateRetryScheduleV1, } from "./capability-runtime-validation.js";
|
|
13
14
|
import { PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION } from "./lifecycle-catalog.js";
|
|
14
15
|
import { createLifecycleDeliveryQueue } from "./lifecycle-delivery-queue.js";
|
|
@@ -23,6 +24,122 @@ export { validateExecutionFactsV1, validateRetryScheduleV1 } from "./capability-
|
|
|
23
24
|
* clock 缺省恒 0(生产不注入),不能作为耗时来源。
|
|
24
25
|
*/
|
|
25
26
|
const SLOW_EVENT_SUBSCRIBER_WARN_MS = 100;
|
|
27
|
+
/**
|
|
28
|
+
* 超限驻留视图的尾部窗口字节数:超限后驻留视图保留完整流真实末尾这么多字节。
|
|
29
|
+
*/
|
|
30
|
+
const OUTPUT_ARTIFACT_TAIL_BYTES = 64 * 1024;
|
|
31
|
+
const truncationMarkerEncoder = new TextEncoder();
|
|
32
|
+
/**
|
|
33
|
+
* 超限标记文本(ASCII):N 是驻留视图未表示的原始流字节数(十进制)。
|
|
34
|
+
*/
|
|
35
|
+
const encodeTruncationMarker = (omittedBytes) => truncationMarkerEncoder.encode(`\n[agent-forge artifact truncated: ${omittedBytes} bytes omitted]\n`);
|
|
36
|
+
const concatChunks = (chunks, totalBytes) => {
|
|
37
|
+
const bytes = new Uint8Array(totalBytes);
|
|
38
|
+
let offset = 0;
|
|
39
|
+
for (const chunk of chunks) {
|
|
40
|
+
bytes.set(chunk, offset);
|
|
41
|
+
offset += chunk.byteLength;
|
|
42
|
+
}
|
|
43
|
+
return bytes;
|
|
44
|
+
};
|
|
45
|
+
/** 取 chunks 拼接后的前 length 字节(跨 chunk 切片),作为截断视图的 head。 */
|
|
46
|
+
const takeLeadingBytes = (chunks, length) => {
|
|
47
|
+
const taken = [];
|
|
48
|
+
let remaining = length;
|
|
49
|
+
for (const chunk of chunks) {
|
|
50
|
+
if (remaining <= 0)
|
|
51
|
+
break;
|
|
52
|
+
if (chunk.byteLength <= remaining) {
|
|
53
|
+
taken.push(chunk);
|
|
54
|
+
remaining -= chunk.byteLength;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
taken.push(chunk.subarray(0, remaining));
|
|
58
|
+
remaining = 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return taken;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 组装 head + 截断标记 + tail 的驻留视图,总长恰为 OUTPUT_ARTIFACT_MAX_BUFFER_BYTES。
|
|
65
|
+
* 标记展示的省略字节数依赖标记自身的字节长度(head = 上限 − tail − marker),
|
|
66
|
+
* 不动点按字节数收敛(标记长度只在十进制进位处变化),两三轮内稳定。
|
|
67
|
+
*/
|
|
68
|
+
const buildTruncatedView = (headChunks, tailChunks, totalBytes) => {
|
|
69
|
+
const tailBytes = Math.min(OUTPUT_ARTIFACT_TAIL_BYTES, totalBytes);
|
|
70
|
+
let omitted = totalBytes - OUTPUT_ARTIFACT_MAX_BUFFER_BYTES;
|
|
71
|
+
let marker = encodeTruncationMarker(omitted);
|
|
72
|
+
let headLength = OUTPUT_ARTIFACT_MAX_BUFFER_BYTES - tailBytes - marker.byteLength;
|
|
73
|
+
while (totalBytes - headLength - tailBytes !== omitted) {
|
|
74
|
+
omitted = totalBytes - headLength - tailBytes;
|
|
75
|
+
marker = encodeTruncationMarker(omitted);
|
|
76
|
+
headLength = OUTPUT_ARTIFACT_MAX_BUFFER_BYTES - tailBytes - marker.byteLength;
|
|
77
|
+
}
|
|
78
|
+
return concatChunks([...takeLeadingBytes(headChunks, headLength), marker, ...tailChunks], OUTPUT_ARTIFACT_MAX_BUFFER_BYTES);
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* output.put 驻留缓冲(M4 双层限额的缓冲半层):逐字节缓冲直至
|
|
82
|
+
* OUTPUT_ARTIFACT_MAX_BUFFER_BYTES,超限后停止缓冲但仍把 AsyncIterable 完整
|
|
83
|
+
* 消费完——消费端提前返回会把背压和写管道破裂转嫁给上游,语义变化,禁止;
|
|
84
|
+
* 只丢弃数据。尾部窗口始终滑动维持在完整流末尾 OUTPUT_ARTIFACT_TAIL_BYTES。
|
|
85
|
+
* 超限驻留视图 = head + 截断标记 + tail(总长恰为上限);未超限驻留与提交
|
|
86
|
+
* 数据逐字节一致。
|
|
87
|
+
*/
|
|
88
|
+
const bufferOutputArtifactData = async (data, throwIfAborted) => {
|
|
89
|
+
if (data instanceof Uint8Array) {
|
|
90
|
+
if (data.byteLength <= OUTPUT_ARTIFACT_MAX_BUFFER_BYTES) {
|
|
91
|
+
return { bytes: new Uint8Array(data), totalBytes: data.byteLength, truncated: false };
|
|
92
|
+
}
|
|
93
|
+
const tailStart = data.byteLength - OUTPUT_ARTIFACT_TAIL_BYTES;
|
|
94
|
+
return {
|
|
95
|
+
bytes: buildTruncatedView([data], [data.subarray(tailStart)], data.byteLength),
|
|
96
|
+
totalBytes: data.byteLength,
|
|
97
|
+
truncated: true,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const headChunks = [];
|
|
101
|
+
const tailChunks = [];
|
|
102
|
+
let tailBytes = 0;
|
|
103
|
+
let headBytes = 0;
|
|
104
|
+
let totalBytes = 0;
|
|
105
|
+
let truncated = false;
|
|
106
|
+
const appendTail = (chunk) => {
|
|
107
|
+
tailChunks.push(chunk);
|
|
108
|
+
tailBytes += chunk.byteLength;
|
|
109
|
+
while (tailBytes > OUTPUT_ARTIFACT_TAIL_BYTES) {
|
|
110
|
+
const oldest = tailChunks[0];
|
|
111
|
+
const overflow = tailBytes - OUTPUT_ARTIFACT_TAIL_BYTES;
|
|
112
|
+
if (oldest.byteLength <= overflow) {
|
|
113
|
+
tailChunks.shift();
|
|
114
|
+
tailBytes -= oldest.byteLength;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
tailChunks[0] = oldest.subarray(overflow);
|
|
118
|
+
tailBytes -= overflow;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
for await (const chunk of data) {
|
|
123
|
+
throwIfAborted();
|
|
124
|
+
if (!(chunk instanceof Uint8Array)) {
|
|
125
|
+
throw new OutputArtifactError("invalid_ref", "Artifact stream yielded a non-Uint8Array chunk");
|
|
126
|
+
}
|
|
127
|
+
const copy = new Uint8Array(chunk);
|
|
128
|
+
totalBytes += copy.byteLength;
|
|
129
|
+
appendTail(copy);
|
|
130
|
+
if (truncated)
|
|
131
|
+
continue;
|
|
132
|
+
headChunks.push(copy);
|
|
133
|
+
headBytes += copy.byteLength;
|
|
134
|
+
if (headBytes > OUTPUT_ARTIFACT_MAX_BUFFER_BYTES)
|
|
135
|
+
truncated = true;
|
|
136
|
+
}
|
|
137
|
+
throwIfAborted();
|
|
138
|
+
if (!truncated) {
|
|
139
|
+
return { bytes: concatChunks(headChunks, totalBytes), totalBytes, truncated };
|
|
140
|
+
}
|
|
141
|
+
return { bytes: buildTruncatedView(headChunks, tailChunks, totalBytes), totalBytes, truncated: true };
|
|
142
|
+
};
|
|
26
143
|
export function createCapabilityRuntime(inputHost, options = {}) {
|
|
27
144
|
// D-075 S4 third batch: the communication/turnContext host services carry
|
|
28
145
|
// host-owned callbacks. They must ride by reference (like the trace
|
|
@@ -114,7 +231,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
114
231
|
const onOutputArtifactCommit = options.onOutputArtifactCommit;
|
|
115
232
|
const toolExecutionContext = options.toolExecutionContext;
|
|
116
233
|
const state = createCapabilityRuntimeState();
|
|
117
|
-
const { tools, skills, retryPolicies, compactionPolicies, overflowPolicies, branchSummaryPolicies, runLoopStrategies, loopHooks, commands, operations, rpcMethods, contextStrategies, pluginCapabilities, providerHeaderTransforms, streamFnWrappers, contributionPoints, lifecycleDefinitions, lifecycleRegistrations, subscribers, statuses, pluginRegistrations, apiStates, activeOwnerTokens, outputArtifacts, stateByOwner, stateRevisionsByOwner, stateWatchers, stateByInstance, stateRevisionsByInstance, stateWatchersByInstance,
|
|
234
|
+
const { tools, skills, retryPolicies, compactionPolicies, overflowPolicies, branchSummaryPolicies, runLoopStrategies, loopHooks, commands, operations, rpcMethods, contextStrategies, pluginCapabilities, providerHeaderTransforms, streamFnWrappers, contributionPoints, lifecycleDefinitions, lifecycleRegistrations, subscribers, statuses, pluginRegistrations, apiStates, activeOwnerTokens, outputArtifacts, stateByOwner, stateRevisionsByOwner, stateWatchers, stateByInstance, stateRevisionsByInstance, stateWatchersByInstance, spans, lifecycleDeliveryQueues, } = state;
|
|
118
235
|
const runtimeState = state;
|
|
119
236
|
// 契约 A(D-082 批 3b):store 字段保持基础注册结构类型(store 不感知链序),
|
|
120
237
|
// 本运行时经此类型视图写入/读取链序元数据;唯一写入方是 registerStreamFnWrapper
|
|
@@ -338,7 +455,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
338
455
|
...(fields === undefined ? {} : { fields: detachedSnapshot(fields) }),
|
|
339
456
|
...(cause === undefined ? {} : { cause: detachedSnapshot(cause) }),
|
|
340
457
|
};
|
|
341
|
-
|
|
458
|
+
pushRuntimeLog(state, record);
|
|
342
459
|
// 插件日志宿主转发(设计 §7.2):入环后同步转发一次。回调抛错直接吞掉——
|
|
343
460
|
// 与 notifyToolRegistryChange 同守"观察者故障不打断调用方"的边界,但错误
|
|
344
461
|
// 通道不同:不引入无读者的计数,也绝不经 recordLog 再记录(回调契约禁止
|
|
@@ -895,7 +1012,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
895
1012
|
if (!state.active || !activeOwnerTokens.has(ownerToken) || event.owner !== owner)
|
|
896
1013
|
return;
|
|
897
1014
|
if (event.event === "start") {
|
|
898
|
-
|
|
1015
|
+
setOperationStatus(runtimeState, event.operationId, "running");
|
|
899
1016
|
reportOperationStart(event.operationId, event.operationKind, [ownerToken]);
|
|
900
1017
|
}
|
|
901
1018
|
else if (event.event === "step") {
|
|
@@ -904,12 +1021,12 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
904
1021
|
reportOperationStep(event.operationId, event.operationKind, [ownerToken], event.progress, event.step);
|
|
905
1022
|
}
|
|
906
1023
|
else if (event.event === "cancel") {
|
|
907
|
-
|
|
1024
|
+
setOperationStatus(runtimeState, event.operationId, "cancelled");
|
|
908
1025
|
reportOperationCancel(event.operationId, event.operationKind, [ownerToken]);
|
|
909
1026
|
}
|
|
910
1027
|
else {
|
|
911
1028
|
const status = event.status ?? "failed";
|
|
912
|
-
|
|
1029
|
+
setOperationStatus(runtimeState, event.operationId, status);
|
|
913
1030
|
reportOperationEnd(event.operationId, event.operationKind, status, [ownerToken]);
|
|
914
1031
|
}
|
|
915
1032
|
};
|
|
@@ -984,7 +1101,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
984
1101
|
status: "running",
|
|
985
1102
|
attributes: detachedSnapshot(attributes ?? {}),
|
|
986
1103
|
};
|
|
987
|
-
|
|
1104
|
+
setDiagnosticsSpan(runtimeState, spanId, snapshot);
|
|
988
1105
|
let ended = false;
|
|
989
1106
|
const span = {
|
|
990
1107
|
traceId,
|
|
@@ -1091,7 +1208,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1091
1208
|
const sequence = ++operationSequence;
|
|
1092
1209
|
const operationId = createRuntimeId("capability-operation", sequence, `capability:${owner}:${id}@${version}:${sequence}`);
|
|
1093
1210
|
const handle = trackOperation([ownerToken, registered.ownerToken], new RuntimeOperation(operationId, (value, context) => invokePluginCapability(registered, value, context.signal), detachedSnapshot(input), (status) => {
|
|
1094
|
-
|
|
1211
|
+
setOperationStatus(runtimeState, operationId, status);
|
|
1095
1212
|
if (status === "running") {
|
|
1096
1213
|
reportCapabilityCall("start", operationId, owner, registered, [
|
|
1097
1214
|
ownerToken,
|
|
@@ -1105,7 +1222,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1105
1222
|
]);
|
|
1106
1223
|
}
|
|
1107
1224
|
}, (status) => reportCapabilityCall("end", operationId, owner, registered, [ownerToken, registered.ownerToken], status), () => false));
|
|
1108
|
-
|
|
1225
|
+
setOperationStatus(runtimeState, operationId, handle.status());
|
|
1109
1226
|
const signal = callOptions?.signal;
|
|
1110
1227
|
if (signal) {
|
|
1111
1228
|
if (signal.aborted)
|
|
@@ -1258,30 +1375,10 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1258
1375
|
}
|
|
1259
1376
|
};
|
|
1260
1377
|
throwIfAborted();
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
sizeBytes = input.data.byteLength;
|
|
1266
|
-
}
|
|
1267
|
-
else {
|
|
1268
|
-
for await (const chunk of input.data) {
|
|
1269
|
-
throwIfAborted();
|
|
1270
|
-
if (!(chunk instanceof Uint8Array)) {
|
|
1271
|
-
throw new OutputArtifactError("invalid_ref", "Artifact stream yielded a non-Uint8Array chunk");
|
|
1272
|
-
}
|
|
1273
|
-
const copy = new Uint8Array(chunk);
|
|
1274
|
-
chunks.push(copy);
|
|
1275
|
-
sizeBytes += copy.byteLength;
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
throwIfAborted();
|
|
1279
|
-
const bytes = new Uint8Array(sizeBytes);
|
|
1280
|
-
let offset = 0;
|
|
1281
|
-
for (const chunk of chunks) {
|
|
1282
|
-
bytes.set(chunk, offset);
|
|
1283
|
-
offset += chunk.byteLength;
|
|
1284
|
-
}
|
|
1378
|
+
// M4 双层限额:驻留缓冲封顶(形态见 bufferOutputArtifactData)。
|
|
1379
|
+
// sizeBytes/truncated 是运行时计算值——调用方传入的 truncated 只过
|
|
1380
|
+
// 类型校验,其值在组 ref 处被计算值覆盖,不再生效。
|
|
1381
|
+
const { bytes, totalBytes, truncated } = await bufferOutputArtifactData(input.data, throwIfAborted);
|
|
1285
1382
|
// A stream may yield after the plugin has been revoked. Never commit
|
|
1286
1383
|
// bytes after the lifecycle boundary has closed.
|
|
1287
1384
|
assertUsable();
|
|
@@ -1293,16 +1390,20 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1293
1390
|
artifactId,
|
|
1294
1391
|
kind: input.kind,
|
|
1295
1392
|
mediaType: input.mediaType,
|
|
1296
|
-
sizeBytes,
|
|
1297
|
-
truncated
|
|
1393
|
+
sizeBytes: totalBytes,
|
|
1394
|
+
truncated,
|
|
1298
1395
|
createdAt: clock(),
|
|
1299
1396
|
};
|
|
1300
1397
|
outputArtifacts.set(artifactId, { ref, bytes, ownerToken });
|
|
1301
1398
|
// Durable mirroring is a host concern, not a runtime one: the commit
|
|
1302
|
-
// observer receives the
|
|
1303
|
-
//
|
|
1304
|
-
//
|
|
1305
|
-
//
|
|
1399
|
+
// observer receives the resident buffer reachable through stat/read.
|
|
1400
|
+
// That buffer is capped at OUTPUT_ARTIFACT_MAX_BUFFER_BYTES, so for an
|
|
1401
|
+
// oversized artifact the observer intentionally receives the truncated
|
|
1402
|
+
// head+marker+tail view (durable mirrors persist the truncated view)
|
|
1403
|
+
// while ref.sizeBytes keeps the original total. An observer failure is
|
|
1404
|
+
// recorded but never fails the committed artifact, and cleanup/revoke
|
|
1405
|
+
// intentionally do not re-emit (durable records are meant to outlive
|
|
1406
|
+
// the in-memory lifecycle boundary).
|
|
1306
1407
|
if (onOutputArtifactCommit) {
|
|
1307
1408
|
try {
|
|
1308
1409
|
onOutputArtifactCommit({ ref: { ...ref }, bytes });
|
|
@@ -1867,7 +1968,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1867
1968
|
const sequence = ++operationSequence;
|
|
1868
1969
|
const id = createRuntimeId("operation", sequence, `operation:${owner}:${operation}:${sequence}`);
|
|
1869
1970
|
const handle = trackOperation([ownerToken, registered.ownerToken], new RuntimeOperation(id, (value, context) => invokeRegisteredCapability(registered, (handler) => handler(value, context)), input, (status) => {
|
|
1870
|
-
|
|
1971
|
+
setOperationStatus(runtimeState, id, status);
|
|
1871
1972
|
if (status === "running") {
|
|
1872
1973
|
reportOperationStart(id, operation, [ownerToken, registered.ownerToken]);
|
|
1873
1974
|
}
|
|
@@ -1878,7 +1979,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
1878
1979
|
let step = 0;
|
|
1879
1980
|
return (progress) => reportOperationStep(id, operation, [ownerToken, registered.ownerToken], progress, ++step);
|
|
1880
1981
|
})()));
|
|
1881
|
-
|
|
1982
|
+
setOperationStatus(runtimeState, id, handle.status());
|
|
1882
1983
|
const signal = options?.signal;
|
|
1883
1984
|
if (signal) {
|
|
1884
1985
|
if (signal.aborted)
|
|
@@ -2010,6 +2111,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
2010
2111
|
const definition = lifecycleDefinitions.get(lifecycleEventKey(id, version));
|
|
2011
2112
|
return definition !== undefined && activeOwnerTokens.has(definition.ownerToken);
|
|
2012
2113
|
},
|
|
2114
|
+
hasLifecycleSubscribers: (type, version) => (state.lifecycleRegistrations.get(lifecycleEventKey(type, version))?.size ?? 0) > 0,
|
|
2013
2115
|
dispatchLifecycle,
|
|
2014
2116
|
async recordPluginRejection(rejection) {
|
|
2015
2117
|
const detached = Object.freeze({
|
|
@@ -2018,7 +2120,7 @@ export function createCapabilityRuntime(inputHost, options = {}) {
|
|
|
2018
2120
|
...(rejection.pluginId === undefined ? {} : { pluginId: rejection.pluginId }),
|
|
2019
2121
|
message: rejection.message,
|
|
2020
2122
|
});
|
|
2021
|
-
|
|
2123
|
+
pushPluginRejection(state, detached);
|
|
2022
2124
|
const rejectedEventDefinition = lifecycleDefinitions.get(lifecycleEventKey(PLUGIN_REJECTED_EVENT_ID, PLUGIN_REJECTED_EVENT_VERSION));
|
|
2023
2125
|
if (!rejectedEventDefinition || !activeOwnerTokens.has(rejectedEventDefinition.ownerToken)) {
|
|
2024
2126
|
return;
|