@averyyy/pi-coding-agent 1.4.0-piclient.9 → 1.5.0-piclient.2
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 +122 -4
- package/dist/bundle/chunks/anthropic-messages-WU4RRDFO.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-M725JFGO.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +7 -4
- package/dist/bundle/chunks/chunk-3UW3IQIY.js +16 -0
- package/dist/bundle/chunks/chunk-4RKLODCT.js +2 -0
- package/dist/bundle/chunks/{chunk-3LTMO2WY.js → chunk-75IISYAM.js} +2 -2
- package/dist/bundle/chunks/{chunk-CF5GWZHW.js → chunk-A3Y7H47A.js} +1 -1
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/bundle/chunks/{chunk-D3OXAPLU.js → chunk-G23G7KNC.js} +2 -9
- package/dist/bundle/chunks/chunk-GJFZM2RZ.js +129 -0
- package/dist/bundle/chunks/chunk-GO33PKBT.js +9 -0
- package/dist/bundle/chunks/chunk-J55RSOMM.js +1592 -0
- package/dist/bundle/chunks/{chunk-H2AI7MFJ.js → chunk-JM6XUN2B.js} +2 -2
- package/dist/bundle/chunks/{chunk-BRYV63PL.js → chunk-LTLKVIE2.js} +8 -7
- package/dist/bundle/chunks/{chunk-MKWEYCNF.js → chunk-N4CTF6DK.js} +2 -2
- package/dist/bundle/chunks/chunk-O5CTLHDX.js +82 -0
- package/dist/bundle/chunks/{chunk-3NEJV7UG.js → chunk-OB5DESD7.js} +1 -1
- package/dist/bundle/chunks/chunk-OV4EHN3Q.js +2 -0
- package/dist/bundle/chunks/{chunk-3EGEEHMN.js → chunk-OW4KH7CI.js} +1 -1
- package/dist/bundle/chunks/{chunk-HZG4C6GI.js → chunk-OXKIVFVM.js} +1 -1
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/bundle/chunks/chunk-PWQUNMKT.js +4 -0
- package/dist/bundle/chunks/{chunk-VHUVVKJM.js → chunk-WATJAG5U.js} +1 -1
- package/dist/bundle/chunks/{chunk-VYYRESZJ.js → chunk-YH5RGRHQ.js} +3 -3
- package/dist/bundle/chunks/{cli-QUNA6INU.js → cli-2Q4CKMZK.js} +11 -9
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QIIM6OB4.js → cloudflare-workers-ai-system-one-JEJELFEJ.js} +1 -1
- package/dist/bundle/chunks/devin.js +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-4L2AVJKX.js → easter-egg-3d-UEH5CVEM.js} +1 -1
- package/dist/bundle/chunks/{execute-UNST3ORJ.js → execute-BOGNP5CQ.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-antigravity-runtime.js +3 -3
- package/dist/bundle/chunks/google-antigravity.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-PNRT4EAN.js → google-generative-ai-UTHMOBSC.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-ZLSXUSEM.js → google-vertex-MKY2BEE7.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/kimi-coding.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-U4EH6TAM.js → llama-cpp-classify-CYHVVBOQ.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-U2CRJEWX.js +5 -0
- package/dist/bundle/chunks/{openai-codex-responses-UIB63WGM.js → openai-codex-responses-DK2NKO47.js} +1 -1
- package/dist/bundle/chunks/openai-completions-VPNLDI5K.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-Q46R33J3.js → openai-decisions-UZ6HF7LF.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-FGTD6NDJ.js → openai-responses-S5QT5K5D.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-WBAVKHHY.js → openrouter-images-P5CYCO4P.js} +1 -1
- package/dist/bundle/chunks/pi-messages-XPX326L5.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-SITSZTHV.js → runtime-2Z3FBQRD.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-DFEHTLK5.js → typesafe-system-one-NKVLMGFF.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-FXCA64MK.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 +8 -7
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.d.ts.map +1 -1
- package/dist/cli/auth-check.js +12 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +6 -0
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -5
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +6 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +35 -7
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/compaction/branch-summarization.d.ts +4 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +14 -5
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/exec.d.ts +9 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +79 -15
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.js +165 -45
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/types.d.ts +27 -4
- 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/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +11 -4
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +15 -5
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1678 -2029
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +5 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +17 -11
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +11 -14
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +167 -198
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +14 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +160 -46
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +163 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -0
- package/dist/core/pi-ai-schemas.js +21 -0
- package/dist/core/pi-ai-schemas.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +1 -0
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +4 -0
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/pi-server-accounts.d.ts +22 -0
- package/dist/core/pi-server-accounts.d.ts.map +1 -0
- package/dist/core/pi-server-accounts.js +137 -0
- package/dist/core/pi-server-accounts.js.map +1 -0
- package/dist/core/pi-server-client.d.ts +15 -7
- package/dist/core/pi-server-client.d.ts.map +1 -1
- package/dist/core/pi-server-client.js +85 -4
- package/dist/core/pi-server-client.js.map +1 -1
- package/dist/core/pi-server-observer.d.ts +4 -0
- package/dist/core/pi-server-observer.d.ts.map +1 -1
- package/dist/core/pi-server-observer.js +24 -0
- package/dist/core/pi-server-observer.js.map +1 -1
- package/dist/core/pi-server-request.d.ts +1 -1
- package/dist/core/pi-server-request.d.ts.map +1 -1
- package/dist/core/pi-server-request.js +2 -2
- package/dist/core/pi-server-request.js.map +1 -1
- package/dist/core/pi-server-subagents.d.ts +26 -0
- package/dist/core/pi-server-subagents.d.ts.map +1 -0
- package/dist/core/pi-server-subagents.js +112 -0
- package/dist/core/pi-server-subagents.js.map +1 -0
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +1 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +3 -2
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +32 -16
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +6 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +42 -24
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +61 -18
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +32 -13
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +2 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +8 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +13 -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 +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- 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 +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- 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.js +2 -2
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +19 -19
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- 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 +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +6 -2
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +16 -4
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +1 -1
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +36 -13
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +1 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +33 -24
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +30 -7
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +4 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +45 -21
- package/dist/modes/interactive/components/assistant-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 +4 -17
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +7 -0
- 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 +2 -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 +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +4 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +105 -10
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +3 -2
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +17 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +13 -4
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +86 -22
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -24
- package/dist/modes/interactive/components/session-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 +2 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +6 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +14 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +5 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +9 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +6 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +10 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +179 -58
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts +10 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js +21 -0
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +31 -23
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +55 -4
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +5 -2
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +4 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +4 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +14 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +7 -0
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +30 -35
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +21 -11
- package/docs/custom-provider.md +2 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +3173 -225
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +23 -12
- package/docs/mcp.md +6 -4
- package/docs/message-types.md +1 -1
- package/docs/packages.md +24 -0
- package/docs/quickstart.md +7 -3
- package/docs/sessions.md +11 -3
- package/docs/settings.md +5 -4
- package/docs/slash-commands.md +3 -2
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +2 -0
- package/docs/windows.md +27 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- 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/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +19 -29
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +180 -0
- package/package.json +13 -14
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +17 -0
- package/dist/bundle/chunks/anthropic-messages-3TZAX2CL.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-5OV6AS44.js +0 -2
- package/dist/bundle/chunks/chunk-3V45WARH.js +0 -7
- package/dist/bundle/chunks/chunk-GA3MDGH3.js +0 -82
- package/dist/bundle/chunks/chunk-H2UJDH5M.js +0 -131
- package/dist/bundle/chunks/chunk-H76KZMOI.js +0 -2
- package/dist/bundle/chunks/chunk-K47GPRYD.js +0 -1577
- package/dist/bundle/chunks/chunk-PG7P2LUM.js +0 -4
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
- package/dist/bundle/chunks/chunk-TLSZ4DWU.js +0 -16
- package/dist/bundle/chunks/chunk-WVXVPMMO.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-OJFHLO4F.js +0 -5
- package/dist/bundle/chunks/openai-completions-T5JB7LUM.js +0 -7
- package/dist/bundle/chunks/pi-messages-S7RKCD5K.js +0 -8
- package/dist/bundle/chunks/virtual-modules-2WW4BVZM.js +0 -2
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/sandbox/package.json +0 -19
|
@@ -31,6 +31,7 @@ import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID } from "../../core/radius.js";
|
|
|
31
31
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
32
32
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
33
33
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
34
|
+
import { getSourcePackageKey } from "../../core/source-info.js";
|
|
34
35
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
35
36
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
36
37
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
@@ -45,6 +46,7 @@ import { getCwdRelativePath } from "../../utils/paths.js";
|
|
|
45
46
|
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
46
47
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
47
48
|
import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
|
|
49
|
+
import { stripBom } from "../../utils/text.js";
|
|
48
50
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
49
51
|
import { checkForNewPiVersion } from "../../utils/version-check.js";
|
|
50
52
|
import { reportBug } from "./bug-report.js";
|
|
@@ -276,6 +278,7 @@ export class InteractiveMode {
|
|
|
276
278
|
lastSigintTime = 0;
|
|
277
279
|
lastEscapeTime = 0;
|
|
278
280
|
changelogMarkdown = undefined;
|
|
281
|
+
extensionChangelogUpdates = [];
|
|
279
282
|
startupNoticesShown = false;
|
|
280
283
|
anthropicSubscriptionWarningShown = false;
|
|
281
284
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
@@ -570,24 +573,44 @@ export class InteractiveMode {
|
|
|
570
573
|
return;
|
|
571
574
|
}
|
|
572
575
|
this.startupNoticesShown = true;
|
|
573
|
-
if (!this.changelogMarkdown) {
|
|
576
|
+
if (!this.changelogMarkdown && this.extensionChangelogUpdates.length === 0) {
|
|
574
577
|
return;
|
|
575
578
|
}
|
|
576
579
|
if (this.chatContainer.children.length > 0) {
|
|
577
580
|
this.chatContainer.addChild(new Spacer(1));
|
|
578
581
|
}
|
|
579
582
|
this.chatContainer.addChild(new DynamicBorder());
|
|
580
|
-
if (this.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
if (this.changelogMarkdown) {
|
|
584
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
585
|
+
const versionMatch = this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/);
|
|
586
|
+
const latestVersion = versionMatch ? versionMatch[1] : this.version;
|
|
587
|
+
const condensedText = `Updated to v${latestVersion}. Use ${theme.bold("/changelog")} to view full changelog.`;
|
|
588
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
592
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
593
|
+
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
594
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
595
|
+
}
|
|
585
596
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
this.
|
|
597
|
+
if (this.extensionChangelogUpdates.length > 0) {
|
|
598
|
+
if (this.changelogMarkdown) {
|
|
599
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
600
|
+
}
|
|
601
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
602
|
+
const condensedText = this.extensionChangelogUpdates
|
|
603
|
+
.map((update) => `Updated ${update.name} to v${update.version}.`)
|
|
604
|
+
.join("\n");
|
|
605
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Extension Updates")), 1, 0));
|
|
609
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
610
|
+
const markdown = this.extensionChangelogUpdates.map((update) => update.markdown).join("\n\n");
|
|
611
|
+
this.chatContainer.addChild(new Markdown(markdown, 1, 0, this.getMarkdownThemeWithSettings()));
|
|
612
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
613
|
+
}
|
|
591
614
|
}
|
|
592
615
|
this.chatContainer.addChild(new DynamicBorder());
|
|
593
616
|
}
|
|
@@ -665,20 +688,15 @@ export class InteractiveMode {
|
|
|
665
688
|
if (this.isInitialized)
|
|
666
689
|
return;
|
|
667
690
|
this.registerSignalHandlers();
|
|
668
|
-
// Load
|
|
691
|
+
// Load changelogs (only show new entries, skip for resumed sessions)
|
|
669
692
|
this.changelogMarkdown = this.getChangelogForDisplay();
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
.
|
|
677
|
-
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
678
|
-
const cycleHint = cycleKeys.length > 0
|
|
679
|
-
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
680
|
-
: "";
|
|
681
|
-
console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`));
|
|
693
|
+
this.extensionChangelogUpdates = this.getExtensionChangelogUpdates();
|
|
694
|
+
// Fullscreen renders on the alternate screen, so text printed to stdout here would stay in the shell
|
|
695
|
+
// after exit. Fullscreen shows the notice in the header instead (#11508).
|
|
696
|
+
if (this.renderer.mode !== "fullscreen") {
|
|
697
|
+
const modelScopeNotice = this.getModelScopeNotice();
|
|
698
|
+
if (modelScopeNotice)
|
|
699
|
+
console.log(modelScopeNotice);
|
|
682
700
|
}
|
|
683
701
|
// Keep one component tree and remount it when changing renderers.
|
|
684
702
|
this.renderWidgets(); // Initialize with default spacer
|
|
@@ -779,6 +797,8 @@ export class InteractiveMode {
|
|
|
779
797
|
this.builtInHeader = new Text("", 0, 0);
|
|
780
798
|
this.headerContainer.addChild(this.builtInHeader);
|
|
781
799
|
}
|
|
800
|
+
if (this.renderer.mode === "fullscreen")
|
|
801
|
+
this.showFullscreenModelScopeNotice();
|
|
782
802
|
this.ui.requestRender();
|
|
783
803
|
// Ensure fd and rg are available after mounting the TUI (downloads if missing, adds to PATH via getBinDir)
|
|
784
804
|
// so slow downloads do not make startup appear frozen.
|
|
@@ -837,9 +857,6 @@ export class InteractiveMode {
|
|
|
837
857
|
async run() {
|
|
838
858
|
await this.init();
|
|
839
859
|
const modelCatalogError = this.session.modelRuntime.getError();
|
|
840
|
-
const modelSelectionGuidance = process.env.PI_SERVER_MODE === "true" && (!this.session.model || isUnknownModel(this.session.model))
|
|
841
|
-
? " Use /model to refresh catalogs and select a model."
|
|
842
|
-
: "";
|
|
843
860
|
if (!process.env.PI_OFFLINE) {
|
|
844
861
|
const controller = new AbortController();
|
|
845
862
|
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
@@ -849,18 +866,13 @@ export class InteractiveMode {
|
|
|
849
866
|
if (result.aborted)
|
|
850
867
|
return;
|
|
851
868
|
for (const [provider, error] of result.errors) {
|
|
852
|
-
|
|
853
|
-
modelCatalogError &&
|
|
854
|
-
this.session.modelRuntime.getError() === modelCatalogError) {
|
|
855
|
-
continue;
|
|
856
|
-
}
|
|
857
|
-
this.showWarning(`Could not refresh ${provider} model catalog: ${error.message}${provider === "pi-server" ? modelSelectionGuidance : ""}`);
|
|
869
|
+
this.showWarning(`Could not refresh ${provider} model catalog: ${error.message}`);
|
|
858
870
|
}
|
|
859
871
|
})
|
|
860
872
|
.catch((error) => {
|
|
861
873
|
if (controller.signal.aborted || (error instanceof Error && error.name === "AbortError"))
|
|
862
874
|
return;
|
|
863
|
-
this.showWarning(`Could not refresh model catalogs: ${error instanceof Error ? error.message : String(error)}
|
|
875
|
+
this.showWarning(`Could not refresh model catalogs: ${error instanceof Error ? error.message : String(error)}`);
|
|
864
876
|
})
|
|
865
877
|
.finally(() => clearTimeout(timeout));
|
|
866
878
|
}
|
|
@@ -907,7 +919,7 @@ export class InteractiveMode {
|
|
|
907
919
|
this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
|
|
908
920
|
}
|
|
909
921
|
if (modelCatalogError) {
|
|
910
|
-
this.showError(`Model catalog error: ${modelCatalogError}
|
|
922
|
+
this.showError(`Model catalog error: ${modelCatalogError}`);
|
|
911
923
|
}
|
|
912
924
|
if (modelFallbackMessage) {
|
|
913
925
|
this.showWarning(modelFallbackMessage);
|
|
@@ -1035,6 +1047,58 @@ export class InteractiveMode {
|
|
|
1035
1047
|
}
|
|
1036
1048
|
return undefined;
|
|
1037
1049
|
}
|
|
1050
|
+
getExtensionChangelogUpdates() {
|
|
1051
|
+
// Skip changelog for resumed/continued sessions (already have messages)
|
|
1052
|
+
if (this.session.state.messages.length > 0) {
|
|
1053
|
+
return [];
|
|
1054
|
+
}
|
|
1055
|
+
const seenKeys = new Set();
|
|
1056
|
+
const updates = [];
|
|
1057
|
+
for (const { sourceInfo } of this.session.resourceLoader.getExtensions().extensions) {
|
|
1058
|
+
if (sourceInfo.origin !== "package" || !sourceInfo.baseDir || !sourceInfo.changelogPath) {
|
|
1059
|
+
continue;
|
|
1060
|
+
}
|
|
1061
|
+
const key = getSourcePackageKey(sourceInfo);
|
|
1062
|
+
if (seenKeys.has(key)) {
|
|
1063
|
+
continue;
|
|
1064
|
+
}
|
|
1065
|
+
seenKeys.add(key);
|
|
1066
|
+
const pkg = this.readPackageJson(sourceInfo.baseDir);
|
|
1067
|
+
if (!pkg?.version) {
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
const lastVersion = this.settingsManager.getExtensionChangelogVersion(key);
|
|
1071
|
+
if (!lastVersion) {
|
|
1072
|
+
// Fresh install - record the version, don't show changelog
|
|
1073
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
const newEntries = getNewEntries(parseChangelog(sourceInfo.changelogPath), lastVersion);
|
|
1077
|
+
if (newEntries.length > 0) {
|
|
1078
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1079
|
+
const name = pkg.name || sourceInfo.source;
|
|
1080
|
+
// Prefix each "## [x.y.z]" heading with the package name so entries render like Pi's own.
|
|
1081
|
+
const markdown = newEntries
|
|
1082
|
+
.map((entry) => entry.content.replace(/^##\s+/, `## ${name} `))
|
|
1083
|
+
.join("\n\n")
|
|
1084
|
+
.trim();
|
|
1085
|
+
updates.push({ name, version: pkg.version, markdown });
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
return updates;
|
|
1089
|
+
}
|
|
1090
|
+
readPackageJson(packageRoot) {
|
|
1091
|
+
try {
|
|
1092
|
+
const pkg = JSON.parse(stripBom(fs.readFileSync(path.join(packageRoot, "package.json"), "utf-8")));
|
|
1093
|
+
return {
|
|
1094
|
+
name: typeof pkg.name === "string" ? pkg.name : undefined,
|
|
1095
|
+
version: typeof pkg.version === "string" ? pkg.version : undefined,
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
catch {
|
|
1099
|
+
return undefined;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1038
1102
|
reportInstallTelemetry(version) {
|
|
1039
1103
|
if (process.env.PI_OFFLINE) {
|
|
1040
1104
|
return;
|
|
@@ -1061,8 +1125,8 @@ export class InteractiveMode {
|
|
|
1061
1125
|
// Extension System
|
|
1062
1126
|
// =========================================================================
|
|
1063
1127
|
formatDisplayPath(p) {
|
|
1064
|
-
const home = os.homedir().
|
|
1065
|
-
const normalizedPath = p.
|
|
1128
|
+
const home = os.homedir().replaceAll("\\", "/").replace(/\/$/, "");
|
|
1129
|
+
const normalizedPath = p.replaceAll("\\", "/");
|
|
1066
1130
|
if (normalizedPath === home || normalizedPath.startsWith(`${home}/`)) {
|
|
1067
1131
|
return `~${normalizedPath.slice(home.length)}`;
|
|
1068
1132
|
}
|
|
@@ -1090,6 +1154,27 @@ export class InteractiveMode {
|
|
|
1090
1154
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;
|
|
1091
1155
|
}
|
|
1092
1156
|
/** Startup details (model scope, loaded resources). Hidden by quietStartup: true or "header". */
|
|
1157
|
+
getModelScopeNotice() {
|
|
1158
|
+
if (this.session.scopedModels.length === 0 || !this.shouldShowStartupDetails())
|
|
1159
|
+
return undefined;
|
|
1160
|
+
const modelList = this.session.scopedModels
|
|
1161
|
+
.map((sm) => {
|
|
1162
|
+
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
|
1163
|
+
return `${sm.model.id}${thinkingStr}`;
|
|
1164
|
+
})
|
|
1165
|
+
.join(", ");
|
|
1166
|
+
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
1167
|
+
const cycleHint = cycleKeys.length > 0
|
|
1168
|
+
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
1169
|
+
: "";
|
|
1170
|
+
return theme.fg("dim", `Model scope: ${modelList}${cycleHint}`);
|
|
1171
|
+
}
|
|
1172
|
+
showFullscreenModelScopeNotice() {
|
|
1173
|
+
if (!this.getModelScopeNotice())
|
|
1174
|
+
return;
|
|
1175
|
+
this.headerContainer.addChild(new ThemedText(() => this.getModelScopeNotice() ?? "", 1, 0));
|
|
1176
|
+
this.headerContainer.addChild(new Spacer(1));
|
|
1177
|
+
}
|
|
1093
1178
|
shouldShowStartupDetails() {
|
|
1094
1179
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() === false;
|
|
1095
1180
|
}
|
|
@@ -1460,7 +1545,7 @@ export class InteractiveMode {
|
|
|
1460
1545
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1461
1546
|
if (skillDiagnostics.length > 0) {
|
|
1462
1547
|
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1463
|
-
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill
|
|
1548
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill warnings]")}\n${warningLines()}`, 0, 0));
|
|
1464
1549
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1465
1550
|
}
|
|
1466
1551
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
@@ -2308,8 +2393,12 @@ export class InteractiveMode {
|
|
|
2308
2393
|
this.editorComponentFactory = factory;
|
|
2309
2394
|
// Save text from current editor before switching
|
|
2310
2395
|
const currentText = this.editor.getText();
|
|
2311
|
-
|
|
2312
|
-
this.
|
|
2396
|
+
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2397
|
+
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2398
|
+
if (!dialogOpen) {
|
|
2399
|
+
this.disposeActiveSelector();
|
|
2400
|
+
this.editorContainer.clear();
|
|
2401
|
+
}
|
|
2313
2402
|
if (factory) {
|
|
2314
2403
|
// Create the custom editor with tui, theme, and keybindings
|
|
2315
2404
|
const newEditor = factory(this.ui, getEditorTheme(), this.keybindings);
|
|
@@ -2360,7 +2449,8 @@ export class InteractiveMode {
|
|
|
2360
2449
|
this.defaultEditor.setText(currentText);
|
|
2361
2450
|
this.editor = this.defaultEditor;
|
|
2362
2451
|
}
|
|
2363
|
-
|
|
2452
|
+
if (!dialogOpen)
|
|
2453
|
+
this.editorContainer.addChild(this.editor);
|
|
2364
2454
|
if (this.activeStatusIndicator) {
|
|
2365
2455
|
this.statusContainer.clear();
|
|
2366
2456
|
this.activeWorkingIndicatorEmbedded = this.setEditorWorkingStatusIndicator(this.activeStatusIndicator);
|
|
@@ -2368,7 +2458,8 @@ export class InteractiveMode {
|
|
|
2368
2458
|
this.statusContainer.addChild(this.activeStatusIndicator);
|
|
2369
2459
|
}
|
|
2370
2460
|
}
|
|
2371
|
-
|
|
2461
|
+
if (!dialogOpen)
|
|
2462
|
+
this.ui.setFocus(this.editor);
|
|
2372
2463
|
this.ui.requestRender();
|
|
2373
2464
|
}
|
|
2374
2465
|
/**
|
|
@@ -2440,7 +2531,7 @@ export class InteractiveMode {
|
|
|
2440
2531
|
options?.onHandle?.(overlayHandle);
|
|
2441
2532
|
}
|
|
2442
2533
|
else {
|
|
2443
|
-
this.pushExtensionDialog(c);
|
|
2534
|
+
this.pushExtensionDialog(c, options?.blocked);
|
|
2444
2535
|
}
|
|
2445
2536
|
})
|
|
2446
2537
|
.catch((err) => {
|
|
@@ -3367,12 +3458,12 @@ export class InteractiveMode {
|
|
|
3367
3458
|
// Render user message separately if present
|
|
3368
3459
|
if (skillBlock.userMessage) {
|
|
3369
3460
|
this.chatContainer.addChild(new Spacer(1));
|
|
3370
|
-
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3461
|
+
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3371
3462
|
this.chatContainer.addChild(userComponent);
|
|
3372
3463
|
}
|
|
3373
3464
|
}
|
|
3374
3465
|
else {
|
|
3375
|
-
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3466
|
+
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3376
3467
|
this.chatContainer.addChild(userComponent);
|
|
3377
3468
|
}
|
|
3378
3469
|
if (options?.populateHistory) {
|
|
@@ -3382,7 +3473,7 @@ export class InteractiveMode {
|
|
|
3382
3473
|
break;
|
|
3383
3474
|
}
|
|
3384
3475
|
case "assistant": {
|
|
3385
|
-
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers());
|
|
3476
|
+
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3386
3477
|
this.chatContainer.addChild(assistantComponent);
|
|
3387
3478
|
break;
|
|
3388
3479
|
}
|
|
@@ -3395,7 +3486,7 @@ export class InteractiveMode {
|
|
|
3395
3486
|
}
|
|
3396
3487
|
}
|
|
3397
3488
|
}
|
|
3398
|
-
renderSessionItems(items, options = {}) {
|
|
3489
|
+
renderSessionItems(items, messageMeta, options = {}) {
|
|
3399
3490
|
this.pendingTools.clear();
|
|
3400
3491
|
const renderedPendingTools = new Map();
|
|
3401
3492
|
// Cache misses are not persisted, unlike successful cache-warming usage.
|
|
@@ -3423,7 +3514,11 @@ export class InteractiveMode {
|
|
|
3423
3514
|
const message = item;
|
|
3424
3515
|
// Assistant messages need special handling for tool calls
|
|
3425
3516
|
if (message.role === "assistant") {
|
|
3426
|
-
|
|
3517
|
+
const meta = messageMeta?.get(message);
|
|
3518
|
+
this.addMessageToChat(message, {
|
|
3519
|
+
messageId: meta?.id,
|
|
3520
|
+
timestamp: meta?.timestamp,
|
|
3521
|
+
});
|
|
3427
3522
|
// Render tool call components
|
|
3428
3523
|
for (const content of message.content) {
|
|
3429
3524
|
if (content.type === "toolCall") {
|
|
@@ -3469,7 +3564,12 @@ export class InteractiveMode {
|
|
|
3469
3564
|
}
|
|
3470
3565
|
else {
|
|
3471
3566
|
// All other messages use standard rendering
|
|
3472
|
-
|
|
3567
|
+
const meta = messageMeta?.get(message);
|
|
3568
|
+
this.addMessageToChat(message, {
|
|
3569
|
+
...options,
|
|
3570
|
+
messageId: meta?.id,
|
|
3571
|
+
timestamp: meta?.timestamp,
|
|
3572
|
+
});
|
|
3473
3573
|
}
|
|
3474
3574
|
}
|
|
3475
3575
|
for (const [toolCallId, component] of renderedPendingTools) {
|
|
@@ -3487,17 +3587,21 @@ export class InteractiveMode {
|
|
|
3487
3587
|
// Selection coordinates point into the transcript being replaced (#9311).
|
|
3488
3588
|
if (this.renderer instanceof TuiAltScreen)
|
|
3489
3589
|
this.renderer.resetTextSelection();
|
|
3590
|
+
const messageMeta = new Map();
|
|
3490
3591
|
const items = entries.flatMap((entry) => {
|
|
3491
3592
|
if (entry.type === "custom" || (entry.type === "usage" && entry.kind === "cache_warm")) {
|
|
3492
3593
|
return [entry];
|
|
3493
3594
|
}
|
|
3494
3595
|
const messages = sessionEntryToContextMessages(entry);
|
|
3596
|
+
for (const msg of messages) {
|
|
3597
|
+
messageMeta.set(msg, { id: entry.id, timestamp: entry.timestamp });
|
|
3598
|
+
}
|
|
3495
3599
|
if ((entry.type === "compaction" || entry.type === "branch_summary") && entry.usage && messages.length > 0) {
|
|
3496
3600
|
return [...messages, { type: "compaction_cost", kind: entry.type, usage: entry.usage }];
|
|
3497
3601
|
}
|
|
3498
3602
|
return messages;
|
|
3499
3603
|
});
|
|
3500
|
-
this.renderSessionItems(items, options);
|
|
3604
|
+
this.renderSessionItems(items, messageMeta, options);
|
|
3501
3605
|
}
|
|
3502
3606
|
addCacheWarmingUsage(entry) {
|
|
3503
3607
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
@@ -3681,7 +3785,14 @@ export class InteractiveMode {
|
|
|
3681
3785
|
if (options?.exitCode !== PI_CLIENT_RUNTIME_RELOAD_EXIT_CODE) {
|
|
3682
3786
|
const resumeCommand = formatResumeCommand(this.sessionManager);
|
|
3683
3787
|
if (resumeCommand) {
|
|
3684
|
-
|
|
3788
|
+
await new Promise((resolve, reject) => {
|
|
3789
|
+
process.stdout.write(`${chalk.dim("To resume this session:")} ${resumeCommand}\n`, (error) => {
|
|
3790
|
+
if (error)
|
|
3791
|
+
reject(error);
|
|
3792
|
+
else
|
|
3793
|
+
resolve();
|
|
3794
|
+
});
|
|
3795
|
+
});
|
|
3685
3796
|
}
|
|
3686
3797
|
}
|
|
3687
3798
|
process.exit(options?.exitCode ?? 0);
|
|
@@ -3952,6 +4063,9 @@ export class InteractiveMode {
|
|
|
3952
4063
|
if (result.status === "complete") {
|
|
3953
4064
|
this.editor.setText(result.content);
|
|
3954
4065
|
}
|
|
4066
|
+
else {
|
|
4067
|
+
this.showStatus(result.message);
|
|
4068
|
+
}
|
|
3955
4069
|
}
|
|
3956
4070
|
finally {
|
|
3957
4071
|
this.ui.start();
|
|
@@ -5060,7 +5174,12 @@ export class InteractiveMode {
|
|
|
5060
5174
|
id: providerId,
|
|
5061
5175
|
name: provider?.name ?? providerId,
|
|
5062
5176
|
authType: type,
|
|
5063
|
-
status: {
|
|
5177
|
+
status: {
|
|
5178
|
+
type,
|
|
5179
|
+
source: this.session.modelRuntime.isServerAccountProvider(providerId)
|
|
5180
|
+
? "pi-server account"
|
|
5181
|
+
: "stored credential",
|
|
5182
|
+
},
|
|
5064
5183
|
subscription: provider?.auth.oauth?.isSubscription === true,
|
|
5065
5184
|
};
|
|
5066
5185
|
})
|
|
@@ -5235,6 +5354,7 @@ export class InteractiveMode {
|
|
|
5235
5354
|
if (this.session.modelRuntime.hasConfiguredAuth(providerOption.id)) {
|
|
5236
5355
|
const authStatus = this.session.modelRuntime.getProviderAuthStatus(providerOption.id);
|
|
5237
5356
|
const sources = {
|
|
5357
|
+
server_account: "a pi-server account",
|
|
5238
5358
|
stored: "stored credentials",
|
|
5239
5359
|
runtime: "a runtime API key",
|
|
5240
5360
|
environment: authStatus.label ? `environment (${authStatus.label})` : "environment credentials",
|
|
@@ -5244,9 +5364,7 @@ export class InteractiveMode {
|
|
|
5244
5364
|
};
|
|
5245
5365
|
const source = authStatus.configured && authStatus.source
|
|
5246
5366
|
? sources[authStatus.source]
|
|
5247
|
-
:
|
|
5248
|
-
? "pi-server credentials"
|
|
5249
|
-
: "configured authentication";
|
|
5367
|
+
: "configured authentication";
|
|
5250
5368
|
message += `. Models remain available through ${source}.`;
|
|
5251
5369
|
}
|
|
5252
5370
|
this.showStatus(message);
|
|
@@ -5266,6 +5384,9 @@ export class InteractiveMode {
|
|
|
5266
5384
|
}
|
|
5267
5385
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
5268
5386
|
const actionLabel = authType === "oauth" ? `Logged in to ${providerName}` : `Saved API key for ${providerName}`;
|
|
5387
|
+
const credentialLocation = this.session.modelRuntime.isServerAccountProvider(providerId)
|
|
5388
|
+
? "Credentials saved on pi-server"
|
|
5389
|
+
: `Credentials saved to ${getAuthPath()}`;
|
|
5269
5390
|
const session = this.session;
|
|
5270
5391
|
// Dynamic catalogs may be empty until the first authenticated network refresh.
|
|
5271
5392
|
const deferSelection = isUnknownModel(previousModel) &&
|
|
@@ -5314,11 +5435,11 @@ export class InteractiveMode {
|
|
|
5314
5435
|
this.footer.invalidate();
|
|
5315
5436
|
this.updateEditorBorderColor();
|
|
5316
5437
|
if (selectedModel) {
|
|
5317
|
-
this.showStatus(`${actionLabel}. Selected ${selectedModel.id}.
|
|
5438
|
+
this.showStatus(`${actionLabel}. Selected ${selectedModel.id}. ${credentialLocation}`);
|
|
5318
5439
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(selectedModel);
|
|
5319
5440
|
}
|
|
5320
5441
|
else {
|
|
5321
|
-
this.showStatus(`${actionLabel}.
|
|
5442
|
+
this.showStatus(`${actionLabel}. ${credentialLocation}`);
|
|
5322
5443
|
if (selectionError) {
|
|
5323
5444
|
this.showError(selectionError);
|
|
5324
5445
|
}
|
|
@@ -5328,7 +5449,7 @@ export class InteractiveMode {
|
|
|
5328
5449
|
}
|
|
5329
5450
|
};
|
|
5330
5451
|
if (deferSelection) {
|
|
5331
|
-
this.showStatus(`${actionLabel}.
|
|
5452
|
+
this.showStatus(`${actionLabel}. ${credentialLocation}. Refreshing model catalog…`);
|
|
5332
5453
|
}
|
|
5333
5454
|
else {
|
|
5334
5455
|
await finishAuthentication();
|