pi-namespace-patch 1.3.0-namespace.1 → 1.5.0-namespace.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 +172 -0
- package/README.md +5 -5
- package/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-FSC6BAW3.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +12 -9
- package/dist/bundle/chunks/chunk-36QC74V4.js +2 -0
- package/dist/bundle/chunks/{chunk-RXG5KZNJ.js → chunk-3BE6TOTE.js} +1 -1
- package/dist/bundle/chunks/{chunk-AKJ3ZOR3.js → chunk-3TGLJEWK.js} +1 -1
- package/dist/bundle/chunks/chunk-4EYXVSA5.js +129 -0
- package/dist/bundle/chunks/{chunk-S3GGRYIO.js → chunk-5AGIVGSV.js} +1 -1
- package/dist/bundle/chunks/{chunk-RH6M5TBT.js → chunk-62VOPMLK.js} +8 -7
- package/dist/bundle/chunks/{chunk-F5ZABL6Z.js → chunk-7CBJINYJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-DRQDKNXA.js → chunk-7DDKXS2Q.js} +1 -1
- package/dist/bundle/chunks/chunk-7O7QKK6A.js +2 -0
- package/dist/bundle/chunks/chunk-AXIQEITU.js +1234 -0
- package/dist/bundle/chunks/{chunk-2LOB3CBH.js → chunk-B46VJEHW.js} +3 -3
- package/dist/bundle/chunks/chunk-C2WU32PX.js +2 -0
- package/dist/bundle/chunks/{chunk-H3QXYIF7.js → chunk-CF5GWZHW.js} +1 -1
- package/dist/bundle/chunks/chunk-CHWNPHIS.js +82 -0
- package/dist/bundle/chunks/chunk-EOO47QGR.js +2 -0
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/bundle/chunks/chunk-GN3QYODH.js +16 -0
- package/dist/bundle/chunks/{chunk-4L3WN2XY.js → chunk-JXWJOIH4.js} +1 -1
- package/dist/bundle/chunks/{chunk-6CYCI3EJ.js → chunk-LVVZS2NO.js} +1 -1
- package/dist/bundle/chunks/chunk-NL4X6LBY.js +4 -0
- package/dist/bundle/chunks/chunk-NZY7EIPA.js +4 -0
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/bundle/chunks/{chunk-5GTPJSRI.js → chunk-R2EGYMOO.js} +3 -3
- package/dist/bundle/chunks/{chunk-ZBURYEWF.js → chunk-TMTOQ7H7.js} +1 -1
- package/dist/bundle/chunks/{chunk-22CYIUS4.js → chunk-UKVNB6C4.js} +1 -1
- package/dist/bundle/chunks/chunk-V6KH5QG4.js +9 -0
- package/dist/bundle/chunks/chunk-VOLAXWGI.js +2 -0
- package/dist/bundle/chunks/chunk-YZKQS34S.js +9 -0
- package/dist/bundle/chunks/{cli-SWM4FQ6V.js → cli-MCOUW5WS.js} +11 -9
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-WLAFJSP6.js +2 -0
- package/dist/bundle/chunks/{easter-egg-3d-OX6RUCIS.js → easter-egg-3d-WMBNSJ4M.js} +1 -1
- package/dist/bundle/chunks/{execute-HXNYK3DM.js → execute-4CEBORGZ.js} +9 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-INGKNW72.js +2 -0
- package/dist/bundle/chunks/google-vertex-IBTX6MBF.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-LVOO5TPL.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{jiti-loader-C3NU2SDH.js → jiti-loader-GL4HJFAD.js} +1 -1
- package/dist/bundle/chunks/{jiti-static-loader-E6ANQD5T.js → jiti-static-loader-2RCDI6B4.js} +1 -1
- package/dist/bundle/chunks/kimi-coding.js +1 -1
- package/dist/bundle/chunks/{lib-TEDK3E5I.js → lib-4AVRLBHM.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-FYN623RH.js → llama-cpp-classify-V5U3QKXI.js} +2 -2
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-S4OWXIXQ.js +5 -0
- package/dist/bundle/chunks/{multipart-parser-SQ6GDJL7.js → multipart-parser-FMGQ7342.js} +1 -1
- package/dist/bundle/chunks/{node-TWVVAGPO.js → node-AUOGOBCN.js} +1 -1
- package/dist/bundle/chunks/{node-N5BSDOA5.js → node-KCMANYC2.js} +1 -1
- package/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +10 -0
- package/dist/bundle/chunks/openai-completions-EJNYB6IX.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-WVPMQ4JD.js → openai-decisions-IXI34BYG.js} +1 -1
- package/dist/bundle/chunks/openai-responses-MD3562FB.js +4 -0
- package/dist/bundle/chunks/openrouter-images-PISKSFMS.js +2 -0
- package/dist/bundle/chunks/pi-messages-NORUKF4E.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-366HE7CW.js → runtime-FQB7RU7U.js} +1 -1
- package/dist/bundle/chunks/{src-UK77SYZE.js → src-QKGKDFSU.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-CHVC2UUI.js +2 -0
- package/dist/bundle/chunks/virtual-modules-ZVUPOVM4.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/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 +11 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +60 -13
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/client-identity.d.ts +8 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +15 -0
- package/dist/core/client-identity.js.map +1 -0
- 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 +17 -6
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -15
- package/dist/core/compaction/compaction.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 +104 -60
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +167 -46
- 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/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- 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 +10 -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 +11 -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 +1783 -1219
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +50 -27
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +23 -17
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +6 -3
- 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 +165 -51
- 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/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +7 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +39 -24
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +11 -10
- 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 +4 -2
- 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.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +2 -7
- 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/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +99 -24
- package/dist/extensions/codemode/execute.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/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.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 +15 -8
- 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 +16 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +16 -15
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +221 -153
- 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 +57 -5
- 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 +7 -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/pi-user-agent.d.ts +1 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js +3 -2
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +59 -13
- 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 +34 -38
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +21 -11
- package/docs/codemode.md +2 -2
- package/docs/compaction.md +3 -3
- package/docs/custom-provider.md +55 -1
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +3 -0
- package/docs/extensions.md +3222 -152
- 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/models-configuration.md +196 -0
- package/docs/models.md +21 -5
- package/docs/packages.md +24 -0
- package/docs/quickstart.md +7 -3
- package/docs/sessions.md +11 -3
- package/docs/settings.md +6 -5
- package/docs/slash-commands.md +3 -2
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +72 -0
- package/docs/windows.md +43 -2
- 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 +14 -14
- package/schemas/models.schema.json +119 -65
- package/schemas/settings.schema.json +17 -0
- package/dist/bundle/chunks/anthropic-messages-UIH6DSZT.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-KZZFKCXW.js +0 -2
- package/dist/bundle/chunks/chunk-2JW42LFQ.js +0 -2
- package/dist/bundle/chunks/chunk-3ZATHNCK.js +0 -9
- package/dist/bundle/chunks/chunk-6MWTY2OB.js +0 -130
- package/dist/bundle/chunks/chunk-DOST5PQW.js +0 -82
- package/dist/bundle/chunks/chunk-GDR5JFDJ.js +0 -4
- package/dist/bundle/chunks/chunk-H2VI33AU.js +0 -1220
- package/dist/bundle/chunks/chunk-HACVPRBJ.js +0 -11
- package/dist/bundle/chunks/chunk-ITZNWD4K.js +0 -2
- package/dist/bundle/chunks/chunk-PYGXRV27.js +0 -7
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
- package/dist/bundle/chunks/chunk-UCKJ6OH5.js +0 -11
- package/dist/bundle/chunks/chunk-WJUNYZC5.js +0 -2
- package/dist/bundle/chunks/chunk-XIX7LUWI.js +0 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-UTBL2KOF.js +0 -2
- package/dist/bundle/chunks/google-generative-ai-KJOKBJM3.js +0 -2
- package/dist/bundle/chunks/google-vertex-VCLZ36OB.js +0 -2
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +0 -13
- package/dist/bundle/chunks/mistral-conversations-AMQJ43DD.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-ZYGHVE5B.js +0 -10
- package/dist/bundle/chunks/openai-completions-BGCEXFAB.js +0 -7
- package/dist/bundle/chunks/openai-responses-KCCCXI3B.js +0 -3
- package/dist/bundle/chunks/openrouter-images-DUPG5DZO.js +0 -2
- package/dist/bundle/chunks/pi-messages-V27DSLVC.js +0 -8
- package/dist/bundle/chunks/typesafe-system-one-ZSK3RN4B.js +0 -2
- package/dist/bundle/chunks/virtual-modules-ZXBODXVN.js +0 -2
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -72
- package/dist/core/provider-attribution.js.map +0 -1
- 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
|
@@ -29,6 +29,7 @@ import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID } from "../../core/radius.js";
|
|
|
29
29
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
30
30
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
31
31
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
32
|
+
import { getSourcePackageKey } from "../../core/source-info.js";
|
|
32
33
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
33
34
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
34
35
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
@@ -39,10 +40,11 @@ import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../.
|
|
|
39
40
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
40
41
|
import { parseGitUrl } from "../../utils/git.js";
|
|
41
42
|
import { ensurePngTranscoder } from "../../utils/image-convert.js";
|
|
42
|
-
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
43
|
+
import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
|
|
43
44
|
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
44
45
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
45
46
|
import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
|
|
47
|
+
import { stripBom } from "../../utils/text.js";
|
|
46
48
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
47
49
|
import { checkForNewPiVersion } from "../../utils/version-check.js";
|
|
48
50
|
import { reportBug } from "./bug-report.js";
|
|
@@ -274,6 +276,7 @@ export class InteractiveMode {
|
|
|
274
276
|
lastSigintTime = 0;
|
|
275
277
|
lastEscapeTime = 0;
|
|
276
278
|
changelogMarkdown = undefined;
|
|
279
|
+
extensionChangelogUpdates = [];
|
|
277
280
|
startupNoticesShown = false;
|
|
278
281
|
anthropicSubscriptionWarningShown = false;
|
|
279
282
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
@@ -321,9 +324,9 @@ export class InteractiveMode {
|
|
|
321
324
|
bugReportHintShown = false;
|
|
322
325
|
installChangeWarningShown = false;
|
|
323
326
|
// Extension UI state
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
+
// Extension dialogs shown in the editor slot (select, confirm, input, editor, inline custom).
|
|
328
|
+
// The last entry is visible; see pushExtensionDialog().
|
|
329
|
+
extensionDialogs = [];
|
|
327
330
|
extensionTerminalInputSubscriptions = new Set();
|
|
328
331
|
// Extension widgets (components rendered above/below the editor)
|
|
329
332
|
extensionWidgetsAbove = new Map();
|
|
@@ -573,24 +576,44 @@ export class InteractiveMode {
|
|
|
573
576
|
return;
|
|
574
577
|
}
|
|
575
578
|
this.startupNoticesShown = true;
|
|
576
|
-
if (!this.changelogMarkdown) {
|
|
579
|
+
if (!this.changelogMarkdown && this.extensionChangelogUpdates.length === 0) {
|
|
577
580
|
return;
|
|
578
581
|
}
|
|
579
582
|
if (this.chatContainer.children.length > 0) {
|
|
580
583
|
this.chatContainer.addChild(new Spacer(1));
|
|
581
584
|
}
|
|
582
585
|
this.chatContainer.addChild(new DynamicBorder());
|
|
583
|
-
if (this.
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
if (this.changelogMarkdown) {
|
|
587
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
588
|
+
const versionMatch = this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/);
|
|
589
|
+
const latestVersion = versionMatch ? versionMatch[1] : this.version;
|
|
590
|
+
const condensedText = `Updated to v${latestVersion}. Use ${theme.bold("/changelog")} to view full changelog.`;
|
|
591
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
595
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
596
|
+
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
597
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
598
|
+
}
|
|
588
599
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
this.
|
|
600
|
+
if (this.extensionChangelogUpdates.length > 0) {
|
|
601
|
+
if (this.changelogMarkdown) {
|
|
602
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
603
|
+
}
|
|
604
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
605
|
+
const condensedText = this.extensionChangelogUpdates
|
|
606
|
+
.map((update) => `Updated ${update.name} to v${update.version}.`)
|
|
607
|
+
.join("\n");
|
|
608
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Extension Updates")), 1, 0));
|
|
612
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
613
|
+
const markdown = this.extensionChangelogUpdates.map((update) => update.markdown).join("\n\n");
|
|
614
|
+
this.chatContainer.addChild(new Markdown(markdown, 1, 0, this.getMarkdownThemeWithSettings()));
|
|
615
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
616
|
+
}
|
|
594
617
|
}
|
|
595
618
|
this.chatContainer.addChild(new DynamicBorder());
|
|
596
619
|
}
|
|
@@ -667,20 +690,15 @@ export class InteractiveMode {
|
|
|
667
690
|
if (this.isInitialized)
|
|
668
691
|
return;
|
|
669
692
|
this.registerSignalHandlers();
|
|
670
|
-
// Load
|
|
693
|
+
// Load changelogs (only show new entries, skip for resumed sessions)
|
|
671
694
|
this.changelogMarkdown = this.getChangelogForDisplay();
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
.
|
|
679
|
-
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
680
|
-
const cycleHint = cycleKeys.length > 0
|
|
681
|
-
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
682
|
-
: "";
|
|
683
|
-
console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`));
|
|
695
|
+
this.extensionChangelogUpdates = this.getExtensionChangelogUpdates();
|
|
696
|
+
// Fullscreen renders on the alternate screen, so text printed to stdout here would stay in the shell
|
|
697
|
+
// after exit. Fullscreen shows the notice in the header instead (#11508).
|
|
698
|
+
if (this.renderer.mode !== "fullscreen") {
|
|
699
|
+
const modelScopeNotice = this.getModelScopeNotice();
|
|
700
|
+
if (modelScopeNotice)
|
|
701
|
+
console.log(modelScopeNotice);
|
|
684
702
|
}
|
|
685
703
|
// Keep one component tree and remount it when changing renderers.
|
|
686
704
|
this.renderWidgets(); // Initialize with default spacer
|
|
@@ -780,6 +798,8 @@ export class InteractiveMode {
|
|
|
780
798
|
this.builtInHeader = new Text("", 0, 0);
|
|
781
799
|
this.headerContainer.addChild(this.builtInHeader);
|
|
782
800
|
}
|
|
801
|
+
if (this.renderer.mode === "fullscreen")
|
|
802
|
+
this.showFullscreenModelScopeNotice();
|
|
783
803
|
this.ui.requestRender();
|
|
784
804
|
// Ensure fd and rg are available after mounting the TUI (downloads if missing, adds to PATH via getBinDir)
|
|
785
805
|
// so slow downloads do not make startup appear frozen.
|
|
@@ -1017,6 +1037,58 @@ export class InteractiveMode {
|
|
|
1017
1037
|
}
|
|
1018
1038
|
return undefined;
|
|
1019
1039
|
}
|
|
1040
|
+
getExtensionChangelogUpdates() {
|
|
1041
|
+
// Skip changelog for resumed/continued sessions (already have messages)
|
|
1042
|
+
if (this.session.state.messages.length > 0) {
|
|
1043
|
+
return [];
|
|
1044
|
+
}
|
|
1045
|
+
const seenKeys = new Set();
|
|
1046
|
+
const updates = [];
|
|
1047
|
+
for (const { sourceInfo } of this.session.resourceLoader.getExtensions().extensions) {
|
|
1048
|
+
if (sourceInfo.origin !== "package" || !sourceInfo.baseDir || !sourceInfo.changelogPath) {
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
const key = getSourcePackageKey(sourceInfo);
|
|
1052
|
+
if (seenKeys.has(key)) {
|
|
1053
|
+
continue;
|
|
1054
|
+
}
|
|
1055
|
+
seenKeys.add(key);
|
|
1056
|
+
const pkg = this.readPackageJson(sourceInfo.baseDir);
|
|
1057
|
+
if (!pkg?.version) {
|
|
1058
|
+
continue;
|
|
1059
|
+
}
|
|
1060
|
+
const lastVersion = this.settingsManager.getExtensionChangelogVersion(key);
|
|
1061
|
+
if (!lastVersion) {
|
|
1062
|
+
// Fresh install - record the version, don't show changelog
|
|
1063
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1064
|
+
continue;
|
|
1065
|
+
}
|
|
1066
|
+
const newEntries = getNewEntries(parseChangelog(sourceInfo.changelogPath), lastVersion);
|
|
1067
|
+
if (newEntries.length > 0) {
|
|
1068
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1069
|
+
const name = pkg.name || sourceInfo.source;
|
|
1070
|
+
// Prefix each "## [x.y.z]" heading with the package name so entries render like Pi's own.
|
|
1071
|
+
const markdown = newEntries
|
|
1072
|
+
.map((entry) => entry.content.replace(/^##\s+/, `## ${name} `))
|
|
1073
|
+
.join("\n\n")
|
|
1074
|
+
.trim();
|
|
1075
|
+
updates.push({ name, version: pkg.version, markdown });
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return updates;
|
|
1079
|
+
}
|
|
1080
|
+
readPackageJson(packageRoot) {
|
|
1081
|
+
try {
|
|
1082
|
+
const pkg = JSON.parse(stripBom(fs.readFileSync(path.join(packageRoot, "package.json"), "utf-8")));
|
|
1083
|
+
return {
|
|
1084
|
+
name: typeof pkg.name === "string" ? pkg.name : undefined,
|
|
1085
|
+
version: typeof pkg.version === "string" ? pkg.version : undefined,
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
catch {
|
|
1089
|
+
return undefined;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1020
1092
|
reportInstallTelemetry(version) {
|
|
1021
1093
|
if (process.env.PI_OFFLINE) {
|
|
1022
1094
|
return;
|
|
@@ -1043,13 +1115,7 @@ export class InteractiveMode {
|
|
|
1043
1115
|
// Extension System
|
|
1044
1116
|
// =========================================================================
|
|
1045
1117
|
formatDisplayPath(p) {
|
|
1046
|
-
|
|
1047
|
-
let result = p;
|
|
1048
|
-
// Replace home directory with ~
|
|
1049
|
-
if (result.startsWith(home)) {
|
|
1050
|
-
result = `~${result.slice(home.length)}`;
|
|
1051
|
-
}
|
|
1052
|
-
return result;
|
|
1118
|
+
return shortenHomePath(p);
|
|
1053
1119
|
}
|
|
1054
1120
|
formatExtensionDisplayPath(path) {
|
|
1055
1121
|
let result = this.formatDisplayPath(path);
|
|
@@ -1073,6 +1139,27 @@ export class InteractiveMode {
|
|
|
1073
1139
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;
|
|
1074
1140
|
}
|
|
1075
1141
|
/** Startup details (model scope, loaded resources). Hidden by quietStartup: true or "header". */
|
|
1142
|
+
getModelScopeNotice() {
|
|
1143
|
+
if (this.session.scopedModels.length === 0 || !this.shouldShowStartupDetails())
|
|
1144
|
+
return undefined;
|
|
1145
|
+
const modelList = this.session.scopedModels
|
|
1146
|
+
.map((sm) => {
|
|
1147
|
+
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
|
1148
|
+
return `${sm.model.id}${thinkingStr}`;
|
|
1149
|
+
})
|
|
1150
|
+
.join(", ");
|
|
1151
|
+
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
1152
|
+
const cycleHint = cycleKeys.length > 0
|
|
1153
|
+
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
1154
|
+
: "";
|
|
1155
|
+
return theme.fg("dim", `Model scope: ${modelList}${cycleHint}`);
|
|
1156
|
+
}
|
|
1157
|
+
showFullscreenModelScopeNotice() {
|
|
1158
|
+
if (!this.getModelScopeNotice())
|
|
1159
|
+
return;
|
|
1160
|
+
this.headerContainer.addChild(new ThemedText(() => this.getModelScopeNotice() ?? "", 1, 0));
|
|
1161
|
+
this.headerContainer.addChild(new Spacer(1));
|
|
1162
|
+
}
|
|
1076
1163
|
shouldShowStartupDetails() {
|
|
1077
1164
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() === false;
|
|
1078
1165
|
}
|
|
@@ -1443,7 +1530,7 @@ export class InteractiveMode {
|
|
|
1443
1530
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1444
1531
|
if (skillDiagnostics.length > 0) {
|
|
1445
1532
|
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1446
|
-
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill
|
|
1533
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill warnings]")}\n${warningLines()}`, 0, 0));
|
|
1447
1534
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1448
1535
|
}
|
|
1449
1536
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
@@ -1906,14 +1993,12 @@ export class InteractiveMode {
|
|
|
1906
1993
|
this.renderWidgets();
|
|
1907
1994
|
}
|
|
1908
1995
|
resetExtensionUI() {
|
|
1909
|
-
if (this.
|
|
1910
|
-
this.
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
this.
|
|
1914
|
-
|
|
1915
|
-
if (this.extensionEditor) {
|
|
1916
|
-
this.hideExtensionEditor();
|
|
1996
|
+
if (this.extensionDialogs.length > 0) {
|
|
1997
|
+
for (const dialog of this.extensionDialogs) {
|
|
1998
|
+
dialog.component.dispose?.();
|
|
1999
|
+
}
|
|
2000
|
+
this.extensionDialogs = [];
|
|
2001
|
+
this.showTopExtensionDialog();
|
|
1917
2002
|
}
|
|
1918
2003
|
this.ui.hideOverlay();
|
|
1919
2004
|
this.clearExtensionTerminalInputListeners();
|
|
@@ -2113,6 +2198,35 @@ export class InteractiveMode {
|
|
|
2113
2198
|
setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
|
|
2114
2199
|
};
|
|
2115
2200
|
}
|
|
2201
|
+
/**
|
|
2202
|
+
* Show an extension dialog in the editor slot.
|
|
2203
|
+
* Dialogs form a stack: a new dialog hides the visible one, and closing the visible dialog shows
|
|
2204
|
+
* the previous one again. Every dialog stays answerable, so no dialog promise is left pending,
|
|
2205
|
+
* and dialogs opened from inside another dialog (for example a confirm from a custom component) work.
|
|
2206
|
+
*/
|
|
2207
|
+
pushExtensionDialog(component, blocked) {
|
|
2208
|
+
this.disposeActiveSelector();
|
|
2209
|
+
this.extensionDialogs.push({ component, blocked });
|
|
2210
|
+
this.showTopExtensionDialog();
|
|
2211
|
+
}
|
|
2212
|
+
/** Remove an extension dialog. If it was visible, show the previous dialog or the editor. */
|
|
2213
|
+
removeExtensionDialog(component) {
|
|
2214
|
+
const index = this.extensionDialogs.findIndex((dialog) => dialog.component === component);
|
|
2215
|
+
if (index === -1)
|
|
2216
|
+
return;
|
|
2217
|
+
this.extensionDialogs.splice(index, 1);
|
|
2218
|
+
if (index === this.extensionDialogs.length)
|
|
2219
|
+
this.showTopExtensionDialog();
|
|
2220
|
+
}
|
|
2221
|
+
showTopExtensionDialog() {
|
|
2222
|
+
const top = this.extensionDialogs.at(-1);
|
|
2223
|
+
const component = top?.component ?? this.editor;
|
|
2224
|
+
this.editorContainer.clear();
|
|
2225
|
+
this.editorContainer.addChild(component);
|
|
2226
|
+
this.ui.setFocus(component);
|
|
2227
|
+
this.programStatus.setBlocked("extension-dialog", top?.blocked);
|
|
2228
|
+
this.ui.requestRender();
|
|
2229
|
+
}
|
|
2116
2230
|
/**
|
|
2117
2231
|
* Show a selector for extensions.
|
|
2118
2232
|
*/
|
|
@@ -2122,41 +2236,18 @@ export class InteractiveMode {
|
|
|
2122
2236
|
resolve(undefined);
|
|
2123
2237
|
return;
|
|
2124
2238
|
}
|
|
2125
|
-
const
|
|
2126
|
-
this.hideExtensionSelector();
|
|
2127
|
-
resolve(undefined);
|
|
2128
|
-
};
|
|
2129
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2130
|
-
this.extensionSelector = new ExtensionSelectorComponent(title, options, (option) => {
|
|
2239
|
+
const finish = (option) => {
|
|
2131
2240
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2132
|
-
|
|
2241
|
+
selector.dispose();
|
|
2242
|
+
this.removeExtensionDialog(selector);
|
|
2133
2243
|
resolve(option);
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
this.disposeActiveSelector();
|
|
2140
|
-
this.editorContainer.clear();
|
|
2141
|
-
this.editorContainer.addChild(this.extensionSelector);
|
|
2142
|
-
this.ui.setFocus(this.extensionSelector);
|
|
2143
|
-
// Extension dialogs share the editor slot: opening one replaces the status of a displaced one.
|
|
2144
|
-
this.programStatus.setBlocked("extension-dialog", blocked);
|
|
2145
|
-
this.ui.requestRender();
|
|
2244
|
+
};
|
|
2245
|
+
const onAbort = () => finish(undefined);
|
|
2246
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2247
|
+
const selector = new ExtensionSelectorComponent(title, options, (option) => finish(option), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
|
|
2248
|
+
this.pushExtensionDialog(selector, blocked);
|
|
2146
2249
|
});
|
|
2147
2250
|
}
|
|
2148
|
-
/**
|
|
2149
|
-
* Hide the extension selector.
|
|
2150
|
-
*/
|
|
2151
|
-
hideExtensionSelector() {
|
|
2152
|
-
this.extensionSelector?.dispose();
|
|
2153
|
-
this.editorContainer.clear();
|
|
2154
|
-
this.editorContainer.addChild(this.editor);
|
|
2155
|
-
this.extensionSelector = undefined;
|
|
2156
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2157
|
-
this.ui.setFocus(this.editor);
|
|
2158
|
-
this.ui.requestRender();
|
|
2159
|
-
}
|
|
2160
2251
|
/**
|
|
2161
2252
|
* Show a confirmation dialog for extensions.
|
|
2162
2253
|
*/
|
|
@@ -2180,71 +2271,31 @@ export class InteractiveMode {
|
|
|
2180
2271
|
resolve(undefined);
|
|
2181
2272
|
return;
|
|
2182
2273
|
}
|
|
2183
|
-
const
|
|
2184
|
-
this.hideExtensionInput();
|
|
2185
|
-
resolve(undefined);
|
|
2186
|
-
};
|
|
2187
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2188
|
-
this.extensionInput = new ExtensionInputComponent(title, placeholder, (value) => {
|
|
2274
|
+
const finish = (value) => {
|
|
2189
2275
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2190
|
-
|
|
2276
|
+
input.dispose();
|
|
2277
|
+
this.removeExtensionDialog(input);
|
|
2191
2278
|
resolve(value);
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
this.disposeActiveSelector();
|
|
2198
|
-
this.editorContainer.clear();
|
|
2199
|
-
this.editorContainer.addChild(this.extensionInput);
|
|
2200
|
-
this.ui.setFocus(this.extensionInput);
|
|
2201
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2202
|
-
this.ui.requestRender();
|
|
2279
|
+
};
|
|
2280
|
+
const onAbort = () => finish(undefined);
|
|
2281
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2282
|
+
const input = new ExtensionInputComponent(title, placeholder, (value) => finish(value), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout });
|
|
2283
|
+
this.pushExtensionDialog(input, { kind: "question", message: title });
|
|
2203
2284
|
});
|
|
2204
2285
|
}
|
|
2205
|
-
/**
|
|
2206
|
-
* Hide the extension input.
|
|
2207
|
-
*/
|
|
2208
|
-
hideExtensionInput() {
|
|
2209
|
-
this.extensionInput?.dispose();
|
|
2210
|
-
this.editorContainer.clear();
|
|
2211
|
-
this.editorContainer.addChild(this.editor);
|
|
2212
|
-
this.extensionInput = undefined;
|
|
2213
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2214
|
-
this.ui.setFocus(this.editor);
|
|
2215
|
-
this.ui.requestRender();
|
|
2216
|
-
}
|
|
2217
2286
|
/**
|
|
2218
2287
|
* Show a multi-line editor for extensions (with Ctrl+G support).
|
|
2219
2288
|
*/
|
|
2220
2289
|
showExtensionEditor(title, prefill) {
|
|
2221
2290
|
return new Promise((resolve) => {
|
|
2222
|
-
|
|
2223
|
-
this.
|
|
2291
|
+
const finish = (value) => {
|
|
2292
|
+
this.removeExtensionDialog(editor);
|
|
2224
2293
|
resolve(value);
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
}, undefined, this.settingsManager.getExternalEditorCommand());
|
|
2229
|
-
this.disposeActiveSelector();
|
|
2230
|
-
this.editorContainer.clear();
|
|
2231
|
-
this.editorContainer.addChild(this.extensionEditor);
|
|
2232
|
-
this.ui.setFocus(this.extensionEditor);
|
|
2233
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2234
|
-
this.ui.requestRender();
|
|
2294
|
+
};
|
|
2295
|
+
const editor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => finish(value), () => finish(undefined), undefined, this.settingsManager.getExternalEditorCommand());
|
|
2296
|
+
this.pushExtensionDialog(editor, { kind: "question", message: title });
|
|
2235
2297
|
});
|
|
2236
2298
|
}
|
|
2237
|
-
/**
|
|
2238
|
-
* Hide the extension editor.
|
|
2239
|
-
*/
|
|
2240
|
-
hideExtensionEditor() {
|
|
2241
|
-
this.editorContainer.clear();
|
|
2242
|
-
this.editorContainer.addChild(this.editor);
|
|
2243
|
-
this.extensionEditor = undefined;
|
|
2244
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2245
|
-
this.ui.setFocus(this.editor);
|
|
2246
|
-
this.ui.requestRender();
|
|
2247
|
-
}
|
|
2248
2299
|
/**
|
|
2249
2300
|
* Set a custom editor component from an extension.
|
|
2250
2301
|
* Pass undefined to restore the default editor.
|
|
@@ -2253,8 +2304,12 @@ export class InteractiveMode {
|
|
|
2253
2304
|
this.editorComponentFactory = factory;
|
|
2254
2305
|
// Save text from current editor before switching
|
|
2255
2306
|
const currentText = this.editor.getText();
|
|
2256
|
-
|
|
2257
|
-
this.
|
|
2307
|
+
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2308
|
+
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2309
|
+
if (!dialogOpen) {
|
|
2310
|
+
this.disposeActiveSelector();
|
|
2311
|
+
this.editorContainer.clear();
|
|
2312
|
+
}
|
|
2258
2313
|
if (factory) {
|
|
2259
2314
|
// Create the custom editor with tui, theme, and keybindings
|
|
2260
2315
|
const newEditor = factory(this.ui, getEditorTheme(), this.keybindings);
|
|
@@ -2305,7 +2360,8 @@ export class InteractiveMode {
|
|
|
2305
2360
|
this.defaultEditor.setText(currentText);
|
|
2306
2361
|
this.editor = this.defaultEditor;
|
|
2307
2362
|
}
|
|
2308
|
-
|
|
2363
|
+
if (!dialogOpen)
|
|
2364
|
+
this.editorContainer.addChild(this.editor);
|
|
2309
2365
|
if (this.activeStatusIndicator) {
|
|
2310
2366
|
this.statusContainer.clear();
|
|
2311
2367
|
this.activeWorkingIndicatorEmbedded = this.setEditorWorkingStatusIndicator(this.activeStatusIndicator);
|
|
@@ -2313,7 +2369,8 @@ export class InteractiveMode {
|
|
|
2313
2369
|
this.statusContainer.addChild(this.activeStatusIndicator);
|
|
2314
2370
|
}
|
|
2315
2371
|
}
|
|
2316
|
-
|
|
2372
|
+
if (!dialogOpen)
|
|
2373
|
+
this.ui.setFocus(this.editor);
|
|
2317
2374
|
this.ui.requestRender();
|
|
2318
2375
|
}
|
|
2319
2376
|
/**
|
|
@@ -2334,17 +2391,16 @@ export class InteractiveMode {
|
|
|
2334
2391
|
async showExtensionCustom(factory, options) {
|
|
2335
2392
|
const savedText = this.editor.getText();
|
|
2336
2393
|
const isOverlay = options?.overlay ?? false;
|
|
2337
|
-
const restoreEditor = () => {
|
|
2338
|
-
this.editorContainer.clear();
|
|
2339
|
-
this.editorContainer.addChild(this.editor);
|
|
2340
|
-
this.editor.setText(savedText);
|
|
2341
|
-
this.ui.setFocus(this.editor);
|
|
2342
|
-
this.ui.requestRender();
|
|
2343
|
-
};
|
|
2344
2394
|
return new Promise((resolve, reject) => {
|
|
2345
2395
|
let component;
|
|
2346
2396
|
let overlayHandle;
|
|
2347
2397
|
let closed = false;
|
|
2398
|
+
const restoreEditor = () => {
|
|
2399
|
+
if (component)
|
|
2400
|
+
this.removeExtensionDialog(component);
|
|
2401
|
+
this.editor.setText(savedText);
|
|
2402
|
+
this.ui.requestRender();
|
|
2403
|
+
};
|
|
2348
2404
|
const close = (result) => {
|
|
2349
2405
|
if (closed)
|
|
2350
2406
|
return;
|
|
@@ -2378,19 +2434,15 @@ export class InteractiveMode {
|
|
|
2378
2434
|
return opts;
|
|
2379
2435
|
}
|
|
2380
2436
|
// Fallback: use component's width property if available
|
|
2381
|
-
const w =
|
|
2437
|
+
const w = c.width;
|
|
2382
2438
|
return w ? { width: w } : undefined;
|
|
2383
2439
|
};
|
|
2384
|
-
overlayHandle = this.ui.showOverlay(
|
|
2440
|
+
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2385
2441
|
// Expose handle to caller for visibility control
|
|
2386
2442
|
options?.onHandle?.(overlayHandle);
|
|
2387
2443
|
}
|
|
2388
2444
|
else {
|
|
2389
|
-
this.
|
|
2390
|
-
this.editorContainer.clear();
|
|
2391
|
-
this.editorContainer.addChild(component);
|
|
2392
|
-
this.ui.setFocus(component);
|
|
2393
|
-
this.ui.requestRender();
|
|
2445
|
+
this.pushExtensionDialog(c, options?.blocked);
|
|
2394
2446
|
}
|
|
2395
2447
|
})
|
|
2396
2448
|
.catch((err) => {
|
|
@@ -3211,12 +3263,12 @@ export class InteractiveMode {
|
|
|
3211
3263
|
// Render user message separately if present
|
|
3212
3264
|
if (skillBlock.userMessage) {
|
|
3213
3265
|
this.chatContainer.addChild(new Spacer(1));
|
|
3214
|
-
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3266
|
+
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3215
3267
|
this.chatContainer.addChild(userComponent);
|
|
3216
3268
|
}
|
|
3217
3269
|
}
|
|
3218
3270
|
else {
|
|
3219
|
-
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3271
|
+
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3220
3272
|
this.chatContainer.addChild(userComponent);
|
|
3221
3273
|
}
|
|
3222
3274
|
if (options?.populateHistory) {
|
|
@@ -3226,7 +3278,7 @@ export class InteractiveMode {
|
|
|
3226
3278
|
break;
|
|
3227
3279
|
}
|
|
3228
3280
|
case "assistant": {
|
|
3229
|
-
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers());
|
|
3281
|
+
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3230
3282
|
this.chatContainer.addChild(assistantComponent);
|
|
3231
3283
|
break;
|
|
3232
3284
|
}
|
|
@@ -3239,7 +3291,7 @@ export class InteractiveMode {
|
|
|
3239
3291
|
}
|
|
3240
3292
|
}
|
|
3241
3293
|
}
|
|
3242
|
-
renderSessionItems(items, options = {}) {
|
|
3294
|
+
renderSessionItems(items, messageMeta, options = {}) {
|
|
3243
3295
|
this.pendingTools.clear();
|
|
3244
3296
|
const renderedPendingTools = new Map();
|
|
3245
3297
|
// Cache misses are not persisted, unlike successful cache-warming usage.
|
|
@@ -3267,7 +3319,11 @@ export class InteractiveMode {
|
|
|
3267
3319
|
const message = item;
|
|
3268
3320
|
// Assistant messages need special handling for tool calls
|
|
3269
3321
|
if (message.role === "assistant") {
|
|
3270
|
-
|
|
3322
|
+
const meta = messageMeta?.get(message);
|
|
3323
|
+
this.addMessageToChat(message, {
|
|
3324
|
+
messageId: meta?.id,
|
|
3325
|
+
timestamp: meta?.timestamp,
|
|
3326
|
+
});
|
|
3271
3327
|
// Render tool call components
|
|
3272
3328
|
for (const content of message.content) {
|
|
3273
3329
|
if (content.type === "toolCall") {
|
|
@@ -3313,7 +3369,12 @@ export class InteractiveMode {
|
|
|
3313
3369
|
}
|
|
3314
3370
|
else {
|
|
3315
3371
|
// All other messages use standard rendering
|
|
3316
|
-
|
|
3372
|
+
const meta = messageMeta?.get(message);
|
|
3373
|
+
this.addMessageToChat(message, {
|
|
3374
|
+
...options,
|
|
3375
|
+
messageId: meta?.id,
|
|
3376
|
+
timestamp: meta?.timestamp,
|
|
3377
|
+
});
|
|
3317
3378
|
}
|
|
3318
3379
|
}
|
|
3319
3380
|
for (const [toolCallId, component] of renderedPendingTools) {
|
|
@@ -3331,17 +3392,21 @@ export class InteractiveMode {
|
|
|
3331
3392
|
// Selection coordinates point into the transcript being replaced (#9311).
|
|
3332
3393
|
if (this.renderer instanceof TuiAltScreen)
|
|
3333
3394
|
this.renderer.resetTextSelection();
|
|
3395
|
+
const messageMeta = new Map();
|
|
3334
3396
|
const items = entries.flatMap((entry) => {
|
|
3335
3397
|
if (entry.type === "custom" || (entry.type === "usage" && entry.kind === "cache_warm")) {
|
|
3336
3398
|
return [entry];
|
|
3337
3399
|
}
|
|
3338
3400
|
const messages = sessionEntryToContextMessages(entry);
|
|
3401
|
+
for (const msg of messages) {
|
|
3402
|
+
messageMeta.set(msg, { id: entry.id, timestamp: entry.timestamp });
|
|
3403
|
+
}
|
|
3339
3404
|
if ((entry.type === "compaction" || entry.type === "branch_summary") && entry.usage && messages.length > 0) {
|
|
3340
3405
|
return [...messages, { type: "compaction_cost", kind: entry.type, usage: entry.usage }];
|
|
3341
3406
|
}
|
|
3342
3407
|
return messages;
|
|
3343
3408
|
});
|
|
3344
|
-
this.renderSessionItems(items, options);
|
|
3409
|
+
this.renderSessionItems(items, messageMeta, options);
|
|
3345
3410
|
}
|
|
3346
3411
|
addCacheWarmingUsage(entry) {
|
|
3347
3412
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
@@ -3790,6 +3855,9 @@ export class InteractiveMode {
|
|
|
3790
3855
|
if (result.status === "complete") {
|
|
3791
3856
|
this.editor.setText(result.content);
|
|
3792
3857
|
}
|
|
3858
|
+
else {
|
|
3859
|
+
this.showStatus(result.message);
|
|
3860
|
+
}
|
|
3793
3861
|
}
|
|
3794
3862
|
finally {
|
|
3795
3863
|
this.ui.start();
|