@ai-agent-forge/agent-forge 0.88.2 → 0.88.3
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 +27 -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 +240 -230
- 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-HTC5K5SM.js → chunk-B42Y2VME.js} +94 -89
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-BVVSHK6W.js} +1 -1
- 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-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 +6 -1
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-errors.d.ts","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/core-errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+N7C,CAAC","sourcesContent":["/**\n * core-errors 域词典(批次⑥):core/plugins 层终端用户可见的 throw 错误消息。\n * 覆盖范围见 docs/design/国际化与本地化.md 与批次⑥登记:配置错误、认证与 API key\n * 失败、网络/超时/HTTP 失败、文件 IO、会话文件损坏、资源缺失、环境限制,以及\n * 插件生态的安装/下载失败。插件开发者契约校验(D 类)不在此域,归批次⑨。\n * key 为英文原文(与调用点逐字一致),占位符 `{name}` 原样保留。\n */\nexport const coreErrors: Record<string, string> = {\n\t// ---- 认证与模型引导(auth-guidance.ts 及其 throw 调用点)----\n\t\"Use /login to log into a provider via OAuth or API key. See:\":\n\t\t\"使用 /login 通过 OAuth 或 API key 登录提供商。参见:\",\n\t\"No models available. {help}\": \"没有可用模型。{help}\",\n\t\"No model selected.\\n\\n{help}\\n\\nThen use /model to select a model.\":\n\t\t\"未选择模型。\\n\\n{help}\\n\\n然后使用 /model 选择模型。\",\n\t\"No API key found for {provider}.\\n\\n{help}\": \"未找到 {provider} 的 API key。\\n\\n{help}\",\n\t\"the selected model\": \"所选模型\",\n\n\t// ---- 会话管理(session-manager.ts / session-storage.ts)----\n\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\":\n\t\t\"会话 id 不能为空,只能包含字母数字字符、'-'、'_' 和 '.',且首尾必须是字母数字字符\",\n\t\"Session file is not a valid {appName} session: {path}\": \"会话文件不是有效的 {appName} 会话:{path}\",\n\t\"Invalid compaction operationId in session entry: {operationId}\": \"会话条目中的压缩 operationId 无效:{operationId}\",\n\t\"Duplicate compaction operationId in session: {operationId}\": \"会话中存在重复的压缩 operationId:{operationId}\",\n\t\"Session append failed and rollback failed\": \"会话追加失败且回滚失败\",\n\t\"Cannot fork: source session file is empty or invalid: {path}\": \"无法分叉:源会话文件为空或无效:{path}\",\n\t\"Cannot fork: source session has no header: {path}\": \"无法分叉:源会话缺少头信息:{path}\",\n\t\"session guard lock timeout after {timeoutMs} ms: {lockPath}\": \"会话守护锁在 {timeoutMs} 毫秒后超时:{lockPath}\",\n\t\"Session file is owned by another live process (pid {pid}): {sessionFile}. Close that process first; concurrent writers would silently fork the session history.\":\n\t\t\"会话文件被另一个存活进程占用(pid {pid}):{sessionFile}。请先关闭该进程;并发写入会导致会话历史静默分叉。\",\n\t\"Session file: {sessionFile}\": \"会话文件:{sessionFile}\",\n\t\"Stored session working directory does not exist: {sessionCwd}{sessionFile}\\nCurrent working directory: {fallbackCwd}\":\n\t\t\"会话中记录的工作目录不存在:{sessionCwd}{sessionFile}\\n当前工作目录:{fallbackCwd}\",\n\n\t// ---- 会话运行时状态与操作守卫(agent-session*.ts)----\n\t\"Input rejected by an input gate\": \"输入被输入门拒绝\",\n\t\"Input rejected by an input gate: {reason}\": \"输入被输入门拒绝:{reason}\",\n\t\"Session reload in progress; prompts are unavailable\": \"会话重载进行中;暂无法提交提示\",\n\t\"Session reload in progress; compaction is unavailable\": \"会话重载进行中;暂无法压缩\",\n\t\"Session reload in progress; compaction was not started\": \"会话重载进行中;压缩未启动\",\n\t\"Session reload in progress; tree navigation is unavailable\": \"会话重载进行中;暂无法导航会话树\",\n\t\"Session reload in progress; bash execution is unavailable\": \"会话重载进行中;暂无法执行 bash\",\n\t\"Session reload in progress; bash results cannot be recorded\": \"会话重载进行中;无法记录 bash 结果\",\n\t\"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\":\n\t\t\"压缩进行中无法提交提示。请等待压缩完成后再重试。\",\n\t\"Authentication failed for \\\"{provider}\\\". Credentials may have expired or network is unavailable. Run '/login {provider}' to re-authenticate.\":\n\t\t\"“{provider}”认证失败。凭证可能已过期或网络不可用。请运行 '/login {provider}' 重新认证。\",\n\t\"No model is set on this session's agent\": \"本会话的 agent 未设置模型\",\n\t\"No API key for {provider}/{model}\": \"没有 {provider}/{model} 的 API key\",\n\t\"Already compacted\": \"已压缩过\",\n\t\"Nothing to compact (session too small)\": \"没有可压缩的内容(会话太小)\",\n\t\"Wait for the current response to finish before navigating the session tree.\": \"请等待当前响应结束再导航会话树。\",\n\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\":\n\t\t\"请等待当前压缩或树导航结束再导航会话树。\",\n\t\"No model available for summarization\": \"没有可用于生成摘要的模型\",\n\t\"Branch navigation is already in progress\": \"分支导航已在进行中\",\n\t\"Branch summary policy is not registered: {name}\": \"分支摘要策略未注册:{name}\",\n\t\"Configured context strategy is not registered: {name}\": \"已配置的上下文策略未注册:{name}\",\n\t\"Configured context strategy is not registered after reload: {name}\": \"重载后已配置的上下文策略未注册:{name}\",\n\t\"This session has not been saved yet. Send a message before cloning or forking it.\":\n\t\t\"本会话尚未保存。请先发送消息再克隆或分叉。\",\n\t\"Failed to create forked session\": \"创建分叉会话失败\",\n\t\"File not found: {path}\": \"文件不存在:{path}\",\n\t\"Skill is duplicated in resources: {name}\": \"技能在资源中重复:{name}\",\n\t\"Skill conflicts with a resource skill: {name}\": \"技能与资源技能冲突:{name}\",\n\n\t// ---- 模型与提供商配置(model-runtime.ts / provider-composer.ts)----\n\t\"Credential {operation} committed for {providerId}, but local synchronization failed\":\n\t\t\"提供商 {providerId} 的凭证 {operation} 已提交,但本地同步失败\",\n\t\"Unknown provider: {provider}\": \"未知提供商:{provider}\",\n\t\"Provider is not configured: {provider}\": \"提供商未配置:{provider}\",\n\t'Provider {providerId}, model {modelId}: no \"api\" specified. Set at provider or model level.':\n\t\t'提供商 {providerId},模型 {modelId}:未指定 \"api\"。请在提供商或模型级别设置。',\n\t'Provider {providerId}: \"baseUrl\" is required when defining custom models.':\n\t\t'提供商 {providerId}:定义自定义模型时必须提供 \"baseUrl\"。',\n\t\"Provider {providerId}, model {modelId}: invalid contextWindow\":\n\t\t\"提供商 {providerId},模型 {modelId}:contextWindow 无效\",\n\t\"Provider {providerId}, model {modelId}: invalid maxTokens\": \"提供商 {providerId},模型 {modelId}:maxTokens 无效\",\n\t'Provider {providerId}: \"baseUrl\" is required when \"oauth\" is set.':\n\t\t'提供商 {providerId}:设置 \"oauth\" 时必须提供 \"baseUrl\"。',\n\t'Provider {providerId}: must specify \"baseUrl\", \"headers\", \"compat\", \"modelOverrides\", or \"models\".':\n\t\t'提供商 {providerId}:必须指定 \"baseUrl\"、\"headers\"、\"compat\"、\"modelOverrides\" 或 \"models\" 之一。',\n\t\"Provider {providerId}: no authentication method configured.\": \"提供商 {providerId}:未配置任何认证方式。\",\n\t'API key for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 API key',\n\n\t// ---- 配置值解析(resolve-config-value.ts)----\n\t\"Failed to resolve {description} from shell command: {command}\": \"无法从 shell 命令解析{description}:{command}\",\n\t\"Failed to resolve {description} from environment variable: {envVar}\": \"无法从环境变量解析{description}:{envVar}\",\n\t\"Failed to resolve {description} from environment variables: {envVars}\":\n\t\t\"无法从环境变量解析{description}:{envVars}\",\n\t\"Failed to resolve {description}\": \"无法解析{description}\",\n\t'{description} header \"{key}\"': '{description}的 header \"{key}\"',\n\n\t// ---- settings 校验(settings-manager.ts / http-dispatcher.ts)----\n\t\"Invalid {settingName} setting: {value}\": \"无效的 {settingName} 设置:{value}\",\n\t\"Invalid compaction.{field} setting: {value}. Expected a non-negative safe integer.\":\n\t\t\"无效的 compaction.{field} 设置:{value}。应为非负安全整数。\",\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"] setting: {value}. Expected an object.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"] 设置:{value}。应为对象。',\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"].{field} setting: {value}. Expected a non-negative safe integer.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"].{field} 设置:{value}。应为非负安全整数。',\n\t\"Invalid httpIdleTimeoutMs setting: {value}\": \"无效的 httpIdleTimeoutMs 设置:{value}\",\n\t\"Invalid HTTP idle timeout: {value}\": \"无效的 HTTP 空闲超时:{value}\",\n\n\t// ---- 凭证存储(auth-storage.ts)----\n\t\"Failed to read auth.json: {reason}\": \"读取 auth.json 失败:{reason}\",\n\t\"Invalid auth.json: expected an object\": \"auth.json 无效:应为对象\",\n\t'Invalid auth.json credential for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 auth.json 凭证无效',\n\t\"Read-only credential storage cannot modify auth.json\": \"只读凭证存储无法修改 auth.json\",\n\n\t// ---- 模型目录与压缩(remote-catalog-provider.ts / compaction.ts)----\n\t'Invalid model catalog for provider \"{providerId}\"': '提供商 \"{providerId}\" 的模型目录无效',\n\t\"Model catalog request failed for {providerId}: {status}\": \"提供商 {providerId} 的模型目录请求失败:{status}\",\n\t\"First kept entry has no UUID - session may need migration\": \"首个保留条目没有 UUID——会话可能需要迁移\",\n\n\t// ---- 导出(export-html/index.ts)----\n\t\"Cannot export in-memory session to HTML\": \"无法将内存中的会话导出为 HTML\",\n\t\"Nothing to export yet - start a conversation first\": \"暂无可导出内容——请先开始对话\",\n\n\t// ---- SDK 会话创建与插件装载(sdk.ts / capability-plugin.ts / capability-runtime.ts)----\n\t\"Failed to read capability plugin manifest {path}: {reason}\": \"读取能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to inspect capability plugin directory {directory}: {reason}\": \"检查能力插件目录失败 {directory}:{reason}\",\n\t\"Capability plugin path must be a directory: {directory}\": \"能力插件路径必须是目录:{directory}\",\n\t\"Failed to resolve capability plugin directory {directory}: {reason}\": \"解析能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to read capability plugin directory {directory}: {reason}\": \"读取能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to resolve capability plugin manifest {path}: {reason}\": \"解析能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to import capability plugin entry {path}: {reason}\": \"导入能力插件入口失败 {path}:{reason}\",\n\t\"Plugin capability is required but unavailable: {capabilityId}@{version} ({pluginId})\":\n\t\t\"必需的插件能力不可用:{capabilityId}@{version}({pluginId})\",\n\t'Session is bound to suite \"{boundSuiteId}\" and cannot resume with \"{suiteId}\"; rerun with --rebind-suite to adopt the new suite, or create a new session':\n\t\t'会话已绑定 suite \"{boundSuiteId}\",无法以 \"{suiteId}\" 恢复;请加 --rebind-suite 重新运行以切换到新 suite,或创建新会话',\n\t\"Session Profile identity drift detected (the active plugin set changed since the conversation started); rerun with --rebind-suite to adopt the new plugin set, or create a new session\":\n\t\t\"检测到会话 Profile 身份漂移(对话开始后生效的插件集发生了变化);请加 --rebind-suite 重新运行以采用新插件集,或创建新会话\",\n\n\t// ---- 包管理与命令执行(package-manager.ts / package-source.ts / package-install-host.ts / config.ts)----\n\t\"Path does not exist: {path}\": \"路径不存在:{path}\",\n\t\"Unsupported install source: {source}\": \"不支持的安装源:{source}\",\n\t\"Unsupported remove source: {source}\": \"不支持的移除源:{source}\",\n\t\"Missing source: {source}\": \"源缺失:{source}\",\n\t\"Empty response from npm view\": \"npm view 返回空响应\",\n\t\"Unexpected response from npm view\": \"npm view 返回意外响应\",\n\t\"Failed to determine remote HEAD\": \"无法确定远端 HEAD\",\n\t\"Unsupported upstream remote: {upstream}\": \"不支持的 upstream 远端:{upstream}\",\n\t\"Missing upstream branch name\": \"缺少 upstream 分支名\",\n\t\"Failed to run {command} {args}: {reason}\": \"执行 {command} {args} 失败:{reason}\",\n\t\"Failed to run {command}: {reason}\": \"执行 {command} 失败:{reason}\",\n\t\"No matching package found for {source}\": \"未找到与 {source} 匹配的包\",\n\t\"No matching package found for {source}. Did you mean {suggestion}?\":\n\t\t\"未找到与 {source} 匹配的包。你是想找 {suggestion} 吗?\",\n\t\"Invalid npmCommand: first array entry must be a non-empty command\": \"无效的 npmCommand:数组第一项必须是非空命令\",\n\n\t// ---- MCP(plugins/mcp-http / agent-session-services.ts)----\n\t\"MCP HTTP transport error: {reason}\": \"MCP HTTP 传输错误:{reason}\",\n\t\"MCP HTTP transport is closed\": \"MCP HTTP 传输已关闭\",\n\t\"MCP HTTP transport returned HTTP {status}\": \"MCP HTTP 传输返回 HTTP {status}\",\n\t\"MCP HTTP transport returned non-JSON body: {reason}\": \"MCP HTTP 传输返回了非 JSON 响应体:{reason}\",\n\t\"MCP error {code}: {message}\": \"MCP 错误 {code}:{message}\",\n\t\"unknown error\": \"未知错误\",\n\t\"MCP tools/list result must contain tools[]\": \"MCP tools/list 结果必须包含 tools[]\",\n\t\"MCP tool requires a non-empty name\": \"MCP 工具必须具有非空名称\",\n\n\t// ---- 插件生态:获取与分发失败表(plugin-acquisition.ts / distribution.ts)----\n\t\"Plugin ref is invalid\": \"插件 ref 无效\",\n\t\"Local plugin ref exists but is neither a directory nor a .zip/.tgz file\":\n\t\t\"本地插件 ref 存在,但既不是目录也不是 .zip/.tgz 文件\",\n\t\"Plugin ref URL scheme is not supported\": \"不支持插件 ref 的 URL 协议\",\n\t\"Plugin ref #sha256 digest fragment is invalid\": \"插件 ref 的 #sha256 摘要片段无效\",\n\t\"Plugin npm package ref is invalid\": \"插件 npm 包 ref 无效\",\n\t\"Plugin package acquisition was cancelled\": \"插件包获取已取消\",\n\t\"Plugin package download failed\": \"插件包下载失败\",\n\t\"Plugin npm package was not found on the registry\": \"注册表中未找到该插件 npm 包\",\n\t\"No npm package version matches the requested range\": \"没有匹配所请求范围的 npm 包版本\",\n\t\"Plugin package bytes do not match the expected digest\": \"插件包字节与预期摘要不匹配\",\n\t\"Plugin package bytes are neither a zip nor a tgz\": \"插件包字节既不是 zip 也不是 tgz\",\n\t\"Plugin package contents are invalid\": \"插件包内容无效\",\n\t\"Plugin package exceeds the configured size budget\": \"插件包超出配置的大小预算\",\n\t\"Plugin release was not found\": \"未找到插件 release\",\n\t\"Plugin release has no .zip/.tgz asset\": \"插件 release 没有 .zip/.tgz 资产\",\n\t\"Plugin release has multiple .zip/.tgz assets\": \"插件 release 有多个 .zip/.tgz 资产\",\n\t\"Plugin release API rate limit was exceeded\": \"插件 release API 超出速率限制\",\n\t\"Plugin distribution is unsupported on this host\": \"此宿主不支持插件分发\",\n\t\"Plugin distribution operation was cancelled\": \"插件分发操作已取消\",\n\t\"Plugin distribution descriptor is invalid\": \"插件分发描述符无效\",\n\t\"Plugin distribution metadata is invalid\": \"插件分发元数据无效\",\n\t\"Plugin distribution artifact handle is invalid\": \"插件分发产物句柄无效\",\n\t\"Plugin distribution source does not match the descriptor\": \"插件分发来源与描述符不匹配\",\n\t\"Plugin distribution plugin identity does not match the descriptor\": \"插件分发的插件身份与描述符不匹配\",\n\t\"Plugin distribution digest does not match the descriptor\": \"插件分发摘要与描述符不匹配\",\n\t\"Plugin distribution signature was rejected\": \"插件分发签名被拒绝\",\n\t\"Plugin distribution descriptor has expired\": \"插件分发描述符已过期\",\n\t\"Plugin distribution size does not match the descriptor\": \"插件分发大小与描述符不匹配\",\n\t\"Plugin distribution media type does not match the descriptor\": \"插件分发媒体类型与描述符不匹配\",\n\t\"Plugin distribution host operation failed\": \"插件分发宿主操作失败\",\n\t\"Plugin distribution artifact release failed\": \"插件分发产物释放失败\",\n\n\t// ---- 插件生态:网络下载与安装店 IO(node-*-source.ts / registry.ts)----\n\t\"npm registry request timed out\": \"npm registry 请求超时\",\n\t\"npm registry request was cancelled\": \"npm registry 请求已取消\",\n\t\"npm registry request failed\": \"npm registry 请求失败\",\n\t\"npm registry rate limit was exceeded\": \"npm registry 速率限制已触发\",\n\t\"npm registry redirect limit exceeded\": \"超出 npm registry 重定向次数上限\",\n\t\"npm package was not found on the registry\": \"注册表中未找到该 npm 包\",\n\t\"npm registry request did not succeed\": \"npm registry 请求未成功\",\n\t\"npm tarball download was cancelled\": \"npm tarball 下载已取消\",\n\t\"npm tarball download did not succeed\": \"npm tarball 下载未成功\",\n\t\"plugin package download was cancelled\": \"插件包下载已取消\",\n\t\"plugin package download timed out\": \"插件包下载超时\",\n\t\"plugin package download failed\": \"插件包下载失败\",\n\t\"plugin package redirect limit exceeded\": \"超出插件包重定向次数上限\",\n\t\"plugin package download did not succeed\": \"插件包下载未成功\",\n\t\"plugin package response has no body\": \"插件包响应没有响应体\",\n\t\"release API request timed out\": \"release API 请求超时\",\n\t\"release API request was cancelled\": \"release API 请求已取消\",\n\t\"release API request failed\": \"release API 请求失败\",\n\t\"repo or release was not found\": \"未找到仓库或 release\",\n\t\"release API request did not succeed\": \"release API 请求未成功\",\n\t\"release API redirect limit exceeded\": \"超出 release API 重定向次数上限\",\n\t\"release asset download was cancelled\": \"release 资产下载已取消\",\n\t\"repo has no published release\": \"仓库没有已发布的 release\",\n\t\"Plugin registry request failed\": \"插件注册表请求失败\",\n\t\"Plugin registry request was cancelled\": \"插件注册表请求已取消\",\n\t\"Plugin registry request timed out\": \"插件注册表请求超时\",\n\t\"Disk registry source read was cancelled\": \"磁盘注册表源读取已取消\",\n\t\"Install store index could not be read\": \"无法读取安装店索引\",\n\t\"Installed plugin manifest could not be read\": \"无法读取已安装插件的 manifest\",\n\t\"Plugin registry operation was cancelled\": \"插件注册表操作已取消\",\n\t\"only toggles the enabled flag; the record lifecycle is {lifecycle} and the runtime will not load it\":\n\t\t\"仅切换 enabled 标志;该记录 lifecycle 为 {lifecycle},运行时不会加载\",\n\n\t// --- provider-composer.ts OAuth 手动输码 ---\n\t\"Paste the authorization code\": \"请粘贴授权码\",\n};\n"]}
|
|
1
|
+
{"version":3,"file":"core-errors.d.ts","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/core-errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+N7C,CAAC","sourcesContent":["/**\n * core-errors 域词典(批次⑥):core/plugins 层终端用户可见的 throw 错误消息。\n * 覆盖范围见 docs/design/国际化与本地化.md 与批次⑥登记:配置错误、认证与 API key\n * 失败、网络/超时/HTTP 失败、文件 IO、会话文件损坏、资源缺失、环境限制,以及\n * 插件生态的安装/下载失败。插件开发者契约校验(D 类)不在此域,归批次⑨。\n * key 为英文原文(与调用点逐字一致),占位符 `{name}` 原样保留。\n */\nexport const coreErrors: Record<string, string> = {\n\t// ---- 认证与模型引导(auth-guidance.ts 及其 throw 调用点)----\n\t\"Use /login to log into a provider via OAuth or API key. See:\":\n\t\t\"使用 /login 通过 OAuth 或 API key 登录提供商。参见:\",\n\t\"No models available. {help}\": \"没有可用模型。{help}\",\n\t\"No model selected.\\n\\n{help}\\n\\nThen use /model to select a model.\":\n\t\t\"未选择模型。\\n\\n{help}\\n\\n然后使用 /model 选择模型。\",\n\t\"No API key found for {provider}.\\n\\n{help}\": \"未找到 {provider} 的 API key。\\n\\n{help}\",\n\t\"the selected model\": \"所选模型\",\n\n\t// ---- 会话管理(session-manager.ts / session-storage.ts)----\n\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\":\n\t\t\"会话 id 不能为空,只能包含字母数字字符、'-'、'_' 和 '.',且首尾必须是字母数字字符\",\n\t\"Session file is not a valid {appName} session: {path}\": \"会话文件不是有效的 {appName} 会话:{path}\",\n\t\"Invalid compaction operationId in session entry: {operationId}\": \"会话条目中的压缩 operationId 无效:{operationId}\",\n\t\"Duplicate compaction operationId in session: {operationId}\": \"会话中存在重复的压缩 operationId:{operationId}\",\n\t\"Session append failed and rollback failed\": \"会话追加失败且回滚失败\",\n\t\"Cannot fork: source session file is empty or invalid: {path}\": \"无法分叉:源会话文件为空或无效:{path}\",\n\t\"Cannot fork: source session has no header: {path}\": \"无法分叉:源会话缺少头信息:{path}\",\n\t\"session guard lock timeout after {timeoutMs} ms: {lockPath}\": \"会话守护锁在 {timeoutMs} 毫秒后超时:{lockPath}\",\n\t\"Session file is owned by another live process (pid {pid}): {sessionFile}. Close that process first; concurrent writers would silently fork the session history.\":\n\t\t\"会话文件被另一个存活进程占用(pid {pid}):{sessionFile}。请先关闭该进程;并发写入会导致会话历史静默分叉。\",\n\t\"Session file: {sessionFile}\": \"会话文件:{sessionFile}\",\n\t\"Stored session working directory does not exist: {sessionCwd}{sessionFile}\\nCurrent working directory: {fallbackCwd}\":\n\t\t\"会话中记录的工作目录不存在:{sessionCwd}{sessionFile}\\n当前工作目录:{fallbackCwd}\",\n\n\t// ---- 会话运行时状态与操作守卫(agent-session*.ts)----\n\t\"Input rejected by an input gate\": \"输入被输入门拒绝\",\n\t\"Input rejected by an input gate: {reason}\": \"输入被输入门拒绝:{reason}\",\n\t\"Session reload in progress; prompts are unavailable\": \"会话重载进行中;暂无法提交提示\",\n\t\"Session reload in progress; compaction is unavailable\": \"会话重载进行中;暂无法压缩\",\n\t\"Session reload in progress; compaction was not started\": \"会话重载进行中;压缩未启动\",\n\t\"Session reload in progress; tree navigation is unavailable\": \"会话重载进行中;暂无法导航会话树\",\n\t\"Session reload in progress; bash execution is unavailable\": \"会话重载进行中;暂无法执行 bash\",\n\t\"Session reload in progress; bash results cannot be recorded\": \"会话重载进行中;无法记录 bash 结果\",\n\t\"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\":\n\t\t\"压缩进行中无法提交提示。请等待压缩完成后再重试。\",\n\t\"Authentication failed for \\\"{provider}\\\". Credentials may have expired or network is unavailable. Run '/login {provider}' to re-authenticate.\":\n\t\t\"“{provider}”认证失败。凭证可能已过期或网络不可用。请运行 '/login {provider}' 重新认证。\",\n\t\"No model is set on this session's agent\": \"本会话的 agent 未设置模型\",\n\t\"No API key for {provider}/{model}\": \"没有 {provider}/{model} 的 API key\",\n\t\"Already compacted\": \"已压缩过\",\n\t\"Nothing to compact (session too small)\": \"没有可压缩的内容(会话太小)\",\n\t\"Wait for the current response to finish before navigating the session tree.\": \"请等待当前响应结束再导航会话树。\",\n\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\":\n\t\t\"请等待当前压缩或树导航结束再导航会话树。\",\n\t\"No model available for summarization\": \"没有可用于生成摘要的模型\",\n\t\"Branch navigation is already in progress\": \"分支导航已在进行中\",\n\t\"Branch summary policy is not registered: {name}\": \"分支摘要策略未注册:{name}\",\n\t\"Configured context strategy is not registered: {name}\": \"已配置的上下文策略未注册:{name}\",\n\t\"Configured context strategy is not registered after reload: {name}\": \"重载后已配置的上下文策略未注册:{name}\",\n\t\"This session has not been saved yet. Send a message before cloning or forking it.\":\n\t\t\"本会话尚未保存。请先发送消息再克隆或分叉。\",\n\t\"Failed to create forked session\": \"创建分叉会话失败\",\n\t\"File not found: {path}\": \"文件不存在:{path}\",\n\t\"Skill is duplicated in resources: {name}\": \"技能在资源中重复:{name}\",\n\t\"Skill conflicts with a resource skill: {name}\": \"技能与资源技能冲突:{name}\",\n\n\t// ---- 模型与提供商配置(model-runtime.ts / provider-composer.ts)----\n\t\"Credential {operation} committed for {providerId}, but local synchronization failed\":\n\t\t\"提供商 {providerId} 的凭证 {operation} 已提交,但本地同步失败\",\n\t\"Unknown provider: {provider}\": \"未知提供商:{provider}\",\n\t\"Provider is not configured: {provider}\": \"提供商未配置:{provider}\",\n\t'Provider {providerId}, model {modelId}: no \"api\" specified. Set at provider or model level.':\n\t\t'提供商 {providerId},模型 {modelId}:未指定 \"api\"。请在提供商或模型级别设置。',\n\t'Provider {providerId}: \"baseUrl\" is required when defining custom models.':\n\t\t'提供商 {providerId}:定义自定义模型时必须提供 \"baseUrl\"。',\n\t\"Provider {providerId}, model {modelId}: invalid contextWindow\":\n\t\t\"提供商 {providerId},模型 {modelId}:contextWindow 无效\",\n\t\"Provider {providerId}, model {modelId}: invalid maxTokens\": \"提供商 {providerId},模型 {modelId}:maxTokens 无效\",\n\t'Provider {providerId}: \"baseUrl\" is required when \"oauth\" is set.':\n\t\t'提供商 {providerId}:设置 \"oauth\" 时必须提供 \"baseUrl\"。',\n\t'Provider {providerId}: must specify \"baseUrl\", \"headers\", \"compat\", \"modelOverrides\", or \"models\".':\n\t\t'提供商 {providerId}:必须指定 \"baseUrl\"、\"headers\"、\"compat\"、\"modelOverrides\" 或 \"models\" 之一。',\n\t\"Provider {providerId}: no authentication method configured.\": \"提供商 {providerId}:未配置任何认证方式。\",\n\t'API key for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 API key',\n\n\t// ---- 配置值解析(resolve-config-value.ts)----\n\t\"Failed to resolve {description} from shell command: {command}\": \"无法从 shell 命令解析{description}:{command}\",\n\t\"Failed to resolve {description} from environment variable: {envVar}\": \"无法从环境变量解析{description}:{envVar}\",\n\t\"Failed to resolve {description} from environment variables: {envVars}\":\n\t\t\"无法从环境变量解析{description}:{envVars}\",\n\t\"Failed to resolve {description}\": \"无法解析{description}\",\n\t'{description} header \"{key}\"': '{description}的 header \"{key}\"',\n\n\t// ---- settings 校验(settings-manager.ts / http-dispatcher.ts)----\n\t\"Invalid {settingName} setting: {value}\": \"无效的 {settingName} 设置:{value}\",\n\t\"Invalid compaction.{field} setting: {value}. Expected a non-negative safe integer.\":\n\t\t\"无效的 compaction.{field} 设置:{value}。应为非负安全整数。\",\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"] setting: {value}. Expected an object.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"] 设置:{value}。应为对象。',\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"].{field} setting: {value}. Expected a non-negative safe integer.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"].{field} 设置:{value}。应为非负安全整数。',\n\t\"Invalid httpIdleTimeoutMs setting: {value}\": \"无效的 httpIdleTimeoutMs 设置:{value}\",\n\t\"Invalid HTTP idle timeout: {value}\": \"无效的 HTTP 空闲超时:{value}\",\n\n\t// ---- 凭证存储(auth-storage.ts)----\n\t\"Failed to read auth.json: {reason}\": \"读取 auth.json 失败:{reason}\",\n\t\"Invalid auth.json: expected an object\": \"auth.json 无效:应为对象\",\n\t'Invalid auth.json credential for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 auth.json 凭证无效',\n\t\"Read-only credential storage cannot modify auth.json\": \"只读凭证存储无法修改 auth.json\",\n\n\t// ---- 模型目录与压缩(remote-catalog-provider.ts / compaction.ts)----\n\t'Invalid model catalog for provider \"{providerId}\"': '提供商 \"{providerId}\" 的模型目录无效',\n\t\"Model catalog request failed for {providerId}: {status}\": \"提供商 {providerId} 的模型目录请求失败:{status}\",\n\t\"First kept entry has no UUID - session may need migration\": \"首个保留条目没有 UUID——会话可能需要迁移\",\n\n\t// ---- 导出(src/export-html/index.ts)----\n\t\"Cannot export in-memory session to HTML\": \"无法将内存中的会话导出为 HTML\",\n\t\"Nothing to export yet - start a conversation first\": \"暂无可导出内容——请先开始对话\",\n\n\t// ---- SDK 会话创建与插件装载(sdk.ts / capability-plugin.ts / capability-runtime.ts)----\n\t\"Failed to read capability plugin manifest {path}: {reason}\": \"读取能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to inspect capability plugin directory {directory}: {reason}\": \"检查能力插件目录失败 {directory}:{reason}\",\n\t\"Capability plugin path must be a directory: {directory}\": \"能力插件路径必须是目录:{directory}\",\n\t\"Failed to resolve capability plugin directory {directory}: {reason}\": \"解析能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to read capability plugin directory {directory}: {reason}\": \"读取能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to resolve capability plugin manifest {path}: {reason}\": \"解析能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to import capability plugin entry {path}: {reason}\": \"导入能力插件入口失败 {path}:{reason}\",\n\t\"Plugin capability is required but unavailable: {capabilityId}@{version} ({pluginId})\":\n\t\t\"必需的插件能力不可用:{capabilityId}@{version}({pluginId})\",\n\t'Session is bound to suite \"{boundSuiteId}\" and cannot resume with \"{suiteId}\"; rerun with --rebind-suite to adopt the new suite, or create a new session':\n\t\t'会话已绑定 suite \"{boundSuiteId}\",无法以 \"{suiteId}\" 恢复;请加 --rebind-suite 重新运行以切换到新 suite,或创建新会话',\n\t\"Session Profile identity drift detected (the active plugin set changed since the conversation started); rerun with --rebind-suite to adopt the new plugin set, or create a new session\":\n\t\t\"检测到会话 Profile 身份漂移(对话开始后生效的插件集发生了变化);请加 --rebind-suite 重新运行以采用新插件集,或创建新会话\",\n\n\t// ---- 包管理与命令执行(package-manager.ts / package-source.ts / package-install-host.ts / config.ts)----\n\t\"Path does not exist: {path}\": \"路径不存在:{path}\",\n\t\"Unsupported install source: {source}\": \"不支持的安装源:{source}\",\n\t\"Unsupported remove source: {source}\": \"不支持的移除源:{source}\",\n\t\"Missing source: {source}\": \"源缺失:{source}\",\n\t\"Empty response from npm view\": \"npm view 返回空响应\",\n\t\"Unexpected response from npm view\": \"npm view 返回意外响应\",\n\t\"Failed to determine remote HEAD\": \"无法确定远端 HEAD\",\n\t\"Unsupported upstream remote: {upstream}\": \"不支持的 upstream 远端:{upstream}\",\n\t\"Missing upstream branch name\": \"缺少 upstream 分支名\",\n\t\"Failed to run {command} {args}: {reason}\": \"执行 {command} {args} 失败:{reason}\",\n\t\"Failed to run {command}: {reason}\": \"执行 {command} 失败:{reason}\",\n\t\"No matching package found for {source}\": \"未找到与 {source} 匹配的包\",\n\t\"No matching package found for {source}. Did you mean {suggestion}?\":\n\t\t\"未找到与 {source} 匹配的包。你是想找 {suggestion} 吗?\",\n\t\"Invalid npmCommand: first array entry must be a non-empty command\": \"无效的 npmCommand:数组第一项必须是非空命令\",\n\n\t// ---- MCP(plugins/mcp-http / agent-session-services.ts)----\n\t\"MCP HTTP transport error: {reason}\": \"MCP HTTP 传输错误:{reason}\",\n\t\"MCP HTTP transport is closed\": \"MCP HTTP 传输已关闭\",\n\t\"MCP HTTP transport returned HTTP {status}\": \"MCP HTTP 传输返回 HTTP {status}\",\n\t\"MCP HTTP transport returned non-JSON body: {reason}\": \"MCP HTTP 传输返回了非 JSON 响应体:{reason}\",\n\t\"MCP error {code}: {message}\": \"MCP 错误 {code}:{message}\",\n\t\"unknown error\": \"未知错误\",\n\t\"MCP tools/list result must contain tools[]\": \"MCP tools/list 结果必须包含 tools[]\",\n\t\"MCP tool requires a non-empty name\": \"MCP 工具必须具有非空名称\",\n\n\t// ---- 插件生态:获取与分发失败表(plugin-acquisition.ts / distribution.ts)----\n\t\"Plugin ref is invalid\": \"插件 ref 无效\",\n\t\"Local plugin ref exists but is neither a directory nor a .zip/.tgz file\":\n\t\t\"本地插件 ref 存在,但既不是目录也不是 .zip/.tgz 文件\",\n\t\"Plugin ref URL scheme is not supported\": \"不支持插件 ref 的 URL 协议\",\n\t\"Plugin ref #sha256 digest fragment is invalid\": \"插件 ref 的 #sha256 摘要片段无效\",\n\t\"Plugin npm package ref is invalid\": \"插件 npm 包 ref 无效\",\n\t\"Plugin package acquisition was cancelled\": \"插件包获取已取消\",\n\t\"Plugin package download failed\": \"插件包下载失败\",\n\t\"Plugin npm package was not found on the registry\": \"注册表中未找到该插件 npm 包\",\n\t\"No npm package version matches the requested range\": \"没有匹配所请求范围的 npm 包版本\",\n\t\"Plugin package bytes do not match the expected digest\": \"插件包字节与预期摘要不匹配\",\n\t\"Plugin package bytes are neither a zip nor a tgz\": \"插件包字节既不是 zip 也不是 tgz\",\n\t\"Plugin package contents are invalid\": \"插件包内容无效\",\n\t\"Plugin package exceeds the configured size budget\": \"插件包超出配置的大小预算\",\n\t\"Plugin release was not found\": \"未找到插件 release\",\n\t\"Plugin release has no .zip/.tgz asset\": \"插件 release 没有 .zip/.tgz 资产\",\n\t\"Plugin release has multiple .zip/.tgz assets\": \"插件 release 有多个 .zip/.tgz 资产\",\n\t\"Plugin release API rate limit was exceeded\": \"插件 release API 超出速率限制\",\n\t\"Plugin distribution is unsupported on this host\": \"此宿主不支持插件分发\",\n\t\"Plugin distribution operation was cancelled\": \"插件分发操作已取消\",\n\t\"Plugin distribution descriptor is invalid\": \"插件分发描述符无效\",\n\t\"Plugin distribution metadata is invalid\": \"插件分发元数据无效\",\n\t\"Plugin distribution artifact handle is invalid\": \"插件分发产物句柄无效\",\n\t\"Plugin distribution source does not match the descriptor\": \"插件分发来源与描述符不匹配\",\n\t\"Plugin distribution plugin identity does not match the descriptor\": \"插件分发的插件身份与描述符不匹配\",\n\t\"Plugin distribution digest does not match the descriptor\": \"插件分发摘要与描述符不匹配\",\n\t\"Plugin distribution signature was rejected\": \"插件分发签名被拒绝\",\n\t\"Plugin distribution descriptor has expired\": \"插件分发描述符已过期\",\n\t\"Plugin distribution size does not match the descriptor\": \"插件分发大小与描述符不匹配\",\n\t\"Plugin distribution media type does not match the descriptor\": \"插件分发媒体类型与描述符不匹配\",\n\t\"Plugin distribution host operation failed\": \"插件分发宿主操作失败\",\n\t\"Plugin distribution artifact release failed\": \"插件分发产物释放失败\",\n\n\t// ---- 插件生态:网络下载与安装店 IO(node-*-source.ts / registry.ts)----\n\t\"npm registry request timed out\": \"npm registry 请求超时\",\n\t\"npm registry request was cancelled\": \"npm registry 请求已取消\",\n\t\"npm registry request failed\": \"npm registry 请求失败\",\n\t\"npm registry rate limit was exceeded\": \"npm registry 速率限制已触发\",\n\t\"npm registry redirect limit exceeded\": \"超出 npm registry 重定向次数上限\",\n\t\"npm package was not found on the registry\": \"注册表中未找到该 npm 包\",\n\t\"npm registry request did not succeed\": \"npm registry 请求未成功\",\n\t\"npm tarball download was cancelled\": \"npm tarball 下载已取消\",\n\t\"npm tarball download did not succeed\": \"npm tarball 下载未成功\",\n\t\"plugin package download was cancelled\": \"插件包下载已取消\",\n\t\"plugin package download timed out\": \"插件包下载超时\",\n\t\"plugin package download failed\": \"插件包下载失败\",\n\t\"plugin package redirect limit exceeded\": \"超出插件包重定向次数上限\",\n\t\"plugin package download did not succeed\": \"插件包下载未成功\",\n\t\"plugin package response has no body\": \"插件包响应没有响应体\",\n\t\"release API request timed out\": \"release API 请求超时\",\n\t\"release API request was cancelled\": \"release API 请求已取消\",\n\t\"release API request failed\": \"release API 请求失败\",\n\t\"repo or release was not found\": \"未找到仓库或 release\",\n\t\"release API request did not succeed\": \"release API 请求未成功\",\n\t\"release API redirect limit exceeded\": \"超出 release API 重定向次数上限\",\n\t\"release asset download was cancelled\": \"release 资产下载已取消\",\n\t\"repo has no published release\": \"仓库没有已发布的 release\",\n\t\"Plugin registry request failed\": \"插件注册表请求失败\",\n\t\"Plugin registry request was cancelled\": \"插件注册表请求已取消\",\n\t\"Plugin registry request timed out\": \"插件注册表请求超时\",\n\t\"Disk registry source read was cancelled\": \"磁盘注册表源读取已取消\",\n\t\"Install store index could not be read\": \"无法读取安装店索引\",\n\t\"Installed plugin manifest could not be read\": \"无法读取已安装插件的 manifest\",\n\t\"Plugin registry operation was cancelled\": \"插件注册表操作已取消\",\n\t\"only toggles the enabled flag; the record lifecycle is {lifecycle} and the runtime will not load it\":\n\t\t\"仅切换 enabled 标志;该记录 lifecycle 为 {lifecycle},运行时不会加载\",\n\n\t// --- provider-composer.ts OAuth 手动输码 ---\n\t\"Paste the authorization code\": \"请粘贴授权码\",\n};\n"]}
|
|
@@ -85,7 +85,7 @@ export const coreErrors = {
|
|
|
85
85
|
'Invalid model catalog for provider "{providerId}"': '提供商 "{providerId}" 的模型目录无效',
|
|
86
86
|
"Model catalog request failed for {providerId}: {status}": "提供商 {providerId} 的模型目录请求失败:{status}",
|
|
87
87
|
"First kept entry has no UUID - session may need migration": "首个保留条目没有 UUID——会话可能需要迁移",
|
|
88
|
-
// ---- 导出(export-html/index.ts)----
|
|
88
|
+
// ---- 导出(src/export-html/index.ts)----
|
|
89
89
|
"Cannot export in-memory session to HTML": "无法将内存中的会话导出为 HTML",
|
|
90
90
|
"Nothing to export yet - start a conversation first": "暂无可导出内容——请先开始对话",
|
|
91
91
|
// ---- SDK 会话创建与插件装载(sdk.ts / capability-plugin.ts / capability-runtime.ts)----
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-errors.js","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/core-errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAA2B;IACjD,8EAAkD;IAClD,8DAA8D,EAC7D,oEAAwC;IACzC,6BAA6B,EAAE,6BAAe;IAC9C,oEAAoE,EACnE,qEAAuC;IACxC,4CAA4C,EAAE,+CAAqC;IACnF,oBAAoB,EAAE,cAAM;IAE5B,qEAAyD;IACzD,yIAAyI,EAC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ourcesContent":["/**\n * core-errors 域词典(批次⑥):core/plugins 层终端用户可见的 throw 错误消息。\n * 覆盖范围见 docs/design/国际化与本地化.md 与批次⑥登记:配置错误、认证与 API key\n * 失败、网络/超时/HTTP 失败、文件 IO、会话文件损坏、资源缺失、环境限制,以及\n * 插件生态的安装/下载失败。插件开发者契约校验(D 类)不在此域,归批次⑨。\n * key 为英文原文(与调用点逐字一致),占位符 `{name}` 原样保留。\n */\nexport const coreErrors: Record<string, string> = {\n\t// ---- 认证与模型引导(auth-guidance.ts 及其 throw 调用点)----\n\t\"Use /login to log into a provider via OAuth or API key. See:\":\n\t\t\"使用 /login 通过 OAuth 或 API key 登录提供商。参见:\",\n\t\"No models available. {help}\": \"没有可用模型。{help}\",\n\t\"No model selected.\\n\\n{help}\\n\\nThen use /model to select a model.\":\n\t\t\"未选择模型。\\n\\n{help}\\n\\n然后使用 /model 选择模型。\",\n\t\"No API key found for {provider}.\\n\\n{help}\": \"未找到 {provider} 的 API key。\\n\\n{help}\",\n\t\"the selected model\": \"所选模型\",\n\n\t// ---- 会话管理(session-manager.ts / session-storage.ts)----\n\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\":\n\t\t\"会话 id 不能为空,只能包含字母数字字符、'-'、'_' 和 '.',且首尾必须是字母数字字符\",\n\t\"Session file is not a valid {appName} session: {path}\": \"会话文件不是有效的 {appName} 会话:{path}\",\n\t\"Invalid compaction operationId in session entry: {operationId}\": \"会话条目中的压缩 operationId 无效:{operationId}\",\n\t\"Duplicate compaction operationId in session: {operationId}\": \"会话中存在重复的压缩 operationId:{operationId}\",\n\t\"Session append failed and rollback failed\": \"会话追加失败且回滚失败\",\n\t\"Cannot fork: source session file is empty or invalid: {path}\": \"无法分叉:源会话文件为空或无效:{path}\",\n\t\"Cannot fork: source session has no header: {path}\": \"无法分叉:源会话缺少头信息:{path}\",\n\t\"session guard lock timeout after {timeoutMs} ms: {lockPath}\": \"会话守护锁在 {timeoutMs} 毫秒后超时:{lockPath}\",\n\t\"Session file is owned by another live process (pid {pid}): {sessionFile}. Close that process first; concurrent writers would silently fork the session history.\":\n\t\t\"会话文件被另一个存活进程占用(pid {pid}):{sessionFile}。请先关闭该进程;并发写入会导致会话历史静默分叉。\",\n\t\"Session file: {sessionFile}\": \"会话文件:{sessionFile}\",\n\t\"Stored session working directory does not exist: {sessionCwd}{sessionFile}\\nCurrent working directory: {fallbackCwd}\":\n\t\t\"会话中记录的工作目录不存在:{sessionCwd}{sessionFile}\\n当前工作目录:{fallbackCwd}\",\n\n\t// ---- 会话运行时状态与操作守卫(agent-session*.ts)----\n\t\"Input rejected by an input gate\": \"输入被输入门拒绝\",\n\t\"Input rejected by an input gate: {reason}\": \"输入被输入门拒绝:{reason}\",\n\t\"Session reload in progress; prompts are unavailable\": \"会话重载进行中;暂无法提交提示\",\n\t\"Session reload in progress; compaction is unavailable\": \"会话重载进行中;暂无法压缩\",\n\t\"Session reload in progress; compaction was not started\": \"会话重载进行中;压缩未启动\",\n\t\"Session reload in progress; tree navigation is unavailable\": \"会话重载进行中;暂无法导航会话树\",\n\t\"Session reload in progress; bash execution is unavailable\": \"会话重载进行中;暂无法执行 bash\",\n\t\"Session reload in progress; bash results cannot be recorded\": \"会话重载进行中;无法记录 bash 结果\",\n\t\"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\":\n\t\t\"压缩进行中无法提交提示。请等待压缩完成后再重试。\",\n\t\"Authentication failed for \\\"{provider}\\\". Credentials may have expired or network is unavailable. Run '/login {provider}' to re-authenticate.\":\n\t\t\"“{provider}”认证失败。凭证可能已过期或网络不可用。请运行 '/login {provider}' 重新认证。\",\n\t\"No model is set on this session's agent\": \"本会话的 agent 未设置模型\",\n\t\"No API key for {provider}/{model}\": \"没有 {provider}/{model} 的 API key\",\n\t\"Already compacted\": \"已压缩过\",\n\t\"Nothing to compact (session too small)\": \"没有可压缩的内容(会话太小)\",\n\t\"Wait for the current response to finish before navigating the session tree.\": \"请等待当前响应结束再导航会话树。\",\n\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\":\n\t\t\"请等待当前压缩或树导航结束再导航会话树。\",\n\t\"No model available for summarization\": \"没有可用于生成摘要的模型\",\n\t\"Branch navigation is already in progress\": \"分支导航已在进行中\",\n\t\"Branch summary policy is not registered: {name}\": \"分支摘要策略未注册:{name}\",\n\t\"Configured context strategy is not registered: {name}\": \"已配置的上下文策略未注册:{name}\",\n\t\"Configured context strategy is not registered after reload: {name}\": \"重载后已配置的上下文策略未注册:{name}\",\n\t\"This session has not been saved yet. Send a message before cloning or forking it.\":\n\t\t\"本会话尚未保存。请先发送消息再克隆或分叉。\",\n\t\"Failed to create forked session\": \"创建分叉会话失败\",\n\t\"File not found: {path}\": \"文件不存在:{path}\",\n\t\"Skill is duplicated in resources: {name}\": \"技能在资源中重复:{name}\",\n\t\"Skill conflicts with a resource skill: {name}\": \"技能与资源技能冲突:{name}\",\n\n\t// ---- 模型与提供商配置(model-runtime.ts / provider-composer.ts)----\n\t\"Credential {operation} committed for {providerId}, but local synchronization failed\":\n\t\t\"提供商 {providerId} 的凭证 {operation} 已提交,但本地同步失败\",\n\t\"Unknown provider: {provider}\": \"未知提供商:{provider}\",\n\t\"Provider is not configured: {provider}\": \"提供商未配置:{provider}\",\n\t'Provider {providerId}, model {modelId}: no \"api\" specified. Set at provider or model level.':\n\t\t'提供商 {providerId},模型 {modelId}:未指定 \"api\"。请在提供商或模型级别设置。',\n\t'Provider {providerId}: \"baseUrl\" is required when defining custom models.':\n\t\t'提供商 {providerId}:定义自定义模型时必须提供 \"baseUrl\"。',\n\t\"Provider {providerId}, model {modelId}: invalid contextWindow\":\n\t\t\"提供商 {providerId},模型 {modelId}:contextWindow 无效\",\n\t\"Provider {providerId}, model {modelId}: invalid maxTokens\": \"提供商 {providerId},模型 {modelId}:maxTokens 无效\",\n\t'Provider {providerId}: \"baseUrl\" is required when \"oauth\" is set.':\n\t\t'提供商 {providerId}:设置 \"oauth\" 时必须提供 \"baseUrl\"。',\n\t'Provider {providerId}: must specify \"baseUrl\", \"headers\", \"compat\", \"modelOverrides\", or \"models\".':\n\t\t'提供商 {providerId}:必须指定 \"baseUrl\"、\"headers\"、\"compat\"、\"modelOverrides\" 或 \"models\" 之一。',\n\t\"Provider {providerId}: no authentication method configured.\": \"提供商 {providerId}:未配置任何认证方式。\",\n\t'API key for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 API key',\n\n\t// ---- 配置值解析(resolve-config-value.ts)----\n\t\"Failed to resolve {description} from shell command: {command}\": \"无法从 shell 命令解析{description}:{command}\",\n\t\"Failed to resolve {description} from environment variable: {envVar}\": \"无法从环境变量解析{description}:{envVar}\",\n\t\"Failed to resolve {description} from environment variables: {envVars}\":\n\t\t\"无法从环境变量解析{description}:{envVars}\",\n\t\"Failed to resolve {description}\": \"无法解析{description}\",\n\t'{description} header \"{key}\"': '{description}的 header \"{key}\"',\n\n\t// ---- settings 校验(settings-manager.ts / http-dispatcher.ts)----\n\t\"Invalid {settingName} setting: {value}\": \"无效的 {settingName} 设置:{value}\",\n\t\"Invalid compaction.{field} setting: {value}. Expected a non-negative safe integer.\":\n\t\t\"无效的 compaction.{field} 设置:{value}。应为非负安全整数。\",\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"] setting: {value}. Expected an object.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"] 设置:{value}。应为对象。',\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"].{field} setting: {value}. Expected a non-negative safe integer.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"].{field} 设置:{value}。应为非负安全整数。',\n\t\"Invalid httpIdleTimeoutMs setting: {value}\": \"无效的 httpIdleTimeoutMs 设置:{value}\",\n\t\"Invalid HTTP idle timeout: {value}\": \"无效的 HTTP 空闲超时:{value}\",\n\n\t// ---- 凭证存储(auth-storage.ts)----\n\t\"Failed to read auth.json: {reason}\": \"读取 auth.json 失败:{reason}\",\n\t\"Invalid auth.json: expected an object\": \"auth.json 无效:应为对象\",\n\t'Invalid auth.json credential for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 auth.json 凭证无效',\n\t\"Read-only credential storage cannot modify auth.json\": \"只读凭证存储无法修改 auth.json\",\n\n\t// ---- 模型目录与压缩(remote-catalog-provider.ts / compaction.ts)----\n\t'Invalid model catalog for provider \"{providerId}\"': '提供商 \"{providerId}\" 的模型目录无效',\n\t\"Model catalog request failed for {providerId}: {status}\": \"提供商 {providerId} 的模型目录请求失败:{status}\",\n\t\"First kept entry has no UUID - session may need migration\": \"首个保留条目没有 UUID——会话可能需要迁移\",\n\n\t// ---- 导出(export-html/index.ts)----\n\t\"Cannot export in-memory session to HTML\": \"无法将内存中的会话导出为 HTML\",\n\t\"Nothing to export yet - start a conversation first\": \"暂无可导出内容——请先开始对话\",\n\n\t// ---- SDK 会话创建与插件装载(sdk.ts / capability-plugin.ts / capability-runtime.ts)----\n\t\"Failed to read capability plugin manifest {path}: {reason}\": \"读取能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to inspect capability plugin directory {directory}: {reason}\": \"检查能力插件目录失败 {directory}:{reason}\",\n\t\"Capability plugin path must be a directory: {directory}\": \"能力插件路径必须是目录:{directory}\",\n\t\"Failed to resolve capability plugin directory {directory}: {reason}\": \"解析能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to read capability plugin directory {directory}: {reason}\": \"读取能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to resolve capability plugin manifest {path}: {reason}\": \"解析能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to import capability plugin entry {path}: {reason}\": \"导入能力插件入口失败 {path}:{reason}\",\n\t\"Plugin capability is required but unavailable: {capabilityId}@{version} ({pluginId})\":\n\t\t\"必需的插件能力不可用:{capabilityId}@{version}({pluginId})\",\n\t'Session is bound to suite \"{boundSuiteId}\" and cannot resume with \"{suiteId}\"; rerun with --rebind-suite to adopt the new suite, or create a new session':\n\t\t'会话已绑定 suite \"{boundSuiteId}\",无法以 \"{suiteId}\" 恢复;请加 --rebind-suite 重新运行以切换到新 suite,或创建新会话',\n\t\"Session Profile identity drift detected (the active plugin set changed since the conversation started); rerun with --rebind-suite to adopt the new plugin set, or create a new session\":\n\t\t\"检测到会话 Profile 身份漂移(对话开始后生效的插件集发生了变化);请加 --rebind-suite 重新运行以采用新插件集,或创建新会话\",\n\n\t// ---- 包管理与命令执行(package-manager.ts / package-source.ts / package-install-host.ts / config.ts)----\n\t\"Path does not exist: {path}\": \"路径不存在:{path}\",\n\t\"Unsupported install source: {source}\": \"不支持的安装源:{source}\",\n\t\"Unsupported remove source: {source}\": \"不支持的移除源:{source}\",\n\t\"Missing source: {source}\": \"源缺失:{source}\",\n\t\"Empty response from npm view\": \"npm view 返回空响应\",\n\t\"Unexpected response from npm view\": \"npm view 返回意外响应\",\n\t\"Failed to determine remote HEAD\": \"无法确定远端 HEAD\",\n\t\"Unsupported upstream remote: {upstream}\": \"不支持的 upstream 远端:{upstream}\",\n\t\"Missing upstream branch name\": \"缺少 upstream 分支名\",\n\t\"Failed to run {command} {args}: {reason}\": \"执行 {command} {args} 失败:{reason}\",\n\t\"Failed to run {command}: {reason}\": \"执行 {command} 失败:{reason}\",\n\t\"No matching package found for {source}\": \"未找到与 {source} 匹配的包\",\n\t\"No matching package found for {source}. Did you mean {suggestion}?\":\n\t\t\"未找到与 {source} 匹配的包。你是想找 {suggestion} 吗?\",\n\t\"Invalid npmCommand: first array entry must be a non-empty command\": \"无效的 npmCommand:数组第一项必须是非空命令\",\n\n\t// ---- MCP(plugins/mcp-http / agent-session-services.ts)----\n\t\"MCP HTTP transport error: {reason}\": \"MCP HTTP 传输错误:{reason}\",\n\t\"MCP HTTP transport is closed\": \"MCP HTTP 传输已关闭\",\n\t\"MCP HTTP transport returned HTTP {status}\": \"MCP HTTP 传输返回 HTTP {status}\",\n\t\"MCP HTTP transport returned non-JSON body: {reason}\": \"MCP HTTP 传输返回了非 JSON 响应体:{reason}\",\n\t\"MCP error {code}: {message}\": \"MCP 错误 {code}:{message}\",\n\t\"unknown error\": \"未知错误\",\n\t\"MCP tools/list result must contain tools[]\": \"MCP tools/list 结果必须包含 tools[]\",\n\t\"MCP tool requires a non-empty name\": \"MCP 工具必须具有非空名称\",\n\n\t// ---- 插件生态:获取与分发失败表(plugin-acquisition.ts / distribution.ts)----\n\t\"Plugin ref is invalid\": \"插件 ref 无效\",\n\t\"Local plugin ref exists but is neither a directory nor a .zip/.tgz file\":\n\t\t\"本地插件 ref 存在,但既不是目录也不是 .zip/.tgz 文件\",\n\t\"Plugin ref URL scheme is not supported\": \"不支持插件 ref 的 URL 协议\",\n\t\"Plugin ref #sha256 digest fragment is invalid\": \"插件 ref 的 #sha256 摘要片段无效\",\n\t\"Plugin npm package ref is invalid\": \"插件 npm 包 ref 无效\",\n\t\"Plugin package acquisition was cancelled\": \"插件包获取已取消\",\n\t\"Plugin package download failed\": \"插件包下载失败\",\n\t\"Plugin npm package was not found on the registry\": \"注册表中未找到该插件 npm 包\",\n\t\"No npm package version matches the requested range\": \"没有匹配所请求范围的 npm 包版本\",\n\t\"Plugin package bytes do not match the expected digest\": \"插件包字节与预期摘要不匹配\",\n\t\"Plugin package bytes are neither a zip nor a tgz\": \"插件包字节既不是 zip 也不是 tgz\",\n\t\"Plugin package contents are invalid\": \"插件包内容无效\",\n\t\"Plugin package exceeds the configured size budget\": \"插件包超出配置的大小预算\",\n\t\"Plugin release was not found\": \"未找到插件 release\",\n\t\"Plugin release has no .zip/.tgz asset\": \"插件 release 没有 .zip/.tgz 资产\",\n\t\"Plugin release has multiple .zip/.tgz assets\": \"插件 release 有多个 .zip/.tgz 资产\",\n\t\"Plugin release API rate limit was exceeded\": \"插件 release API 超出速率限制\",\n\t\"Plugin distribution is unsupported on this host\": \"此宿主不支持插件分发\",\n\t\"Plugin distribution operation was cancelled\": \"插件分发操作已取消\",\n\t\"Plugin distribution descriptor is invalid\": \"插件分发描述符无效\",\n\t\"Plugin distribution metadata is invalid\": \"插件分发元数据无效\",\n\t\"Plugin distribution artifact handle is invalid\": \"插件分发产物句柄无效\",\n\t\"Plugin distribution source does not match the descriptor\": \"插件分发来源与描述符不匹配\",\n\t\"Plugin distribution plugin identity does not match the descriptor\": \"插件分发的插件身份与描述符不匹配\",\n\t\"Plugin distribution digest does not match the descriptor\": \"插件分发摘要与描述符不匹配\",\n\t\"Plugin distribution signature was rejected\": \"插件分发签名被拒绝\",\n\t\"Plugin distribution descriptor has expired\": \"插件分发描述符已过期\",\n\t\"Plugin distribution size does not match the descriptor\": \"插件分发大小与描述符不匹配\",\n\t\"Plugin distribution media type does not match the descriptor\": \"插件分发媒体类型与描述符不匹配\",\n\t\"Plugin distribution host operation failed\": \"插件分发宿主操作失败\",\n\t\"Plugin distribution artifact release failed\": \"插件分发产物释放失败\",\n\n\t// ---- 插件生态:网络下载与安装店 IO(node-*-source.ts / registry.ts)----\n\t\"npm registry request timed out\": \"npm registry 请求超时\",\n\t\"npm registry request was cancelled\": \"npm registry 请求已取消\",\n\t\"npm registry request failed\": \"npm registry 请求失败\",\n\t\"npm registry rate limit was exceeded\": \"npm registry 速率限制已触发\",\n\t\"npm registry redirect limit exceeded\": \"超出 npm registry 重定向次数上限\",\n\t\"npm package was not found on the registry\": \"注册表中未找到该 npm 包\",\n\t\"npm registry request did not succeed\": \"npm registry 请求未成功\",\n\t\"npm tarball download was cancelled\": \"npm tarball 下载已取消\",\n\t\"npm tarball download did not succeed\": \"npm tarball 下载未成功\",\n\t\"plugin package download was cancelled\": \"插件包下载已取消\",\n\t\"plugin package download timed out\": \"插件包下载超时\",\n\t\"plugin package download failed\": \"插件包下载失败\",\n\t\"plugin package redirect limit exceeded\": \"超出插件包重定向次数上限\",\n\t\"plugin package download did not succeed\": \"插件包下载未成功\",\n\t\"plugin package response has no body\": \"插件包响应没有响应体\",\n\t\"release API request timed out\": \"release API 请求超时\",\n\t\"release API request was cancelled\": \"release API 请求已取消\",\n\t\"release API request failed\": \"release API 请求失败\",\n\t\"repo or release was not found\": \"未找到仓库或 release\",\n\t\"release API request did not succeed\": \"release API 请求未成功\",\n\t\"release API redirect limit exceeded\": \"超出 release API 重定向次数上限\",\n\t\"release asset download was cancelled\": \"release 资产下载已取消\",\n\t\"repo has no published release\": \"仓库没有已发布的 release\",\n\t\"Plugin registry request failed\": \"插件注册表请求失败\",\n\t\"Plugin registry request was cancelled\": \"插件注册表请求已取消\",\n\t\"Plugin registry request timed out\": \"插件注册表请求超时\",\n\t\"Disk registry source read was cancelled\": \"磁盘注册表源读取已取消\",\n\t\"Install store index could not be read\": \"无法读取安装店索引\",\n\t\"Installed plugin manifest could not be read\": \"无法读取已安装插件的 manifest\",\n\t\"Plugin registry operation was cancelled\": \"插件注册表操作已取消\",\n\t\"only toggles the enabled flag; the record lifecycle is {lifecycle} and the runtime will not load it\":\n\t\t\"仅切换 enabled 标志;该记录 lifecycle 为 {lifecycle},运行时不会加载\",\n\n\t// --- provider-composer.ts OAuth 手动输码 ---\n\t\"Paste the authorization code\": \"请粘贴授权码\",\n};\n"]}
|
|
1
|
+
{"version":3,"file":"core-errors.js","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/core-errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAA2B;IACjD,8EAAkD;IAClD,8DAA8D,EAC7D,oEAAwC;IACzC,6BAA6B,EAAE,6BAAe;IAC9C,oEAAoE,EACnE,qEAAuC;IACxC,4CAA4C,EAAE,+CAAqC;IACnF,oBAAoB,EAAE,cAAM;IAE5B,qEAAyD;IACzD,yIAAyI,EACxI,oHAAkD;IACnD,uDAAuD,EAAE,uDAA+B;IACxF,gEAAgE,EAAE,6DAAuC;IACzG,4DAA4D,EAAE,4DAAsC;IACpG,2CAA2C,EAAE,mCAAa;IAC1D,8DAA8D,EAAE,wDAAwB;IACxF,mDAAmD,EAAE,kDAAsB;IAC3E,6DAA6D,EAAE,6DAAqC;IACpG,iKAAiK,EAChK,sJAAkE;IACnE,6BAA6B,EAAE,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IAE3D,0FAA4D;IAC5D,gCAAgC,EAAE,2BAAmB;IACrD,oCAAoC,EAAE,8BAAoB;IAC1D,6BAA6B,EAAE,2BAAmB;IAClD,sCAAsC,EAAE,oCAAsB;IAC9D,sCAAsC,EAAE,2CAAyB;IACjE,2CAA2C,EAAE,kCAAgB;IAC7D,sCAAsC,EAAE,8BAAoB;IAC5D,oCAAoC,EAAE,6BAAmB;IACzD,sCAAsC,EAAE,6BAAmB;IAC3D,uCAAuC,EAAE,0BAAU;IACnD,mCAAmC,EAAE,uBAAS;IAC9C,gCAAgC,EAAE,uBAAS;IAC3C,wCAAwC,EAAE,sCAAc;IACxD,yCAAyC,EAAE,0BAAU;IACrD,qCAAqC,EAAE,gCAAY;IACnD,+BAA+B,EAAE,0BAAkB;IACnD,mCAAmC,EAAE,6BAAmB;IACxD,4BAA4B,EAAE,0BAAkB;IAChD,+BAA+B,EAAE,4BAAgB;IACjD,qCAAqC,EAAE,6BAAmB;IAC1D,qCAAqC,EAAE,0CAAwB;IAC/D,sCAAsC,EAAE,+BAAiB;IACzD,+BAA+B,EAAE,kCAAkB;IACnD,gCAAgC,EAAE,6BAAW;IAC7C,uCAAuC,EAAE,gCAAY;IACrD,mCAAmC,EAAE,6BAAW;IAChD,yCAAyC,EAAE,mCAAa;IACxD,uCAAuC,EAAE,6BAAW;IACpD,6CAA6C,EAAE,yCAAqB;IACpE,yCAAyC,EAAE,gCAAY;IACvD,qGAAqG,EACpG,wFAAoD;IAErD,kDAA0C;IAC1C,8BAA8B,EAAE,oBAAQ;CACxC,CAAC","sourcesContent":["/**\n * core-errors 域词典(批次⑥):core/plugins 层终端用户可见的 throw 错误消息。\n * 覆盖范围见 docs/design/国际化与本地化.md 与批次⑥登记:配置错误、认证与 API key\n * 失败、网络/超时/HTTP 失败、文件 IO、会话文件损坏、资源缺失、环境限制,以及\n * 插件生态的安装/下载失败。插件开发者契约校验(D 类)不在此域,归批次⑨。\n * key 为英文原文(与调用点逐字一致),占位符 `{name}` 原样保留。\n */\nexport const coreErrors: Record<string, string> = {\n\t// ---- 认证与模型引导(auth-guidance.ts 及其 throw 调用点)----\n\t\"Use /login to log into a provider via OAuth or API key. See:\":\n\t\t\"使用 /login 通过 OAuth 或 API key 登录提供商。参见:\",\n\t\"No models available. {help}\": \"没有可用模型。{help}\",\n\t\"No model selected.\\n\\n{help}\\n\\nThen use /model to select a model.\":\n\t\t\"未选择模型。\\n\\n{help}\\n\\n然后使用 /model 选择模型。\",\n\t\"No API key found for {provider}.\\n\\n{help}\": \"未找到 {provider} 的 API key。\\n\\n{help}\",\n\t\"the selected model\": \"所选模型\",\n\n\t// ---- 会话管理(session-manager.ts / session-storage.ts)----\n\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\":\n\t\t\"会话 id 不能为空,只能包含字母数字字符、'-'、'_' 和 '.',且首尾必须是字母数字字符\",\n\t\"Session file is not a valid {appName} session: {path}\": \"会话文件不是有效的 {appName} 会话:{path}\",\n\t\"Invalid compaction operationId in session entry: {operationId}\": \"会话条目中的压缩 operationId 无效:{operationId}\",\n\t\"Duplicate compaction operationId in session: {operationId}\": \"会话中存在重复的压缩 operationId:{operationId}\",\n\t\"Session append failed and rollback failed\": \"会话追加失败且回滚失败\",\n\t\"Cannot fork: source session file is empty or invalid: {path}\": \"无法分叉:源会话文件为空或无效:{path}\",\n\t\"Cannot fork: source session has no header: {path}\": \"无法分叉:源会话缺少头信息:{path}\",\n\t\"session guard lock timeout after {timeoutMs} ms: {lockPath}\": \"会话守护锁在 {timeoutMs} 毫秒后超时:{lockPath}\",\n\t\"Session file is owned by another live process (pid {pid}): {sessionFile}. Close that process first; concurrent writers would silently fork the session history.\":\n\t\t\"会话文件被另一个存活进程占用(pid {pid}):{sessionFile}。请先关闭该进程;并发写入会导致会话历史静默分叉。\",\n\t\"Session file: {sessionFile}\": \"会话文件:{sessionFile}\",\n\t\"Stored session working directory does not exist: {sessionCwd}{sessionFile}\\nCurrent working directory: {fallbackCwd}\":\n\t\t\"会话中记录的工作目录不存在:{sessionCwd}{sessionFile}\\n当前工作目录:{fallbackCwd}\",\n\n\t// ---- 会话运行时状态与操作守卫(agent-session*.ts)----\n\t\"Input rejected by an input gate\": \"输入被输入门拒绝\",\n\t\"Input rejected by an input gate: {reason}\": \"输入被输入门拒绝:{reason}\",\n\t\"Session reload in progress; prompts are unavailable\": \"会话重载进行中;暂无法提交提示\",\n\t\"Session reload in progress; compaction is unavailable\": \"会话重载进行中;暂无法压缩\",\n\t\"Session reload in progress; compaction was not started\": \"会话重载进行中;压缩未启动\",\n\t\"Session reload in progress; tree navigation is unavailable\": \"会话重载进行中;暂无法导航会话树\",\n\t\"Session reload in progress; bash execution is unavailable\": \"会话重载进行中;暂无法执行 bash\",\n\t\"Session reload in progress; bash results cannot be recorded\": \"会话重载进行中;无法记录 bash 结果\",\n\t\"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\":\n\t\t\"压缩进行中无法提交提示。请等待压缩完成后再重试。\",\n\t\"Authentication failed for \\\"{provider}\\\". Credentials may have expired or network is unavailable. Run '/login {provider}' to re-authenticate.\":\n\t\t\"“{provider}”认证失败。凭证可能已过期或网络不可用。请运行 '/login {provider}' 重新认证。\",\n\t\"No model is set on this session's agent\": \"本会话的 agent 未设置模型\",\n\t\"No API key for {provider}/{model}\": \"没有 {provider}/{model} 的 API key\",\n\t\"Already compacted\": \"已压缩过\",\n\t\"Nothing to compact (session too small)\": \"没有可压缩的内容(会话太小)\",\n\t\"Wait for the current response to finish before navigating the session tree.\": \"请等待当前响应结束再导航会话树。\",\n\t\"Wait for the current compaction or tree navigation to finish before navigating the session tree.\":\n\t\t\"请等待当前压缩或树导航结束再导航会话树。\",\n\t\"No model available for summarization\": \"没有可用于生成摘要的模型\",\n\t\"Branch navigation is already in progress\": \"分支导航已在进行中\",\n\t\"Branch summary policy is not registered: {name}\": \"分支摘要策略未注册:{name}\",\n\t\"Configured context strategy is not registered: {name}\": \"已配置的上下文策略未注册:{name}\",\n\t\"Configured context strategy is not registered after reload: {name}\": \"重载后已配置的上下文策略未注册:{name}\",\n\t\"This session has not been saved yet. Send a message before cloning or forking it.\":\n\t\t\"本会话尚未保存。请先发送消息再克隆或分叉。\",\n\t\"Failed to create forked session\": \"创建分叉会话失败\",\n\t\"File not found: {path}\": \"文件不存在:{path}\",\n\t\"Skill is duplicated in resources: {name}\": \"技能在资源中重复:{name}\",\n\t\"Skill conflicts with a resource skill: {name}\": \"技能与资源技能冲突:{name}\",\n\n\t// ---- 模型与提供商配置(model-runtime.ts / provider-composer.ts)----\n\t\"Credential {operation} committed for {providerId}, but local synchronization failed\":\n\t\t\"提供商 {providerId} 的凭证 {operation} 已提交,但本地同步失败\",\n\t\"Unknown provider: {provider}\": \"未知提供商:{provider}\",\n\t\"Provider is not configured: {provider}\": \"提供商未配置:{provider}\",\n\t'Provider {providerId}, model {modelId}: no \"api\" specified. Set at provider or model level.':\n\t\t'提供商 {providerId},模型 {modelId}:未指定 \"api\"。请在提供商或模型级别设置。',\n\t'Provider {providerId}: \"baseUrl\" is required when defining custom models.':\n\t\t'提供商 {providerId}:定义自定义模型时必须提供 \"baseUrl\"。',\n\t\"Provider {providerId}, model {modelId}: invalid contextWindow\":\n\t\t\"提供商 {providerId},模型 {modelId}:contextWindow 无效\",\n\t\"Provider {providerId}, model {modelId}: invalid maxTokens\": \"提供商 {providerId},模型 {modelId}:maxTokens 无效\",\n\t'Provider {providerId}: \"baseUrl\" is required when \"oauth\" is set.':\n\t\t'提供商 {providerId}:设置 \"oauth\" 时必须提供 \"baseUrl\"。',\n\t'Provider {providerId}: must specify \"baseUrl\", \"headers\", \"compat\", \"modelOverrides\", or \"models\".':\n\t\t'提供商 {providerId}:必须指定 \"baseUrl\"、\"headers\"、\"compat\"、\"modelOverrides\" 或 \"models\" 之一。',\n\t\"Provider {providerId}: no authentication method configured.\": \"提供商 {providerId}:未配置任何认证方式。\",\n\t'API key for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 API key',\n\n\t// ---- 配置值解析(resolve-config-value.ts)----\n\t\"Failed to resolve {description} from shell command: {command}\": \"无法从 shell 命令解析{description}:{command}\",\n\t\"Failed to resolve {description} from environment variable: {envVar}\": \"无法从环境变量解析{description}:{envVar}\",\n\t\"Failed to resolve {description} from environment variables: {envVars}\":\n\t\t\"无法从环境变量解析{description}:{envVars}\",\n\t\"Failed to resolve {description}\": \"无法解析{description}\",\n\t'{description} header \"{key}\"': '{description}的 header \"{key}\"',\n\n\t// ---- settings 校验(settings-manager.ts / http-dispatcher.ts)----\n\t\"Invalid {settingName} setting: {value}\": \"无效的 {settingName} 设置:{value}\",\n\t\"Invalid compaction.{field} setting: {value}. Expected a non-negative safe integer.\":\n\t\t\"无效的 compaction.{field} 设置:{value}。应为非负安全整数。\",\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"] setting: {value}. Expected an object.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"] 设置:{value}。应为对象。',\n\t'Invalid compaction.modelOverrides[\"{modelKey}\"].{field} setting: {value}. Expected a non-negative safe integer.':\n\t\t'无效的 compaction.modelOverrides[\"{modelKey}\"].{field} 设置:{value}。应为非负安全整数。',\n\t\"Invalid httpIdleTimeoutMs setting: {value}\": \"无效的 httpIdleTimeoutMs 设置:{value}\",\n\t\"Invalid HTTP idle timeout: {value}\": \"无效的 HTTP 空闲超时:{value}\",\n\n\t// ---- 凭证存储(auth-storage.ts)----\n\t\"Failed to read auth.json: {reason}\": \"读取 auth.json 失败:{reason}\",\n\t\"Invalid auth.json: expected an object\": \"auth.json 无效:应为对象\",\n\t'Invalid auth.json credential for provider \"{providerId}\"': '提供商 \"{providerId}\" 的 auth.json 凭证无效',\n\t\"Read-only credential storage cannot modify auth.json\": \"只读凭证存储无法修改 auth.json\",\n\n\t// ---- 模型目录与压缩(remote-catalog-provider.ts / compaction.ts)----\n\t'Invalid model catalog for provider \"{providerId}\"': '提供商 \"{providerId}\" 的模型目录无效',\n\t\"Model catalog request failed for {providerId}: {status}\": \"提供商 {providerId} 的模型目录请求失败:{status}\",\n\t\"First kept entry has no UUID - session may need migration\": \"首个保留条目没有 UUID——会话可能需要迁移\",\n\n\t// ---- 导出(src/export-html/index.ts)----\n\t\"Cannot export in-memory session to HTML\": \"无法将内存中的会话导出为 HTML\",\n\t\"Nothing to export yet - start a conversation first\": \"暂无可导出内容——请先开始对话\",\n\n\t// ---- SDK 会话创建与插件装载(sdk.ts / capability-plugin.ts / capability-runtime.ts)----\n\t\"Failed to read capability plugin manifest {path}: {reason}\": \"读取能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to inspect capability plugin directory {directory}: {reason}\": \"检查能力插件目录失败 {directory}:{reason}\",\n\t\"Capability plugin path must be a directory: {directory}\": \"能力插件路径必须是目录:{directory}\",\n\t\"Failed to resolve capability plugin directory {directory}: {reason}\": \"解析能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to read capability plugin directory {directory}: {reason}\": \"读取能力插件目录失败 {directory}:{reason}\",\n\t\"Failed to resolve capability plugin manifest {path}: {reason}\": \"解析能力插件 manifest 失败 {path}:{reason}\",\n\t\"Failed to import capability plugin entry {path}: {reason}\": \"导入能力插件入口失败 {path}:{reason}\",\n\t\"Plugin capability is required but unavailable: {capabilityId}@{version} ({pluginId})\":\n\t\t\"必需的插件能力不可用:{capabilityId}@{version}({pluginId})\",\n\t'Session is bound to suite \"{boundSuiteId}\" and cannot resume with \"{suiteId}\"; rerun with --rebind-suite to adopt the new suite, or create a new session':\n\t\t'会话已绑定 suite \"{boundSuiteId}\",无法以 \"{suiteId}\" 恢复;请加 --rebind-suite 重新运行以切换到新 suite,或创建新会话',\n\t\"Session Profile identity drift detected (the active plugin set changed since the conversation started); rerun with --rebind-suite to adopt the new plugin set, or create a new session\":\n\t\t\"检测到会话 Profile 身份漂移(对话开始后生效的插件集发生了变化);请加 --rebind-suite 重新运行以采用新插件集,或创建新会话\",\n\n\t// ---- 包管理与命令执行(package-manager.ts / package-source.ts / package-install-host.ts / config.ts)----\n\t\"Path does not exist: {path}\": \"路径不存在:{path}\",\n\t\"Unsupported install source: {source}\": \"不支持的安装源:{source}\",\n\t\"Unsupported remove source: {source}\": \"不支持的移除源:{source}\",\n\t\"Missing source: {source}\": \"源缺失:{source}\",\n\t\"Empty response from npm view\": \"npm view 返回空响应\",\n\t\"Unexpected response from npm view\": \"npm view 返回意外响应\",\n\t\"Failed to determine remote HEAD\": \"无法确定远端 HEAD\",\n\t\"Unsupported upstream remote: {upstream}\": \"不支持的 upstream 远端:{upstream}\",\n\t\"Missing upstream branch name\": \"缺少 upstream 分支名\",\n\t\"Failed to run {command} {args}: {reason}\": \"执行 {command} {args} 失败:{reason}\",\n\t\"Failed to run {command}: {reason}\": \"执行 {command} 失败:{reason}\",\n\t\"No matching package found for {source}\": \"未找到与 {source} 匹配的包\",\n\t\"No matching package found for {source}. Did you mean {suggestion}?\":\n\t\t\"未找到与 {source} 匹配的包。你是想找 {suggestion} 吗?\",\n\t\"Invalid npmCommand: first array entry must be a non-empty command\": \"无效的 npmCommand:数组第一项必须是非空命令\",\n\n\t// ---- MCP(plugins/mcp-http / agent-session-services.ts)----\n\t\"MCP HTTP transport error: {reason}\": \"MCP HTTP 传输错误:{reason}\",\n\t\"MCP HTTP transport is closed\": \"MCP HTTP 传输已关闭\",\n\t\"MCP HTTP transport returned HTTP {status}\": \"MCP HTTP 传输返回 HTTP {status}\",\n\t\"MCP HTTP transport returned non-JSON body: {reason}\": \"MCP HTTP 传输返回了非 JSON 响应体:{reason}\",\n\t\"MCP error {code}: {message}\": \"MCP 错误 {code}:{message}\",\n\t\"unknown error\": \"未知错误\",\n\t\"MCP tools/list result must contain tools[]\": \"MCP tools/list 结果必须包含 tools[]\",\n\t\"MCP tool requires a non-empty name\": \"MCP 工具必须具有非空名称\",\n\n\t// ---- 插件生态:获取与分发失败表(plugin-acquisition.ts / distribution.ts)----\n\t\"Plugin ref is invalid\": \"插件 ref 无效\",\n\t\"Local plugin ref exists but is neither a directory nor a .zip/.tgz file\":\n\t\t\"本地插件 ref 存在,但既不是目录也不是 .zip/.tgz 文件\",\n\t\"Plugin ref URL scheme is not supported\": \"不支持插件 ref 的 URL 协议\",\n\t\"Plugin ref #sha256 digest fragment is invalid\": \"插件 ref 的 #sha256 摘要片段无效\",\n\t\"Plugin npm package ref is invalid\": \"插件 npm 包 ref 无效\",\n\t\"Plugin package acquisition was cancelled\": \"插件包获取已取消\",\n\t\"Plugin package download failed\": \"插件包下载失败\",\n\t\"Plugin npm package was not found on the registry\": \"注册表中未找到该插件 npm 包\",\n\t\"No npm package version matches the requested range\": \"没有匹配所请求范围的 npm 包版本\",\n\t\"Plugin package bytes do not match the expected digest\": \"插件包字节与预期摘要不匹配\",\n\t\"Plugin package bytes are neither a zip nor a tgz\": \"插件包字节既不是 zip 也不是 tgz\",\n\t\"Plugin package contents are invalid\": \"插件包内容无效\",\n\t\"Plugin package exceeds the configured size budget\": \"插件包超出配置的大小预算\",\n\t\"Plugin release was not found\": \"未找到插件 release\",\n\t\"Plugin release has no .zip/.tgz asset\": \"插件 release 没有 .zip/.tgz 资产\",\n\t\"Plugin release has multiple .zip/.tgz assets\": \"插件 release 有多个 .zip/.tgz 资产\",\n\t\"Plugin release API rate limit was exceeded\": \"插件 release API 超出速率限制\",\n\t\"Plugin distribution is unsupported on this host\": \"此宿主不支持插件分发\",\n\t\"Plugin distribution operation was cancelled\": \"插件分发操作已取消\",\n\t\"Plugin distribution descriptor is invalid\": \"插件分发描述符无效\",\n\t\"Plugin distribution metadata is invalid\": \"插件分发元数据无效\",\n\t\"Plugin distribution artifact handle is invalid\": \"插件分发产物句柄无效\",\n\t\"Plugin distribution source does not match the descriptor\": \"插件分发来源与描述符不匹配\",\n\t\"Plugin distribution plugin identity does not match the descriptor\": \"插件分发的插件身份与描述符不匹配\",\n\t\"Plugin distribution digest does not match the descriptor\": \"插件分发摘要与描述符不匹配\",\n\t\"Plugin distribution signature was rejected\": \"插件分发签名被拒绝\",\n\t\"Plugin distribution descriptor has expired\": \"插件分发描述符已过期\",\n\t\"Plugin distribution size does not match the descriptor\": \"插件分发大小与描述符不匹配\",\n\t\"Plugin distribution media type does not match the descriptor\": \"插件分发媒体类型与描述符不匹配\",\n\t\"Plugin distribution host operation failed\": \"插件分发宿主操作失败\",\n\t\"Plugin distribution artifact release failed\": \"插件分发产物释放失败\",\n\n\t// ---- 插件生态:网络下载与安装店 IO(node-*-source.ts / registry.ts)----\n\t\"npm registry request timed out\": \"npm registry 请求超时\",\n\t\"npm registry request was cancelled\": \"npm registry 请求已取消\",\n\t\"npm registry request failed\": \"npm registry 请求失败\",\n\t\"npm registry rate limit was exceeded\": \"npm registry 速率限制已触发\",\n\t\"npm registry redirect limit exceeded\": \"超出 npm registry 重定向次数上限\",\n\t\"npm package was not found on the registry\": \"注册表中未找到该 npm 包\",\n\t\"npm registry request did not succeed\": \"npm registry 请求未成功\",\n\t\"npm tarball download was cancelled\": \"npm tarball 下载已取消\",\n\t\"npm tarball download did not succeed\": \"npm tarball 下载未成功\",\n\t\"plugin package download was cancelled\": \"插件包下载已取消\",\n\t\"plugin package download timed out\": \"插件包下载超时\",\n\t\"plugin package download failed\": \"插件包下载失败\",\n\t\"plugin package redirect limit exceeded\": \"超出插件包重定向次数上限\",\n\t\"plugin package download did not succeed\": \"插件包下载未成功\",\n\t\"plugin package response has no body\": \"插件包响应没有响应体\",\n\t\"release API request timed out\": \"release API 请求超时\",\n\t\"release API request was cancelled\": \"release API 请求已取消\",\n\t\"release API request failed\": \"release API 请求失败\",\n\t\"repo or release was not found\": \"未找到仓库或 release\",\n\t\"release API request did not succeed\": \"release API 请求未成功\",\n\t\"release API redirect limit exceeded\": \"超出 release API 重定向次数上限\",\n\t\"release asset download was cancelled\": \"release 资产下载已取消\",\n\t\"repo has no published release\": \"仓库没有已发布的 release\",\n\t\"Plugin registry request failed\": \"插件注册表请求失败\",\n\t\"Plugin registry request was cancelled\": \"插件注册表请求已取消\",\n\t\"Plugin registry request timed out\": \"插件注册表请求超时\",\n\t\"Disk registry source read was cancelled\": \"磁盘注册表源读取已取消\",\n\t\"Install store index could not be read\": \"无法读取安装店索引\",\n\t\"Installed plugin manifest could not be read\": \"无法读取已安装插件的 manifest\",\n\t\"Plugin registry operation was cancelled\": \"插件注册表操作已取消\",\n\t\"only toggles the enabled flag; the record lifecycle is {lifecycle} and the runtime will not load it\":\n\t\t\"仅切换 enabled 标志;该记录 lifecycle 为 {lifecycle},运行时不会加载\",\n\n\t// --- provider-composer.ts OAuth 手动输码 ---\n\t\"Paste the authorization code\": \"请粘贴授权码\",\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-components-misc.d.ts","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/tui-components-misc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tui-components-misc.d.ts","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/tui-components-misc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4GpD,CAAC","sourcesContent":["/**\n * 批次④ misc 域词典(docs/design/国际化与本地化.md §词典结构):\n * 覆盖 components/ 下的 footer、status-indicator、bash-execution、\n * assistant-message、user-message-selector、tree-render、branch-summary、\n * compaction-summary、skill-invocation、show-images、dialog-editor、dialog-input、\n * dialog-selector、mermaid、custom-entry、custom-message、tool-execution、\n * theme-selector、bordered-loader、settings-submenu。key 为英文原文(与调用点\n * 逐字一致;`t()` 会 trim key,调用点的前导/尾随空白在 `t()` 外拼接),\n * value 为简体中文译文,`{占位符}` 原样保留。数据值与纯格式(token 缩写、\n * 计数、时间戳)不入词典;skill 等术语保留原文(回退 key)。\n */\nexport const tuiComponentsMisc: Record<string, string> = {\n\t// ---- footer ----\n\t\"(sub)\": \"(订阅)\",\n\t\"(auto)\": \"(自动)\",\n\t\"no-model\": \"无模型\",\n\t\"{model} • thinking off\": \"{model} • 思考关闭\",\n\n\t// ---- status-indicator ----\n\t\"Retrying ({attempt}/{max}) in {seconds}s... ({key} to cancel)\":\n\t\t\"第 {attempt}/{max} 次重试,{seconds} 秒后...({key} 取消)\",\n\t\"Compacting context... ({key} to cancel)\": \"正在压缩上下文...({key} 取消)\",\n\t\"Context overflow detected, Auto-compacting... ({key} to cancel)\": \"检测到上下文溢出,自动压缩中...({key} 取消)\",\n\t\"Auto-compacting... ({key} to cancel)\": \"自动压缩中...({key} 取消)\",\n\t\"Summarizing branch... ({key} to cancel)\": \"正在生成分支摘要...({key} 取消)\",\n\n\t// ---- bash-execution ----\n\t\"Running... ({key} to cancel)\": \"运行中...({key} 取消)\",\n\t\"({key} to collapse)\": \"({key} 折叠)\",\n\t\"... {count} more lines ({key} to expand)\": \"... 还有 {count} 行({key} 展开)\",\n\t\"(cancelled)\": \"(已取消)\",\n\t\"(exit {code})\": \"(退出码 {code})\",\n\t\"Output truncated. Full output: {path}\": \"输出已截断。完整输出:{path}\",\n\n\t// ---- assistant-message ----\n\t\"Thinking...\": \"思考中...\",\n\t\"Response was truncated before completion.\": \"响应在完成前被截断。\",\n\t\"Operation aborted\": \"操作已中止\",\n\t\"Error: {message}\": \"错误:{message}\",\n\n\t// ---- user-message-selector ----\n\t\"No user messages found\": \"未找到用户消息\",\n\t\"Message {position} of {total}\": \"第 {position} 条,共 {total} 条\",\n\t\"Fork from Message\": \"从消息分叉\",\n\t\"Select a user message to copy the active path up to that point into a new session\":\n\t\t\"选择一条用户消息,将截至该点的当前路径复制到新会话\",\n\n\t// ---- queue-manager-selector(/queue-list 管理器)----\n\t\"Queued Messages\": \"排队消息\",\n\tSteering: \"转向\",\n\t\"Follow-up\": \"后续\",\n\t\"alt+up/alt+down move · delete remove · enter restore · esc close\":\n\t\t\"alt+up/alt+down 移动 · delete 移除 · enter 取回编辑器 · esc 关闭\",\n\n\t// ---- tree-render(/tree 高密度行,译文极短)----\n\t\"user:\": \"用户:\",\n\t\"assistant:\": \"助手:\",\n\t\"(aborted)\": \"(已中止)\",\n\t\"(no content)\": \"(无内容)\",\n\ttool: \"工具\",\n\t\"[bash]: {command}\": \"[bash]: {command}\",\n\t\"[compaction: {tokens}k tokens]\": \"[压缩: {tokens}k tokens]\",\n\t\"[branch summary]:\": \"[分支摘要]:\",\n\t\"[model: {model}]\": \"[模型: {model}]\",\n\t\"[thinking: {level}]\": \"[思考: {level}]\",\n\t\"[custom: {type}]\": \"[自定义: {type}]\",\n\t\"[label: {label}]\": \"[标签: {label}]\",\n\t\"(cleared)\": \"(已清除)\",\n\t\"[title: {name}]\": \"[标题: {name}]\",\n\tempty: \"空\",\n\t\"[read: {display}]\": \"[读取: {display}]\",\n\t\"[write: {path}]\": \"[写入: {path}]\",\n\t\"[edit: {path}]\": \"[编辑: {path}]\",\n\t\"[bash: {cmd}]\": \"[bash: {cmd}]\",\n\t\"[grep: /{pattern}/ in {path}]\": \"[搜索: /{pattern}/ 于 {path}]\",\n\t\"[find: {pattern} in {path}]\": \"[查找: {pattern} 于 {path}]\",\n\t\"[ls: {path}]\": \"[列目录: {path}]\",\n\t\"[{name}: {args}]\": \"[{name}: {args}]\",\n\n\t// ---- branch-summary / compaction-summary / skill-invocation ----\n\t\"[branch]\": \"[分支]\",\n\t\"**Branch Summary**\": \"**分支摘要**\",\n\t\"Branch summary ({key} to expand)\": \"分支摘要({key} 展开)\",\n\t\"[compaction]\": \"[压缩]\",\n\t\"**Compacted from {tokens} tokens**\": \"**已从 {tokens} tokens 压缩**\",\n\t\"Compacted from {tokens} tokens ({key} to expand)\": \"已从 {tokens} tokens 压缩({key} 展开)\",\n\t\"({key} to expand)\": \"({key} 展开)\",\n\n\t// ---- show-images-selector ----\n\tYes: \"是\",\n\tNo: \"否\",\n\t\"Show images inline in terminal\": \"在终端内联显示图片\",\n\t\"Show text placeholder instead\": \"改为显示文本占位符\",\n\n\t// ---- dialog-editor / dialog-input / dialog-selector / bordered-loader ----\n\tsubmit: \"提交\",\n\tnewline: \"换行\",\n\t\"external editor\": \"外部编辑器\",\n\tselect: \"选择\",\n\n\t// ---- mermaid ----\n\t\"Mermaid diagram not rendered: {warning}{suffix}\": \"Mermaid 图表未渲染:{warning}{suffix}\",\n\t\"+{count} more\": \"还有 {count} 条\",\n\n\t// ---- custom-entry ----\n\t\"[{type}] renderer failed: {message}\": \"[{type}] 渲染器失败:{message}\",\n\n\t// ---- tool-execution ----\n\t\"... ({count} more lines, {key} to expand)\": \"...(还有 {count} 行,{key} 展开)\",\n\t\"... ({count} lines truncated)\": \"...(已截断 {count} 行)\",\n\t\"... ({count} lines truncated; full output: {path})\": \"...(已截断 {count} 行;完整输出: {path})\",\n\n\t// ---- theme-selector ----\n\t\"(current)\": \"(当前)\",\n\n\t// ---- settings-submenu ----\n\t\"Type to filter · Enter to select · Esc to go back\": \"输入以过滤 · Enter 选择 · Esc 返回\",\n\t\"Enter to select · Esc to go back\": \"Enter 选择 · Esc 返回\",\n\t\"Step {index}/{total}\": \"第 {index}/{total} 步\",\n};\n"]}
|
|
@@ -92,6 +92,8 @@ export const tuiComponentsMisc = {
|
|
|
92
92
|
"[{type}] renderer failed: {message}": "[{type}] 渲染器失败:{message}",
|
|
93
93
|
// ---- tool-execution ----
|
|
94
94
|
"... ({count} more lines, {key} to expand)": "...(还有 {count} 行,{key} 展开)",
|
|
95
|
+
"... ({count} lines truncated)": "...(已截断 {count} 行)",
|
|
96
|
+
"... ({count} lines truncated; full output: {path})": "...(已截断 {count} 行;完整输出: {path})",
|
|
95
97
|
// ---- theme-selector ----
|
|
96
98
|
"(current)": "(当前)",
|
|
97
99
|
// ---- settings-submenu ----
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-components-misc.js","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/tui-components-misc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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,iBAAO;IACpB,iBAAiB,EAAE,kBAAc;IACjC,KAAK,EAAE,KAAG;IACV,mBAAmB,EAAE,qBAAiB;IACtC,iBAAiB,EAAE,kBAAc;IACjC,gBAAgB,EAAE,kBAAc;IAChC,eAAe,EAAE,eAAe;IAChC,+BAA+B,EAAE,kCAA4B;IAC7D,6BAA6B,EAAE,gCAA0B;IACzD,cAAc,EAAE,qBAAe;IAC/B,kBAAkB,EAAE,kBAAkB;IAEtC,mEAAmE;IACnE,UAAU,EAAE,UAAM;IAClB,oBAAoB,EAAE,kBAAU;IAChC,kCAAkC,EAAE,gCAAgB;IACpD,cAAc,EAAE,UAAM;IACtB,oCAAoC,EAAE,mCAA2B;IACjE,kDAAkD,EAAE,iDAAiC;IACrF,mBAAmB,EAAE,oBAAY;IAEjC,iCAAiC;IACjC,GAAG,EAAE,KAAG;IACR,EAAE,EAAE,KAAG;IACP,gCAAgC,EAAE,6BAAW;IAC7C,+BAA+B,EAAE,6BAAW;IAE5C,6EAA6E;IAC7E,MAAM,EAAE,QAAI;IACZ,OAAO,EAAE,QAAI;IACb,iBAAiB,EAAE,iBAAO;IAC1B,MAAM,EAAE,QAAI;IAEZ,oBAAoB;IACpB,iDAAiD,EAAE,6CAAiC;IACpF,eAAe,EAAE,oBAAc;IAE/B,yBAAyB;IACzB,qCAAqC,EAAE,sCAA0B;IAEjE,2BAA2B;IAC3B,2CAA2C,EAAE,4CAA4B;
|
|
1
|
+
{"version":3,"file":"tui-components-misc.js","sourceRoot":"","sources":["../../../../../src/core/i18n/locales/zh-cn/tui-components-misc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACxD,mBAAmB;IACnB,OAAO,EAAE,cAAM;IACf,QAAQ,EAAE,cAAM;IAChB,UAAU,EAAE,WAAK;IACjB,0BAAwB,EAAE,0BAAgB;IAE1C,6BAA6B;IAC7B,+DAA+D,EAC9D,uEAAiD;IAClD,yCAAyC,EAAE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ACzD,cAAc,EAAE,qBAAe;IAC/B,kBAAkB,EAAE,kBAAkB;IAEtC,mEAAmE;IACnE,UAAU,EAAE,UAAM;IAClB,oBAAoB,EAAE,kBAAU;IAChC,kCAAkC,EAAE,gCAAgB;IACpD,cAAc,EAAE,UAAM;IACtB,oCAAoC,EAAE,mCAA2B;IACjE,kDAAkD,EAAE,iDAAiC;IACrF,mBAAmB,EAAE,oBAAY;IAEjC,iCAAiC;IACjC,GAAG,EAAE,KAAG;IACR,EAAE,EAAE,KAAG;IACP,gCAAgC,EAAE,6BAAW;IAC7C,+BAA+B,EAAE,6BAAW;IAE5C,6EAA6E;IAC7E,MAAM,EAAE,QAAI;IACZ,OAAO,EAAE,QAAI;IACb,iBAAiB,EAAE,iBAAO;IAC1B,MAAM,EAAE,QAAI;IAEZ,oBAAoB;IACpB,iDAAiD,EAAE,6CAAiC;IACpF,eAAe,EAAE,oBAAc;IAE/B,yBAAyB;IACzB,qCAAqC,EAAE,sCAA0B;IAEjE,2BAA2B;IAC3B,2CAA2C,EAAE,4CAA4B;IACzE,+BAA+B,EAAE,gCAAoB;IACrD,oDAAoD,EAAE,uDAAiC;IAEvF,2BAA2B;IAC3B,WAAW,EAAE,cAAM;IAEnB,6BAA6B;IAC7B,qDAAmD,EAAE,+CAA2B;IAChF,mCAAkC,EAAE,4BAAmB;IACvD,sBAAsB,EAAE,yBAAqB;CAC7C,CAAC","sourcesContent":["/**\n * 批次④ misc 域词典(docs/design/国际化与本地化.md §词典结构):\n * 覆盖 components/ 下的 footer、status-indicator、bash-execution、\n * assistant-message、user-message-selector、tree-render、branch-summary、\n * compaction-summary、skill-invocation、show-images、dialog-editor、dialog-input、\n * dialog-selector、mermaid、custom-entry、custom-message、tool-execution、\n * theme-selector、bordered-loader、settings-submenu。key 为英文原文(与调用点\n * 逐字一致;`t()` 会 trim key,调用点的前导/尾随空白在 `t()` 外拼接),\n * value 为简体中文译文,`{占位符}` 原样保留。数据值与纯格式(token 缩写、\n * 计数、时间戳)不入词典;skill 等术语保留原文(回退 key)。\n */\nexport const tuiComponentsMisc: Record<string, string> = {\n\t// ---- footer ----\n\t\"(sub)\": \"(订阅)\",\n\t\"(auto)\": \"(自动)\",\n\t\"no-model\": \"无模型\",\n\t\"{model} • thinking off\": \"{model} • 思考关闭\",\n\n\t// ---- status-indicator ----\n\t\"Retrying ({attempt}/{max}) in {seconds}s... ({key} to cancel)\":\n\t\t\"第 {attempt}/{max} 次重试,{seconds} 秒后...({key} 取消)\",\n\t\"Compacting context... ({key} to cancel)\": \"正在压缩上下文...({key} 取消)\",\n\t\"Context overflow detected, Auto-compacting... ({key} to cancel)\": \"检测到上下文溢出,自动压缩中...({key} 取消)\",\n\t\"Auto-compacting... ({key} to cancel)\": \"自动压缩中...({key} 取消)\",\n\t\"Summarizing branch... ({key} to cancel)\": \"正在生成分支摘要...({key} 取消)\",\n\n\t// ---- bash-execution ----\n\t\"Running... ({key} to cancel)\": \"运行中...({key} 取消)\",\n\t\"({key} to collapse)\": \"({key} 折叠)\",\n\t\"... {count} more lines ({key} to expand)\": \"... 还有 {count} 行({key} 展开)\",\n\t\"(cancelled)\": \"(已取消)\",\n\t\"(exit {code})\": \"(退出码 {code})\",\n\t\"Output truncated. Full output: {path}\": \"输出已截断。完整输出:{path}\",\n\n\t// ---- assistant-message ----\n\t\"Thinking...\": \"思考中...\",\n\t\"Response was truncated before completion.\": \"响应在完成前被截断。\",\n\t\"Operation aborted\": \"操作已中止\",\n\t\"Error: {message}\": \"错误:{message}\",\n\n\t// ---- user-message-selector ----\n\t\"No user messages found\": \"未找到用户消息\",\n\t\"Message {position} of {total}\": \"第 {position} 条,共 {total} 条\",\n\t\"Fork from Message\": \"从消息分叉\",\n\t\"Select a user message to copy the active path up to that point into a new session\":\n\t\t\"选择一条用户消息,将截至该点的当前路径复制到新会话\",\n\n\t// ---- queue-manager-selector(/queue-list 管理器)----\n\t\"Queued Messages\": \"排队消息\",\n\tSteering: \"转向\",\n\t\"Follow-up\": \"后续\",\n\t\"alt+up/alt+down move · delete remove · enter restore · esc close\":\n\t\t\"alt+up/alt+down 移动 · delete 移除 · enter 取回编辑器 · esc 关闭\",\n\n\t// ---- tree-render(/tree 高密度行,译文极短)----\n\t\"user:\": \"用户:\",\n\t\"assistant:\": \"助手:\",\n\t\"(aborted)\": \"(已中止)\",\n\t\"(no content)\": \"(无内容)\",\n\ttool: \"工具\",\n\t\"[bash]: {command}\": \"[bash]: {command}\",\n\t\"[compaction: {tokens}k tokens]\": \"[压缩: {tokens}k tokens]\",\n\t\"[branch summary]:\": \"[分支摘要]:\",\n\t\"[model: {model}]\": \"[模型: {model}]\",\n\t\"[thinking: {level}]\": \"[思考: {level}]\",\n\t\"[custom: {type}]\": \"[自定义: {type}]\",\n\t\"[label: {label}]\": \"[标签: {label}]\",\n\t\"(cleared)\": \"(已清除)\",\n\t\"[title: {name}]\": \"[标题: {name}]\",\n\tempty: \"空\",\n\t\"[read: {display}]\": \"[读取: {display}]\",\n\t\"[write: {path}]\": \"[写入: {path}]\",\n\t\"[edit: {path}]\": \"[编辑: {path}]\",\n\t\"[bash: {cmd}]\": \"[bash: {cmd}]\",\n\t\"[grep: /{pattern}/ in {path}]\": \"[搜索: /{pattern}/ 于 {path}]\",\n\t\"[find: {pattern} in {path}]\": \"[查找: {pattern} 于 {path}]\",\n\t\"[ls: {path}]\": \"[列目录: {path}]\",\n\t\"[{name}: {args}]\": \"[{name}: {args}]\",\n\n\t// ---- branch-summary / compaction-summary / skill-invocation ----\n\t\"[branch]\": \"[分支]\",\n\t\"**Branch Summary**\": \"**分支摘要**\",\n\t\"Branch summary ({key} to expand)\": \"分支摘要({key} 展开)\",\n\t\"[compaction]\": \"[压缩]\",\n\t\"**Compacted from {tokens} tokens**\": \"**已从 {tokens} tokens 压缩**\",\n\t\"Compacted from {tokens} tokens ({key} to expand)\": \"已从 {tokens} tokens 压缩({key} 展开)\",\n\t\"({key} to expand)\": \"({key} 展开)\",\n\n\t// ---- show-images-selector ----\n\tYes: \"是\",\n\tNo: \"否\",\n\t\"Show images inline in terminal\": \"在终端内联显示图片\",\n\t\"Show text placeholder instead\": \"改为显示文本占位符\",\n\n\t// ---- dialog-editor / dialog-input / dialog-selector / bordered-loader ----\n\tsubmit: \"提交\",\n\tnewline: \"换行\",\n\t\"external editor\": \"外部编辑器\",\n\tselect: \"选择\",\n\n\t// ---- mermaid ----\n\t\"Mermaid diagram not rendered: {warning}{suffix}\": \"Mermaid 图表未渲染:{warning}{suffix}\",\n\t\"+{count} more\": \"还有 {count} 条\",\n\n\t// ---- custom-entry ----\n\t\"[{type}] renderer failed: {message}\": \"[{type}] 渲染器失败:{message}\",\n\n\t// ---- tool-execution ----\n\t\"... ({count} more lines, {key} to expand)\": \"...(还有 {count} 行,{key} 展开)\",\n\t\"... ({count} lines truncated)\": \"...(已截断 {count} 行)\",\n\t\"... ({count} lines truncated; full output: {path})\": \"...(已截断 {count} 行;完整输出: {path})\",\n\n\t// ---- theme-selector ----\n\t\"(current)\": \"(当前)\",\n\n\t// ---- settings-submenu ----\n\t\"Type to filter · Enter to select · Esc to go back\": \"输入以过滤 · Enter 选择 · Esc 返回\",\n\t\"Enter to select · Esc to go back\": \"Enter 选择 · Esc 返回\",\n\t\"Step {index}/{total}\": \"第 {index}/{total} 步\",\n};\n"]}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import type { ThinkingLevel } from "@agent-forge/agent-core";
|
|
5
5
|
import { type Api, type AuthOperationOptions, type KnownProvider, type Model } from "@agent-forge/ai";
|
|
6
6
|
import type { ModelRuntime } from "./model-runtime.ts";
|
|
7
|
+
export declare const VALID_THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
8
|
+
export declare function isValidThinkingLevel(level: string): level is ThinkingLevel;
|
|
7
9
|
/** Default model IDs for each known provider */
|
|
8
10
|
export declare const defaultModelPerProvider: Record<KnownProvider, string>;
|
|
9
11
|
export interface ScopedModel {
|
|
@@ -1 +1 @@
|
|
|
1
|
-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C;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACpD,YAAY,EAAE,YAAY,CAAC;CAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8E9B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,EACpC,mBAAmB,EAAE,OAAO,EAC5B,YAAY,EAAE,YAAY,GACxB,OAAO,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC,CA+DjF","sourcesContent":["/**\n * Model resolution, scoping, and initial selection\n */\n\nimport type { ThinkingLevel } from \"@agent-forge/agent-core\";\nimport { type Api, type AuthOperationOptions, type KnownProvider, type Model, modelsAreEqual } from \"@agent-forge/ai\";\nimport chalk from \"chalk\";\nimport { minimatch } from \"minimatch\";\nimport { isValidThinkingLevel } from \"../cli/args.ts\";\nimport { DEFAULT_THINKING_LEVEL } from \"./defaults.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\n\n/** Default model IDs for each known provider */\nexport const defaultModelPerProvider: Record<KnownProvider, string> = {\n\t\"amazon-bedrock\": \"us.anthropic.claude-opus-4-6-v1\",\n\t\"ant-ling\": \"Ring-2.6-1T\",\n\tanthropic: \"claude-opus-4-8\",\n\topenai: \"gpt-5.5\",\n\t\"azure-openai-responses\": \"gpt-5.4\",\n\t\"openai-codex\": \"gpt-6.1-sol\",\n\tradius: \"auto\",\n\tnvidia: \"nvidia/nemotron-3-super-120b-a12b\",\n\tdeepseek: \"deepseek-v4-pro\",\n\tgoogle: \"gemini-3.1-pro-preview\",\n\t\"google-vertex\": \"gemini-3.1-pro-preview\",\n\t\"github-copilot\": \"gpt-5.4\",\n\topenrouter: \"moonshotai/kimi-k2.6\",\n\t\"vercel-ai-gateway\": \"zai/glm-5.1\",\n\txai: \"grok-4.6\",\n\tgroq: \"openai/gpt-oss-120b\",\n\tcerebras: \"gpt-oss-120b\",\n\tzai: \"glm-5.3\",\n\t\"zai-coding-cn\": \"glm-5.3\",\n\tmistral: \"devstral-medium-latest\",\n\tminimax: \"MiniMax-M2.7\",\n\t\"minimax-cn\": \"MiniMax-M2.7\",\n\tmoonshotai: \"kimi-k2.6\",\n\t\"moonshotai-cn\": \"kimi-k2.6\",\n\thuggingface: \"moonshotai/Kimi-K2.6\",\n\tfireworks: \"accounts/fireworks/models/kimi-k3\",\n\ttogether: \"moonshotai/Kimi-K3\",\n\tbaseten: \"zai-org/GLM-5.2\",\n\topencode: \"kimi-k2.6\",\n\t\"opencode-go\": \"kimi-k3\",\n\t\"kimi-coding\": \"kimi-for-coding\",\n\t\"cloudflare-workers-ai\": \"@cf/moonshotai/kimi-k2.6\",\n\t\"cloudflare-ai-gateway\": \"workers-ai/@cf/moonshotai/kimi-k2.6\",\n\t\"qwen-token-plan\": \"qwen3.7-max\",\n\t\"qwen-token-plan-cn\": \"qwen3.7-max\",\n\t\"qwen-token-plan-individual\": \"qwen3.8-max\",\n\txiaomi: \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-cn\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-ams\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-sgp\": \"mimo-v2.5-pro\",\n};\n\nexport interface ScopedModel {\n\tmodel: Model<Api>;\n\t/** Thinking level if explicitly specified in pattern (e.g., \"model:high\"), undefined otherwise */\n\tthinkingLevel?: ThinkingLevel;\n}\n\n/**\n * Helper to check if a model ID looks like an alias (no date suffix)\n * Dates are typically in format: -20241022 or -20250929\n */\nfunction isAlias(id: string): boolean {\n\t// Check if ID ends with -latest\n\tif (id.endsWith(\"-latest\")) return true;\n\n\t// Check if ID ends with a date pattern (-YYYYMMDD)\n\tconst datePattern = /-\\d{8}$/;\n\treturn !datePattern.test(id);\n}\n\n/**\n * Find an exact model reference match.\n * Supports either a bare model id or a canonical provider/modelId reference.\n * When matching by bare id, ambiguous matches across providers are rejected.\n */\nexport function findExactModelReferenceMatch(\n\tmodelReference: string,\n\tavailableModels: Model<Api>[],\n): Model<Api> | undefined {\n\tconst trimmedReference = modelReference.trim();\n\tif (!trimmedReference) {\n\t\treturn undefined;\n\t}\n\n\tconst normalizedReference = trimmedReference.toLowerCase();\n\n\tconst canonicalMatches = availableModels.filter(\n\t\t(model) => `${model.provider}/${model.id}`.toLowerCase() === normalizedReference,\n\t);\n\tif (canonicalMatches.length === 1) {\n\t\treturn canonicalMatches[0];\n\t}\n\tif (canonicalMatches.length > 1) {\n\t\treturn undefined;\n\t}\n\n\tconst slashIndex = trimmedReference.indexOf(\"/\");\n\tif (slashIndex !== -1) {\n\t\tconst provider = trimmedReference.substring(0, slashIndex).trim();\n\t\tconst modelId = trimmedReference.substring(slashIndex + 1).trim();\n\t\tif (provider && modelId) {\n\t\t\tconst providerMatches = availableModels.filter(\n\t\t\t\t(model) =>\n\t\t\t\t\tmodel.provider.toLowerCase() === provider.toLowerCase() &&\n\t\t\t\t\tmodel.id.toLowerCase() === modelId.toLowerCase(),\n\t\t\t);\n\t\t\tif (providerMatches.length === 1) {\n\t\t\t\treturn providerMatches[0];\n\t\t\t}\n\t\t\tif (providerMatches.length > 1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst idMatches = availableModels.filter((model) => model.id.toLowerCase() === normalizedReference);\n\treturn idMatches.length === 1 ? idMatches[0] : undefined;\n}\n\n/**\n * Try to match a pattern to a model from the available models list.\n * Returns the matched model or undefined if no match found.\n */\nfunction tryMatchModel(modelPattern: string, availableModels: Model<Api>[]): Model<Api> | undefined {\n\tconst exactMatch = findExactModelReferenceMatch(modelPattern, availableModels);\n\tif (exactMatch) {\n\t\treturn exactMatch;\n\t}\n\n\t// No exact match - fall back to partial matching\n\tconst matches = availableModels.filter(\n\t\t(m) =>\n\t\t\tm.id.toLowerCase().includes(modelPattern.toLowerCase()) ||\n\t\t\tm.name?.toLowerCase().includes(modelPattern.toLowerCase()),\n\t);\n\n\tif (matches.length === 0) {\n\t\treturn undefined;\n\t}\n\n\t// Separate into aliases and dated versions\n\tconst aliases = matches.filter((m) => isAlias(m.id));\n\tconst datedVersions = matches.filter((m) => !isAlias(m.id));\n\n\tif (aliases.length > 0) {\n\t\t// Prefer alias - if multiple aliases, pick the one that sorts highest\n\t\taliases.sort((a, b) => b.id.localeCompare(a.id));\n\t\treturn aliases[0];\n\t} else {\n\t\t// No alias found, pick latest dated version\n\t\tdatedVersions.sort((a, b) => b.id.localeCompare(a.id));\n\t\treturn datedVersions[0];\n\t}\n}\n\nexport interface ParsedModelResult {\n\tmodel: Model<Api> | undefined;\n\t/** Thinking level if explicitly specified in pattern, undefined otherwise */\n\tthinkingLevel?: ThinkingLevel;\n\twarning: string | undefined;\n}\n\nfunction buildFallbackModel(provider: string, modelId: string, availableModels: Model<Api>[]): Model<Api> | undefined {\n\tconst providerModels = availableModels.filter((m) => m.provider === provider);\n\tif (providerModels.length === 0) return undefined;\n\n\tconst defaultId = defaultModelPerProvider[provider as KnownProvider];\n\tconst baseModel = defaultId\n\t\t? (providerModels.find((m) => m.id === defaultId) ?? providerModels[0])\n\t\t: providerModels[0];\n\n\treturn {\n\t\t...baseModel,\n\t\tid: modelId,\n\t\tname: modelId,\n\t};\n}\n\n/**\n * Parse a pattern to extract model and thinking level.\n * Handles models with colons in their IDs (e.g., OpenRouter's :exacto suffix).\n *\n * Algorithm:\n * 1. Try to match full pattern as a model\n * 2. If found, return it with \"off\" thinking level\n * 3. If not found and has colons, split on last colon:\n * - If suffix is valid thinking level, use it and recurse on prefix\n * - If suffix is invalid, warn and recurse on prefix with \"off\"\n *\n * @internal Exported for testing\n */\nexport function parseModelPattern(\n\tpattern: string,\n\tavailableModels: Model<Api>[],\n\toptions?: { allowInvalidThinkingLevelFallback?: boolean },\n): ParsedModelResult {\n\t// Try exact match first\n\tconst exactMatch = tryMatchModel(pattern, availableModels);\n\tif (exactMatch) {\n\t\treturn { model: exactMatch, thinkingLevel: undefined, warning: undefined };\n\t}\n\n\t// No match - try splitting on last colon if present\n\tconst lastColonIndex = pattern.lastIndexOf(\":\");\n\tif (lastColonIndex === -1) {\n\t\t// No colons, pattern simply doesn't match any model\n\t\treturn { model: undefined, thinkingLevel: undefined, warning: undefined };\n\t}\n\n\tconst prefix = pattern.substring(0, lastColonIndex);\n\tconst suffix = pattern.substring(lastColonIndex + 1);\n\n\tif (isValidThinkingLevel(suffix)) {\n\t\t// Valid thinking level - recurse on prefix and use this level\n\t\tconst result = parseModelPattern(prefix, availableModels, options);\n\t\tif (result.model) {\n\t\t\t// Only use this thinking level if no warning from inner recursion\n\t\t\treturn {\n\t\t\t\tmodel: result.model,\n\t\t\t\tthinkingLevel: result.warning ? undefined : suffix,\n\t\t\t\twarning: result.warning,\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t} else {\n\t\t// Invalid suffix\n\t\tconst allowFallback = options?.allowInvalidThinkingLevelFallback ?? true;\n\t\tif (!allowFallback) {\n\t\t\t// In strict mode (CLI --model parsing), treat it as part of the model id and fail.\n\t\t\t// This avoids accidentally resolving to a different model.\n\t\t\treturn { model: undefined, thinkingLevel: undefined, warning: undefined };\n\t\t}\n\n\t\t// Scope mode: recurse on prefix and warn\n\t\tconst result = parseModelPattern(prefix, availableModels, options);\n\t\tif (result.model) {\n\t\t\treturn {\n\t\t\t\tmodel: result.model,\n\t\t\t\tthinkingLevel: undefined,\n\t\t\t\twarning: `Invalid thinking level \"${suffix}\" in pattern \"${pattern}\". Using default instead.`,\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/**\n * Resolve model patterns to actual Model objects with optional thinking levels\n * Format: \"pattern:level\" where :level is optional\n * For each pattern, finds all matching models and picks the best version:\n * 1. Prefer alias (e.g., claude-sonnet-4-5) over dated versions (claude-sonnet-4-5-20250929)\n * 2. If no alias, pick the latest dated version\n *\n * Supports models with colons in their IDs (e.g., OpenRouter's model:exacto).\n * The algorithm tries to match the full pattern first, then progressively\n * strips colon-suffixes to find a match.\n */\nexport interface ModelScopeDiagnostic {\n\ttype: \"warning\";\n\tcode: \"no-match\" | \"invalid-thinking-level\";\n\tmessage: string;\n\tpattern: string;\n}\n\nexport interface ResolveModelScopeResult {\n\tscopedModels: ScopedModel[];\n\tdiagnostics: ModelScopeDiagnostic[];\n}\n\nexport function resolveModelScopeFromModels(\n\tpatterns: string[],\n\tmodels: readonly Model<Api>[],\n): ResolveModelScopeResult {\n\tconst availableModels = [...models];\n\tconst scopedModels: ScopedModel[] = [];\n\tconst diagnostics: ModelScopeDiagnostic[] = [];\n\n\tfor (const pattern of patterns) {\n\t\t// Check if pattern contains glob characters\n\t\tif (pattern.includes(\"*\") || pattern.includes(\"?\") || pattern.includes(\"[\")) {\n\t\t\t// Extract optional thinking level suffix (e.g., \"provider/*:high\")\n\t\t\tconst colonIdx = pattern.lastIndexOf(\":\");\n\t\t\tlet globPattern = pattern;\n\t\t\tlet thinkingLevel: ThinkingLevel | undefined;\n\n\t\t\tif (colonIdx !== -1) {\n\t\t\t\tconst suffix = pattern.substring(colonIdx + 1);\n\t\t\t\tif (isValidThinkingLevel(suffix)) {\n\t\t\t\t\tthinkingLevel = suffix;\n\t\t\t\t\tglobPattern = pattern.substring(0, colonIdx);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst exactMatch = findExactModelReferenceMatch(globPattern, availableModels);\n\t\t\tif (exactMatch) {\n\t\t\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, exactMatch))) {\n\t\t\t\t\tscopedModels.push({ model: exactMatch, thinkingLevel });\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Match against \"provider/modelId\" format OR just model ID\n\t\t\t// This allows \"*sonnet*\" to match without requiring \"anthropic/*sonnet*\"\n\t\t\tconst matchingModels = availableModels.filter((m) => {\n\t\t\t\tconst fullId = `${m.provider}/${m.id}`;\n\t\t\t\treturn minimatch(fullId, globPattern, { nocase: true }) || minimatch(m.id, globPattern, { nocase: true });\n\t\t\t});\n\n\t\t\tif (matchingModels.length === 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tcode: \"no-match\",\n\t\t\t\t\tmessage: `No models match pattern \"${pattern}\"`,\n\t\t\t\t\tpattern,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const model of matchingModels) {\n\t\t\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, model))) {\n\t\t\t\t\tscopedModels.push({ model, thinkingLevel });\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst { model, thinkingLevel, warning } = parseModelPattern(pattern, availableModels);\n\n\t\tif (warning) {\n\t\t\tdiagnostics.push({ type: \"warning\", code: \"invalid-thinking-level\", message: warning, pattern });\n\t\t}\n\n\t\tif (!model) {\n\t\t\tdiagnostics.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tcode: \"no-match\",\n\t\t\t\tmessage: `No models match pattern \"${pattern}\"`,\n\t\t\t\tpattern,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Avoid duplicates\n\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, model))) {\n\t\t\tscopedModels.push({ model, thinkingLevel });\n\t\t}\n\t}\n\n\treturn { scopedModels, diagnostics };\n}\n\nexport async function resolveModelScopeWithDiagnostics(\n\tpatterns: string[],\n\tmodelRuntime: ModelRuntime,\n\toptions?: AuthOperationOptions,\n): Promise<ResolveModelScopeResult> {\n\treturn resolveModelScopeFromModels(patterns, await modelRuntime.getAvailable(undefined, options));\n}\n\nexport async function resolveModelScope(\n\tpatterns: string[],\n\tmodelRuntime: ModelRuntime,\n\toptions?: AuthOperationOptions,\n): Promise<ScopedModel[]> {\n\tconst { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(patterns, modelRuntime, options);\n\tfor (const diagnostic of diagnostics) {\n\t\tconsole.warn(chalk.yellow(`Warning: ${diagnostic.message}`));\n\t}\n\treturn scopedModels;\n}\n\nexport interface ResolveCliModelResult {\n\tmodel: Model<Api> | undefined;\n\tthinkingLevel?: ThinkingLevel;\n\twarning: string | undefined;\n\t/**\n\t * Error message suitable for CLI display.\n\t * When set, model will be undefined.\n\t */\n\terror: string | undefined;\n}\n\n/**\n * Resolve a single model from CLI flags.\n *\n * Supports:\n * - --provider <provider> --model <pattern>\n * - --model <provider>/<pattern>\n * - Fuzzy matching (same rules as model scoping: exact id, then partial id/name)\n *\n * Note: This does not apply the thinking level by itself, but it may *parse* and\n * return a thinking level from \"<pattern>:<thinking>\" so the caller can apply it.\n */\nexport function resolveCliModel(options: {\n\tcliProvider?: string;\n\tcliModel?: string;\n\tcliThinking?: ThinkingLevel;\n\tmodelRuntime: ModelRuntime;\n}): ResolveCliModelResult {\n\tconst { cliProvider, cliModel, cliThinking, modelRuntime } = options;\n\n\tif (!cliModel) {\n\t\treturn { model: undefined, warning: undefined, error: undefined };\n\t}\n\n\t// Important: use *all* models here, not just models with pre-configured auth.\n\t// This allows \"--api-key\" to be used for first-time setup.\n\tconst availableModels = [...modelRuntime.getModels()];\n\tif (availableModels.length === 0) {\n\t\treturn {\n\t\t\tmodel: undefined,\n\t\t\twarning: undefined,\n\t\t\terror: \"No models available. Check your installation or add models to models.json.\",\n\t\t};\n\t}\n\n\t// Build canonical provider lookup (case-insensitive)\n\tconst providerMap = new Map<string, string>();\n\tfor (const m of availableModels) {\n\t\tproviderMap.set(m.provider.toLowerCase(), m.provider);\n\t}\n\n\tlet provider = cliProvider ? providerMap.get(cliProvider.toLowerCase()) : undefined;\n\tif (cliProvider && !provider) {\n\t\treturn {\n\t\t\tmodel: undefined,\n\t\t\twarning: undefined,\n\t\t\terror: `Unknown provider \"${cliProvider}\". Use --list-models to see available providers/models.`,\n\t\t};\n\t}\n\n\t// If no explicit --provider, try to interpret \"provider/model\" format first.\n\t// When the prefix before the first slash matches a known provider, prefer that\n\t// interpretation over matching models whose IDs literally contain slashes\n\t// (e.g. \"zai/glm-5\" should resolve to provider=zai, model=glm-5, not to a\n\t// vercel-ai-gateway model with id \"zai/glm-5\").\n\tlet pattern = cliModel;\n\tlet inferredProvider = false;\n\n\tif (!provider) {\n\t\tconst slashIndex = cliModel.indexOf(\"/\");\n\t\tif (slashIndex !== -1) {\n\t\t\tconst maybeProvider = cliModel.substring(0, slashIndex);\n\t\t\tconst canonical = providerMap.get(maybeProvider.toLowerCase());\n\t\t\tif (canonical) {\n\t\t\t\tprovider = canonical;\n\t\t\t\tpattern = cliModel.substring(slashIndex + 1);\n\t\t\t\tinferredProvider = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// If no provider was inferred from the slash, try exact matches without provider inference.\n\t// This handles models whose IDs naturally contain slashes (e.g. OpenRouter-style IDs).\n\t// Bare exact IDs can exist in multiple providers, so do not choose by catalog order.\n\t// Prefer the sole authenticated provider when there is one; otherwise require an\n\t// explicit provider to avoid silently selecting an unusable provider.\n\tif (!provider) {\n\t\tconst lower = cliModel.toLowerCase();\n\t\tconst exactMatches = availableModels.filter(\n\t\t\t(m) => m.id.toLowerCase() === lower || `${m.provider}/${m.id}`.toLowerCase() === lower,\n\t\t);\n\t\tif (exactMatches.length === 1) {\n\t\t\treturn { model: exactMatches[0], warning: undefined, thinkingLevel: undefined, error: undefined };\n\t\t}\n\t\tif (exactMatches.length > 1) {\n\t\t\tconst authenticatedExactMatches = exactMatches.filter((m) => modelRuntime.hasConfiguredAuth(m.provider));\n\t\t\tif (authenticatedExactMatches.length === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tmodel: authenticatedExactMatches[0],\n\t\t\t\t\twarning: undefined,\n\t\t\t\t\tthinkingLevel: undefined,\n\t\t\t\t\terror: undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst matches = exactMatches\n\t\t\t\t.map((m) => `${m.provider}/${m.id}`)\n\t\t\t\t.sort((a, b) => a.localeCompare(b))\n\t\t\t\t.join(\", \");\n\t\t\tconst authHint =\n\t\t\t\tauthenticatedExactMatches.length === 0\n\t\t\t\t\t? \"No matching provider is authenticated.\"\n\t\t\t\t\t: \"More than one matching provider is authenticated.\";\n\t\t\treturn {\n\t\t\t\tmodel: undefined,\n\t\t\t\twarning: undefined,\n\t\t\t\tthinkingLevel: undefined,\n\t\t\t\terror: `Model \"${cliModel}\" is ambiguous across providers: ${matches}. ${authHint} Use --provider or provider/model.`,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (cliProvider && provider) {\n\t\t// If both were provided, tolerate --model <provider>/<pattern> by stripping the provider prefix\n\t\tconst prefix = `${provider}/`;\n\t\tif (cliModel.toLowerCase().startsWith(prefix.toLowerCase())) {\n\t\t\tpattern = cliModel.substring(prefix.length);\n\t\t}\n\t}\n\n\tconst candidates = provider ? availableModels.filter((m) => m.provider === provider) : availableModels;\n\tconst { model, thinkingLevel, warning } = parseModelPattern(pattern, candidates, {\n\t\tallowInvalidThinkingLevelFallback: false,\n\t});\n\n\tif (model) {\n\t\t// If provider inference matched an unauthenticated provider/model pair, prefer\n\t\t// one exact raw model-id match that is authenticated. This keeps\n\t\t// \"provider/model\" syntax preferred when usable, but handles models whose\n\t\t// literal id starts with a known provider name (for example\n\t\t// commandcode model id \"xiaomi/mimo-v2.5-pro\").\n\t\tif (inferredProvider) {\n\t\t\tconst rawExactMatches = availableModels.filter(\n\t\t\t\t(m) => m.id.toLowerCase() === cliModel.toLowerCase() && !modelsAreEqual(m, model),\n\t\t\t);\n\t\t\tif (rawExactMatches.length > 0 && !modelRuntime.hasConfiguredAuth(model.provider)) {\n\t\t\t\tconst authenticatedRawMatches = rawExactMatches.filter((m) => modelRuntime.hasConfiguredAuth(m.provider));\n\t\t\t\tif (authenticatedRawMatches.length === 1) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmodel: authenticatedRawMatches[0],\n\t\t\t\t\t\tthinkingLevel: undefined,\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t\terror: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { model, thinkingLevel, warning, error: undefined };\n\t}\n\n\t// If we inferred a provider from the slash but found no match within that provider,\n\t// fall back to matching the full input as a raw model id across all models.\n\t// This handles OpenRouter-style IDs like \"openai/gpt-4o:extended\" where \"openai\"\n\t// looks like a provider but the full string is actually a model id on openrouter.\n\tif (inferredProvider) {\n\t\tconst lower = cliModel.toLowerCase();\n\t\tconst exact = availableModels.find(\n\t\t\t(m) => m.id.toLowerCase() === lower || `${m.provider}/${m.id}`.toLowerCase() === lower,\n\t\t);\n\t\tif (exact) {\n\t\t\treturn { model: exact, warning: undefined, thinkingLevel: undefined, error: undefined };\n\t\t}\n\t\t// Also try parseModelPattern on the full input against all models\n\t\tconst fallback = parseModelPattern(cliModel, availableModels, {\n\t\t\tallowInvalidThinkingLevelFallback: false,\n\t\t});\n\t\tif (fallback.model) {\n\t\t\treturn {\n\t\t\t\tmodel: fallback.model,\n\t\t\t\tthinkingLevel: fallback.thinkingLevel,\n\t\t\t\twarning: fallback.warning,\n\t\t\t\terror: undefined,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (provider) {\n\t\t// Parse thinking level suffix from the pattern before building the fallback model,\n\t\t// but only when --thinking is not explicitly provided.\n\t\t// e.g. \"zai-org/GLM-5.1-FP8:high\" → modelId=\"zai-org/GLM-5.1-FP8\", fallbackThinking=\"high\"\n\t\tlet fallbackPattern = pattern;\n\t\tlet fallbackThinking: ThinkingLevel | undefined;\n\t\tif (!cliThinking) {\n\t\t\tconst lastColon = pattern.lastIndexOf(\":\");\n\t\t\tif (lastColon !== -1) {\n\t\t\t\tconst suffix = pattern.substring(lastColon + 1);\n\t\t\t\tif (isValidThinkingLevel(suffix)) {\n\t\t\t\t\tfallbackPattern = pattern.substring(0, lastColon);\n\t\t\t\t\tfallbackThinking = suffix;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst fallbackModel = buildFallbackModel(provider, fallbackPattern, availableModels);\n\t\tif (fallbackModel) {\n\t\t\tconst requestedThinking = cliThinking ?? fallbackThinking;\n\t\t\tconst model =\n\t\t\t\trequestedThinking && requestedThinking !== \"off\" ? { ...fallbackModel, reasoning: true } : fallbackModel;\n\t\t\tconst fallbackWarning = warning\n\t\t\t\t? `${warning} Model \"${fallbackPattern}\" not found for provider \"${provider}\". Using custom model id.`\n\t\t\t\t: `Model \"${fallbackPattern}\" not found for provider \"${provider}\". Using custom model id.`;\n\t\t\treturn { model, thinkingLevel: fallbackThinking, warning: fallbackWarning, error: undefined };\n\t\t}\n\t}\n\n\tconst display = provider ? `${provider}/${pattern}` : cliModel;\n\treturn {\n\t\tmodel: undefined,\n\t\tthinkingLevel: undefined,\n\t\twarning,\n\t\terror: `Model \"${display}\" not found. Use --list-models to see available models.`,\n\t};\n}\n\nexport interface InitialModelResult {\n\tmodel: Model<Api> | undefined;\n\tthinkingLevel: ThinkingLevel;\n\tfallbackMessage: string | undefined;\n}\n\n/**\n * Find the initial model to use based on priority:\n * 1. CLI args (provider + model)\n * 2. First model from scoped models (if not continuing/resuming)\n * 3. Restored from session (if continuing/resuming)\n * 4. Saved default from settings\n * 5. First available model with valid API key\n */\nexport async function findInitialModel(options: {\n\tcliProvider?: string;\n\tcliModel?: string;\n\tscopedModels: ScopedModel[];\n\tisContinuing: boolean;\n\tdefaultProvider?: string;\n\tdefaultModelId?: string;\n\tdefaultThinkingLevel?: ThinkingLevel;\n\tmodelThinkingLevels?: Record<string, ThinkingLevel>;\n\tmodelRuntime: ModelRuntime;\n}): Promise<InitialModelResult> {\n\tconst {\n\t\tcliProvider,\n\t\tcliModel,\n\t\tscopedModels,\n\t\tisContinuing,\n\t\tdefaultProvider,\n\t\tdefaultModelId,\n\t\tdefaultThinkingLevel,\n\t\tmodelThinkingLevels,\n\t\tmodelRuntime,\n\t} = options;\n\n\tlet model: Model<Api> | undefined;\n\tlet thinkingLevel: ThinkingLevel = DEFAULT_THINKING_LEVEL;\n\n\t// 1. CLI args take priority\n\tif (cliProvider && cliModel) {\n\t\tconst resolved = resolveCliModel({\n\t\t\tcliProvider,\n\t\t\tcliModel,\n\t\t\tmodelRuntime,\n\t\t});\n\t\t// v8 ignore next -- CLI 模型解析失败即退出进程,测试无法安全触达 process.exit(1)\n\t\tif (resolved.error) {\n\t\t\tconsole.error(chalk.red(resolved.error));\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tif (resolved.model) {\n\t\t\treturn { model: resolved.model, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t\t}\n\t}\n\n\t// 2. Use first model from scoped models (skip if continuing/resuming)\n\tif (scopedModels.length > 0 && !isContinuing) {\n\t\tconst scopedModel = scopedModels[0];\n\t\tconst perModel = modelThinkingLevels?.[`${scopedModel.model.provider}/${scopedModel.model.id}`];\n\t\treturn {\n\t\t\tmodel: scopedModel.model,\n\t\t\tthinkingLevel: scopedModel.thinkingLevel ?? perModel ?? defaultThinkingLevel ?? DEFAULT_THINKING_LEVEL,\n\t\t\tfallbackMessage: undefined,\n\t\t};\n\t}\n\n\t// 3. Try saved default from settings if auth is configured.\n\tif (defaultProvider && defaultModelId) {\n\t\tconst found = modelRuntime.getModel(defaultProvider, defaultModelId);\n\t\tif (found && modelRuntime.hasConfiguredAuth(found.provider)) {\n\t\t\tmodel = found;\n\t\t\tconst perModel = modelThinkingLevels?.[`${defaultProvider}/${defaultModelId}`];\n\t\t\tif (perModel) {\n\t\t\t\tthinkingLevel = perModel;\n\t\t\t} else if (defaultThinkingLevel) {\n\t\t\t\tthinkingLevel = defaultThinkingLevel;\n\t\t\t}\n\t\t\treturn { model, thinkingLevel, fallbackMessage: undefined };\n\t\t}\n\t}\n\n\t// 4. Try first available model with valid API key\n\tconst availableModels = [...modelRuntime.getAvailableSnapshot()];\n\n\tif (availableModels.length > 0) {\n\t\t// Try to find a default model from known providers\n\t\tfor (const provider of Object.keys(defaultModelPerProvider) as KnownProvider[]) {\n\t\t\tconst defaultId = defaultModelPerProvider[provider];\n\t\t\tconst match = availableModels.find((m) => m.provider === provider && m.id === defaultId);\n\t\t\tif (match) {\n\t\t\t\treturn { model: match, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t\t\t}\n\t\t}\n\n\t\t// If no default found, use first available\n\t\treturn { model: availableModels[0], thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t}\n\n\t// 5. No model found\n\treturn { model: undefined, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n}\n\n/**\n * Restore model from session, with fallback to available models\n */\nexport async function restoreModelFromSession(\n\tsavedProvider: string,\n\tsavedModelId: string,\n\tcurrentModel: Model<Api> | undefined,\n\tshouldPrintMessages: boolean,\n\tmodelRuntime: ModelRuntime,\n): Promise<{ model: Model<Api> | undefined; fallbackMessage: string | undefined }> {\n\tconst restoredModel = modelRuntime.getModel(savedProvider, savedModelId);\n\n\t// Check if restored model exists and still has auth configured\n\tconst hasConfiguredAuth = restoredModel ? modelRuntime.hasConfiguredAuth(restoredModel.provider) : false;\n\n\tif (restoredModel && hasConfiguredAuth) {\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Restored model: ${savedProvider}/${savedModelId}`));\n\t\t}\n\t\treturn { model: restoredModel, fallbackMessage: undefined };\n\t}\n\n\t// Model not found or no API key - fall back\n\tconst reason = !restoredModel ? \"model no longer exists\" : \"no auth configured\";\n\n\tif (shouldPrintMessages) {\n\t\tconsole.error(chalk.yellow(`Warning: Could not restore model ${savedProvider}/${savedModelId} (${reason}).`));\n\t}\n\n\t// If we already have a model, use it as fallback\n\tif (currentModel) {\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Falling back to: ${currentModel.provider}/${currentModel.id}`));\n\t\t}\n\t\treturn {\n\t\t\tmodel: currentModel,\n\t\t\tfallbackMessage: `Could not restore model ${savedProvider}/${savedModelId} (${reason}). Using ${currentModel.provider}/${currentModel.id}.`,\n\t\t};\n\t}\n\n\t// Try to find any available model\n\tconst availableModels = [...modelRuntime.getAvailableSnapshot()];\n\n\tif (availableModels.length > 0) {\n\t\t// Try to find a default model from known providers\n\t\tlet fallbackModel: Model<Api> | undefined;\n\t\tfor (const provider of Object.keys(defaultModelPerProvider) as KnownProvider[]) {\n\t\t\tconst defaultId = defaultModelPerProvider[provider];\n\t\t\tconst match = availableModels.find((m) => m.provider === provider && m.id === defaultId);\n\t\t\tif (match) {\n\t\t\t\tfallbackModel = match;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If no default found, use first available\n\t\tif (!fallbackModel) {\n\t\t\tfallbackModel = availableModels[0];\n\t\t}\n\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Falling back to: ${fallbackModel.provider}/${fallbackModel.id}`));\n\t\t}\n\n\t\treturn {\n\t\t\tmodel: fallbackModel,\n\t\t\tfallbackMessage: `Could not restore model ${savedProvider}/${savedModelId} (${reason}). Using ${fallbackModel.provider}/${fallbackModel.id}.`,\n\t\t};\n\t}\n\n\t// No models available\n\treturn { model: undefined, fallbackMessage: undefined };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"model-resolver.d.ts","sourceRoot":"","sources":["../../src/core/model-resolver.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yB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GAOG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACpD,YAAY,EAAE,YAAY,CAAC;CAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8E9B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,EACpC,mBAAmB,EAAE,OAAO,EAC5B,YAAY,EAAE,YAAY,GACxB,OAAO,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC,CA+DjF","sourcesContent":["/**\n * Model resolution, scoping, and initial selection\n */\n\nimport type { ThinkingLevel } from \"@agent-forge/agent-core\";\nimport { type Api, type AuthOperationOptions, type KnownProvider, type Model, modelsAreEqual } from \"@agent-forge/ai\";\nimport chalk from \"chalk\";\nimport { minimatch } from \"minimatch\";\nimport { DEFAULT_THINKING_LEVEL } from \"./defaults.ts\";\nimport type { ModelRuntime } from \"./model-runtime.ts\";\n\nexport const VALID_THINKING_LEVELS = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const;\n\nexport function isValidThinkingLevel(level: string): level is ThinkingLevel {\n\treturn VALID_THINKING_LEVELS.includes(level as ThinkingLevel);\n}\n\n/** Default model IDs for each known provider */\nexport const defaultModelPerProvider: Record<KnownProvider, string> = {\n\t\"amazon-bedrock\": \"us.anthropic.claude-opus-4-6-v1\",\n\t\"ant-ling\": \"Ring-2.6-1T\",\n\tanthropic: \"claude-opus-4-8\",\n\topenai: \"gpt-5.5\",\n\t\"azure-openai-responses\": \"gpt-5.4\",\n\t\"openai-codex\": \"gpt-6.1-sol\",\n\tradius: \"auto\",\n\tnvidia: \"nvidia/nemotron-3-super-120b-a12b\",\n\tdeepseek: \"deepseek-v4-pro\",\n\tgoogle: \"gemini-3.1-pro-preview\",\n\t\"google-vertex\": \"gemini-3.1-pro-preview\",\n\t\"github-copilot\": \"gpt-5.4\",\n\topenrouter: \"moonshotai/kimi-k2.6\",\n\t\"vercel-ai-gateway\": \"zai/glm-5.1\",\n\txai: \"grok-4.6\",\n\tgroq: \"openai/gpt-oss-120b\",\n\tcerebras: \"gpt-oss-120b\",\n\tzai: \"glm-5.3\",\n\t\"zai-coding-cn\": \"glm-5.3\",\n\tmistral: \"devstral-medium-latest\",\n\tminimax: \"MiniMax-M2.7\",\n\t\"minimax-cn\": \"MiniMax-M2.7\",\n\tmoonshotai: \"kimi-k2.6\",\n\t\"moonshotai-cn\": \"kimi-k2.6\",\n\thuggingface: \"moonshotai/Kimi-K2.6\",\n\tfireworks: \"accounts/fireworks/models/kimi-k3\",\n\ttogether: \"moonshotai/Kimi-K3\",\n\tbaseten: \"zai-org/GLM-5.2\",\n\topencode: \"kimi-k2.6\",\n\t\"opencode-go\": \"kimi-k3\",\n\t\"kimi-coding\": \"kimi-for-coding\",\n\t\"cloudflare-workers-ai\": \"@cf/moonshotai/kimi-k2.6\",\n\t\"cloudflare-ai-gateway\": \"workers-ai/@cf/moonshotai/kimi-k2.6\",\n\t\"qwen-token-plan\": \"qwen3.7-max\",\n\t\"qwen-token-plan-cn\": \"qwen3.7-max\",\n\t\"qwen-token-plan-individual\": \"qwen3.8-max\",\n\txiaomi: \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-cn\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-ams\": \"mimo-v2.5-pro\",\n\t\"xiaomi-token-plan-sgp\": \"mimo-v2.5-pro\",\n};\n\nexport interface ScopedModel {\n\tmodel: Model<Api>;\n\t/** Thinking level if explicitly specified in pattern (e.g., \"model:high\"), undefined otherwise */\n\tthinkingLevel?: ThinkingLevel;\n}\n\n/**\n * Helper to check if a model ID looks like an alias (no date suffix)\n * Dates are typically in format: -20241022 or -20250929\n */\nfunction isAlias(id: string): boolean {\n\t// Check if ID ends with -latest\n\tif (id.endsWith(\"-latest\")) return true;\n\n\t// Check if ID ends with a date pattern (-YYYYMMDD)\n\tconst datePattern = /-\\d{8}$/;\n\treturn !datePattern.test(id);\n}\n\n/**\n * Find an exact model reference match.\n * Supports either a bare model id or a canonical provider/modelId reference.\n * When matching by bare id, ambiguous matches across providers are rejected.\n */\nexport function findExactModelReferenceMatch(\n\tmodelReference: string,\n\tavailableModels: Model<Api>[],\n): Model<Api> | undefined {\n\tconst trimmedReference = modelReference.trim();\n\tif (!trimmedReference) {\n\t\treturn undefined;\n\t}\n\n\tconst normalizedReference = trimmedReference.toLowerCase();\n\n\tconst canonicalMatches = availableModels.filter(\n\t\t(model) => `${model.provider}/${model.id}`.toLowerCase() === normalizedReference,\n\t);\n\tif (canonicalMatches.length === 1) {\n\t\treturn canonicalMatches[0];\n\t}\n\tif (canonicalMatches.length > 1) {\n\t\treturn undefined;\n\t}\n\n\tconst slashIndex = trimmedReference.indexOf(\"/\");\n\tif (slashIndex !== -1) {\n\t\tconst provider = trimmedReference.substring(0, slashIndex).trim();\n\t\tconst modelId = trimmedReference.substring(slashIndex + 1).trim();\n\t\tif (provider && modelId) {\n\t\t\tconst providerMatches = availableModels.filter(\n\t\t\t\t(model) =>\n\t\t\t\t\tmodel.provider.toLowerCase() === provider.toLowerCase() &&\n\t\t\t\t\tmodel.id.toLowerCase() === modelId.toLowerCase(),\n\t\t\t);\n\t\t\tif (providerMatches.length === 1) {\n\t\t\t\treturn providerMatches[0];\n\t\t\t}\n\t\t\tif (providerMatches.length > 1) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst idMatches = availableModels.filter((model) => model.id.toLowerCase() === normalizedReference);\n\treturn idMatches.length === 1 ? idMatches[0] : undefined;\n}\n\n/**\n * Try to match a pattern to a model from the available models list.\n * Returns the matched model or undefined if no match found.\n */\nfunction tryMatchModel(modelPattern: string, availableModels: Model<Api>[]): Model<Api> | undefined {\n\tconst exactMatch = findExactModelReferenceMatch(modelPattern, availableModels);\n\tif (exactMatch) {\n\t\treturn exactMatch;\n\t}\n\n\t// No exact match - fall back to partial matching\n\tconst matches = availableModels.filter(\n\t\t(m) =>\n\t\t\tm.id.toLowerCase().includes(modelPattern.toLowerCase()) ||\n\t\t\tm.name?.toLowerCase().includes(modelPattern.toLowerCase()),\n\t);\n\n\tif (matches.length === 0) {\n\t\treturn undefined;\n\t}\n\n\t// Separate into aliases and dated versions\n\tconst aliases = matches.filter((m) => isAlias(m.id));\n\tconst datedVersions = matches.filter((m) => !isAlias(m.id));\n\n\tif (aliases.length > 0) {\n\t\t// Prefer alias - if multiple aliases, pick the one that sorts highest\n\t\taliases.sort((a, b) => b.id.localeCompare(a.id));\n\t\treturn aliases[0];\n\t} else {\n\t\t// No alias found, pick latest dated version\n\t\tdatedVersions.sort((a, b) => b.id.localeCompare(a.id));\n\t\treturn datedVersions[0];\n\t}\n}\n\nexport interface ParsedModelResult {\n\tmodel: Model<Api> | undefined;\n\t/** Thinking level if explicitly specified in pattern, undefined otherwise */\n\tthinkingLevel?: ThinkingLevel;\n\twarning: string | undefined;\n}\n\nfunction buildFallbackModel(provider: string, modelId: string, availableModels: Model<Api>[]): Model<Api> | undefined {\n\tconst providerModels = availableModels.filter((m) => m.provider === provider);\n\tif (providerModels.length === 0) return undefined;\n\n\tconst defaultId = defaultModelPerProvider[provider as KnownProvider];\n\tconst baseModel = defaultId\n\t\t? (providerModels.find((m) => m.id === defaultId) ?? providerModels[0])\n\t\t: providerModels[0];\n\n\treturn {\n\t\t...baseModel,\n\t\tid: modelId,\n\t\tname: modelId,\n\t};\n}\n\n/**\n * Parse a pattern to extract model and thinking level.\n * Handles models with colons in their IDs (e.g., OpenRouter's :exacto suffix).\n *\n * Algorithm:\n * 1. Try to match full pattern as a model\n * 2. If found, return it with \"off\" thinking level\n * 3. If not found and has colons, split on last colon:\n * - If suffix is valid thinking level, use it and recurse on prefix\n * - If suffix is invalid, warn and recurse on prefix with \"off\"\n *\n * @internal Exported for testing\n */\nexport function parseModelPattern(\n\tpattern: string,\n\tavailableModels: Model<Api>[],\n\toptions?: { allowInvalidThinkingLevelFallback?: boolean },\n): ParsedModelResult {\n\t// Try exact match first\n\tconst exactMatch = tryMatchModel(pattern, availableModels);\n\tif (exactMatch) {\n\t\treturn { model: exactMatch, thinkingLevel: undefined, warning: undefined };\n\t}\n\n\t// No match - try splitting on last colon if present\n\tconst lastColonIndex = pattern.lastIndexOf(\":\");\n\tif (lastColonIndex === -1) {\n\t\t// No colons, pattern simply doesn't match any model\n\t\treturn { model: undefined, thinkingLevel: undefined, warning: undefined };\n\t}\n\n\tconst prefix = pattern.substring(0, lastColonIndex);\n\tconst suffix = pattern.substring(lastColonIndex + 1);\n\n\tif (isValidThinkingLevel(suffix)) {\n\t\t// Valid thinking level - recurse on prefix and use this level\n\t\tconst result = parseModelPattern(prefix, availableModels, options);\n\t\tif (result.model) {\n\t\t\t// Only use this thinking level if no warning from inner recursion\n\t\t\treturn {\n\t\t\t\tmodel: result.model,\n\t\t\t\tthinkingLevel: result.warning ? undefined : suffix,\n\t\t\t\twarning: result.warning,\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t} else {\n\t\t// Invalid suffix\n\t\tconst allowFallback = options?.allowInvalidThinkingLevelFallback ?? true;\n\t\tif (!allowFallback) {\n\t\t\t// In strict mode (CLI --model parsing), treat it as part of the model id and fail.\n\t\t\t// This avoids accidentally resolving to a different model.\n\t\t\treturn { model: undefined, thinkingLevel: undefined, warning: undefined };\n\t\t}\n\n\t\t// Scope mode: recurse on prefix and warn\n\t\tconst result = parseModelPattern(prefix, availableModels, options);\n\t\tif (result.model) {\n\t\t\treturn {\n\t\t\t\tmodel: result.model,\n\t\t\t\tthinkingLevel: undefined,\n\t\t\t\twarning: `Invalid thinking level \"${suffix}\" in pattern \"${pattern}\". Using default instead.`,\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/**\n * Resolve model patterns to actual Model objects with optional thinking levels\n * Format: \"pattern:level\" where :level is optional\n * For each pattern, finds all matching models and picks the best version:\n * 1. Prefer alias (e.g., claude-sonnet-4-5) over dated versions (claude-sonnet-4-5-20250929)\n * 2. If no alias, pick the latest dated version\n *\n * Supports models with colons in their IDs (e.g., OpenRouter's model:exacto).\n * The algorithm tries to match the full pattern first, then progressively\n * strips colon-suffixes to find a match.\n */\nexport interface ModelScopeDiagnostic {\n\ttype: \"warning\";\n\tcode: \"no-match\" | \"invalid-thinking-level\";\n\tmessage: string;\n\tpattern: string;\n}\n\nexport interface ResolveModelScopeResult {\n\tscopedModels: ScopedModel[];\n\tdiagnostics: ModelScopeDiagnostic[];\n}\n\nexport function resolveModelScopeFromModels(\n\tpatterns: string[],\n\tmodels: readonly Model<Api>[],\n): ResolveModelScopeResult {\n\tconst availableModels = [...models];\n\tconst scopedModels: ScopedModel[] = [];\n\tconst diagnostics: ModelScopeDiagnostic[] = [];\n\n\tfor (const pattern of patterns) {\n\t\t// Check if pattern contains glob characters\n\t\tif (pattern.includes(\"*\") || pattern.includes(\"?\") || pattern.includes(\"[\")) {\n\t\t\t// Extract optional thinking level suffix (e.g., \"provider/*:high\")\n\t\t\tconst colonIdx = pattern.lastIndexOf(\":\");\n\t\t\tlet globPattern = pattern;\n\t\t\tlet thinkingLevel: ThinkingLevel | undefined;\n\n\t\t\tif (colonIdx !== -1) {\n\t\t\t\tconst suffix = pattern.substring(colonIdx + 1);\n\t\t\t\tif (isValidThinkingLevel(suffix)) {\n\t\t\t\t\tthinkingLevel = suffix;\n\t\t\t\t\tglobPattern = pattern.substring(0, colonIdx);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst exactMatch = findExactModelReferenceMatch(globPattern, availableModels);\n\t\t\tif (exactMatch) {\n\t\t\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, exactMatch))) {\n\t\t\t\t\tscopedModels.push({ model: exactMatch, thinkingLevel });\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Match against \"provider/modelId\" format OR just model ID\n\t\t\t// This allows \"*sonnet*\" to match without requiring \"anthropic/*sonnet*\"\n\t\t\tconst matchingModels = availableModels.filter((m) => {\n\t\t\t\tconst fullId = `${m.provider}/${m.id}`;\n\t\t\t\treturn minimatch(fullId, globPattern, { nocase: true }) || minimatch(m.id, globPattern, { nocase: true });\n\t\t\t});\n\n\t\t\tif (matchingModels.length === 0) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tcode: \"no-match\",\n\t\t\t\t\tmessage: `No models match pattern \"${pattern}\"`,\n\t\t\t\t\tpattern,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const model of matchingModels) {\n\t\t\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, model))) {\n\t\t\t\t\tscopedModels.push({ model, thinkingLevel });\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst { model, thinkingLevel, warning } = parseModelPattern(pattern, availableModels);\n\n\t\tif (warning) {\n\t\t\tdiagnostics.push({ type: \"warning\", code: \"invalid-thinking-level\", message: warning, pattern });\n\t\t}\n\n\t\tif (!model) {\n\t\t\tdiagnostics.push({\n\t\t\t\ttype: \"warning\",\n\t\t\t\tcode: \"no-match\",\n\t\t\t\tmessage: `No models match pattern \"${pattern}\"`,\n\t\t\t\tpattern,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Avoid duplicates\n\t\tif (!scopedModels.find((sm) => modelsAreEqual(sm.model, model))) {\n\t\t\tscopedModels.push({ model, thinkingLevel });\n\t\t}\n\t}\n\n\treturn { scopedModels, diagnostics };\n}\n\nexport async function resolveModelScopeWithDiagnostics(\n\tpatterns: string[],\n\tmodelRuntime: ModelRuntime,\n\toptions?: AuthOperationOptions,\n): Promise<ResolveModelScopeResult> {\n\treturn resolveModelScopeFromModels(patterns, await modelRuntime.getAvailable(undefined, options));\n}\n\nexport async function resolveModelScope(\n\tpatterns: string[],\n\tmodelRuntime: ModelRuntime,\n\toptions?: AuthOperationOptions,\n): Promise<ScopedModel[]> {\n\tconst { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(patterns, modelRuntime, options);\n\tfor (const diagnostic of diagnostics) {\n\t\tconsole.warn(chalk.yellow(`Warning: ${diagnostic.message}`));\n\t}\n\treturn scopedModels;\n}\n\nexport interface ResolveCliModelResult {\n\tmodel: Model<Api> | undefined;\n\tthinkingLevel?: ThinkingLevel;\n\twarning: string | undefined;\n\t/**\n\t * Error message suitable for CLI display.\n\t * When set, model will be undefined.\n\t */\n\terror: string | undefined;\n}\n\n/**\n * Resolve a single model from CLI flags.\n *\n * Supports:\n * - --provider <provider> --model <pattern>\n * - --model <provider>/<pattern>\n * - Fuzzy matching (same rules as model scoping: exact id, then partial id/name)\n *\n * Note: This does not apply the thinking level by itself, but it may *parse* and\n * return a thinking level from \"<pattern>:<thinking>\" so the caller can apply it.\n */\nexport function resolveCliModel(options: {\n\tcliProvider?: string;\n\tcliModel?: string;\n\tcliThinking?: ThinkingLevel;\n\tmodelRuntime: ModelRuntime;\n}): ResolveCliModelResult {\n\tconst { cliProvider, cliModel, cliThinking, modelRuntime } = options;\n\n\tif (!cliModel) {\n\t\treturn { model: undefined, warning: undefined, error: undefined };\n\t}\n\n\t// Important: use *all* models here, not just models with pre-configured auth.\n\t// This allows \"--api-key\" to be used for first-time setup.\n\tconst availableModels = [...modelRuntime.getModels()];\n\tif (availableModels.length === 0) {\n\t\treturn {\n\t\t\tmodel: undefined,\n\t\t\twarning: undefined,\n\t\t\terror: \"No models available. Check your installation or add models to models.json.\",\n\t\t};\n\t}\n\n\t// Build canonical provider lookup (case-insensitive)\n\tconst providerMap = new Map<string, string>();\n\tfor (const m of availableModels) {\n\t\tproviderMap.set(m.provider.toLowerCase(), m.provider);\n\t}\n\n\tlet provider = cliProvider ? providerMap.get(cliProvider.toLowerCase()) : undefined;\n\tif (cliProvider && !provider) {\n\t\treturn {\n\t\t\tmodel: undefined,\n\t\t\twarning: undefined,\n\t\t\terror: `Unknown provider \"${cliProvider}\". Use --list-models to see available providers/models.`,\n\t\t};\n\t}\n\n\t// If no explicit --provider, try to interpret \"provider/model\" format first.\n\t// When the prefix before the first slash matches a known provider, prefer that\n\t// interpretation over matching models whose IDs literally contain slashes\n\t// (e.g. \"zai/glm-5\" should resolve to provider=zai, model=glm-5, not to a\n\t// vercel-ai-gateway model with id \"zai/glm-5\").\n\tlet pattern = cliModel;\n\tlet inferredProvider = false;\n\n\tif (!provider) {\n\t\tconst slashIndex = cliModel.indexOf(\"/\");\n\t\tif (slashIndex !== -1) {\n\t\t\tconst maybeProvider = cliModel.substring(0, slashIndex);\n\t\t\tconst canonical = providerMap.get(maybeProvider.toLowerCase());\n\t\t\tif (canonical) {\n\t\t\t\tprovider = canonical;\n\t\t\t\tpattern = cliModel.substring(slashIndex + 1);\n\t\t\t\tinferredProvider = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// If no provider was inferred from the slash, try exact matches without provider inference.\n\t// This handles models whose IDs naturally contain slashes (e.g. OpenRouter-style IDs).\n\t// Bare exact IDs can exist in multiple providers, so do not choose by catalog order.\n\t// Prefer the sole authenticated provider when there is one; otherwise require an\n\t// explicit provider to avoid silently selecting an unusable provider.\n\tif (!provider) {\n\t\tconst lower = cliModel.toLowerCase();\n\t\tconst exactMatches = availableModels.filter(\n\t\t\t(m) => m.id.toLowerCase() === lower || `${m.provider}/${m.id}`.toLowerCase() === lower,\n\t\t);\n\t\tif (exactMatches.length === 1) {\n\t\t\treturn { model: exactMatches[0], warning: undefined, thinkingLevel: undefined, error: undefined };\n\t\t}\n\t\tif (exactMatches.length > 1) {\n\t\t\tconst authenticatedExactMatches = exactMatches.filter((m) => modelRuntime.hasConfiguredAuth(m.provider));\n\t\t\tif (authenticatedExactMatches.length === 1) {\n\t\t\t\treturn {\n\t\t\t\t\tmodel: authenticatedExactMatches[0],\n\t\t\t\t\twarning: undefined,\n\t\t\t\t\tthinkingLevel: undefined,\n\t\t\t\t\terror: undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst matches = exactMatches\n\t\t\t\t.map((m) => `${m.provider}/${m.id}`)\n\t\t\t\t.sort((a, b) => a.localeCompare(b))\n\t\t\t\t.join(\", \");\n\t\t\tconst authHint =\n\t\t\t\tauthenticatedExactMatches.length === 0\n\t\t\t\t\t? \"No matching provider is authenticated.\"\n\t\t\t\t\t: \"More than one matching provider is authenticated.\";\n\t\t\treturn {\n\t\t\t\tmodel: undefined,\n\t\t\t\twarning: undefined,\n\t\t\t\tthinkingLevel: undefined,\n\t\t\t\terror: `Model \"${cliModel}\" is ambiguous across providers: ${matches}. ${authHint} Use --provider or provider/model.`,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (cliProvider && provider) {\n\t\t// If both were provided, tolerate --model <provider>/<pattern> by stripping the provider prefix\n\t\tconst prefix = `${provider}/`;\n\t\tif (cliModel.toLowerCase().startsWith(prefix.toLowerCase())) {\n\t\t\tpattern = cliModel.substring(prefix.length);\n\t\t}\n\t}\n\n\tconst candidates = provider ? availableModels.filter((m) => m.provider === provider) : availableModels;\n\tconst { model, thinkingLevel, warning } = parseModelPattern(pattern, candidates, {\n\t\tallowInvalidThinkingLevelFallback: false,\n\t});\n\n\tif (model) {\n\t\t// If provider inference matched an unauthenticated provider/model pair, prefer\n\t\t// one exact raw model-id match that is authenticated. This keeps\n\t\t// \"provider/model\" syntax preferred when usable, but handles models whose\n\t\t// literal id starts with a known provider name (for example\n\t\t// commandcode model id \"xiaomi/mimo-v2.5-pro\").\n\t\tif (inferredProvider) {\n\t\t\tconst rawExactMatches = availableModels.filter(\n\t\t\t\t(m) => m.id.toLowerCase() === cliModel.toLowerCase() && !modelsAreEqual(m, model),\n\t\t\t);\n\t\t\tif (rawExactMatches.length > 0 && !modelRuntime.hasConfiguredAuth(model.provider)) {\n\t\t\t\tconst authenticatedRawMatches = rawExactMatches.filter((m) => modelRuntime.hasConfiguredAuth(m.provider));\n\t\t\t\tif (authenticatedRawMatches.length === 1) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmodel: authenticatedRawMatches[0],\n\t\t\t\t\t\tthinkingLevel: undefined,\n\t\t\t\t\t\twarning: undefined,\n\t\t\t\t\t\terror: undefined,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { model, thinkingLevel, warning, error: undefined };\n\t}\n\n\t// If we inferred a provider from the slash but found no match within that provider,\n\t// fall back to matching the full input as a raw model id across all models.\n\t// This handles OpenRouter-style IDs like \"openai/gpt-4o:extended\" where \"openai\"\n\t// looks like a provider but the full string is actually a model id on openrouter.\n\tif (inferredProvider) {\n\t\tconst lower = cliModel.toLowerCase();\n\t\tconst exact = availableModels.find(\n\t\t\t(m) => m.id.toLowerCase() === lower || `${m.provider}/${m.id}`.toLowerCase() === lower,\n\t\t);\n\t\tif (exact) {\n\t\t\treturn { model: exact, warning: undefined, thinkingLevel: undefined, error: undefined };\n\t\t}\n\t\t// Also try parseModelPattern on the full input against all models\n\t\tconst fallback = parseModelPattern(cliModel, availableModels, {\n\t\t\tallowInvalidThinkingLevelFallback: false,\n\t\t});\n\t\tif (fallback.model) {\n\t\t\treturn {\n\t\t\t\tmodel: fallback.model,\n\t\t\t\tthinkingLevel: fallback.thinkingLevel,\n\t\t\t\twarning: fallback.warning,\n\t\t\t\terror: undefined,\n\t\t\t};\n\t\t}\n\t}\n\n\tif (provider) {\n\t\t// Parse thinking level suffix from the pattern before building the fallback model,\n\t\t// but only when --thinking is not explicitly provided.\n\t\t// e.g. \"zai-org/GLM-5.1-FP8:high\" → modelId=\"zai-org/GLM-5.1-FP8\", fallbackThinking=\"high\"\n\t\tlet fallbackPattern = pattern;\n\t\tlet fallbackThinking: ThinkingLevel | undefined;\n\t\tif (!cliThinking) {\n\t\t\tconst lastColon = pattern.lastIndexOf(\":\");\n\t\t\tif (lastColon !== -1) {\n\t\t\t\tconst suffix = pattern.substring(lastColon + 1);\n\t\t\t\tif (isValidThinkingLevel(suffix)) {\n\t\t\t\t\tfallbackPattern = pattern.substring(0, lastColon);\n\t\t\t\t\tfallbackThinking = suffix;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst fallbackModel = buildFallbackModel(provider, fallbackPattern, availableModels);\n\t\tif (fallbackModel) {\n\t\t\tconst requestedThinking = cliThinking ?? fallbackThinking;\n\t\t\tconst model =\n\t\t\t\trequestedThinking && requestedThinking !== \"off\" ? { ...fallbackModel, reasoning: true } : fallbackModel;\n\t\t\tconst fallbackWarning = warning\n\t\t\t\t? `${warning} Model \"${fallbackPattern}\" not found for provider \"${provider}\". Using custom model id.`\n\t\t\t\t: `Model \"${fallbackPattern}\" not found for provider \"${provider}\". Using custom model id.`;\n\t\t\treturn { model, thinkingLevel: fallbackThinking, warning: fallbackWarning, error: undefined };\n\t\t}\n\t}\n\n\tconst display = provider ? `${provider}/${pattern}` : cliModel;\n\treturn {\n\t\tmodel: undefined,\n\t\tthinkingLevel: undefined,\n\t\twarning,\n\t\terror: `Model \"${display}\" not found. Use --list-models to see available models.`,\n\t};\n}\n\nexport interface InitialModelResult {\n\tmodel: Model<Api> | undefined;\n\tthinkingLevel: ThinkingLevel;\n\tfallbackMessage: string | undefined;\n}\n\n/**\n * Find the initial model to use based on priority:\n * 1. CLI args (provider + model)\n * 2. First model from scoped models (if not continuing/resuming)\n * 3. Restored from session (if continuing/resuming)\n * 4. Saved default from settings\n * 5. First available model with valid API key\n */\nexport async function findInitialModel(options: {\n\tcliProvider?: string;\n\tcliModel?: string;\n\tscopedModels: ScopedModel[];\n\tisContinuing: boolean;\n\tdefaultProvider?: string;\n\tdefaultModelId?: string;\n\tdefaultThinkingLevel?: ThinkingLevel;\n\tmodelThinkingLevels?: Record<string, ThinkingLevel>;\n\tmodelRuntime: ModelRuntime;\n}): Promise<InitialModelResult> {\n\tconst {\n\t\tcliProvider,\n\t\tcliModel,\n\t\tscopedModels,\n\t\tisContinuing,\n\t\tdefaultProvider,\n\t\tdefaultModelId,\n\t\tdefaultThinkingLevel,\n\t\tmodelThinkingLevels,\n\t\tmodelRuntime,\n\t} = options;\n\n\tlet model: Model<Api> | undefined;\n\tlet thinkingLevel: ThinkingLevel = DEFAULT_THINKING_LEVEL;\n\n\t// 1. CLI args take priority\n\tif (cliProvider && cliModel) {\n\t\tconst resolved = resolveCliModel({\n\t\t\tcliProvider,\n\t\t\tcliModel,\n\t\t\tmodelRuntime,\n\t\t});\n\t\t// v8 ignore next -- CLI 模型解析失败即退出进程,测试无法安全触达 process.exit(1)\n\t\tif (resolved.error) {\n\t\t\tconsole.error(chalk.red(resolved.error));\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tif (resolved.model) {\n\t\t\treturn { model: resolved.model, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t\t}\n\t}\n\n\t// 2. Use first model from scoped models (skip if continuing/resuming)\n\tif (scopedModels.length > 0 && !isContinuing) {\n\t\tconst scopedModel = scopedModels[0];\n\t\tconst perModel = modelThinkingLevels?.[`${scopedModel.model.provider}/${scopedModel.model.id}`];\n\t\treturn {\n\t\t\tmodel: scopedModel.model,\n\t\t\tthinkingLevel: scopedModel.thinkingLevel ?? perModel ?? defaultThinkingLevel ?? DEFAULT_THINKING_LEVEL,\n\t\t\tfallbackMessage: undefined,\n\t\t};\n\t}\n\n\t// 3. Try saved default from settings if auth is configured.\n\tif (defaultProvider && defaultModelId) {\n\t\tconst found = modelRuntime.getModel(defaultProvider, defaultModelId);\n\t\tif (found && modelRuntime.hasConfiguredAuth(found.provider)) {\n\t\t\tmodel = found;\n\t\t\tconst perModel = modelThinkingLevels?.[`${defaultProvider}/${defaultModelId}`];\n\t\t\tif (perModel) {\n\t\t\t\tthinkingLevel = perModel;\n\t\t\t} else if (defaultThinkingLevel) {\n\t\t\t\tthinkingLevel = defaultThinkingLevel;\n\t\t\t}\n\t\t\treturn { model, thinkingLevel, fallbackMessage: undefined };\n\t\t}\n\t}\n\n\t// 4. Try first available model with valid API key\n\tconst availableModels = [...modelRuntime.getAvailableSnapshot()];\n\n\tif (availableModels.length > 0) {\n\t\t// Try to find a default model from known providers\n\t\tfor (const provider of Object.keys(defaultModelPerProvider) as KnownProvider[]) {\n\t\t\tconst defaultId = defaultModelPerProvider[provider];\n\t\t\tconst match = availableModels.find((m) => m.provider === provider && m.id === defaultId);\n\t\t\tif (match) {\n\t\t\t\treturn { model: match, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t\t\t}\n\t\t}\n\n\t\t// If no default found, use first available\n\t\treturn { model: availableModels[0], thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n\t}\n\n\t// 5. No model found\n\treturn { model: undefined, thinkingLevel: DEFAULT_THINKING_LEVEL, fallbackMessage: undefined };\n}\n\n/**\n * Restore model from session, with fallback to available models\n */\nexport async function restoreModelFromSession(\n\tsavedProvider: string,\n\tsavedModelId: string,\n\tcurrentModel: Model<Api> | undefined,\n\tshouldPrintMessages: boolean,\n\tmodelRuntime: ModelRuntime,\n): Promise<{ model: Model<Api> | undefined; fallbackMessage: string | undefined }> {\n\tconst restoredModel = modelRuntime.getModel(savedProvider, savedModelId);\n\n\t// Check if restored model exists and still has auth configured\n\tconst hasConfiguredAuth = restoredModel ? modelRuntime.hasConfiguredAuth(restoredModel.provider) : false;\n\n\tif (restoredModel && hasConfiguredAuth) {\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Restored model: ${savedProvider}/${savedModelId}`));\n\t\t}\n\t\treturn { model: restoredModel, fallbackMessage: undefined };\n\t}\n\n\t// Model not found or no API key - fall back\n\tconst reason = !restoredModel ? \"model no longer exists\" : \"no auth configured\";\n\n\tif (shouldPrintMessages) {\n\t\tconsole.error(chalk.yellow(`Warning: Could not restore model ${savedProvider}/${savedModelId} (${reason}).`));\n\t}\n\n\t// If we already have a model, use it as fallback\n\tif (currentModel) {\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Falling back to: ${currentModel.provider}/${currentModel.id}`));\n\t\t}\n\t\treturn {\n\t\t\tmodel: currentModel,\n\t\t\tfallbackMessage: `Could not restore model ${savedProvider}/${savedModelId} (${reason}). Using ${currentModel.provider}/${currentModel.id}.`,\n\t\t};\n\t}\n\n\t// Try to find any available model\n\tconst availableModels = [...modelRuntime.getAvailableSnapshot()];\n\n\tif (availableModels.length > 0) {\n\t\t// Try to find a default model from known providers\n\t\tlet fallbackModel: Model<Api> | undefined;\n\t\tfor (const provider of Object.keys(defaultModelPerProvider) as KnownProvider[]) {\n\t\t\tconst defaultId = defaultModelPerProvider[provider];\n\t\t\tconst match = availableModels.find((m) => m.provider === provider && m.id === defaultId);\n\t\t\tif (match) {\n\t\t\t\tfallbackModel = match;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// If no default found, use first available\n\t\tif (!fallbackModel) {\n\t\t\tfallbackModel = availableModels[0];\n\t\t}\n\n\t\tif (shouldPrintMessages) {\n\t\t\tconsole.log(chalk.dim(`Falling back to: ${fallbackModel.provider}/${fallbackModel.id}`));\n\t\t}\n\n\t\treturn {\n\t\t\tmodel: fallbackModel,\n\t\t\tfallbackMessage: `Could not restore model ${savedProvider}/${savedModelId} (${reason}). Using ${fallbackModel.provider}/${fallbackModel.id}.`,\n\t\t};\n\t}\n\n\t// No models available\n\treturn { model: undefined, fallbackMessage: undefined };\n}\n"]}
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
import { modelsAreEqual } from "@agent-forge/ai";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { minimatch } from "minimatch";
|
|
7
|
-
import { isValidThinkingLevel } from "../cli/args.js";
|
|
8
7
|
import { DEFAULT_THINKING_LEVEL } from "./defaults.js";
|
|
8
|
+
export const VALID_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
9
|
+
export function isValidThinkingLevel(level) {
|
|
10
|
+
return VALID_THINKING_LEVELS.includes(level);
|
|
11
|
+
}
|
|
9
12
|
/** Default model IDs for each known provider */
|
|
10
13
|
export const defaultModelPerProvider = {
|
|
11
14
|
"amazon-bedrock": "us.anthropic.claude-opus-4-6-v1",
|