@punch-bot/cli 1.5.1 → 1.5.3
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 +162 -1
- package/README.md +6 -8
- package/dist/bundle/chunks/anthropic-messages-WIBS5YKY.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-GP5GDEGO.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +7 -4
- package/dist/bundle/chunks/chunk-35EHANXE.js +2 -0
- package/dist/bundle/chunks/chunk-3IMHRFLG.js +6 -0
- package/dist/bundle/chunks/chunk-77CRE5SV.js +9 -0
- package/dist/bundle/chunks/chunk-CE33JMCE.js +861 -0
- package/dist/bundle/chunks/{chunk-MYNHUMKE.js → chunk-CXY7BILM.js} +2 -44
- package/dist/bundle/chunks/chunk-EISXNXOQ.js +41 -0
- package/dist/bundle/chunks/chunk-ENMVUQHE.js +26 -0
- package/dist/bundle/chunks/chunk-FFMDRXC4.js +10 -0
- package/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/bundle/chunks/chunk-HQH636GU.js +361 -0
- package/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/bundle/chunks/chunk-JAJLG57O.js +4 -0
- package/dist/bundle/chunks/{chunk-RROECCMX.js → chunk-LOHGXPCL.js} +2 -2
- package/dist/bundle/chunks/{chunk-CRILLKNU.js → chunk-OV2VGRRS.js} +1 -1
- package/dist/bundle/chunks/chunk-P7FPUEYA.js +2 -0
- package/dist/bundle/chunks/chunk-PDENR63J.js +16 -0
- package/dist/bundle/chunks/chunk-RHOWRSGK.js +2 -0
- package/dist/bundle/chunks/{chunk-HMPP4ECW.js → chunk-UZ3LUZDC.js} +1 -1
- package/dist/bundle/chunks/chunk-WN2D4UD4.js +2 -0
- package/dist/bundle/chunks/chunk-X4T5TGM4.js +82 -0
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/cli-OQNR6ESL.js +53 -0
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-JWAAZATQ.js → cloudflare-workers-ai-system-one-36EDUVVN.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{execute-HXULRBCI.js → execute-EHT55MW7.js} +5 -3
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-EHUU7JII.js → google-generative-ai-KA6FZCHM.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-AFMVUS5C.js → google-vertex-DXKQ4IYR.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-YVA2UOJG.js → llama-cpp-classify-676UCBOD.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-PJ56UMXO.js +5 -0
- package/dist/bundle/chunks/openai-codex-responses-DWVG7MAQ.js +10 -0
- package/dist/bundle/chunks/openai-completions-OKI6KBNP.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-GNOLFL74.js → openai-decisions-SO57QA6O.js} +1 -1
- package/dist/bundle/chunks/openai-responses-3HV234HB.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-ZTNVFSL2.js → openrouter-images-5X6D7HFS.js} +1 -1
- package/dist/bundle/chunks/pi-messages-BS5Z34RE.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-R5GXO4CV.js → runtime-74PFKASL.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-I5AHLF6T.js → typesafe-system-one-IPNULX2M.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-2Y422I6U.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 +0 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -12
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +26 -2
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/auth-login.d.ts +15 -0
- package/dist/cli/auth-login.d.ts.map +1 -0
- package/dist/cli/auth-login.js +232 -0
- package/dist/cli/auth-login.js.map +1 -0
- package/dist/cli/auth-logout.d.ts +14 -0
- package/dist/cli/auth-logout.d.ts.map +1 -0
- package/dist/cli/auth-logout.js +63 -0
- package/dist/cli/auth-logout.js.map +1 -0
- package/dist/cli/auth-terminal.d.ts +17 -0
- package/dist/cli/auth-terminal.d.ts.map +1 -0
- package/dist/cli/auth-terminal.js +63 -0
- package/dist/cli/auth-terminal.js.map +1 -0
- package/dist/cli/project-trust.js +1 -1
- package/dist/cli/project-trust.js.map +1 -1
- package/dist/config.d.ts +10 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -11
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +5 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +20 -5
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +31 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +158 -71
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +3 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +4 -37
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +11 -89
- package/dist/core/cache-warmer.js.map +1 -1
- 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 +16 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.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/template.css +9 -0
- package/dist/core/export-html/template.js +165 -45
- 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 -13
- 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/runner.d.ts +1 -4
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +0 -14
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -18
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +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/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +23 -41
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +51 -120
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1730 -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-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +36 -29
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +11 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +24 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +210 -51
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +167 -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/preferred-providers.d.ts +17 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +24 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/project-trust.d.ts +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +3 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-matching.d.ts +11 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +14 -0
- package/dist/core/provider-matching.js.map +1 -0
- package/dist/core/radius-mcp.d.ts +13 -0
- package/dist/core/radius-mcp.d.ts.map +1 -0
- package/dist/core/radius-mcp.js +29 -0
- package/dist/core/radius-mcp.js.map +1 -0
- package/dist/core/radius.d.ts +0 -3
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +0 -5
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -0
- package/dist/core/remote-catalog-provider.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 +40 -25
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +8 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +3 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts +0 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +0 -3
- package/dist/core/session-cwd.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-defaults.d.ts +1 -31
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -31
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -56
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +11 -247
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +4 -54
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +7 -101
- 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.d.ts +0 -6
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -27
- 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/telemetry.js +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/theme/theme.d.ts.map +1 -1
- package/dist/core/theme/theme.js +5 -1
- package/dist/core/theme/theme.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 +35 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -14
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +182 -41
- package/dist/core/tools/edit-diff.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 +10 -11
- 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 +82 -36
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +7 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +87 -75
- 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 +2 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +10 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +141 -25
- package/dist/core/tools/read.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/truncate.d.ts +4 -14
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +23 -29
- package/dist/core/tools/truncate.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.js +4 -4
- package/dist/extensions/codemode/execute.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 +59 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/client.d.ts +2 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +23 -2
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +1 -1
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +2 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +83 -22
- 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 +4 -7
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +5 -4
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +11 -49
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +56 -296
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/resources.d.ts +1 -1
- package/dist/extensions/mcp/resources.d.ts.map +1 -1
- package/dist/extensions/mcp/resources.js +4 -3
- package/dist/extensions/mcp/resources.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts +4 -3
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +7 -5
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/mcp/tools.d.ts +2 -23
- package/dist/extensions/mcp/tools.d.ts.map +1 -1
- package/dist/extensions/mcp/tools.js +6 -58
- package/dist/extensions/mcp/tools.js.map +1 -1
- package/dist/extensions/punch/index.d.ts.map +1 -1
- package/dist/extensions/punch/index.js +1 -1
- package/dist/extensions/punch/index.js.map +1 -1
- package/dist/extensions/punch/todos.js +1 -1
- package/dist/extensions/punch/todos.js.map +1 -1
- package/dist/extensions/subagent/index.d.ts.map +1 -1
- package/dist/extensions/subagent/index.js +278 -129
- package/dist/extensions/subagent/index.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 +122 -42
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +106 -14
- package/dist/main.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +19 -10
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +53 -23
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +94 -12
- 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/changelog.d.ts +2 -2
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +12 -9
- package/dist/utils/changelog.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/fuzzy.d.ts.map +1 -1
- package/dist/utils/fuzzy.js +59 -44
- package/dist/utils/fuzzy.js.map +1 -1
- package/dist/utils/git.d.ts +11 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +44 -0
- 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/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.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/terminal-question.d.ts +8 -0
- package/dist/utils/terminal-question.d.ts.map +1 -0
- package/dist/utils/terminal-question.js +24 -0
- package/dist/utils/terminal-question.js.map +1 -0
- package/dist/utils/text.d.ts +2 -0
- package/dist/utils/text.d.ts.map +1 -1
- package/dist/utils/text.js +5 -0
- package/dist/utils/text.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/dist/utils/web-url.d.ts +12 -0
- package/dist/utils/web-url.d.ts.map +1 -0
- package/dist/utils/web-url.js +20 -0
- package/dist/utils/web-url.js.map +1 -0
- package/docs/cli-integration.md +3 -5
- package/docs/cli.md +45 -26
- package/docs/compaction.md +9 -9
- package/docs/configuration.md +1 -2
- package/docs/containerization.md +16 -14
- package/docs/custom-provider.md +5 -3
- package/docs/docs.json +9 -9
- package/docs/environment-variables.md +5 -12
- package/docs/extensions.md +683 -757
- package/docs/how-pi-works.md +5 -5
- package/docs/index.md +5 -5
- package/docs/llama-cpp.md +41 -39
- package/docs/mcp.md +12 -10
- package/docs/message-types.md +1 -1
- package/docs/models-configuration.md +6 -1
- package/docs/models.md +18 -19
- package/docs/nvidia-rtx-llama-cpp.md +1 -1
- package/docs/packages.md +21 -1
- package/docs/prompt-templates.md +11 -9
- package/docs/providers.md +8 -8
- package/docs/quickstart.md +28 -52
- package/docs/rpc-commands.md +2 -2
- package/docs/rpc-extension-ui.md +5 -7
- package/docs/rpc.md +4 -2
- package/docs/sdk.md +1 -1
- package/docs/security.md +9 -5
- package/docs/session-format.md +7 -9
- package/docs/sessions.md +26 -26
- package/docs/settings.md +36 -67
- package/docs/shell-aliases.md +7 -7
- package/docs/skills.md +4 -4
- package/docs/slash-commands.md +50 -58
- package/docs/termux.md +8 -9
- package/docs/themes.md +21 -41
- package/docs/usage.md +59 -177
- package/docs/virtual-models.md +4 -4
- package/docs/windows.md +8 -10
- package/examples/extensions/README.md +3 -2
- 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/gondolin/package-lock.json +16 -26
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/rpc-demo.ts +2 -2
- package/examples/extensions/subagent/README.md +14 -11
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +208 -0
- package/npm-shrinkwrap.json +32 -34
- package/package.json +12 -14
- package/schemas/models.schema.json +65 -36
- package/schemas/settings.schema.json +17 -243
- package/dist/bundle/chunks/anthropic-messages-WAYXCPZL.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-LUIPKPFC.js +0 -2
- package/dist/bundle/chunks/chunk-275CIYA5.js +0 -16
- package/dist/bundle/chunks/chunk-2W2ATKZM.js +0 -2
- package/dist/bundle/chunks/chunk-3V45WARH.js +0 -7
- package/dist/bundle/chunks/chunk-4LBJE4YM.js +0 -14
- package/dist/bundle/chunks/chunk-4NE64BTO.js +0 -82
- package/dist/bundle/chunks/chunk-7SFLP7ZK.js +0 -1197
- package/dist/bundle/chunks/chunk-BQU3RKDL.js +0 -2
- package/dist/bundle/chunks/chunk-NJK3U3WK.js +0 -8
- package/dist/bundle/chunks/chunk-NQWQE4BR.js +0 -11
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +0 -2
- package/dist/bundle/chunks/chunk-TRN3ET6M.js +0 -2
- package/dist/bundle/chunks/chunk-UE7JCDFW.js +0 -2
- package/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/bundle/chunks/cli-W5KJM7YB.js +0 -51
- package/dist/bundle/chunks/mistral-conversations-FEBYNTL2.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-MI7TTP3C.js +0 -10
- package/dist/bundle/chunks/openai-completions-BVORSTAM.js +0 -7
- package/dist/bundle/chunks/openai-responses-TLIV5OQA.js +0 -4
- package/dist/bundle/chunks/pi-messages-4MVQCGGY.js +0 -8
- package/dist/bundle/chunks/virtual-modules-QK7S56IZ.js +0 -2
- package/dist/core/bug-report-upload.d.ts +0 -12
- package/dist/core/bug-report-upload.d.ts.map +0 -1
- package/dist/core/bug-report-upload.js +0 -22
- package/dist/core/bug-report-upload.js.map +0 -1
- package/dist/core/bug-report.d.ts +0 -184
- package/dist/core/bug-report.d.ts.map +0 -1
- package/dist/core/bug-report.js +0 -292
- package/dist/core/bug-report.js.map +0 -1
- package/dist/core/crash-log.d.ts +0 -27
- package/dist/core/crash-log.d.ts.map +0 -1
- package/dist/core/crash-log.js +0 -140
- package/dist/core/crash-log.js.map +0 -1
- package/dist/core/footer-data-provider.d.ts +0 -64
- package/dist/core/footer-data-provider.d.ts.map +0 -1
- package/dist/core/footer-data-provider.js +0 -338
- package/dist/core/footer-data-provider.js.map +0 -1
- package/dist/utils/zip.d.ts +0 -7
- package/dist/utils/zip.d.ts.map +0 -1
- package/dist/utils/zip.js +0 -60
- package/dist/utils/zip.js.map +0 -1
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/keybindings.md +0 -194
- package/docs/terminal-setup.md +0 -17
- package/docs/tmux.md +0 -55
- package/docs/tui.md +0 -125
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -66
- package/examples/extensions/sandbox/package.json +0 -22
|
@@ -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,22 +20,23 @@ 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;
|
|
38
|
-
|
|
38
|
+
/** Whether PI_OFFLINE is set; package installs and updates then skip all network access. */
|
|
39
|
+
export function isOfflineModeEnabled() {
|
|
39
40
|
const value = process.env.PI_OFFLINE;
|
|
40
41
|
if (!value)
|
|
41
42
|
return false;
|
|
@@ -470,6 +471,33 @@ function collectResourceFiles(dir, resourceType) {
|
|
|
470
471
|
}
|
|
471
472
|
return collectFiles(dir, FILE_PATTERNS[resourceType]);
|
|
472
473
|
}
|
|
474
|
+
// A `pi` object counts as an explicit resource manifest only when it lists resources. Packages whose
|
|
475
|
+
// `pi` object holds only metadata (changelogPath, gallery image/video) still use directory auto-discovery.
|
|
476
|
+
function hasManifestResourceFields(manifest) {
|
|
477
|
+
return RESOURCE_TYPES.some((resourceType) => manifest[resourceType] !== undefined);
|
|
478
|
+
}
|
|
479
|
+
function isPathInside(parent, child) {
|
|
480
|
+
const relativePath = relative(parent, child);
|
|
481
|
+
return (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath));
|
|
482
|
+
}
|
|
483
|
+
function resolvePackageChangelogPath(packageRoot, manifest) {
|
|
484
|
+
const changelogPath = manifest?.changelogPath ?? "CHANGELOG.md";
|
|
485
|
+
if (!changelogPath)
|
|
486
|
+
return undefined;
|
|
487
|
+
const resolvedPath = resolve(packageRoot, changelogPath);
|
|
488
|
+
if (!existsSync(resolvedPath))
|
|
489
|
+
return undefined;
|
|
490
|
+
const canonicalPackageRoot = canonicalizePath(packageRoot);
|
|
491
|
+
const canonicalChangelogPath = canonicalizePath(resolvedPath);
|
|
492
|
+
if (!isPathInside(canonicalPackageRoot, canonicalChangelogPath))
|
|
493
|
+
return undefined;
|
|
494
|
+
try {
|
|
495
|
+
return statSync(resolvedPath).isFile() ? resolvedPath : undefined;
|
|
496
|
+
}
|
|
497
|
+
catch {
|
|
498
|
+
return undefined;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
473
501
|
function matchesAnyPattern(filePath, patterns, baseDir) {
|
|
474
502
|
const rel = toPosixPath(relative(baseDir, filePath));
|
|
475
503
|
const name = basename(filePath);
|
|
@@ -715,7 +743,7 @@ export class DefaultPackageManager {
|
|
|
715
743
|
}
|
|
716
744
|
// Dedupe: project scope wins over global for same package identity
|
|
717
745
|
const packageSources = this.dedupePackages(allPackages);
|
|
718
|
-
await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
746
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
719
747
|
const globalBaseDir = this.agentDir;
|
|
720
748
|
const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
|
|
721
749
|
for (const resourceType of RESOURCE_TYPES) {
|
|
@@ -741,7 +769,7 @@ export class DefaultPackageManager {
|
|
|
741
769
|
const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
|
|
742
770
|
this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
|
|
743
771
|
}
|
|
744
|
-
return this.toResolvedPaths(accumulator);
|
|
772
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
745
773
|
}
|
|
746
774
|
async resolveExtensionSources(sources, options) {
|
|
747
775
|
const accumulator = this.createAccumulator();
|
|
@@ -753,8 +781,8 @@ export class DefaultPackageManager {
|
|
|
753
781
|
const packageSources = sources
|
|
754
782
|
.filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
|
|
755
783
|
.map((source) => ({ pkg: source, scope }));
|
|
756
|
-
await this.resolvePackageSources(packageSources, accumulator);
|
|
757
|
-
return this.toResolvedPaths(accumulator);
|
|
784
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator);
|
|
785
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
758
786
|
}
|
|
759
787
|
listConfiguredPackages() {
|
|
760
788
|
const globalSettings = this.settingsManager.getGlobalSettings();
|
|
@@ -877,17 +905,18 @@ export class DefaultPackageManager {
|
|
|
877
905
|
gitCandidates.push({ ...entry, parsed });
|
|
878
906
|
}
|
|
879
907
|
}
|
|
880
|
-
const npmCheckTasks = npmCandidates.map((entry) => async () =>
|
|
881
|
-
entry,
|
|
882
|
-
|
|
883
|
-
|
|
908
|
+
const npmCheckTasks = npmCandidates.map((entry) => async () => {
|
|
909
|
+
const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
|
|
910
|
+
return {
|
|
911
|
+
entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
|
|
912
|
+
shouldUpdate: check.shouldUpdate,
|
|
913
|
+
};
|
|
914
|
+
});
|
|
884
915
|
const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
|
|
885
916
|
const userNpmUpdates = [];
|
|
886
917
|
const projectNpmUpdates = [];
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
continue;
|
|
890
|
-
}
|
|
918
|
+
const npmUpdates = npmCheckResults.filter((result) => result.shouldUpdate);
|
|
919
|
+
for (const result of npmUpdates) {
|
|
891
920
|
if (result.entry.scope === "user") {
|
|
892
921
|
userNpmUpdates.push(result.entry);
|
|
893
922
|
}
|
|
@@ -902,27 +931,73 @@ export class DefaultPackageManager {
|
|
|
902
931
|
if (projectNpmUpdates.length > 0) {
|
|
903
932
|
tasks.push(this.updateNpmBatch(projectNpmUpdates, "project"));
|
|
904
933
|
}
|
|
934
|
+
const gitUpdates = [];
|
|
905
935
|
if (gitCandidates.length > 0) {
|
|
906
936
|
const gitTasks = gitCandidates.map((entry) => async () => this.withProgress("update", entry.source, `Updating ${entry.source}...`, async () => {
|
|
937
|
+
const targetDir = this.getGitInstallPath(entry.parsed, entry.scope);
|
|
938
|
+
const from = await this.getGitHead(targetDir);
|
|
907
939
|
await this.updateGit(entry.parsed, entry.scope);
|
|
940
|
+
const to = await this.getGitHead(targetDir);
|
|
941
|
+
if (from !== to) {
|
|
942
|
+
gitUpdates.push({ source: entry.source, type: "git", scope: entry.scope, from, to });
|
|
943
|
+
}
|
|
908
944
|
}));
|
|
909
945
|
tasks.push(this.runWithConcurrency(gitTasks, GIT_UPDATE_CONCURRENCY).then(() => { }));
|
|
910
946
|
}
|
|
911
947
|
await Promise.all(tasks);
|
|
948
|
+
const updated = [];
|
|
949
|
+
for (const { entry } of npmUpdates) {
|
|
950
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, entry.scope);
|
|
951
|
+
const to = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
952
|
+
if (to !== entry.installedVersion) {
|
|
953
|
+
updated.push({ source: entry.source, type: "npm", scope: entry.scope, from: entry.installedVersion, to });
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
// Keep git results in configured order, independent of completion order.
|
|
957
|
+
for (const entry of gitCandidates) {
|
|
958
|
+
const update = gitUpdates.find((u) => u.source === entry.source && u.scope === entry.scope);
|
|
959
|
+
if (update)
|
|
960
|
+
updated.push(update);
|
|
961
|
+
}
|
|
962
|
+
// Report each changed package, e.g. "npm:foo 1.2.0 -> 1.3.0".
|
|
963
|
+
for (const pkg of updated) {
|
|
964
|
+
const format = (value) => value === undefined ? "(none)" : pkg.type === "git" ? value.slice(0, 7) : value;
|
|
965
|
+
const scope = pkg.scope === "project" ? " (project)" : "";
|
|
966
|
+
this.emitProgress({
|
|
967
|
+
type: "result",
|
|
968
|
+
action: "update",
|
|
969
|
+
source: pkg.source,
|
|
970
|
+
message: `${pkg.source}${scope} ${format(pkg.from)} -> ${format(pkg.to)}`,
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
async getGitHead(targetDir) {
|
|
975
|
+
if (!existsSync(targetDir))
|
|
976
|
+
return undefined;
|
|
977
|
+
try {
|
|
978
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
979
|
+
cwd: targetDir,
|
|
980
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
981
|
+
});
|
|
982
|
+
return head.trim() || undefined;
|
|
983
|
+
}
|
|
984
|
+
catch {
|
|
985
|
+
return undefined;
|
|
986
|
+
}
|
|
912
987
|
}
|
|
913
988
|
async shouldUpdateNpmSource(source, scope) {
|
|
914
989
|
const installedPath = this.getManagedNpmInstallPath(source, scope);
|
|
915
990
|
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
916
991
|
if (!installedVersion) {
|
|
917
|
-
return true;
|
|
992
|
+
return { shouldUpdate: true };
|
|
918
993
|
}
|
|
919
994
|
try {
|
|
920
995
|
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
921
|
-
return gt(targetVersion, installedVersion);
|
|
996
|
+
return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
|
|
922
997
|
}
|
|
923
998
|
catch {
|
|
924
999
|
// Preserve existing update behavior when version lookup fails.
|
|
925
|
-
return true;
|
|
1000
|
+
return { shouldUpdate: true, installedVersion };
|
|
926
1001
|
}
|
|
927
1002
|
}
|
|
928
1003
|
async updateNpmBatch(sources, scope) {
|
|
@@ -935,6 +1010,29 @@ export class DefaultPackageManager {
|
|
|
935
1010
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
936
1011
|
await this.installNpmBatch(specs, scope);
|
|
937
1012
|
});
|
|
1013
|
+
this.reportUnchangedNpmUpdates(sources, scope);
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* npm can resolve stale registry metadata shortly after a publish and install the old
|
|
1017
|
+
* version without an error. Warn when an announced update did not change the installed version.
|
|
1018
|
+
*/
|
|
1019
|
+
reportUnchangedNpmUpdates(sources, scope) {
|
|
1020
|
+
for (const entry of sources) {
|
|
1021
|
+
if (!entry.installedVersion || !entry.targetVersion) {
|
|
1022
|
+
continue;
|
|
1023
|
+
}
|
|
1024
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
|
|
1025
|
+
const versionAfter = this.getInstalledNpmVersion(installedPath);
|
|
1026
|
+
if (versionAfter !== entry.installedVersion) {
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
this.emitProgress({
|
|
1030
|
+
type: "progress",
|
|
1031
|
+
action: "update",
|
|
1032
|
+
source: entry.source,
|
|
1033
|
+
message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
938
1036
|
}
|
|
939
1037
|
async installNpmBatch(specs, scope) {
|
|
940
1038
|
const installRoot = this.getNpmInstallRoot(scope, false);
|
|
@@ -998,6 +1096,7 @@ export class DefaultPackageManager {
|
|
|
998
1096
|
return results.filter((result) => result !== undefined);
|
|
999
1097
|
}
|
|
1000
1098
|
async resolvePackageSources(sources, accumulator, onMissing) {
|
|
1099
|
+
const installFailures = [];
|
|
1001
1100
|
for (const { pkg, scope } of sources) {
|
|
1002
1101
|
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
|
1003
1102
|
const filter = typeof pkg === "object" ? pkg : undefined;
|
|
@@ -1014,21 +1113,46 @@ export class DefaultPackageManager {
|
|
|
1014
1113
|
const installMissing = async () => {
|
|
1015
1114
|
if (isOfflineModeEnabled())
|
|
1016
1115
|
return false;
|
|
1017
|
-
if (
|
|
1116
|
+
if (onMissing) {
|
|
1117
|
+
const action = await onMissing(resolvedSource);
|
|
1118
|
+
if (action === "skip")
|
|
1119
|
+
return false;
|
|
1120
|
+
if (action === "error")
|
|
1121
|
+
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1122
|
+
}
|
|
1123
|
+
// A source that cannot be installed (no network, missing package, failing git prepare step)
|
|
1124
|
+
// must not abort startup. Skip its resources, like offline mode does, and report the failure.
|
|
1125
|
+
try {
|
|
1018
1126
|
await this.installParsedSource(parsed, resolvedScope);
|
|
1019
1127
|
return true;
|
|
1020
1128
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1129
|
+
catch (error) {
|
|
1130
|
+
installFailures.push({
|
|
1131
|
+
source: resolvedSource,
|
|
1132
|
+
scope: resolvedScope,
|
|
1133
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1134
|
+
});
|
|
1023
1135
|
return false;
|
|
1024
|
-
|
|
1025
|
-
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1026
|
-
await this.installParsedSource(parsed, resolvedScope);
|
|
1027
|
-
return true;
|
|
1136
|
+
}
|
|
1028
1137
|
};
|
|
1029
1138
|
if (parsed.type === "npm") {
|
|
1030
1139
|
let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
|
|
1031
1140
|
const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1141
|
+
if (!needsInstall &&
|
|
1142
|
+
resolvedScope === "temporary" &&
|
|
1143
|
+
!parsed.pinned &&
|
|
1144
|
+
(await this.npmHasAvailableUpdate(parsed, installedPath))) {
|
|
1145
|
+
// Temporary (-e) sources have no `pi update` path, so refresh unpinned ones on load like
|
|
1146
|
+
// temporary git sources. Like `pi update`, install `name@latest` for unversioned specs because a bare
|
|
1147
|
+
// `npm install name` keeps the range already saved in the temporary package.json.
|
|
1148
|
+
const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
|
|
1149
|
+
try {
|
|
1150
|
+
await this.installNpm({ ...parsed, spec }, resolvedScope, true);
|
|
1151
|
+
}
|
|
1152
|
+
catch {
|
|
1153
|
+
// Keep the cached install if the refresh fails.
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1032
1156
|
if (needsInstall) {
|
|
1033
1157
|
const installed = await installMissing();
|
|
1034
1158
|
if (!installed)
|
|
@@ -1047,14 +1171,15 @@ export class DefaultPackageManager {
|
|
|
1047
1171
|
if (!installed)
|
|
1048
1172
|
continue;
|
|
1049
1173
|
}
|
|
1050
|
-
else if (resolvedScope === "temporary" && !
|
|
1051
|
-
await this.refreshTemporaryGitSource(parsed, resolvedSource);
|
|
1174
|
+
else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
|
|
1175
|
+
await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
|
|
1052
1176
|
}
|
|
1053
1177
|
metadata.baseDir = installedPath;
|
|
1054
1178
|
metadata.packageRoot = installedPath;
|
|
1055
1179
|
this.collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
1056
1180
|
}
|
|
1057
1181
|
}
|
|
1182
|
+
return installFailures;
|
|
1058
1183
|
}
|
|
1059
1184
|
findAutoloadDeltaBase(pkg, scope, sources) {
|
|
1060
1185
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
@@ -1110,7 +1235,7 @@ export class DefaultPackageManager {
|
|
|
1110
1235
|
if (parsed.type === "git") {
|
|
1111
1236
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1112
1237
|
}
|
|
1113
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1238
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1114
1239
|
}
|
|
1115
1240
|
getSourceMatchKeyForSettings(source, scope) {
|
|
1116
1241
|
const parsed = this.parseSource(source);
|
|
@@ -1121,7 +1246,7 @@ export class DefaultPackageManager {
|
|
|
1121
1246
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1122
1247
|
}
|
|
1123
1248
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1124
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1249
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1125
1250
|
}
|
|
1126
1251
|
buildNoMatchingPackageMessage(source, configuredPackages) {
|
|
1127
1252
|
const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
|
|
@@ -1400,9 +1525,9 @@ export class DefaultPackageManager {
|
|
|
1400
1525
|
}
|
|
1401
1526
|
if (scope) {
|
|
1402
1527
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1403
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1528
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1404
1529
|
}
|
|
1405
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1530
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1406
1531
|
}
|
|
1407
1532
|
/**
|
|
1408
1533
|
* Dedupe packages: if same package identity appears in both global and project,
|
|
@@ -1493,7 +1618,7 @@ export class DefaultPackageManager {
|
|
|
1493
1618
|
"--config.strict-dep-builds=false",
|
|
1494
1619
|
];
|
|
1495
1620
|
case "npm":
|
|
1496
|
-
return ["install", "--omit=dev", "--legacy-peer-deps"];
|
|
1621
|
+
return ["install", "--omit=dev", "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1497
1622
|
default:
|
|
1498
1623
|
return ["install"];
|
|
1499
1624
|
}
|
|
@@ -1502,7 +1627,9 @@ export class DefaultPackageManager {
|
|
|
1502
1627
|
const npmCommand = this.getNpmCommand();
|
|
1503
1628
|
return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
|
|
1504
1629
|
}
|
|
1505
|
-
getNpmInstallArgs(specs,
|
|
1630
|
+
getNpmInstallArgs(specs, root) {
|
|
1631
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1632
|
+
const installRoot = existsSync(root) ? realpathSync(root) : root;
|
|
1506
1633
|
const packageManagerName = this.getPackageManagerName();
|
|
1507
1634
|
// Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
|
|
1508
1635
|
// Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
|
|
@@ -1522,7 +1649,8 @@ export class DefaultPackageManager {
|
|
|
1522
1649
|
"--config.strict-dep-builds=false",
|
|
1523
1650
|
];
|
|
1524
1651
|
}
|
|
1525
|
-
|
|
1652
|
+
// npm audit fix would run without --legacy-peer-deps and install pi peers, so skip audit advice.
|
|
1653
|
+
return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1526
1654
|
}
|
|
1527
1655
|
async installNpm(source, scope, temporary) {
|
|
1528
1656
|
const installRoot = this.getNpmInstallRoot(scope, temporary);
|
|
@@ -1530,10 +1658,12 @@ export class DefaultPackageManager {
|
|
|
1530
1658
|
await this.runNpmCommand(this.getNpmInstallArgs([source.spec], installRoot));
|
|
1531
1659
|
}
|
|
1532
1660
|
async uninstallNpm(source, scope) {
|
|
1533
|
-
const
|
|
1534
|
-
if (!existsSync(
|
|
1661
|
+
const root = this.getNpmInstallRoot(scope, false);
|
|
1662
|
+
if (!existsSync(root)) {
|
|
1535
1663
|
return;
|
|
1536
1664
|
}
|
|
1665
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1666
|
+
const installRoot = realpathSync(root);
|
|
1537
1667
|
const packageManagerName = this.getPackageManagerName();
|
|
1538
1668
|
if (packageManagerName === "bun") {
|
|
1539
1669
|
await this.runNpmCommand(["uninstall", source.name, "--cwd", installRoot]);
|
|
@@ -1541,7 +1671,7 @@ export class DefaultPackageManager {
|
|
|
1541
1671
|
}
|
|
1542
1672
|
const args = ["uninstall", source.name, "--prefix", installRoot];
|
|
1543
1673
|
if (packageManagerName !== "pnpm") {
|
|
1544
|
-
args.push("--legacy-peer-deps");
|
|
1674
|
+
args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
|
|
1545
1675
|
}
|
|
1546
1676
|
await this.runNpmCommand(args);
|
|
1547
1677
|
}
|
|
@@ -1623,20 +1753,31 @@ export class DefaultPackageManager {
|
|
|
1623
1753
|
return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
|
|
1624
1754
|
}
|
|
1625
1755
|
async cleanAndInstallGitDependencies(targetDir, markerPath) {
|
|
1626
|
-
// Clean untracked files (extensions should be pristine).
|
|
1627
|
-
//
|
|
1756
|
+
// Clean untracked files (extensions should be pristine). On Windows, files loaded by
|
|
1757
|
+
// another process (e.g. a native module of this extension in another pi session) cannot
|
|
1758
|
+
// be deleted, so git clean fails. Still install dependencies for the new commit, but keep
|
|
1759
|
+
// the marker so the next update retries the clean.
|
|
1760
|
+
let cleaned = true;
|
|
1628
1761
|
try {
|
|
1629
1762
|
await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
|
|
1630
1763
|
}
|
|
1631
1764
|
catch (error) {
|
|
1632
|
-
|
|
1633
|
-
|
|
1765
|
+
cleaned = false;
|
|
1766
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1767
|
+
this.emitProgress({
|
|
1768
|
+
type: "progress",
|
|
1769
|
+
action: "update",
|
|
1770
|
+
source: targetDir,
|
|
1771
|
+
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.`,
|
|
1772
|
+
});
|
|
1634
1773
|
}
|
|
1635
1774
|
const packageJsonPath = join(targetDir, "package.json");
|
|
1636
1775
|
if (existsSync(packageJsonPath)) {
|
|
1637
1776
|
await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
|
|
1638
1777
|
}
|
|
1639
|
-
|
|
1778
|
+
if (cleaned) {
|
|
1779
|
+
rmSync(markerPath, { force: true });
|
|
1780
|
+
}
|
|
1640
1781
|
}
|
|
1641
1782
|
async ensureGitRef(targetDir, fetchArgs, ref) {
|
|
1642
1783
|
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
@@ -1664,11 +1805,22 @@ export class DefaultPackageManager {
|
|
|
1664
1805
|
await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
|
|
1665
1806
|
await this.cleanAndInstallGitDependencies(targetDir, markerPath);
|
|
1666
1807
|
}
|
|
1667
|
-
async refreshTemporaryGitSource(source, sourceStr) {
|
|
1808
|
+
async refreshTemporaryGitSource(source, sourceStr, installedPath) {
|
|
1668
1809
|
if (isOfflineModeEnabled()) {
|
|
1669
1810
|
return;
|
|
1670
1811
|
}
|
|
1671
1812
|
try {
|
|
1813
|
+
// A ref can name a moving branch, so refresh refs too. Skip the network call only when the
|
|
1814
|
+
// ref is a commit hash that is already checked out.
|
|
1815
|
+
if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
|
|
1816
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1817
|
+
cwd: installedPath,
|
|
1818
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1819
|
+
});
|
|
1820
|
+
if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
|
|
1821
|
+
return;
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1672
1824
|
await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
|
|
1673
1825
|
await this.updateGit(source, "temporary");
|
|
1674
1826
|
});
|
|
@@ -1846,6 +1998,14 @@ export class DefaultPackageManager {
|
|
|
1846
1998
|
return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
|
|
1847
1999
|
}
|
|
1848
2000
|
collectPackageResources(packageRoot, accumulator, filter, metadata) {
|
|
2001
|
+
const manifest = readPiManifest(join(packageRoot, "package.json"));
|
|
2002
|
+
const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
|
|
2003
|
+
if (changelogPath) {
|
|
2004
|
+
metadata.changelogPath = changelogPath;
|
|
2005
|
+
}
|
|
2006
|
+
else {
|
|
2007
|
+
delete metadata.changelogPath;
|
|
2008
|
+
}
|
|
1849
2009
|
if (filter) {
|
|
1850
2010
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1851
2011
|
const patterns = filter[resourceType];
|
|
@@ -1862,8 +2022,7 @@ export class DefaultPackageManager {
|
|
|
1862
2022
|
}
|
|
1863
2023
|
return true;
|
|
1864
2024
|
}
|
|
1865
|
-
|
|
1866
|
-
if (manifest) {
|
|
2025
|
+
if (manifest && hasManifestResourceFields(manifest)) {
|
|
1867
2026
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1868
2027
|
const entries = manifest[resourceType];
|
|
1869
2028
|
this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
|
|
@@ -2023,7 +2182,7 @@ export class DefaultPackageManager {
|
|
|
2023
2182
|
const userAgentsSkillsDir = join(getHomeDir(), ".agents", "skills");
|
|
2024
2183
|
const projectTrusted = this.settingsManager.isProjectTrusted();
|
|
2025
2184
|
const projectAgentsSkillDirs = projectTrusted
|
|
2026
|
-
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) =>
|
|
2185
|
+
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) => !pathsEqual(dir, userAgentsSkillsDir))
|
|
2027
2186
|
: [];
|
|
2028
2187
|
const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
|
|
2029
2188
|
const target = this.getTargetMap(accumulator, resourceType);
|
|
@@ -2124,10 +2283,10 @@ export class DefaultPackageManager {
|
|
|
2124
2283
|
resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
|
|
2125
2284
|
const seen = new Set();
|
|
2126
2285
|
return resolved.filter((entry) => {
|
|
2127
|
-
const
|
|
2128
|
-
if (seen.has(
|
|
2286
|
+
const pathKey = getResourcePathKey(entry.path);
|
|
2287
|
+
if (seen.has(pathKey))
|
|
2129
2288
|
return false;
|
|
2130
|
-
seen.add(
|
|
2289
|
+
seen.add(pathKey);
|
|
2131
2290
|
return true;
|
|
2132
2291
|
});
|
|
2133
2292
|
};
|