@ai-agent-forge/agent-forge 0.88.0 → 0.88.2
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 +73 -0
- package/bundled-plugins/agent-loop-policy/agent-forge.json +19 -0
- package/bundled-plugins/agent-loop-policy/dist/entry.d.ts +28 -0
- package/bundled-plugins/agent-loop-policy/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/agent-loop-policy/dist/entry.js +69 -0
- package/bundled-plugins/agent-loop-policy/dist/entry.js.map +1 -0
- package/bundled-plugins/agent-loop-policy/dist/loop-guard.d.ts +199 -0
- package/bundled-plugins/agent-loop-policy/dist/loop-guard.d.ts.map +1 -0
- package/bundled-plugins/agent-loop-policy/dist/loop-guard.js +208 -0
- package/bundled-plugins/agent-loop-policy/dist/loop-guard.js.map +1 -0
- package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.d.ts +17 -0
- package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.d.ts.map +1 -0
- package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.js +18 -0
- package/bundled-plugins/agent-loop-policy/dist/run-loop-strategy.js.map +1 -0
- package/bundled-plugins/agent-loop-policy/plugin.json +7 -0
- package/bundled-plugins/coding-tools/agent-forge.json +19 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/bash.d.ts +5 -44
- package/bundled-plugins/coding-tools/dist/bash.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/bash.js +15 -119
- package/bundled-plugins/coding-tools/dist/bash.js.map +1 -0
- package/bundled-plugins/coding-tools/dist/capability.d.ts +25 -0
- package/bundled-plugins/coding-tools/dist/capability.d.ts.map +1 -0
- package/bundled-plugins/coding-tools/dist/capability.js +98 -0
- package/bundled-plugins/coding-tools/dist/capability.js.map +1 -0
- package/bundled-plugins/coding-tools/dist/config.d.ts +8 -0
- package/bundled-plugins/coding-tools/dist/config.d.ts.map +1 -0
- package/bundled-plugins/coding-tools/dist/config.js +8 -0
- package/bundled-plugins/coding-tools/dist/config.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/edit.d.ts +3 -3
- package/bundled-plugins/coding-tools/dist/edit.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/edit.js +12 -10
- package/bundled-plugins/coding-tools/dist/edit.js.map +1 -0
- package/bundled-plugins/coding-tools/dist/entry.d.ts +14 -0
- package/bundled-plugins/coding-tools/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/coding-tools/dist/entry.js +23 -0
- package/bundled-plugins/coding-tools/dist/entry.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/find.d.ts +4 -4
- package/bundled-plugins/coding-tools/dist/find.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/find.js +10 -8
- package/bundled-plugins/coding-tools/dist/find.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/grep.d.ts +3 -3
- package/bundled-plugins/coding-tools/dist/grep.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/grep.js +10 -8
- package/bundled-plugins/coding-tools/dist/grep.js.map +1 -0
- package/bundled-plugins/coding-tools/dist/index.d.ts +17 -0
- package/bundled-plugins/coding-tools/dist/index.d.ts.map +1 -0
- package/bundled-plugins/coding-tools/dist/index.js +17 -0
- package/bundled-plugins/coding-tools/dist/index.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.d.ts +3 -3
- package/bundled-plugins/coding-tools/dist/ls.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.js +8 -6
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/ls.js.map +1 -1
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/powershell.d.ts +2 -1
- package/bundled-plugins/coding-tools/dist/powershell.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/powershell.js +6 -3
- package/bundled-plugins/coding-tools/dist/powershell.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/read.d.ts +3 -3
- package/bundled-plugins/coding-tools/dist/read.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/read.js +15 -13
- package/bundled-plugins/coding-tools/dist/read.js.map +1 -0
- package/bundled-plugins/coding-tools/dist/types.d.ts +74 -0
- package/bundled-plugins/coding-tools/dist/types.d.ts.map +1 -0
- package/bundled-plugins/coding-tools/dist/types.js +28 -0
- package/bundled-plugins/coding-tools/dist/types.js.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/write.d.ts +2 -2
- package/bundled-plugins/coding-tools/dist/write.d.ts.map +1 -0
- package/{dist/core/tools → bundled-plugins/coding-tools/dist}/write.js +11 -9
- package/bundled-plugins/coding-tools/dist/write.js.map +1 -0
- package/bundled-plugins/coding-tools/plugin.json +10 -0
- package/bundled-plugins/compaction-policy/agent-forge.json +19 -0
- package/bundled-plugins/compaction-policy/dist/branch-summary-policy.d.ts +6 -0
- package/bundled-plugins/compaction-policy/dist/branch-summary-policy.d.ts.map +1 -0
- package/bundled-plugins/compaction-policy/dist/branch-summary-policy.js +19 -0
- package/bundled-plugins/compaction-policy/dist/branch-summary-policy.js.map +1 -0
- package/bundled-plugins/compaction-policy/dist/compaction-policy.d.ts +6 -0
- package/bundled-plugins/compaction-policy/dist/compaction-policy.d.ts.map +1 -0
- package/bundled-plugins/compaction-policy/dist/compaction-policy.js +38 -0
- package/bundled-plugins/compaction-policy/dist/compaction-policy.js.map +1 -0
- package/bundled-plugins/compaction-policy/dist/entry.d.ts +13 -0
- package/bundled-plugins/compaction-policy/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/compaction-policy/dist/entry.js +23 -0
- package/bundled-plugins/compaction-policy/dist/entry.js.map +1 -0
- package/bundled-plugins/compaction-policy/plugin.json +10 -0
- package/bundled-plugins/mcp-http/dist/index.d.ts +8 -0
- package/bundled-plugins/mcp-http/dist/index.d.ts.map +1 -0
- package/bundled-plugins/mcp-http/dist/index.js +8 -0
- package/bundled-plugins/mcp-http/dist/index.js.map +1 -0
- package/bundled-plugins/mcp-http/dist/mcp-http.d.ts.map +1 -0
- package/{dist/plugins → bundled-plugins/mcp-http/dist}/mcp-http.js +1 -1
- package/bundled-plugins/mcp-http/dist/mcp-http.js.map +1 -0
- package/bundled-plugins/overflow-policy/agent-forge.json +19 -0
- package/bundled-plugins/overflow-policy/dist/entry.d.ts +16 -0
- package/bundled-plugins/overflow-policy/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/overflow-policy/dist/entry.js +35 -0
- package/bundled-plugins/overflow-policy/dist/entry.js.map +1 -0
- package/bundled-plugins/overflow-policy/plugin.json +10 -0
- package/bundled-plugins/provider-failover/agent-forge.json +19 -0
- package/bundled-plugins/provider-failover/dist/entry.d.ts +8 -0
- package/bundled-plugins/provider-failover/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/provider-failover/dist/entry.js +8 -0
- package/bundled-plugins/provider-failover/dist/entry.js.map +1 -0
- package/bundled-plugins/provider-failover/dist/provider-failover.d.ts +122 -0
- package/bundled-plugins/provider-failover/dist/provider-failover.d.ts.map +1 -0
- package/{dist/core/extensions → bundled-plugins/provider-failover/dist}/provider-failover.js +143 -56
- package/bundled-plugins/provider-failover/dist/provider-failover.js.map +1 -0
- package/bundled-plugins/provider-failover/plugin.json +7 -0
- package/bundled-plugins/retry-policy/agent-forge.json +19 -0
- package/bundled-plugins/retry-policy/dist/entry.d.ts +16 -0
- package/bundled-plugins/retry-policy/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/retry-policy/dist/entry.js +34 -0
- package/bundled-plugins/retry-policy/dist/entry.js.map +1 -0
- package/bundled-plugins/retry-policy/plugin.json +10 -0
- package/dist/bundle/.build-manifest.json +109 -155
- package/dist/bundle/chunks/{anthropic-messages-ALDZBUKI.js → anthropic-messages-PLAKXR73.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-A2WJWZFB.js → azure-openai-responses-OUWQ2AZD.js} +1 -1
- package/dist/bundle/chunks/chunk-44I47ACN.js +13 -0
- package/dist/bundle/chunks/chunk-6F5JWGKE.js +4 -0
- package/dist/bundle/chunks/{chunk-CIX3FSBK.js → chunk-A3JYRWB6.js} +1 -1
- package/dist/bundle/chunks/{chunk-SQFG22WN.js → chunk-AC2FIS4G.js} +1 -1
- package/dist/bundle/chunks/chunk-HTC5K5SM.js +866 -0
- package/dist/bundle/chunks/{chunk-YJCQVXW5.js → chunk-HTEVUY7F.js} +1 -1
- package/dist/bundle/chunks/{chunk-Y7HXTASS.js → chunk-HV64ASMT.js} +1 -1
- package/dist/bundle/chunks/chunk-LSP24WNH.js +665 -0
- package/dist/bundle/chunks/{chunk-7ZY7IXZD.js → chunk-TRDNDS6A.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-NIB4WONV.js → google-generative-ai-DLII6DAT.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-DCPYUEUO.js → google-vertex-G7BZL7GM.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +4 -4
- package/dist/bundle/chunks/{mistral-conversations-OC6LA5XL.js → mistral-conversations-JXUK24ID.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-IO2X4Y7L.js → openai-codex-responses-5GSGFIPG.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-XYQQHETU.js → openai-completions-EI2I6DTG.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-DLIRN3CI.js → openai-responses-AUJQ3NWT.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-E6RRYBO7.js → pi-messages-PWU2VJMR.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-MRXD3RWG.js +5 -0
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/client.js +1 -1
- package/dist/bundle/index.js +3 -3
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/capabilities/builtin.d.ts +1 -1
- package/dist/capabilities/builtin.d.ts.map +1 -1
- package/dist/capabilities/builtin.js +5 -0
- package/dist/capabilities/builtin.js.map +1 -1
- package/dist/cli/plugin-command.d.ts.map +1 -1
- package/dist/cli/plugin-command.js +25 -3
- package/dist/cli/plugin-command.js.map +1 -1
- package/dist/config.d.ts +2 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-bash.d.ts +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-bash.js +1 -1
- package/dist/core/agent-session-bash.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +14 -1
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-internal.d.ts +3 -1
- package/dist/core/agent-session-internal.d.ts.map +1 -1
- package/dist/core/agent-session-internal.js.map +1 -1
- package/dist/core/agent-session-loop.d.ts +4 -3
- package/dist/core/agent-session-loop.d.ts.map +1 -1
- package/dist/core/agent-session-loop.js +9 -6
- package/dist/core/agent-session-loop.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +32 -3
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +31 -9
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-store.d.ts.map +1 -1
- package/dist/core/agent-session-store.js +6 -1
- package/dist/core/agent-session-store.js.map +1 -1
- package/dist/core/agent-session-tools.d.ts.map +1 -1
- package/dist/core/agent-session-tools.js +18 -1
- package/dist/core/agent-session-tools.js.map +1 -1
- package/dist/core/agent-session.d.ts +34 -11
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +114 -38
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/extensions/bootstrap-agent-loop.d.ts +23 -151
- package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -1
- package/dist/core/extensions/bootstrap-agent-loop.js +28 -290
- package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -1
- package/dist/core/extensions/capability-runtime-types.d.ts +5 -3
- package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -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 +42 -6
- package/dist/core/extensions/capability-runtime.js.map +1 -1
- package/dist/core/extensions/index.d.ts +12 -5
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +12 -5
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +65 -0
- 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.map +1 -1
- package/dist/core/i18n/locales/zh-cn/cli.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/cli.js +2 -0
- package/dist/core/i18n/locales/zh-cn/cli.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-core.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-core.js +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-core.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.js +2 -4
- package/dist/core/i18n/locales/zh-cn/core-contract-extensions.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 +3 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/index.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/index.js +2 -0
- package/dist/core/i18n/locales/zh-cn/index.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js +5 -0
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/session-cleanup.d.ts +7 -0
- package/dist/core/i18n/locales/zh-cn/session-cleanup.d.ts.map +1 -0
- package/dist/core/i18n/locales/zh-cn/session-cleanup.js +15 -0
- package/dist/core/i18n/locales/zh-cn/session-cleanup.js.map +1 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/slash-commands.js +1 -0
- package/dist/core/i18n/locales/zh-cn/slash-commands.js.map +1 -1
- package/dist/core/sdk.d.ts +10 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +287 -78
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cleanup.d.ts +49 -0
- package/dist/core/session-cleanup.d.ts.map +1 -0
- package/dist/core/session-cleanup.js +159 -0
- package/dist/core/session-cleanup.js.map +1 -0
- package/dist/core/session-index.d.ts +75 -0
- package/dist/core/session-index.d.ts.map +1 -0
- package/dist/core/session-index.js +455 -0
- package/dist/core/session-index.js.map +1 -0
- package/dist/core/session-manager.d.ts +9 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +202 -47
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +5 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +12 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash-operations.d.ts +41 -0
- package/dist/core/tools/bash-operations.d.ts.map +1 -0
- package/dist/core/tools/bash-operations.js +113 -0
- package/dist/core/tools/bash-operations.js.map +1 -0
- package/dist/core/tools/capability-mount.d.ts +40 -0
- package/dist/core/tools/capability-mount.d.ts.map +1 -0
- package/dist/core/tools/capability-mount.js +112 -0
- package/dist/core/tools/capability-mount.js.map +1 -0
- package/dist/core/tools/index.d.ts +12 -36
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -117
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/readme-path.d.ts +3 -0
- package/dist/core/tools/readme-path.d.ts.map +1 -0
- package/dist/core/tools/readme-path.js +15 -0
- package/dist/core/tools/readme-path.js.map +1 -0
- package/dist/index.d.ts +3 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -39
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/main.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 +27 -5
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +5 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +9 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +17 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +52 -25
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-run-group.d.ts +44 -0
- package/dist/modes/interactive/components/tool-run-group.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-run-group.js +121 -0
- package/dist/modes/interactive/components/tool-run-group.js.map +1 -0
- package/dist/modes/interactive/interactive-commands.d.ts +2 -0
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-commands.js +7 -0
- package/dist/modes/interactive/interactive-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +18 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +85 -3
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/plugins/ecosystem/cli.d.ts.map +1 -1
- package/dist/plugins/ecosystem/cli.js +20 -5
- package/dist/plugins/ecosystem/cli.js.map +1 -1
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts +7 -2
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-npm-registry-source.js +64 -9
- package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js +6 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts +7 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js +50 -3
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -1
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts +28 -16
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts.map +1 -1
- package/dist/plugins/ecosystem/plugin-bootstrap.js +35 -33
- package/dist/plugins/ecosystem/plugin-bootstrap.js.map +1 -1
- package/dist/profile/plugin-profiles.d.ts +1 -1
- package/dist/profile/plugin-profiles.d.ts.map +1 -1
- package/dist/profile/plugin-profiles.js +18 -0
- package/dist/profile/plugin-profiles.js.map +1 -1
- package/dist/profiles/builtin-suites.d.ts +19 -5
- package/dist/profiles/builtin-suites.d.ts.map +1 -1
- package/dist/profiles/builtin-suites.js +26 -6
- package/dist/profiles/builtin-suites.js.map +1 -1
- package/docs/settings.md +354 -354
- package/docs/usage.md +292 -292
- package/examples/extensions/bash-spawn-hook/index.ts +7 -2
- package/examples/extensions/built-in-tool-renderer/index.ts +4 -2
- package/examples/extensions/minimal-mode/index.ts +2 -2
- package/examples/extensions/truncated-tool/index.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/with-deps/plugin.json +1 -1
- package/package.json +3 -2
- package/dist/bundle/chunks/chunk-6ZKDNZHA.js +0 -145
- package/dist/bundle/chunks/chunk-HLJEVRWP.js +0 -13
- package/dist/bundle/chunks/chunk-YGHQME4V.js +0 -1456
- package/dist/bundle/chunks/virtual-modules-KZ5DRH7Q.js +0 -2
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts +0 -7
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts.map +0 -1
- package/dist/core/extensions/bootstrap-branch-summary-policy.js +0 -28
- package/dist/core/extensions/bootstrap-branch-summary-policy.js.map +0 -1
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts +0 -7
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts.map +0 -1
- package/dist/core/extensions/bootstrap-compaction-policy.js +0 -48
- package/dist/core/extensions/bootstrap-compaction-policy.js.map +0 -1
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts +0 -7
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +0 -1
- package/dist/core/extensions/bootstrap-overflow-policy.js +0 -30
- package/dist/core/extensions/bootstrap-overflow-policy.js.map +0 -1
- package/dist/core/extensions/bootstrap-retry-policy.d.ts +0 -7
- package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +0 -1
- package/dist/core/extensions/bootstrap-retry-policy.js +0 -29
- package/dist/core/extensions/bootstrap-retry-policy.js.map +0 -1
- package/dist/core/extensions/bootstrap-tools.d.ts +0 -20
- package/dist/core/extensions/bootstrap-tools.d.ts.map +0 -1
- package/dist/core/extensions/bootstrap-tools.js +0 -36
- package/dist/core/extensions/bootstrap-tools.js.map +0 -1
- package/dist/core/extensions/provider-failover.d.ts +0 -110
- package/dist/core/extensions/provider-failover.d.ts.map +0 -1
- package/dist/core/extensions/provider-failover.js.map +0 -1
- package/dist/core/tools/bash.d.ts.map +0 -1
- package/dist/core/tools/bash.js.map +0 -1
- package/dist/core/tools/edit.d.ts.map +0 -1
- package/dist/core/tools/edit.js.map +0 -1
- package/dist/core/tools/find.d.ts.map +0 -1
- package/dist/core/tools/find.js.map +0 -1
- package/dist/core/tools/grep.d.ts.map +0 -1
- package/dist/core/tools/grep.js.map +0 -1
- package/dist/core/tools/ls.d.ts.map +0 -1
- package/dist/core/tools/powershell.d.ts.map +0 -1
- package/dist/core/tools/powershell.js.map +0 -1
- package/dist/core/tools/read.d.ts.map +0 -1
- package/dist/core/tools/read.js.map +0 -1
- package/dist/core/tools/write.d.ts.map +0 -1
- package/dist/core/tools/write.js.map +0 -1
- package/dist/plugins/mcp-http.d.ts.map +0 -1
- package/dist/plugins/mcp-http.js.map +0 -1
- package/dist/profile/child-facade.d.ts +0 -44
- package/dist/profile/child-facade.d.ts.map +0 -1
- package/dist/profile/child-facade.js +0 -56
- package/dist/profile/child-facade.js.map +0 -1
- package/dist/profile/dependency-wiring.d.ts +0 -48
- package/dist/profile/dependency-wiring.d.ts.map +0 -1
- package/dist/profile/dependency-wiring.js +0 -56
- package/dist/profile/dependency-wiring.js.map +0 -1
- package/dist/profile/domain-recovery.d.ts +0 -60
- package/dist/profile/domain-recovery.d.ts.map +0 -1
- package/dist/profile/domain-recovery.js +0 -94
- package/dist/profile/domain-recovery.js.map +0 -1
- package/dist/profile/first-roles.d.ts +0 -30
- package/dist/profile/first-roles.d.ts.map +0 -1
- package/dist/profile/first-roles.js +0 -83
- package/dist/profile/first-roles.js.map +0 -1
- package/dist/profile/goal-plugin.d.ts +0 -38
- package/dist/profile/goal-plugin.d.ts.map +0 -1
- package/dist/profile/goal-plugin.js +0 -132
- package/dist/profile/goal-plugin.js.map +0 -1
- package/dist/profile/plan-plugin.d.ts +0 -44
- package/dist/profile/plan-plugin.d.ts.map +0 -1
- package/dist/profile/plan-plugin.js +0 -157
- package/dist/profile/plan-plugin.js.map +0 -1
- package/dist/profile/policy-manifest.d.ts +0 -53
- package/dist/profile/policy-manifest.d.ts.map +0 -1
- package/dist/profile/policy-manifest.js +0 -53
- package/dist/profile/policy-manifest.js.map +0 -1
- package/dist/profile/role-assembly.d.ts +0 -47
- package/dist/profile/role-assembly.d.ts.map +0 -1
- package/dist/profile/role-assembly.js +0 -31
- package/dist/profile/role-assembly.js.map +0 -1
- package/dist/profile/role-catalog.d.ts +0 -43
- package/dist/profile/role-catalog.d.ts.map +0 -1
- package/dist/profile/role-catalog.js +0 -132
- package/dist/profile/role-catalog.js.map +0 -1
- package/dist/profile/role-orchestrator.d.ts +0 -123
- package/dist/profile/role-orchestrator.d.ts.map +0 -1
- package/dist/profile/role-orchestrator.js +0 -195
- package/dist/profile/role-orchestrator.js.map +0 -1
- package/dist/profile/role-runner.d.ts +0 -99
- package/dist/profile/role-runner.d.ts.map +0 -1
- package/dist/profile/role-runner.js +0 -79
- package/dist/profile/role-runner.js.map +0 -1
- package/dist/profile/root-facade.d.ts +0 -36
- package/dist/profile/root-facade.d.ts.map +0 -1
- package/dist/profile/root-facade.js +0 -49
- package/dist/profile/root-facade.js.map +0 -1
- package/dist/profile/skill-discovery-wiring.d.ts +0 -58
- package/dist/profile/skill-discovery-wiring.d.ts.map +0 -1
- package/dist/profile/skill-discovery-wiring.js +0 -80
- package/dist/profile/skill-discovery-wiring.js.map +0 -1
- package/dist/profile/state-store.d.ts +0 -62
- package/dist/profile/state-store.d.ts.map +0 -1
- package/dist/profile/state-store.js +0 -144
- package/dist/profile/state-store.js.map +0 -1
- package/dist/profile/todo-plugin.d.ts +0 -37
- package/dist/profile/todo-plugin.d.ts.map +0 -1
- package/dist/profile/todo-plugin.js +0 -137
- package/dist/profile/todo-plugin.js.map +0 -1
- package/examples/extensions/mcp-stdio/index.d.ts +0 -64
- package/examples/extensions/mcp-stdio/index.d.ts.map +0 -1
- package/examples/extensions/mcp-stdio/index.js +0 -292
- package/examples/extensions/mcp-stdio/index.js.map +0 -1
- /package/{dist/plugins → bundled-plugins/mcp-http/dist}/mcp-http.d.ts +0 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* Modes use this class and add their own I/O layer on top.
|
|
14
14
|
*/
|
|
15
15
|
import { readFileSync } from "node:fs";
|
|
16
|
+
import { readFile as readFileUtf8 } from "node:fs/promises";
|
|
16
17
|
import { resolve } from "node:path";
|
|
17
18
|
import { contentText } from "@agent-forge/ai";
|
|
18
19
|
import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels, streamSimple, } from "@agent-forge/ai/compat";
|
|
@@ -32,10 +33,11 @@ import { getAllTools, getCapabilitySkills, getToolDefinition, normalizePromptGui
|
|
|
32
33
|
import { formatNoApiKeyFoundMessage, formatNoModelSelectedMessage } from "./auth-guidance.js";
|
|
33
34
|
import { THINKING_LEVEL_OPTIONS } from "./defaults.js";
|
|
34
35
|
import { definitionSnapshot, detachedSnapshot } from "./extensions/capability-runtime-snapshot.js";
|
|
35
|
-
import { BOOTSTRAP_AGENT_LOOP_PLUGIN_ID,
|
|
36
|
+
import { BOOTSTRAP_AGENT_LOOP_PLUGIN_ID, BOOTSTRAP_LIFECYCLE_PLUGIN_ID, BOOTSTRAP_SKILLS_PLUGIN_ID, createCapabilityRuntime, DEFAULT_BRANCH_SUMMARY_POLICY_NAME, DEFAULT_COMPACTION_POLICY_NAME, DEFAULT_OVERFLOW_POLICY_NAME, DEFAULT_RETRY_POLICY_NAME, DEFAULT_RUN_LOOP_STRATEGY_NAME, EXPERIMENTAL_PUBLIC_API_VERSION, installBootstrapAgentLoop, installBootstrapLifecycle, installSessionBootstrapSkills, loadCapabilityPluginFromManifest, loadCapabilityPlugin as loadCapabilityPluginRuntime, } from "./extensions/index.js";
|
|
36
37
|
import { t } from "./i18n/index.js";
|
|
37
38
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
38
39
|
import { createSessionJsonlArtifact } from "./session-export.js";
|
|
40
|
+
import { createCapabilityMountTools } from "./tools/capability-mount.js";
|
|
39
41
|
import { createToolSearchTool } from "./tools/tool-search.js";
|
|
40
42
|
/**
|
|
41
43
|
* Parse a skill block from message text.
|
|
@@ -151,6 +153,8 @@ export class AgentSession {
|
|
|
151
153
|
_resourceLoader;
|
|
152
154
|
_customTools;
|
|
153
155
|
_deferredToolPluginIds;
|
|
156
|
+
_deferredCapabilityCards = [];
|
|
157
|
+
_capabilityMountToolsRegistered = false;
|
|
154
158
|
/** Abort reason supplied to the in-flight abort(); consumed by the interruption marker. */
|
|
155
159
|
_pendingAbortReason;
|
|
156
160
|
/** Set when the in-flight prompt run produced an aborted terminal assistant turn. */
|
|
@@ -174,7 +178,6 @@ export class AgentSession {
|
|
|
174
178
|
for (const listener of [...this._outputArtifactCommitListeners])
|
|
175
179
|
listener(artifact);
|
|
176
180
|
};
|
|
177
|
-
_bootstrapToolsHandle;
|
|
178
181
|
_bootstrapSkillsHandle;
|
|
179
182
|
_bootstrapRetryHandle;
|
|
180
183
|
_bootstrapCompactionHandle;
|
|
@@ -184,6 +187,12 @@ export class AgentSession {
|
|
|
184
187
|
_bootstrapLifecycleHandle;
|
|
185
188
|
_capabilityPlugins = new Map();
|
|
186
189
|
_inlineCapabilityPlugins = new Map();
|
|
190
|
+
/**
|
|
191
|
+
* 宿主装配链经 loadCapabilityPluginManifest 声明的 configOverride(按解析后
|
|
192
|
+
* manifest 路径)。reload 重装载循环据此回放 sdk 注入的会话事实(D-082 批 1:
|
|
193
|
+
* coding-tools 的 cwd/read/bash 等),会话生命周期内随同路径显式装载覆盖。
|
|
194
|
+
*/
|
|
195
|
+
_capabilityPluginConfigOverrides = new Map();
|
|
187
196
|
_isDisposingCapabilityPlugins = false;
|
|
188
197
|
/**
|
|
189
198
|
* 工具表变更钩子的两道门(见 _buildRuntime 的 onToolRegistryChange):
|
|
@@ -204,7 +213,6 @@ export class AgentSession {
|
|
|
204
213
|
_allowedToolNames;
|
|
205
214
|
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: read and written via the agent-session-* submodule facade
|
|
206
215
|
_excludedToolNames;
|
|
207
|
-
_baseToolsOverride;
|
|
208
216
|
_disabledBootstrapPlugins;
|
|
209
217
|
_sessionStartEvent;
|
|
210
218
|
_capabilityMode;
|
|
@@ -279,6 +287,7 @@ export class AgentSession {
|
|
|
279
287
|
this._resourceLoader = config.resourceLoader;
|
|
280
288
|
this._customTools = config.customTools ?? [];
|
|
281
289
|
this._deferredToolPluginIds = new Set(config.deferredToolPluginIds ?? []);
|
|
290
|
+
this._deferredCapabilityCards = [...(config.deferredCapabilityCards ?? [])];
|
|
282
291
|
if (this._deferredToolPluginIds.size > 0) {
|
|
283
292
|
this._customTools.push(createToolSearchTool({
|
|
284
293
|
listAllToolNames: () => Array.from(this._toolRegistry.keys()),
|
|
@@ -290,12 +299,15 @@ export class AgentSession {
|
|
|
290
299
|
setActiveToolsByName: (toolNames) => this.setActiveToolsByName(toolNames),
|
|
291
300
|
}));
|
|
292
301
|
}
|
|
302
|
+
if (this._deferredCapabilityCards.length > 0) {
|
|
303
|
+
this._capabilityMountToolsRegistered = true;
|
|
304
|
+
this._customTools.push(...this._createCapabilityMountTools());
|
|
305
|
+
}
|
|
293
306
|
this._cwd = config.cwd;
|
|
294
307
|
this._modelRuntime = config.modelRuntime;
|
|
295
308
|
this._initialActiveToolNames = config.initialActiveToolNames;
|
|
296
309
|
this._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;
|
|
297
310
|
this._excludedToolNames = config.excludedToolNames ? new Set(config.excludedToolNames) : undefined;
|
|
298
|
-
this._baseToolsOverride = config.baseToolsOverride;
|
|
299
311
|
this._disabledBootstrapPlugins = config.disabledBootstrapPlugins;
|
|
300
312
|
this._sessionStartEvent = config.sessionStartEvent ?? { reason: "startup" };
|
|
301
313
|
this._capabilityMode = config.capabilityMode ?? "full-control";
|
|
@@ -660,7 +672,6 @@ export class AgentSession {
|
|
|
660
672
|
const interactionHost = this._interactionHost;
|
|
661
673
|
return interactionHost?.dispose?.();
|
|
662
674
|
},
|
|
663
|
-
() => this._bootstrapToolsHandle?.dispose(),
|
|
664
675
|
() => this._bootstrapSkillsHandle?.dispose(),
|
|
665
676
|
() => this._bootstrapRetryHandle?.dispose(),
|
|
666
677
|
() => this._bootstrapCompactionHandle?.dispose(),
|
|
@@ -680,7 +691,6 @@ export class AgentSession {
|
|
|
680
691
|
this._capabilityRuntime?.revokeAllAPIs();
|
|
681
692
|
this._capabilityPlugins.clear();
|
|
682
693
|
this._inlineCapabilityPlugins.clear();
|
|
683
|
-
this._bootstrapToolsHandle = undefined;
|
|
684
694
|
this._bootstrapSkillsHandle = undefined;
|
|
685
695
|
this._bootstrapRetryHandle = undefined;
|
|
686
696
|
this._bootstrapCompactionHandle = undefined;
|
|
@@ -879,7 +889,6 @@ export class AgentSession {
|
|
|
879
889
|
getCapabilityPlugins() {
|
|
880
890
|
const handles = Array.from(this._capabilityPlugins.values());
|
|
881
891
|
for (const handle of [
|
|
882
|
-
this._bootstrapToolsHandle,
|
|
883
892
|
this._bootstrapSkillsHandle,
|
|
884
893
|
this._bootstrapRetryHandle,
|
|
885
894
|
this._bootstrapCompactionHandle,
|
|
@@ -1010,10 +1019,11 @@ export class AgentSession {
|
|
|
1010
1019
|
(!tool.source.startsWith("agent-forge.builtin.") && !tool.source.startsWith("agent-forge.plugin.")) ||
|
|
1011
1020
|
tool.readonlySafe === true)
|
|
1012
1021
|
// Deferred plugin tools register but stay out of the active set on
|
|
1013
|
-
// this explicit-activation path too, until tool_search
|
|
1014
|
-
// setActiveTools names them (same contract as the
|
|
1015
|
-
// agent-session-tools.ts).
|
|
1016
|
-
.filter((tool) => !this._deferredToolPluginIds.has(tool.source)
|
|
1022
|
+
// this explicit-activation path too, until tool_search /
|
|
1023
|
+
// capability_mount or setActiveTools names them (same contract as the
|
|
1024
|
+
// default path in agent-session-tools.ts).
|
|
1025
|
+
.filter((tool) => !this._deferredToolPluginIds.has(tool.source) &&
|
|
1026
|
+
!this._deferredCapabilityCards.some((card) => card.pluginId === tool.source))
|
|
1017
1027
|
.map((tool) => tool.name)
|
|
1018
1028
|
.filter((name) => !previousToolNames.has(name));
|
|
1019
1029
|
this._refreshToolRegistry({
|
|
@@ -1031,6 +1041,13 @@ export class AgentSession {
|
|
|
1031
1041
|
if (this._capabilityPlugins.has(resolvedManifestPath)) {
|
|
1032
1042
|
throw new Error(t("Capability plugin manifest is already loaded: {path}", { path: resolvedManifestPath }));
|
|
1033
1043
|
}
|
|
1044
|
+
// 宿主装配声明的 configOverride 按路径记录(D-082 批 1):sdk 装配链注入的
|
|
1045
|
+
// 会话事实(coding-tools 的 cwd/read/bash 等)在 reload 重装载时经此回放,
|
|
1046
|
+
// 否则插件会退回 manifest 缺省值(cwd 缺失即退回 process.cwd())。同路径的
|
|
1047
|
+
// 后续显式装载覆盖旧值。
|
|
1048
|
+
if (options?.configOverride !== undefined) {
|
|
1049
|
+
this._capabilityPluginConfigOverrides.set(resolvedManifestPath, options.configOverride);
|
|
1050
|
+
}
|
|
1034
1051
|
const previousToolNames = new Set(runtime.listTools().map((tool) => tool.name));
|
|
1035
1052
|
const loaded = await loadCapabilityPluginFromManifest(runtime, resolvedManifestPath, options);
|
|
1036
1053
|
return this._trackCapabilityPlugin(resolvedManifestPath, loaded, previousToolNames);
|
|
@@ -2035,6 +2052,50 @@ export class AgentSession {
|
|
|
2035
2052
|
_refreshToolRegistry(options) {
|
|
2036
2053
|
refreshToolRegistry(this._internal, options);
|
|
2037
2054
|
}
|
|
2055
|
+
/** Registry tool names whose owning capability plugin is `pluginId`. */
|
|
2056
|
+
_toolNamesForPlugin(pluginId) {
|
|
2057
|
+
return Array.from(this._toolDefinitions.entries())
|
|
2058
|
+
.filter(([, entry]) => entry.sourceInfo.source === pluginId)
|
|
2059
|
+
.map(([name]) => name);
|
|
2060
|
+
}
|
|
2061
|
+
_readManual(manualPath) {
|
|
2062
|
+
return readFileUtf8(manualPath, "utf8");
|
|
2063
|
+
}
|
|
2064
|
+
_createCapabilityMountTools() {
|
|
2065
|
+
return createCapabilityMountTools({
|
|
2066
|
+
getCards: () => this._deferredCapabilityCards,
|
|
2067
|
+
toolNamesForPlugin: (pluginId) => {
|
|
2068
|
+
const names = this._toolNamesForPlugin(pluginId);
|
|
2069
|
+
// readonly narrowing (宪法 §6): the registry keeps non-readonlySafe
|
|
2070
|
+
// tools even in readonly sessions (the normal load path filters them
|
|
2071
|
+
// at activation); mount must not smuggle them past that gate.
|
|
2072
|
+
if (this._capabilityMode !== "readonly")
|
|
2073
|
+
return names;
|
|
2074
|
+
const readonlySafe = new Set((this._capabilityRuntime?.listTools() ?? [])
|
|
2075
|
+
.filter((tool) => tool.source === pluginId)
|
|
2076
|
+
.filter((tool) => tool.readonlySafe === true)
|
|
2077
|
+
.map((tool) => tool.name));
|
|
2078
|
+
return names.filter((name) => readonlySafe.has(name));
|
|
2079
|
+
},
|
|
2080
|
+
getActiveToolNames: () => this.getActiveToolNames(),
|
|
2081
|
+
setActiveToolsByName: (toolNames) => this.setActiveToolsByName(toolNames),
|
|
2082
|
+
readManual: (manualPath) => this._readManual(manualPath),
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
/**
|
|
2086
|
+
* Register on-demand capability cards after construction (插件按需挂载与能力手册设计 §4).
|
|
2087
|
+
* The sdk assembly calls this once the plugin pool settles, before loading;
|
|
2088
|
+
* first call also injects the capability_mount / capability_unmount pair.
|
|
2089
|
+
* Idempotent: later calls replace the card set.
|
|
2090
|
+
*/
|
|
2091
|
+
registerDeferredCapabilityCards(cards) {
|
|
2092
|
+
this._deferredCapabilityCards = [...cards];
|
|
2093
|
+
if (this._deferredCapabilityCards.length === 0 || this._capabilityMountToolsRegistered)
|
|
2094
|
+
return;
|
|
2095
|
+
this._capabilityMountToolsRegistered = true;
|
|
2096
|
+
this._customTools.push(...this._createCapabilityMountTools());
|
|
2097
|
+
this._refreshToolRegistry();
|
|
2098
|
+
}
|
|
2038
2099
|
_syncCapabilityTools() {
|
|
2039
2100
|
syncCapabilityTools(this._internal);
|
|
2040
2101
|
}
|
|
@@ -2109,9 +2170,6 @@ export class AgentSession {
|
|
|
2109
2170
|
// 对齐 context transition 控制器的替换模式:runtime 重建时刷新 parent
|
|
2110
2171
|
// 取消栅栏,防止 reload 后新 runtime 的任务绑到旧 spent 信号被立即取消。
|
|
2111
2172
|
this._agentTaskScopeAbortController = new AbortController();
|
|
2112
|
-
const autoResizeImages = this.settingsManager.getImageAutoResize();
|
|
2113
|
-
const shellCommandPrefix = this.settingsManager.getShellCommandPrefix();
|
|
2114
|
-
const shellPath = this.settingsManager.getShellPath();
|
|
2115
2173
|
this._capabilityRuntime = createCapabilityRuntime({
|
|
2116
2174
|
apiVersion: EXPERIMENTAL_PUBLIC_API_VERSION,
|
|
2117
2175
|
mode: this._capabilityMode,
|
|
@@ -2132,6 +2190,27 @@ export class AgentSession {
|
|
|
2132
2190
|
// The session working directory rides the public HostCapabilities as a host
|
|
2133
2191
|
// service so workspace-bound plugins (LSP real host) resolve their adapters.
|
|
2134
2192
|
workspaceDirectory: this._cwd,
|
|
2193
|
+
// 模型目录宿主服务(D-082 批 3b,契约 B):provider-failover 装载预检/
|
|
2194
|
+
// 目录快照读面(api.host.modelCatalog)。全部是 ModelRuntime 静态目录
|
|
2195
|
+
// 与凭据条目的即时读投影,零网络、零 OAuth;resolveModel 返回结构视图
|
|
2196
|
+
// (provider/contextWindow/maxTokens/compat/thinkingLevelMap 五字段),
|
|
2197
|
+
// 不透出内部 Model 对象,未知 provider/model 对返回 undefined。
|
|
2198
|
+
modelCatalog: {
|
|
2199
|
+
resolveModel: (provider, modelId) => {
|
|
2200
|
+
const model = this._modelRuntime.getModel(provider, modelId);
|
|
2201
|
+
if (!model)
|
|
2202
|
+
return undefined;
|
|
2203
|
+
return {
|
|
2204
|
+
provider: model.provider,
|
|
2205
|
+
contextWindow: model.contextWindow,
|
|
2206
|
+
maxTokens: model.maxTokens,
|
|
2207
|
+
...(model.compat === undefined ? {} : { compat: model.compat }),
|
|
2208
|
+
...(model.thinkingLevelMap === undefined ? {} : { thinkingLevelMap: model.thinkingLevelMap }),
|
|
2209
|
+
};
|
|
2210
|
+
},
|
|
2211
|
+
hasProvider: (providerId) => this._modelRuntime.getProvider(providerId) !== undefined,
|
|
2212
|
+
hasConfiguredAuth: (providerId) => this._modelRuntime.hasConfiguredAuth(providerId),
|
|
2213
|
+
},
|
|
2135
2214
|
features: [
|
|
2136
2215
|
"tools",
|
|
2137
2216
|
"skills",
|
|
@@ -2321,22 +2400,20 @@ export class AgentSession {
|
|
|
2321
2400
|
};
|
|
2322
2401
|
installBootstrap(BOOTSTRAP_LIFECYCLE_PLUGIN_ID, () => installBootstrapLifecycle(capabilityRuntime));
|
|
2323
2402
|
installBootstrap(BOOTSTRAP_AGENT_LOOP_PLUGIN_ID, () => installBootstrapAgentLoop(capabilityRuntime, this._createLoopWiring()));
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
}
|
|
2329
|
-
|
|
2403
|
+
// 默认编码工具不再由内嵌 bootstrap-tools 注册(D-082 批 1,S6 工具批):
|
|
2404
|
+
// 实现体迁出为 plugins/coding-tools 独立包,sdk 装配链经 bundled 分发通道
|
|
2405
|
+
// (manifest/jiti)装载,禁用面平移到 options.disabledPluginIds。
|
|
2406
|
+
// 默认策略家族(retry / overflow / compaction / branch summary)自 D-082
|
|
2407
|
+
// 批 3 起不再内嵌安装:实现体迁出为 plugins/{retry,overflow,compaction}-policy
|
|
2408
|
+
// 独立包(branch summary 随 compaction 包),sdk 装配链经 bundled 分发通道
|
|
2409
|
+
// (manifest/jiti)装载,禁用面平移到 options.disabledPluginIds;四个缺省
|
|
2410
|
+
// 策略名(DEFAULT_*_POLICY_NAME)仍由宿主持有。
|
|
2330
2411
|
installBootstrap(BOOTSTRAP_SKILLS_PLUGIN_ID, () => {
|
|
2331
2412
|
// refreshBootstrapSkills keys off this handle to decide refresh vs
|
|
2332
2413
|
// install; dropping it would double-install on the first refresh.
|
|
2333
2414
|
this._bootstrapSkillsHandle = installSessionBootstrapSkills(capabilityRuntime, this._resourceLoader.getSkills().skills);
|
|
2334
2415
|
return this._bootstrapSkillsHandle;
|
|
2335
2416
|
});
|
|
2336
|
-
installBootstrap(BOOTSTRAP_RETRY_PLUGIN_ID, () => installBootstrapRetryPolicy(capabilityRuntime));
|
|
2337
|
-
installBootstrap(BOOTSTRAP_OVERFLOW_PLUGIN_ID, () => installBootstrapOverflowPolicy(capabilityRuntime));
|
|
2338
|
-
installBootstrap(BOOTSTRAP_COMPACTION_PLUGIN_ID, () => installBootstrapCompactionPolicy(capabilityRuntime));
|
|
2339
|
-
installBootstrap(BOOTSTRAP_BRANCH_SUMMARY_PLUGIN_ID, () => installBootstrapBranchSummaryPolicy(capabilityRuntime));
|
|
2340
2417
|
// The embedded builtin capability channel (方案系统 M3) is retired: the
|
|
2341
2418
|
// last embedded capability (memory) moved to its own package in D-075
|
|
2342
2419
|
// S4 fourth batch, so every suite capability now assembles through the
|
|
@@ -2362,17 +2439,15 @@ export class AgentSession {
|
|
|
2362
2439
|
!tool.source.startsWith("agent-forge.plugin.") ||
|
|
2363
2440
|
tool.readonlySafe === true)
|
|
2364
2441
|
.map((tool) => tool.name);
|
|
2365
|
-
const defaultActiveToolNames = this.
|
|
2366
|
-
?
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
.map((tool) => tool.name)
|
|
2375
|
-
: ["read", "bash", "edit", "write"];
|
|
2442
|
+
const defaultActiveToolNames = this._capabilityMode === "readonly"
|
|
2443
|
+
? // Derive from declarations: the readonly install path registers
|
|
2444
|
+
// exactly the declared-safe definitions, so the kernel carries no
|
|
2445
|
+
// per-tool name knowledge for the readonly face.
|
|
2446
|
+
this._capabilityRuntime
|
|
2447
|
+
.listTools()
|
|
2448
|
+
.filter((tool) => tool.readonlySafe)
|
|
2449
|
+
.map((tool) => tool.name)
|
|
2450
|
+
: ["read", "bash", "edit", "write"];
|
|
2376
2451
|
// Builtin capability tools join the active surface like externally
|
|
2377
2452
|
// loaded plugin tools do (_trackCapabilityPlugin); the allowlist /
|
|
2378
2453
|
// denylist filters below still gate them.
|
|
@@ -2414,8 +2489,6 @@ export class AgentSession {
|
|
|
2414
2489
|
await agentTaskAdapter?.dispose?.();
|
|
2415
2490
|
const interactionHost = this._interactionHost;
|
|
2416
2491
|
await interactionHost?.dispose?.();
|
|
2417
|
-
await this._bootstrapToolsHandle?.dispose();
|
|
2418
|
-
this._bootstrapToolsHandle = undefined;
|
|
2419
2492
|
await this._bootstrapSkillsHandle?.dispose();
|
|
2420
2493
|
this._bootstrapSkillsHandle = undefined;
|
|
2421
2494
|
await this._bootstrapRetryHandle?.dispose();
|
|
@@ -2441,7 +2514,10 @@ export class AgentSession {
|
|
|
2441
2514
|
includeAllExtensionTools: true,
|
|
2442
2515
|
});
|
|
2443
2516
|
for (const manifestPath of capabilityPluginPaths) {
|
|
2444
|
-
|
|
2517
|
+
// 宿主装配注入的 configOverride 按路径回放(D-082 批 1),重装载不退
|
|
2518
|
+
// 回 manifest 缺省值。
|
|
2519
|
+
const configOverride = this._capabilityPluginConfigOverrides.get(manifestPath);
|
|
2520
|
+
await this.loadCapabilityPluginManifest(manifestPath, ...(configOverride === undefined ? [] : [{ configOverride }]));
|
|
2445
2521
|
}
|
|
2446
2522
|
for (const { manifest, factory } of inlineCapabilityPlugins) {
|
|
2447
2523
|
await this.loadCapabilityPlugin(manifest, factory);
|