@maxmo74/pi-coding-agent 1.5.0-max.8 → 1.5.2-max.15
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 +132 -0
- package/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
- package/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
- package/dist/bundle/chunks/{chunk-MSIQUO5T.js → chunk-COKMCNCW.js} +1 -1
- package/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
- package/dist/bundle/chunks/chunk-M6TSYZBS.js +1244 -0
- package/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
- package/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
- package/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
- package/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/bundle/chunks/chunk-YTPJCXUB.js +30 -0
- package/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
- package/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-2MK3TR7P.js} +7 -7
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
- package/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
- package/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
- package/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
- package/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-MRQHQVIQ.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +26 -2
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/auth-login.d.ts +15 -0
- package/dist/cli/auth-login.d.ts.map +1 -0
- package/dist/cli/auth-login.js +232 -0
- package/dist/cli/auth-login.js.map +1 -0
- package/dist/cli/auth-logout.d.ts +14 -0
- package/dist/cli/auth-logout.d.ts.map +1 -0
- package/dist/cli/auth-logout.js +57 -0
- package/dist/cli/auth-logout.js.map +1 -0
- package/dist/cli/auth-terminal.d.ts +17 -0
- package/dist/cli/auth-terminal.d.ts.map +1 -0
- package/dist/cli/auth-terminal.js +63 -0
- package/dist/cli/auth-terminal.js.map +1 -0
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +3 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +5 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +21 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +25 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +139 -50
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +3 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +4 -37
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +11 -89
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +10 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +9 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +28 -6
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +12 -37
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +42 -121
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +52 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +20 -19
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +11 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +10 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +50 -5
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +4 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/preferred-providers.d.ts +17 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +24 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +3 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-matching.d.ts +6 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +8 -0
- package/dist/core/provider-matching.js.map +1 -0
- package/dist/core/radius-mcp.d.ts +13 -0
- package/dist/core/radius-mcp.d.ts.map +1 -0
- package/dist/core/radius-mcp.js +29 -0
- package/dist/core/radius-mcp.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +8 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/session-cwd.d.ts +7 -0
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +9 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -14
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +182 -41
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +8 -7
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +82 -36
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +5 -3
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +87 -75
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +8 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +141 -25
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +4 -14
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +23 -29
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/extensions/codemode/execute.js +4 -4
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +34 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +23 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +15 -3
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +2 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +49 -14
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +4 -7
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +4 -3
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +11 -49
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +56 -319
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +1 -1
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +4 -3
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +4 -3
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +7 -5
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +2 -23
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +6 -58
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +18 -6
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +59 -11
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -4
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -4
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +5 -2
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +10 -3
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +11 -5
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +9 -1
- package/dist/modes/interactive/components/extension-selector.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 -18
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts +2 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +25 -20
- 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 +14 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -5
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
- package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
- package/dist/modes/interactive/components/provider-brand.js +66 -0
- package/dist/modes/interactive/components/provider-brand.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +6 -37
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +12 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +19 -10
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +161 -91
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +4 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +19 -10
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +53 -23
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +39 -8
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/changelog.d.ts +2 -2
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +12 -6
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/terminal-question.d.ts +8 -0
- package/dist/utils/terminal-question.d.ts.map +1 -0
- package/dist/utils/terminal-question.js +24 -0
- package/dist/utils/terminal-question.js.map +1 -0
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/web-url.d.ts +12 -0
- package/dist/utils/web-url.d.ts.map +1 -0
- package/dist/utils/web-url.js +20 -0
- package/dist/utils/web-url.js.map +1 -0
- package/docs/cli.md +14 -1
- package/docs/extensions.md +27 -7
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +5 -8
- package/docs/models-configuration.md +6 -1
- package/docs/models.md +2 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/rpc.md +4 -2
- package/docs/sessions.md +7 -1
- package/docs/settings.md +1 -1
- package/docs/tui.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/index.ts +23 -13
- package/examples/extensions/plan-mode/utils.ts +42 -16
- package/examples/extensions/subagent/README.md +14 -11
- package/examples/extensions/subagent/index.ts +392 -171
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +63 -35
- package/package.json +10 -10
- package/schemas/models.schema.json +29 -0
- package/schemas/settings.schema.json +1 -1
- package/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/bundle/chunks/chunk-FGCQRPD5.js +0 -1239
- package/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/bundle/chunks/virtual-modules-CLD44EYP.js +0 -2
|
@@ -25,8 +25,11 @@ import { createCompactionSummaryMessage, createCustomMessage } from "../../core/
|
|
|
25
25
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
|
|
26
26
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
27
27
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
28
|
+
import { compareProviders } from "../../core/preferred-providers.js";
|
|
29
|
+
import { findMatchingProviders } from "../../core/provider-matching.js";
|
|
30
|
+
import { RADIUS_PROVIDER_ID } from "../../core/radius.js";
|
|
31
|
+
import { planRadiusMcpServer } from "../../core/radius-mcp.js";
|
|
32
|
+
import { formatMissingSessionCwdPrompt, getMissingSessionCwdOptions, MissingSessionCwdError, } from "../../core/session-cwd.js";
|
|
30
33
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
31
34
|
import { getSessionOpenRefusal } from "../../core/session-ownership.js";
|
|
32
35
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
@@ -35,7 +38,7 @@ import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
|
35
38
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
36
39
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
37
40
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
38
|
-
import { addMcpServerConfig
|
|
41
|
+
import { addMcpServerConfig } from "../../extensions/mcp/config.js";
|
|
39
42
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
40
43
|
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
41
44
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
@@ -67,6 +70,7 @@ import { ExtensionSelectorComponent } from "./components/extension-selector.js";
|
|
|
67
70
|
import { FooterComponent, formatTokens } from "./components/footer.js";
|
|
68
71
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
69
72
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
73
|
+
import { createMarkdownTransform } from "./components/markdown-transform.js";
|
|
70
74
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
71
75
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
72
76
|
import { formatAuthSelectorProviderStatus, formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
@@ -221,7 +225,7 @@ function getLoginProviderCompletionOptions(providerOptions) {
|
|
|
221
225
|
subscription: provider.subscription,
|
|
222
226
|
});
|
|
223
227
|
}
|
|
224
|
-
return Array.from(byId.values()).sort(
|
|
228
|
+
return Array.from(byId.values()).sort(compareProviders);
|
|
225
229
|
}
|
|
226
230
|
function getLoginProviderSearchText(provider) {
|
|
227
231
|
const authTypes = provider.authTypes
|
|
@@ -279,6 +283,8 @@ export class InteractiveMode {
|
|
|
279
283
|
changelogMarkdown = undefined;
|
|
280
284
|
extensionChangelogUpdates = [];
|
|
281
285
|
startupNoticesShown = false;
|
|
286
|
+
/** Last cache-warming notice, extended in place while it is the last chat line. */
|
|
287
|
+
cacheWarmingNotice;
|
|
282
288
|
anthropicSubscriptionWarningShown = false;
|
|
283
289
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
284
290
|
lastStatusSpacer = undefined;
|
|
@@ -328,6 +334,13 @@ export class InteractiveMode {
|
|
|
328
334
|
// Extension dialogs shown in the editor slot (select, confirm, input, editor, inline custom).
|
|
329
335
|
// The last entry is visible; see pushExtensionDialog().
|
|
330
336
|
extensionDialogs = [];
|
|
337
|
+
/** Numbers the program status sources of blocking overlays, so closing one keeps the others. */
|
|
338
|
+
nextBlockingOverlayId = 0;
|
|
339
|
+
/**
|
|
340
|
+
* Open extension overlays (custom with overlay: true) and the function that removes each, in opening
|
|
341
|
+
* order. Reset removes only these, not pi's own overlays.
|
|
342
|
+
*/
|
|
343
|
+
extensionOverlays = new Map();
|
|
331
344
|
extensionTerminalInputSubscriptions = new Set();
|
|
332
345
|
// Extension widgets (components rendered above/below the editor)
|
|
333
346
|
extensionWidgetsAbove = new Map();
|
|
@@ -584,7 +597,7 @@ export class InteractiveMode {
|
|
|
584
597
|
else {
|
|
585
598
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
586
599
|
this.chatContainer.addChild(new Spacer(1));
|
|
587
|
-
this.chatContainer.addChild(
|
|
600
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(this.changelogMarkdown.trim(), 1, 0));
|
|
588
601
|
this.chatContainer.addChild(new Spacer(1));
|
|
589
602
|
}
|
|
590
603
|
}
|
|
@@ -602,7 +615,7 @@ export class InteractiveMode {
|
|
|
602
615
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Extension Updates")), 1, 0));
|
|
603
616
|
this.chatContainer.addChild(new Spacer(1));
|
|
604
617
|
const markdown = this.extensionChangelogUpdates.map((update) => update.markdown).join("\n\n");
|
|
605
|
-
this.chatContainer.addChild(
|
|
618
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(markdown, 1, 0));
|
|
606
619
|
this.chatContainer.addChild(new Spacer(1));
|
|
607
620
|
}
|
|
608
621
|
}
|
|
@@ -1024,6 +1037,11 @@ export class InteractiveMode {
|
|
|
1024
1037
|
return undefined;
|
|
1025
1038
|
}
|
|
1026
1039
|
const newEntries = getNewEntries(entries, lastVersion);
|
|
1040
|
+
if (!newEntries) {
|
|
1041
|
+
// Unreadable saved version: show nothing and record the current one so later updates compare again
|
|
1042
|
+
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
1043
|
+
return undefined;
|
|
1044
|
+
}
|
|
1027
1045
|
if (newEntries.length > 0) {
|
|
1028
1046
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
1029
1047
|
this.reportInstallTelemetry(VERSION);
|
|
@@ -1058,6 +1076,11 @@ export class InteractiveMode {
|
|
|
1058
1076
|
continue;
|
|
1059
1077
|
}
|
|
1060
1078
|
const newEntries = getNewEntries(parseChangelog(sourceInfo.changelogPath), lastVersion);
|
|
1079
|
+
if (!newEntries) {
|
|
1080
|
+
// Unreadable saved version: show nothing and record the current one so later updates compare again
|
|
1081
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1082
|
+
continue;
|
|
1083
|
+
}
|
|
1061
1084
|
if (newEntries.length > 0) {
|
|
1062
1085
|
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1063
1086
|
const name = pkg.name || sourceInfo.source;
|
|
@@ -1780,6 +1803,7 @@ export class InteractiveMode {
|
|
|
1780
1803
|
this.loadedResourcesContainer.clear();
|
|
1781
1804
|
this.chatContainer.clear();
|
|
1782
1805
|
this.pendingMessagesContainer.clear();
|
|
1806
|
+
this.pendingBashComponents = [];
|
|
1783
1807
|
this.compactionQueuedMessages = [];
|
|
1784
1808
|
this.streamingComponent = undefined;
|
|
1785
1809
|
this.streamingMessage = undefined;
|
|
@@ -1799,6 +1823,12 @@ export class InteractiveMode {
|
|
|
1799
1823
|
getMarkdownTransformers() {
|
|
1800
1824
|
return [this.mermaidMarkdownTransformer, ...this.session.extensionRunner.getMarkdownTransformers()];
|
|
1801
1825
|
}
|
|
1826
|
+
/** Markdown of a changelog or release note that runs the Markdown transformers of the `changelog` type. */
|
|
1827
|
+
createChangelogMarkdown(markdown, paddingX, paddingY, defaultTextStyle) {
|
|
1828
|
+
return new Markdown(markdown, paddingX, paddingY, this.getMarkdownThemeWithSettings(), defaultTextStyle, {
|
|
1829
|
+
transform: createMarkdownTransform("changelog", () => false, this.getMarkdownTransformers()),
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1802
1832
|
/**
|
|
1803
1833
|
* Set up keyboard shortcuts registered by extensions.
|
|
1804
1834
|
*/
|
|
@@ -1994,7 +2024,10 @@ export class InteractiveMode {
|
|
|
1994
2024
|
this.extensionDialogs = [];
|
|
1995
2025
|
this.showTopExtensionDialog();
|
|
1996
2026
|
}
|
|
1997
|
-
|
|
2027
|
+
// Reload and session switches replace every extension without calling done(): remove their overlays,
|
|
2028
|
+
// newest first, the same way done() does, but leave the promises pending as for inline dialogs.
|
|
2029
|
+
for (const removeOverlay of [...this.extensionOverlays.values()].reverse())
|
|
2030
|
+
removeOverlay();
|
|
1998
2031
|
this.clearExtensionTerminalInputListeners();
|
|
1999
2032
|
this.setExtensionFooter(undefined);
|
|
2000
2033
|
this.setExtensionHeader(undefined);
|
|
@@ -2253,8 +2286,9 @@ export class InteractiveMode {
|
|
|
2253
2286
|
return result === "Yes";
|
|
2254
2287
|
}
|
|
2255
2288
|
async promptForMissingSessionCwd(error) {
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2289
|
+
const options = getMissingSessionCwdOptions(error.issue);
|
|
2290
|
+
const label = await this.showExtensionSelector(formatMissingSessionCwdPrompt(error.issue), options.map((option) => option.label));
|
|
2291
|
+
return options.find((option) => option.label === label)?.value;
|
|
2258
2292
|
}
|
|
2259
2293
|
/**
|
|
2260
2294
|
* Show a text input for extensions.
|
|
@@ -2297,7 +2331,7 @@ export class InteractiveMode {
|
|
|
2297
2331
|
setCustomEditorComponent(factory) {
|
|
2298
2332
|
this.editorComponentFactory = factory;
|
|
2299
2333
|
// Save text from current editor before switching
|
|
2300
|
-
const currentText = this.editor.getText();
|
|
2334
|
+
const currentText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2301
2335
|
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2302
2336
|
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2303
2337
|
if (!dialogOpen) {
|
|
@@ -2383,11 +2417,13 @@ export class InteractiveMode {
|
|
|
2383
2417
|
}
|
|
2384
2418
|
/** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
|
|
2385
2419
|
async showExtensionCustom(factory, options) {
|
|
2386
|
-
const savedText = this.editor.getText();
|
|
2420
|
+
const savedText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2387
2421
|
const isOverlay = options?.overlay ?? false;
|
|
2388
2422
|
return new Promise((resolve, reject) => {
|
|
2389
2423
|
let component;
|
|
2390
2424
|
let overlayHandle;
|
|
2425
|
+
// An overlay stays blocked until its interaction ends, also while setHidden() hides it.
|
|
2426
|
+
const overlayStatusSource = isOverlay && options?.blocked ? `extension-overlay:${this.nextBlockingOverlayId++}` : undefined;
|
|
2391
2427
|
let closed = false;
|
|
2392
2428
|
const restoreEditor = () => {
|
|
2393
2429
|
if (component)
|
|
@@ -2395,17 +2431,7 @@ export class InteractiveMode {
|
|
|
2395
2431
|
this.editor.setText(savedText);
|
|
2396
2432
|
this.ui.requestRender();
|
|
2397
2433
|
};
|
|
2398
|
-
const
|
|
2399
|
-
if (closed)
|
|
2400
|
-
return;
|
|
2401
|
-
closed = true;
|
|
2402
|
-
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2403
|
-
if (isOverlay)
|
|
2404
|
-
overlayHandle?.hide();
|
|
2405
|
-
else
|
|
2406
|
-
restoreEditor();
|
|
2407
|
-
// Note: both branches above already call requestRender
|
|
2408
|
-
resolve(result);
|
|
2434
|
+
const disposeComponent = () => {
|
|
2409
2435
|
try {
|
|
2410
2436
|
component?.dispose?.();
|
|
2411
2437
|
}
|
|
@@ -2413,6 +2439,30 @@ export class InteractiveMode {
|
|
|
2413
2439
|
/* ignore dispose errors */
|
|
2414
2440
|
}
|
|
2415
2441
|
};
|
|
2442
|
+
// Shared by done() and resetExtensionUI(). Removing the map entry first makes a second call a no-op.
|
|
2443
|
+
const removeOverlay = () => {
|
|
2444
|
+
if (!overlayHandle || !this.extensionOverlays.delete(overlayHandle))
|
|
2445
|
+
return;
|
|
2446
|
+
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2447
|
+
overlayHandle.hide();
|
|
2448
|
+
if (overlayStatusSource)
|
|
2449
|
+
this.programStatus.setBlocked(overlayStatusSource, undefined);
|
|
2450
|
+
disposeComponent();
|
|
2451
|
+
};
|
|
2452
|
+
const close = (result) => {
|
|
2453
|
+
if (closed)
|
|
2454
|
+
return;
|
|
2455
|
+
closed = true;
|
|
2456
|
+
if (isOverlay) {
|
|
2457
|
+
removeOverlay();
|
|
2458
|
+
resolve(result);
|
|
2459
|
+
}
|
|
2460
|
+
else {
|
|
2461
|
+
restoreEditor();
|
|
2462
|
+
resolve(result);
|
|
2463
|
+
disposeComponent();
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2416
2466
|
Promise.resolve(factory(this.ui, theme, this.keybindings, close))
|
|
2417
2467
|
.then((c) => {
|
|
2418
2468
|
if (closed)
|
|
@@ -2432,6 +2482,9 @@ export class InteractiveMode {
|
|
|
2432
2482
|
return w ? { width: w } : undefined;
|
|
2433
2483
|
};
|
|
2434
2484
|
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2485
|
+
this.extensionOverlays.set(overlayHandle, removeOverlay);
|
|
2486
|
+
if (overlayStatusSource)
|
|
2487
|
+
this.programStatus.setBlocked(overlayStatusSource, options?.blocked);
|
|
2435
2488
|
// Expose handle to caller for visibility control
|
|
2436
2489
|
options?.onHandle?.(overlayHandle);
|
|
2437
2490
|
}
|
|
@@ -3022,6 +3075,9 @@ export class InteractiveMode {
|
|
|
3022
3075
|
this.ui.requestRender();
|
|
3023
3076
|
break;
|
|
3024
3077
|
case "agent_settled":
|
|
3078
|
+
// The session records deferred user bash results when the run settles; show them there too.
|
|
3079
|
+
this.flushPendingBashComponents();
|
|
3080
|
+
this.ui.requestRender();
|
|
3025
3081
|
await this.checkShutdownRequested();
|
|
3026
3082
|
break;
|
|
3027
3083
|
case "compaction_start": {
|
|
@@ -3220,7 +3276,7 @@ export class InteractiveMode {
|
|
|
3220
3276
|
case "custom": {
|
|
3221
3277
|
if (message.display) {
|
|
3222
3278
|
const renderer = this.session.extensionRunner.getMessageRenderer(message.customType);
|
|
3223
|
-
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3279
|
+
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3224
3280
|
component.setExpanded(this.toolOutputExpanded);
|
|
3225
3281
|
this.chatContainer.addChild(component);
|
|
3226
3282
|
}
|
|
@@ -3228,14 +3284,14 @@ export class InteractiveMode {
|
|
|
3228
3284
|
}
|
|
3229
3285
|
case "compactionSummary": {
|
|
3230
3286
|
this.chatContainer.addChild(new Spacer(1));
|
|
3231
|
-
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3287
|
+
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3232
3288
|
component.setExpanded(this.toolOutputExpanded);
|
|
3233
3289
|
this.chatContainer.addChild(component);
|
|
3234
3290
|
break;
|
|
3235
3291
|
}
|
|
3236
3292
|
case "branchSummary": {
|
|
3237
3293
|
this.chatContainer.addChild(new Spacer(1));
|
|
3238
|
-
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3294
|
+
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3239
3295
|
component.setExpanded(this.toolOutputExpanded);
|
|
3240
3296
|
this.chatContainer.addChild(component);
|
|
3241
3297
|
break;
|
|
@@ -3251,7 +3307,7 @@ export class InteractiveMode {
|
|
|
3251
3307
|
const skillBlock = parseSkillBlock(textContent);
|
|
3252
3308
|
if (skillBlock) {
|
|
3253
3309
|
// Render skill block (collapsible)
|
|
3254
|
-
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3310
|
+
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3255
3311
|
component.setExpanded(this.toolOutputExpanded);
|
|
3256
3312
|
this.chatContainer.addChild(component);
|
|
3257
3313
|
// Render user message separately if present
|
|
@@ -3405,9 +3461,18 @@ export class InteractiveMode {
|
|
|
3405
3461
|
addCacheWarmingUsage(entry) {
|
|
3406
3462
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3407
3463
|
return;
|
|
3464
|
+
// Back-to-back warms collapse into one line with the cumulative cost.
|
|
3465
|
+
const previous = this.cacheWarmingNotice;
|
|
3466
|
+
if (previous && this.chatContainer.children.at(-1) === previous.component && previous.note === entry.note) {
|
|
3467
|
+
previous.total.cost += entry.usage.cost.total;
|
|
3468
|
+
previous.component.invalidate();
|
|
3469
|
+
return;
|
|
3470
|
+
}
|
|
3471
|
+
const total = { cost: entry.usage.cost.total };
|
|
3472
|
+
const component = new ThemedText(() => theme.fg("dim", formatCacheWarmingUsage(total.cost, entry.note)), 1, 0);
|
|
3473
|
+
this.cacheWarmingNotice = { component, total, note: entry.note };
|
|
3408
3474
|
this.chatContainer.addChild(new Spacer(1));
|
|
3409
|
-
|
|
3410
|
-
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3475
|
+
this.chatContainer.addChild(component);
|
|
3411
3476
|
}
|
|
3412
3477
|
/**
|
|
3413
3478
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -3813,7 +3878,7 @@ export class InteractiveMode {
|
|
|
3813
3878
|
if (isExpandable(activeHeader)) {
|
|
3814
3879
|
activeHeader.setExpanded(expanded);
|
|
3815
3880
|
}
|
|
3816
|
-
for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
|
|
3881
|
+
for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
|
|
3817
3882
|
for (const child of container.children) {
|
|
3818
3883
|
if (isExpandable(child)) {
|
|
3819
3884
|
child.setExpanded(expanded);
|
|
@@ -3891,9 +3956,7 @@ export class InteractiveMode {
|
|
|
3891
3956
|
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
|
|
3892
3957
|
if (note) {
|
|
3893
3958
|
this.chatContainer.addChild(new Spacer(1));
|
|
3894
|
-
this.chatContainer.addChild(
|
|
3895
|
-
color: (text) => theme.fg("muted", text),
|
|
3896
|
-
}));
|
|
3959
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(note, 1, 0, { color: (text) => theme.fg("muted", text) }));
|
|
3897
3960
|
this.chatContainer.addChild(new Spacer(1));
|
|
3898
3961
|
}
|
|
3899
3962
|
this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
|
|
@@ -3955,6 +4018,10 @@ export class InteractiveMode {
|
|
|
3955
4018
|
}
|
|
3956
4019
|
updatePendingMessagesDisplay() {
|
|
3957
4020
|
this.pendingMessagesContainer.clear();
|
|
4021
|
+
// User bash output shown while the agent works lives here until it moves to the chat.
|
|
4022
|
+
for (const component of this.pendingBashComponents) {
|
|
4023
|
+
this.pendingMessagesContainer.addChild(component);
|
|
4024
|
+
}
|
|
3958
4025
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
|
3959
4026
|
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
|
3960
4027
|
this.pendingMessagesContainer.addChild(new Spacer(1));
|
|
@@ -3982,7 +4049,7 @@ export class InteractiveMode {
|
|
|
3982
4049
|
return 0;
|
|
3983
4050
|
}
|
|
3984
4051
|
const queuedText = allQueued.join("\n\n");
|
|
3985
|
-
const currentText = options?.currentText ?? this.editor.getText();
|
|
4052
|
+
const currentText = options?.currentText ?? this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
3986
4053
|
const combinedText = [queuedText, currentText].filter((t) => t.trim()).join("\n\n");
|
|
3987
4054
|
this.editor.setText(combinedText);
|
|
3988
4055
|
this.updatePendingMessagesDisplay();
|
|
@@ -4898,25 +4965,43 @@ export class InteractiveMode {
|
|
|
4898
4965
|
}
|
|
4899
4966
|
catch (error) {
|
|
4900
4967
|
if (error instanceof MissingSessionCwdError) {
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4968
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
4969
|
+
case "continue": {
|
|
4970
|
+
const result = await this.runtimeHost.switchSession(sessionPath, {
|
|
4971
|
+
cwdOverride: error.issue.fallbackCwd,
|
|
4972
|
+
withSession: options?.withSession,
|
|
4973
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
4974
|
+
});
|
|
4975
|
+
if (!result.cancelled)
|
|
4976
|
+
this.showStatus(`Resumed session in ${error.issue.fallbackCwd}`);
|
|
4977
|
+
return result;
|
|
4978
|
+
}
|
|
4979
|
+
case "fork":
|
|
4980
|
+
return this.switchToForkedSession(sessionPath, error.issue.fallbackCwd, options);
|
|
4981
|
+
case undefined:
|
|
4982
|
+
this.showStatus("Resume cancelled");
|
|
4983
|
+
return { cancelled: true };
|
|
4913
4984
|
}
|
|
4914
|
-
this.showStatus("Resumed session in current cwd");
|
|
4915
|
-
return result;
|
|
4916
4985
|
}
|
|
4917
4986
|
return this.handleFatalRuntimeError("Failed to resume session", error);
|
|
4918
4987
|
}
|
|
4919
4988
|
}
|
|
4989
|
+
/** Fork a session whose stored cwd is gone into `cwd` and switch to the fork, like `--session <id>` from another project (#11060). */
|
|
4990
|
+
async switchToForkedSession(sourcePath, cwd, options) {
|
|
4991
|
+
const fork = SessionManager.forkFrom(sourcePath, cwd, this.sessionManager.getSessionDir());
|
|
4992
|
+
const forkPath = fork.getSessionFile();
|
|
4993
|
+
const result = await this.runtimeHost.switchSession(forkPath, {
|
|
4994
|
+
withSession: options?.withSession,
|
|
4995
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
4996
|
+
});
|
|
4997
|
+
if (result.cancelled) {
|
|
4998
|
+
// An extension vetoed the switch; drop the fork so cancelling leaves no copy behind.
|
|
4999
|
+
fs.rmSync(forkPath, { force: true });
|
|
5000
|
+
return result;
|
|
5001
|
+
}
|
|
5002
|
+
this.showStatus(`Forked into new session ${fork.getSessionId()} in ${cwd}`);
|
|
5003
|
+
return result;
|
|
5004
|
+
}
|
|
4920
5005
|
getLoginProviderOptions(authType) {
|
|
4921
5006
|
const options = [];
|
|
4922
5007
|
for (const provider of this.session.modelRuntime.getProviders()) {
|
|
@@ -4949,7 +5034,8 @@ export class InteractiveMode {
|
|
|
4949
5034
|
});
|
|
4950
5035
|
}
|
|
4951
5036
|
}
|
|
4952
|
-
|
|
5037
|
+
// The sort is stable, so a provider's account option stays above its API key option.
|
|
5038
|
+
return options.sort(compareProviders);
|
|
4953
5039
|
}
|
|
4954
5040
|
async getLogoutProviderOptions() {
|
|
4955
5041
|
return (await this.session.modelRuntime.listCredentials({ signal: AbortSignal.timeout(15_000) }))
|
|
@@ -4963,22 +5049,14 @@ export class InteractiveMode {
|
|
|
4963
5049
|
subscription: provider?.auth.oauth?.isSubscription === true,
|
|
4964
5050
|
};
|
|
4965
5051
|
})
|
|
4966
|
-
.sort(
|
|
4967
|
-
}
|
|
4968
|
-
findLoginProviderOptions(providerRef) {
|
|
4969
|
-
const normalizedProviderRef = providerRef.trim().toLowerCase();
|
|
4970
|
-
if (!normalizedProviderRef) {
|
|
4971
|
-
return [];
|
|
4972
|
-
}
|
|
4973
|
-
return this.getLoginProviderOptions().filter((provider) => provider.id.toLowerCase() === normalizedProviderRef ||
|
|
4974
|
-
provider.name.toLowerCase() === normalizedProviderRef);
|
|
5052
|
+
.sort(compareProviders);
|
|
4975
5053
|
}
|
|
4976
5054
|
async handleLoginCommand(providerRef) {
|
|
4977
5055
|
if (!providerRef) {
|
|
4978
5056
|
this.showLoginAuthTypeSelector();
|
|
4979
5057
|
return;
|
|
4980
5058
|
}
|
|
4981
|
-
const providerOptions = this.
|
|
5059
|
+
const providerOptions = findMatchingProviders(this.getLoginProviderOptions(), providerRef);
|
|
4982
5060
|
if (providerOptions.length === 1) {
|
|
4983
5061
|
await this.startProviderLogin(providerOptions[0]);
|
|
4984
5062
|
return;
|
|
@@ -5095,8 +5173,8 @@ export class InteractiveMode {
|
|
|
5095
5173
|
else {
|
|
5096
5174
|
this.ui.requestRender();
|
|
5097
5175
|
}
|
|
5098
|
-
}, initialSearchInput);
|
|
5099
|
-
return { component: selector, focus: selector };
|
|
5176
|
+
}, initialSearchInput, this.ui);
|
|
5177
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5100
5178
|
});
|
|
5101
5179
|
}
|
|
5102
5180
|
async showOAuthSelector(mode) {
|
|
@@ -5142,8 +5220,8 @@ export class InteractiveMode {
|
|
|
5142
5220
|
}, () => {
|
|
5143
5221
|
done();
|
|
5144
5222
|
this.ui.requestRender();
|
|
5145
|
-
});
|
|
5146
|
-
return { component: selector, focus: selector };
|
|
5223
|
+
}, undefined, this.ui);
|
|
5224
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5147
5225
|
});
|
|
5148
5226
|
}
|
|
5149
5227
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
@@ -5419,24 +5497,10 @@ export class InteractiveMode {
|
|
|
5419
5497
|
* when missing. Nothing is asked when a global server already uses this login.
|
|
5420
5498
|
*/
|
|
5421
5499
|
offerRadiusMcpServer(providerId, providerName) {
|
|
5422
|
-
const
|
|
5423
|
-
|
|
5424
|
-
const { servers } = loadMcpConfig({
|
|
5425
|
-
agentDir: getAgentDir(),
|
|
5426
|
-
cwd: this.sessionManager.getCwd(),
|
|
5427
|
-
projectTrusted: false,
|
|
5428
|
-
});
|
|
5429
|
-
const existing = servers.find((server) => "url" in server.config && normalizeUrl(server.config.url) === normalizeUrl(RADIUS_MCP_URL));
|
|
5430
|
-
if (existing && "url" in existing.config && existing.config.auth?.provider === providerId)
|
|
5500
|
+
const plan = planRadiusMcpServer(providerId, getAgentDir(), this.sessionManager.getCwd());
|
|
5501
|
+
if (!plan)
|
|
5431
5502
|
return;
|
|
5432
|
-
|
|
5433
|
-
if (!existing && servers.some((server) => server.name === name))
|
|
5434
|
-
name = "radius-mcp";
|
|
5435
|
-
const config = existing && "url" in existing.config
|
|
5436
|
-
? { ...existing.config, auth: { provider: providerId } }
|
|
5437
|
-
: { url: RADIUS_MCP_URL, auth: { provider: providerId } };
|
|
5438
|
-
// `auth` replaces the MCP OAuth sign-in.
|
|
5439
|
-
delete config.oauth;
|
|
5503
|
+
const { mcpPath, name, config } = plan;
|
|
5440
5504
|
this.showSelector((done) => {
|
|
5441
5505
|
const selector = new ExtensionSelectorComponent(`Configure ${providerName} MCP in ${mcpPath}?`, ["Yes", "No"], (option) => {
|
|
5442
5506
|
done();
|
|
@@ -5602,18 +5666,22 @@ export class InteractiveMode {
|
|
|
5602
5666
|
}
|
|
5603
5667
|
catch (error) {
|
|
5604
5668
|
if (error instanceof MissingSessionCwdError) {
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5669
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
5670
|
+
case "continue": {
|
|
5671
|
+
const result = await this.runtimeHost.importFromJsonl(inputPath, error.issue.fallbackCwd);
|
|
5672
|
+
this.showStatus(result.cancelled ? "Import cancelled" : `Session imported from: ${inputPath}`);
|
|
5673
|
+
return;
|
|
5674
|
+
}
|
|
5675
|
+
case "fork": {
|
|
5676
|
+
const result = await this.switchToForkedSession(inputPath, error.issue.fallbackCwd);
|
|
5677
|
+
if (result.cancelled)
|
|
5678
|
+
this.showStatus("Import cancelled");
|
|
5679
|
+
return;
|
|
5680
|
+
}
|
|
5681
|
+
case undefined:
|
|
5682
|
+
this.showStatus("Import cancelled");
|
|
5683
|
+
return;
|
|
5614
5684
|
}
|
|
5615
|
-
this.showStatus(`Session imported from: ${inputPath}`);
|
|
5616
|
-
return;
|
|
5617
5685
|
}
|
|
5618
5686
|
if (error instanceof SessionImportFileNotFoundError) {
|
|
5619
5687
|
this.showError(`Failed to import session: ${error.message}`);
|
|
@@ -5780,7 +5848,7 @@ export class InteractiveMode {
|
|
|
5780
5848
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5781
5849
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
5782
5850
|
this.chatContainer.addChild(new Spacer(1));
|
|
5783
|
-
this.chatContainer.addChild(
|
|
5851
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(changelogMarkdown, 1, 1));
|
|
5784
5852
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5785
5853
|
this.ui.requestRender();
|
|
5786
5854
|
}
|
|
@@ -5982,6 +6050,7 @@ export class InteractiveMode {
|
|
|
5982
6050
|
const result = eventResult.result;
|
|
5983
6051
|
// Create UI component for display
|
|
5984
6052
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6053
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
5985
6054
|
if (this.session.isStreaming) {
|
|
5986
6055
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|
|
5987
6056
|
this.pendingBashComponents.push(this.bashComponent);
|
|
@@ -6003,6 +6072,7 @@ export class InteractiveMode {
|
|
|
6003
6072
|
// Normal execution path (possibly with custom operations)
|
|
6004
6073
|
const isDeferred = this.session.isStreaming;
|
|
6005
6074
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6075
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6006
6076
|
if (isDeferred) {
|
|
6007
6077
|
// Show in pending area when agent is streaming
|
|
6008
6078
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|