@astralyn/pi 1.4.11 → 1.5.0
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 +73 -0
- package/dist/bundle/chunks/anthropic-messages-G5ZGBHOH.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-EMPTMYNF.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +22 -15
- package/dist/bundle/chunks/chunk-AXX7FFFD.js +2 -0
- package/dist/bundle/chunks/chunk-FNGB3ASD.js +2 -0
- package/dist/bundle/chunks/chunk-FPALVF3F.js +4 -0
- package/dist/bundle/chunks/chunk-H3UF54OB.js +9 -0
- package/dist/bundle/chunks/chunk-IC6JXX2J.js +10 -0
- package/dist/bundle/chunks/{chunk-TH3QDDPD.js → chunk-IRUUTK4W.js} +1 -1
- package/dist/bundle/chunks/{chunk-MZJC45TM.js → chunk-J7L6O5XA.js} +3 -3
- package/dist/bundle/chunks/{chunk-DLVLAQEG.js → chunk-KBFO53OG.js} +3 -3
- package/dist/bundle/chunks/{chunk-TPVFPFJP.js → chunk-P7VXFB2M.js} +1 -1
- package/dist/bundle/chunks/chunk-PSYLMRL6.js +9 -0
- package/dist/bundle/chunks/chunk-QNZARXLE.js +82 -0
- package/dist/bundle/chunks/chunk-R3YHAMWH.js +1503 -0
- package/dist/bundle/chunks/chunk-RAIYJ5FC.js +4 -0
- package/dist/bundle/chunks/{chunk-OV2VMHBX.js → chunk-SR6EWNPW.js} +1 -1
- package/dist/bundle/chunks/chunk-TA3YH2ZI.js +16 -0
- package/dist/bundle/chunks/{chunk-NUQMVNKQ.js → chunk-THAJ4BZF.js} +58 -62
- package/dist/bundle/chunks/{chunk-24FY4C5S.js → chunk-TRSJS3FM.js} +1 -1
- package/dist/bundle/chunks/chunk-ZRI3ICDE.js +2 -0
- package/dist/bundle/chunks/{cli-MBFCFGI2.js → cli-LAZQG54B.js} +11 -9
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-7BKATOEJ.js → cloudflare-workers-ai-system-one-4L2ABUJE.js} +1 -1
- package/dist/bundle/chunks/{execute-VLAIP26K.js → execute-ACWDKC3C.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-HTUSU45F.js → google-generative-ai-OOVDGS5W.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-AVQV4P76.js → google-vertex-IK5RNG7J.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-27QYLJZY.js → llama-cpp-classify-XHAVT37C.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-Z56KY4OJ.js +5 -0
- package/dist/bundle/chunks/{openai-codex-responses-Q25MHDFX.js → openai-codex-responses-5NAH3SK6.js} +1 -1
- package/dist/bundle/chunks/openai-completions-S7S6PO3J.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-3WYFPGSK.js → openai-decisions-7A36EAHE.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-E4BNZIQK.js → openai-responses-ZQRZJKH4.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-CBP3OPOD.js → openrouter-images-X7PX72ON.js} +1 -1
- package/dist/bundle/chunks/pi-messages-TXNWPLI4.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-3RPOJS5T.js → runtime-X3XOMNXQ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-BNICP2LS.js → typesafe-system-one-XJGMSHWL.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-T2KLVAFL.js +2 -0
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -7
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -5
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +0 -5
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +12 -28
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +21 -14
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +67 -93
- package/dist/core/agent-session.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/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/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +5 -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/runner.d.ts +0 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +7 -12
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +41 -23
- 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-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +16 -10
- package/dist/core/model-resolver.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/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/quiescence.d.ts +24 -0
- package/dist/core/quiescence.d.ts.map +1 -0
- package/dist/core/quiescence.js +81 -0
- package/dist/core/quiescence.js.map +1 -0
- 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 +41 -28
- package/dist/core/resource-loader.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-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-command-name.d.ts +6 -0
- package/dist/core/slash-command-name.d.ts.map +1 -0
- package/dist/core/slash-command-name.js +11 -0
- package/dist/core/slash-command-name.js.map +1 -0
- 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/tasks/codec.d.ts +14 -0
- package/dist/core/tasks/codec.d.ts.map +1 -1
- package/dist/core/tasks/codec.js +57 -4
- package/dist/core/tasks/codec.js.map +1 -1
- package/dist/core/tasks/record.d.ts +1 -7
- package/dist/core/tasks/record.d.ts.map +1 -1
- package/dist/core/tasks/record.js +0 -18
- package/dist/core/tasks/record.js.map +1 -1
- package/dist/core/tasks/reminder.d.ts +3 -2
- package/dist/core/tasks/reminder.d.ts.map +1 -1
- package/dist/core/tasks/reminder.js +4 -3
- package/dist/core/tasks/reminder.js.map +1 -1
- package/dist/core/tasks/runtime.d.ts +0 -2
- package/dist/core/tasks/runtime.d.ts.map +1 -1
- package/dist/core/tasks/runtime.js +2 -15
- package/dist/core/tasks/runtime.js.map +1 -1
- package/dist/core/tasks/session.d.ts +9 -2
- package/dist/core/tasks/session.d.ts.map +1 -1
- package/dist/core/tasks/session.js +23 -9
- package/dist/core/tasks/session.js.map +1 -1
- package/dist/core/tasks/types.d.ts +1 -18
- package/dist/core/tasks/types.d.ts.map +1 -1
- package/dist/core/tasks/types.js +1 -1
- package/dist/core/tasks/types.js.map +1 -1
- package/dist/core/tools/bash.d.ts +8 -7
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +6 -5
- 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/powershell.d.ts +1 -5
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -6
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +19 -41
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +3 -25
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +18 -19
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/shell-execution.d.ts +20 -13
- package/dist/core/tools/shell-execution.d.ts.map +1 -1
- package/dist/core/tools/shell-execution.js +165 -183
- package/dist/core/tools/shell-execution.js.map +1 -1
- package/dist/core/tools/shell-tool.d.ts +9 -14
- package/dist/core/tools/shell-tool.d.ts.map +1 -1
- package/dist/core/tools/shell-tool.js +38 -66
- package/dist/core/tools/shell-tool.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -4
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -3
- 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 +30 -13
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts +0 -9
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +24 -91
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/agent/activity-lines.d.ts +2 -3
- package/dist/extensions/agent/activity-lines.d.ts.map +1 -1
- package/dist/extensions/agent/activity-lines.js +5 -9
- package/dist/extensions/agent/activity-lines.js.map +1 -1
- package/dist/extensions/agent/activity.d.ts +0 -2
- package/dist/extensions/agent/activity.d.ts.map +1 -1
- package/dist/extensions/agent/activity.js +1 -1
- package/dist/extensions/agent/activity.js.map +1 -1
- package/dist/extensions/agent/progress.d.ts +0 -3
- package/dist/extensions/agent/progress.d.ts.map +1 -1
- package/dist/extensions/agent/progress.js +2 -8
- package/dist/extensions/agent/progress.js.map +1 -1
- package/dist/extensions/agent/render.js +1 -1
- package/dist/extensions/agent/render.js.map +1 -1
- package/dist/extensions/agent/tool.d.ts.map +1 -1
- package/dist/extensions/agent/tool.js +0 -6
- package/dist/extensions/agent/tool.js.map +1 -1
- package/dist/{core/isolated-session.d.ts → extensions/agent/worker-session.d.ts} +6 -6
- package/dist/extensions/agent/worker-session.d.ts.map +1 -0
- package/dist/{core/isolated-session.js → extensions/agent/worker-session.js} +9 -9
- package/dist/extensions/agent/worker-session.js.map +1 -0
- package/dist/extensions/agent/worker.d.ts +0 -3
- package/dist/extensions/agent/worker.d.ts.map +1 -1
- package/dist/extensions/agent/worker.js +2 -3
- package/dist/extensions/agent/worker.js.map +1 -1
- package/dist/extensions/btw/agent.d.ts.map +1 -1
- package/dist/extensions/btw/agent.js +2 -1
- package/dist/extensions/btw/agent.js.map +1 -1
- package/dist/extensions/cached-compaction/render.d.ts.map +1 -1
- package/dist/extensions/cached-compaction/render.js +3 -3
- package/dist/extensions/cached-compaction/render.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/deepwiki/schema.d.ts.map +1 -1
- package/dist/extensions/deepwiki/schema.js +1 -1
- package/dist/extensions/deepwiki/schema.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/run-summary/index.d.ts +1 -1
- package/dist/extensions/run-summary/index.d.ts.map +1 -1
- package/dist/extensions/run-summary/index.js +11 -23
- package/dist/extensions/run-summary/index.js.map +1 -1
- package/dist/extensions/statusline/usage.d.ts.map +1 -1
- package/dist/extensions/statusline/usage.js +2 -1
- package/dist/extensions/statusline/usage.js.map +1 -1
- package/dist/extensions/tasks/tool/schema.d.ts.map +1 -1
- package/dist/extensions/tasks/tool/schema.js +1 -1
- package/dist/extensions/tasks/tool/schema.js.map +1 -1
- package/dist/extensions/tasks/ui/completion-render.d.ts +5 -1
- package/dist/extensions/tasks/ui/completion-render.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/completion-render.js +25 -70
- package/dist/extensions/tasks/ui/completion-render.js.map +1 -1
- package/dist/extensions/tasks/ui/inspector.d.ts +1 -1
- package/dist/extensions/tasks/ui/inspector.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/inspector.js +0 -6
- package/dist/extensions/tasks/ui/inspector.js.map +1 -1
- package/dist/extensions/tasks/ui/manager.d.ts +1 -1
- package/dist/extensions/tasks/ui/manager.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/manager.js.map +1 -1
- package/dist/extensions/tasks/ui/views.d.ts +2 -4
- package/dist/extensions/tasks/ui/views.d.ts.map +1 -1
- package/dist/extensions/tasks/ui/views.js +3 -7
- package/dist/extensions/tasks/ui/views.js.map +1 -1
- package/dist/extensions/tool-presentation/fallback.d.ts.map +1 -0
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.js +5 -5
- package/dist/extensions/tool-presentation/fallback.js.map +1 -0
- package/dist/extensions/tool-presentation/index.js +1 -1
- package/dist/extensions/tool-presentation/index.js.map +1 -1
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.d.ts +1 -1
- package/dist/extensions/tool-presentation/shell.d.ts.map +1 -0
- package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/shell.js +3 -3
- package/dist/extensions/tool-presentation/shell.js.map +1 -0
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +15 -8
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +5 -3
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +61 -45
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector-skills.d.ts +54 -0
- package/dist/modes/interactive/components/config-selector-skills.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector-skills.js +178 -0
- package/dist/modes/interactive/components/config-selector-skills.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +2 -11
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +31 -181
- 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 +103 -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 +15 -23
- 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 +7 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +48 -9
- 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 +4 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/editor-host.d.ts.map +1 -1
- package/dist/modes/interactive/editor-host.js +3 -2
- package/dist/modes/interactive/editor-host.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 +17 -5
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +8 -12
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +169 -112
- 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 +30 -23
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tool-view/chat.d.ts +2 -2
- package/dist/modes/interactive/tool-view/chat.d.ts.map +1 -1
- package/dist/modes/interactive/tool-view/chat.js +22 -19
- package/dist/modes/interactive/tool-view/chat.js.map +1 -1
- package/dist/modes/interactive/transcript-layout.d.ts +2 -0
- package/dist/modes/interactive/transcript-layout.d.ts.map +1 -1
- package/dist/modes/interactive/transcript-layout.js +5 -2
- package/dist/modes/interactive/transcript-layout.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +9 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +23 -23
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +0 -3
- 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 +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/dist/utils/usage.d.ts +5 -0
- package/dist/utils/usage.d.ts.map +1 -0
- package/dist/utils/usage.js +16 -0
- package/dist/utils/usage.js.map +1 -0
- package/docs/bundled/README.md +1 -1
- package/docs/bundled/extensions/agent.md +5 -5
- package/docs/bundled/extensions/run-summary.md +4 -4
- package/docs/bundled/tasks.md +2 -4
- package/docs/bundled/tool-presentation.md +2 -2
- package/docs/custom-provider.md +1 -1
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +36 -21
- package/docs/keybindings.md +1 -1
- package/docs/llama-cpp.md +17 -12
- package/docs/mcp.md +6 -4
- package/docs/packages.md +26 -1
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +7 -5
- package/docs/session-format.md +2 -2
- package/docs/sessions.md +10 -0
- package/docs/settings.md +5 -4
- package/docs/terminal-setup.md +2 -2
- package/docs/tmux.md +6 -0
- package/docs/tui.md +12 -7
- package/docs/usage.md +19 -9
- package/docs/windows.md +29 -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/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +9 -9
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +17 -0
- package/dist/bundle/chunks/anthropic-messages-HWL6AS7T.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-4YYPDYV5.js +0 -2
- package/dist/bundle/chunks/chunk-6JS2SOFO.js +0 -11
- package/dist/bundle/chunks/chunk-ANCZPKX7.js +0 -2
- package/dist/bundle/chunks/chunk-FEZ5RM2B.js +0 -2
- package/dist/bundle/chunks/chunk-LPF7HQ3S.js +0 -4
- package/dist/bundle/chunks/chunk-MMNIHCU7.js +0 -2
- package/dist/bundle/chunks/chunk-PUU43PDV.js +0 -1484
- package/dist/bundle/chunks/chunk-R267VV5T.js +0 -82
- package/dist/bundle/chunks/chunk-RVKT7OUB.js +0 -9
- package/dist/bundle/chunks/chunk-SA2AQYEI.js +0 -7
- package/dist/bundle/chunks/chunk-ZAIGBRV5.js +0 -16
- package/dist/bundle/chunks/mistral-conversations-V2JJTMJ5.js +0 -5
- package/dist/bundle/chunks/openai-completions-TXZXILJR.js +0 -7
- package/dist/bundle/chunks/pi-messages-LBJQ4NGP.js +0 -8
- package/dist/bundle/chunks/virtual-modules-63XNTSVN.js +0 -2
- package/dist/core/isolated-session.d.ts.map +0 -1
- package/dist/core/isolated-session.js.map +0 -1
- package/dist/modes/interactive/tool-view/fallback.d.ts.map +0 -1
- package/dist/modes/interactive/tool-view/fallback.js.map +0 -1
- package/dist/modes/interactive/tool-view/shell.d.ts.map +0 -1
- package/dist/modes/interactive/tool-view/shell.js.map +0 -1
- package/dist/utils/path-identity.d.ts +0 -12
- package/dist/utils/path-identity.d.ts.map +0 -1
- package/dist/utils/path-identity.js +0 -63
- package/dist/utils/path-identity.js.map +0 -1
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/sandbox/package.json +0 -19
- /package/dist/{modes/interactive/tool-view → extensions/tool-presentation}/fallback.d.ts +0 -0
|
@@ -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);
|
|
@@ -708,7 +735,7 @@ export class DefaultPackageManager {
|
|
|
708
735
|
}
|
|
709
736
|
// Dedupe: project scope wins over global for same package identity
|
|
710
737
|
const packageSources = this.dedupePackages(allPackages);
|
|
711
|
-
await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
738
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
712
739
|
const globalBaseDir = this.agentDir;
|
|
713
740
|
const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
|
|
714
741
|
for (const resourceType of RESOURCE_TYPES) {
|
|
@@ -734,7 +761,7 @@ export class DefaultPackageManager {
|
|
|
734
761
|
const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
|
|
735
762
|
this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
|
|
736
763
|
}
|
|
737
|
-
return this.toResolvedPaths(accumulator);
|
|
764
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
738
765
|
}
|
|
739
766
|
async resolveExtensionSources(sources, options) {
|
|
740
767
|
const accumulator = this.createAccumulator();
|
|
@@ -746,8 +773,8 @@ export class DefaultPackageManager {
|
|
|
746
773
|
const packageSources = sources
|
|
747
774
|
.filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
|
|
748
775
|
.map((source) => ({ pkg: source, scope }));
|
|
749
|
-
await this.resolvePackageSources(packageSources, accumulator);
|
|
750
|
-
return this.toResolvedPaths(accumulator);
|
|
776
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator);
|
|
777
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
751
778
|
}
|
|
752
779
|
listConfiguredPackages() {
|
|
753
780
|
const globalSettings = this.settingsManager.getGlobalSettings();
|
|
@@ -870,10 +897,13 @@ export class DefaultPackageManager {
|
|
|
870
897
|
gitCandidates.push({ ...entry, parsed });
|
|
871
898
|
}
|
|
872
899
|
}
|
|
873
|
-
const npmCheckTasks = npmCandidates.map((entry) => async () =>
|
|
874
|
-
entry,
|
|
875
|
-
|
|
876
|
-
|
|
900
|
+
const npmCheckTasks = npmCandidates.map((entry) => async () => {
|
|
901
|
+
const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
|
|
902
|
+
return {
|
|
903
|
+
entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
|
|
904
|
+
shouldUpdate: check.shouldUpdate,
|
|
905
|
+
};
|
|
906
|
+
});
|
|
877
907
|
const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
|
|
878
908
|
const userNpmUpdates = [];
|
|
879
909
|
const projectNpmUpdates = [];
|
|
@@ -907,15 +937,15 @@ export class DefaultPackageManager {
|
|
|
907
937
|
const installedPath = this.getManagedNpmInstallPath(source, scope);
|
|
908
938
|
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
909
939
|
if (!installedVersion) {
|
|
910
|
-
return true;
|
|
940
|
+
return { shouldUpdate: true };
|
|
911
941
|
}
|
|
912
942
|
try {
|
|
913
943
|
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
914
|
-
return gt(targetVersion, installedVersion);
|
|
944
|
+
return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
|
|
915
945
|
}
|
|
916
946
|
catch {
|
|
917
947
|
// Preserve existing update behavior when version lookup fails.
|
|
918
|
-
return true;
|
|
948
|
+
return { shouldUpdate: true, installedVersion };
|
|
919
949
|
}
|
|
920
950
|
}
|
|
921
951
|
async updateNpmBatch(sources, scope) {
|
|
@@ -928,6 +958,29 @@ export class DefaultPackageManager {
|
|
|
928
958
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
929
959
|
await this.installNpmBatch(specs, scope);
|
|
930
960
|
});
|
|
961
|
+
this.reportUnchangedNpmUpdates(sources, scope);
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* npm can resolve stale registry metadata shortly after a publish and install the old
|
|
965
|
+
* version without an error. Warn when an announced update did not change the installed version.
|
|
966
|
+
*/
|
|
967
|
+
reportUnchangedNpmUpdates(sources, scope) {
|
|
968
|
+
for (const entry of sources) {
|
|
969
|
+
if (!entry.installedVersion || !entry.targetVersion) {
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
|
|
973
|
+
const versionAfter = this.getInstalledNpmVersion(installedPath);
|
|
974
|
+
if (versionAfter !== entry.installedVersion) {
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
977
|
+
this.emitProgress({
|
|
978
|
+
type: "progress",
|
|
979
|
+
action: "update",
|
|
980
|
+
source: entry.source,
|
|
981
|
+
message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
|
|
982
|
+
});
|
|
983
|
+
}
|
|
931
984
|
}
|
|
932
985
|
async installNpmBatch(specs, scope) {
|
|
933
986
|
const installRoot = this.getNpmInstallRoot(scope, false);
|
|
@@ -991,6 +1044,7 @@ export class DefaultPackageManager {
|
|
|
991
1044
|
return results.filter((result) => result !== undefined);
|
|
992
1045
|
}
|
|
993
1046
|
async resolvePackageSources(sources, accumulator, onMissing) {
|
|
1047
|
+
const installFailures = [];
|
|
994
1048
|
for (const { pkg, scope } of sources) {
|
|
995
1049
|
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
|
996
1050
|
const filter = typeof pkg === "object" ? pkg : undefined;
|
|
@@ -1007,21 +1061,46 @@ export class DefaultPackageManager {
|
|
|
1007
1061
|
const installMissing = async () => {
|
|
1008
1062
|
if (isOfflineModeEnabled())
|
|
1009
1063
|
return false;
|
|
1010
|
-
if (
|
|
1064
|
+
if (onMissing) {
|
|
1065
|
+
const action = await onMissing(resolvedSource);
|
|
1066
|
+
if (action === "skip")
|
|
1067
|
+
return false;
|
|
1068
|
+
if (action === "error")
|
|
1069
|
+
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1070
|
+
}
|
|
1071
|
+
// A source that cannot be installed (no network, missing package, failing git prepare step)
|
|
1072
|
+
// must not abort startup. Skip its resources, like offline mode does, and report the failure.
|
|
1073
|
+
try {
|
|
1011
1074
|
await this.installParsedSource(parsed, resolvedScope);
|
|
1012
1075
|
return true;
|
|
1013
1076
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1077
|
+
catch (error) {
|
|
1078
|
+
installFailures.push({
|
|
1079
|
+
source: resolvedSource,
|
|
1080
|
+
scope: resolvedScope,
|
|
1081
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1082
|
+
});
|
|
1016
1083
|
return false;
|
|
1017
|
-
|
|
1018
|
-
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1019
|
-
await this.installParsedSource(parsed, resolvedScope);
|
|
1020
|
-
return true;
|
|
1084
|
+
}
|
|
1021
1085
|
};
|
|
1022
1086
|
if (parsed.type === "npm") {
|
|
1023
1087
|
let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
|
|
1024
1088
|
const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1089
|
+
if (!needsInstall &&
|
|
1090
|
+
resolvedScope === "temporary" &&
|
|
1091
|
+
!parsed.pinned &&
|
|
1092
|
+
(await this.npmHasAvailableUpdate(parsed, installedPath))) {
|
|
1093
|
+
// Temporary (-e) sources have no `pi update` path, so refresh unpinned ones on load like
|
|
1094
|
+
// temporary git sources. Like `pi update`, install `name@latest` for unversioned specs because a bare
|
|
1095
|
+
// `npm install name` keeps the range already saved in the temporary package.json.
|
|
1096
|
+
const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
|
|
1097
|
+
try {
|
|
1098
|
+
await this.installNpm({ ...parsed, spec }, resolvedScope, true);
|
|
1099
|
+
}
|
|
1100
|
+
catch {
|
|
1101
|
+
// Keep the cached install if the refresh fails.
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1025
1104
|
if (needsInstall) {
|
|
1026
1105
|
const installed = await installMissing();
|
|
1027
1106
|
if (!installed)
|
|
@@ -1040,14 +1119,15 @@ export class DefaultPackageManager {
|
|
|
1040
1119
|
if (!installed)
|
|
1041
1120
|
continue;
|
|
1042
1121
|
}
|
|
1043
|
-
else if (resolvedScope === "temporary" && !
|
|
1044
|
-
await this.refreshTemporaryGitSource(parsed, resolvedSource);
|
|
1122
|
+
else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
|
|
1123
|
+
await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
|
|
1045
1124
|
}
|
|
1046
1125
|
metadata.baseDir = installedPath;
|
|
1047
1126
|
metadata.packageRoot = installedPath;
|
|
1048
1127
|
this.collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
1049
1128
|
}
|
|
1050
1129
|
}
|
|
1130
|
+
return installFailures;
|
|
1051
1131
|
}
|
|
1052
1132
|
findAutoloadDeltaBase(pkg, scope, sources) {
|
|
1053
1133
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
@@ -1103,7 +1183,7 @@ export class DefaultPackageManager {
|
|
|
1103
1183
|
if (parsed.type === "git") {
|
|
1104
1184
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1105
1185
|
}
|
|
1106
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1186
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1107
1187
|
}
|
|
1108
1188
|
getSourceMatchKeyForSettings(source, scope) {
|
|
1109
1189
|
const parsed = this.parseSource(source);
|
|
@@ -1114,7 +1194,7 @@ export class DefaultPackageManager {
|
|
|
1114
1194
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1115
1195
|
}
|
|
1116
1196
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1117
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1197
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1118
1198
|
}
|
|
1119
1199
|
buildNoMatchingPackageMessage(source, configuredPackages) {
|
|
1120
1200
|
const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
|
|
@@ -1393,9 +1473,9 @@ export class DefaultPackageManager {
|
|
|
1393
1473
|
}
|
|
1394
1474
|
if (scope) {
|
|
1395
1475
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1396
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1476
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1397
1477
|
}
|
|
1398
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1478
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1399
1479
|
}
|
|
1400
1480
|
/**
|
|
1401
1481
|
* Dedupe packages: if same package identity appears in both global and project,
|
|
@@ -1486,7 +1566,7 @@ export class DefaultPackageManager {
|
|
|
1486
1566
|
"--config.strict-dep-builds=false",
|
|
1487
1567
|
];
|
|
1488
1568
|
case "npm":
|
|
1489
|
-
return ["install", "--omit=dev", "--legacy-peer-deps"];
|
|
1569
|
+
return ["install", "--omit=dev", "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1490
1570
|
default:
|
|
1491
1571
|
return ["install"];
|
|
1492
1572
|
}
|
|
@@ -1495,7 +1575,9 @@ export class DefaultPackageManager {
|
|
|
1495
1575
|
const npmCommand = this.getNpmCommand();
|
|
1496
1576
|
return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
|
|
1497
1577
|
}
|
|
1498
|
-
getNpmInstallArgs(specs,
|
|
1578
|
+
getNpmInstallArgs(specs, root) {
|
|
1579
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1580
|
+
const installRoot = existsSync(root) ? realpathSync(root) : root;
|
|
1499
1581
|
const packageManagerName = this.getPackageManagerName();
|
|
1500
1582
|
// Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
|
|
1501
1583
|
// Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
|
|
@@ -1515,7 +1597,8 @@ export class DefaultPackageManager {
|
|
|
1515
1597
|
"--config.strict-dep-builds=false",
|
|
1516
1598
|
];
|
|
1517
1599
|
}
|
|
1518
|
-
|
|
1600
|
+
// npm audit fix would run without --legacy-peer-deps and install pi peers, so skip audit advice.
|
|
1601
|
+
return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1519
1602
|
}
|
|
1520
1603
|
async installNpm(source, scope, temporary) {
|
|
1521
1604
|
const installRoot = this.getNpmInstallRoot(scope, temporary);
|
|
@@ -1523,10 +1606,12 @@ export class DefaultPackageManager {
|
|
|
1523
1606
|
await this.runNpmCommand(this.getNpmInstallArgs([source.spec], installRoot));
|
|
1524
1607
|
}
|
|
1525
1608
|
async uninstallNpm(source, scope) {
|
|
1526
|
-
const
|
|
1527
|
-
if (!existsSync(
|
|
1609
|
+
const root = this.getNpmInstallRoot(scope, false);
|
|
1610
|
+
if (!existsSync(root)) {
|
|
1528
1611
|
return;
|
|
1529
1612
|
}
|
|
1613
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1614
|
+
const installRoot = realpathSync(root);
|
|
1530
1615
|
const packageManagerName = this.getPackageManagerName();
|
|
1531
1616
|
if (packageManagerName === "bun") {
|
|
1532
1617
|
await this.runNpmCommand(["uninstall", source.name, "--cwd", installRoot]);
|
|
@@ -1534,7 +1619,7 @@ export class DefaultPackageManager {
|
|
|
1534
1619
|
}
|
|
1535
1620
|
const args = ["uninstall", source.name, "--prefix", installRoot];
|
|
1536
1621
|
if (packageManagerName !== "pnpm") {
|
|
1537
|
-
args.push("--legacy-peer-deps");
|
|
1622
|
+
args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
|
|
1538
1623
|
}
|
|
1539
1624
|
await this.runNpmCommand(args);
|
|
1540
1625
|
}
|
|
@@ -1616,20 +1701,31 @@ export class DefaultPackageManager {
|
|
|
1616
1701
|
return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
|
|
1617
1702
|
}
|
|
1618
1703
|
async cleanAndInstallGitDependencies(targetDir, markerPath) {
|
|
1619
|
-
// Clean untracked files (extensions should be pristine).
|
|
1620
|
-
//
|
|
1704
|
+
// Clean untracked files (extensions should be pristine). On Windows, files loaded by
|
|
1705
|
+
// another process (e.g. a native module of this extension in another pi session) cannot
|
|
1706
|
+
// be deleted, so git clean fails. Still install dependencies for the new commit, but keep
|
|
1707
|
+
// the marker so the next update retries the clean.
|
|
1708
|
+
let cleaned = true;
|
|
1621
1709
|
try {
|
|
1622
1710
|
await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
|
|
1623
1711
|
}
|
|
1624
1712
|
catch (error) {
|
|
1625
|
-
|
|
1626
|
-
|
|
1713
|
+
cleaned = false;
|
|
1714
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1715
|
+
this.emitProgress({
|
|
1716
|
+
type: "progress",
|
|
1717
|
+
action: "update",
|
|
1718
|
+
source: targetDir,
|
|
1719
|
+
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.`,
|
|
1720
|
+
});
|
|
1627
1721
|
}
|
|
1628
1722
|
const packageJsonPath = join(targetDir, "package.json");
|
|
1629
1723
|
if (existsSync(packageJsonPath)) {
|
|
1630
1724
|
await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
|
|
1631
1725
|
}
|
|
1632
|
-
|
|
1726
|
+
if (cleaned) {
|
|
1727
|
+
rmSync(markerPath, { force: true });
|
|
1728
|
+
}
|
|
1633
1729
|
}
|
|
1634
1730
|
async ensureGitRef(targetDir, fetchArgs, ref) {
|
|
1635
1731
|
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
@@ -1657,11 +1753,22 @@ export class DefaultPackageManager {
|
|
|
1657
1753
|
await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
|
|
1658
1754
|
await this.cleanAndInstallGitDependencies(targetDir, markerPath);
|
|
1659
1755
|
}
|
|
1660
|
-
async refreshTemporaryGitSource(source, sourceStr) {
|
|
1756
|
+
async refreshTemporaryGitSource(source, sourceStr, installedPath) {
|
|
1661
1757
|
if (isOfflineModeEnabled()) {
|
|
1662
1758
|
return;
|
|
1663
1759
|
}
|
|
1664
1760
|
try {
|
|
1761
|
+
// A ref can name a moving branch, so refresh refs too. Skip the network call only when the
|
|
1762
|
+
// ref is a commit hash that is already checked out.
|
|
1763
|
+
if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
|
|
1764
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1765
|
+
cwd: installedPath,
|
|
1766
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1767
|
+
});
|
|
1768
|
+
if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
|
|
1769
|
+
return;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1665
1772
|
await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
|
|
1666
1773
|
await this.updateGit(source, "temporary");
|
|
1667
1774
|
});
|
|
@@ -1849,6 +1956,14 @@ export class DefaultPackageManager {
|
|
|
1849
1956
|
return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
|
|
1850
1957
|
}
|
|
1851
1958
|
collectPackageResources(packageRoot, accumulator, filter, metadata) {
|
|
1959
|
+
const manifest = readPiManifest(join(packageRoot, "package.json"));
|
|
1960
|
+
const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
|
|
1961
|
+
if (changelogPath) {
|
|
1962
|
+
metadata.changelogPath = changelogPath;
|
|
1963
|
+
}
|
|
1964
|
+
else {
|
|
1965
|
+
delete metadata.changelogPath;
|
|
1966
|
+
}
|
|
1852
1967
|
if (filter) {
|
|
1853
1968
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1854
1969
|
const patterns = filter[resourceType];
|
|
@@ -1865,8 +1980,7 @@ export class DefaultPackageManager {
|
|
|
1865
1980
|
}
|
|
1866
1981
|
return true;
|
|
1867
1982
|
}
|
|
1868
|
-
|
|
1869
|
-
if (manifest) {
|
|
1983
|
+
if (manifest && hasManifestResourceFields(manifest)) {
|
|
1870
1984
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1871
1985
|
const entries = manifest[resourceType];
|
|
1872
1986
|
this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
|
|
@@ -2026,7 +2140,7 @@ export class DefaultPackageManager {
|
|
|
2026
2140
|
const userAgentsSkillsDir = join(getHomeDir(), ".agents", "skills");
|
|
2027
2141
|
const projectTrusted = this.settingsManager.isProjectTrusted();
|
|
2028
2142
|
const projectAgentsSkillDirs = projectTrusted
|
|
2029
|
-
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) =>
|
|
2143
|
+
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) => !pathsEqual(dir, userAgentsSkillsDir))
|
|
2030
2144
|
: [];
|
|
2031
2145
|
const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
|
|
2032
2146
|
const target = this.getTargetMap(accumulator, resourceType);
|
|
@@ -2127,10 +2241,10 @@ export class DefaultPackageManager {
|
|
|
2127
2241
|
resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
|
|
2128
2242
|
const seen = new Set();
|
|
2129
2243
|
return resolved.filter((entry) => {
|
|
2130
|
-
const
|
|
2131
|
-
if (seen.has(
|
|
2244
|
+
const pathKey = getResourcePathKey(entry.path);
|
|
2245
|
+
if (seen.has(pathKey))
|
|
2132
2246
|
return false;
|
|
2133
|
-
seen.add(
|
|
2247
|
+
seen.add(pathKey);
|
|
2134
2248
|
return true;
|
|
2135
2249
|
});
|
|
2136
2250
|
};
|