@averyyy/pi-coding-agent 0.87.1-piclient.2 → 0.99.1-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 +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-YZ3Q2WVP.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-3YXHSP6S.js +21 -0
- package/dist/bundle/chunks/chunk-7BINYQ2V.js +1548 -0
- package/dist/bundle/chunks/chunk-7JGR3GZN.js +11 -0
- package/dist/bundle/chunks/chunk-F6ORSP6L.js +187 -0
- package/dist/bundle/chunks/chunk-FJTXMIZI.js +150 -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-J4CWPC4N.js +2 -0
- package/dist/bundle/chunks/chunk-KYJKN5BJ.js +2 -0
- package/dist/bundle/chunks/chunk-RO6I2QFQ.js +4 -0
- package/dist/bundle/chunks/{chunk-XDUWOHPL.js → chunk-S3GGRYIO.js} +2 -2
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +2 -0
- package/dist/bundle/chunks/{chunk-UZNGGY6N.js → chunk-V7V43FNB.js} +3 -3
- package/dist/bundle/chunks/{chunk-FUXEF6JQ.js → chunk-W2DOMZSC.js} +1 -1
- package/dist/bundle/chunks/chunk-WVKBMRQX.js +82 -0
- package/dist/bundle/chunks/cli-WF6HDHBO.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-AVGAUHMT.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-SG7PGUUZ.js → openai-codex-responses-FUE7WESF.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-ZUXFVYPI.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-6ZC4MGWD.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-E7A4HNJI.js +2 -0
- package/dist/bundle/chunks/virtual-modules-H7OCXN6W.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 +118 -11
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +548 -288
- 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-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.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/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 +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/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-X2F52Z34.js +0 -1685
- 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
|
@@ -34,7 +34,7 @@ import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
|
34
34
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
35
35
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
36
36
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
37
|
-
import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
|
|
37
|
+
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
38
38
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
39
39
|
import { parseGitUrl } from "../../utils/git.js";
|
|
40
40
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
@@ -65,11 +65,13 @@ import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
|
65
65
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
66
66
|
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
67
67
|
import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
68
|
+
import { piLogoLines } from "./components/pi-logo.js";
|
|
68
69
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
69
70
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
70
71
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
71
72
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
72
73
|
import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
74
|
+
import { ThemedText } from "./components/themed-text.js";
|
|
73
75
|
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
74
76
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
75
77
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
@@ -80,7 +82,7 @@ import { editInExternalEditor } from "./external-editor.js";
|
|
|
80
82
|
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
81
83
|
import { getModelSearchText } from "./model-search.js";
|
|
82
84
|
import { shareSession } from "./session-share.js";
|
|
83
|
-
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
85
|
+
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
84
86
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
85
87
|
import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
86
88
|
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
@@ -93,16 +95,16 @@ function isWorkingStatusEditor(editor) {
|
|
|
93
95
|
function isExpandable(obj) {
|
|
94
96
|
return typeof obj === "object" && obj !== null && "setExpanded" in obj && typeof obj.setExpanded === "function";
|
|
95
97
|
}
|
|
96
|
-
class ExpandableText extends
|
|
97
|
-
|
|
98
|
-
getExpandedText;
|
|
98
|
+
class ExpandableText extends ThemedText {
|
|
99
|
+
state;
|
|
99
100
|
constructor(getCollapsedText, getExpandedText, expanded = false, paddingX = 0, paddingY = 0) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
101
|
+
const state = { expanded };
|
|
102
|
+
super(() => (state.expanded ? getExpandedText() : getCollapsedText()), paddingX, paddingY);
|
|
103
|
+
this.state = state;
|
|
103
104
|
}
|
|
104
105
|
setExpanded(expanded) {
|
|
105
|
-
this.
|
|
106
|
+
this.state.expanded = expanded;
|
|
107
|
+
this.invalidate();
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
110
|
function isCustomSessionEntry(item) {
|
|
@@ -257,6 +259,7 @@ export class InteractiveMode {
|
|
|
257
259
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
258
260
|
lastStatusSpacer = undefined;
|
|
259
261
|
lastStatusText = undefined;
|
|
262
|
+
lastStatusMessage = "";
|
|
260
263
|
managedToolStatusStarted = false;
|
|
261
264
|
// Streaming message tracking
|
|
262
265
|
streamingComponent = undefined;
|
|
@@ -347,7 +350,7 @@ export class InteractiveMode {
|
|
|
347
350
|
});
|
|
348
351
|
this.runtimeHost.setRebindSession(async () => {
|
|
349
352
|
await this.rebindCurrentSession({ renderBeforeBind: true });
|
|
350
|
-
|
|
353
|
+
this.themeController.applyFromSettings();
|
|
351
354
|
});
|
|
352
355
|
this.version = VERSION;
|
|
353
356
|
this.renderer = createInteractiveTui({
|
|
@@ -357,6 +360,7 @@ export class InteractiveMode {
|
|
|
357
360
|
terminal: options.terminal,
|
|
358
361
|
onRightClickPaste: this.onRightClickPaste,
|
|
359
362
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
363
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
360
364
|
});
|
|
361
365
|
this.ui = createInteractiveTuiReference(() => this.renderer);
|
|
362
366
|
this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());
|
|
@@ -401,7 +405,8 @@ export class InteractiveMode {
|
|
|
401
405
|
});
|
|
402
406
|
}
|
|
403
407
|
getAutocompleteSourceTag(sourceInfo) {
|
|
404
|
-
|
|
408
|
+
// Built-in extension commands are untagged, like built-in commands.
|
|
409
|
+
if (!sourceInfo || sourceInfo.source === "builtin") {
|
|
405
410
|
return undefined;
|
|
406
411
|
}
|
|
407
412
|
const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
|
|
@@ -554,7 +559,7 @@ export class InteractiveMode {
|
|
|
554
559
|
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
555
560
|
}
|
|
556
561
|
else {
|
|
557
|
-
this.chatContainer.addChild(new
|
|
562
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
558
563
|
this.chatContainer.addChild(new Spacer(1));
|
|
559
564
|
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
560
565
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -606,6 +611,7 @@ export class InteractiveMode {
|
|
|
606
611
|
terminal,
|
|
607
612
|
onRightClickPaste: this.onRightClickPaste,
|
|
608
613
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
614
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
609
615
|
});
|
|
610
616
|
nextUi.setClearOnShrink(clearOnShrink);
|
|
611
617
|
nextUi.onDebug = onDebug;
|
|
@@ -683,13 +689,21 @@ export class InteractiveMode {
|
|
|
683
689
|
this.ui.start();
|
|
684
690
|
this.bindAbortInputListener();
|
|
685
691
|
this.isInitialized = true;
|
|
686
|
-
|
|
692
|
+
this.themeController.applyFromSettings();
|
|
693
|
+
// The header and startup notices bake theme colors into their text, so build them once the terminal
|
|
694
|
+
// reported its colors. This ends at the terminal's DA1 reply, or after 100 ms if it answers nothing.
|
|
695
|
+
await this.themeController.waitForTerminalColors();
|
|
687
696
|
// Add header with keybindings from config (unless silenced)
|
|
688
697
|
if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
|
689
|
-
|
|
698
|
+
// Built on demand so the header follows theme changes. The logo's first line carries the version,
|
|
699
|
+
// its second line the first line of key hints.
|
|
700
|
+
const withLogo = (hints) => {
|
|
701
|
+
const [top, bottom] = piLogoLines();
|
|
702
|
+
return `${top} ${theme.fg("dim", `v${this.version}`)}\n${bottom} ${hints}`;
|
|
703
|
+
};
|
|
690
704
|
// Build startup instructions using keybinding hint helpers
|
|
691
705
|
const hint = (keybinding, description) => keyHint(keybinding, description);
|
|
692
|
-
const expandedInstructions = [
|
|
706
|
+
const expandedInstructions = () => [
|
|
693
707
|
hint("app.interrupt", "to interrupt"),
|
|
694
708
|
hint("app.clear", "to clear"),
|
|
695
709
|
rawKeyHint(`${keyText("app.clear")} twice`, "to exit"),
|
|
@@ -707,19 +721,19 @@ export class InteractiveMode {
|
|
|
707
721
|
rawKeyHint("!!", "to run bash (no context)"),
|
|
708
722
|
hint("app.message.followUp", "to queue follow-up"),
|
|
709
723
|
hint("app.message.dequeue", "to edit all queued messages"),
|
|
710
|
-
hint("app.clipboard.pasteImage", "to paste
|
|
724
|
+
hint("app.clipboard.pasteImage", "to paste files on macOS, images, or text"),
|
|
711
725
|
rawKeyHint("drop files", "to attach"),
|
|
712
726
|
].join("\n");
|
|
713
|
-
const compactInstructions = [
|
|
727
|
+
const compactInstructions = () => [
|
|
714
728
|
hint("app.interrupt", "interrupt"),
|
|
715
729
|
rawKeyHint(`${keyText("app.clear")}/${keyText("app.exit")}`, "clear/exit"),
|
|
716
730
|
rawKeyHint("/", "commands"),
|
|
717
731
|
rawKeyHint("!", "bash"),
|
|
718
732
|
hint("app.tools.expand", "more"),
|
|
719
733
|
].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
|
-
this.builtInHeader = new ExpandableText(() => `${
|
|
734
|
+
const compactOnboarding = () => theme.fg("dim", `Press ${keyText("app.tools.expand")} to show full startup help and loaded resources.`);
|
|
735
|
+
const onboarding = () => theme.fg("dim", `Pi can explain its own features and look up its docs. Ask it how to use or extend Pi.`);
|
|
736
|
+
this.builtInHeader = new ExpandableText(() => `${withLogo(compactInstructions())}\n${compactOnboarding()}\n\n${onboarding()}`, () => `${withLogo(expandedInstructions())}\n\n${onboarding()}`, this.getStartupExpansionState(), 1, 0);
|
|
723
737
|
// Setup UI layout
|
|
724
738
|
this.headerContainer.addChild(new Spacer(1));
|
|
725
739
|
this.headerContainer.addChild(this.builtInHeader);
|
|
@@ -1306,8 +1320,9 @@ export class InteractiveMode {
|
|
|
1306
1320
|
}
|
|
1307
1321
|
return theme.fg("dim", ` ${labels.join(", ")}`);
|
|
1308
1322
|
};
|
|
1323
|
+
// Bodies are built on demand so the listing follows theme changes.
|
|
1309
1324
|
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);
|
|
1325
|
+
const section = new ExpandableText(() => `${sectionHeader(name, color)}\n${collapsedBody()}`, () => `${sectionHeader(name, color)}\n${expandedBody()}`, this.getStartupExpansionState(), 0, 0);
|
|
1311
1326
|
this.loadedResourcesContainer.addChild(section);
|
|
1312
1327
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1313
1328
|
};
|
|
@@ -1352,27 +1367,25 @@ export class InteractiveMode {
|
|
|
1352
1367
|
];
|
|
1353
1368
|
if (contextFiles.length > 0) {
|
|
1354
1369
|
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 });
|
|
1370
|
+
const contextList = () => contextFiles.map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`)).join("\n");
|
|
1371
|
+
const contextCompactList = () => formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
|
|
1359
1372
|
addLoadedSection("Context", contextCompactList, contextList);
|
|
1360
1373
|
}
|
|
1361
1374
|
const skills = skillsResult.skills;
|
|
1362
1375
|
if (skills.length > 0) {
|
|
1363
1376
|
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
1364
|
-
const skillList = this.formatScopeGroups(groups, {
|
|
1377
|
+
const skillList = () => this.formatScopeGroups(groups, {
|
|
1365
1378
|
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
1366
1379
|
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
1367
1380
|
});
|
|
1368
|
-
const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
|
|
1381
|
+
const skillCompactList = () => formatCompactList(skills.map((skill) => skill.name));
|
|
1369
1382
|
addLoadedSection("Skills", skillCompactList, skillList);
|
|
1370
1383
|
}
|
|
1371
1384
|
const templates = this.session.promptTemplates;
|
|
1372
1385
|
if (templates.length > 0) {
|
|
1373
1386
|
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
1374
1387
|
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
1375
|
-
const templateList = this.formatScopeGroups(groups, {
|
|
1388
|
+
const templateList = () => this.formatScopeGroups(groups, {
|
|
1376
1389
|
formatPath: (item) => {
|
|
1377
1390
|
const template = templateByPath.get(item.path);
|
|
1378
1391
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
@@ -1382,53 +1395,40 @@ export class InteractiveMode {
|
|
|
1382
1395
|
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
1383
1396
|
},
|
|
1384
1397
|
});
|
|
1385
|
-
const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1398
|
+
const promptCompactList = () => formatCompactList(templates.map((template) => `/${template.name}`));
|
|
1386
1399
|
addLoadedSection("Prompts", promptCompactList, templateList);
|
|
1387
1400
|
}
|
|
1388
1401
|
if (extensions.length > 0) {
|
|
1389
1402
|
const groups = this.buildScopeGroups(extensions);
|
|
1390
|
-
const extList = this.formatScopeGroups(groups, {
|
|
1403
|
+
const extList = () => this.formatScopeGroups(groups, {
|
|
1391
1404
|
formatPath: (item) => this.formatExtensionDisplayPath(item.path),
|
|
1392
1405
|
formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
|
|
1393
1406
|
});
|
|
1394
|
-
const
|
|
1407
|
+
const extensionLabels = this.getCompactExtensionLabels(extensions);
|
|
1408
|
+
const extensionCompactList = () => formatCompactList(extensionLabels);
|
|
1395
1409
|
addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
|
|
1396
1410
|
}
|
|
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
1411
|
}
|
|
1413
1412
|
if (showDiagnostics) {
|
|
1414
1413
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1415
1414
|
if (skillDiagnostics.length > 0) {
|
|
1416
|
-
const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1417
|
-
this.loadedResourcesContainer.addChild(new
|
|
1415
|
+
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1416
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1418
1417
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1419
1418
|
}
|
|
1420
1419
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
1421
1420
|
if (promptDiagnostics.length > 0) {
|
|
1422
|
-
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1423
|
-
this.loadedResourcesContainer.addChild(new
|
|
1421
|
+
const warningLines = () => this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
1422
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1424
1423
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1425
1424
|
}
|
|
1426
1425
|
const extensionDiagnostics = [];
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1426
|
+
const extensionsResult = this.session.resourceLoader.getExtensions();
|
|
1427
|
+
for (const error of extensionsResult.errors) {
|
|
1428
|
+
extensionDiagnostics.push({ type: "error", message: error.error, path: error.path });
|
|
1429
|
+
}
|
|
1430
|
+
for (const warning of extensionsResult.warnings ?? []) {
|
|
1431
|
+
extensionDiagnostics.push({ type: "warning", message: warning.warning, path: warning.path });
|
|
1432
1432
|
}
|
|
1433
1433
|
const commandDiagnostics = this.session.extensionRunner.getCommandDiagnostics();
|
|
1434
1434
|
extensionDiagnostics.push(...commandDiagnostics);
|
|
@@ -1436,14 +1436,14 @@ export class InteractiveMode {
|
|
|
1436
1436
|
const shortcutDiagnostics = this.session.extensionRunner.getShortcutDiagnostics();
|
|
1437
1437
|
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
1438
1438
|
if (extensionDiagnostics.length > 0) {
|
|
1439
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1440
|
-
this.loadedResourcesContainer.addChild(new
|
|
1439
|
+
const warningLines = () => this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
1440
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Extension issues]")}\n${warningLines()}`, 0, 0));
|
|
1441
1441
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1442
1442
|
}
|
|
1443
1443
|
const themeDiagnostics = themesResult.diagnostics;
|
|
1444
1444
|
if (themeDiagnostics.length > 0) {
|
|
1445
|
-
const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1446
|
-
this.loadedResourcesContainer.addChild(new
|
|
1445
|
+
const warningLines = () => this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
1446
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Theme conflicts]")}\n${warningLines()}`, 0, 0));
|
|
1447
1447
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
@@ -1535,6 +1535,7 @@ export class InteractiveMode {
|
|
|
1535
1535
|
this.applyFullscreenScrollbarSetting();
|
|
1536
1536
|
if (this.renderer instanceof TuiAltScreen) {
|
|
1537
1537
|
this.renderer.setCopyOnSelect(this.settingsManager.getFullscreenCopyOnSelect());
|
|
1538
|
+
this.renderer.setWheelScrollLines(this.settingsManager.getFullscreenWheelScrollLines());
|
|
1538
1539
|
}
|
|
1539
1540
|
this.footer.setSession(this.session);
|
|
1540
1541
|
this.footer.setAutoCompactEnabled(this.session.autoCompactionEnabled);
|
|
@@ -1581,10 +1582,11 @@ export class InteractiveMode {
|
|
|
1581
1582
|
this.showError(`${prefix}: ${message}`);
|
|
1582
1583
|
const extensionHint = this.getCrashExtensionHint(error);
|
|
1583
1584
|
if (extensionHint) {
|
|
1584
|
-
this.chatContainer.addChild(new
|
|
1585
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", extensionHint), this.outputPad, 0));
|
|
1585
1586
|
}
|
|
1586
1587
|
if (this.recordCrash("fatal_error", error)) {
|
|
1587
|
-
|
|
1588
|
+
const instructions = this.crashReportInstructions();
|
|
1589
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("muted", instructions), this.outputPad, 0));
|
|
1588
1590
|
}
|
|
1589
1591
|
stopThemeWatcher();
|
|
1590
1592
|
this.stop("transcript");
|
|
@@ -1620,7 +1622,7 @@ export class InteractiveMode {
|
|
|
1620
1622
|
if (this.bugReportHintShown)
|
|
1621
1623
|
return;
|
|
1622
1624
|
this.bugReportHintShown = true;
|
|
1623
|
-
this.chatContainer.addChild(new
|
|
1625
|
+
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
1626
|
this.ui.requestRender();
|
|
1625
1627
|
}
|
|
1626
1628
|
maybeSuggestBugReport(message) {
|
|
@@ -1874,7 +1876,7 @@ export class InteractiveMode {
|
|
|
1874
1876
|
container.addChild(new Text(line, 1, 0));
|
|
1875
1877
|
}
|
|
1876
1878
|
if (content.length > InteractiveMode.MAX_WIDGET_LINES) {
|
|
1877
|
-
container.addChild(new
|
|
1879
|
+
container.addChild(new ThemedText(() => theme.fg("muted", "... (widget truncated)"), 1, 0));
|
|
1878
1880
|
}
|
|
1879
1881
|
component = container;
|
|
1880
1882
|
}
|
|
@@ -2404,17 +2406,14 @@ export class InteractiveMode {
|
|
|
2404
2406
|
*/
|
|
2405
2407
|
showExtensionError(extensionPath, error, stack) {
|
|
2406
2408
|
const errorMsg = `Extension "${extensionPath}" error: ${error}`;
|
|
2407
|
-
const errorText = new
|
|
2409
|
+
const errorText = new ThemedText(() => theme.fg("error", errorMsg), 1, 0);
|
|
2408
2410
|
this.chatContainer.addChild(errorText);
|
|
2409
2411
|
if (stack) {
|
|
2410
2412
|
// 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));
|
|
2413
|
+
const stackLines = stack.split("\n").slice(1); // Skip first line (duplicates error message)
|
|
2414
|
+
if (stackLines.length > 0) {
|
|
2415
|
+
const renderStack = () => stackLines.map((line) => theme.fg("dim", ` ${line.trim()}`)).join("\n");
|
|
2416
|
+
this.chatContainer.addChild(new ThemedText(renderStack, 1, 0));
|
|
2418
2417
|
}
|
|
2419
2418
|
}
|
|
2420
2419
|
this.ui.requestRender();
|
|
@@ -2517,8 +2516,8 @@ export class InteractiveMode {
|
|
|
2517
2516
|
this.updateEditorBorderColor();
|
|
2518
2517
|
}
|
|
2519
2518
|
};
|
|
2520
|
-
// Handle clipboard paste (triggered on Ctrl+V).
|
|
2521
|
-
//
|
|
2519
|
+
// Handle clipboard paste (triggered on Ctrl+V). Copied files use their original paths,
|
|
2520
|
+
// images are attached via temporary files, and plain text is the final fallback.
|
|
2522
2521
|
this.defaultEditor.onPasteImage = () => {
|
|
2523
2522
|
void this.handleClipboardPaste();
|
|
2524
2523
|
};
|
|
@@ -2541,6 +2540,22 @@ export class InteractiveMode {
|
|
|
2541
2540
|
}
|
|
2542
2541
|
async handleClipboardPaste() {
|
|
2543
2542
|
try {
|
|
2543
|
+
const filePaths = await readClipboardFilePaths();
|
|
2544
|
+
if (filePaths) {
|
|
2545
|
+
if (filePaths.some((filePath) => /\p{Cc}/u.test(filePath))) {
|
|
2546
|
+
throw new Error("Clipboard file path contains control characters");
|
|
2547
|
+
}
|
|
2548
|
+
const paths = this.isBashMode ? filePaths.map(quoteIfNeeded).join(" ") : filePaths.join("\n");
|
|
2549
|
+
const cursor = this.editor.getCursor?.();
|
|
2550
|
+
const currentLine = cursor ? (this.editor.getText().split("\n")[cursor.line] ?? "") : "";
|
|
2551
|
+
const characterBeforeCursor = cursor && cursor.col > 0 ? currentLine[cursor.col - 1] : "";
|
|
2552
|
+
const characterAfterCursor = cursor ? currentLine[cursor.col] : "";
|
|
2553
|
+
const leadingSpace = characterBeforeCursor && !/\s/.test(characterBeforeCursor) ? " " : "";
|
|
2554
|
+
const trailingSpace = characterAfterCursor && !/\s/.test(characterAfterCursor) ? " " : "";
|
|
2555
|
+
this.editor.insertTextAtCursor?.(`${leadingSpace}${paths}${trailingSpace}`);
|
|
2556
|
+
this.ui.requestRender();
|
|
2557
|
+
return;
|
|
2558
|
+
}
|
|
2544
2559
|
const image = await readClipboardImage();
|
|
2545
2560
|
if (image) {
|
|
2546
2561
|
const tmpDir = os.tmpdir();
|
|
@@ -2558,8 +2573,8 @@ export class InteractiveMode {
|
|
|
2558
2573
|
this.ui.requestRender();
|
|
2559
2574
|
}
|
|
2560
2575
|
}
|
|
2561
|
-
catch {
|
|
2562
|
-
|
|
2576
|
+
catch (error) {
|
|
2577
|
+
this.showError(`Failed to paste from clipboard: ${error instanceof Error ? error.message : String(error)}`);
|
|
2563
2578
|
}
|
|
2564
2579
|
}
|
|
2565
2580
|
handleStartupSubmit(text) {
|
|
@@ -2988,6 +3003,9 @@ export class InteractiveMode {
|
|
|
2988
3003
|
// The bash execution callback handles TUI output rendering.
|
|
2989
3004
|
break;
|
|
2990
3005
|
case "tool_execution_start": {
|
|
3006
|
+
// Nested calls (from codemode scripts) are shown inside their parent's row.
|
|
3007
|
+
if (event.parentToolCallId)
|
|
3008
|
+
break;
|
|
2991
3009
|
let component = this.pendingTools.get(event.toolCallId);
|
|
2992
3010
|
if (!component) {
|
|
2993
3011
|
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
@@ -3097,7 +3115,8 @@ export class InteractiveMode {
|
|
|
3097
3115
|
}
|
|
3098
3116
|
else {
|
|
3099
3117
|
this.chatContainer.addChild(new Spacer(1));
|
|
3100
|
-
|
|
3118
|
+
const errorMessage = event.errorMessage;
|
|
3119
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", errorMessage), 1, 0));
|
|
3101
3120
|
}
|
|
3102
3121
|
}
|
|
3103
3122
|
if (this.session.isAborting) {
|
|
@@ -3186,7 +3205,7 @@ export class InteractiveMode {
|
|
|
3186
3205
|
}
|
|
3187
3206
|
const message = status.type === "warning" ? `Warning: ${status.message}` : status.message;
|
|
3188
3207
|
const color = status.type === "warning" ? "warning" : "dim";
|
|
3189
|
-
this.chatContainer.addChild(new
|
|
3208
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));
|
|
3190
3209
|
this.lastStatusSpacer = undefined;
|
|
3191
3210
|
this.lastStatusText = undefined;
|
|
3192
3211
|
this.ui.requestRender();
|
|
@@ -3202,12 +3221,14 @@ export class InteractiveMode {
|
|
|
3202
3221
|
const last = children.length > 0 ? children[children.length - 1] : undefined;
|
|
3203
3222
|
const secondLast = children.length > 1 ? children[children.length - 2] : undefined;
|
|
3204
3223
|
if (last && secondLast && last === this.lastStatusText && secondLast === this.lastStatusSpacer) {
|
|
3205
|
-
this.
|
|
3224
|
+
this.lastStatusMessage = message;
|
|
3225
|
+
this.lastStatusText.invalidate();
|
|
3206
3226
|
this.ui.requestRender();
|
|
3207
3227
|
return;
|
|
3208
3228
|
}
|
|
3209
3229
|
const spacer = new Spacer(1);
|
|
3210
|
-
|
|
3230
|
+
this.lastStatusMessage = message;
|
|
3231
|
+
const text = new ThemedText(() => theme.fg("dim", this.lastStatusMessage), 1, 0);
|
|
3211
3232
|
this.chatContainer.addChild(spacer);
|
|
3212
3233
|
this.chatContainer.addChild(text);
|
|
3213
3234
|
this.lastStatusSpacer = spacer;
|
|
@@ -3416,7 +3437,8 @@ export class InteractiveMode {
|
|
|
3416
3437
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3417
3438
|
return;
|
|
3418
3439
|
this.chatContainer.addChild(new Spacer(1));
|
|
3419
|
-
|
|
3440
|
+
const usage = formatCacheWarmingUsage(entry);
|
|
3441
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3420
3442
|
}
|
|
3421
3443
|
/**
|
|
3422
3444
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -3430,7 +3452,7 @@ export class InteractiveMode {
|
|
|
3430
3452
|
const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
|
|
3431
3453
|
const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
|
|
3432
3454
|
this.chatContainer.addChild(new Spacer(1));
|
|
3433
|
-
this.chatContainer.addChild(new
|
|
3455
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
|
|
3434
3456
|
}
|
|
3435
3457
|
static countDroppedThinkingBlocks(message) {
|
|
3436
3458
|
let count = 0;
|
|
@@ -3467,7 +3489,7 @@ export class InteractiveMode {
|
|
|
3467
3489
|
return;
|
|
3468
3490
|
const noun = droppedCount === 1 ? "thinking block" : "thinking blocks";
|
|
3469
3491
|
this.chatContainer.addChild(new Spacer(1));
|
|
3470
|
-
this.chatContainer.addChild(new
|
|
3492
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Anthropic dropped ${droppedCount} ${noun} (details in session)`), 1, 0));
|
|
3471
3493
|
}
|
|
3472
3494
|
/**
|
|
3473
3495
|
* Show a transcript notice when a completed assistant message paid for a
|
|
@@ -3494,9 +3516,8 @@ export class InteractiveMode {
|
|
|
3494
3516
|
else if (miss.idleMs >= CACHE_TTL_MS) {
|
|
3495
3517
|
label = `Cache miss after ${Math.round(miss.idleMs / 60_000)}m idle`;
|
|
3496
3518
|
}
|
|
3497
|
-
const text = theme.fg("warning", `${label}: ${reBilled}`);
|
|
3498
3519
|
this.chatContainer.addChild(new Spacer(1));
|
|
3499
|
-
this.chatContainer.addChild(new
|
|
3520
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `${label}: ${reBilled}`), 1, 0));
|
|
3500
3521
|
}
|
|
3501
3522
|
renderInitialMessages() {
|
|
3502
3523
|
const entries = this.sessionManager.buildContextEntries();
|
|
@@ -3520,7 +3541,7 @@ export class InteractiveMode {
|
|
|
3520
3541
|
if (this.chatContainer.children.length > 0) {
|
|
3521
3542
|
this.chatContainer.addChild(new Spacer(1));
|
|
3522
3543
|
}
|
|
3523
|
-
this.chatContainer.addChild(new
|
|
3544
|
+
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
3545
|
}
|
|
3525
3546
|
async getUserInput() {
|
|
3526
3547
|
const queuedInput = this.pendingUserInputs.shift();
|
|
@@ -3871,26 +3892,28 @@ export class InteractiveMode {
|
|
|
3871
3892
|
}
|
|
3872
3893
|
showError(errorMessage) {
|
|
3873
3894
|
this.chatContainer.addChild(new Spacer(1));
|
|
3874
|
-
this.chatContainer.addChild(new
|
|
3895
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("error", `Error: ${errorMessage}`), this.outputPad, 0));
|
|
3875
3896
|
this.ui.requestRender();
|
|
3876
3897
|
}
|
|
3877
3898
|
showWarning(warningMessage) {
|
|
3878
3899
|
this.chatContainer.addChild(new Spacer(1));
|
|
3879
|
-
this.chatContainer.addChild(new
|
|
3900
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("warning", `Warning: ${warningMessage}`), 1, 0));
|
|
3880
3901
|
this.ui.requestRender();
|
|
3881
3902
|
}
|
|
3882
3903
|
showNewVersionNotification(release) {
|
|
3883
|
-
const
|
|
3884
|
-
|
|
3904
|
+
const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
|
|
3905
|
+
theme.fg("accent", `${APP_NAME} update`);
|
|
3885
3906
|
const changelogUrl = "https://pi.dev/changelog";
|
|
3886
|
-
const
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3907
|
+
const changelogLine = () => {
|
|
3908
|
+
const changelogLink = getCapabilities().hyperlinks
|
|
3909
|
+
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
3910
|
+
: theme.fg("accent", changelogUrl);
|
|
3911
|
+
return theme.fg("muted", "Changelog: ") + changelogLink;
|
|
3912
|
+
};
|
|
3890
3913
|
const note = release.note?.trim();
|
|
3891
3914
|
this.chatContainer.addChild(new Spacer(1));
|
|
3892
3915
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3893
|
-
this.chatContainer.addChild(new
|
|
3916
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.bold(theme.fg("warning", "Update Available"))}\n${updateInstruction()}`, 1, 0));
|
|
3894
3917
|
if (note) {
|
|
3895
3918
|
this.chatContainer.addChild(new Spacer(1));
|
|
3896
3919
|
this.chatContainer.addChild(new Markdown(note, 1, 0, this.getMarkdownThemeWithSettings(), {
|
|
@@ -3898,17 +3921,17 @@ export class InteractiveMode {
|
|
|
3898
3921
|
}));
|
|
3899
3922
|
this.chatContainer.addChild(new Spacer(1));
|
|
3900
3923
|
}
|
|
3901
|
-
this.chatContainer.addChild(new
|
|
3924
|
+
this.chatContainer.addChild(new ThemedText(changelogLine, 1, 0));
|
|
3902
3925
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3903
3926
|
this.ui.requestRender();
|
|
3904
3927
|
}
|
|
3905
3928
|
showPackageUpdateNotification(packages) {
|
|
3906
|
-
const
|
|
3907
|
-
|
|
3929
|
+
const updateInstruction = () => theme.fg("muted", "Package updates are available. Run ") +
|
|
3930
|
+
theme.fg("accent", `${APP_NAME} update --extensions`);
|
|
3908
3931
|
const packageLines = packages.map((pkg) => `- ${pkg}`).join("\n");
|
|
3909
3932
|
this.chatContainer.addChild(new Spacer(1));
|
|
3910
3933
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3911
|
-
this.chatContainer.addChild(new
|
|
3934
|
+
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
3935
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
|
3913
3936
|
this.ui.requestRender();
|
|
3914
3937
|
}
|
|
@@ -4156,7 +4179,7 @@ export class InteractiveMode {
|
|
|
4156
4179
|
thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
|
|
4157
4180
|
availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
|
|
4158
4181
|
modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
|
|
4159
|
-
currentTheme: this.themeController.getThemeSelection() ||
|
|
4182
|
+
currentTheme: this.themeController.getThemeSelection() || SYSTEM_THEME_NAME,
|
|
4160
4183
|
terminalTheme: this.themeController.getTerminalTheme(),
|
|
4161
4184
|
availableThemes: getAvailableThemes(),
|
|
4162
4185
|
hideThinkingBlock: this.hideThinkingBlock,
|
|
@@ -4178,6 +4201,7 @@ export class InteractiveMode {
|
|
|
4178
4201
|
fullscreenExitOutput: this.settingsManager.getFullscreenExitOutput(),
|
|
4179
4202
|
fullscreenScrollbar: this.settingsManager.getFullscreenScrollbar(),
|
|
4180
4203
|
fullscreenCopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),
|
|
4204
|
+
fullscreenWheelScrollLines: this.settingsManager.getFullscreenWheelScrollLines(),
|
|
4181
4205
|
warnings: this.settingsManager.getWarnings(),
|
|
4182
4206
|
}, {
|
|
4183
4207
|
onAutoCompactChange: (enabled) => {
|
|
@@ -4252,7 +4276,7 @@ export class InteractiveMode {
|
|
|
4252
4276
|
},
|
|
4253
4277
|
onThemeChange: (themeSetting) => {
|
|
4254
4278
|
this.settingsManager.setTheme(themeSetting);
|
|
4255
|
-
|
|
4279
|
+
this.themeController.setThemeSetting(themeSetting);
|
|
4256
4280
|
},
|
|
4257
4281
|
onThemePreview: (themeName) => this.themeController.preview(themeName),
|
|
4258
4282
|
onHideThinkingBlockChange: (hidden) => {
|
|
@@ -4357,6 +4381,11 @@ export class InteractiveMode {
|
|
|
4357
4381
|
if (this.renderer instanceof TuiAltScreen)
|
|
4358
4382
|
this.renderer.setCopyOnSelect(enabled);
|
|
4359
4383
|
},
|
|
4384
|
+
onFullscreenWheelScrollLinesChange: (lines) => {
|
|
4385
|
+
this.settingsManager.setFullscreenWheelScrollLines(lines);
|
|
4386
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
4387
|
+
this.renderer.setWheelScrollLines(lines);
|
|
4388
|
+
},
|
|
4360
4389
|
onWarningsChange: (warnings) => {
|
|
4361
4390
|
this.settingsManager.setWarnings(warnings);
|
|
4362
4391
|
},
|
|
@@ -5339,7 +5368,7 @@ export class InteractiveMode {
|
|
|
5339
5368
|
signal: dialog.signal,
|
|
5340
5369
|
prompt: (prompt) => this.showAuthPrompt(dialog, prompt),
|
|
5341
5370
|
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5342
|
-
});
|
|
5371
|
+
}, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
|
|
5343
5372
|
}
|
|
5344
5373
|
async showLoginDialog(providerId, providerName) {
|
|
5345
5374
|
const previousModel = this.session.model;
|
|
@@ -5387,7 +5416,7 @@ export class InteractiveMode {
|
|
|
5387
5416
|
const borderColor = (s) => theme.fg("border", s);
|
|
5388
5417
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5389
5418
|
reloadBox.addChild(new Spacer(1));
|
|
5390
|
-
reloadBox.addChild(new
|
|
5419
|
+
reloadBox.addChild(new ThemedText(() => theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes, and context files..."), 1, 0));
|
|
5391
5420
|
reloadBox.addChild(new Spacer(1));
|
|
5392
5421
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
|
5393
5422
|
const previousEditor = this.editor;
|
|
@@ -5423,7 +5452,7 @@ export class InteractiveMode {
|
|
|
5423
5452
|
}
|
|
5424
5453
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
5425
5454
|
this.applyRuntimeSettings();
|
|
5426
|
-
|
|
5455
|
+
this.themeController.applyFromSettings();
|
|
5427
5456
|
this.setupAutocompleteProvider();
|
|
5428
5457
|
const runner = this.session.extensionRunner;
|
|
5429
5458
|
this.setupExtensionShortcuts(runner);
|
|
@@ -5587,7 +5616,7 @@ export class InteractiveMode {
|
|
|
5587
5616
|
const currentName = this.sessionManager.getSessionName();
|
|
5588
5617
|
if (currentName) {
|
|
5589
5618
|
this.chatContainer.addChild(new Spacer(1));
|
|
5590
|
-
this.chatContainer.addChild(new
|
|
5619
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name: ${currentName}`), 1, 0));
|
|
5591
5620
|
}
|
|
5592
5621
|
else {
|
|
5593
5622
|
this.showWarning("Usage: /name <name>");
|
|
@@ -5601,7 +5630,8 @@ export class InteractiveMode {
|
|
|
5601
5630
|
this.showWarning(`Session name was normalized from ${JSON.stringify(name)} to ${JSON.stringify(sessionName)}`);
|
|
5602
5631
|
}
|
|
5603
5632
|
this.chatContainer.addChild(new Spacer(1));
|
|
5604
|
-
|
|
5633
|
+
const displayName = sessionName ?? name;
|
|
5634
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", `Session name set: ${displayName}`), 1, 0));
|
|
5605
5635
|
this.ui.requestRender();
|
|
5606
5636
|
}
|
|
5607
5637
|
handleSessionCommand() {
|
|
@@ -5613,61 +5643,69 @@ export class InteractiveMode {
|
|
|
5613
5643
|
// resolves to a concrete responseModel). Usage without model attribution is
|
|
5614
5644
|
// grouped separately so the breakdown reconciles with the session total.
|
|
5615
5645
|
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`;
|
|
5646
|
+
// Snapshot the stats; the text is built on demand so it follows theme changes.
|
|
5643
5647
|
const cacheWarmingStatus = this.session.cacheWarmingStatus;
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
const
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
info +=
|
|
5654
|
-
info += `${theme.
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5648
|
+
const cacheWarmingMode = this.settingsManager.getCacheWarmingMode();
|
|
5649
|
+
const model = this.session.model;
|
|
5650
|
+
const selectedModelKey = `${model?.provider}/${model?.id}`;
|
|
5651
|
+
const renderInfo = () => {
|
|
5652
|
+
let info = `${theme.bold("Session Info")}\n\n`;
|
|
5653
|
+
if (sessionName) {
|
|
5654
|
+
info += `${theme.fg("dim", "Name:")} ${sessionName}\n`;
|
|
5655
|
+
}
|
|
5656
|
+
info += `${theme.fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
5657
|
+
info += `${theme.fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
5658
|
+
info += `${theme.bold("Messages")}\n`;
|
|
5659
|
+
info += `${theme.fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
5660
|
+
info += `${theme.fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
5661
|
+
info += `${theme.fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
5662
|
+
info += `${theme.fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
5663
|
+
info += `${theme.bold("Tokens")}\n`;
|
|
5664
|
+
// "Input" is the full prompt volume. With cache activity, split it into
|
|
5665
|
+
// cached (served from cache) vs uncached (everything else) - the only
|
|
5666
|
+
// provider-independent split. Cache writes, where reported, are a detail
|
|
5667
|
+
// of the uncached portion.
|
|
5668
|
+
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
5669
|
+
const promptTokens = input + cacheRead + cacheWrite;
|
|
5670
|
+
info += `${theme.fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
5671
|
+
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
5672
|
+
const hitRate = theme.fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
5673
|
+
info += ` ${theme.fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
5674
|
+
const written = cacheWrite > 0 ? ` ${theme.fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
5675
|
+
info += ` ${theme.fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
5676
|
+
}
|
|
5677
|
+
info += `${theme.fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
5678
|
+
info += `${theme.fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
5679
|
+
info += `\n${theme.bold("Cache Warming")}\n`;
|
|
5680
|
+
info += `${theme.fg("dim", "Mode:")} ${cacheWarmingMode}\n`;
|
|
5681
|
+
info += `${theme.fg("dim", "Status:")} ${cacheWarmingStatus ? formatCacheWarmingStatus(cacheWarmingStatus) : "Inactive (cache warming unavailable)"}\n`;
|
|
5682
|
+
const decision = cacheWarmingStatus?.decision;
|
|
5683
|
+
if (decision?.economicsAvailable) {
|
|
5684
|
+
info += `${theme.fg("dim", "Cache miss penalty:")} $${decision.missCost.toFixed(3)}\n`;
|
|
5685
|
+
info += `${theme.fg("dim", "Refresh cost:")} $${decision.warmCost.toFixed(3)}\n`;
|
|
5686
|
+
}
|
|
5687
|
+
if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
|
|
5688
|
+
info += `\n${theme.bold("Cost")}\n`;
|
|
5689
|
+
info += `${theme.fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
|
|
5690
|
+
// A single entry repeats the total, unless it names a model other than the selected one.
|
|
5691
|
+
if (usageBreakdown.length > 1 || usageBreakdown[0]?.key !== selectedModelKey) {
|
|
5692
|
+
for (const entry of usageBreakdown) {
|
|
5693
|
+
info += `\n ${theme.fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${theme.fg("dim", `(${formatTokens(entry.tokens)} tokens)`)}`;
|
|
5694
|
+
}
|
|
5695
|
+
}
|
|
5696
|
+
if (cacheWaste.missedTokens > 0) {
|
|
5697
|
+
const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
|
|
5698
|
+
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
5699
|
+
info +=
|
|
5700
|
+
cacheWaste.missedCost >= 0.0001
|
|
5701
|
+
? `\n${theme.fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${theme.fg("dim", `(${detail})`)}`
|
|
5702
|
+
: `\n${theme.fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
5658
5703
|
}
|
|
5659
5704
|
}
|
|
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
|
-
}
|
|
5705
|
+
return info;
|
|
5706
|
+
};
|
|
5669
5707
|
this.chatContainer.addChild(new Spacer(1));
|
|
5670
|
-
this.chatContainer.addChild(new
|
|
5708
|
+
this.chatContainer.addChild(new ThemedText(renderInfo, 1, 0));
|
|
5671
5709
|
this.ui.requestRender();
|
|
5672
5710
|
}
|
|
5673
5711
|
handleChangelogCommand() {
|
|
@@ -5681,7 +5719,7 @@ export class InteractiveMode {
|
|
|
5681
5719
|
: "No changelog entries found.";
|
|
5682
5720
|
this.chatContainer.addChild(new Spacer(1));
|
|
5683
5721
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5684
|
-
this.chatContainer.addChild(new
|
|
5722
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
5685
5723
|
this.chatContainer.addChild(new Spacer(1));
|
|
5686
5724
|
this.chatContainer.addChild(new Markdown(changelogMarkdown, 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5687
5725
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5782,7 +5820,7 @@ export class InteractiveMode {
|
|
|
5782
5820
|
| \`${copyMessage}\` | Copy selection or last assistant message |
|
|
5783
5821
|
| \`${followUp}\` | Queue follow-up message |
|
|
5784
5822
|
| \`${dequeue}\` | Restore queued messages |
|
|
5785
|
-
| \`${pasteImage}\` | Paste
|
|
5823
|
+
| \`${pasteImage}\` | Paste files on macOS, images, or text from clipboard |
|
|
5786
5824
|
| \`/\` | Slash commands |
|
|
5787
5825
|
| \`!\` | Run bash command |
|
|
5788
5826
|
| \`!!\` | Run bash command (excluded from context) |
|
|
@@ -5804,7 +5842,7 @@ export class InteractiveMode {
|
|
|
5804
5842
|
}
|
|
5805
5843
|
this.chatContainer.addChild(new Spacer(1));
|
|
5806
5844
|
this.chatContainer.addChild(new DynamicBorder());
|
|
5807
|
-
this.chatContainer.addChild(new
|
|
5845
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Keyboard Shortcuts")), 1, 0));
|
|
5808
5846
|
this.chatContainer.addChild(new Spacer(1));
|
|
5809
5847
|
this.chatContainer.addChild(new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()));
|
|
5810
5848
|
this.chatContainer.addChild(new DynamicBorder());
|
|
@@ -5818,7 +5856,7 @@ export class InteractiveMode {
|
|
|
5818
5856
|
return;
|
|
5819
5857
|
}
|
|
5820
5858
|
this.chatContainer.addChild(new Spacer(1));
|
|
5821
|
-
this.chatContainer.addChild(new
|
|
5859
|
+
this.chatContainer.addChild(new ThemedText(() => theme.fg("accent", "✓ New session started"), 1, 1));
|
|
5822
5860
|
this.ui.requestRender();
|
|
5823
5861
|
}
|
|
5824
5862
|
catch (error) {
|
|
@@ -5849,7 +5887,7 @@ export class InteractiveMode {
|
|
|
5849
5887
|
fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });
|
|
5850
5888
|
fs.writeFileSync(debugLogPath, debugData);
|
|
5851
5889
|
this.chatContainer.addChild(new Spacer(1));
|
|
5852
|
-
this.chatContainer.addChild(new
|
|
5890
|
+
this.chatContainer.addChild(new ThemedText(() => `${theme.fg("accent", "✓ Debug log written")}\n${theme.fg("muted", debugLogPath)}`, 1, 1));
|
|
5853
5891
|
this.ui.requestRender();
|
|
5854
5892
|
}
|
|
5855
5893
|
handleArminSaysHi() {
|