@averyyy/pi-coding-agent 1.4.0-piclient.9 → 1.5.0-piclient.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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-H2AI7MFJ.js → chunk-JM6XUN2B.js} +2 -2
- package/dist/bundle/chunks/{chunk-BRYV63PL.js → chunk-LTLKVIE2.js} +8 -7
- package/dist/bundle/chunks/chunk-LXHWY6K4.js +1592 -0
- 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-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-3NEJV7UG.js → chunk-ULTM5Q67.js} +1 -1
- 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-CR5DUKA3.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
function getEnv() {
|
|
5
5
|
if (process.platform !== "linux" || Object.keys(process.env).length > 0) {
|
|
@@ -20,18 +20,18 @@ function getEnv() {
|
|
|
20
20
|
return process.env;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
23
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
24
24
|
import ignore from "ignore";
|
|
25
25
|
import { minimatch } from "minimatch";
|
|
26
26
|
import { gt, maxSatisfying, rcompare, satisfies, valid, validRange } from "semver";
|
|
27
27
|
import { CONFIG_DIR_NAME } from "../config.js";
|
|
28
28
|
import { spawnProcess, spawnProcessSync } from "../utils/child-process.js";
|
|
29
29
|
import { parseGitUrl } from "../utils/git.js";
|
|
30
|
-
import { canonicalizePath, isLocalPath, markPathIgnoredByCloudSync, normalizePath, resolvePath, } from "../utils/paths.js";
|
|
30
|
+
import { canonicalizePath, getPathComparisonKey, isLocalPath, markPathIgnoredByCloudSync, normalizePath, pathsEqual, resolvePath, } from "../utils/paths.js";
|
|
31
31
|
import { stripBom } from "../utils/text.js";
|
|
32
32
|
import { isStdoutTakenOver } from "./output-guard.js";
|
|
33
33
|
import { readPiManifest } from "./pi-manifest.js";
|
|
34
|
-
import { BUILTIN_PATH_PREFIX } from "./source-info.js";
|
|
34
|
+
import { BUILTIN_PATH_PREFIX, getResourcePathKey } from "./source-info.js";
|
|
35
35
|
const NETWORK_TIMEOUT_MS = 10000;
|
|
36
36
|
const UPDATE_CHECK_CONCURRENCY = 4;
|
|
37
37
|
const GIT_UPDATE_CONCURRENCY = 4;
|
|
@@ -470,6 +470,33 @@ function collectResourceFiles(dir, resourceType) {
|
|
|
470
470
|
}
|
|
471
471
|
return collectFiles(dir, FILE_PATTERNS[resourceType]);
|
|
472
472
|
}
|
|
473
|
+
// A `pi` object counts as an explicit resource manifest only when it lists resources. Packages whose
|
|
474
|
+
// `pi` object holds only metadata (changelogPath, gallery image/video) still use directory auto-discovery.
|
|
475
|
+
function hasManifestResourceFields(manifest) {
|
|
476
|
+
return RESOURCE_TYPES.some((resourceType) => manifest[resourceType] !== undefined);
|
|
477
|
+
}
|
|
478
|
+
function isPathInside(parent, child) {
|
|
479
|
+
const relativePath = relative(parent, child);
|
|
480
|
+
return (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath));
|
|
481
|
+
}
|
|
482
|
+
function resolvePackageChangelogPath(packageRoot, manifest) {
|
|
483
|
+
const changelogPath = manifest?.changelogPath ?? "CHANGELOG.md";
|
|
484
|
+
if (!changelogPath)
|
|
485
|
+
return undefined;
|
|
486
|
+
const resolvedPath = resolve(packageRoot, changelogPath);
|
|
487
|
+
if (!existsSync(resolvedPath))
|
|
488
|
+
return undefined;
|
|
489
|
+
const canonicalPackageRoot = canonicalizePath(packageRoot);
|
|
490
|
+
const canonicalChangelogPath = canonicalizePath(resolvedPath);
|
|
491
|
+
if (!isPathInside(canonicalPackageRoot, canonicalChangelogPath))
|
|
492
|
+
return undefined;
|
|
493
|
+
try {
|
|
494
|
+
return statSync(resolvedPath).isFile() ? resolvedPath : undefined;
|
|
495
|
+
}
|
|
496
|
+
catch {
|
|
497
|
+
return undefined;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
473
500
|
function matchesAnyPattern(filePath, patterns, baseDir) {
|
|
474
501
|
const rel = toPosixPath(relative(baseDir, filePath));
|
|
475
502
|
const name = basename(filePath);
|
|
@@ -715,7 +742,7 @@ export class DefaultPackageManager {
|
|
|
715
742
|
}
|
|
716
743
|
// Dedupe: project scope wins over global for same package identity
|
|
717
744
|
const packageSources = this.dedupePackages(allPackages);
|
|
718
|
-
await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
745
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
719
746
|
const globalBaseDir = this.agentDir;
|
|
720
747
|
const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
|
|
721
748
|
for (const resourceType of RESOURCE_TYPES) {
|
|
@@ -741,7 +768,7 @@ export class DefaultPackageManager {
|
|
|
741
768
|
const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
|
|
742
769
|
this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
|
|
743
770
|
}
|
|
744
|
-
return this.toResolvedPaths(accumulator);
|
|
771
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
745
772
|
}
|
|
746
773
|
async resolveExtensionSources(sources, options) {
|
|
747
774
|
const accumulator = this.createAccumulator();
|
|
@@ -753,8 +780,8 @@ export class DefaultPackageManager {
|
|
|
753
780
|
const packageSources = sources
|
|
754
781
|
.filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
|
|
755
782
|
.map((source) => ({ pkg: source, scope }));
|
|
756
|
-
await this.resolvePackageSources(packageSources, accumulator);
|
|
757
|
-
return this.toResolvedPaths(accumulator);
|
|
783
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator);
|
|
784
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
758
785
|
}
|
|
759
786
|
listConfiguredPackages() {
|
|
760
787
|
const globalSettings = this.settingsManager.getGlobalSettings();
|
|
@@ -877,10 +904,13 @@ export class DefaultPackageManager {
|
|
|
877
904
|
gitCandidates.push({ ...entry, parsed });
|
|
878
905
|
}
|
|
879
906
|
}
|
|
880
|
-
const npmCheckTasks = npmCandidates.map((entry) => async () =>
|
|
881
|
-
entry,
|
|
882
|
-
|
|
883
|
-
|
|
907
|
+
const npmCheckTasks = npmCandidates.map((entry) => async () => {
|
|
908
|
+
const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
|
|
909
|
+
return {
|
|
910
|
+
entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
|
|
911
|
+
shouldUpdate: check.shouldUpdate,
|
|
912
|
+
};
|
|
913
|
+
});
|
|
884
914
|
const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
|
|
885
915
|
const userNpmUpdates = [];
|
|
886
916
|
const projectNpmUpdates = [];
|
|
@@ -914,15 +944,15 @@ export class DefaultPackageManager {
|
|
|
914
944
|
const installedPath = this.getManagedNpmInstallPath(source, scope);
|
|
915
945
|
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
916
946
|
if (!installedVersion) {
|
|
917
|
-
return true;
|
|
947
|
+
return { shouldUpdate: true };
|
|
918
948
|
}
|
|
919
949
|
try {
|
|
920
950
|
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
921
|
-
return gt(targetVersion, installedVersion);
|
|
951
|
+
return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
|
|
922
952
|
}
|
|
923
953
|
catch {
|
|
924
954
|
// Preserve existing update behavior when version lookup fails.
|
|
925
|
-
return true;
|
|
955
|
+
return { shouldUpdate: true, installedVersion };
|
|
926
956
|
}
|
|
927
957
|
}
|
|
928
958
|
async updateNpmBatch(sources, scope) {
|
|
@@ -935,6 +965,29 @@ export class DefaultPackageManager {
|
|
|
935
965
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
936
966
|
await this.installNpmBatch(specs, scope);
|
|
937
967
|
});
|
|
968
|
+
this.reportUnchangedNpmUpdates(sources, scope);
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* npm can resolve stale registry metadata shortly after a publish and install the old
|
|
972
|
+
* version without an error. Warn when an announced update did not change the installed version.
|
|
973
|
+
*/
|
|
974
|
+
reportUnchangedNpmUpdates(sources, scope) {
|
|
975
|
+
for (const entry of sources) {
|
|
976
|
+
if (!entry.installedVersion || !entry.targetVersion) {
|
|
977
|
+
continue;
|
|
978
|
+
}
|
|
979
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
|
|
980
|
+
const versionAfter = this.getInstalledNpmVersion(installedPath);
|
|
981
|
+
if (versionAfter !== entry.installedVersion) {
|
|
982
|
+
continue;
|
|
983
|
+
}
|
|
984
|
+
this.emitProgress({
|
|
985
|
+
type: "progress",
|
|
986
|
+
action: "update",
|
|
987
|
+
source: entry.source,
|
|
988
|
+
message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
|
|
989
|
+
});
|
|
990
|
+
}
|
|
938
991
|
}
|
|
939
992
|
async installNpmBatch(specs, scope) {
|
|
940
993
|
const installRoot = this.getNpmInstallRoot(scope, false);
|
|
@@ -998,6 +1051,7 @@ export class DefaultPackageManager {
|
|
|
998
1051
|
return results.filter((result) => result !== undefined);
|
|
999
1052
|
}
|
|
1000
1053
|
async resolvePackageSources(sources, accumulator, onMissing) {
|
|
1054
|
+
const installFailures = [];
|
|
1001
1055
|
for (const { pkg, scope } of sources) {
|
|
1002
1056
|
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
|
1003
1057
|
const filter = typeof pkg === "object" ? pkg : undefined;
|
|
@@ -1014,21 +1068,46 @@ export class DefaultPackageManager {
|
|
|
1014
1068
|
const installMissing = async () => {
|
|
1015
1069
|
if (isOfflineModeEnabled())
|
|
1016
1070
|
return false;
|
|
1017
|
-
if (
|
|
1071
|
+
if (onMissing) {
|
|
1072
|
+
const action = await onMissing(resolvedSource);
|
|
1073
|
+
if (action === "skip")
|
|
1074
|
+
return false;
|
|
1075
|
+
if (action === "error")
|
|
1076
|
+
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1077
|
+
}
|
|
1078
|
+
// A source that cannot be installed (no network, missing package, failing git prepare step)
|
|
1079
|
+
// must not abort startup. Skip its resources, like offline mode does, and report the failure.
|
|
1080
|
+
try {
|
|
1018
1081
|
await this.installParsedSource(parsed, resolvedScope);
|
|
1019
1082
|
return true;
|
|
1020
1083
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1084
|
+
catch (error) {
|
|
1085
|
+
installFailures.push({
|
|
1086
|
+
source: resolvedSource,
|
|
1087
|
+
scope: resolvedScope,
|
|
1088
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1089
|
+
});
|
|
1023
1090
|
return false;
|
|
1024
|
-
|
|
1025
|
-
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1026
|
-
await this.installParsedSource(parsed, resolvedScope);
|
|
1027
|
-
return true;
|
|
1091
|
+
}
|
|
1028
1092
|
};
|
|
1029
1093
|
if (parsed.type === "npm") {
|
|
1030
1094
|
let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
|
|
1031
1095
|
const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1096
|
+
if (!needsInstall &&
|
|
1097
|
+
resolvedScope === "temporary" &&
|
|
1098
|
+
!parsed.pinned &&
|
|
1099
|
+
(await this.npmHasAvailableUpdate(parsed, installedPath))) {
|
|
1100
|
+
// Temporary (-e) sources have no `pi update` path, so refresh unpinned ones on load like
|
|
1101
|
+
// temporary git sources. Like `pi update`, install `name@latest` for unversioned specs because a bare
|
|
1102
|
+
// `npm install name` keeps the range already saved in the temporary package.json.
|
|
1103
|
+
const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
|
|
1104
|
+
try {
|
|
1105
|
+
await this.installNpm({ ...parsed, spec }, resolvedScope, true);
|
|
1106
|
+
}
|
|
1107
|
+
catch {
|
|
1108
|
+
// Keep the cached install if the refresh fails.
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1032
1111
|
if (needsInstall) {
|
|
1033
1112
|
const installed = await installMissing();
|
|
1034
1113
|
if (!installed)
|
|
@@ -1047,14 +1126,15 @@ export class DefaultPackageManager {
|
|
|
1047
1126
|
if (!installed)
|
|
1048
1127
|
continue;
|
|
1049
1128
|
}
|
|
1050
|
-
else if (resolvedScope === "temporary" && !
|
|
1051
|
-
await this.refreshTemporaryGitSource(parsed, resolvedSource);
|
|
1129
|
+
else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
|
|
1130
|
+
await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
|
|
1052
1131
|
}
|
|
1053
1132
|
metadata.baseDir = installedPath;
|
|
1054
1133
|
metadata.packageRoot = installedPath;
|
|
1055
1134
|
this.collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
1056
1135
|
}
|
|
1057
1136
|
}
|
|
1137
|
+
return installFailures;
|
|
1058
1138
|
}
|
|
1059
1139
|
findAutoloadDeltaBase(pkg, scope, sources) {
|
|
1060
1140
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
@@ -1110,7 +1190,7 @@ export class DefaultPackageManager {
|
|
|
1110
1190
|
if (parsed.type === "git") {
|
|
1111
1191
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1112
1192
|
}
|
|
1113
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1193
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1114
1194
|
}
|
|
1115
1195
|
getSourceMatchKeyForSettings(source, scope) {
|
|
1116
1196
|
const parsed = this.parseSource(source);
|
|
@@ -1121,7 +1201,7 @@ export class DefaultPackageManager {
|
|
|
1121
1201
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1122
1202
|
}
|
|
1123
1203
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1124
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1204
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1125
1205
|
}
|
|
1126
1206
|
buildNoMatchingPackageMessage(source, configuredPackages) {
|
|
1127
1207
|
const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
|
|
@@ -1400,9 +1480,9 @@ export class DefaultPackageManager {
|
|
|
1400
1480
|
}
|
|
1401
1481
|
if (scope) {
|
|
1402
1482
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1403
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1483
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1404
1484
|
}
|
|
1405
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1485
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1406
1486
|
}
|
|
1407
1487
|
/**
|
|
1408
1488
|
* Dedupe packages: if same package identity appears in both global and project,
|
|
@@ -1493,7 +1573,7 @@ export class DefaultPackageManager {
|
|
|
1493
1573
|
"--config.strict-dep-builds=false",
|
|
1494
1574
|
];
|
|
1495
1575
|
case "npm":
|
|
1496
|
-
return ["install", "--omit=dev", "--legacy-peer-deps"];
|
|
1576
|
+
return ["install", "--omit=dev", "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1497
1577
|
default:
|
|
1498
1578
|
return ["install"];
|
|
1499
1579
|
}
|
|
@@ -1502,7 +1582,9 @@ export class DefaultPackageManager {
|
|
|
1502
1582
|
const npmCommand = this.getNpmCommand();
|
|
1503
1583
|
return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
|
|
1504
1584
|
}
|
|
1505
|
-
getNpmInstallArgs(specs,
|
|
1585
|
+
getNpmInstallArgs(specs, root) {
|
|
1586
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1587
|
+
const installRoot = existsSync(root) ? realpathSync(root) : root;
|
|
1506
1588
|
const packageManagerName = this.getPackageManagerName();
|
|
1507
1589
|
// Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
|
|
1508
1590
|
// Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
|
|
@@ -1522,7 +1604,8 @@ export class DefaultPackageManager {
|
|
|
1522
1604
|
"--config.strict-dep-builds=false",
|
|
1523
1605
|
];
|
|
1524
1606
|
}
|
|
1525
|
-
|
|
1607
|
+
// npm audit fix would run without --legacy-peer-deps and install pi peers, so skip audit advice.
|
|
1608
|
+
return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1526
1609
|
}
|
|
1527
1610
|
async installNpm(source, scope, temporary) {
|
|
1528
1611
|
const installRoot = this.getNpmInstallRoot(scope, temporary);
|
|
@@ -1530,10 +1613,12 @@ export class DefaultPackageManager {
|
|
|
1530
1613
|
await this.runNpmCommand(this.getNpmInstallArgs([source.spec], installRoot));
|
|
1531
1614
|
}
|
|
1532
1615
|
async uninstallNpm(source, scope) {
|
|
1533
|
-
const
|
|
1534
|
-
if (!existsSync(
|
|
1616
|
+
const root = this.getNpmInstallRoot(scope, false);
|
|
1617
|
+
if (!existsSync(root)) {
|
|
1535
1618
|
return;
|
|
1536
1619
|
}
|
|
1620
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1621
|
+
const installRoot = realpathSync(root);
|
|
1537
1622
|
const packageManagerName = this.getPackageManagerName();
|
|
1538
1623
|
if (packageManagerName === "bun") {
|
|
1539
1624
|
await this.runNpmCommand(["uninstall", source.name, "--cwd", installRoot]);
|
|
@@ -1541,7 +1626,7 @@ export class DefaultPackageManager {
|
|
|
1541
1626
|
}
|
|
1542
1627
|
const args = ["uninstall", source.name, "--prefix", installRoot];
|
|
1543
1628
|
if (packageManagerName !== "pnpm") {
|
|
1544
|
-
args.push("--legacy-peer-deps");
|
|
1629
|
+
args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
|
|
1545
1630
|
}
|
|
1546
1631
|
await this.runNpmCommand(args);
|
|
1547
1632
|
}
|
|
@@ -1623,20 +1708,31 @@ export class DefaultPackageManager {
|
|
|
1623
1708
|
return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
|
|
1624
1709
|
}
|
|
1625
1710
|
async cleanAndInstallGitDependencies(targetDir, markerPath) {
|
|
1626
|
-
// Clean untracked files (extensions should be pristine).
|
|
1627
|
-
//
|
|
1711
|
+
// Clean untracked files (extensions should be pristine). On Windows, files loaded by
|
|
1712
|
+
// another process (e.g. a native module of this extension in another pi session) cannot
|
|
1713
|
+
// be deleted, so git clean fails. Still install dependencies for the new commit, but keep
|
|
1714
|
+
// the marker so the next update retries the clean.
|
|
1715
|
+
let cleaned = true;
|
|
1628
1716
|
try {
|
|
1629
1717
|
await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
|
|
1630
1718
|
}
|
|
1631
1719
|
catch (error) {
|
|
1632
|
-
|
|
1633
|
-
|
|
1720
|
+
cleaned = false;
|
|
1721
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1722
|
+
this.emitProgress({
|
|
1723
|
+
type: "progress",
|
|
1724
|
+
action: "update",
|
|
1725
|
+
source: targetDir,
|
|
1726
|
+
message: `Could not remove all untracked files in ${targetDir} (${reason}). Files may be in use by another pi session; close it and run the update again.`,
|
|
1727
|
+
});
|
|
1634
1728
|
}
|
|
1635
1729
|
const packageJsonPath = join(targetDir, "package.json");
|
|
1636
1730
|
if (existsSync(packageJsonPath)) {
|
|
1637
1731
|
await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
|
|
1638
1732
|
}
|
|
1639
|
-
|
|
1733
|
+
if (cleaned) {
|
|
1734
|
+
rmSync(markerPath, { force: true });
|
|
1735
|
+
}
|
|
1640
1736
|
}
|
|
1641
1737
|
async ensureGitRef(targetDir, fetchArgs, ref) {
|
|
1642
1738
|
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
@@ -1664,11 +1760,22 @@ export class DefaultPackageManager {
|
|
|
1664
1760
|
await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
|
|
1665
1761
|
await this.cleanAndInstallGitDependencies(targetDir, markerPath);
|
|
1666
1762
|
}
|
|
1667
|
-
async refreshTemporaryGitSource(source, sourceStr) {
|
|
1763
|
+
async refreshTemporaryGitSource(source, sourceStr, installedPath) {
|
|
1668
1764
|
if (isOfflineModeEnabled()) {
|
|
1669
1765
|
return;
|
|
1670
1766
|
}
|
|
1671
1767
|
try {
|
|
1768
|
+
// A ref can name a moving branch, so refresh refs too. Skip the network call only when the
|
|
1769
|
+
// ref is a commit hash that is already checked out.
|
|
1770
|
+
if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
|
|
1771
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1772
|
+
cwd: installedPath,
|
|
1773
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1774
|
+
});
|
|
1775
|
+
if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
|
|
1776
|
+
return;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1672
1779
|
await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
|
|
1673
1780
|
await this.updateGit(source, "temporary");
|
|
1674
1781
|
});
|
|
@@ -1846,6 +1953,14 @@ export class DefaultPackageManager {
|
|
|
1846
1953
|
return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
|
|
1847
1954
|
}
|
|
1848
1955
|
collectPackageResources(packageRoot, accumulator, filter, metadata) {
|
|
1956
|
+
const manifest = readPiManifest(join(packageRoot, "package.json"));
|
|
1957
|
+
const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
|
|
1958
|
+
if (changelogPath) {
|
|
1959
|
+
metadata.changelogPath = changelogPath;
|
|
1960
|
+
}
|
|
1961
|
+
else {
|
|
1962
|
+
delete metadata.changelogPath;
|
|
1963
|
+
}
|
|
1849
1964
|
if (filter) {
|
|
1850
1965
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1851
1966
|
const patterns = filter[resourceType];
|
|
@@ -1862,8 +1977,7 @@ export class DefaultPackageManager {
|
|
|
1862
1977
|
}
|
|
1863
1978
|
return true;
|
|
1864
1979
|
}
|
|
1865
|
-
|
|
1866
|
-
if (manifest) {
|
|
1980
|
+
if (manifest && hasManifestResourceFields(manifest)) {
|
|
1867
1981
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1868
1982
|
const entries = manifest[resourceType];
|
|
1869
1983
|
this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
|
|
@@ -2023,7 +2137,7 @@ export class DefaultPackageManager {
|
|
|
2023
2137
|
const userAgentsSkillsDir = join(getHomeDir(), ".agents", "skills");
|
|
2024
2138
|
const projectTrusted = this.settingsManager.isProjectTrusted();
|
|
2025
2139
|
const projectAgentsSkillDirs = projectTrusted
|
|
2026
|
-
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) =>
|
|
2140
|
+
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) => !pathsEqual(dir, userAgentsSkillsDir))
|
|
2027
2141
|
: [];
|
|
2028
2142
|
const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
|
|
2029
2143
|
const target = this.getTargetMap(accumulator, resourceType);
|
|
@@ -2124,10 +2238,10 @@ export class DefaultPackageManager {
|
|
|
2124
2238
|
resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
|
|
2125
2239
|
const seen = new Set();
|
|
2126
2240
|
return resolved.filter((entry) => {
|
|
2127
|
-
const
|
|
2128
|
-
if (seen.has(
|
|
2241
|
+
const pathKey = getResourcePathKey(entry.path);
|
|
2242
|
+
if (seen.has(pathKey))
|
|
2129
2243
|
return false;
|
|
2130
|
-
seen.add(
|
|
2244
|
+
seen.add(pathKey);
|
|
2131
2245
|
return true;
|
|
2132
2246
|
});
|
|
2133
2247
|
};
|