@earendil-works/pi-coding-agent 0.87.1 → 0.99.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 +97 -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-A6EXUBG6.js +6 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-EN5WOBET.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
- package/dist/bundle/chunks/chunk-AXPY26X7.js +146 -0
- package/dist/bundle/chunks/chunk-GOPCREV2.js +4 -0
- package/dist/bundle/chunks/chunk-GUORCHFS.js +1435 -0
- package/dist/bundle/chunks/chunk-H3QXYIF7.js +31 -0
- package/dist/bundle/chunks/{chunk-S7SZN6Z3.js → chunk-HSPCVFST.js} +1 -1
- package/dist/bundle/chunks/chunk-IMTXZUO7.js +82 -0
- package/dist/bundle/chunks/chunk-J4CWPC4N.js +2 -0
- package/dist/bundle/chunks/chunk-LLMKQWZS.js +21 -0
- package/dist/bundle/chunks/{chunk-WIUZI2CJ.js → chunk-LRS5S6EK.js} +3 -3
- package/dist/bundle/chunks/chunk-PEHWOV5U.js +187 -0
- package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
- package/dist/bundle/chunks/chunk-SLDA2X2H.js +2 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
- package/dist/bundle/chunks/cli-AZXNGIZH.js +49 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XJQQYGGU.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +295 -0
- package/dist/bundle/chunks/execute-7XXPZAWW.js +308 -0
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-CQAKKJTA.js +2 -0
- package/dist/bundle/chunks/google-vertex-AE36YXJU.js +2 -0
- package/dist/bundle/chunks/{lib-HGQMNYVT.js → lib-TEDK3E5I.js} +2 -2
- package/dist/bundle/chunks/llama-cpp-classify-PJJYKPLD.js +22 -0
- package/dist/bundle/chunks/mistral-conversations-KEYTXJM7.js +5 -0
- package/dist/bundle/chunks/openai-chatgpt.js +75 -0
- package/dist/bundle/chunks/{openai-codex-responses-QDSOTBBO.js → openai-codex-responses-JQTCOVEG.js} +2 -2
- package/dist/bundle/chunks/openai-codex.js +2 -2
- package/dist/bundle/chunks/{openai-completions-OBX42CLD.js → openai-completions-XW2Q5HVC.js} +2 -2
- package/dist/bundle/chunks/openai-responses-6AXWFL75.js +3 -0
- package/dist/bundle/chunks/{openrouter-images-N4XVVFSD.js → openrouter-images-TPQ4V6OR.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +2 -2
- 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-G5WJPRBM.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
- package/dist/bundle/chunks/virtual-modules-CSWRO37N.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 +4 -3
- 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 +18 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -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 +135 -11
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +509 -253
- 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 +55 -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 +296 -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 +98 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +157 -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 +13 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +25 -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 +41 -3
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +167 -17
- 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-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.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.map +1 -1
- 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 +18 -3
- 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 +24 -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 +31 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +72 -2
- 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 +35 -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 +9 -10
- 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 +115 -0
- package/dist/core/virtual-models.d.ts.map +1 -0
- package/dist/core/virtual-models.js +117 -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 +390 -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 +119 -0
- package/dist/extensions/codemode/renderer.js.map +1 -0
- package/dist/extensions/codemode/tool.d.ts +122 -0
- package/dist/extensions/codemode/tool.d.ts.map +1 -0
- package/dist/extensions/codemode/tool.js +324 -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 +485 -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 +70 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +146 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +52 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +902 -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 +94 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +333 -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 +96 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +388 -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 +83 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +233 -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 +172 -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 +72 -0
- package/dist/extensions/tool-search/tool.d.ts.map +1 -0
- package/dist/extensions/tool-search/tool.js +210 -0
- package/dist/extensions/tool-search/tool.js.map +1 -0
- package/dist/index.d.ts +9 -2
- 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 +10 -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.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/pi-logo.d.ts +12 -0
- package/dist/modes/interactive/components/pi-logo.d.ts.map +1 -0
- package/dist/modes/interactive/components/pi-logo.js +25 -0
- package/dist/modes/interactive/components/pi-logo.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 +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +28 -6
- 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.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/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 +11 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +199 -161
- 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 +54 -0
- package/dist/modes/interactive/theme/system-theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/system-theme.js +535 -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/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 +64 -3
- package/docs/configuration.md +2 -0
- package/docs/custom-provider.md +43 -4
- package/docs/docs.json +8 -0
- package/docs/extensions.md +55 -0
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +13 -0
- package/docs/mcp.md +188 -0
- package/docs/models.md +35 -0
- package/docs/packages.md +4 -2
- package/docs/providers.md +1 -0
- package/docs/rpc-commands.md +9 -3
- package/docs/rpc.md +3 -1
- package/docs/sdk.md +7 -2
- package/docs/security.md +2 -0
- package/docs/session-format.md +5 -1
- package/docs/settings.md +20 -3
- package/docs/themes.md +33 -7
- package/docs/tui.md +18 -0
- 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/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/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/npm-shrinkwrap.json +89 -39
- package/package.json +14 -12
- package/dist/bundle/chunks/anthropic-messages-J5WXPPPC.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +0 -2
- package/dist/bundle/chunks/chunk-65HAU2C5.js +0 -2
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +0 -2
- package/dist/bundle/chunks/chunk-NUHFSC37.js +0 -25
- package/dist/bundle/chunks/chunk-OJP47DM6.js +0 -1568
- package/dist/bundle/chunks/chunk-RCZIEVGO.js +0 -11
- 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-HWEUZ6WZ.js +0 -2
- package/dist/bundle/chunks/virtual-modules-VHMJYYWQ.js +0 -2
|
@@ -33,7 +33,7 @@ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
|
33
33
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
34
34
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
35
35
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
36
|
-
import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
|
|
36
|
+
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
37
37
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
38
38
|
import { parseGitUrl } from "../../utils/git.js";
|
|
39
39
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
@@ -64,11 +64,13 @@ import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
|
64
64
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
65
65
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
66
66
|
import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
67
|
+
import { piLogoLines } from "./components/pi-logo.js";
|
|
67
68
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
68
69
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
69
70
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
70
71
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
71
72
|
import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
73
|
+
import { ThemedText } from "./components/themed-text.js";
|
|
72
74
|
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
73
75
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
74
76
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
@@ -79,7 +81,7 @@ import { editInExternalEditor } from "./external-editor.js";
|
|
|
79
81
|
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
80
82
|
import { getModelSearchText } from "./model-search.js";
|
|
81
83
|
import { shareSession } from "./session-share.js";
|
|
82
|
-
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
84
|
+
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
83
85
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
84
86
|
import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
85
87
|
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
@@ -92,16 +94,16 @@ function isWorkingStatusEditor(editor) {
|
|
|
92
94
|
function isExpandable(obj) {
|
|
93
95
|
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
94
96
|
}
|
|
95
|
-
class ExpandableText extends
|
|
96
|
-
|
|
97
|
-
getExpandedText;
|
|
97
|
+
class ExpandableText extends ThemedText {
|
|
98
|
+
state;
|
|
98
99
|
constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.
|
|
100
|
+
const state = { expanded };
|
|
101
|
+
super(() => (state.expanded ? getExpandedText() : getCollapsedText()), paddingX, paddingY);
|
|
102
|
+
this.state = state;
|
|
102
103
|
}
|
|
103
104
|
setExpanded(expanded) {
|
|
104
|
-
this.
|
|
105
|
+
this.state.expanded = expanded;
|
|
106
|
+
this.invalidate();
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
function isCustomSessionEntry(item) {
|
|
@@ -256,6 +258,7 @@ export class InteractiveMode {
|
|
|
256
258
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
257
259
|
lastStatusSpacer = undefined;
|
|
258
260
|
lastStatusText = undefined;
|
|
261
|
+
lastStatusMessage = "";
|
|
259
262
|
managedToolStatusStarted = false;
|
|
260
263
|
// Streaming message tracking
|
|
261
264
|
streamingComponent = undefined;
|
|
@@ -341,7 +344,7 @@ export class InteractiveMode {
|
|
|
341
344
|
});
|
|
342
345
|
this.runtimeHost.setRebindSession(async () => {
|
|
343
346
|
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
344
|
-
|
|
347
|
+
this.themeController.applyFromSettings();
|
|
345
348
|
});
|
|
346
349
|
this.version = VERSION;
|
|
347
350
|
this.renderer = createInteractiveTui({
|
|
@@ -351,6 +354,7 @@ export class InteractiveMode {
|
|
|
351
354
|
terminal: options.terminal,
|
|
352
355
|
onRightClickPaste: this.onRightClickPaste,
|
|
353
356
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
357
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
354
358
|
});
|
|
355
359
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
356
360
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -395,7 +399,8 @@ export class InteractiveMode {
|
|
|
395
399
|
});
|
|
396
400
|
}
|
|
397
401
|
getAutocompleteSourceTag(sourceInfo) {
|
|
398
|
-
|
|
402
|
+
// Built-in extension commands are untagged, like built-in commands.
|
|
403
|
+
if (!sourceInfo || sourceInfo.source === "builtin") {
|
|
399
404
|
return undefined;
|
|
400
405
|
}
|
|
401
406
|
const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
|
|
@@ -548,7 +553,7 @@ export class InteractiveMode {
|
|
|
548
553
|
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
549
554
|
}
|
|
550
555
|
else {
|
|
551
|
-
this.chatContainer.addChild(new
|
|
556
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
552
557
|
this.chatContainer.addChild(new Spacer(1));
|
|
553
558
|
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
554
559
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -600,6 +605,7 @@ export class InteractiveMode {
|
|
|
600
605
|
terminal,
|
|
601
606
|
onRightClickPaste: this.onRightClickPaste,
|
|
602
607
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
608
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
603
609
|
});
|
|
604
610
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
605
611
|
nextUi.onDebug = onDebug;
|
|
@@ -675,13 +681,21 @@ export class InteractiveMode {
|
|
|
675
681
|
// Start the UI before initializing extensions so session_start handlers can use interactive dialogs
|
|
676
682
|
this.ui.start();
|
|
677
683
|
this.isInitialized = true;
|
|
678
|
-
|
|
684
|
+
this.themeController.applyFromSettings();
|
|
685
|
+
// The header and startup notices bake theme colors into their text, so build them once the terminal
|
|
686
|
+
// reported its colors. This ends at the terminal's DA1 reply, or after 100 ms if it answers nothing.
|
|
687
|
+
await this.themeController.waitForTerminalColors();
|
|
679
688
|
// Add header with keybindings from config (unless silenced)
|
|
680
689
|
if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
|
681
|
-
|
|
690
|
+
// Built on demand so the header follows theme changes. The logo's first line carries the version,
|
|
691
|
+
// its second line the first line of key hints.
|
|
692
|
+
const withLogo = (hints) => {
|
|
693
|
+
const [top, bottom] = piLogoLines();
|
|
694
|
+
return `${top} ${theme.fg("dim", `v${this.version}`)}\n${bottom} ${hints}`;
|
|
695
|
+
};
|
|
682
696
|
// Build startup instructions using keybinding hint helpers
|
|
683
697
|
const hint = (keybinding, description) => keyHint(keybinding, description);
|
|
684
|
-
const expandedInstructions = [
|
|
698
|
+
const expandedInstructions = () => [
|
|
685
699
|
hint("app.interrupt", "to interrupt"),
|
|
686
700
|
hint("app.clear", "to clear"),
|
|
687
701
|
rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
|
|
@@ -699,19 +713,19 @@ export class InteractiveMode {
|
|
|
699
713
|
rawKeyHint("!!", "to run bash (no context)"),
|
|
700
714
|
hint("app.message.followUp", "to queue follow-up"),
|
|
701
715
|
hint("app.message.dequeue", "to edit all queued messages"),
|
|
702
|
-
hint("app.clipboard.pasteImage", "to paste
|
|
716
|
+
hint("app.clipboard.pasteImage", "to paste files on macOS, images, or text"),
|
|
703
717
|
rawKeyHint("drop files", "to attach"),
|
|
704
718
|
].join("\n");
|
|
705
|
-
const compactInstructions = [
|
|
719
|
+
const compactInstructions = () => [
|
|
706
720
|
hint("app.interrupt", "interrupt"),
|
|
707
721
|
rawKeyHint(`${keyText("app.clear")}/${keyText("app.exit")}`, "clear/exit"),
|
|
708
722
|
rawKeyHint("/", "commands"),
|
|
709
723
|
rawKeyHint("!", "bash"),
|
|
710
724
|
hint("app.tools.expand", "more"),
|
|
711
725
|
].join(theme.fg("muted", " · "));
|
|
712
|
-
const compactOnboarding = theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
|
|
713
|
-
const onboarding = theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
714
|
-
this.builtInHeader = new ExpandableText(() => `${
|
|
726
|
+
const compactOnboarding = () => theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
|
|
727
|
+
const onboarding = () => theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
728
|
+
this.builtInHeader = new ExpandableText(() => `${withLogo(compactInstructions())}\n${compactOnboarding()}\n\n${onboarding()}`, () => `${withLogo(expandedInstructions())}\n\n${onboarding()}`, this.getStartupExpansionState(), 1, 0);
|
|
715
729
|
// Setup UI layout
|
|
716
730
|
this.headerContainer.addChild(new Spacer(1));
|
|
717
731
|
this.headerContainer.addChild(this.builtInHeader);
|
|
@@ -1284,8 +1298,9 @@ export class InteractiveMode {
|
|
|
1284
1298
|
}
|
|
1285
1299
|
return theme.fg("dim", ` ${labels.join(", ")}`);
|
|
1286
1300
|
};
|
|
1301
|
+
// Bodies are built on demand so the listing follows theme changes.
|
|
1287
1302
|
const addLoadedSection = (name, collapsedBody, expandedBody = collapsedBody, color = "mdHeading") => {
|
|
1288
|
-
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody}`, () => `${sectionHeader(name, color)}\n${expandedBody}`, this.getStartupExpansionState(), 0, 0);
|
|
1303
|
+
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody()}`, () => `${sectionHeader(name, color)}\n${expandedBody()}`, this.getStartupExpansionState(), 0, 0);
|
|
1289
1304
|
this.loadedResourcesContainer.addChild(section);
|
|
1290
1305
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1291
1306
|
};
|
|
@@ -1330,27 +1345,25 @@ export class InteractiveMode {
|
|
|
1330
1345
|
];
|
|
1331
1346
|
if (contextFiles.length > 0) {
|
|
1332
1347
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1333
|
-
const contextList = contextFiles
|
|
1334
|
-
|
|
1335
|
-
.join("\n");
|
|
1336
|
-
const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1348
|
+
const contextList = () => contextFiles.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`)).join("\n");
|
|
1349
|
+
const contextCompactList = () => formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1337
1350
|
addLoadedSection("Context", contextCompactList, contextList);
|
|
1338
1351
|
}
|
|
1339
1352
|
const skills = skillsResult.skills;
|
|
1340
1353
|
if (skills.length > 0) {
|
|
1341
1354
|
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
1342
|
-
const skillList = this.formatScopeGroups(groups, {
|
|
1355
|
+
const skillList = () => this.formatScopeGroups(groups, {
|
|
1343
1356
|
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1344
1357
|
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1345
1358
|
});
|
|
1346
|
-
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
1359
|
+
const skillCompactList = () => formatCompactList(skills.map((skill) => skill.name));
|
|
1347
1360
|
addLoadedSection("Skills", skillCompactList, skillList);
|
|
1348
1361
|
}
|
|
1349
1362
|
const templates = this.session.promptTemplates;
|
|
1350
1363
|
if (templates.length > 0) {
|
|
1351
1364
|
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
1352
1365
|
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
1353
|
-
const templateList = this.formatScopeGroups(groups, {
|
|
1366
|
+
const templateList = () => this.formatScopeGroups(groups, {
|
|
1354
1367
|
formatPath: (item) => {
|
|
1355
1368
|
const template = templateByPath.get(item.path);
|
|
1356
1369
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
@@ -1360,53 +1373,40 @@ export class InteractiveMode {
|
|
|
1360
1373
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
1361
1374
|
},
|
|
1362
1375
|
});
|
|
1363
|
-
const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1376
|
+
const promptCompactList = () => formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1364
1377
|
addLoadedSection("Prompts", promptCompactList, templateList);
|
|
1365
1378
|
}
|
|
1366
1379
|
if (extensions.length > 0) {
|
|
1367
1380
|
const groups = this.buildScopeGroups(extensions);
|
|
1368
|
-
const extList = this.formatScopeGroups(groups, {
|
|
1381
|
+
const extList = () => this.formatScopeGroups(groups, {
|
|
1369
1382
|
formatPath: (item) => this.formatExtensionDisplayPath(item.path),
|
|
1370
1383
|
formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
|
|
1371
1384
|
});
|
|
1372
|
-
const
|
|
1385
|
+
const extensionLabels = this.getCompactExtensionLabels(extensions);
|
|
1386
|
+
const extensionCompactList = () => formatCompactList(extensionLabels);
|
|
1373
1387
|
addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
|
|
1374
1388
|
}
|
|
1375
|
-
// Show loaded themes (excluding built-in)
|
|
1376
|
-
const loadedThemes = themesResult.themes;
|
|
1377
|
-
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
1378
|
-
if (customThemes.length > 0) {
|
|
1379
|
-
const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
|
|
1380
|
-
path: loadedTheme.sourcePath,
|
|
1381
|
-
sourceInfo: loadedTheme.sourceInfo,
|
|
1382
|
-
})));
|
|
1383
|
-
const themeList = this.formatScopeGroups(groups, {
|
|
1384
|
-
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1385
|
-
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1386
|
-
});
|
|
1387
|
-
const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
|
|
1388
|
-
addLoadedSection("Themes", themeCompactList, themeList);
|
|
1389
|
-
}
|
|
1390
1389
|
}
|
|
1391
1390
|
if (showDiagnostics) {
|
|
1392
1391
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1393
1392
|
if (skillDiagnostics.length > 0) {
|
|
1394
|
-
const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1395
|
-
this.loadedResourcesContainer.addChild(new
|
|
1393
|
+
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1394
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1396
1395
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1397
1396
|
}
|
|
1398
1397
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
1399
1398
|
if (promptDiagnostics.length > 0) {
|
|
1400
|
-
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1401
|
-
this.loadedResourcesContainer.addChild(new
|
|
1399
|
+
const warningLines = () => this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1400
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1402
1401
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1403
1402
|
}
|
|
1404
1403
|
const extensionDiagnostics = [];
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1404
|
+
const extensionsResult = this.session.resourceLoader.getExtensions();
|
|
1405
|
+
for (const error of extensionsResult.errors) {
|
|
1406
|
+
extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
|
|
1407
|
+
}
|
|
1408
|
+
for (const warning of extensionsResult.warnings ?? []) {
|
|
1409
|
+
extensionDiagnostics.push({ type: "warning", message: warning.warning, path: warning.path });
|
|
1410
1410
|
}
|
|
1411
1411
|
const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
|
|
1412
1412
|
extensionDiagnostics.push(...commandDiagnostics);
|
|
@@ -1414,14 +1414,14 @@ export class InteractiveMode {
|
|
|
1414
1414
|
const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
|
|
1415
1415
|
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
1416
1416
|
if (extensionDiagnostics.length > 0) {
|
|
1417
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1418
|
-
this.loadedResourcesContainer.addChild(new
|
|
1417
|
+
const warningLines = () => this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1418
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Extension issues]")}\n${warningLines()}`, 0, 0));
|
|
1419
1419
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1420
1420
|
}
|
|
1421
1421
|
const themeDiagnostics = themesResult.diagnostics;
|
|
1422
1422
|
if (themeDiagnostics.length > 0) {
|
|
1423
|
-
const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1424
|
-
this.loadedResourcesContainer.addChild(new
|
|
1423
|
+
const warningLines = () => this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1424
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Theme conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1425
1425
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
@@ -1513,6 +1513,7 @@ export class InteractiveMode {
|
|
|
1513
1513
|
this.applyFullscreenScrollbarSetting();
|
|
1514
1514
|
if (this.renderer instanceof TuiAltScreen) {
|
|
1515
1515
|
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1516
|
+
this.renderer.setWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());
|
|
1516
1517
|
}
|
|
1517
1518
|
this.footer.setSession(this.session);
|
|
1518
1519
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
@@ -1559,10 +1560,11 @@ export class InteractiveMode {
|
|
|
1559
1560
|
this.showError(`${prefix}: ${message}`);
|
|
1560
1561
|
const extensionHint = this.getCrashExtensionHint(error);
|
|
1561
1562
|
if (extensionHint) {
|
|
1562
|
-
this.chatContainer.addChild(new
|
|
1563
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", extensionHint), this.outputPad, 0));
|
|
1563
1564
|
}
|
|
1564
1565
|
if (this.recordCrash("fatal_error", error)) {
|
|
1565
|
-
|
|
1566
|
+
const instructions = this.crashReportInstructions();
|
|
1567
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", instructions), this.outputPad, 0));
|
|
1566
1568
|
}
|
|
1567
1569
|
stopThemeWatcher();
|
|
1568
1570
|
this.stop("transcript");
|
|
@@ -1598,7 +1600,7 @@ export class InteractiveMode {
|
|
|
1598
1600
|
if (this.bugReportHintShown)
|
|
1599
1601
|
return;
|
|
1600
1602
|
this.bugReportHintShown = true;
|
|
1601
|
-
this.chatContainer.addChild(new
|
|
1603
|
+
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));
|
|
1602
1604
|
this.ui.requestRender();
|
|
1603
1605
|
}
|
|
1604
1606
|
maybeSuggestBugReport(message) {
|
|
@@ -1795,7 +1797,7 @@ export class InteractiveMode {
|
|
|
1795
1797
|
container.addChild(new Text(line, 1, 0));
|
|
1796
1798
|
}
|
|
1797
1799
|
if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
|
|
1798
|
-
container.addChild(new
|
|
1800
|
+
container.addChild(new ThemedText(() => theme.fg("muted", "... (widget truncated)"), 1, 0));
|
|
1799
1801
|
}
|
|
1800
1802
|
component = container;
|
|
1801
1803
|
}
|
|
@@ -2308,17 +2310,14 @@ export class InteractiveMode {
|
|
|
2308
2310
|
*/
|
|
2309
2311
|
showExtensionError(extensionPath, error, stack) {
|
|
2310
2312
|
const errorMsg = `Extension "${extensionPath}" error: ${error}`;
|
|
2311
|
-
const errorText = new
|
|
2313
|
+
const errorText = new ThemedText(() => theme.fg("error", errorMsg), 1, 0);
|
|
2312
2314
|
this.chatContainer.addChild(errorText);
|
|
2313
2315
|
if (stack) {
|
|
2314
2316
|
// Show stack trace in dim color, indented
|
|
2315
|
-
const stackLines = stack
|
|
2316
|
-
|
|
2317
|
-
.
|
|
2318
|
-
.
|
|
2319
|
-
.join("\n");
|
|
2320
|
-
if (stackLines) {
|
|
2321
|
-
this.chatContainer.addChild(new Text(stackLines, 1, 0));
|
|
2317
|
+
const stackLines = stack.split("\n").slice(1); // Skip first line (duplicates error message)
|
|
2318
|
+
if (stackLines.length > 0) {
|
|
2319
|
+
const renderStack = () => stackLines.map((line) => theme.fg("dim", ` ${line.trim()}`)).join("\n");
|
|
2320
|
+
this.chatContainer.addChild(new ThemedText(renderStack, 1, 0));
|
|
2322
2321
|
}
|
|
2323
2322
|
}
|
|
2324
2323
|
this.ui.requestRender();
|
|
@@ -2388,8 +2387,8 @@ export class InteractiveMode {
|
|
|
2388
2387
|
this.updateEditorBorderColor();
|
|
2389
2388
|
}
|
|
2390
2389
|
};
|
|
2391
|
-
// Handle clipboard paste (triggered on Ctrl+V).
|
|
2392
|
-
//
|
|
2390
|
+
// Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,
|
|
2391
|
+
// images are attached via temporary files, and plain text is the final fallback.
|
|
2393
2392
|
this.defaultEditor.onPasteImage = () => {
|
|
2394
2393
|
void this.handleClipboardPaste();
|
|
2395
2394
|
};
|
|
@@ -2412,6 +2411,22 @@ export class InteractiveMode {
|
|
|
2412
2411
|
}
|
|
2413
2412
|
async handleClipboardPaste() {
|
|
2414
2413
|
try {
|
|
2414
|
+
const filePaths = await readClipboardFilePaths();
|
|
2415
|
+
if (filePaths) {
|
|
2416
|
+
if (filePaths.some((filePath) => /\p{Cc}/u.test(filePath))) {
|
|
2417
|
+
throw new Error("Clipboard file path contains control characters");
|
|
2418
|
+
}
|
|
2419
|
+
const paths = this.isBashMode ? filePaths.map(quoteIfNeeded).join(" ") : filePaths.join("\n");
|
|
2420
|
+
const cursor = this.editor.getCursor?.();
|
|
2421
|
+
const currentLine = cursor ? (this.editor.getText().split("\n")[cursor.line] ?? "") : "";
|
|
2422
|
+
const characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : "";
|
|
2423
|
+
const characterAfterCursor = cursor ? currentLine[cursor.col] : "";
|
|
2424
|
+
const leadingSpace = characterBeforeCursor && !/\s/.test(characterBeforeCursor) ? " " : "";
|
|
2425
|
+
const trailingSpace = characterAfterCursor && !/\s/.test(characterAfterCursor) ? " " : "";
|
|
2426
|
+
this.editor.insertTextAtCursor?.(`${leadingSpace}${paths}${trailingSpace}`);
|
|
2427
|
+
this.ui.requestRender();
|
|
2428
|
+
return;
|
|
2429
|
+
}
|
|
2415
2430
|
const image = await readClipboardImage();
|
|
2416
2431
|
if (image) {
|
|
2417
2432
|
const tmpDir = os.tmpdir();
|
|
@@ -2429,8 +2444,8 @@ export class InteractiveMode {
|
|
|
2429
2444
|
this.ui.requestRender();
|
|
2430
2445
|
}
|
|
2431
2446
|
}
|
|
2432
|
-
catch {
|
|
2433
|
-
|
|
2447
|
+
catch (error) {
|
|
2448
|
+
this.showError(`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`);
|
|
2434
2449
|
}
|
|
2435
2450
|
}
|
|
2436
2451
|
handleStartupSubmit(text) {
|
|
@@ -2811,6 +2826,9 @@ export class InteractiveMode {
|
|
|
2811
2826
|
// The bash execution callback handles TUI output rendering.
|
|
2812
2827
|
break;
|
|
2813
2828
|
case "tool_execution_start": {
|
|
2829
|
+
// Nested calls (from codemode scripts) are shown inside their parent's row.
|
|
2830
|
+
if (event.parentToolCallId)
|
|
2831
|
+
break;
|
|
2814
2832
|
let component = this.pendingTools.get(event.toolCallId);
|
|
2815
2833
|
if (!component) {
|
|
2816
2834
|
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
@@ -2912,7 +2930,8 @@ export class InteractiveMode {
|
|
|
2912
2930
|
}
|
|
2913
2931
|
else {
|
|
2914
2932
|
this.chatContainer.addChild(new Spacer(1));
|
|
2915
|
-
|
|
2933
|
+
const errorMessage = event.errorMessage;
|
|
2934
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", errorMessage), 1, 0));
|
|
2916
2935
|
}
|
|
2917
2936
|
}
|
|
2918
2937
|
void this.flushCompactionQueue({ willRetry: event.willRetry });
|
|
@@ -2984,7 +3003,7 @@ export class InteractiveMode {
|
|
|
2984
3003
|
}
|
|
2985
3004
|
const message = status.type === "warning" ? `Warning: ${status.message}` : status.message;
|
|
2986
3005
|
const color = status.type === "warning" ? "warning" : "dim";
|
|
2987
|
-
this.chatContainer.addChild(new
|
|
3006
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));
|
|
2988
3007
|
this.lastStatusSpacer = undefined;
|
|
2989
3008
|
this.lastStatusText = undefined;
|
|
2990
3009
|
this.ui.requestRender();
|
|
@@ -3000,12 +3019,14 @@ export class InteractiveMode {
|
|
|
3000
3019
|
const last = children.length > 0 ? children[children.length - 1] : undefined;
|
|
3001
3020
|
const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
|
|
3002
3021
|
if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
|
|
3003
|
-
this.
|
|
3022
|
+
this.lastStatusMessage = message;
|
|
3023
|
+
this.lastStatusText.invalidate();
|
|
3004
3024
|
this.ui.requestRender();
|
|
3005
3025
|
return;
|
|
3006
3026
|
}
|
|
3007
3027
|
const spacer = new Spacer(1);
|
|
3008
|
-
|
|
3028
|
+
this.lastStatusMessage = message;
|
|
3029
|
+
const text = new ThemedText(() => theme.fg("dim", this.lastStatusMessage), 1, 0);
|
|
3009
3030
|
this.chatContainer.addChild(spacer);
|
|
3010
3031
|
this.chatContainer.addChild(text);
|
|
3011
3032
|
this.lastStatusSpacer = spacer;
|
|
@@ -3214,7 +3235,8 @@ export class InteractiveMode {
|
|
|
3214
3235
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3215
3236
|
return;
|
|
3216
3237
|
this.chatContainer.addChild(new Spacer(1));
|
|
3217
|
-
|
|
3238
|
+
const usage = formatCacheWarmingUsage(entry);
|
|
3239
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3218
3240
|
}
|
|
3219
3241
|
/**
|
|
3220
3242
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -3228,7 +3250,7 @@ export class InteractiveMode {
|
|
|
3228
3250
|
const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
|
|
3229
3251
|
const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
|
|
3230
3252
|
this.chatContainer.addChild(new Spacer(1));
|
|
3231
|
-
this.chatContainer.addChild(new
|
|
3253
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
|
|
3232
3254
|
}
|
|
3233
3255
|
static countDroppedThinkingBlocks(message) {
|
|
3234
3256
|
let count = 0;
|
|
@@ -3265,7 +3287,7 @@ export class InteractiveMode {
|
|
|
3265
3287
|
return;
|
|
3266
3288
|
const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
|
|
3267
3289
|
this.chatContainer.addChild(new Spacer(1));
|
|
3268
|
-
this.chatContainer.addChild(new
|
|
3290
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
|
|
3269
3291
|
}
|
|
3270
3292
|
/**
|
|
3271
3293
|
* Show a transcript notice when a completed assistant message paid for a
|
|
@@ -3292,9 +3314,8 @@ export class InteractiveMode {
|
|
|
3292
3314
|
else if (miss.idleMs >= CACHE_TTL_MS) {
|
|
3293
3315
|
label = `Cache miss after ${Math.round(miss.idleMs / 60_000)}m idle`;
|
|
3294
3316
|
}
|
|
3295
|
-
const text = theme.fg("warning", `${label}: ${reBilled}`);
|
|
3296
3317
|
this.chatContainer.addChild(new Spacer(1));
|
|
3297
|
-
this.chatContainer.addChild(new
|
|
3318
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${reBilled}`), 1, 0));
|
|
3298
3319
|
}
|
|
3299
3320
|
renderInitialMessages() {
|
|
3300
3321
|
const entries = this.sessionManager.buildContextEntries();
|
|
@@ -3318,7 +3339,7 @@ export class InteractiveMode {
|
|
|
3318
3339
|
if (this.chatContainer.children.length > 0) {
|
|
3319
3340
|
this.chatContainer.addChild(new Spacer(1));
|
|
3320
3341
|
}
|
|
3321
|
-
this.chatContainer.addChild(new
|
|
3342
|
+
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));
|
|
3322
3343
|
}
|
|
3323
3344
|
async getUserInput() {
|
|
3324
3345
|
const queuedInput = this.pendingUserInputs.shift();
|
|
@@ -3665,26 +3686,28 @@ export class InteractiveMode {
|
|
|
3665
3686
|
}
|
|
3666
3687
|
showError(errorMessage) {
|
|
3667
3688
|
this.chatContainer.addChild(new Spacer(1));
|
|
3668
|
-
this.chatContainer.addChild(new
|
|
3689
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
|
|
3669
3690
|
this.ui.requestRender();
|
|
3670
3691
|
}
|
|
3671
3692
|
showWarning(warningMessage) {
|
|
3672
3693
|
this.chatContainer.addChild(new Spacer(1));
|
|
3673
|
-
this.chatContainer.addChild(new
|
|
3694
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
|
|
3674
3695
|
this.ui.requestRender();
|
|
3675
3696
|
}
|
|
3676
3697
|
showNewVersionNotification(release) {
|
|
3677
|
-
const
|
|
3678
|
-
|
|
3698
|
+
const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
|
|
3699
|
+
theme.fg("accent", `${APP_NAME} update`);
|
|
3679
3700
|
const changelogUrl = "https://pi.dev/changelog";
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3701
|
+
const changelogLine = () => {
|
|
3702
|
+
const changelogLink = getCapabilities().hyperlinks
|
|
3703
|
+
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
3704
|
+
: theme.fg("accent", changelogUrl);
|
|
3705
|
+
return theme.fg("muted", "Changelog: ") + changelogLink;
|
|
3706
|
+
};
|
|
3684
3707
|
const note = release.note?.trim();
|
|
3685
3708
|
this.chatContainer.addChild(new Spacer(1));
|
|
3686
3709
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3687
|
-
this.chatContainer.addChild(new
|
|
3710
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
|
|
3688
3711
|
if (note) {
|
|
3689
3712
|
this.chatContainer.addChild(new Spacer(1));
|
|
3690
3713
|
this.chatContainer.addChild(new Markdown(note, 1, 0, this.getMarkdownThemeWithSettings(), {
|
|
@@ -3692,17 +3715,17 @@ export class InteractiveMode {
|
|
|
3692
3715
|
}));
|
|
3693
3716
|
this.chatContainer.addChild(new Spacer(1));
|
|
3694
3717
|
}
|
|
3695
|
-
this.chatContainer.addChild(new
|
|
3718
|
+
this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
|
|
3696
3719
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3697
3720
|
this.ui.requestRender();
|
|
3698
3721
|
}
|
|
3699
3722
|
showPackageUpdateNotification(packages) {
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3723
|
+
const updateInstruction = () => theme.fg("muted", "Package updates are available. Run ") +
|
|
3724
|
+
theme.fg("accent", `${APP_NAME} update --extensions`);
|
|
3702
3725
|
const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
|
|
3703
3726
|
this.chatContainer.addChild(new Spacer(1));
|
|
3704
3727
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3705
|
-
this.chatContainer.addChild(new
|
|
3728
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Package Updates Available"))}\n${updateInstruction()}\n${theme.fg("muted", "Packages:")}\n${packageLines}`, 1, 0));
|
|
3706
3729
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3707
3730
|
this.ui.requestRender();
|
|
3708
3731
|
}
|
|
@@ -3932,7 +3955,7 @@ export class InteractiveMode {
|
|
|
3932
3955
|
thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
|
|
3933
3956
|
availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
|
|
3934
3957
|
modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
|
|
3935
|
-
currentTheme: this.themeController.getThemeSelection() ||
|
|
3958
|
+
currentTheme: this.themeController.getThemeSelection() || SYSTEM_THEME_NAME,
|
|
3936
3959
|
terminalTheme: this.themeController.getTerminalTheme(),
|
|
3937
3960
|
availableThemes: getAvailableThemes(),
|
|
3938
3961
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
@@ -3954,6 +3977,7 @@ export class InteractiveMode {
|
|
|
3954
3977
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
3955
3978
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
3956
3979
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
3980
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
3957
3981
|
warnings: this.settingsManager.getWarnings(),
|
|
3958
3982
|
}, {
|
|
3959
3983
|
onAutoCompactChange: (enabled) => {
|
|
@@ -4028,7 +4052,7 @@ export class InteractiveMode {
|
|
|
4028
4052
|
},
|
|
4029
4053
|
onThemeChange: (themeSetting) => {
|
|
4030
4054
|
this.settingsManager.setTheme(themeSetting);
|
|
4031
|
-
|
|
4055
|
+
this.themeController.setThemeSetting(themeSetting);
|
|
4032
4056
|
},
|
|
4033
4057
|
onThemePreview: (themeName) => this.themeController.preview(themeName),
|
|
4034
4058
|
onHideThinkingBlockChange: (hidden) => {
|
|
@@ -4133,6 +4157,11 @@ export class InteractiveMode {
|
|
|
4133
4157
|
if (this.renderer instanceof TuiAltScreen)
|
|
4134
4158
|
this.renderer.setCopyOnSelect(enabled);
|
|
4135
4159
|
},
|
|
4160
|
+
onFullscreenWheelScrollLinesChange: (lines) => {
|
|
4161
|
+
this.settingsManager.setFullscreenWheelScrollLines(lines);
|
|
4162
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
4163
|
+
this.renderer.setWheelScrollLines(lines);
|
|
4164
|
+
},
|
|
4136
4165
|
onWarningsChange: (warnings) => {
|
|
4137
4166
|
this.settingsManager.setWarnings(warnings);
|
|
4138
4167
|
},
|
|
@@ -5115,7 +5144,7 @@ export class InteractiveMode {
|
|
|
5115
5144
|
signal: dialog.signal,
|
|
5116
5145
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5117
5146
|
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5118
|
-
});
|
|
5147
|
+
}, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
|
|
5119
5148
|
}
|
|
5120
5149
|
async showLoginDialog(providerId, providerName) {
|
|
5121
5150
|
const previousModel = this.session.model;
|
|
@@ -5163,7 +5192,7 @@ export class InteractiveMode {
|
|
|
5163
5192
|
const borderColor = (s) => theme.fg("border", s);
|
|
5164
5193
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5165
5194
|
reloadBox.addChild(new Spacer(1));
|
|
5166
|
-
reloadBox.addChild(new
|
|
5195
|
+
reloadBox.addChild(new ThemedText(() => theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
|
|
5167
5196
|
reloadBox.addChild(new Spacer(1));
|
|
5168
5197
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5169
5198
|
const previousEditor = this.editor;
|
|
@@ -5199,7 +5228,7 @@ export class InteractiveMode {
|
|
|
5199
5228
|
}
|
|
5200
5229
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
5201
5230
|
this.applyRuntimeSettings();
|
|
5202
|
-
|
|
5231
|
+
this.themeController.applyFromSettings();
|
|
5203
5232
|
this.setupAutocompleteProvider();
|
|
5204
5233
|
const runner = this.session.extensionRunner;
|
|
5205
5234
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5363,7 +5392,7 @@ export class InteractiveMode {
|
|
|
5363
5392
|
const currentName = this.sessionManager.getSessionName();
|
|
5364
5393
|
if (currentName) {
|
|
5365
5394
|
this.chatContainer.addChild(new Spacer(1));
|
|
5366
|
-
this.chatContainer.addChild(new
|
|
5395
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name: ${currentName}`), 1, 0));
|
|
5367
5396
|
}
|
|
5368
5397
|
else {
|
|
5369
5398
|
this.showWarning("Usage: /name <name>");
|
|
@@ -5377,7 +5406,8 @@ export class InteractiveMode {
|
|
|
5377
5406
|
this.showWarning(`Session name was normalized from ${JSON.stringify(name)} to ${JSON.stringify(sessionName)}`);
|
|
5378
5407
|
}
|
|
5379
5408
|
this.chatContainer.addChild(new Spacer(1));
|
|
5380
|
-
|
|
5409
|
+
const displayName = sessionName ?? name;
|
|
5410
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name set: ${displayName}`), 1, 0));
|
|
5381
5411
|
this.ui.requestRender();
|
|
5382
5412
|
}
|
|
5383
5413
|
handleSessionCommand() {
|
|
@@ -5389,61 +5419,69 @@ export class InteractiveMode {
|
|
|
5389
5419
|
// resolves to a concrete responseModel). Usage without model attribution is
|
|
5390
5420
|
// grouped separately so the breakdown reconciles with the session total.
|
|
5391
5421
|
const usageBreakdown = getUsageCostBreakdown(entries);
|
|
5392
|
-
|
|
5393
|
-
if (sessionName) {
|
|
5394
|
-
info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
|
|
5395
|
-
}
|
|
5396
|
-
info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
5397
|
-
info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
5398
|
-
info += `${theme.bold("Messages")}\n`;
|
|
5399
|
-
info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
5400
|
-
info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
5401
|
-
info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
5402
|
-
info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
5403
|
-
info += `${theme.bold("Tokens")}\n`;
|
|
5404
|
-
// "Input" is the full prompt volume. With cache activity, split it into
|
|
5405
|
-
// cached (served from cache) vs uncached (everything else) - the only
|
|
5406
|
-
// provider-independent split. Cache writes, where reported, are a detail
|
|
5407
|
-
// of the uncached portion.
|
|
5408
|
-
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
5409
|
-
const promptTokens = input + cacheRead + cacheWrite;
|
|
5410
|
-
info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
5411
|
-
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
5412
|
-
const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
5413
|
-
info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
5414
|
-
const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
5415
|
-
info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
5416
|
-
}
|
|
5417
|
-
info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
5418
|
-
info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
5422
|
+
// Snapshot the stats; the text is built on demand so it follows theme changes.
|
|
5419
5423
|
const cacheWarmingStatus = this.session.cacheWarmingStatus;
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
const
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
info +=
|
|
5430
|
-
info += `${theme.
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5424
|
+
const cacheWarmingMode = this.settingsManager.getCacheWarmingMode();
|
|
5425
|
+
const model = this.session.model;
|
|
5426
|
+
const selectedModelKey = `${model?.provider}/${model?.id}`;
|
|
5427
|
+
const renderInfo = () => {
|
|
5428
|
+
let info = `${theme.bold("Session Info")}\n\n`;
|
|
5429
|
+
if (sessionName) {
|
|
5430
|
+
info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
|
|
5431
|
+
}
|
|
5432
|
+
info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
5433
|
+
info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
5434
|
+
info += `${theme.bold("Messages")}\n`;
|
|
5435
|
+
info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
5436
|
+
info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
5437
|
+
info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
5438
|
+
info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
5439
|
+
info += `${theme.bold("Tokens")}\n`;
|
|
5440
|
+
// "Input" is the full prompt volume. With cache activity, split it into
|
|
5441
|
+
// cached (served from cache) vs uncached (everything else) - the only
|
|
5442
|
+
// provider-independent split. Cache writes, where reported, are a detail
|
|
5443
|
+
// of the uncached portion.
|
|
5444
|
+
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
5445
|
+
const promptTokens = input + cacheRead + cacheWrite;
|
|
5446
|
+
info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
5447
|
+
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
5448
|
+
const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
5449
|
+
info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
5450
|
+
const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
5451
|
+
info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
5452
|
+
}
|
|
5453
|
+
info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
5454
|
+
info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
5455
|
+
info += `\n${theme.bold("Cache Warming")}\n`;
|
|
5456
|
+
info += `${theme.fg("dim", "Mode:")} ${cacheWarmingMode}\n`;
|
|
5457
|
+
info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
|
|
5458
|
+
const decision = cacheWarmingStatus?.decision;
|
|
5459
|
+
if (decision?.economicsAvailable) {
|
|
5460
|
+
info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
|
|
5461
|
+
info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
|
|
5462
|
+
}
|
|
5463
|
+
if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
|
|
5464
|
+
info += `\n${theme.bold("Cost")}\n`;
|
|
5465
|
+
info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
|
|
5466
|
+
// A single entry repeats the total, unless it names a model other than the selected one.
|
|
5467
|
+
if (usageBreakdown.length > 1 || usageBreakdown[0]?.key !== selectedModelKey) {
|
|
5468
|
+
for (const entry of usageBreakdown) {
|
|
5469
|
+
info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
|
|
5470
|
+
}
|
|
5471
|
+
}
|
|
5472
|
+
if (cacheWaste.missedTokens > 0) {
|
|
5473
|
+
const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
|
|
5474
|
+
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
5475
|
+
info +=
|
|
5476
|
+
cacheWaste.missedCost >= 0.0001
|
|
5477
|
+
? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
|
|
5478
|
+
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5434
5479
|
}
|
|
5435
5480
|
}
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
5439
|
-
info +=
|
|
5440
|
-
cacheWaste.missedCost >= 0.0001
|
|
5441
|
-
? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
|
|
5442
|
-
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5443
|
-
}
|
|
5444
|
-
}
|
|
5481
|
+
return info;
|
|
5482
|
+
};
|
|
5445
5483
|
this.chatContainer.addChild(new Spacer(1));
|
|
5446
|
-
this.chatContainer.addChild(new
|
|
5484
|
+
this.chatContainer.addChild(new ThemedText(renderInfo, 1, 0));
|
|
5447
5485
|
this.ui.requestRender();
|
|
5448
5486
|
}
|
|
5449
5487
|
handleChangelogCommand() {
|
|
@@ -5457,7 +5495,7 @@ export class InteractiveMode {
|
|
|
5457
5495
|
: "No changelog entries found.";
|
|
5458
5496
|
this.chatContainer.addChild(new Spacer(1));
|
|
5459
5497
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5460
|
-
this.chatContainer.addChild(new
|
|
5498
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
5461
5499
|
this.chatContainer.addChild(new Spacer(1));
|
|
5462
5500
|
this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5463
5501
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5558,7 +5596,7 @@ export class InteractiveMode {
|
|
|
5558
5596
|
| \`${copyMessage}\` | Copy selection or last assistant message |
|
|
5559
5597
|
| \`${followUp}\` | Queue follow-up message |
|
|
5560
5598
|
| \`${dequeue}\` | Restore queued messages |
|
|
5561
|
-
| \`${pasteImage}\` | Paste
|
|
5599
|
+
| \`${pasteImage}\` | Paste files on macOS, images, or text from clipboard |
|
|
5562
5600
|
| \`/\` | Slash commands |
|
|
5563
5601
|
| \`!\` | Run bash command |
|
|
5564
5602
|
| \`!!\` | Run bash command (excluded from context) |
|
|
@@ -5580,7 +5618,7 @@ export class InteractiveMode {
|
|
|
5580
5618
|
}
|
|
5581
5619
|
this.chatContainer.addChild(new Spacer(1));
|
|
5582
5620
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5583
|
-
this.chatContainer.addChild(new
|
|
5621
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
|
|
5584
5622
|
this.chatContainer.addChild(new Spacer(1));
|
|
5585
5623
|
this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5586
5624
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5594,7 +5632,7 @@ export class InteractiveMode {
|
|
|
5594
5632
|
return;
|
|
5595
5633
|
}
|
|
5596
5634
|
this.chatContainer.addChild(new Spacer(1));
|
|
5597
|
-
this.chatContainer.addChild(new
|
|
5635
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("accent", "✓ New session started"), 1, 1));
|
|
5598
5636
|
this.ui.requestRender();
|
|
5599
5637
|
}
|
|
5600
5638
|
catch (error) {
|
|
@@ -5625,7 +5663,7 @@ export class InteractiveMode {
|
|
|
5625
5663
|
fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
|
|
5626
5664
|
fs.writeFileSync(debugLogPath, debugData);
|
|
5627
5665
|
this.chatContainer.addChild(new Spacer(1));
|
|
5628
|
-
this.chatContainer.addChild(new
|
|
5666
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
|
|
5629
5667
|
this.ui.requestRender();
|
|
5630
5668
|
}
|
|
5631
5669
|
handleArminSaysHi() {
|