@draht/coding-agent 2026.10.31-1 → 2026.11.5-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +131 -0
- package/dist/bundle/chunks/anthropic-messages-UJZ4SGHU.js +6 -0
- package/dist/bundle/chunks/azure-openai-responses-NCMJPZVJ.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +8 -5
- package/dist/bundle/chunks/{chunk-IGO52ZOY.js → chunk-3BJ462DN.js} +2 -2
- package/dist/bundle/chunks/chunk-5OXIAQP5.js +2 -0
- package/dist/bundle/chunks/chunk-6M3D4XVD.js +2 -0
- package/dist/bundle/chunks/chunk-AOCWORXE.js +2 -0
- package/dist/bundle/chunks/chunk-BK5LXGIH.js +2 -0
- package/dist/bundle/chunks/chunk-CA23BDNK.js +2 -0
- package/dist/bundle/chunks/chunk-DWOGGNWY.js +18 -0
- package/dist/bundle/chunks/{chunk-7ATV4EYW.js → chunk-EOXOMUKR.js} +1 -1
- package/dist/bundle/chunks/chunk-F5TDVH26.js +159 -0
- package/dist/bundle/chunks/chunk-HJ3PS7QP.js +4 -0
- package/dist/bundle/chunks/chunk-ITKDPD4D.js +12 -0
- package/dist/bundle/chunks/chunk-KFREX3FS.js +10 -0
- package/dist/bundle/chunks/{chunk-E4VZJRJ2.js → chunk-P7O36UDU.js} +2 -2
- package/dist/bundle/chunks/chunk-PMINB7UH.js +1401 -0
- package/dist/bundle/chunks/chunk-PZKD35UB.js +2 -0
- package/dist/bundle/chunks/{chunk-CPFKZX4B.js → chunk-Q2QKCYPU.js} +1 -1
- package/dist/bundle/chunks/chunk-QBUTRTYN.js +2 -0
- package/dist/bundle/chunks/chunk-SUVMF4W5.js +2 -0
- package/dist/bundle/chunks/chunk-UFACUBF2.js +16 -0
- package/dist/bundle/chunks/chunk-VXO6B72D.js +9 -0
- package/dist/bundle/chunks/{chunk-PMDUR6B5.js → chunk-WXASQQBZ.js} +2 -2
- package/dist/bundle/chunks/chunk-Y3NLUJYO.js +2 -0
- package/dist/bundle/chunks/chunk-Y7QE2R34.js +2 -0
- package/dist/bundle/chunks/chunk-YD5VPPI4.js +30 -0
- package/dist/bundle/chunks/chunk-YWRWN7ZB.js +82 -0
- package/dist/bundle/chunks/{cli-HTUB6WOG.js → cli-4SUT6MJ6.js} +10 -10
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-BJVMNETD.js +2 -0
- package/dist/bundle/chunks/{execute-UUPNZJJG.js → execute-ZI7T2SUH.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-A2277FHU.js → google-generative-ai-N5IPPKQY.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-2KSVQZQN.js → google-vertex-A4BKUE4H.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-Y3DUSEM2.js → llama-cpp-classify-L4URPZ4F.js} +1 -1
- package/dist/bundle/chunks/meta.js +1 -1
- package/dist/bundle/chunks/mistral-conversations-CK2BS74V.js +5 -0
- package/dist/bundle/chunks/openai-codex-responses-XGVNKP4D.js +10 -0
- package/dist/bundle/chunks/openai-completions-72XZO4Q3.js +7 -0
- package/dist/bundle/chunks/{openai-decisions-JRN6M2KB.js → openai-decisions-P5OCXLLD.js} +1 -1
- package/dist/bundle/chunks/openai-responses-RGLZ4E3Q.js +4 -0
- package/dist/bundle/chunks/{openrouter-images-2XTVCXIC.js → openrouter-images-LSBWMZDK.js} +1 -1
- package/dist/bundle/chunks/pi-messages-CL4MEVNS.js +8 -0
- package/dist/bundle/chunks/radius.js +1 -1
- package/dist/bundle/chunks/{runtime-IB3XQ7E3.js → runtime-F4362CZF.js} +1 -1
- package/dist/bundle/chunks/{runtime-LB35PK4J.js → runtime-FJYRBK3O.js} +1 -1
- package/dist/bundle/chunks/settings-manager-T6G6KKY3.js +2 -0
- package/dist/bundle/chunks/typesafe-system-one-BFYS6AEA.js +2 -0
- package/dist/bundle/chunks/virtual-modules-BPZIVXNK.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -7
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +3 -1
- package/dist/cli/config-selector.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.map +1 -1
- package/dist/core/agent-session-runtime.js +4 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +16 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +104 -30
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/ai-schemas.d.ts +166 -0
- package/dist/core/ai-schemas.d.ts.map +1 -0
- package/dist/core/ai-schemas.js +21 -0
- package/dist/core/ai-schemas.js.map +1 -0
- 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/bug-report.d.ts +4 -4
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +2 -0
- 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/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 +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/ai-extension-view.js +22 -0
- package/dist/core/extensions/ai-extension-view.js.map +1 -0
- 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 +15 -9
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +9 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +55 -11
- 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 +6 -5
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +21 -38
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +58 -134
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1717 -1990
- 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 -9
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +4 -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 +215 -52
- package/dist/core/package-manager.js.map +1 -1
- 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 +3 -0
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +8 -4
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +38 -23
- 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 -15
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +14 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +41 -25
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +4 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +73 -70
- 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/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +2 -7
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +19 -19
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +0 -14
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +0 -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 +15 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +6 -2
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/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/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 +2 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +72 -15
- 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 +2 -2
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +13 -50
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +53 -319
- 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 +4 -3
- 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/mcp/ui.d.ts +1 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +33 -24
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +16 -8
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +4 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +44 -20
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +12 -4
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +12 -4
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +4 -18
- 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 +5 -2
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +12 -4
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +11 -5
- package/dist/modes/interactive/components/diff.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/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +9 -1
- package/dist/modes/interactive/components/extension-selector.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 +104 -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/mermaid.d.ts +2 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +25 -20
- package/dist/modes/interactive/components/mermaid.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 +20 -27
- 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/skill-invocation-message.d.ts +5 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +12 -4
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +6 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +14 -2
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +2 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +24 -16
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +9 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +6 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +16 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +179 -53
- 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 +35 -23
- package/dist/modes/interactive/theme/theme.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 +78 -9
- 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 +15 -2
- 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/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +4 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +14 -0
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +7 -0
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +30 -35
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +22 -10
- package/docs/custom-provider.md +2 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +3201 -233
- package/docs/keybindings.md +2 -2
- package/docs/llama-cpp.md +23 -15
- package/docs/message-types.md +1 -1
- package/docs/models-configuration.md +17 -4
- package/docs/models.md +9 -4
- package/docs/packages.md +24 -0
- package/docs/providers.md +1 -1
- package/docs/rpc.md +3 -1
- package/docs/sessions.md +11 -3
- package/docs/settings.md +5 -4
- package/docs/slash-commands.md +3 -2
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +2 -0
- package/docs/windows.md +27 -0
- package/eval/drahtbank/isolated-tools.ts +0 -1
- package/examples/extensions/antigravity-image-gen.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- package/examples/extensions/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/plan-mode/index.ts +23 -13
- package/examples/extensions/plan-mode/utils.ts +42 -16
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/sandbox/package-lock.json +15 -41
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/index.ts +388 -171
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/tsconfig.json +188 -0
- package/package.json +15 -16
- package/schemas/models.schema.json +85 -39
- package/schemas/settings.schema.json +17 -0
- package/dist/bundle/chunks/anthropic-messages-CZYDBUW7.js +0 -6
- package/dist/bundle/chunks/azure-openai-responses-UKM4K3L6.js +0 -2
- package/dist/bundle/chunks/chunk-2TZWVGCR.js +0 -2
- package/dist/bundle/chunks/chunk-76YNMQ57.js +0 -2
- package/dist/bundle/chunks/chunk-AS6DCLAM.js +0 -1428
- package/dist/bundle/chunks/chunk-BL72B6LV.js +0 -82
- package/dist/bundle/chunks/chunk-C2XCXA6V.js +0 -2
- package/dist/bundle/chunks/chunk-CLKG6K6Z.js +0 -7
- package/dist/bundle/chunks/chunk-FOYIPAAD.js +0 -6
- package/dist/bundle/chunks/chunk-FXCTQRNN.js +0 -2
- package/dist/bundle/chunks/chunk-H5BLLINF.js +0 -11
- package/dist/bundle/chunks/chunk-IT4RIOZD.js +0 -2
- package/dist/bundle/chunks/chunk-N3FZGIII.js +0 -16
- package/dist/bundle/chunks/chunk-OCUU7HYF.js +0 -2
- package/dist/bundle/chunks/chunk-QMN7OD6G.js +0 -2
- package/dist/bundle/chunks/chunk-UCJ7FLSO.js +0 -166
- package/dist/bundle/chunks/chunk-WFHH5SX6.js +0 -4
- package/dist/bundle/chunks/chunk-WYWBXNDO.js +0 -6
- package/dist/bundle/chunks/chunk-XOGEYN4Q.js +0 -2
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-V37VPUK4.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-R2NJADHS.js +0 -5
- package/dist/bundle/chunks/openai-codex-responses-KJZDJELP.js +0 -10
- package/dist/bundle/chunks/openai-completions-RTWADJBP.js +0 -7
- package/dist/bundle/chunks/openai-responses-B7ASLN2Z.js +0 -4
- package/dist/bundle/chunks/pi-messages-7TX4RC24.js +0 -8
- package/dist/bundle/chunks/settings-manager-YNY5F4RU.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-7BNMQFXE.js +0 -2
- package/dist/bundle/chunks/virtual-modules-OFCQ5AEG.js +0 -2
|
@@ -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,23 +20,24 @@ 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
|
-
import {
|
|
28
|
+
import { realHomeDir, realPathStrict } from "../utils/canonical-path.js";
|
|
29
29
|
import { spawnProcess, spawnProcessSync } from "../utils/child-process.js";
|
|
30
30
|
import { parseGitUrl } from "../utils/git.js";
|
|
31
|
-
import { isLocalPath, markPathIgnoredByCloudSync, normalizePath, resolvePath } from "../utils/paths.js";
|
|
31
|
+
import { getPathComparisonKey, isLocalPath, markPathIgnoredByCloudSync, normalizePath, pathsEqual, resolvePath, } from "../utils/paths.js";
|
|
32
32
|
import { stripBom } from "../utils/text.js";
|
|
33
33
|
import { isStdoutTakenOver } from "./output-guard.js";
|
|
34
34
|
import { readPiManifest } from "./pi-manifest.js";
|
|
35
|
-
import { BUILTIN_PATH_PREFIX } from "./source-info.js";
|
|
35
|
+
import { BUILTIN_PATH_PREFIX, getResourcePathKey } from "./source-info.js";
|
|
36
36
|
const NETWORK_TIMEOUT_MS = 10000;
|
|
37
37
|
const UPDATE_CHECK_CONCURRENCY = 4;
|
|
38
38
|
const GIT_UPDATE_CONCURRENCY = 4;
|
|
39
|
-
|
|
39
|
+
/** Whether DRAHT_OFFLINE is set; package installs and updates then skip all network access. */
|
|
40
|
+
export function isOfflineModeEnabled() {
|
|
40
41
|
const value = process.env.DRAHT_OFFLINE;
|
|
41
42
|
if (!value)
|
|
42
43
|
return false;
|
|
@@ -474,6 +475,37 @@ function collectResourceFiles(dir, resourceType) {
|
|
|
474
475
|
}
|
|
475
476
|
return collectFiles(dir, FILE_PATTERNS[resourceType]);
|
|
476
477
|
}
|
|
478
|
+
// A `draht` object counts as an explicit resource manifest only when it lists resources. Packages whose
|
|
479
|
+
// `draht` object holds only metadata (changelogPath, gallery image/video) still use directory auto-discovery.
|
|
480
|
+
function hasManifestResourceFields(manifest) {
|
|
481
|
+
return RESOURCE_TYPES.some((resourceType) => manifest[resourceType] !== undefined);
|
|
482
|
+
}
|
|
483
|
+
function isPathInside(parent, child) {
|
|
484
|
+
const relativePath = relative(parent, child);
|
|
485
|
+
return (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath));
|
|
486
|
+
}
|
|
487
|
+
function resolvePackageChangelogPath(packageRoot, manifest) {
|
|
488
|
+
const changelogPath = manifest?.changelogPath ?? "CHANGELOG.md";
|
|
489
|
+
if (!changelogPath)
|
|
490
|
+
return undefined;
|
|
491
|
+
const resolvedPath = resolve(packageRoot, changelogPath);
|
|
492
|
+
if (!existsSync(resolvedPath))
|
|
493
|
+
return undefined;
|
|
494
|
+
// Containment is a security decision: compare fully resolved real paths, never a partial resolution.
|
|
495
|
+
const canonicalPackageRoot = realPathStrict(packageRoot);
|
|
496
|
+
const canonicalChangelogPath = realPathStrict(resolvedPath);
|
|
497
|
+
if (!canonicalPackageRoot ||
|
|
498
|
+
!canonicalChangelogPath ||
|
|
499
|
+
!isPathInside(canonicalPackageRoot, canonicalChangelogPath)) {
|
|
500
|
+
return undefined;
|
|
501
|
+
}
|
|
502
|
+
try {
|
|
503
|
+
return statSync(resolvedPath).isFile() ? resolvedPath : undefined;
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
return undefined;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
477
509
|
function matchesAnyPattern(filePath, patterns, baseDir) {
|
|
478
510
|
const rel = toPosixPath(relative(baseDir, filePath));
|
|
479
511
|
const name = basename(filePath);
|
|
@@ -721,7 +753,7 @@ export class DefaultPackageManager {
|
|
|
721
753
|
}
|
|
722
754
|
// Dedupe: project scope wins over global for same package identity
|
|
723
755
|
const packageSources = this.dedupePackages(allPackages);
|
|
724
|
-
await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
756
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
725
757
|
const globalBaseDir = this.agentDir;
|
|
726
758
|
const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
|
|
727
759
|
for (const resourceType of RESOURCE_TYPES) {
|
|
@@ -747,7 +779,7 @@ export class DefaultPackageManager {
|
|
|
747
779
|
const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
|
|
748
780
|
this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
|
|
749
781
|
}
|
|
750
|
-
return this.toResolvedPaths(accumulator);
|
|
782
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
751
783
|
}
|
|
752
784
|
async resolveExtensionSources(sources, options) {
|
|
753
785
|
const accumulator = this.createAccumulator();
|
|
@@ -759,8 +791,8 @@ export class DefaultPackageManager {
|
|
|
759
791
|
const packageSources = sources
|
|
760
792
|
.filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
|
|
761
793
|
.map((source) => ({ pkg: source, scope }));
|
|
762
|
-
await this.resolvePackageSources(packageSources, accumulator);
|
|
763
|
-
return this.toResolvedPaths(accumulator);
|
|
794
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator);
|
|
795
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
764
796
|
}
|
|
765
797
|
listConfiguredPackages() {
|
|
766
798
|
const globalSettings = this.settingsManager.getGlobalSettings();
|
|
@@ -883,17 +915,18 @@ export class DefaultPackageManager {
|
|
|
883
915
|
gitCandidates.push({ ...entry, parsed });
|
|
884
916
|
}
|
|
885
917
|
}
|
|
886
|
-
const npmCheckTasks = npmCandidates.map((entry) => async () =>
|
|
887
|
-
entry,
|
|
888
|
-
|
|
889
|
-
|
|
918
|
+
const npmCheckTasks = npmCandidates.map((entry) => async () => {
|
|
919
|
+
const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
|
|
920
|
+
return {
|
|
921
|
+
entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
|
|
922
|
+
shouldUpdate: check.shouldUpdate,
|
|
923
|
+
};
|
|
924
|
+
});
|
|
890
925
|
const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
|
|
891
926
|
const userNpmUpdates = [];
|
|
892
927
|
const projectNpmUpdates = [];
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
continue;
|
|
896
|
-
}
|
|
928
|
+
const npmUpdates = npmCheckResults.filter((result) => result.shouldUpdate);
|
|
929
|
+
for (const result of npmUpdates) {
|
|
897
930
|
if (result.entry.scope === "user") {
|
|
898
931
|
userNpmUpdates.push(result.entry);
|
|
899
932
|
}
|
|
@@ -908,27 +941,73 @@ export class DefaultPackageManager {
|
|
|
908
941
|
if (projectNpmUpdates.length > 0) {
|
|
909
942
|
tasks.push(this.updateNpmBatch(projectNpmUpdates, "project"));
|
|
910
943
|
}
|
|
944
|
+
const gitUpdates = [];
|
|
911
945
|
if (gitCandidates.length > 0) {
|
|
912
946
|
const gitTasks = gitCandidates.map((entry) => async () => this.withProgress("update", entry.source, `Updating ${entry.source}...`, async () => {
|
|
947
|
+
const targetDir = this.getGitInstallPath(entry.parsed, entry.scope);
|
|
948
|
+
const from = await this.getGitHead(targetDir);
|
|
913
949
|
await this.updateGit(entry.parsed, entry.scope);
|
|
950
|
+
const to = await this.getGitHead(targetDir);
|
|
951
|
+
if (from !== to) {
|
|
952
|
+
gitUpdates.push({ source: entry.source, type: "git", scope: entry.scope, from, to });
|
|
953
|
+
}
|
|
914
954
|
}));
|
|
915
955
|
tasks.push(this.runWithConcurrency(gitTasks, GIT_UPDATE_CONCURRENCY).then(() => { }));
|
|
916
956
|
}
|
|
917
957
|
await Promise.all(tasks);
|
|
958
|
+
const updated = [];
|
|
959
|
+
for (const { entry } of npmUpdates) {
|
|
960
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, entry.scope);
|
|
961
|
+
const to = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
962
|
+
if (to !== entry.installedVersion) {
|
|
963
|
+
updated.push({ source: entry.source, type: "npm", scope: entry.scope, from: entry.installedVersion, to });
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
// Keep git results in configured order, independent of completion order.
|
|
967
|
+
for (const entry of gitCandidates) {
|
|
968
|
+
const update = gitUpdates.find((u) => u.source === entry.source && u.scope === entry.scope);
|
|
969
|
+
if (update)
|
|
970
|
+
updated.push(update);
|
|
971
|
+
}
|
|
972
|
+
// Report each changed package, e.g. "npm:foo 1.2.0 -> 1.3.0".
|
|
973
|
+
for (const pkg of updated) {
|
|
974
|
+
const format = (value) => value === undefined ? "(none)" : pkg.type === "git" ? value.slice(0, 7) : value;
|
|
975
|
+
const scope = pkg.scope === "project" ? " (project)" : "";
|
|
976
|
+
this.emitProgress({
|
|
977
|
+
type: "result",
|
|
978
|
+
action: "update",
|
|
979
|
+
source: pkg.source,
|
|
980
|
+
message: `${pkg.source}${scope} ${format(pkg.from)} -> ${format(pkg.to)}`,
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
async getGitHead(targetDir) {
|
|
985
|
+
if (!existsSync(targetDir))
|
|
986
|
+
return undefined;
|
|
987
|
+
try {
|
|
988
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
989
|
+
cwd: targetDir,
|
|
990
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
991
|
+
});
|
|
992
|
+
return head.trim() || undefined;
|
|
993
|
+
}
|
|
994
|
+
catch {
|
|
995
|
+
return undefined;
|
|
996
|
+
}
|
|
918
997
|
}
|
|
919
998
|
async shouldUpdateNpmSource(source, scope) {
|
|
920
999
|
const installedPath = this.getManagedNpmInstallPath(source, scope);
|
|
921
1000
|
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
922
1001
|
if (!installedVersion) {
|
|
923
|
-
return true;
|
|
1002
|
+
return { shouldUpdate: true };
|
|
924
1003
|
}
|
|
925
1004
|
try {
|
|
926
1005
|
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
927
|
-
return gt(targetVersion, installedVersion);
|
|
1006
|
+
return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
|
|
928
1007
|
}
|
|
929
1008
|
catch {
|
|
930
1009
|
// Preserve existing update behavior when version lookup fails.
|
|
931
|
-
return true;
|
|
1010
|
+
return { shouldUpdate: true, installedVersion };
|
|
932
1011
|
}
|
|
933
1012
|
}
|
|
934
1013
|
async updateNpmBatch(sources, scope) {
|
|
@@ -941,6 +1020,29 @@ export class DefaultPackageManager {
|
|
|
941
1020
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
942
1021
|
await this.installNpmBatch(specs, scope);
|
|
943
1022
|
});
|
|
1023
|
+
this.reportUnchangedNpmUpdates(sources, scope);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* npm can resolve stale registry metadata shortly after a publish and install the old
|
|
1027
|
+
* version without an error. Warn when an announced update did not change the installed version.
|
|
1028
|
+
*/
|
|
1029
|
+
reportUnchangedNpmUpdates(sources, scope) {
|
|
1030
|
+
for (const entry of sources) {
|
|
1031
|
+
if (!entry.installedVersion || !entry.targetVersion) {
|
|
1032
|
+
continue;
|
|
1033
|
+
}
|
|
1034
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
|
|
1035
|
+
const versionAfter = this.getInstalledNpmVersion(installedPath);
|
|
1036
|
+
if (versionAfter !== entry.installedVersion) {
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
this.emitProgress({
|
|
1040
|
+
type: "progress",
|
|
1041
|
+
action: "update",
|
|
1042
|
+
source: entry.source,
|
|
1043
|
+
message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
944
1046
|
}
|
|
945
1047
|
async installNpmBatch(specs, scope) {
|
|
946
1048
|
const installRoot = this.getNpmInstallRoot(scope, false);
|
|
@@ -1004,6 +1106,7 @@ export class DefaultPackageManager {
|
|
|
1004
1106
|
return results.filter((result) => result !== undefined);
|
|
1005
1107
|
}
|
|
1006
1108
|
async resolvePackageSources(sources, accumulator, onMissing) {
|
|
1109
|
+
const installFailures = [];
|
|
1007
1110
|
for (const { pkg, scope } of sources) {
|
|
1008
1111
|
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
|
1009
1112
|
const filter = typeof pkg === "object" ? pkg : undefined;
|
|
@@ -1020,21 +1123,46 @@ export class DefaultPackageManager {
|
|
|
1020
1123
|
const installMissing = async () => {
|
|
1021
1124
|
if (isOfflineModeEnabled())
|
|
1022
1125
|
return false;
|
|
1023
|
-
if (
|
|
1126
|
+
if (onMissing) {
|
|
1127
|
+
const action = await onMissing(resolvedSource);
|
|
1128
|
+
if (action === "skip")
|
|
1129
|
+
return false;
|
|
1130
|
+
if (action === "error")
|
|
1131
|
+
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1132
|
+
}
|
|
1133
|
+
// A source that cannot be installed (no network, missing package, failing git prepare step)
|
|
1134
|
+
// must not abort startup. Skip its resources, like offline mode does, and report the failure.
|
|
1135
|
+
try {
|
|
1024
1136
|
await this.installParsedSource(parsed, resolvedScope);
|
|
1025
1137
|
return true;
|
|
1026
1138
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1139
|
+
catch (error) {
|
|
1140
|
+
installFailures.push({
|
|
1141
|
+
source: resolvedSource,
|
|
1142
|
+
scope: resolvedScope,
|
|
1143
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1144
|
+
});
|
|
1029
1145
|
return false;
|
|
1030
|
-
|
|
1031
|
-
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1032
|
-
await this.installParsedSource(parsed, resolvedScope);
|
|
1033
|
-
return true;
|
|
1146
|
+
}
|
|
1034
1147
|
};
|
|
1035
1148
|
if (parsed.type === "npm") {
|
|
1036
1149
|
let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
|
|
1037
1150
|
const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1151
|
+
if (!needsInstall &&
|
|
1152
|
+
resolvedScope === "temporary" &&
|
|
1153
|
+
!parsed.pinned &&
|
|
1154
|
+
(await this.npmHasAvailableUpdate(parsed, installedPath))) {
|
|
1155
|
+
// Temporary (-e) sources have no `draht update` path, so refresh unpinned ones on load like
|
|
1156
|
+
// temporary git sources. Like `draht update`, install `name@latest` for unversioned specs because a bare
|
|
1157
|
+
// `npm install name` keeps the range already saved in the temporary package.json.
|
|
1158
|
+
const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
|
|
1159
|
+
try {
|
|
1160
|
+
await this.installNpm({ ...parsed, spec }, resolvedScope, true);
|
|
1161
|
+
}
|
|
1162
|
+
catch {
|
|
1163
|
+
// Keep the cached install if the refresh fails.
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1038
1166
|
if (needsInstall) {
|
|
1039
1167
|
const installed = await installMissing();
|
|
1040
1168
|
if (!installed)
|
|
@@ -1053,14 +1181,15 @@ export class DefaultPackageManager {
|
|
|
1053
1181
|
if (!installed)
|
|
1054
1182
|
continue;
|
|
1055
1183
|
}
|
|
1056
|
-
else if (resolvedScope === "temporary" && !
|
|
1057
|
-
await this.refreshTemporaryGitSource(parsed, resolvedSource);
|
|
1184
|
+
else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
|
|
1185
|
+
await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
|
|
1058
1186
|
}
|
|
1059
1187
|
metadata.baseDir = installedPath;
|
|
1060
1188
|
metadata.packageRoot = installedPath;
|
|
1061
1189
|
this.collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
1062
1190
|
}
|
|
1063
1191
|
}
|
|
1192
|
+
return installFailures;
|
|
1064
1193
|
}
|
|
1065
1194
|
findAutoloadDeltaBase(pkg, scope, sources) {
|
|
1066
1195
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
@@ -1116,7 +1245,7 @@ export class DefaultPackageManager {
|
|
|
1116
1245
|
if (parsed.type === "git") {
|
|
1117
1246
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1118
1247
|
}
|
|
1119
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1248
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1120
1249
|
}
|
|
1121
1250
|
getSourceMatchKeyForSettings(source, scope) {
|
|
1122
1251
|
const parsed = this.parseSource(source);
|
|
@@ -1127,7 +1256,7 @@ export class DefaultPackageManager {
|
|
|
1127
1256
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1128
1257
|
}
|
|
1129
1258
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1130
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1259
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1131
1260
|
}
|
|
1132
1261
|
buildNoMatchingPackageMessage(source, configuredPackages) {
|
|
1133
1262
|
const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
|
|
@@ -1406,9 +1535,9 @@ export class DefaultPackageManager {
|
|
|
1406
1535
|
}
|
|
1407
1536
|
if (scope) {
|
|
1408
1537
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1409
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1538
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1410
1539
|
}
|
|
1411
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1540
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1412
1541
|
}
|
|
1413
1542
|
/**
|
|
1414
1543
|
* Dedupe packages: if same package identity appears in both global and project,
|
|
@@ -1499,7 +1628,7 @@ export class DefaultPackageManager {
|
|
|
1499
1628
|
"--config.strict-dep-builds=false",
|
|
1500
1629
|
];
|
|
1501
1630
|
case "npm":
|
|
1502
|
-
return ["install", "--omit=dev", "--legacy-peer-deps"];
|
|
1631
|
+
return ["install", "--omit=dev", "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1503
1632
|
default:
|
|
1504
1633
|
return ["install"];
|
|
1505
1634
|
}
|
|
@@ -1508,7 +1637,9 @@ export class DefaultPackageManager {
|
|
|
1508
1637
|
const npmCommand = this.getNpmCommand();
|
|
1509
1638
|
return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
|
|
1510
1639
|
}
|
|
1511
|
-
getNpmInstallArgs(specs,
|
|
1640
|
+
getNpmInstallArgs(specs, root) {
|
|
1641
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1642
|
+
const installRoot = existsSync(root) ? realpathSync(root) : root;
|
|
1512
1643
|
const packageManagerName = this.getPackageManagerName();
|
|
1513
1644
|
// Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
|
|
1514
1645
|
// Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
|
|
@@ -1528,7 +1659,8 @@ export class DefaultPackageManager {
|
|
|
1528
1659
|
"--config.strict-dep-builds=false",
|
|
1529
1660
|
];
|
|
1530
1661
|
}
|
|
1531
|
-
|
|
1662
|
+
// npm audit fix would run without --legacy-peer-deps and install draht peers, so skip audit advice.
|
|
1663
|
+
return ["install", ...specs, "--prefix", installRoot, "--legacy-peer-deps", "--no-audit", "--no-fund"];
|
|
1532
1664
|
}
|
|
1533
1665
|
async installNpm(source, scope, temporary) {
|
|
1534
1666
|
const installRoot = this.getNpmInstallRoot(scope, temporary);
|
|
@@ -1536,10 +1668,12 @@ export class DefaultPackageManager {
|
|
|
1536
1668
|
await this.runNpmCommand(this.getNpmInstallArgs([source.spec], installRoot));
|
|
1537
1669
|
}
|
|
1538
1670
|
async uninstallNpm(source, scope) {
|
|
1539
|
-
const
|
|
1540
|
-
if (!existsSync(
|
|
1671
|
+
const root = this.getNpmInstallRoot(scope, false);
|
|
1672
|
+
if (!existsSync(root)) {
|
|
1541
1673
|
return;
|
|
1542
1674
|
}
|
|
1675
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1676
|
+
const installRoot = realpathSync(root);
|
|
1543
1677
|
const packageManagerName = this.getPackageManagerName();
|
|
1544
1678
|
if (packageManagerName === "bun") {
|
|
1545
1679
|
await this.runNpmCommand(["uninstall", source.name, "--cwd", installRoot]);
|
|
@@ -1547,7 +1681,7 @@ export class DefaultPackageManager {
|
|
|
1547
1681
|
}
|
|
1548
1682
|
const args = ["uninstall", source.name, "--prefix", installRoot];
|
|
1549
1683
|
if (packageManagerName !== "pnpm") {
|
|
1550
|
-
args.push("--legacy-peer-deps");
|
|
1684
|
+
args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
|
|
1551
1685
|
}
|
|
1552
1686
|
await this.runNpmCommand(args);
|
|
1553
1687
|
}
|
|
@@ -1629,20 +1763,31 @@ export class DefaultPackageManager {
|
|
|
1629
1763
|
return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
|
|
1630
1764
|
}
|
|
1631
1765
|
async cleanAndInstallGitDependencies(targetDir, markerPath) {
|
|
1632
|
-
// Clean untracked files (extensions should be pristine).
|
|
1633
|
-
//
|
|
1766
|
+
// Clean untracked files (extensions should be pristine). On Windows, files loaded by
|
|
1767
|
+
// another process (e.g. a native module of this extension in another draht session) cannot
|
|
1768
|
+
// be deleted, so git clean fails. Still install dependencies for the new commit, but keep
|
|
1769
|
+
// the marker so the next update retries the clean.
|
|
1770
|
+
let cleaned = true;
|
|
1634
1771
|
try {
|
|
1635
1772
|
await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
|
|
1636
1773
|
}
|
|
1637
1774
|
catch (error) {
|
|
1638
|
-
|
|
1639
|
-
|
|
1775
|
+
cleaned = false;
|
|
1776
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1777
|
+
this.emitProgress({
|
|
1778
|
+
type: "progress",
|
|
1779
|
+
action: "update",
|
|
1780
|
+
source: targetDir,
|
|
1781
|
+
message: `Could not remove all untracked files in ${targetDir} (${reason}). Files may be in use by another draht session; close it and run the update again.`,
|
|
1782
|
+
});
|
|
1640
1783
|
}
|
|
1641
1784
|
const packageJsonPath = join(targetDir, "package.json");
|
|
1642
1785
|
if (existsSync(packageJsonPath)) {
|
|
1643
1786
|
await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
|
|
1644
1787
|
}
|
|
1645
|
-
|
|
1788
|
+
if (cleaned) {
|
|
1789
|
+
rmSync(markerPath, { force: true });
|
|
1790
|
+
}
|
|
1646
1791
|
}
|
|
1647
1792
|
async ensureGitRef(targetDir, fetchArgs, ref) {
|
|
1648
1793
|
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
@@ -1670,11 +1815,22 @@ export class DefaultPackageManager {
|
|
|
1670
1815
|
await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
|
|
1671
1816
|
await this.cleanAndInstallGitDependencies(targetDir, markerPath);
|
|
1672
1817
|
}
|
|
1673
|
-
async refreshTemporaryGitSource(source, sourceStr) {
|
|
1818
|
+
async refreshTemporaryGitSource(source, sourceStr, installedPath) {
|
|
1674
1819
|
if (isOfflineModeEnabled()) {
|
|
1675
1820
|
return;
|
|
1676
1821
|
}
|
|
1677
1822
|
try {
|
|
1823
|
+
// A ref can name a moving branch, so refresh refs too. Skip the network call only when the
|
|
1824
|
+
// ref is a commit hash that is already checked out.
|
|
1825
|
+
if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
|
|
1826
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1827
|
+
cwd: installedPath,
|
|
1828
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1829
|
+
});
|
|
1830
|
+
if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
|
|
1831
|
+
return;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1678
1834
|
await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
|
|
1679
1835
|
await this.updateGit(source, "temporary");
|
|
1680
1836
|
});
|
|
@@ -1852,6 +2008,14 @@ export class DefaultPackageManager {
|
|
|
1852
2008
|
return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
|
|
1853
2009
|
}
|
|
1854
2010
|
collectPackageResources(packageRoot, accumulator, filter, metadata) {
|
|
2011
|
+
const manifest = readPiManifest(join(packageRoot, "package.json"));
|
|
2012
|
+
const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
|
|
2013
|
+
if (changelogPath) {
|
|
2014
|
+
metadata.changelogPath = changelogPath;
|
|
2015
|
+
}
|
|
2016
|
+
else {
|
|
2017
|
+
delete metadata.changelogPath;
|
|
2018
|
+
}
|
|
1855
2019
|
if (filter) {
|
|
1856
2020
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1857
2021
|
const patterns = filter[resourceType];
|
|
@@ -1868,8 +2032,7 @@ export class DefaultPackageManager {
|
|
|
1868
2032
|
}
|
|
1869
2033
|
return true;
|
|
1870
2034
|
}
|
|
1871
|
-
|
|
1872
|
-
if (manifest) {
|
|
2035
|
+
if (manifest && hasManifestResourceFields(manifest)) {
|
|
1873
2036
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1874
2037
|
const entries = manifest[resourceType];
|
|
1875
2038
|
this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
|
|
@@ -2035,7 +2198,7 @@ export class DefaultPackageManager {
|
|
|
2035
2198
|
const canonicalUserAgentsSkillsDir = realHome === undefined ? undefined : join(realHome, ".agents", "skills");
|
|
2036
2199
|
const projectTrusted = this.settingsManager.isProjectTrusted();
|
|
2037
2200
|
const projectAgentsSkillDirs = projectTrusted
|
|
2038
|
-
? collectAncestorAgentsSkillDirs(this.cwdSpelling).filter((dir) => dir
|
|
2201
|
+
? collectAncestorAgentsSkillDirs(this.cwdSpelling).filter((dir) => canonicalUserAgentsSkillsDir === undefined || !pathsEqual(dir, canonicalUserAgentsSkillsDir))
|
|
2039
2202
|
: [];
|
|
2040
2203
|
const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
|
|
2041
2204
|
const target = this.getTargetMap(accumulator, resourceType);
|
|
@@ -2136,10 +2299,10 @@ export class DefaultPackageManager {
|
|
|
2136
2299
|
resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
|
|
2137
2300
|
const seen = new Set();
|
|
2138
2301
|
return resolved.filter((entry) => {
|
|
2139
|
-
const
|
|
2140
|
-
if (seen.has(
|
|
2302
|
+
const pathKey = getResourcePathKey(entry.path);
|
|
2303
|
+
if (seen.has(pathKey))
|
|
2141
2304
|
return false;
|
|
2142
|
-
seen.add(
|
|
2305
|
+
seen.add(pathKey);
|
|
2143
2306
|
return true;
|
|
2144
2307
|
});
|
|
2145
2308
|
};
|