@maxmo74/pi-coding-agent 1.5.0-max.8 → 1.6.0-max.16
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 +214 -0
- package/README.md +1 -1
- package/dist/bundle/chunks/anthropic-messages-WAFIHSF7.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-EB4MRIM4.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-E6LJTZYC.js +82 -0
- package/dist/bundle/chunks/chunk-EEBRZED2.js +44 -0
- package/dist/bundle/chunks/chunk-EVSO24NP.js +2 -0
- package/dist/bundle/chunks/chunk-EXXWEFU5.js +1247 -0
- package/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-F7LEMV2T.js} +1 -1
- package/dist/bundle/chunks/chunk-I6HYYNH6.js +8 -0
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-ILDLA2JW.js} +1 -1
- package/dist/bundle/chunks/chunk-INODY4DR.js +2 -0
- package/dist/bundle/chunks/{chunk-MSIQUO5T.js → chunk-KREOSXD7.js} +1 -1
- package/dist/bundle/chunks/chunk-LWG2CUTI.js +31 -0
- package/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-NRLRGOCX.js} +1 -1
- package/dist/bundle/chunks/chunk-NRY4NBZW.js +4 -0
- package/dist/bundle/chunks/chunk-NV3NPOPF.js +20 -0
- package/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-RCNEHRMW.js} +1 -1
- package/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-X26YOAEH.js} +15 -14
- package/dist/bundle/chunks/chunk-X6RQRO3L.js +16 -0
- package/dist/bundle/chunks/chunk-XGGZYFNG.js +55 -0
- package/dist/bundle/chunks/chunk-XJ2YV77J.js +30 -0
- package/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/bundle/chunks/chunk-YOWSKVK7.js +2 -0
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-QMJEURSM.js} +7 -7
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-AMCR7QEI.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-7CBVPJQ3.js} +1 -1
- package/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-XDNPBEMU.js} +5 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-43M4N5LK.js +2 -0
- package/dist/bundle/chunks/google-vertex-2B3PASK2.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-XXZYF3RR.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-E3D5ZQKB.js} +2 -2
- package/dist/bundle/chunks/{openai-codex-responses-QAWLOQSN.js → openai-codex-responses-MSQDSDUR.js} +2 -2
- package/dist/bundle/chunks/openai-completions-4IC6AGTR.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-LZ2RLVRX.js} +1 -1
- package/dist/bundle/chunks/openai-responses-MCO3BHCC.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-SHUJ3VSG.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-NIKOQ4O7.js} +1 -1
- package/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-F3SXQONS.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-R2CDUWNO.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-2WYTGPJ3.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.d.ts.map +1 -1
- package/dist/cli/args.js +5 -3
- 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 +12 -7
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +9 -6
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +4 -0
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +16 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +40 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +31 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +160 -63
- 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/exec.d.ts +1 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +6 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +57 -20
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -3
- package/dist/core/export-html/tool-renderer.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 +28 -6
- 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 +14 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +33 -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 +0 -8
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +22 -85
- 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 +26 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +95 -7
- 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 +9 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +5 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +2 -0
- package/dist/core/resource-loader.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/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +45 -36
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-ownership.js +15 -1
- package/dist/core/session-ownership.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 +96 -39
- 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/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -1
- package/dist/core/tools/output-accumulator.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 +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +146 -35
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +6 -2
- package/dist/core/tools/renderers/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/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -4
- package/dist/extensions/llama/provider.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 +7 -9
- 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 +98 -27
- package/dist/main.js.map +1 -1
- package/dist/modes/diagnostics-stderr.d.ts +4 -0
- package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
- package/dist/modes/diagnostics-stderr.js +11 -0
- package/dist/modes/diagnostics-stderr.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +2 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +9 -3
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.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/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +5 -2
- package/dist/modes/interactive/components/config-selector.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 +19 -8
- 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 +39 -8
- 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 +8 -38
- package/dist/modes/interactive/components/radius-login-selector.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 +9 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +8 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +41 -9
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +5 -1
- package/dist/modes/interactive/components/settings-submenu.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/themed-text.d.ts +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/themed-text.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +5 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.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/components/user-message.d.ts +2 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +9 -3
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +14 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +232 -127
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.js +2 -0
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +5 -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 +35 -23
- 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 +67 -45
- 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 +53 -9
- 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 +15 -8
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/flush-stdout.d.ts +8 -0
- package/dist/utils/flush-stdout.d.ts.map +1 -0
- package/dist/utils/flush-stdout.js +23 -0
- package/dist/utils/flush-stdout.js.map +1 -0
- 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 +31 -11
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +5 -8
- package/docs/models-configuration.md +9 -3
- package/docs/models.md +2 -1
- package/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +4 -2
- package/docs/rpc-commands.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 +3 -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/index.ts +4 -7
- 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 +11 -11
- package/schemas/models.schema.json +30 -1
- 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-B46VJEHW.js +0 -44
- package/dist/bundle/chunks/chunk-CF5GWZHW.js +0 -31
- package/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/bundle/chunks/chunk-FGCQRPD5.js +0 -1239
- package/dist/bundle/chunks/chunk-GN3QYODH.js +0 -16
- 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/google-generative-ai-INGKNW72.js +0 -2
- package/dist/bundle/chunks/google-vertex-IBTX6MBF.js +0 -2
- package/dist/bundle/chunks/openai-completions-EJNYB6IX.js +0 -7
- package/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/bundle/chunks/virtual-modules-CLD44EYP.js +0 -2
- 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
|
@@ -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,10 +38,11 @@ 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";
|
|
45
|
+
import { flushStdout } from "../../utils/flush-stdout.js";
|
|
42
46
|
import { parseGitUrl } from "../../utils/git.js";
|
|
43
47
|
import { ensurePngTranscoder } from "../../utils/image-convert.js";
|
|
44
48
|
import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
|
|
@@ -67,6 +71,7 @@ import { ExtensionSelectorComponent } from "./components/extension-selector.js";
|
|
|
67
71
|
import { FooterComponent, formatTokens } from "./components/footer.js";
|
|
68
72
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
69
73
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
74
|
+
import { createMarkdownTransform } from "./components/markdown-transform.js";
|
|
70
75
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
71
76
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
72
77
|
import { formatAuthSelectorProviderStatus, formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
@@ -221,7 +226,7 @@ function getLoginProviderCompletionOptions(providerOptions) {
|
|
|
221
226
|
subscription: provider.subscription,
|
|
222
227
|
});
|
|
223
228
|
}
|
|
224
|
-
return Array.from(byId.values()).sort(
|
|
229
|
+
return Array.from(byId.values()).sort(compareProviders);
|
|
225
230
|
}
|
|
226
231
|
function getLoginProviderSearchText(provider) {
|
|
227
232
|
const authTypes = provider.authTypes
|
|
@@ -235,6 +240,41 @@ function formatLoginProviderCompletionDescription(provider) {
|
|
|
235
240
|
.join("/");
|
|
236
241
|
return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
|
|
237
242
|
}
|
|
243
|
+
/** Assistant diagnostics that list reasoning a provider withheld from the model, by diagnostic type. */
|
|
244
|
+
const REASONING_DROP_DIAGNOSTICS = new Map([
|
|
245
|
+
[
|
|
246
|
+
"anthropic_input_transformations",
|
|
247
|
+
{ provider: "Anthropic", droppedType: "thinking_dropped", noun: ["thinking block", "thinking blocks"] },
|
|
248
|
+
],
|
|
249
|
+
[
|
|
250
|
+
"openai_input_transformations",
|
|
251
|
+
{ provider: "OpenAI", droppedType: "reasoning", noun: ["reasoning item", "reasoning items"] },
|
|
252
|
+
],
|
|
253
|
+
]);
|
|
254
|
+
/** Count the reasoning blocks a provider reported as withheld from the request that produced `message`. */
|
|
255
|
+
function getDroppedReasoning(message) {
|
|
256
|
+
for (const diagnostic of message.diagnostics ?? []) {
|
|
257
|
+
const kind = REASONING_DROP_DIAGNOSTICS.get(diagnostic.type);
|
|
258
|
+
if (!kind)
|
|
259
|
+
continue;
|
|
260
|
+
// Session data: diagnostics details are untyped JSON.
|
|
261
|
+
const transformations = diagnostic.details?.transformations;
|
|
262
|
+
if (!Array.isArray(transformations))
|
|
263
|
+
continue;
|
|
264
|
+
const dropped = transformations.filter((transformation) => typeof transformation === "object" &&
|
|
265
|
+
transformation !== null &&
|
|
266
|
+
transformation.type === kind.droppedType);
|
|
267
|
+
if (dropped.length === 0)
|
|
268
|
+
continue;
|
|
269
|
+
const reasons = new Set();
|
|
270
|
+
for (const transformation of dropped) {
|
|
271
|
+
if (typeof transformation.reason === "string")
|
|
272
|
+
reasons.add(transformation.reason);
|
|
273
|
+
}
|
|
274
|
+
return { diagnostic: kind, count: dropped.length, reasons: [...reasons] };
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
238
278
|
export class InteractiveMode {
|
|
239
279
|
runtimeHost;
|
|
240
280
|
renderer;
|
|
@@ -279,6 +319,8 @@ export class InteractiveMode {
|
|
|
279
319
|
changelogMarkdown = undefined;
|
|
280
320
|
extensionChangelogUpdates = [];
|
|
281
321
|
startupNoticesShown = false;
|
|
322
|
+
/** Last cache-warming notice, extended in place while it is the last chat line. */
|
|
323
|
+
cacheWarmingNotice;
|
|
282
324
|
anthropicSubscriptionWarningShown = false;
|
|
283
325
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
284
326
|
lastStatusSpacer = undefined;
|
|
@@ -328,6 +370,13 @@ export class InteractiveMode {
|
|
|
328
370
|
// Extension dialogs shown in the editor slot (select, confirm, input, editor, inline custom).
|
|
329
371
|
// The last entry is visible; see pushExtensionDialog().
|
|
330
372
|
extensionDialogs = [];
|
|
373
|
+
/** Numbers the program status sources of blocking overlays, so closing one keeps the others. */
|
|
374
|
+
nextBlockingOverlayId = 0;
|
|
375
|
+
/**
|
|
376
|
+
* Open extension overlays (custom with overlay: true) and the function that removes each, in opening
|
|
377
|
+
* order. Reset removes only these, not pi's own overlays.
|
|
378
|
+
*/
|
|
379
|
+
extensionOverlays = new Map();
|
|
331
380
|
extensionTerminalInputSubscriptions = new Set();
|
|
332
381
|
// Extension widgets (components rendered above/below the editor)
|
|
333
382
|
extensionWidgetsAbove = new Map();
|
|
@@ -373,6 +422,7 @@ export class InteractiveMode {
|
|
|
373
422
|
this.runtimeHost.setRebindSession(async () => {
|
|
374
423
|
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
375
424
|
this.themeController.applyFromSettings();
|
|
425
|
+
this.showRuntimeDiagnostics(this.runtimeHost.takeUnreportedDiagnostics());
|
|
376
426
|
});
|
|
377
427
|
this.version = VERSION;
|
|
378
428
|
this.renderer = createInteractiveTui({
|
|
@@ -584,7 +634,7 @@ export class InteractiveMode {
|
|
|
584
634
|
else {
|
|
585
635
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
586
636
|
this.chatContainer.addChild(new Spacer(1));
|
|
587
|
-
this.chatContainer.addChild(
|
|
637
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(this.changelogMarkdown.trim(), 1, 0));
|
|
588
638
|
this.chatContainer.addChild(new Spacer(1));
|
|
589
639
|
}
|
|
590
640
|
}
|
|
@@ -602,7 +652,7 @@ export class InteractiveMode {
|
|
|
602
652
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Extension Updates")), 1, 0));
|
|
603
653
|
this.chatContainer.addChild(new Spacer(1));
|
|
604
654
|
const markdown = this.extensionChangelogUpdates.map((update) => update.markdown).join("\n\n");
|
|
605
|
-
this.chatContainer.addChild(
|
|
655
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(markdown, 1, 0));
|
|
606
656
|
this.chatContainer.addChild(new Spacer(1));
|
|
607
657
|
}
|
|
608
658
|
}
|
|
@@ -657,6 +707,7 @@ export class InteractiveMode {
|
|
|
657
707
|
});
|
|
658
708
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
659
709
|
nextUi.onDebug = onDebug;
|
|
710
|
+
nextUi.setSuspendSignalHandler(() => this.handleCtrlZ());
|
|
660
711
|
if (nextUi instanceof TuiMainScreen && this.mainScreenRenderState) {
|
|
661
712
|
nextUi.restoreRenderState(this.mainScreenRenderState);
|
|
662
713
|
}
|
|
@@ -721,6 +772,8 @@ export class InteractiveMode {
|
|
|
721
772
|
this.defaultEditor.onCtrlD = () => this.handleCtrlD();
|
|
722
773
|
this.defaultEditor.onSubmit = (text) => this.handleStartupSubmit(text);
|
|
723
774
|
this.ui.setFocus(this.editor);
|
|
775
|
+
// An external SIGTSTP (kill -TSTP) restores the terminal like Ctrl+Z (#12272).
|
|
776
|
+
this.ui.setSuspendSignalHandler(() => this.handleCtrlZ());
|
|
724
777
|
// Start the UI before initializing extensions so session_start handlers can use interactive dialogs
|
|
725
778
|
this.ui.start();
|
|
726
779
|
this.isInitialized = true;
|
|
@@ -887,17 +940,7 @@ export class InteractiveMode {
|
|
|
887
940
|
});
|
|
888
941
|
// Show startup warnings
|
|
889
942
|
const { migratedProviders, startupDiagnostics, modelFallbackMessage, initialMessage, initialImages, initialMessages, } = this.options;
|
|
890
|
-
|
|
891
|
-
if (diagnostic.type === "error") {
|
|
892
|
-
this.showError(diagnostic.message);
|
|
893
|
-
}
|
|
894
|
-
else if (diagnostic.type === "warning") {
|
|
895
|
-
this.showWarning(diagnostic.message);
|
|
896
|
-
}
|
|
897
|
-
else {
|
|
898
|
-
this.showStatus(diagnostic.message);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
943
|
+
this.showRuntimeDiagnostics(startupDiagnostics ?? []);
|
|
901
944
|
if (migratedProviders && migratedProviders.length > 0) {
|
|
902
945
|
this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
|
|
903
946
|
}
|
|
@@ -1024,6 +1067,11 @@ export class InteractiveMode {
|
|
|
1024
1067
|
return undefined;
|
|
1025
1068
|
}
|
|
1026
1069
|
const newEntries = getNewEntries(entries, lastVersion);
|
|
1070
|
+
if (!newEntries) {
|
|
1071
|
+
// Unreadable saved version: show nothing and record the current one so later updates compare again
|
|
1072
|
+
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
1073
|
+
return undefined;
|
|
1074
|
+
}
|
|
1027
1075
|
if (newEntries.length > 0) {
|
|
1028
1076
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
1029
1077
|
this.reportInstallTelemetry(VERSION);
|
|
@@ -1058,6 +1106,11 @@ export class InteractiveMode {
|
|
|
1058
1106
|
continue;
|
|
1059
1107
|
}
|
|
1060
1108
|
const newEntries = getNewEntries(parseChangelog(sourceInfo.changelogPath), lastVersion);
|
|
1109
|
+
if (!newEntries) {
|
|
1110
|
+
// Unreadable saved version: show nothing and record the current one so later updates compare again
|
|
1111
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1112
|
+
continue;
|
|
1113
|
+
}
|
|
1061
1114
|
if (newEntries.length > 0) {
|
|
1062
1115
|
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1063
1116
|
const name = pkg.name || sourceInfo.source;
|
|
@@ -1676,6 +1729,19 @@ export class InteractiveMode {
|
|
|
1676
1729
|
this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);
|
|
1677
1730
|
}
|
|
1678
1731
|
}
|
|
1732
|
+
showRuntimeDiagnostics(diagnostics) {
|
|
1733
|
+
for (const diagnostic of diagnostics) {
|
|
1734
|
+
if (diagnostic.type === "error") {
|
|
1735
|
+
this.showError(diagnostic.message);
|
|
1736
|
+
}
|
|
1737
|
+
else if (diagnostic.type === "warning") {
|
|
1738
|
+
this.showWarning(diagnostic.message);
|
|
1739
|
+
}
|
|
1740
|
+
else {
|
|
1741
|
+
this.showStatus(diagnostic.message);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1679
1745
|
async rebindCurrentSession(options = {}) {
|
|
1680
1746
|
const session = this.session;
|
|
1681
1747
|
this.unsubscribe?.();
|
|
@@ -1710,6 +1776,7 @@ export class InteractiveMode {
|
|
|
1710
1776
|
}
|
|
1711
1777
|
stopThemeWatcher();
|
|
1712
1778
|
this.stop("transcript");
|
|
1779
|
+
await flushStdout();
|
|
1713
1780
|
process.exit(1);
|
|
1714
1781
|
}
|
|
1715
1782
|
getCrashExtensionHint(error) {
|
|
@@ -1780,6 +1847,7 @@ export class InteractiveMode {
|
|
|
1780
1847
|
this.loadedResourcesContainer.clear();
|
|
1781
1848
|
this.chatContainer.clear();
|
|
1782
1849
|
this.pendingMessagesContainer.clear();
|
|
1850
|
+
this.pendingBashComponents = [];
|
|
1783
1851
|
this.compactionQueuedMessages = [];
|
|
1784
1852
|
this.streamingComponent = undefined;
|
|
1785
1853
|
this.streamingMessage = undefined;
|
|
@@ -1799,6 +1867,12 @@ export class InteractiveMode {
|
|
|
1799
1867
|
getMarkdownTransformers() {
|
|
1800
1868
|
return [this.mermaidMarkdownTransformer, ...this.session.extensionRunner.getMarkdownTransformers()];
|
|
1801
1869
|
}
|
|
1870
|
+
/** Markdown of a changelog or release note that runs the Markdown transformers of the `changelog` type. */
|
|
1871
|
+
createChangelogMarkdown(markdown, paddingX, paddingY, defaultTextStyle) {
|
|
1872
|
+
return new Markdown(markdown, paddingX, paddingY, this.getMarkdownThemeWithSettings(), defaultTextStyle, {
|
|
1873
|
+
transform: createMarkdownTransform("changelog", () => false, this.getMarkdownTransformers()),
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1802
1876
|
/**
|
|
1803
1877
|
* Set up keyboard shortcuts registered by extensions.
|
|
1804
1878
|
*/
|
|
@@ -1994,7 +2068,10 @@ export class InteractiveMode {
|
|
|
1994
2068
|
this.extensionDialogs = [];
|
|
1995
2069
|
this.showTopExtensionDialog();
|
|
1996
2070
|
}
|
|
1997
|
-
|
|
2071
|
+
// Reload and session switches replace every extension without calling done(): remove their overlays,
|
|
2072
|
+
// newest first, the same way done() does, but leave the promises pending as for inline dialogs.
|
|
2073
|
+
for (const removeOverlay of [...this.extensionOverlays.values()].reverse())
|
|
2074
|
+
removeOverlay();
|
|
1998
2075
|
this.clearExtensionTerminalInputListeners();
|
|
1999
2076
|
this.setExtensionFooter(undefined);
|
|
2000
2077
|
this.setExtensionHeader(undefined);
|
|
@@ -2253,8 +2330,9 @@ export class InteractiveMode {
|
|
|
2253
2330
|
return result === "Yes";
|
|
2254
2331
|
}
|
|
2255
2332
|
async promptForMissingSessionCwd(error) {
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2333
|
+
const options = getMissingSessionCwdOptions(error.issue);
|
|
2334
|
+
const label = await this.showExtensionSelector(formatMissingSessionCwdPrompt(error.issue), options.map((option) => option.label));
|
|
2335
|
+
return options.find((option) => option.label === label)?.value;
|
|
2258
2336
|
}
|
|
2259
2337
|
/**
|
|
2260
2338
|
* Show a text input for extensions.
|
|
@@ -2297,7 +2375,7 @@ export class InteractiveMode {
|
|
|
2297
2375
|
setCustomEditorComponent(factory) {
|
|
2298
2376
|
this.editorComponentFactory = factory;
|
|
2299
2377
|
// Save text from current editor before switching
|
|
2300
|
-
const currentText = this.editor.getText();
|
|
2378
|
+
const currentText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2301
2379
|
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2302
2380
|
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2303
2381
|
if (!dialogOpen) {
|
|
@@ -2383,11 +2461,13 @@ export class InteractiveMode {
|
|
|
2383
2461
|
}
|
|
2384
2462
|
/** Show a custom component with keyboard focus. Overlay mode renders on top of existing content. */
|
|
2385
2463
|
async showExtensionCustom(factory, options) {
|
|
2386
|
-
const savedText = this.editor.getText();
|
|
2464
|
+
const savedText = this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
2387
2465
|
const isOverlay = options?.overlay ?? false;
|
|
2388
2466
|
return new Promise((resolve, reject) => {
|
|
2389
2467
|
let component;
|
|
2390
2468
|
let overlayHandle;
|
|
2469
|
+
// An overlay stays blocked until its interaction ends, also while setHidden() hides it.
|
|
2470
|
+
const overlayStatusSource = isOverlay && options?.blocked ? `extension-overlay:${this.nextBlockingOverlayId++}` : undefined;
|
|
2391
2471
|
let closed = false;
|
|
2392
2472
|
const restoreEditor = () => {
|
|
2393
2473
|
if (component)
|
|
@@ -2395,17 +2475,7 @@ export class InteractiveMode {
|
|
|
2395
2475
|
this.editor.setText(savedText);
|
|
2396
2476
|
this.ui.requestRender();
|
|
2397
2477
|
};
|
|
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);
|
|
2478
|
+
const disposeComponent = () => {
|
|
2409
2479
|
try {
|
|
2410
2480
|
component?.dispose?.();
|
|
2411
2481
|
}
|
|
@@ -2413,6 +2483,30 @@ export class InteractiveMode {
|
|
|
2413
2483
|
/* ignore dispose errors */
|
|
2414
2484
|
}
|
|
2415
2485
|
};
|
|
2486
|
+
// Shared by done() and resetExtensionUI(). Removing the map entry first makes a second call a no-op.
|
|
2487
|
+
const removeOverlay = () => {
|
|
2488
|
+
if (!overlayHandle || !this.extensionOverlays.delete(overlayHandle))
|
|
2489
|
+
return;
|
|
2490
|
+
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2491
|
+
overlayHandle.hide();
|
|
2492
|
+
if (overlayStatusSource)
|
|
2493
|
+
this.programStatus.setBlocked(overlayStatusSource, undefined);
|
|
2494
|
+
disposeComponent();
|
|
2495
|
+
};
|
|
2496
|
+
const close = (result) => {
|
|
2497
|
+
if (closed)
|
|
2498
|
+
return;
|
|
2499
|
+
closed = true;
|
|
2500
|
+
if (isOverlay) {
|
|
2501
|
+
removeOverlay();
|
|
2502
|
+
resolve(result);
|
|
2503
|
+
}
|
|
2504
|
+
else {
|
|
2505
|
+
restoreEditor();
|
|
2506
|
+
resolve(result);
|
|
2507
|
+
disposeComponent();
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2416
2510
|
Promise.resolve(factory(this.ui, theme, this.keybindings, close))
|
|
2417
2511
|
.then((c) => {
|
|
2418
2512
|
if (closed)
|
|
@@ -2432,6 +2526,9 @@ export class InteractiveMode {
|
|
|
2432
2526
|
return w ? { width: w } : undefined;
|
|
2433
2527
|
};
|
|
2434
2528
|
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2529
|
+
this.extensionOverlays.set(overlayHandle, removeOverlay);
|
|
2530
|
+
if (overlayStatusSource)
|
|
2531
|
+
this.programStatus.setBlocked(overlayStatusSource, options?.blocked);
|
|
2435
2532
|
// Expose handle to caller for visibility control
|
|
2436
2533
|
options?.onHandle?.(overlayHandle);
|
|
2437
2534
|
}
|
|
@@ -3022,6 +3119,9 @@ export class InteractiveMode {
|
|
|
3022
3119
|
this.ui.requestRender();
|
|
3023
3120
|
break;
|
|
3024
3121
|
case "agent_settled":
|
|
3122
|
+
// The session records deferred user bash results when the run settles; show them there too.
|
|
3123
|
+
this.flushPendingBashComponents();
|
|
3124
|
+
this.ui.requestRender();
|
|
3025
3125
|
await this.checkShutdownRequested();
|
|
3026
3126
|
break;
|
|
3027
3127
|
case "compaction_start": {
|
|
@@ -3220,7 +3320,7 @@ export class InteractiveMode {
|
|
|
3220
3320
|
case "custom": {
|
|
3221
3321
|
if (message.display) {
|
|
3222
3322
|
const renderer = this.session.extensionRunner.getMessageRenderer(message.customType);
|
|
3223
|
-
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3323
|
+
const component = new CustomMessageComponent(message, renderer, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3224
3324
|
component.setExpanded(this.toolOutputExpanded);
|
|
3225
3325
|
this.chatContainer.addChild(component);
|
|
3226
3326
|
}
|
|
@@ -3228,14 +3328,14 @@ export class InteractiveMode {
|
|
|
3228
3328
|
}
|
|
3229
3329
|
case "compactionSummary": {
|
|
3230
3330
|
this.chatContainer.addChild(new Spacer(1));
|
|
3231
|
-
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3331
|
+
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3232
3332
|
component.setExpanded(this.toolOutputExpanded);
|
|
3233
3333
|
this.chatContainer.addChild(component);
|
|
3234
3334
|
break;
|
|
3235
3335
|
}
|
|
3236
3336
|
case "branchSummary": {
|
|
3237
3337
|
this.chatContainer.addChild(new Spacer(1));
|
|
3238
|
-
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3338
|
+
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3239
3339
|
component.setExpanded(this.toolOutputExpanded);
|
|
3240
3340
|
this.chatContainer.addChild(component);
|
|
3241
3341
|
break;
|
|
@@ -3251,7 +3351,7 @@ export class InteractiveMode {
|
|
|
3251
3351
|
const skillBlock = parseSkillBlock(textContent);
|
|
3252
3352
|
if (skillBlock) {
|
|
3253
3353
|
// Render skill block (collapsible)
|
|
3254
|
-
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3354
|
+
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3255
3355
|
component.setExpanded(this.toolOutputExpanded);
|
|
3256
3356
|
this.chatContainer.addChild(component);
|
|
3257
3357
|
// Render user message separately if present
|
|
@@ -3405,9 +3505,18 @@ export class InteractiveMode {
|
|
|
3405
3505
|
addCacheWarmingUsage(entry) {
|
|
3406
3506
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3407
3507
|
return;
|
|
3508
|
+
// Back-to-back warms collapse into one line with the cumulative cost.
|
|
3509
|
+
const previous = this.cacheWarmingNotice;
|
|
3510
|
+
if (previous && this.chatContainer.children.at(-1) === previous.component && previous.note === entry.note) {
|
|
3511
|
+
previous.total.cost += entry.usage.cost.total;
|
|
3512
|
+
previous.component.invalidate();
|
|
3513
|
+
return;
|
|
3514
|
+
}
|
|
3515
|
+
const total = { cost: entry.usage.cost.total };
|
|
3516
|
+
const component = new ThemedText(() => theme.fg("dim", formatCacheWarmingUsage(total.cost, entry.note)), 1, 0);
|
|
3517
|
+
this.cacheWarmingNotice = { component, total, note: entry.note };
|
|
3408
3518
|
this.chatContainer.addChild(new Spacer(1));
|
|
3409
|
-
|
|
3410
|
-
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3519
|
+
this.chatContainer.addChild(component);
|
|
3411
3520
|
}
|
|
3412
3521
|
/**
|
|
3413
3522
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -3423,42 +3532,30 @@ export class InteractiveMode {
|
|
|
3423
3532
|
this.chatContainer.addChild(new Spacer(1));
|
|
3424
3533
|
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
|
|
3425
3534
|
}
|
|
3426
|
-
static countDroppedThinkingBlocks(message) {
|
|
3427
|
-
let count = 0;
|
|
3428
|
-
for (const diagnostic of message.diagnostics ?? []) {
|
|
3429
|
-
if (diagnostic.type !== "anthropic_input_transformations")
|
|
3430
|
-
continue;
|
|
3431
|
-
const transformations = diagnostic.details?.transformations;
|
|
3432
|
-
if (!Array.isArray(transformations))
|
|
3433
|
-
continue;
|
|
3434
|
-
count += transformations.filter((transformation) => typeof transformation === "object" &&
|
|
3435
|
-
transformation !== null &&
|
|
3436
|
-
transformation.type === "thinking_dropped").length;
|
|
3437
|
-
}
|
|
3438
|
-
return count;
|
|
3439
|
-
}
|
|
3440
3535
|
maybeShowThinkingDropNotice(message) {
|
|
3441
3536
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3442
3537
|
return;
|
|
3443
|
-
const
|
|
3444
|
-
if (
|
|
3538
|
+
const dropped = getDroppedReasoning(message);
|
|
3539
|
+
if (!dropped)
|
|
3445
3540
|
return;
|
|
3446
|
-
|
|
3447
|
-
//
|
|
3448
|
-
// so the branch's last assistant message is the previous response.
|
|
3541
|
+
// Providers report a withheld block again on every later request that replays it, so only
|
|
3542
|
+
// a count above the previous response's means new losses. message_end reaches the UI before
|
|
3543
|
+
// the current message is persisted, so the branch's last assistant message is the previous response.
|
|
3449
3544
|
const branch = this.sessionManager.getBranch();
|
|
3450
3545
|
for (let i = branch.length - 1; i >= 0; i--) {
|
|
3451
3546
|
const entry = branch[i];
|
|
3452
3547
|
if (entry.type === "message" && entry.message.role === "assistant") {
|
|
3453
|
-
|
|
3548
|
+
const previous = getDroppedReasoning(entry.message);
|
|
3549
|
+
if (previous?.diagnostic === dropped.diagnostic && dropped.count <= previous.count)
|
|
3550
|
+
return;
|
|
3454
3551
|
break;
|
|
3455
3552
|
}
|
|
3456
3553
|
}
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
const
|
|
3554
|
+
const { provider, noun: nouns } = dropped.diagnostic;
|
|
3555
|
+
const noun = nouns[dropped.count === 1 ? 0 : 1];
|
|
3556
|
+
const reasons = dropped.reasons.length > 0 ? `: ${dropped.reasons.join(", ")}` : "";
|
|
3460
3557
|
this.chatContainer.addChild(new Spacer(1));
|
|
3461
|
-
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning",
|
|
3558
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${provider} dropped ${dropped.count} ${noun}${reasons} (details in session)`), 1, 0));
|
|
3462
3559
|
}
|
|
3463
3560
|
/**
|
|
3464
3561
|
* Show a transcript notice when a completed assistant message paid for a
|
|
@@ -3570,6 +3667,7 @@ export class InteractiveMode {
|
|
|
3570
3667
|
this.themeController.disableAutoSync();
|
|
3571
3668
|
await this.ui.terminal.drainInput(1000);
|
|
3572
3669
|
this.stop();
|
|
3670
|
+
await flushStdout();
|
|
3573
3671
|
process.exit(0);
|
|
3574
3672
|
}
|
|
3575
3673
|
// Interactive quit (Ctrl+D, Ctrl+C, /quit, extension shutdown()). Stop the
|
|
@@ -3583,8 +3681,10 @@ export class InteractiveMode {
|
|
|
3583
3681
|
await this.runtimeHost.dispose();
|
|
3584
3682
|
const resumeCommand = formatResumeCommand(this.sessionManager);
|
|
3585
3683
|
if (resumeCommand) {
|
|
3586
|
-
|
|
3684
|
+
// Own line so the command can be selected with a triple-click (#12237).
|
|
3685
|
+
process.stdout.write(`${chalk.dim("To resume this session:")}\n${resumeCommand}\n`);
|
|
3587
3686
|
}
|
|
3687
|
+
await flushStdout();
|
|
3588
3688
|
process.exit(0);
|
|
3589
3689
|
}
|
|
3590
3690
|
emergencyTerminalExit() {
|
|
@@ -3813,7 +3913,7 @@ export class InteractiveMode {
|
|
|
3813
3913
|
if (isExpandable(activeHeader)) {
|
|
3814
3914
|
activeHeader.setExpanded(expanded);
|
|
3815
3915
|
}
|
|
3816
|
-
for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
|
|
3916
|
+
for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
|
|
3817
3917
|
for (const child of container.children) {
|
|
3818
3918
|
if (isExpandable(child)) {
|
|
3819
3919
|
child.setExpanded(expanded);
|
|
@@ -3891,9 +3991,7 @@ export class InteractiveMode {
|
|
|
3891
3991
|
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
|
|
3892
3992
|
if (note) {
|
|
3893
3993
|
this.chatContainer.addChild(new Spacer(1));
|
|
3894
|
-
this.chatContainer.addChild(
|
|
3895
|
-
color: (text) => theme.fg("muted", text),
|
|
3896
|
-
}));
|
|
3994
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(note, 1, 0, { color: (text) => theme.fg("muted", text) }));
|
|
3897
3995
|
this.chatContainer.addChild(new Spacer(1));
|
|
3898
3996
|
}
|
|
3899
3997
|
this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
|
|
@@ -3955,6 +4053,10 @@ export class InteractiveMode {
|
|
|
3955
4053
|
}
|
|
3956
4054
|
updatePendingMessagesDisplay() {
|
|
3957
4055
|
this.pendingMessagesContainer.clear();
|
|
4056
|
+
// User bash output shown while the agent works lives here until it moves to the chat.
|
|
4057
|
+
for (const component of this.pendingBashComponents) {
|
|
4058
|
+
this.pendingMessagesContainer.addChild(component);
|
|
4059
|
+
}
|
|
3958
4060
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
|
3959
4061
|
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
|
3960
4062
|
this.pendingMessagesContainer.addChild(new Spacer(1));
|
|
@@ -3982,7 +4084,7 @@ export class InteractiveMode {
|
|
|
3982
4084
|
return 0;
|
|
3983
4085
|
}
|
|
3984
4086
|
const queuedText = allQueued.join("\n\n");
|
|
3985
|
-
const currentText = options?.currentText ?? this.editor.getText();
|
|
4087
|
+
const currentText = options?.currentText ?? this.editor.getExpandedText?.() ?? this.editor.getText();
|
|
3986
4088
|
const combinedText = [queuedText, currentText].filter((t) => t.trim()).join("\n\n");
|
|
3987
4089
|
this.editor.setText(combinedText);
|
|
3988
4090
|
this.updatePendingMessagesDisplay();
|
|
@@ -4898,25 +5000,43 @@ export class InteractiveMode {
|
|
|
4898
5000
|
}
|
|
4899
5001
|
catch (error) {
|
|
4900
5002
|
if (error instanceof MissingSessionCwdError) {
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
5003
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
5004
|
+
case "continue": {
|
|
5005
|
+
const result = await this.runtimeHost.switchSession(sessionPath, {
|
|
5006
|
+
cwdOverride: error.issue.fallbackCwd,
|
|
5007
|
+
withSession: options?.withSession,
|
|
5008
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
5009
|
+
});
|
|
5010
|
+
if (!result.cancelled)
|
|
5011
|
+
this.showStatus(`Resumed session in ${error.issue.fallbackCwd}`);
|
|
5012
|
+
return result;
|
|
5013
|
+
}
|
|
5014
|
+
case "fork":
|
|
5015
|
+
return this.switchToForkedSession(sessionPath, error.issue.fallbackCwd, options);
|
|
5016
|
+
case undefined:
|
|
5017
|
+
this.showStatus("Resume cancelled");
|
|
5018
|
+
return { cancelled: true };
|
|
4913
5019
|
}
|
|
4914
|
-
this.showStatus("Resumed session in current cwd");
|
|
4915
|
-
return result;
|
|
4916
5020
|
}
|
|
4917
5021
|
return this.handleFatalRuntimeError("Failed to resume session", error);
|
|
4918
5022
|
}
|
|
4919
5023
|
}
|
|
5024
|
+
/** Fork a session whose stored cwd is gone into `cwd` and switch to the fork, like `--session <id>` from another project (#11060). */
|
|
5025
|
+
async switchToForkedSession(sourcePath, cwd, options) {
|
|
5026
|
+
const fork = SessionManager.forkFrom(sourcePath, cwd, this.sessionManager.getSessionDir());
|
|
5027
|
+
const forkPath = fork.getSessionFile();
|
|
5028
|
+
const result = await this.runtimeHost.switchSession(forkPath, {
|
|
5029
|
+
withSession: options?.withSession,
|
|
5030
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
5031
|
+
});
|
|
5032
|
+
if (result.cancelled) {
|
|
5033
|
+
// An extension vetoed the switch; drop the fork so cancelling leaves no copy behind.
|
|
5034
|
+
fs.rmSync(forkPath, { force: true });
|
|
5035
|
+
return result;
|
|
5036
|
+
}
|
|
5037
|
+
this.showStatus(`Forked into new session ${fork.getSessionId()} in ${cwd}`);
|
|
5038
|
+
return result;
|
|
5039
|
+
}
|
|
4920
5040
|
getLoginProviderOptions(authType) {
|
|
4921
5041
|
const options = [];
|
|
4922
5042
|
for (const provider of this.session.modelRuntime.getProviders()) {
|
|
@@ -4949,7 +5069,8 @@ export class InteractiveMode {
|
|
|
4949
5069
|
});
|
|
4950
5070
|
}
|
|
4951
5071
|
}
|
|
4952
|
-
|
|
5072
|
+
// The sort is stable, so a provider's account option stays above its API key option.
|
|
5073
|
+
return options.sort(compareProviders);
|
|
4953
5074
|
}
|
|
4954
5075
|
async getLogoutProviderOptions() {
|
|
4955
5076
|
return (await this.session.modelRuntime.listCredentials({ signal: AbortSignal.timeout(15_000) }))
|
|
@@ -4963,22 +5084,14 @@ export class InteractiveMode {
|
|
|
4963
5084
|
subscription: provider?.auth.oauth?.isSubscription === true,
|
|
4964
5085
|
};
|
|
4965
5086
|
})
|
|
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);
|
|
5087
|
+
.sort(compareProviders);
|
|
4975
5088
|
}
|
|
4976
5089
|
async handleLoginCommand(providerRef) {
|
|
4977
5090
|
if (!providerRef) {
|
|
4978
5091
|
this.showLoginAuthTypeSelector();
|
|
4979
5092
|
return;
|
|
4980
5093
|
}
|
|
4981
|
-
const providerOptions = this.
|
|
5094
|
+
const providerOptions = findMatchingProviders(this.getLoginProviderOptions(), providerRef);
|
|
4982
5095
|
if (providerOptions.length === 1) {
|
|
4983
5096
|
await this.startProviderLogin(providerOptions[0]);
|
|
4984
5097
|
return;
|
|
@@ -5095,8 +5208,8 @@ export class InteractiveMode {
|
|
|
5095
5208
|
else {
|
|
5096
5209
|
this.ui.requestRender();
|
|
5097
5210
|
}
|
|
5098
|
-
}, initialSearchInput);
|
|
5099
|
-
return { component: selector, focus: selector };
|
|
5211
|
+
}, initialSearchInput, this.ui);
|
|
5212
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5100
5213
|
});
|
|
5101
5214
|
}
|
|
5102
5215
|
async showOAuthSelector(mode) {
|
|
@@ -5142,8 +5255,8 @@ export class InteractiveMode {
|
|
|
5142
5255
|
}, () => {
|
|
5143
5256
|
done();
|
|
5144
5257
|
this.ui.requestRender();
|
|
5145
|
-
});
|
|
5146
|
-
return { component: selector, focus: selector };
|
|
5258
|
+
}, undefined, this.ui);
|
|
5259
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5147
5260
|
});
|
|
5148
5261
|
}
|
|
5149
5262
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
@@ -5419,24 +5532,10 @@ export class InteractiveMode {
|
|
|
5419
5532
|
* when missing. Nothing is asked when a global server already uses this login.
|
|
5420
5533
|
*/
|
|
5421
5534
|
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)
|
|
5535
|
+
const plan = planRadiusMcpServer(providerId, getAgentDir(), this.sessionManager.getCwd());
|
|
5536
|
+
if (!plan)
|
|
5431
5537
|
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;
|
|
5538
|
+
const { mcpPath, name, config } = plan;
|
|
5440
5539
|
this.showSelector((done) => {
|
|
5441
5540
|
const selector = new ExtensionSelectorComponent(`Configure ${providerName} MCP in ${mcpPath}?`, ["Yes", "No"], (option) => {
|
|
5442
5541
|
done();
|
|
@@ -5602,18 +5701,22 @@ export class InteractiveMode {
|
|
|
5602
5701
|
}
|
|
5603
5702
|
catch (error) {
|
|
5604
5703
|
if (error instanceof MissingSessionCwdError) {
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5704
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
5705
|
+
case "continue": {
|
|
5706
|
+
const result = await this.runtimeHost.importFromJsonl(inputPath, error.issue.fallbackCwd);
|
|
5707
|
+
this.showStatus(result.cancelled ? "Import cancelled" : `Session imported from: ${inputPath}`);
|
|
5708
|
+
return;
|
|
5709
|
+
}
|
|
5710
|
+
case "fork": {
|
|
5711
|
+
const result = await this.switchToForkedSession(inputPath, error.issue.fallbackCwd);
|
|
5712
|
+
if (result.cancelled)
|
|
5713
|
+
this.showStatus("Import cancelled");
|
|
5714
|
+
return;
|
|
5715
|
+
}
|
|
5716
|
+
case undefined:
|
|
5717
|
+
this.showStatus("Import cancelled");
|
|
5718
|
+
return;
|
|
5614
5719
|
}
|
|
5615
|
-
this.showStatus(`Session imported from: ${inputPath}`);
|
|
5616
|
-
return;
|
|
5617
5720
|
}
|
|
5618
5721
|
if (error instanceof SessionImportFileNotFoundError) {
|
|
5619
5722
|
this.showError(`Failed to import session: ${error.message}`);
|
|
@@ -5780,7 +5883,7 @@ export class InteractiveMode {
|
|
|
5780
5883
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5781
5884
|
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
5782
5885
|
this.chatContainer.addChild(new Spacer(1));
|
|
5783
|
-
this.chatContainer.addChild(
|
|
5886
|
+
this.chatContainer.addChild(this.createChangelogMarkdown(changelogMarkdown, 1, 1));
|
|
5784
5887
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5785
5888
|
this.ui.requestRender();
|
|
5786
5889
|
}
|
|
@@ -5982,6 +6085,7 @@ export class InteractiveMode {
|
|
|
5982
6085
|
const result = eventResult.result;
|
|
5983
6086
|
// Create UI component for display
|
|
5984
6087
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6088
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
5985
6089
|
if (this.session.isStreaming) {
|
|
5986
6090
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|
|
5987
6091
|
this.pendingBashComponents.push(this.bashComponent);
|
|
@@ -6003,6 +6107,7 @@ export class InteractiveMode {
|
|
|
6003
6107
|
// Normal execution path (possibly with custom operations)
|
|
6004
6108
|
const isDeferred = this.session.isStreaming;
|
|
6005
6109
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6110
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6006
6111
|
if (isDeferred) {
|
|
6007
6112
|
// Show in pending area when agent is streaming
|
|
6008
6113
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|