@averyyy/pi-coding-agent 0.87.1-piclient.2 → 1.0.0-piclient.1
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 +183 -0
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.js.map +1 -1
- package/dist/bun/runtime-setup.d.ts.map +1 -1
- package/dist/bun/runtime-setup.js +4 -1
- package/dist/bun/runtime-setup.js.map +1 -1
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -1
- package/dist/bundle/chunks/anthropic-messages-UID2PALB.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-WK37QQ3X.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/bundle/chunks/chunk-2LGHNI5Y.js +1553 -0
- package/dist/bundle/chunks/chunk-6D7LHLKG.js +2 -0
- package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
- package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-CWVWZD3J.js} +2 -2
- package/dist/bundle/chunks/chunk-GIUN2MS4.js +16 -0
- package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
- package/dist/bundle/chunks/chunk-KYK7L7MP.js +127 -0
- package/dist/bundle/chunks/chunk-LD2P6SFZ.js +2 -0
- package/dist/bundle/chunks/chunk-LDPPAHPJ.js +4 -0
- package/dist/bundle/chunks/chunk-NEUJZQL3.js +19 -0
- package/dist/bundle/chunks/chunk-OI6YFHHK.js +82 -0
- package/dist/bundle/chunks/chunk-OSKPX3Z5.js +2 -0
- package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
- package/dist/bundle/chunks/chunk-SQXKOUF6.js +2 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/chunk-VIV3CWXG.js +2 -0
- package/dist/bundle/chunks/chunk-Y5O5BZGX.js +136 -0
- package/dist/bundle/chunks/{chunk-UZNGGY6N.js → chunk-Z772OFUN.js} +3 -3
- package/dist/bundle/chunks/cli-JE36AHMI.js +51 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-NPQN263E.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +354 -0
- package/dist/bundle/chunks/execute-UX73LR4F.js +367 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-OHRSHIE7.js +2 -0
- package/dist/bundle/chunks/google-vertex-KXEB3MVO.js +2 -0
- package/dist/bundle/chunks/{https-proxy-agent-2VXB7436.js → https-proxy-agent-UDEHOBGS.js} +1 -1
- package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
- package/dist/bundle/chunks/llama-cpp-classify-XT44PI3C.js +22 -0
- package/dist/bundle/chunks/mistral-conversations-DKVFNQL6.js +5 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/{openai-codex-responses-SG7PGUUZ.js → openai-codex-responses-WVERB76N.js} +2 -2
- package/dist/bundle/chunks/openai-codex.js +2 -2
- package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-JXDDPZ23.js} +2 -2
- package/dist/bundle/chunks/openai-responses-WDT74L23.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-ZVXWCSIM.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +2 -2
- package/dist/bundle/chunks/pi-logo-animation-APS4JS6B.js +2 -0
- package/dist/bundle/chunks/{pi-messages-GFKBWJHZ.js → pi-messages-TM5SOOIW.js} +2 -2
- package/dist/bundle/chunks/radius.js +2 -2
- package/dist/bundle/chunks/runtime-MPXPM7VL.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-A4CZTQWZ.js +2 -0
- package/dist/bundle/chunks/virtual-modules-XLXFDFIX.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 +6 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +38 -30
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config.d.ts +15 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +13 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +133 -12
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +598 -297
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-guidance.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/core/bug-report-upload.d.ts.map +1 -1
- package/dist/core/bug-report-upload.js.map +1 -1
- package/dist/core/bug-report.d.ts +1 -1
- package/dist/core/bug-report.d.ts.map +1 -1
- package/dist/core/bug-report.js +1 -1
- package/dist/core/bug-report.js.map +1 -1
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +1 -22
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +25 -18
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/crash-log.d.ts.map +1 -1
- package/dist/core/crash-log.js +2 -1
- package/dist/core/crash-log.js.map +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/event-bus.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +10 -0
- package/dist/core/export-html/template.js +66 -17
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- 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/jiti-loader.d.ts.map +1 -1
- package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +67 -5
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +18 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +99 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +301 -22
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +2 -2
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +3 -3
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +125 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +198 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +15 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +29 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +5 -5
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +47 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +189 -35
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +102 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -0
- package/dist/core/nested-tool-calls.js +178 -0
- package/dist/core/nested-tool-calls.js.map +1 -0
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/package-manager.d.ts +4 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +59 -12
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-client-cli-adapter.d.ts.map +1 -1
- package/dist/core/pi-client-cli-adapter.js.map +1 -1
- package/dist/core/pi-client-runtime-update.d.ts.map +1 -1
- package/dist/core/pi-client-runtime-update.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/pi-server-protocol.d.ts.map +1 -1
- package/dist/core/pi-server-protocol.js.map +1 -1
- package/dist/core/pi-server-request.d.ts.map +1 -1
- package/dist/core/pi-server-request.js.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-composer.d.ts +40 -21
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +92 -40
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +8 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +21 -11
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +7 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +161 -35
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +25 -6
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-export.d.ts.map +1 -1
- package/dist/core/session-export.js.map +1 -1
- package/dist/core/session-manager.d.ts +9 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +22 -22
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts.map +1 -1
- package/dist/core/settings-diagnostics.js.map +1 -1
- package/dist/core/settings-manager.d.ts +36 -4
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +75 -4
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/source-info.d.ts +8 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +16 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +12 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +33 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +11 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +36 -0
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/path-utils.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +6 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +26 -0
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +11 -32
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/find.d.ts.map +1 -1
- package/dist/core/tools/renderers/find.js.map +1 -1
- package/dist/core/tools/renderers/grep.d.ts.map +1 -1
- package/dist/core/tools/renderers/grep.js.map +1 -1
- package/dist/core/tools/renderers/index.d.ts.map +1 -1
- package/dist/core/tools/renderers/index.js.map +1 -1
- package/dist/core/tools/renderers/ls.d.ts.map +1 -1
- package/dist/core/tools/renderers/ls.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +3 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +5 -3
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +14 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +29 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +1 -0
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +2 -0
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +23 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/core/virtual-models.d.ts +117 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +124 -0
- package/dist/core/virtual-models.js.map +1 -0
- package/dist/extensions/codemode/execute.d.ts +16 -0
- package/dist/extensions/codemode/execute.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.js +536 -0
- package/dist/extensions/codemode/execute.js.map +1 -0
- package/dist/extensions/codemode/execute.lazy.d.ts +3 -0
- package/dist/extensions/codemode/execute.lazy.d.ts.map +1 -0
- package/dist/extensions/codemode/execute.lazy.js +3 -0
- package/dist/extensions/codemode/execute.lazy.js.map +1 -0
- package/dist/extensions/codemode/index.d.ts +21 -0
- package/dist/extensions/codemode/index.d.ts.map +1 -0
- package/dist/extensions/codemode/index.js +31 -0
- package/dist/extensions/codemode/index.js.map +1 -0
- package/dist/extensions/codemode/renderer.d.ts +12 -0
- package/dist/extensions/codemode/renderer.d.ts.map +1 -0
- package/dist/extensions/codemode/renderer.js +137 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +123 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +268 -0
- package/dist/extensions/codemode/tool.js.map +1 -0
- package/dist/extensions/codemode/worker.d.ts +7 -0
- package/dist/extensions/codemode/worker.d.ts.map +1 -0
- package/dist/extensions/codemode/worker.js +7 -0
- package/dist/extensions/codemode/worker.js.map +1 -0
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +11 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/huggingface.d.ts.map +1 -1
- package/dist/extensions/llama/huggingface.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.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 +65 -13
- 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.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +500 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +72 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +158 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +76 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +1066 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +97 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +358 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +98 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +395 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +84 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +251 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +174 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/extensions/tool-search/index.d.ts +12 -0
- package/dist/extensions/tool-search/index.d.ts.map +1 -0
- package/dist/extensions/tool-search/index.js +15 -0
- package/dist/extensions/tool-search/index.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +73 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +189 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +16 -0
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js.map +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.js.map +1 -1
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/chat-viewport.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +13 -3
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +4 -4
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js +8 -2
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +7 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +43 -3
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +8 -2
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +24 -21
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/pi-logo-animation.d.ts +68 -0
- package/dist/modes/interactive/components/pi-logo-animation.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.js +1086 -0
- package/dist/modes/interactive/components/pi-logo-animation.js.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts +7 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.js +12 -0
- package/dist/modes/interactive/components/pi-logo-animation.lazy.js.map +1 -0
- package/dist/modes/interactive/components/pi-logo.d.ts +19 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo.js +37 -0
- package/dist/modes/interactive/components/pi-logo.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +15 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.js +85 -0
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -4
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +33 -11
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +17 -0
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -0
- package/dist/modes/interactive/components/themed-text.js +29 -0
- package/dist/modes/interactive/components/themed-text.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +2 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +5 -4
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +27 -3
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +39 -6
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +21 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +348 -197
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts.map +1 -1
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +59 -72
- package/dist/modes/interactive/theme/light.json +57 -69
- package/dist/modes/interactive/theme/system-theme.d.ts +55 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +546 -0
- package/dist/modes/interactive/theme/system-theme.js.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +46 -6
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +127 -47
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-json.js +3 -1
- package/dist/modes/interactive/theme/theme-json.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +7 -2
- package/dist/modes/interactive/theme/theme.d.ts +66 -39
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +238 -317
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +2 -1
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/tui-renderer.js +1 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +6 -6
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +12 -8
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +7 -9
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +10 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +6 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/pi-client-cli.d.ts.map +1 -1
- package/dist/pi-client-cli.js.map +1 -1
- package/dist/rpc-entry.d.ts.map +1 -1
- package/dist/rpc-entry.js.map +1 -1
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +14 -17
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +5 -0
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/deprecation.d.ts.map +1 -1
- package/dist/utils/deprecation.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/fs-watch.js.map +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/html.d.ts.map +1 -1
- package/dist/utils/html.js.map +1 -1
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-process.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize-worker.d.ts.map +1 -1
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +3 -3
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +5 -4
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts +1 -3
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +3 -30
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +2 -0
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/dist/utils/wsl.d.ts.map +1 -1
- package/dist/utils/wsl.js.map +1 -1
- package/dist/utils/zip.d.ts.map +1 -1
- package/dist/utils/zip.js.map +1 -1
- package/docs/cli.md +58 -7
- package/docs/codemode.md +207 -0
- package/docs/configuration.md +2 -0
- package/docs/custom-provider.md +43 -4
- package/docs/docs.json +13 -1
- package/docs/environment-variables.md +2 -2
- package/docs/extensions.md +55 -0
- package/docs/index.md +1 -1
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +13 -0
- package/docs/mcp.md +248 -0
- package/docs/models.md +57 -1
- package/docs/packages.md +4 -2
- package/docs/providers.md +19 -6
- package/docs/rpc-commands.md +9 -3
- package/docs/rpc.md +3 -1
- package/docs/sdk.md +8 -3
- package/docs/security.md +2 -0
- package/docs/session-format.md +5 -1
- package/docs/settings.md +24 -5
- package/docs/themes.md +33 -7
- package/docs/tui.md +18 -0
- package/docs/usage.md +1 -1
- package/docs/virtual-models.md +114 -0
- package/docs/windows.md +2 -0
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +2 -0
- package/examples/extensions/built-in-tool-renderer.ts +16 -40
- 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/custom-provider-gitlab-duo/test.ts +5 -5
- package/examples/extensions/debug-provider.ts +90 -0
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/jev-router.ts +113 -0
- package/examples/extensions/minimal-mode.ts +24 -96
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-client.ts +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/14-codemode-mcp.ts +61 -0
- package/examples/sdk/README.md +2 -1
- package/package.json +14 -12
- package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-QJ7SPP5M.js +0 -2
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
- package/dist/bundle/chunks/chunk-BZKWNWMI.js +0 -2
- package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
- package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
- package/dist/bundle/chunks/chunk-S7SZN6Z3.js +0 -2
- package/dist/bundle/chunks/chunk-X2F52Z34.js +0 -1685
- package/dist/bundle/chunks/chunk-XNGRGP62.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +0 -2
- package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +0 -5
- package/dist/bundle/chunks/openai-responses-AH7QTG23.js +0 -2
- package/dist/bundle/chunks/virtual-modules-WWGGM27U.js +0 -2
|
@@ -26,6 +26,7 @@ import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScop
|
|
|
26
26
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
27
27
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
28
28
|
import { getCliBinName } from "../../core/pi-client-cli-adapter.js";
|
|
29
|
+
import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID } from "../../core/radius.js";
|
|
29
30
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
30
31
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
31
32
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
@@ -33,8 +34,9 @@ import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
|
33
34
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
34
35
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
35
36
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
37
|
+
import { addMcpServerConfig, loadMcpConfig } from "../../extensions/mcp/config.js";
|
|
36
38
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
37
|
-
import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
|
|
39
|
+
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
38
40
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
39
41
|
import { parseGitUrl } from "../../utils/git.js";
|
|
40
42
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
@@ -64,12 +66,16 @@ import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./c
|
|
|
64
66
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
65
67
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
66
68
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
67
|
-
import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
69
|
+
import { formatAuthSelectorProviderStatus, formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
70
|
+
import { piLogoLines, piWordmark, supportsPiLogo } from "./components/pi-logo.js";
|
|
71
|
+
import { playPiLogoAnimation } from "./components/pi-logo-animation.lazy.js";
|
|
72
|
+
import { createLoginMenuSelector } from "./components/radius-login-selector.js";
|
|
68
73
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
69
74
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
70
75
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
71
76
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
72
77
|
import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
78
|
+
import { ThemedText } from "./components/themed-text.js";
|
|
73
79
|
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
74
80
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
75
81
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
@@ -80,7 +86,7 @@ import { editInExternalEditor } from "./external-editor.js";
|
|
|
80
86
|
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
81
87
|
import { getModelSearchText } from "./model-search.js";
|
|
82
88
|
import { shareSession } from "./session-share.js";
|
|
83
|
-
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
89
|
+
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
84
90
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
85
91
|
import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
86
92
|
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
@@ -93,16 +99,26 @@ function isWorkingStatusEditor(editor) {
|
|
|
93
99
|
function isExpandable(obj) {
|
|
94
100
|
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
95
101
|
}
|
|
96
|
-
class ExpandableText extends
|
|
97
|
-
|
|
98
|
-
getExpandedText;
|
|
102
|
+
class ExpandableText extends ThemedText {
|
|
103
|
+
state;
|
|
99
104
|
constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
105
|
+
const state = { expanded };
|
|
106
|
+
super(() => (state.expanded ? getExpandedText() : getCollapsedText()), paddingX, paddingY);
|
|
107
|
+
this.state = state;
|
|
103
108
|
}
|
|
104
109
|
setExpanded(expanded) {
|
|
105
|
-
this.
|
|
110
|
+
this.state.expanded = expanded;
|
|
111
|
+
this.invalidate();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** The built-in header. Clicking its logo (the first two lines, after one column of padding) plays an easter egg. */
|
|
115
|
+
class BuiltInHeader extends ExpandableText {
|
|
116
|
+
onLogoClick;
|
|
117
|
+
handleMouse(event) {
|
|
118
|
+
if (event.type !== "click" || event.y > 1 || event.x < 1 || event.x > 4 || !this.onLogoClick)
|
|
119
|
+
return undefined;
|
|
120
|
+
this.onLogoClick(event.screenX - event.x + 1, event.screenY - event.y);
|
|
121
|
+
return { handled: true };
|
|
106
122
|
}
|
|
107
123
|
}
|
|
108
124
|
function isCustomSessionEntry(item) {
|
|
@@ -174,6 +190,7 @@ function llamaCppPostLoginGuidance(actionLabel, loadedModelCount) {
|
|
|
174
190
|
? `${actionLabel}. No llama.cpp models are loaded. Use /llama to load a model, then /model to select it.`
|
|
175
191
|
: `${actionLabel}. Use /model to select a loaded llama.cpp model, or /llama to manage models.`;
|
|
176
192
|
}
|
|
193
|
+
const RADIUS_LOGIN_INTRO = "Radius is a service crafted for Pi by the builders of Pi, Earendil Works";
|
|
177
194
|
const AUTH_TYPE_ORDER = { oauth: 0, api_key: 1 };
|
|
178
195
|
function createFuzzyAutocompleteItems(items, prefix, getSearchText, toAutocompleteItem) {
|
|
179
196
|
const filtered = fuzzyFilter(items, prefix, getSearchText);
|
|
@@ -196,18 +213,21 @@ function getLoginProviderCompletionOptions(providerOptions) {
|
|
|
196
213
|
id: provider.id,
|
|
197
214
|
name: provider.name,
|
|
198
215
|
authTypes: [provider.authType],
|
|
216
|
+
subscription: provider.subscription,
|
|
199
217
|
});
|
|
200
218
|
}
|
|
201
219
|
return Array.from(byId.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
202
220
|
}
|
|
203
221
|
function getLoginProviderSearchText(provider) {
|
|
204
222
|
const authTypes = provider.authTypes
|
|
205
|
-
.map((authType) => `${authType} ${formatAuthSelectorProviderType(authType)}`)
|
|
223
|
+
.map((authType) => `${authType} ${formatAuthSelectorProviderType(authType, provider.subscription)}`)
|
|
206
224
|
.join(" ");
|
|
207
225
|
return `${provider.id} ${provider.name} ${authTypes}`;
|
|
208
226
|
}
|
|
209
227
|
function formatLoginProviderCompletionDescription(provider) {
|
|
210
|
-
const authTypes = provider.authTypes
|
|
228
|
+
const authTypes = provider.authTypes
|
|
229
|
+
.map((authType) => formatAuthSelectorProviderType(authType, provider.subscription))
|
|
230
|
+
.join("/");
|
|
211
231
|
return provider.name === provider.id ? authTypes : `${provider.name} · ${authTypes}`;
|
|
212
232
|
}
|
|
213
233
|
export class InteractiveMode {
|
|
@@ -257,6 +277,7 @@ export class InteractiveMode {
|
|
|
257
277
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
258
278
|
lastStatusSpacer = undefined;
|
|
259
279
|
lastStatusText = undefined;
|
|
280
|
+
lastStatusMessage = "";
|
|
260
281
|
managedToolStatusStarted = false;
|
|
261
282
|
// Streaming message tracking
|
|
262
283
|
streamingComponent = undefined;
|
|
@@ -347,7 +368,7 @@ export class InteractiveMode {
|
|
|
347
368
|
});
|
|
348
369
|
this.runtimeHost.setRebindSession(async () => {
|
|
349
370
|
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
350
|
-
|
|
371
|
+
this.themeController.applyFromSettings();
|
|
351
372
|
});
|
|
352
373
|
this.version = VERSION;
|
|
353
374
|
this.renderer = createInteractiveTui({
|
|
@@ -357,6 +378,7 @@ export class InteractiveMode {
|
|
|
357
378
|
terminal: options.terminal,
|
|
358
379
|
onRightClickPaste: this.onRightClickPaste,
|
|
359
380
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
381
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
360
382
|
});
|
|
361
383
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
362
384
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -401,7 +423,8 @@ export class InteractiveMode {
|
|
|
401
423
|
});
|
|
402
424
|
}
|
|
403
425
|
getAutocompleteSourceTag(sourceInfo) {
|
|
404
|
-
|
|
426
|
+
// Built-in extension commands are untagged, like built-in commands.
|
|
427
|
+
if (!sourceInfo || sourceInfo.source === "builtin") {
|
|
405
428
|
return undefined;
|
|
406
429
|
}
|
|
407
430
|
const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
|
|
@@ -554,7 +577,7 @@ export class InteractiveMode {
|
|
|
554
577
|
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
555
578
|
}
|
|
556
579
|
else {
|
|
557
|
-
this.chatContainer.addChild(new
|
|
580
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
558
581
|
this.chatContainer.addChild(new Spacer(1));
|
|
559
582
|
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
560
583
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -606,6 +629,7 @@ export class InteractiveMode {
|
|
|
606
629
|
terminal,
|
|
607
630
|
onRightClickPaste: this.onRightClickPaste,
|
|
608
631
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
632
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
609
633
|
});
|
|
610
634
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
611
635
|
nextUi.onDebug = onDebug;
|
|
@@ -636,7 +660,7 @@ export class InteractiveMode {
|
|
|
636
660
|
this.registerSignalHandlers();
|
|
637
661
|
// Load changelog (only show new entries, skip for resumed sessions)
|
|
638
662
|
this.changelogMarkdown = this.getChangelogForDisplay();
|
|
639
|
-
if (this.session.scopedModels.length > 0 &&
|
|
663
|
+
if (this.session.scopedModels.length > 0 && this.shouldShowStartupDetails()) {
|
|
640
664
|
const modelList = this.session.scopedModels
|
|
641
665
|
.map((sm) => {
|
|
642
666
|
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
|
@@ -683,13 +707,26 @@ export class InteractiveMode {
|
|
|
683
707
|
this.ui.start();
|
|
684
708
|
this.bindAbortInputListener();
|
|
685
709
|
this.isInitialized = true;
|
|
686
|
-
|
|
710
|
+
this.themeController.applyFromSettings();
|
|
711
|
+
// The header and startup notices bake theme colors into their text, so build them once the terminal
|
|
712
|
+
// reported its colors. This ends at the terminal's DA1 reply, or after 100 ms if it answers nothing.
|
|
713
|
+
await this.themeController.waitForTerminalColors();
|
|
687
714
|
// Add header with keybindings from config (unless silenced)
|
|
688
|
-
if (this.
|
|
689
|
-
const
|
|
715
|
+
if (this.shouldShowStartupHeader()) {
|
|
716
|
+
const showDetails = this.shouldShowStartupDetails();
|
|
717
|
+
// Built on demand so the header follows theme changes. The logo's first line carries the version,
|
|
718
|
+
// its second line the first line of key hints. Terminals that cannot render the logo get a
|
|
719
|
+
// "Pi vX" line instead, with the key hints below it.
|
|
720
|
+
const showLogo = supportsPiLogo();
|
|
721
|
+
const withLogo = (hints) => {
|
|
722
|
+
if (!showLogo)
|
|
723
|
+
return `${piWordmark()} ${theme.fg("dim", `v${this.version}`)}\n${hints}`;
|
|
724
|
+
const [top, bottom] = piLogoLines();
|
|
725
|
+
return `${top} ${theme.fg("dim", `v${this.version}`)}\n${bottom} ${hints}`;
|
|
726
|
+
};
|
|
690
727
|
// Build startup instructions using keybinding hint helpers
|
|
691
728
|
const hint = (keybinding, description) => keyHint(keybinding, description);
|
|
692
|
-
const expandedInstructions = [
|
|
729
|
+
const expandedInstructions = () => [
|
|
693
730
|
hint("app.interrupt", "to interrupt"),
|
|
694
731
|
hint("app.clear", "to clear"),
|
|
695
732
|
rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
|
|
@@ -707,19 +744,22 @@ export class InteractiveMode {
|
|
|
707
744
|
rawKeyHint("!!", "to run bash (no context)"),
|
|
708
745
|
hint("app.message.followUp", "to queue follow-up"),
|
|
709
746
|
hint("app.message.dequeue", "to edit all queued messages"),
|
|
710
|
-
hint("app.clipboard.pasteImage", "to paste
|
|
747
|
+
hint("app.clipboard.pasteImage", "to paste files on macOS, images, or text"),
|
|
711
748
|
rawKeyHint("drop files", "to attach"),
|
|
712
749
|
].join("\n");
|
|
713
|
-
const compactInstructions = [
|
|
750
|
+
const compactInstructions = () => [
|
|
714
751
|
hint("app.interrupt", "interrupt"),
|
|
715
752
|
rawKeyHint(`${keyText("app.clear")}/${keyText("app.exit")}`, "clear/exit"),
|
|
716
753
|
rawKeyHint("/", "commands"),
|
|
717
754
|
rawKeyHint("!", "bash"),
|
|
718
755
|
hint("app.tools.expand", "more"),
|
|
719
756
|
].join(theme.fg("muted", " · "));
|
|
720
|
-
const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
|
|
721
|
-
const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
722
|
-
|
|
757
|
+
const compactOnboarding = () => theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help${showDetails ? " and loaded resources" : ""}.`);
|
|
758
|
+
const onboarding = () => theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
759
|
+
const header = new BuiltInHeader(() => `${withLogo(compactInstructions())}\n${compactOnboarding()}\n\n${onboarding()}`, () => `${withLogo(expandedInstructions())}\n\n${onboarding()}`, this.getStartupExpansionState(), 1, 0);
|
|
760
|
+
if (showLogo)
|
|
761
|
+
header.onLogoClick = (column, row) => playPiLogoAnimation(this.renderer, column, row);
|
|
762
|
+
this.builtInHeader = header;
|
|
723
763
|
// Setup UI layout
|
|
724
764
|
this.headerContainer.addChild(new Spacer(1));
|
|
725
765
|
this.headerContainer.addChild(this.builtInHeader);
|
|
@@ -1032,6 +1072,14 @@ export class InteractiveMode {
|
|
|
1032
1072
|
getStartupExpansionState() {
|
|
1033
1073
|
return this.options.verbose || this.toolOutputExpanded;
|
|
1034
1074
|
}
|
|
1075
|
+
/** Startup header (logo, version, key hints). Hidden only by quietStartup: true. */
|
|
1076
|
+
shouldShowStartupHeader() {
|
|
1077
|
+
return this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;
|
|
1078
|
+
}
|
|
1079
|
+
/** Startup details (model scope, loaded resources). Hidden by quietStartup: true or "header". */
|
|
1080
|
+
shouldShowStartupDetails() {
|
|
1081
|
+
return this.options.verbose === true || this.settingsManager.getQuietStartup() === false;
|
|
1082
|
+
}
|
|
1035
1083
|
/**
|
|
1036
1084
|
* Get a short path relative to the package root for display.
|
|
1037
1085
|
*/
|
|
@@ -1293,7 +1341,7 @@ export class InteractiveMode {
|
|
|
1293
1341
|
showLoadedResources(options) {
|
|
1294
1342
|
// Resource rendering is idempotent; chat clears no longer clear this separate container.
|
|
1295
1343
|
this.loadedResourcesContainer.clear();
|
|
1296
|
-
const showListing = options?.force || this.
|
|
1344
|
+
const showListing = options?.force || this.shouldShowStartupDetails();
|
|
1297
1345
|
const showDiagnostics = showListing || options?.showDiagnosticsWhenQuiet === true;
|
|
1298
1346
|
if (!showListing && !showDiagnostics) {
|
|
1299
1347
|
return;
|
|
@@ -1306,8 +1354,9 @@ export class InteractiveMode {
|
|
|
1306
1354
|
}
|
|
1307
1355
|
return theme.fg("dim", ` ${labels.join(", ")}`);
|
|
1308
1356
|
};
|
|
1357
|
+
// Bodies are built on demand so the listing follows theme changes.
|
|
1309
1358
|
const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
|
|
1310
|
-
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
|
|
1359
|
+
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody()}`, () => `${sectionHeader(name, color)}\n${expandedBody()}`, this.getStartupExpansionState(), 0, 0);
|
|
1311
1360
|
this.loadedResourcesContainer.addChild(section);
|
|
1312
1361
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1313
1362
|
};
|
|
@@ -1352,27 +1401,25 @@ export class InteractiveMode {
|
|
|
1352
1401
|
];
|
|
1353
1402
|
if (contextFiles.length > 0) {
|
|
1354
1403
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1355
|
-
const contextList = contextFiles
|
|
1356
|
-
|
|
1357
|
-
.join("\n");
|
|
1358
|
-
const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1404
|
+
const contextList = () => contextFiles.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`)).join("\n");
|
|
1405
|
+
const contextCompactList = () => formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1359
1406
|
addLoadedSection("Context", contextCompactList, contextList);
|
|
1360
1407
|
}
|
|
1361
1408
|
const skills = skillsResult.skills;
|
|
1362
1409
|
if (skills.length > 0) {
|
|
1363
1410
|
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
1364
|
-
const skillList = this.formatScopeGroups(groups, {
|
|
1411
|
+
const skillList = () => this.formatScopeGroups(groups, {
|
|
1365
1412
|
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1366
1413
|
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1367
1414
|
});
|
|
1368
|
-
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
1415
|
+
const skillCompactList = () => formatCompactList(skills.map((skill) => skill.name));
|
|
1369
1416
|
addLoadedSection("Skills", skillCompactList, skillList);
|
|
1370
1417
|
}
|
|
1371
1418
|
const templates = this.session.promptTemplates;
|
|
1372
1419
|
if (templates.length > 0) {
|
|
1373
1420
|
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
1374
1421
|
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
1375
|
-
const templateList = this.formatScopeGroups(groups, {
|
|
1422
|
+
const templateList = () => this.formatScopeGroups(groups, {
|
|
1376
1423
|
formatPath: (item) => {
|
|
1377
1424
|
const template = templateByPath.get(item.path);
|
|
1378
1425
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
@@ -1382,53 +1429,40 @@ export class InteractiveMode {
|
|
|
1382
1429
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
1383
1430
|
},
|
|
1384
1431
|
});
|
|
1385
|
-
const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1432
|
+
const promptCompactList = () => formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1386
1433
|
addLoadedSection("Prompts", promptCompactList, templateList);
|
|
1387
1434
|
}
|
|
1388
1435
|
if (extensions.length > 0) {
|
|
1389
1436
|
const groups = this.buildScopeGroups(extensions);
|
|
1390
|
-
const extList = this.formatScopeGroups(groups, {
|
|
1437
|
+
const extList = () => this.formatScopeGroups(groups, {
|
|
1391
1438
|
formatPath: (item) => this.formatExtensionDisplayPath(item.path),
|
|
1392
1439
|
formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
|
|
1393
1440
|
});
|
|
1394
|
-
const
|
|
1441
|
+
const extensionLabels = this.getCompactExtensionLabels(extensions);
|
|
1442
|
+
const extensionCompactList = () => formatCompactList(extensionLabels);
|
|
1395
1443
|
addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
|
|
1396
1444
|
}
|
|
1397
|
-
// Show loaded themes (excluding built-in)
|
|
1398
|
-
const loadedThemes = themesResult.themes;
|
|
1399
|
-
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
1400
|
-
if (customThemes.length > 0) {
|
|
1401
|
-
const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
|
|
1402
|
-
path: loadedTheme.sourcePath,
|
|
1403
|
-
sourceInfo: loadedTheme.sourceInfo,
|
|
1404
|
-
})));
|
|
1405
|
-
const themeList = this.formatScopeGroups(groups, {
|
|
1406
|
-
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1407
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1408
|
-
});
|
|
1409
|
-
const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
|
|
1410
|
-
addLoadedSection("Themes", themeCompactList, themeList);
|
|
1411
|
-
}
|
|
1412
1445
|
}
|
|
1413
1446
|
if (showDiagnostics) {
|
|
1414
1447
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1415
1448
|
if (skillDiagnostics.length > 0) {
|
|
1416
|
-
const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1417
|
-
this.loadedResourcesContainer.addChild(new
|
|
1449
|
+
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1450
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1418
1451
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1419
1452
|
}
|
|
1420
1453
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
1421
1454
|
if (promptDiagnostics.length > 0) {
|
|
1422
|
-
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1423
|
-
this.loadedResourcesContainer.addChild(new
|
|
1455
|
+
const warningLines = () => this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1456
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1424
1457
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1425
1458
|
}
|
|
1426
1459
|
const extensionDiagnostics = [];
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1460
|
+
const extensionsResult = this.session.resourceLoader.getExtensions();
|
|
1461
|
+
for (const error of extensionsResult.errors) {
|
|
1462
|
+
extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
|
|
1463
|
+
}
|
|
1464
|
+
for (const warning of extensionsResult.warnings ?? []) {
|
|
1465
|
+
extensionDiagnostics.push({ type: "warning", message: warning.warning, path: warning.path });
|
|
1432
1466
|
}
|
|
1433
1467
|
const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
|
|
1434
1468
|
extensionDiagnostics.push(...commandDiagnostics);
|
|
@@ -1436,14 +1470,14 @@ export class InteractiveMode {
|
|
|
1436
1470
|
const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
|
|
1437
1471
|
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
1438
1472
|
if (extensionDiagnostics.length > 0) {
|
|
1439
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1440
|
-
this.loadedResourcesContainer.addChild(new
|
|
1473
|
+
const warningLines = () => this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1474
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Extension issues]")}\n${warningLines()}`, 0, 0));
|
|
1441
1475
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1442
1476
|
}
|
|
1443
1477
|
const themeDiagnostics = themesResult.diagnostics;
|
|
1444
1478
|
if (themeDiagnostics.length > 0) {
|
|
1445
|
-
const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1446
|
-
this.loadedResourcesContainer.addChild(new
|
|
1479
|
+
const warningLines = () => this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1480
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Theme conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1447
1481
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1448
1482
|
}
|
|
1449
1483
|
}
|
|
@@ -1535,6 +1569,7 @@ export class InteractiveMode {
|
|
|
1535
1569
|
this.applyFullscreenScrollbarSetting();
|
|
1536
1570
|
if (this.renderer instanceof TuiAltScreen) {
|
|
1537
1571
|
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1572
|
+
this.renderer.setWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());
|
|
1538
1573
|
}
|
|
1539
1574
|
this.footer.setSession(this.session);
|
|
1540
1575
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
@@ -1581,10 +1616,11 @@ export class InteractiveMode {
|
|
|
1581
1616
|
this.showError(`${prefix}: ${message}`);
|
|
1582
1617
|
const extensionHint = this.getCrashExtensionHint(error);
|
|
1583
1618
|
if (extensionHint) {
|
|
1584
|
-
this.chatContainer.addChild(new
|
|
1619
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", extensionHint), this.outputPad, 0));
|
|
1585
1620
|
}
|
|
1586
1621
|
if (this.recordCrash("fatal_error", error)) {
|
|
1587
|
-
|
|
1622
|
+
const instructions = this.crashReportInstructions();
|
|
1623
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", instructions), this.outputPad, 0));
|
|
1588
1624
|
}
|
|
1589
1625
|
stopThemeWatcher();
|
|
1590
1626
|
this.stop("transcript");
|
|
@@ -1620,7 +1656,7 @@ export class InteractiveMode {
|
|
|
1620
1656
|
if (this.bugReportHintShown)
|
|
1621
1657
|
return;
|
|
1622
1658
|
this.bugReportHintShown = true;
|
|
1623
|
-
this.chatContainer.addChild(new
|
|
1659
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", `If this looks like a ${APP_NAME} bug, /bug sends a report to the developers.`), this.outputPad, 0));
|
|
1624
1660
|
this.ui.requestRender();
|
|
1625
1661
|
}
|
|
1626
1662
|
maybeSuggestBugReport(message) {
|
|
@@ -1874,7 +1910,7 @@ export class InteractiveMode {
|
|
|
1874
1910
|
container.addChild(new Text(line, 1, 0));
|
|
1875
1911
|
}
|
|
1876
1912
|
if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
|
|
1877
|
-
container.addChild(new
|
|
1913
|
+
container.addChild(new ThemedText(() => theme.fg("muted", "... (widget truncated)"), 1, 0));
|
|
1878
1914
|
}
|
|
1879
1915
|
component = container;
|
|
1880
1916
|
}
|
|
@@ -2404,17 +2440,14 @@ export class InteractiveMode {
|
|
|
2404
2440
|
*/
|
|
2405
2441
|
showExtensionError(extensionPath, error, stack) {
|
|
2406
2442
|
const errorMsg = `Extension "${extensionPath}" error: ${error}`;
|
|
2407
|
-
const errorText = new
|
|
2443
|
+
const errorText = new ThemedText(() => theme.fg("error", errorMsg), 1, 0);
|
|
2408
2444
|
this.chatContainer.addChild(errorText);
|
|
2409
2445
|
if (stack) {
|
|
2410
2446
|
// Show stack trace in dim color, indented
|
|
2411
|
-
const stackLines = stack
|
|
2412
|
-
|
|
2413
|
-
.
|
|
2414
|
-
.
|
|
2415
|
-
.join("\n");
|
|
2416
|
-
if (stackLines) {
|
|
2417
|
-
this.chatContainer.addChild(new Text(stackLines, 1, 0));
|
|
2447
|
+
const stackLines = stack.split("\n").slice(1); // Skip first line (duplicates error message)
|
|
2448
|
+
if (stackLines.length > 0) {
|
|
2449
|
+
const renderStack = () => stackLines.map((line) => theme.fg("dim", ` ${line.trim()}`)).join("\n");
|
|
2450
|
+
this.chatContainer.addChild(new ThemedText(renderStack, 1, 0));
|
|
2418
2451
|
}
|
|
2419
2452
|
}
|
|
2420
2453
|
this.ui.requestRender();
|
|
@@ -2517,8 +2550,8 @@ export class InteractiveMode {
|
|
|
2517
2550
|
this.updateEditorBorderColor();
|
|
2518
2551
|
}
|
|
2519
2552
|
};
|
|
2520
|
-
// Handle clipboard paste (triggered on Ctrl+V).
|
|
2521
|
-
//
|
|
2553
|
+
// Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,
|
|
2554
|
+
// images are attached via temporary files, and plain text is the final fallback.
|
|
2522
2555
|
this.defaultEditor.onPasteImage = () => {
|
|
2523
2556
|
void this.handleClipboardPaste();
|
|
2524
2557
|
};
|
|
@@ -2541,6 +2574,22 @@ export class InteractiveMode {
|
|
|
2541
2574
|
}
|
|
2542
2575
|
async handleClipboardPaste() {
|
|
2543
2576
|
try {
|
|
2577
|
+
const filePaths = await readClipboardFilePaths();
|
|
2578
|
+
if (filePaths) {
|
|
2579
|
+
if (filePaths.some((filePath) => /\p{Cc}/u.test(filePath))) {
|
|
2580
|
+
throw new Error("Clipboard file path contains control characters");
|
|
2581
|
+
}
|
|
2582
|
+
const paths = this.isBashMode ? filePaths.map(quoteIfNeeded).join(" ") : filePaths.join("\n");
|
|
2583
|
+
const cursor = this.editor.getCursor?.();
|
|
2584
|
+
const currentLine = cursor ? (this.editor.getText().split("\n")[cursor.line] ?? "") : "";
|
|
2585
|
+
const characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : "";
|
|
2586
|
+
const characterAfterCursor = cursor ? currentLine[cursor.col] : "";
|
|
2587
|
+
const leadingSpace = characterBeforeCursor && !/\s/.test(characterBeforeCursor) ? " " : "";
|
|
2588
|
+
const trailingSpace = characterAfterCursor && !/\s/.test(characterAfterCursor) ? " " : "";
|
|
2589
|
+
this.editor.insertTextAtCursor?.(`${leadingSpace}${paths}${trailingSpace}`);
|
|
2590
|
+
this.ui.requestRender();
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2544
2593
|
const image = await readClipboardImage();
|
|
2545
2594
|
if (image) {
|
|
2546
2595
|
const tmpDir = os.tmpdir();
|
|
@@ -2558,8 +2607,8 @@ export class InteractiveMode {
|
|
|
2558
2607
|
this.ui.requestRender();
|
|
2559
2608
|
}
|
|
2560
2609
|
}
|
|
2561
|
-
catch {
|
|
2562
|
-
|
|
2610
|
+
catch (error) {
|
|
2611
|
+
this.showError(`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`);
|
|
2563
2612
|
}
|
|
2564
2613
|
}
|
|
2565
2614
|
handleStartupSubmit(text) {
|
|
@@ -2988,6 +3037,9 @@ export class InteractiveMode {
|
|
|
2988
3037
|
// The bash execution callback handles TUI output rendering.
|
|
2989
3038
|
break;
|
|
2990
3039
|
case "tool_execution_start": {
|
|
3040
|
+
// Nested calls (from codemode scripts) are shown inside their parent's row.
|
|
3041
|
+
if (event.parentToolCallId)
|
|
3042
|
+
break;
|
|
2991
3043
|
let component = this.pendingTools.get(event.toolCallId);
|
|
2992
3044
|
if (!component) {
|
|
2993
3045
|
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
@@ -3097,7 +3149,8 @@ export class InteractiveMode {
|
|
|
3097
3149
|
}
|
|
3098
3150
|
else {
|
|
3099
3151
|
this.chatContainer.addChild(new Spacer(1));
|
|
3100
|
-
|
|
3152
|
+
const errorMessage = event.errorMessage;
|
|
3153
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", errorMessage), 1, 0));
|
|
3101
3154
|
}
|
|
3102
3155
|
}
|
|
3103
3156
|
if (this.session.isAborting) {
|
|
@@ -3186,7 +3239,7 @@ export class InteractiveMode {
|
|
|
3186
3239
|
}
|
|
3187
3240
|
const message = status.type === "warning" ? `Warning: ${status.message}` : status.message;
|
|
3188
3241
|
const color = status.type === "warning" ? "warning" : "dim";
|
|
3189
|
-
this.chatContainer.addChild(new
|
|
3242
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));
|
|
3190
3243
|
this.lastStatusSpacer = undefined;
|
|
3191
3244
|
this.lastStatusText = undefined;
|
|
3192
3245
|
this.ui.requestRender();
|
|
@@ -3202,12 +3255,14 @@ export class InteractiveMode {
|
|
|
3202
3255
|
const last = children.length > 0 ? children[children.length - 1] : undefined;
|
|
3203
3256
|
const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
|
|
3204
3257
|
if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
|
|
3205
|
-
this.
|
|
3258
|
+
this.lastStatusMessage = message;
|
|
3259
|
+
this.lastStatusText.invalidate();
|
|
3206
3260
|
this.ui.requestRender();
|
|
3207
3261
|
return;
|
|
3208
3262
|
}
|
|
3209
3263
|
const spacer = new Spacer(1);
|
|
3210
|
-
|
|
3264
|
+
this.lastStatusMessage = message;
|
|
3265
|
+
const text = new ThemedText(() => theme.fg("dim", this.lastStatusMessage), 1, 0);
|
|
3211
3266
|
this.chatContainer.addChild(spacer);
|
|
3212
3267
|
this.chatContainer.addChild(text);
|
|
3213
3268
|
this.lastStatusSpacer = spacer;
|
|
@@ -3416,7 +3471,8 @@ export class InteractiveMode {
|
|
|
3416
3471
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3417
3472
|
return;
|
|
3418
3473
|
this.chatContainer.addChild(new Spacer(1));
|
|
3419
|
-
|
|
3474
|
+
const usage = formatCacheWarmingUsage(entry);
|
|
3475
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3420
3476
|
}
|
|
3421
3477
|
/**
|
|
3422
3478
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -3430,7 +3486,7 @@ export class InteractiveMode {
|
|
|
3430
3486
|
const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
|
|
3431
3487
|
const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
|
|
3432
3488
|
this.chatContainer.addChild(new Spacer(1));
|
|
3433
|
-
this.chatContainer.addChild(new
|
|
3489
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
|
|
3434
3490
|
}
|
|
3435
3491
|
static countDroppedThinkingBlocks(message) {
|
|
3436
3492
|
let count = 0;
|
|
@@ -3467,7 +3523,7 @@ export class InteractiveMode {
|
|
|
3467
3523
|
return;
|
|
3468
3524
|
const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
|
|
3469
3525
|
this.chatContainer.addChild(new Spacer(1));
|
|
3470
|
-
this.chatContainer.addChild(new
|
|
3526
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
|
|
3471
3527
|
}
|
|
3472
3528
|
/**
|
|
3473
3529
|
* Show a transcript notice when a completed assistant message paid for a
|
|
@@ -3494,9 +3550,8 @@ export class InteractiveMode {
|
|
|
3494
3550
|
else if (miss.idleMs >= CACHE_TTL_MS) {
|
|
3495
3551
|
label = `Cache miss after ${Math.round(miss.idleMs / 60_000)}m idle`;
|
|
3496
3552
|
}
|
|
3497
|
-
const text = theme.fg("warning", `${label}: ${reBilled}`);
|
|
3498
3553
|
this.chatContainer.addChild(new Spacer(1));
|
|
3499
|
-
this.chatContainer.addChild(new
|
|
3554
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${reBilled}`), 1, 0));
|
|
3500
3555
|
}
|
|
3501
3556
|
renderInitialMessages() {
|
|
3502
3557
|
const entries = this.sessionManager.buildContextEntries();
|
|
@@ -3520,7 +3575,7 @@ export class InteractiveMode {
|
|
|
3520
3575
|
if (this.chatContainer.children.length > 0) {
|
|
3521
3576
|
this.chatContainer.addChild(new Spacer(1));
|
|
3522
3577
|
}
|
|
3523
|
-
this.chatContainer.addChild(new
|
|
3578
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `This project is not trusted. Project ${CONFIG_DIR_NAME} resources and packages are ignored. Use /trust to save a trust decision, then restart pi.`), 1, 0));
|
|
3524
3579
|
}
|
|
3525
3580
|
async getUserInput() {
|
|
3526
3581
|
const queuedInput = this.pendingUserInputs.shift();
|
|
@@ -3871,26 +3926,28 @@ export class InteractiveMode {
|
|
|
3871
3926
|
}
|
|
3872
3927
|
showError(errorMessage) {
|
|
3873
3928
|
this.chatContainer.addChild(new Spacer(1));
|
|
3874
|
-
this.chatContainer.addChild(new
|
|
3929
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
|
|
3875
3930
|
this.ui.requestRender();
|
|
3876
3931
|
}
|
|
3877
3932
|
showWarning(warningMessage) {
|
|
3878
3933
|
this.chatContainer.addChild(new Spacer(1));
|
|
3879
|
-
this.chatContainer.addChild(new
|
|
3934
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
|
|
3880
3935
|
this.ui.requestRender();
|
|
3881
3936
|
}
|
|
3882
3937
|
showNewVersionNotification(release) {
|
|
3883
|
-
const
|
|
3884
|
-
|
|
3938
|
+
const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
|
|
3939
|
+
theme.fg("accent", `${APP_NAME} update`);
|
|
3885
3940
|
const changelogUrl = "https://pi.dev/changelog";
|
|
3886
|
-
const
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3941
|
+
const changelogLine = () => {
|
|
3942
|
+
const changelogLink = getCapabilities().hyperlinks
|
|
3943
|
+
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
3944
|
+
: theme.fg("accent", changelogUrl);
|
|
3945
|
+
return theme.fg("muted", "Changelog: ") + changelogLink;
|
|
3946
|
+
};
|
|
3890
3947
|
const note = release.note?.trim();
|
|
3891
3948
|
this.chatContainer.addChild(new Spacer(1));
|
|
3892
3949
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3893
|
-
this.chatContainer.addChild(new
|
|
3950
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
|
|
3894
3951
|
if (note) {
|
|
3895
3952
|
this.chatContainer.addChild(new Spacer(1));
|
|
3896
3953
|
this.chatContainer.addChild(new Markdown(note, 1, 0, this.getMarkdownThemeWithSettings(), {
|
|
@@ -3898,17 +3955,17 @@ export class InteractiveMode {
|
|
|
3898
3955
|
}));
|
|
3899
3956
|
this.chatContainer.addChild(new Spacer(1));
|
|
3900
3957
|
}
|
|
3901
|
-
this.chatContainer.addChild(new
|
|
3958
|
+
this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
|
|
3902
3959
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3903
3960
|
this.ui.requestRender();
|
|
3904
3961
|
}
|
|
3905
3962
|
showPackageUpdateNotification(packages) {
|
|
3906
|
-
const
|
|
3907
|
-
|
|
3963
|
+
const updateInstruction = () => theme.fg("muted", "Package updates are available. Run ") +
|
|
3964
|
+
theme.fg("accent", `${APP_NAME} update --extensions`);
|
|
3908
3965
|
const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
|
|
3909
3966
|
this.chatContainer.addChild(new Spacer(1));
|
|
3910
3967
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3911
|
-
this.chatContainer.addChild(new
|
|
3968
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction()}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
|
|
3912
3969
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3913
3970
|
this.ui.requestRender();
|
|
3914
3971
|
}
|
|
@@ -4156,7 +4213,7 @@ export class InteractiveMode {
|
|
|
4156
4213
|
thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
|
|
4157
4214
|
availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
|
|
4158
4215
|
modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
|
|
4159
|
-
currentTheme: this.themeController.getThemeSelection() ||
|
|
4216
|
+
currentTheme: this.themeController.getThemeSelection() || SYSTEM_THEME_NAME,
|
|
4160
4217
|
terminalTheme: this.themeController.getTerminalTheme(),
|
|
4161
4218
|
availableThemes: getAvailableThemes(),
|
|
4162
4219
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
@@ -4178,6 +4235,7 @@ export class InteractiveMode {
|
|
|
4178
4235
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
4179
4236
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
4180
4237
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
4238
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
4181
4239
|
warnings: this.settingsManager.getWarnings(),
|
|
4182
4240
|
}, {
|
|
4183
4241
|
onAutoCompactChange: (enabled) => {
|
|
@@ -4252,7 +4310,7 @@ export class InteractiveMode {
|
|
|
4252
4310
|
},
|
|
4253
4311
|
onThemeChange: (themeSetting) => {
|
|
4254
4312
|
this.settingsManager.setTheme(themeSetting);
|
|
4255
|
-
|
|
4313
|
+
this.themeController.setThemeSetting(themeSetting);
|
|
4256
4314
|
},
|
|
4257
4315
|
onThemePreview: (themeName) => this.themeController.preview(themeName),
|
|
4258
4316
|
onHideThinkingBlockChange: (hidden) => {
|
|
@@ -4275,8 +4333,8 @@ export class InteractiveMode {
|
|
|
4275
4333
|
onEnableInstallTelemetryChange: (enabled) => {
|
|
4276
4334
|
this.settingsManager.setEnableInstallTelemetry(enabled);
|
|
4277
4335
|
},
|
|
4278
|
-
onQuietStartupChange: (
|
|
4279
|
-
this.settingsManager.setQuietStartup(
|
|
4336
|
+
onQuietStartupChange: (quiet) => {
|
|
4337
|
+
this.settingsManager.setQuietStartup(quiet);
|
|
4280
4338
|
},
|
|
4281
4339
|
onDefaultProjectTrustChange: (defaultProjectTrust) => {
|
|
4282
4340
|
this.settingsManager.setDefaultProjectTrust(defaultProjectTrust);
|
|
@@ -4357,6 +4415,11 @@ export class InteractiveMode {
|
|
|
4357
4415
|
if (this.renderer instanceof TuiAltScreen)
|
|
4358
4416
|
this.renderer.setCopyOnSelect(enabled);
|
|
4359
4417
|
},
|
|
4418
|
+
onFullscreenWheelScrollLinesChange: (lines) => {
|
|
4419
|
+
this.settingsManager.setFullscreenWheelScrollLines(lines);
|
|
4420
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
4421
|
+
this.renderer.setWheelScrollLines(lines);
|
|
4422
|
+
},
|
|
4360
4423
|
onWarningsChange: (warnings) => {
|
|
4361
4424
|
this.settingsManager.setWarnings(warnings);
|
|
4362
4425
|
},
|
|
@@ -4923,6 +4986,7 @@ export class InteractiveMode {
|
|
|
4923
4986
|
source: authStatus.label ?? authStatus.source,
|
|
4924
4987
|
}
|
|
4925
4988
|
: undefined;
|
|
4989
|
+
const subscription = provider.auth.oauth?.isSubscription === true;
|
|
4926
4990
|
if ((!authType || authType === "oauth") && provider.auth.oauth) {
|
|
4927
4991
|
options.push({
|
|
4928
4992
|
id: provider.id,
|
|
@@ -4930,6 +4994,7 @@ export class InteractiveMode {
|
|
|
4930
4994
|
authType: "oauth",
|
|
4931
4995
|
method: provider.auth.oauth,
|
|
4932
4996
|
status,
|
|
4997
|
+
subscription,
|
|
4933
4998
|
});
|
|
4934
4999
|
}
|
|
4935
5000
|
if ((!authType || authType === "api_key") && provider.auth.apiKey) {
|
|
@@ -4939,6 +5004,7 @@ export class InteractiveMode {
|
|
|
4939
5004
|
authType: "api_key",
|
|
4940
5005
|
method: provider.auth.apiKey,
|
|
4941
5006
|
status,
|
|
5007
|
+
subscription,
|
|
4942
5008
|
});
|
|
4943
5009
|
}
|
|
4944
5010
|
}
|
|
@@ -4946,12 +5012,16 @@ export class InteractiveMode {
|
|
|
4946
5012
|
}
|
|
4947
5013
|
async getLogoutProviderOptions() {
|
|
4948
5014
|
return (await this.session.modelRuntime.listCredentials({ signal: AbortSignal.timeout(15_000) }))
|
|
4949
|
-
.map(({ providerId, type }) =>
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
5015
|
+
.map(({ providerId, type }) => {
|
|
5016
|
+
const provider = this.session.modelRuntime.getProvider(providerId);
|
|
5017
|
+
return {
|
|
5018
|
+
id: providerId,
|
|
5019
|
+
name: provider?.name ?? providerId,
|
|
5020
|
+
authType: type,
|
|
5021
|
+
status: { type, source: "stored credential" },
|
|
5022
|
+
subscription: provider?.auth.oauth?.isSubscription === true,
|
|
5023
|
+
};
|
|
5024
|
+
})
|
|
4955
5025
|
.sort((a, b) => a.name.localeCompare(b.name));
|
|
4956
5026
|
}
|
|
4957
5027
|
findLoginProviderOptions(providerRef) {
|
|
@@ -4981,18 +5051,25 @@ export class InteractiveMode {
|
|
|
4981
5051
|
}
|
|
4982
5052
|
this.showLoginProviderSelector(undefined, providerRef);
|
|
4983
5053
|
}
|
|
4984
|
-
|
|
5054
|
+
/** `onBack` reopens the selector the login was started from when the user cancels it. */
|
|
5055
|
+
async startProviderLogin(providerOption, onBack) {
|
|
4985
5056
|
if (providerOption.authType === "oauth") {
|
|
4986
|
-
await this.showLoginDialog(providerOption.id, providerOption.name);
|
|
5057
|
+
await this.showLoginDialog(providerOption.id, providerOption.name, onBack);
|
|
4987
5058
|
}
|
|
4988
5059
|
else if (providerOption.method?.login) {
|
|
4989
|
-
await this.showApiKeyLoginDialog(providerOption.id, providerOption.name);
|
|
5060
|
+
await this.showApiKeyLoginDialog(providerOption.id, providerOption.name, onBack);
|
|
4990
5061
|
}
|
|
4991
5062
|
else {
|
|
4992
|
-
this.showAmbientAuthDialog(providerOption);
|
|
5063
|
+
this.showAmbientAuthDialog(providerOption, onBack);
|
|
4993
5064
|
}
|
|
4994
5065
|
}
|
|
4995
5066
|
showLoginAuthTypeSelector(providerOptions) {
|
|
5067
|
+
// The top-level selector offers Radius directly, as its last option.
|
|
5068
|
+
const radiusOption = providerOptions
|
|
5069
|
+
? undefined
|
|
5070
|
+
: this.getLoginProviderOptions("oauth").find((provider) => provider.id === RADIUS_PROVIDER_ID);
|
|
5071
|
+
const radiusText = radiusOption ? `Sign in with ${radiusOption.name}` : undefined;
|
|
5072
|
+
const radiusLabel = radiusOption ? `${radiusText}${formatAuthSelectorProviderStatus(radiusOption)}` : undefined;
|
|
4996
5073
|
const oauthProvider = providerOptions?.find((provider) => provider.authType === "oauth");
|
|
4997
5074
|
const oauthLoginLabel = oauthProvider?.method && "loginLabel" in oauthProvider.method ? oauthProvider.method.loginLabel : undefined;
|
|
4998
5075
|
const subscriptionLabel = oauthLoginLabel ?? "Sign in with an account";
|
|
@@ -5007,6 +5084,8 @@ export class InteractiveMode {
|
|
|
5007
5084
|
if (availableAuthTypes.has("api_key")) {
|
|
5008
5085
|
options.push(apiKeyLabel);
|
|
5009
5086
|
}
|
|
5087
|
+
if (radiusLabel)
|
|
5088
|
+
options.push(radiusLabel);
|
|
5010
5089
|
if (options.length === 0) {
|
|
5011
5090
|
this.showStatus("No login methods available.");
|
|
5012
5091
|
return;
|
|
@@ -5022,29 +5101,37 @@ export class InteractiveMode {
|
|
|
5022
5101
|
? `Select authentication method for ${providerOptions[0].name}:`
|
|
5023
5102
|
: "Select authentication method:";
|
|
5024
5103
|
this.showSelector((done) => {
|
|
5025
|
-
const
|
|
5104
|
+
const onSelect = (option) => {
|
|
5026
5105
|
done();
|
|
5106
|
+
if (radiusOption && option === radiusLabel) {
|
|
5107
|
+
void this.startProviderLogin(radiusOption, () => this.showLoginAuthTypeSelector());
|
|
5108
|
+
return;
|
|
5109
|
+
}
|
|
5027
5110
|
const authType = option === subscriptionLabel ? "oauth" : "api_key";
|
|
5028
5111
|
if (providerOptions) {
|
|
5029
5112
|
const providerOption = providerOptions.find((provider) => provider.authType === authType);
|
|
5030
5113
|
if (providerOption) {
|
|
5031
|
-
void this.startProviderLogin(providerOption);
|
|
5114
|
+
void this.startProviderLogin(providerOption, () => this.showLoginAuthTypeSelector(providerOptions));
|
|
5032
5115
|
}
|
|
5033
5116
|
return;
|
|
5034
5117
|
}
|
|
5035
5118
|
this.showLoginProviderSelector(authType);
|
|
5036
|
-
}
|
|
5119
|
+
};
|
|
5120
|
+
const onCancel = () => {
|
|
5037
5121
|
done();
|
|
5038
5122
|
this.ui.requestRender();
|
|
5039
|
-
}
|
|
5040
|
-
|
|
5123
|
+
};
|
|
5124
|
+
const selector = radiusLabel && radiusText
|
|
5125
|
+
? createLoginMenuSelector(this.ui, title, options, { label: radiusLabel, text: radiusText }, onSelect, onCancel)
|
|
5126
|
+
: new ExtensionSelectorComponent(title, options, onSelect, onCancel);
|
|
5127
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5041
5128
|
});
|
|
5042
5129
|
}
|
|
5043
5130
|
showLoginProviderSelector(authType, initialSearchInput) {
|
|
5044
5131
|
const providerOptions = this.getLoginProviderOptions(authType);
|
|
5045
5132
|
if (providerOptions.length === 0) {
|
|
5046
5133
|
const message = authType === "oauth"
|
|
5047
|
-
? "No
|
|
5134
|
+
? "No account providers available."
|
|
5048
5135
|
: authType === "api_key"
|
|
5049
5136
|
? "No API key providers available."
|
|
5050
5137
|
: "No login providers available.";
|
|
@@ -5058,7 +5145,7 @@ export class InteractiveMode {
|
|
|
5058
5145
|
if (!providerOption) {
|
|
5059
5146
|
return;
|
|
5060
5147
|
}
|
|
5061
|
-
await this.startProviderLogin(providerOption);
|
|
5148
|
+
await this.startProviderLogin(providerOption, () => this.showLoginProviderSelector(authType, initialSearchInput));
|
|
5062
5149
|
}, () => {
|
|
5063
5150
|
done();
|
|
5064
5151
|
if (authType) {
|
|
@@ -5212,21 +5299,24 @@ export class InteractiveMode {
|
|
|
5212
5299
|
})
|
|
5213
5300
|
.finally(() => clearTimeout(timeout));
|
|
5214
5301
|
}
|
|
5215
|
-
showAmbientAuthDialog(providerOption) {
|
|
5302
|
+
showAmbientAuthDialog(providerOption, onBack) {
|
|
5216
5303
|
const restoreEditor = () => {
|
|
5217
5304
|
this.editorContainer.clear();
|
|
5218
5305
|
this.editorContainer.addChild(this.editor);
|
|
5219
5306
|
this.ui.setFocus(this.editor);
|
|
5220
5307
|
this.ui.requestRender();
|
|
5221
5308
|
};
|
|
5222
|
-
const dialog = new LoginDialogComponent(this.ui, providerOption.id, () =>
|
|
5309
|
+
const dialog = new LoginDialogComponent(this.ui, providerOption.id, () => {
|
|
5310
|
+
restoreEditor();
|
|
5311
|
+
onBack?.();
|
|
5312
|
+
}, providerOption.name, `${providerOption.name} setup`);
|
|
5223
5313
|
dialog.showInfo(`${providerOption.method?.name ?? "Authentication"} is configured outside ${APP_NAME}.`, [], true);
|
|
5224
5314
|
this.editorContainer.clear();
|
|
5225
5315
|
this.editorContainer.addChild(dialog);
|
|
5226
5316
|
this.ui.setFocus(dialog);
|
|
5227
5317
|
this.ui.requestRender();
|
|
5228
5318
|
}
|
|
5229
|
-
async showApiKeyLoginDialog(providerId, providerName) {
|
|
5319
|
+
async showApiKeyLoginDialog(providerId, providerName, onBack) {
|
|
5230
5320
|
const previousModel = this.session.model;
|
|
5231
5321
|
const dialog = new LoginDialogComponent(this.ui, providerId, (_success, _message) => {
|
|
5232
5322
|
// Completion handled below
|
|
@@ -5259,12 +5349,15 @@ export class InteractiveMode {
|
|
|
5259
5349
|
if (error instanceof CredentialSynchronizationError) {
|
|
5260
5350
|
this.showError(`Saved API key for ${providerName}, but local model state could not be synchronized: ${errorMsg}`);
|
|
5261
5351
|
}
|
|
5262
|
-
else if (errorMsg
|
|
5352
|
+
else if (errorMsg === "Login cancelled") {
|
|
5353
|
+
onBack?.();
|
|
5354
|
+
}
|
|
5355
|
+
else {
|
|
5263
5356
|
this.showError(`Failed to save API key for ${providerName}: ${errorMsg}`);
|
|
5264
5357
|
}
|
|
5265
5358
|
}
|
|
5266
5359
|
}
|
|
5267
|
-
showAuthSelect(dialog, prompt) {
|
|
5360
|
+
showAuthSelect(dialog, prompt, providerId) {
|
|
5268
5361
|
return new Promise((resolve, reject) => {
|
|
5269
5362
|
const restoreDialog = () => {
|
|
5270
5363
|
this.editorContainer.clear();
|
|
@@ -5283,17 +5376,17 @@ export class InteractiveMode {
|
|
|
5283
5376
|
}, () => {
|
|
5284
5377
|
restoreDialog();
|
|
5285
5378
|
reject(new Error("Login cancelled"));
|
|
5286
|
-
});
|
|
5379
|
+
}, { description: providerId === RADIUS_PROVIDER_ID ? RADIUS_LOGIN_INTRO : undefined });
|
|
5287
5380
|
this.editorContainer.clear();
|
|
5288
5381
|
this.editorContainer.addChild(selector);
|
|
5289
5382
|
this.ui.setFocus(selector);
|
|
5290
5383
|
this.ui.requestRender();
|
|
5291
5384
|
});
|
|
5292
5385
|
}
|
|
5293
|
-
async showAuthPrompt(dialog, prompt) {
|
|
5386
|
+
async showAuthPrompt(dialog, prompt, providerId) {
|
|
5294
5387
|
let response;
|
|
5295
5388
|
if (prompt.type === "select") {
|
|
5296
|
-
response = this.showAuthSelect(dialog, prompt);
|
|
5389
|
+
response = this.showAuthSelect(dialog, prompt, providerId);
|
|
5297
5390
|
}
|
|
5298
5391
|
else if (prompt.type === "manual_code") {
|
|
5299
5392
|
response = dialog.showManualInput(prompt.message);
|
|
@@ -5337,11 +5430,11 @@ export class InteractiveMode {
|
|
|
5337
5430
|
async loginProvider(dialog, providerId, method) {
|
|
5338
5431
|
await this.session.modelRuntime.login(providerId, method, {
|
|
5339
5432
|
signal: dialog.signal,
|
|
5340
|
-
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5433
|
+
prompt: (prompt) => this.showAuthPrompt(dialog, prompt, providerId),
|
|
5341
5434
|
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5342
|
-
});
|
|
5435
|
+
}, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
|
|
5343
5436
|
}
|
|
5344
|
-
async showLoginDialog(providerId, providerName) {
|
|
5437
|
+
async showLoginDialog(providerId, providerName, onBack) {
|
|
5345
5438
|
const previousModel = this.session.model;
|
|
5346
5439
|
const dialog = new LoginDialogComponent(this.ui, providerId, (_success, _message) => { }, providerName);
|
|
5347
5440
|
this.editorContainer.clear();
|
|
@@ -5358,6 +5451,8 @@ export class InteractiveMode {
|
|
|
5358
5451
|
await this.loginProvider(dialog, providerId, "oauth");
|
|
5359
5452
|
restoreEditor();
|
|
5360
5453
|
await this.completeProviderAuthentication(providerId, providerName, "oauth", previousModel);
|
|
5454
|
+
if (providerId === RADIUS_PROVIDER_ID)
|
|
5455
|
+
this.offerRadiusMcpServer(providerId, providerName);
|
|
5361
5456
|
}
|
|
5362
5457
|
catch (error) {
|
|
5363
5458
|
restoreEditor();
|
|
@@ -5365,11 +5460,58 @@ export class InteractiveMode {
|
|
|
5365
5460
|
if (error instanceof CredentialSynchronizationError) {
|
|
5366
5461
|
this.showError(`Logged in to ${providerName}, but local model state could not be synchronized: ${errorMsg}`);
|
|
5367
5462
|
}
|
|
5368
|
-
else if (errorMsg
|
|
5463
|
+
else if (errorMsg === "Login cancelled") {
|
|
5464
|
+
onBack?.();
|
|
5465
|
+
}
|
|
5466
|
+
else {
|
|
5369
5467
|
this.showError(`Failed to login to ${providerName}: ${errorMsg}`);
|
|
5370
5468
|
}
|
|
5371
5469
|
}
|
|
5372
5470
|
}
|
|
5471
|
+
/**
|
|
5472
|
+
* Offer to point the Radius MCP server in the global mcp.json at the Radius login, adding the server
|
|
5473
|
+
* when missing. Nothing is asked when a global server already uses this login.
|
|
5474
|
+
*/
|
|
5475
|
+
offerRadiusMcpServer(providerId, providerName) {
|
|
5476
|
+
const mcpPath = path.join(getAgentDir(), "mcp.json");
|
|
5477
|
+
const normalizeUrl = (url) => url.replace(/\/+$/u, "");
|
|
5478
|
+
const { servers } = loadMcpConfig({
|
|
5479
|
+
agentDir: getAgentDir(),
|
|
5480
|
+
cwd: this.sessionManager.getCwd(),
|
|
5481
|
+
projectTrusted: false,
|
|
5482
|
+
});
|
|
5483
|
+
const existing = servers.find((server) => "url" in server.config && normalizeUrl(server.config.url) === normalizeUrl(RADIUS_MCP_URL));
|
|
5484
|
+
if (existing && "url" in existing.config && existing.config.auth?.provider === providerId)
|
|
5485
|
+
return;
|
|
5486
|
+
let name = existing?.name ?? "radius";
|
|
5487
|
+
if (!existing && servers.some((server) => server.name === name))
|
|
5488
|
+
name = "radius-mcp";
|
|
5489
|
+
const config = existing && "url" in existing.config
|
|
5490
|
+
? { ...existing.config, auth: { provider: providerId } }
|
|
5491
|
+
: { url: RADIUS_MCP_URL, auth: { provider: providerId } };
|
|
5492
|
+
// `auth` replaces the MCP OAuth sign-in.
|
|
5493
|
+
delete config.oauth;
|
|
5494
|
+
this.showSelector((done) => {
|
|
5495
|
+
const selector = new ExtensionSelectorComponent(`Configure ${providerName} MCP in ${mcpPath}?`, ["Yes", "No"], (option) => {
|
|
5496
|
+
done();
|
|
5497
|
+
if (option !== "Yes")
|
|
5498
|
+
return;
|
|
5499
|
+
try {
|
|
5500
|
+
addMcpServerConfig(mcpPath, name, config);
|
|
5501
|
+
}
|
|
5502
|
+
catch (error) {
|
|
5503
|
+
this.showError(`Could not update ${mcpPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
5504
|
+
return;
|
|
5505
|
+
}
|
|
5506
|
+
// The MCP extension reads mcp.json when the session starts.
|
|
5507
|
+
void this.handleReloadCommand();
|
|
5508
|
+
}, () => {
|
|
5509
|
+
done();
|
|
5510
|
+
this.ui.requestRender();
|
|
5511
|
+
});
|
|
5512
|
+
return { component: selector, focus: selector };
|
|
5513
|
+
});
|
|
5514
|
+
}
|
|
5373
5515
|
// =========================================================================
|
|
5374
5516
|
// Command handlers
|
|
5375
5517
|
// =========================================================================
|
|
@@ -5387,7 +5529,7 @@ export class InteractiveMode {
|
|
|
5387
5529
|
const borderColor = (s) => theme.fg("border", s);
|
|
5388
5530
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5389
5531
|
reloadBox.addChild(new Spacer(1));
|
|
5390
|
-
reloadBox.addChild(new
|
|
5532
|
+
reloadBox.addChild(new ThemedText(() => theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
|
|
5391
5533
|
reloadBox.addChild(new Spacer(1));
|
|
5392
5534
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5393
5535
|
const previousEditor = this.editor;
|
|
@@ -5423,7 +5565,7 @@ export class InteractiveMode {
|
|
|
5423
5565
|
}
|
|
5424
5566
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
5425
5567
|
this.applyRuntimeSettings();
|
|
5426
|
-
|
|
5568
|
+
this.themeController.applyFromSettings();
|
|
5427
5569
|
this.setupAutocompleteProvider();
|
|
5428
5570
|
const runner = this.session.extensionRunner;
|
|
5429
5571
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5587,7 +5729,7 @@ export class InteractiveMode {
|
|
|
5587
5729
|
const currentName = this.sessionManager.getSessionName();
|
|
5588
5730
|
if (currentName) {
|
|
5589
5731
|
this.chatContainer.addChild(new Spacer(1));
|
|
5590
|
-
this.chatContainer.addChild(new
|
|
5732
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name: ${currentName}`), 1, 0));
|
|
5591
5733
|
}
|
|
5592
5734
|
else {
|
|
5593
5735
|
this.showWarning("Usage: /name <name>");
|
|
@@ -5601,7 +5743,8 @@ export class InteractiveMode {
|
|
|
5601
5743
|
this.showWarning(`Session name was normalized from ${JSON.stringify(name)} to ${JSON.stringify(sessionName)}`);
|
|
5602
5744
|
}
|
|
5603
5745
|
this.chatContainer.addChild(new Spacer(1));
|
|
5604
|
-
|
|
5746
|
+
const displayName = sessionName ?? name;
|
|
5747
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name set: ${displayName}`), 1, 0));
|
|
5605
5748
|
this.ui.requestRender();
|
|
5606
5749
|
}
|
|
5607
5750
|
handleSessionCommand() {
|
|
@@ -5613,61 +5756,69 @@ export class InteractiveMode {
|
|
|
5613
5756
|
// resolves to a concrete responseModel). Usage without model attribution is
|
|
5614
5757
|
// grouped separately so the breakdown reconciles with the session total.
|
|
5615
5758
|
const usageBreakdown = getUsageCostBreakdown(entries);
|
|
5616
|
-
|
|
5617
|
-
if (sessionName) {
|
|
5618
|
-
info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
|
|
5619
|
-
}
|
|
5620
|
-
info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
5621
|
-
info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
5622
|
-
info += `${theme.bold("Messages")}\n`;
|
|
5623
|
-
info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
5624
|
-
info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
5625
|
-
info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
5626
|
-
info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
5627
|
-
info += `${theme.bold("Tokens")}\n`;
|
|
5628
|
-
// "Input" is the full prompt volume. With cache activity, split it into
|
|
5629
|
-
// cached (served from cache) vs uncached (everything else) - the only
|
|
5630
|
-
// provider-independent split. Cache writes, where reported, are a detail
|
|
5631
|
-
// of the uncached portion.
|
|
5632
|
-
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
5633
|
-
const promptTokens = input + cacheRead + cacheWrite;
|
|
5634
|
-
info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
5635
|
-
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
5636
|
-
const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
5637
|
-
info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
5638
|
-
const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
5639
|
-
info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
5640
|
-
}
|
|
5641
|
-
info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
5642
|
-
info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
5759
|
+
// Snapshot the stats; the text is built on demand so it follows theme changes.
|
|
5643
5760
|
const cacheWarmingStatus = this.session.cacheWarmingStatus;
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
const
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
info +=
|
|
5654
|
-
info += `${theme.
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5761
|
+
const cacheWarmingMode = this.settingsManager.getCacheWarmingMode();
|
|
5762
|
+
const model = this.session.model;
|
|
5763
|
+
const selectedModelKey = `${model?.provider}/${model?.id}`;
|
|
5764
|
+
const renderInfo = () => {
|
|
5765
|
+
let info = `${theme.bold("Session Info")}\n\n`;
|
|
5766
|
+
if (sessionName) {
|
|
5767
|
+
info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
|
|
5768
|
+
}
|
|
5769
|
+
info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
5770
|
+
info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
5771
|
+
info += `${theme.bold("Messages")}\n`;
|
|
5772
|
+
info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
5773
|
+
info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
5774
|
+
info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
5775
|
+
info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
5776
|
+
info += `${theme.bold("Tokens")}\n`;
|
|
5777
|
+
// "Input" is the full prompt volume. With cache activity, split it into
|
|
5778
|
+
// cached (served from cache) vs uncached (everything else) - the only
|
|
5779
|
+
// provider-independent split. Cache writes, where reported, are a detail
|
|
5780
|
+
// of the uncached portion.
|
|
5781
|
+
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
5782
|
+
const promptTokens = input + cacheRead + cacheWrite;
|
|
5783
|
+
info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
5784
|
+
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
5785
|
+
const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
5786
|
+
info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
5787
|
+
const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
5788
|
+
info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
5789
|
+
}
|
|
5790
|
+
info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
5791
|
+
info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
5792
|
+
info += `\n${theme.bold("Cache Warming")}\n`;
|
|
5793
|
+
info += `${theme.fg("dim", "Mode:")} ${cacheWarmingMode}\n`;
|
|
5794
|
+
info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
|
|
5795
|
+
const decision = cacheWarmingStatus?.decision;
|
|
5796
|
+
if (decision?.economicsAvailable) {
|
|
5797
|
+
info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
|
|
5798
|
+
info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
|
|
5799
|
+
}
|
|
5800
|
+
if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
|
|
5801
|
+
info += `\n${theme.bold("Cost")}\n`;
|
|
5802
|
+
info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
|
|
5803
|
+
// A single entry repeats the total, unless it names a model other than the selected one.
|
|
5804
|
+
if (usageBreakdown.length > 1 || usageBreakdown[0]?.key !== selectedModelKey) {
|
|
5805
|
+
for (const entry of usageBreakdown) {
|
|
5806
|
+
info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
|
|
5807
|
+
}
|
|
5808
|
+
}
|
|
5809
|
+
if (cacheWaste.missedTokens > 0) {
|
|
5810
|
+
const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
|
|
5811
|
+
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
5812
|
+
info +=
|
|
5813
|
+
cacheWaste.missedCost >= 0.0001
|
|
5814
|
+
? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
|
|
5815
|
+
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5658
5816
|
}
|
|
5659
5817
|
}
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
5663
|
-
info +=
|
|
5664
|
-
cacheWaste.missedCost >= 0.0001
|
|
5665
|
-
? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
|
|
5666
|
-
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5667
|
-
}
|
|
5668
|
-
}
|
|
5818
|
+
return info;
|
|
5819
|
+
};
|
|
5669
5820
|
this.chatContainer.addChild(new Spacer(1));
|
|
5670
|
-
this.chatContainer.addChild(new
|
|
5821
|
+
this.chatContainer.addChild(new ThemedText(renderInfo, 1, 0));
|
|
5671
5822
|
this.ui.requestRender();
|
|
5672
5823
|
}
|
|
5673
5824
|
handleChangelogCommand() {
|
|
@@ -5681,7 +5832,7 @@ export class InteractiveMode {
|
|
|
5681
5832
|
: "No changelog entries found.";
|
|
5682
5833
|
this.chatContainer.addChild(new Spacer(1));
|
|
5683
5834
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5684
|
-
this.chatContainer.addChild(new
|
|
5835
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
5685
5836
|
this.chatContainer.addChild(new Spacer(1));
|
|
5686
5837
|
this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5687
5838
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5782,7 +5933,7 @@ export class InteractiveMode {
|
|
|
5782
5933
|
| \`${copyMessage}\` | Copy selection or last assistant message |
|
|
5783
5934
|
| \`${followUp}\` | Queue follow-up message |
|
|
5784
5935
|
| \`${dequeue}\` | Restore queued messages |
|
|
5785
|
-
| \`${pasteImage}\` | Paste
|
|
5936
|
+
| \`${pasteImage}\` | Paste files on macOS, images, or text from clipboard |
|
|
5786
5937
|
| \`/\` | Slash commands |
|
|
5787
5938
|
| \`!\` | Run bash command |
|
|
5788
5939
|
| \`!!\` | Run bash command (excluded from context) |
|
|
@@ -5804,7 +5955,7 @@ export class InteractiveMode {
|
|
|
5804
5955
|
}
|
|
5805
5956
|
this.chatContainer.addChild(new Spacer(1));
|
|
5806
5957
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5807
|
-
this.chatContainer.addChild(new
|
|
5958
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
|
|
5808
5959
|
this.chatContainer.addChild(new Spacer(1));
|
|
5809
5960
|
this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5810
5961
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5818,7 +5969,7 @@ export class InteractiveMode {
|
|
|
5818
5969
|
return;
|
|
5819
5970
|
}
|
|
5820
5971
|
this.chatContainer.addChild(new Spacer(1));
|
|
5821
|
-
this.chatContainer.addChild(new
|
|
5972
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("accent", "✓ New session started"), 1, 1));
|
|
5822
5973
|
this.ui.requestRender();
|
|
5823
5974
|
}
|
|
5824
5975
|
catch (error) {
|
|
@@ -5849,7 +6000,7 @@ export class InteractiveMode {
|
|
|
5849
6000
|
fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
|
|
5850
6001
|
fs.writeFileSync(debugLogPath, debugData);
|
|
5851
6002
|
this.chatContainer.addChild(new Spacer(1));
|
|
5852
|
-
this.chatContainer.addChild(new
|
|
6003
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
|
|
5853
6004
|
this.ui.requestRender();
|
|
5854
6005
|
}
|
|
5855
6006
|
handleArminSaysHi() {
|