@humain/humain-code 0.5.4 → 0.6.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 +170 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-FGFIMZUF.js +66 -0
- package/dist/bundle/chunks/azure-openai-responses-6JNTC7KO.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +261 -237
- package/dist/bundle/chunks/chunk-2H3LUS62.js +1966 -0
- package/dist/bundle/chunks/{chunk-GEISZXXH.js → chunk-4ZBGTJJM.js} +1 -1
- package/dist/bundle/chunks/{chunk-QWXPGBAG.js → chunk-5JSLXC2A.js} +1 -1
- package/dist/bundle/chunks/{chunk-L2VKM23Q.js → chunk-6DE7LJKV.js} +21 -21
- package/dist/bundle/chunks/{chunk-V62QBESW.js → chunk-6E6RHNOU.js} +11 -10
- package/dist/bundle/chunks/chunk-7RZ5BS7U.js +2 -0
- package/dist/bundle/chunks/chunk-AHSNQWZU.js +24 -0
- package/dist/bundle/chunks/{chunk-UJLCKIMZ.js → chunk-AOH2O5CP.js} +3469 -3133
- package/dist/bundle/chunks/{chunk-ODJUBJK2.js → chunk-B7NJMF7B.js} +11 -11
- package/dist/bundle/chunks/chunk-BQ3TMEWD.js +7 -0
- package/dist/bundle/chunks/{chunk-KKCMWB63.js → chunk-C6VERWRZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-CN3Q5UNB.js → chunk-CFHOPLW5.js} +658 -574
- package/dist/bundle/chunks/chunk-CVC2GV26.js +1986 -0
- package/dist/bundle/chunks/{chunk-DU6POZ7E.js → chunk-DHW3REC5.js} +1 -1
- package/dist/bundle/chunks/{chunk-UTNHGOFS.js → chunk-EDONIPUJ.js} +38 -38
- package/dist/bundle/chunks/{chunk-FO2NYB6O.js → chunk-FDGW5ZTG.js} +1147 -1110
- package/dist/bundle/chunks/{chunk-XQX7S3GM.js → chunk-GICL5V54.js} +1 -1
- package/dist/bundle/chunks/chunk-H7Y4QY7K.js +11 -0
- package/dist/bundle/chunks/chunk-HW6HMUXS.js +188 -0
- package/dist/bundle/chunks/chunk-I6AQOITY.js +53 -0
- package/dist/bundle/chunks/{chunk-ZI7TK7HM.js → chunk-IADQJFNH.js} +21 -17
- package/dist/bundle/chunks/chunk-J7AP2BUJ.js +3 -0
- package/dist/bundle/chunks/chunk-JFE52VSN.js +120 -0
- package/dist/bundle/chunks/{chunk-MIJHJNNQ.js → chunk-LDGCU6PD.js} +127 -3
- package/dist/bundle/chunks/{chunk-PS7DGA7B.js → chunk-M4CHQBAI.js} +1 -1
- package/dist/bundle/chunks/{chunk-YDBNMIA3.js → chunk-NN53K2QQ.js} +19 -1
- package/dist/bundle/chunks/{chunk-RTXDU3AA.js → chunk-ONR6Q3II.js} +255 -195
- package/dist/bundle/chunks/{chunk-Y3OPKKDR.js → chunk-P4P7OZ7R.js} +34 -32
- package/dist/bundle/chunks/{chunk-OZNC2W4B.js → chunk-PCTLFSQG.js} +444 -411
- package/dist/bundle/chunks/{chunk-YFBDR4IW.js → chunk-PNGNZXOI.js} +3 -3
- package/dist/bundle/chunks/{chunk-UDB6NI4G.js → chunk-RGUZULEE.js} +593 -481
- package/dist/bundle/chunks/chunk-RO5YPAJH.js +23 -0
- package/dist/bundle/chunks/{chunk-A6B2QMA7.js → chunk-RU7ADKA7.js} +176 -162
- package/dist/bundle/chunks/{chunk-JCXXRCP6.js → chunk-T3KDZFM4.js} +16 -16
- package/dist/bundle/chunks/{chunk-HT5YN3LX.js → chunk-TEOMXMW6.js} +3 -3
- package/dist/bundle/chunks/{chunk-HIZWUSPN.js → chunk-VEGJT52D.js} +77 -77
- package/dist/bundle/chunks/{chunk-IDU5BNNI.js → chunk-XMZGB3H4.js} +12 -3
- package/dist/bundle/chunks/chunk-YEPHPMQC.js +647 -0
- package/dist/bundle/chunks/{chunk-XA7CJAYH.js → chunk-YRUIJ5AH.js} +48 -42
- package/dist/bundle/chunks/{cli-ENEFJH2B.js → cli-BNCWK54K.js} +21 -17
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T7TPP7SQ.js → cloudflare-workers-ai-system-one-KI6W3USX.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +81 -75
- package/dist/bundle/chunks/compat-I5VPOXFT.js +13 -0
- package/dist/bundle/chunks/dist-J5IUPLMH.js +37 -0
- package/dist/bundle/chunks/{dist-RKNCFFGM.js → dist-SKBR3C7C.js} +720 -696
- package/dist/bundle/chunks/dist-TVRQXUY6.js +8 -0
- package/dist/bundle/chunks/{dist-cjs-HTASUQXQ.js → dist-cjs-2SKN226B.js} +77 -77
- package/dist/bundle/chunks/{easter-egg-3d-YOPLCOVW.js → easter-egg-3d-673VRP6Y.js} +1 -1
- package/dist/bundle/chunks/{esm-R6HJ4QEG.js → esm-WPALMLUO.js} +3 -3
- package/dist/bundle/chunks/{event-streams-BR2IL6C5.js → event-streams-7YGFEPBZ.js} +1 -1
- package/dist/bundle/chunks/{execute-2JXEKQ2X.js → execute-PIUR5MUV.js} +23 -23
- package/dist/bundle/chunks/{extract-OTCGZGTL.js → extract-4O5Z5725.js} +74 -71
- package/dist/bundle/chunks/github-copilot.js +50 -51
- package/dist/bundle/chunks/google-generative-ai-635YZEHN.js +22 -0
- package/dist/bundle/chunks/google-vertex-I3ZJ3SB2.js +26 -0
- package/dist/bundle/chunks/host-OQOEIWHK.js +2 -0
- package/dist/bundle/chunks/image-resize-worker.js +3 -2
- package/dist/bundle/chunks/kimi-coding.js +13 -14
- package/dist/bundle/chunks/{llama-cpp-classify-B3G57LVR.js → llama-cpp-classify-PP63BYDF.js} +1 -1
- package/dist/bundle/chunks/meta.js +10 -10
- package/dist/bundle/chunks/mistral-conversations-OKG5GKXR.js +42 -0
- package/dist/bundle/chunks/{node-VSA4ZN7D.js → node-UGQUSQE6.js} +1 -1
- package/dist/bundle/chunks/{node-SJPZTR4K.js → node-UNHECG4X.js} +168 -157
- package/dist/bundle/chunks/openai-codex-responses-6JYZIFT4.js +100 -0
- package/dist/bundle/chunks/openai-completions-YBNI6CAP.js +82 -0
- package/dist/bundle/chunks/{openai-decisions-WOWUC65P.js → openai-decisions-5G5YBFRQ.js} +1 -1
- package/dist/bundle/chunks/openai-responses-C3APJ6MK.js +27 -0
- package/dist/bundle/chunks/{openrouter-images-5K47HDAT.js → openrouter-images-FCJT7C7I.js} +2 -2
- package/dist/bundle/chunks/{pdfjs-EK6K7CXX.js → pdfjs-AKD6EBKN.js} +196 -175
- package/dist/bundle/chunks/pdfjs-decoders-OFXX4HDZ.js +2 -0
- package/dist/bundle/chunks/pdfjs-jbig2-TXR26KRI.js +278 -0
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +326 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +671 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +974 -0
- package/dist/bundle/chunks/pi-messages-UHYZYEOC.js +25 -0
- package/dist/bundle/chunks/radius.js +8 -8
- package/dist/bundle/chunks/{runtime-K3F2QDQP.js → runtime-KE3HDSRT.js} +1 -1
- package/dist/bundle/chunks/{turndown.cjs-U7XOXH4O.js → turndown.cjs-WKGZX7NZ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-43OCHGKP.js → typesafe-system-one-VYVAMWQV.js} +1 -1
- package/dist/bundle/chunks/{undici-EK3EUI2E.js → undici-C6S56CGI.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-KDUZIB3W.js +23 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/flow/package.json +5 -5
- package/dist/bundle/index.js +10 -10
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +29 -5
- package/dist/config.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts +8 -5
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +32 -6
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +19 -1
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +23 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +142 -39
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +4 -0
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +71 -1
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/codex-reset.d.ts +45 -0
- package/dist/core/codex-reset.d.ts.map +1 -0
- package/dist/core/codex-reset.js +190 -0
- package/dist/core/codex-reset.js.map +1 -0
- package/dist/core/codex-usage.d.ts +4 -2
- package/dist/core/codex-usage.d.ts.map +1 -1
- package/dist/core/codex-usage.js +9 -4
- package/dist/core/codex-usage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +3 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +25 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +37 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +274 -65
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +19 -6
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +49 -11
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +9 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +105 -61
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.html +2 -0
- package/dist/core/export-html/template.js +200 -62
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/types.d.ts +27 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +7 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +107 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +56 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +14 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +9 -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 +1691 -2042
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +35 -4
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +70 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +16 -10
- 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 +21 -17
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +29 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +311 -60
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +164 -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/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 +4 -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 +66 -26
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +2 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +19 -8
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +70 -16
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +15 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +37 -3
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +13 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/subscription-credits.d.ts +14 -0
- package/dist/core/subscription-credits.d.ts.map +1 -0
- package/dist/core/subscription-credits.js +10 -0
- package/dist/core/subscription-credits.js.map +1 -0
- package/dist/core/subscription-reset-status.d.ts +10 -0
- package/dist/core/subscription-reset-status.d.ts.map +1 -0
- package/dist/core/subscription-reset-status.js +2 -0
- package/dist/core/subscription-reset-status.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +7 -3
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +42 -12
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +3 -3
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +37 -29
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +9 -8
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +8 -5
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +17 -9
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +16 -4
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.js +4 -3
- package/dist/extensions/mcp/index.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 +7 -3
- 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 +56 -28
- 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/extensions/usage/confirmation.d.ts +40 -0
- package/dist/extensions/usage/confirmation.d.ts.map +1 -0
- package/dist/extensions/usage/confirmation.js +198 -0
- package/dist/extensions/usage/confirmation.js.map +1 -0
- package/dist/extensions/usage/index.d.ts +4 -4
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +352 -33
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +8 -1
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +54 -11
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/popup.d.ts +37 -6
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +396 -45
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +564 -130
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +1 -0
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/web-access/host.d.ts +2 -1
- package/dist/humain/web-access/host.d.ts.map +1 -1
- package/dist/humain/web-access/host.js +1 -1
- package/dist/humain/web-access/host.js.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts +2 -0
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.js +2 -2
- package/dist/humain/web-access/vendor/brave-rate-limit.js.map +1 -1
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts +5 -0
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js +230 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js.map +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +18 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +12 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +33 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +84 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts +3 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.js +54 -49
- package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
- package/dist/humain/web-access/vendor/exa.d.ts +8 -3
- package/dist/humain/web-access/vendor/exa.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/exa.js +129 -14
- package/dist/humain/web-access/vendor/exa.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +68 -10
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.js +2 -2
- package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
- package/dist/humain/web-access/vendor/field-extract.d.ts +38 -0
- package/dist/humain/web-access/vendor/field-extract.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/field-extract.js +350 -0
- package/dist/humain/web-access/vendor/field-extract.js.map +1 -0
- package/dist/humain/web-access/vendor/gemini-search.d.ts +15 -4
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +198 -16
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/github-api.js +1 -1
- package/dist/humain/web-access/vendor/github-api.js.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.js +3 -2
- package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +137 -118
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js.map +1 -1
- package/dist/humain/web-access/vendor/ninerouter.d.ts +4 -0
- package/dist/humain/web-access/vendor/ninerouter.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/ninerouter.js +110 -0
- package/dist/humain/web-access/vendor/ninerouter.js.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts +27 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js +61 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js.map +1 -0
- package/dist/humain/web-access/vendor/openai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/openai-search.js +39 -13
- package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
- package/dist/humain/web-access/vendor/outcrawl.d.ts +4 -0
- package/dist/humain/web-access/vendor/outcrawl.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/outcrawl.js +196 -0
- package/dist/humain/web-access/vendor/outcrawl.js.map +1 -0
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +13 -3
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.d.ts +1 -3
- package/dist/humain/web-access/vendor/pdf-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.js +0 -2
- package/dist/humain/web-access/vendor/pdf-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.d.ts +3 -0
- package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.d.ts +2 -2
- package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.js +39 -13
- package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
- package/dist/humain/web-access/vendor/searchapi.d.ts +4 -0
- package/dist/humain/web-access/vendor/searchapi.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/searchapi.js +195 -0
- package/dist/humain/web-access/vendor/searchapi.js.map +1 -0
- package/dist/humain/web-access/vendor/sofya.d.ts +4 -0
- package/dist/humain/web-access/vendor/sofya.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/sofya.js +193 -0
- package/dist/humain/web-access/vendor/sofya.js.map +1 -0
- package/dist/humain/web-access/vendor/source-check.d.ts +5 -1
- package/dist/humain/web-access/vendor/source-check.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/source-check.js +34 -16
- package/dist/humain/web-access/vendor/source-check.js.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts +7 -0
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js +24 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts +8 -3
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js +15 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts +7 -2
- package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.js +32 -28
- package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
- package/dist/humain/web-access/vendor/tabstack.d.ts +6 -0
- package/dist/humain/web-access/vendor/tabstack.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/tabstack.js +236 -0
- package/dist/humain/web-access/vendor/tabstack.js.map +1 -0
- package/dist/humain/web-access/vendor/tool-arguments.js +1 -1
- package/dist/humain/web-access/vendor/tool-arguments.js.map +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts +8 -0
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js +46 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -0
- package/dist/humain/web-access/vendor/utils.d.ts +9 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +113 -27
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts +4 -0
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +17 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +99 -22
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.js +6 -5
- package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
- package/dist/index.d.ts +3 -3
- 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 +20 -9
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-code-block.d.ts +34 -0
- package/dist/modes/interactive/components/assistant-code-block.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-code-block.js +160 -0
- package/dist/modes/interactive/components/assistant-code-block.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +31 -10
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +276 -73
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +2 -1
- 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 -17
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +7 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +3 -1
- 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/footer.d.ts +4 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +6 -5
- package/dist/modes/interactive/components/footer.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 +107 -11
- 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.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +18 -6
- 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 +16 -24
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +2 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +15 -5
- 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 +4 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +20 -18
- 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 +6 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +259 -83
- 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/oauth-account-format.d.ts +10 -1
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +42 -0
- package/dist/modes/interactive/oauth-account-format.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 +28 -24
- 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 +3 -2
- package/dist/modes/print-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/clipboard-image.d.ts +8 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +31 -1
- package/dist/utils/clipboard-image.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 +96 -6
- 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 +2 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +12 -2
- 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 +156 -11
- 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 -12
- package/docs/compaction.md +32 -8
- package/docs/coordination.md +2 -0
- package/docs/custom-provider.md +4 -2
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +3169 -229
- package/docs/flow.md +2 -0
- package/docs/keybindings.md +24 -2
- package/docs/llama-cpp.md +30 -19
- package/docs/mcp.md +4 -2
- package/docs/message-types.md +7 -7
- package/docs/packages.md +27 -1
- package/docs/sessions.md +11 -3
- package/docs/settings.md +21 -9
- package/docs/slash-commands.md +51 -11
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +3 -1
- package/docs/windows.md +27 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- package/examples/extensions/custom-provider-anthropic/package-lock.json +7 -7
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- 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 +14 -24
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +252 -0
- package/npm-shrinkwrap.json +289 -277
- package/package.json +29 -29
- package/schemas/keybindings.schema.json +28 -0
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +49 -0
- package/src/humain/ponytail/UPSTREAM.md +16 -2
- package/src/humain/ponytail/upstream.json +4 -4
- package/src/humain/web-access/UPSTREAM.md +48 -1
- package/src/humain/web-access/upstream.json +9 -6
- package/src/humain/web-access/vendor/CHANGELOG.md +1223 -0
- package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +0 -67
- package/dist/bundle/chunks/azure-openai-responses-QJFYQ3DF.js +0 -15
- package/dist/bundle/chunks/chunk-2GCMACT4.js +0 -1956
- package/dist/bundle/chunks/chunk-AO6FF5JL.js +0 -21
- package/dist/bundle/chunks/chunk-EY3LZOUP.js +0 -1963
- package/dist/bundle/chunks/chunk-M74U5X4S.js +0 -119
- package/dist/bundle/chunks/chunk-N7CQ3UV3.js +0 -80
- package/dist/bundle/chunks/chunk-OR25QDSS.js +0 -365
- package/dist/bundle/chunks/chunk-PH7UP57J.js +0 -6
- package/dist/bundle/chunks/chunk-QW6PTCAB.js +0 -10
- package/dist/bundle/chunks/chunk-ROZV2IYD.js +0 -125
- package/dist/bundle/chunks/chunk-YFOLLX5D.js +0 -23
- package/dist/bundle/chunks/chunk-ZR4GF4WU.js +0 -54
- package/dist/bundle/chunks/compat-CJBWWYHE.js +0 -13
- package/dist/bundle/chunks/dist-IBUWEKEE.js +0 -24
- package/dist/bundle/chunks/dist-YFMJEHPH.js +0 -8
- package/dist/bundle/chunks/google-generative-ai-HVPCGIZ6.js +0 -21
- package/dist/bundle/chunks/google-vertex-UM5MAALA.js +0 -25
- package/dist/bundle/chunks/host-ZHEL5XQW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-AH72RLXK.js +0 -44
- package/dist/bundle/chunks/openai-codex-responses-L366637C.js +0 -98
- package/dist/bundle/chunks/openai-completions-ZP62QXJX.js +0 -83
- package/dist/bundle/chunks/openai-responses-DXUGSUTN.js +0 -26
- package/dist/bundle/chunks/pi-messages-MOQQDZBK.js +0 -23
- package/dist/bundle/chunks/virtual-modules-5D6QIJPN.js +0 -5
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -66
- package/examples/extensions/sandbox/package.json +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { chmodSync, existsSync, globSync, mkdirSync, readdirSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
function getEnv() {
|
|
5
5
|
if (process.platform !== "linux" || Object.keys(process.env).length > 0) {
|
|
@@ -20,23 +20,23 @@ function getEnv() {
|
|
|
20
20
|
return process.env;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
23
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
24
24
|
import ignore from "ignore";
|
|
25
25
|
import { minimatch } from "minimatch";
|
|
26
26
|
import { gt, maxSatisfying, rcompare, satisfies, valid, validRange } from "semver";
|
|
27
|
-
import { CONFIG_DIR_NAME } from "../config.js";
|
|
27
|
+
import { CONFIG_DIR_NAME, ENV_OFFLINE } from "../config.js";
|
|
28
28
|
import { spawnProcess, spawnProcessSync } from "../utils/child-process.js";
|
|
29
29
|
import { parseGitUrl } from "../utils/git.js";
|
|
30
|
-
import { canonicalizePath, isLocalPath, markPathIgnoredByCloudSync, normalizePath, resolvePath, } from "../utils/paths.js";
|
|
30
|
+
import { canonicalizePath, getPathComparisonKey, isLocalPath, markPathIgnoredByCloudSync, normalizePath, pathsEqual, resolvePath, } from "../utils/paths.js";
|
|
31
31
|
import { stripBom } from "../utils/text.js";
|
|
32
32
|
import { isStdoutTakenOver } from "./output-guard.js";
|
|
33
33
|
import { readPiManifest } from "./pi-manifest.js";
|
|
34
|
-
import { BUILTIN_PATH_PREFIX } from "./source-info.js";
|
|
34
|
+
import { BUILTIN_PATH_PREFIX, getResourcePathKey } from "./source-info.js";
|
|
35
35
|
const NETWORK_TIMEOUT_MS = 10000;
|
|
36
36
|
const UPDATE_CHECK_CONCURRENCY = 4;
|
|
37
37
|
const GIT_UPDATE_CONCURRENCY = 4;
|
|
38
38
|
function isOfflineModeEnabled() {
|
|
39
|
-
const value = process.env.PI_OFFLINE;
|
|
39
|
+
const value = process.env[ENV_OFFLINE] ?? process.env.PI_OFFLINE;
|
|
40
40
|
if (!value)
|
|
41
41
|
return false;
|
|
42
42
|
return value === "1" || value.toLowerCase() === "true" || value.toLowerCase() === "yes";
|
|
@@ -489,6 +489,33 @@ function collectResourceFiles(dir, resourceType) {
|
|
|
489
489
|
}
|
|
490
490
|
return collectFiles(dir, FILE_PATTERNS[resourceType]);
|
|
491
491
|
}
|
|
492
|
+
// A `pi` object counts as an explicit resource manifest only when it lists resources. Packages whose
|
|
493
|
+
// `pi` object holds only metadata (changelogPath, gallery image/video) still use directory auto-discovery.
|
|
494
|
+
function hasManifestResourceFields(manifest) {
|
|
495
|
+
return RESOURCE_TYPES.some((resourceType) => manifest[resourceType] !== undefined);
|
|
496
|
+
}
|
|
497
|
+
function isPathInside(parent, child) {
|
|
498
|
+
const relativePath = relative(parent, child);
|
|
499
|
+
return (relativePath !== "" && relativePath !== ".." && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath));
|
|
500
|
+
}
|
|
501
|
+
function resolvePackageChangelogPath(packageRoot, manifest) {
|
|
502
|
+
const changelogPath = manifest?.changelogPath ?? "CHANGELOG.md";
|
|
503
|
+
if (!changelogPath)
|
|
504
|
+
return undefined;
|
|
505
|
+
const resolvedPath = resolve(packageRoot, changelogPath);
|
|
506
|
+
if (!existsSync(resolvedPath))
|
|
507
|
+
return undefined;
|
|
508
|
+
const canonicalPackageRoot = canonicalizePath(packageRoot);
|
|
509
|
+
const canonicalChangelogPath = canonicalizePath(resolvedPath);
|
|
510
|
+
if (!isPathInside(canonicalPackageRoot, canonicalChangelogPath))
|
|
511
|
+
return undefined;
|
|
512
|
+
try {
|
|
513
|
+
return statSync(resolvedPath).isFile() ? resolvedPath : undefined;
|
|
514
|
+
}
|
|
515
|
+
catch {
|
|
516
|
+
return undefined;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
492
519
|
function matchesAnyPattern(filePath, patterns, baseDir) {
|
|
493
520
|
const rel = toPosixPath(relative(baseDir, filePath));
|
|
494
521
|
const name = basename(filePath);
|
|
@@ -736,7 +763,7 @@ export class DefaultPackageManager {
|
|
|
736
763
|
}
|
|
737
764
|
// Dedupe: project scope wins over global for same package identity
|
|
738
765
|
const packageSources = this.dedupePackages(allPackages);
|
|
739
|
-
await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
766
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator, onMissing);
|
|
740
767
|
const globalBaseDir = this.agentDir;
|
|
741
768
|
const projectBaseDir = join(this.cwd, CONFIG_DIR_NAME);
|
|
742
769
|
for (const resourceType of RESOURCE_TYPES) {
|
|
@@ -762,7 +789,7 @@ export class DefaultPackageManager {
|
|
|
762
789
|
const projectEnabled = applyAutoloadDisabledPatterns([path], getOverridePatterns(projectSettings.extensions ?? []), projectBaseDir).get(path);
|
|
763
790
|
this.addResource(accumulator.extensions, path, { source: "builtin", scope: projectEnabled === undefined ? "user" : "project", origin: "top-level" }, projectEnabled ?? isEnabledByOverrides(path, globalSettings.extensions ?? [], globalBaseDir));
|
|
764
791
|
}
|
|
765
|
-
return this.toResolvedPaths(accumulator);
|
|
792
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
766
793
|
}
|
|
767
794
|
async resolveExtensionSources(sources, options) {
|
|
768
795
|
const accumulator = this.createAccumulator();
|
|
@@ -774,8 +801,8 @@ export class DefaultPackageManager {
|
|
|
774
801
|
const packageSources = sources
|
|
775
802
|
.filter((source) => !source.startsWith(BUILTIN_PATH_PREFIX))
|
|
776
803
|
.map((source) => ({ pkg: source, scope }));
|
|
777
|
-
await this.resolvePackageSources(packageSources, accumulator);
|
|
778
|
-
return this.toResolvedPaths(accumulator);
|
|
804
|
+
const installFailures = await this.resolvePackageSources(packageSources, accumulator);
|
|
805
|
+
return { ...this.toResolvedPaths(accumulator), installFailures };
|
|
779
806
|
}
|
|
780
807
|
listConfiguredPackages() {
|
|
781
808
|
const globalSettings = this.settingsManager.getGlobalSettings();
|
|
@@ -898,10 +925,13 @@ export class DefaultPackageManager {
|
|
|
898
925
|
gitCandidates.push({ ...entry, parsed });
|
|
899
926
|
}
|
|
900
927
|
}
|
|
901
|
-
const npmCheckTasks = npmCandidates.map((entry) => async () =>
|
|
902
|
-
entry,
|
|
903
|
-
|
|
904
|
-
|
|
928
|
+
const npmCheckTasks = npmCandidates.map((entry) => async () => {
|
|
929
|
+
const check = await this.shouldUpdateNpmSource(entry.parsed, entry.scope);
|
|
930
|
+
return {
|
|
931
|
+
entry: { ...entry, installedVersion: check.installedVersion, targetVersion: check.targetVersion },
|
|
932
|
+
shouldUpdate: check.shouldUpdate,
|
|
933
|
+
};
|
|
934
|
+
});
|
|
905
935
|
const npmCheckResults = await this.runWithConcurrency(npmCheckTasks, UPDATE_CHECK_CONCURRENCY);
|
|
906
936
|
const userNpmUpdates = [];
|
|
907
937
|
const projectNpmUpdates = [];
|
|
@@ -935,15 +965,15 @@ export class DefaultPackageManager {
|
|
|
935
965
|
const installedPath = this.getManagedNpmInstallPath(source, scope);
|
|
936
966
|
const installedVersion = existsSync(installedPath) ? this.getInstalledNpmVersion(installedPath) : undefined;
|
|
937
967
|
if (!installedVersion) {
|
|
938
|
-
return true;
|
|
968
|
+
return { shouldUpdate: true };
|
|
939
969
|
}
|
|
940
970
|
try {
|
|
941
|
-
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
942
|
-
return gt(targetVersion, installedVersion);
|
|
971
|
+
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range, scope);
|
|
972
|
+
return { shouldUpdate: gt(targetVersion, installedVersion), installedVersion, targetVersion };
|
|
943
973
|
}
|
|
944
974
|
catch {
|
|
945
975
|
// Preserve existing update behavior when version lookup fails.
|
|
946
|
-
return true;
|
|
976
|
+
return { shouldUpdate: true, installedVersion };
|
|
947
977
|
}
|
|
948
978
|
}
|
|
949
979
|
async updateNpmBatch(sources, scope) {
|
|
@@ -954,13 +984,36 @@ export class DefaultPackageManager {
|
|
|
954
984
|
const message = sources.length === 1 ? `Updating ${sources[0].source}...` : `Updating ${scope} npm packages...`;
|
|
955
985
|
const specs = sources.map((entry) => (entry.parsed.version ? entry.parsed.spec : `${entry.parsed.name}@latest`));
|
|
956
986
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
957
|
-
await this.installNpmBatch(specs, scope);
|
|
987
|
+
await this.installNpmBatch(specs, scope, sourceLabel);
|
|
958
988
|
});
|
|
989
|
+
this.reportUnchangedNpmUpdates(sources, scope);
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* npm can resolve stale registry metadata shortly after a publish and install the old
|
|
993
|
+
* version without an error. Warn when an announced update did not change the installed version.
|
|
994
|
+
*/
|
|
995
|
+
reportUnchangedNpmUpdates(sources, scope) {
|
|
996
|
+
for (const entry of sources) {
|
|
997
|
+
if (!entry.installedVersion || !entry.targetVersion) {
|
|
998
|
+
continue;
|
|
999
|
+
}
|
|
1000
|
+
const installedPath = this.getManagedNpmInstallPath(entry.parsed, scope);
|
|
1001
|
+
const versionAfter = this.getInstalledNpmVersion(installedPath);
|
|
1002
|
+
if (versionAfter !== entry.installedVersion) {
|
|
1003
|
+
continue;
|
|
1004
|
+
}
|
|
1005
|
+
this.emitProgress({
|
|
1006
|
+
type: "progress",
|
|
1007
|
+
action: "update",
|
|
1008
|
+
source: entry.source,
|
|
1009
|
+
message: `${entry.source} is still ${versionAfter} (registry reports ${entry.targetVersion}); npm registry metadata may be stale, try again in a few minutes`,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
959
1012
|
}
|
|
960
|
-
async installNpmBatch(specs, scope) {
|
|
1013
|
+
async installNpmBatch(specs, scope, sourceLabel) {
|
|
961
1014
|
const installRoot = this.getNpmInstallRoot(scope, false);
|
|
962
1015
|
this.ensureNpmProject(installRoot);
|
|
963
|
-
await this.
|
|
1016
|
+
await this.runNpmCommandInRoot(installRoot, this.getNpmInstallArgs(specs, installRoot), "update", sourceLabel);
|
|
964
1017
|
}
|
|
965
1018
|
async checkForAvailableUpdates() {
|
|
966
1019
|
if (isOfflineModeEnabled()) {
|
|
@@ -989,7 +1042,7 @@ export class DefaultPackageManager {
|
|
|
989
1042
|
if (!existsSync(installedPath)) {
|
|
990
1043
|
return undefined;
|
|
991
1044
|
}
|
|
992
|
-
const hasUpdate = await this.npmHasAvailableUpdate(parsed, installedPath);
|
|
1045
|
+
const hasUpdate = await this.npmHasAvailableUpdate(parsed, installedPath, entry.scope);
|
|
993
1046
|
if (!hasUpdate) {
|
|
994
1047
|
return undefined;
|
|
995
1048
|
}
|
|
@@ -1019,6 +1072,7 @@ export class DefaultPackageManager {
|
|
|
1019
1072
|
return results.filter((result) => result !== undefined);
|
|
1020
1073
|
}
|
|
1021
1074
|
async resolvePackageSources(sources, accumulator, onMissing) {
|
|
1075
|
+
const installFailures = [];
|
|
1022
1076
|
for (const { pkg, scope } of sources) {
|
|
1023
1077
|
const sourceStr = typeof pkg === "string" ? pkg : pkg.source;
|
|
1024
1078
|
const filter = typeof pkg === "object" ? pkg : undefined;
|
|
@@ -1035,21 +1089,46 @@ export class DefaultPackageManager {
|
|
|
1035
1089
|
const installMissing = async () => {
|
|
1036
1090
|
if (isOfflineModeEnabled())
|
|
1037
1091
|
return false;
|
|
1038
|
-
if (
|
|
1092
|
+
if (onMissing) {
|
|
1093
|
+
const action = await onMissing(resolvedSource);
|
|
1094
|
+
if (action === "skip")
|
|
1095
|
+
return false;
|
|
1096
|
+
if (action === "error")
|
|
1097
|
+
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1098
|
+
}
|
|
1099
|
+
// A source that cannot be installed (no network, missing package, failing git prepare step)
|
|
1100
|
+
// must not abort startup. Skip its resources, like offline mode does, and report the failure.
|
|
1101
|
+
try {
|
|
1039
1102
|
await this.installParsedSource(parsed, resolvedScope);
|
|
1040
1103
|
return true;
|
|
1041
1104
|
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1105
|
+
catch (error) {
|
|
1106
|
+
installFailures.push({
|
|
1107
|
+
source: resolvedSource,
|
|
1108
|
+
scope: resolvedScope,
|
|
1109
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1110
|
+
});
|
|
1044
1111
|
return false;
|
|
1045
|
-
|
|
1046
|
-
throw new Error(`Missing source: ${resolvedSource}`);
|
|
1047
|
-
await this.installParsedSource(parsed, resolvedScope);
|
|
1048
|
-
return true;
|
|
1112
|
+
}
|
|
1049
1113
|
};
|
|
1050
1114
|
if (parsed.type === "npm") {
|
|
1051
1115
|
let installedPath = this.getNpmInstallPath(parsed, resolvedScope);
|
|
1052
1116
|
const needsInstall = !existsSync(installedPath) || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1117
|
+
if (!needsInstall &&
|
|
1118
|
+
resolvedScope === "temporary" &&
|
|
1119
|
+
!parsed.pinned &&
|
|
1120
|
+
(await this.npmHasAvailableUpdate(parsed, installedPath, resolvedScope))) {
|
|
1121
|
+
// Temporary (-e) sources have no `pi update` path, so refresh unpinned ones on load like
|
|
1122
|
+
// temporary git sources. Like `pi update`, install `name@latest` for unversioned specs because a bare
|
|
1123
|
+
// `npm install name` keeps the range already saved in the temporary package.json.
|
|
1124
|
+
const spec = parsed.version ? parsed.spec : `${parsed.name}@latest`;
|
|
1125
|
+
try {
|
|
1126
|
+
await this.installNpm({ ...parsed, spec }, resolvedScope, true);
|
|
1127
|
+
}
|
|
1128
|
+
catch {
|
|
1129
|
+
// Keep the cached install if the refresh fails.
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1053
1132
|
if (needsInstall) {
|
|
1054
1133
|
const installed = await installMissing();
|
|
1055
1134
|
if (!installed)
|
|
@@ -1068,14 +1147,15 @@ export class DefaultPackageManager {
|
|
|
1068
1147
|
if (!installed)
|
|
1069
1148
|
continue;
|
|
1070
1149
|
}
|
|
1071
|
-
else if (resolvedScope === "temporary" && !
|
|
1072
|
-
await this.refreshTemporaryGitSource(parsed, resolvedSource);
|
|
1150
|
+
else if (resolvedScope === "temporary" && !isOfflineModeEnabled()) {
|
|
1151
|
+
await this.refreshTemporaryGitSource(parsed, resolvedSource, installedPath);
|
|
1073
1152
|
}
|
|
1074
1153
|
metadata.baseDir = installedPath;
|
|
1075
1154
|
metadata.packageRoot = installedPath;
|
|
1076
1155
|
this.collectPackageResources(installedPath, accumulator, filter, metadata);
|
|
1077
1156
|
}
|
|
1078
1157
|
}
|
|
1158
|
+
return installFailures;
|
|
1079
1159
|
}
|
|
1080
1160
|
findAutoloadDeltaBase(pkg, scope, sources) {
|
|
1081
1161
|
if (scope !== "project" || typeof pkg !== "object" || pkg.autoload !== false)
|
|
@@ -1131,7 +1211,7 @@ export class DefaultPackageManager {
|
|
|
1131
1211
|
if (parsed.type === "git") {
|
|
1132
1212
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1133
1213
|
}
|
|
1134
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1214
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1135
1215
|
}
|
|
1136
1216
|
getSourceMatchKeyForSettings(source, scope) {
|
|
1137
1217
|
const parsed = this.parseSource(source);
|
|
@@ -1142,7 +1222,7 @@ export class DefaultPackageManager {
|
|
|
1142
1222
|
return `git:${parsed.host}/${parsed.path}`;
|
|
1143
1223
|
}
|
|
1144
1224
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1145
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1225
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1146
1226
|
}
|
|
1147
1227
|
buildNoMatchingPackageMessage(source, configuredPackages) {
|
|
1148
1228
|
const suggestion = this.findSuggestedConfiguredSource(source, configuredPackages);
|
|
@@ -1218,7 +1298,7 @@ export class DefaultPackageManager {
|
|
|
1218
1298
|
}
|
|
1219
1299
|
return source.range ? satisfies(installedVersion, source.range) : true;
|
|
1220
1300
|
}
|
|
1221
|
-
async npmHasAvailableUpdate(source, installedPath) {
|
|
1301
|
+
async npmHasAvailableUpdate(source, installedPath, scope) {
|
|
1222
1302
|
if (isOfflineModeEnabled()) {
|
|
1223
1303
|
return false;
|
|
1224
1304
|
}
|
|
@@ -1227,7 +1307,7 @@ export class DefaultPackageManager {
|
|
|
1227
1307
|
return false;
|
|
1228
1308
|
}
|
|
1229
1309
|
try {
|
|
1230
|
-
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
1310
|
+
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range, scope);
|
|
1231
1311
|
return gt(targetVersion, installedVersion);
|
|
1232
1312
|
}
|
|
1233
1313
|
catch {
|
|
@@ -1247,9 +1327,12 @@ export class DefaultPackageManager {
|
|
|
1247
1327
|
return undefined;
|
|
1248
1328
|
}
|
|
1249
1329
|
}
|
|
1250
|
-
async getLatestNpmVersion(packageSpec, range) {
|
|
1330
|
+
async getLatestNpmVersion(packageSpec, range, scope = "user") {
|
|
1251
1331
|
const npmCommand = this.getNpmCommand();
|
|
1252
|
-
const
|
|
1332
|
+
const installRoot = this.getNpmInstallRoot(scope, scope === "temporary");
|
|
1333
|
+
const stdout = await this.runCommandCapture(npmCommand.command, [...npmCommand.args, "view", packageSpec, "version", "--json"],
|
|
1334
|
+
// Do not read the opened folder's .npmrc: it can redirect registries and expanded credentials.
|
|
1335
|
+
{ cwd: existsSync(installRoot) ? installRoot : this.agentDir, timeoutMs: NETWORK_TIMEOUT_MS });
|
|
1253
1336
|
const raw = stdout.trim();
|
|
1254
1337
|
if (!raw)
|
|
1255
1338
|
throw new Error("Empty response from npm view");
|
|
@@ -1421,9 +1504,9 @@ export class DefaultPackageManager {
|
|
|
1421
1504
|
}
|
|
1422
1505
|
if (scope) {
|
|
1423
1506
|
const baseDir = this.getBaseDirForScope(scope);
|
|
1424
|
-
return `local:${this.resolvePathFromBase(parsed.path, baseDir)}`;
|
|
1507
|
+
return `local:${getPathComparisonKey(this.resolvePathFromBase(parsed.path, baseDir))}`;
|
|
1425
1508
|
}
|
|
1426
|
-
return `local:${this.resolvePath(parsed.path)}`;
|
|
1509
|
+
return `local:${getPathComparisonKey(this.resolvePath(parsed.path))}`;
|
|
1427
1510
|
}
|
|
1428
1511
|
/**
|
|
1429
1512
|
* Dedupe packages: if same package identity appears in both global and project,
|
|
@@ -1516,7 +1599,7 @@ export class DefaultPackageManager {
|
|
|
1516
1599
|
"--ignore-scripts",
|
|
1517
1600
|
];
|
|
1518
1601
|
case "npm":
|
|
1519
|
-
return ["install", "--omit=dev", "--legacy-peer-deps", "--ignore-scripts"];
|
|
1602
|
+
return ["install", "--omit=dev", "--legacy-peer-deps", "--ignore-scripts", "--no-audit", "--no-fund"];
|
|
1520
1603
|
default:
|
|
1521
1604
|
return ["install", "--ignore-scripts"];
|
|
1522
1605
|
}
|
|
@@ -1525,7 +1608,9 @@ export class DefaultPackageManager {
|
|
|
1525
1608
|
const npmCommand = this.getNpmCommand();
|
|
1526
1609
|
return this.runCommandSync(npmCommand.command, [...npmCommand.args, ...args]);
|
|
1527
1610
|
}
|
|
1528
|
-
getNpmInstallArgs(specs,
|
|
1611
|
+
getNpmInstallArgs(specs, root) {
|
|
1612
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1613
|
+
const installRoot = existsSync(root) ? realpathSync(root) : root;
|
|
1529
1614
|
const packageManagerName = this.getPackageManagerName();
|
|
1530
1615
|
// Extension packages run inside pi and resolve pi APIs through loader aliases/virtual modules.
|
|
1531
1616
|
// Disable peer dependency resolution for managed installs (npm's --legacy-peer-deps, and
|
|
@@ -1546,28 +1631,165 @@ export class DefaultPackageManager {
|
|
|
1546
1631
|
"--ignore-scripts",
|
|
1547
1632
|
];
|
|
1548
1633
|
}
|
|
1549
|
-
|
|
1634
|
+
// npm audit fix would run without --legacy-peer-deps and install pi peers, so skip audit advice.
|
|
1635
|
+
return [
|
|
1636
|
+
"install",
|
|
1637
|
+
...specs,
|
|
1638
|
+
"--prefix",
|
|
1639
|
+
installRoot,
|
|
1640
|
+
"--legacy-peer-deps",
|
|
1641
|
+
"--ignore-scripts",
|
|
1642
|
+
"--no-audit",
|
|
1643
|
+
"--no-fund",
|
|
1644
|
+
];
|
|
1550
1645
|
}
|
|
1551
1646
|
async installNpm(source, scope, temporary) {
|
|
1552
1647
|
const installRoot = this.getNpmInstallRoot(scope, temporary);
|
|
1553
1648
|
this.ensureNpmProject(installRoot);
|
|
1554
|
-
|
|
1649
|
+
const args = this.getNpmInstallArgs([source.spec], installRoot);
|
|
1650
|
+
if (temporary) {
|
|
1651
|
+
await this.runNpmCommand(args);
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
await this.runNpmCommandInRoot(installRoot, args, "install", `npm:${source.spec}`);
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Run an install or uninstall in a managed npm root and report what it pruned. npm, pnpm, and bun reify the
|
|
1658
|
+
* whole root, so packages that are not saved in its package.json (for example installed with
|
|
1659
|
+
* `npm install --no-save`) are removed along with their dependencies, and the package manager's summary line
|
|
1660
|
+
* is easy to miss.
|
|
1661
|
+
*/
|
|
1662
|
+
async runNpmCommandInRoot(installRoot, args, action, source) {
|
|
1663
|
+
const unsaved = this.getUnsavedNpmPackages(installRoot);
|
|
1664
|
+
await this.runNpmCommand(args);
|
|
1665
|
+
if (unsaved.packages.length === 0) {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
const removed = unsaved.packages.filter(({ path }) => !existsSync(path)).map(({ name }) => name);
|
|
1669
|
+
if (removed.length === 0) {
|
|
1670
|
+
return;
|
|
1671
|
+
}
|
|
1672
|
+
const removedRoots = unsaved.roots.filter((name) => removed.includes(name));
|
|
1673
|
+
const listed = removedRoots.length > 0 ? removedRoots : removed;
|
|
1674
|
+
this.emitProgress({
|
|
1675
|
+
type: "progress",
|
|
1676
|
+
action,
|
|
1677
|
+
source,
|
|
1678
|
+
message: `${this.getPackageManagerName()} removed ${removed.length} ${removed.length === 1 ? "package" : "packages"} not saved in ${join(installRoot, "package.json")}: ${listed.join(", ")}. Save packages kept in this folder as dependencies in that package.json so installs and updates keep them.`,
|
|
1679
|
+
});
|
|
1680
|
+
}
|
|
1681
|
+
getUnsavedNpmPackages(installRoot) {
|
|
1682
|
+
const nodeModulesDir = join(installRoot, "node_modules");
|
|
1683
|
+
const saved = this.readNpmManifestDependencies(join(installRoot, "package.json"), true);
|
|
1684
|
+
if (!saved || !existsSync(nodeModulesDir)) {
|
|
1685
|
+
return { packages: [], roots: [] };
|
|
1686
|
+
}
|
|
1687
|
+
// Every installed copy by path, top-level and nested, since one package can be installed at several versions.
|
|
1688
|
+
const copies = new Map();
|
|
1689
|
+
const collect = (dir, topLevel) => {
|
|
1690
|
+
for (const entry of this.listNodeModulesPackages(dir)) {
|
|
1691
|
+
const path = join(dir, entry.name);
|
|
1692
|
+
const dependencies = this.readNpmManifestDependencies(join(path, "package.json"), false) ?? [];
|
|
1693
|
+
copies.set(path, { name: entry.name, path, topLevel, dependencies });
|
|
1694
|
+
// Symlinked packages (pnpm, local links) resolve their dependencies outside this tree.
|
|
1695
|
+
if (!entry.symlink)
|
|
1696
|
+
collect(join(path, "node_modules"), false);
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
collect(nodeModulesDir, true);
|
|
1700
|
+
// Resolve a dependency like Node does: the nearest node_modules folder from the dependent up to the root.
|
|
1701
|
+
const resolve = (fromDir, name) => {
|
|
1702
|
+
for (let dir = fromDir;; dir = dirname(dir)) {
|
|
1703
|
+
if (basename(dir) !== "node_modules") {
|
|
1704
|
+
const candidate = join(dir, "node_modules", name);
|
|
1705
|
+
if (copies.has(candidate))
|
|
1706
|
+
return candidate;
|
|
1707
|
+
}
|
|
1708
|
+
if (dir === installRoot || dirname(dir) === dir)
|
|
1709
|
+
return undefined;
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
const resolveAll = (fromDir, names) => names.flatMap((name) => resolve(fromDir, name) ?? []);
|
|
1713
|
+
const reachable = new Set();
|
|
1714
|
+
const pending = resolveAll(installRoot, saved);
|
|
1715
|
+
for (let path = pending.pop(); path !== undefined; path = pending.pop()) {
|
|
1716
|
+
if (reachable.has(path))
|
|
1717
|
+
continue;
|
|
1718
|
+
reachable.add(path);
|
|
1719
|
+
pending.push(...resolveAll(path, copies.get(path)?.dependencies ?? []));
|
|
1720
|
+
}
|
|
1721
|
+
const unreachable = [...copies.values()].filter((copy) => !reachable.has(copy.path));
|
|
1722
|
+
const required = new Set(unreachable.flatMap((copy) => resolveAll(copy.path, copy.dependencies)));
|
|
1723
|
+
const packages = unreachable.filter((copy) => copy.topLevel).sort((a, b) => a.name.localeCompare(b.name));
|
|
1724
|
+
return {
|
|
1725
|
+
packages,
|
|
1726
|
+
roots: packages.filter((copy) => !required.has(copy.path)).map((copy) => copy.name),
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
listNodeModulesPackages(nodeModulesDir) {
|
|
1730
|
+
const packages = [];
|
|
1731
|
+
const read = (dir, scope) => {
|
|
1732
|
+
let entries;
|
|
1733
|
+
try {
|
|
1734
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
1735
|
+
}
|
|
1736
|
+
catch {
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
for (const entry of entries) {
|
|
1740
|
+
// Skip .bin, .package-lock.json, and package manager stores such as .pnpm.
|
|
1741
|
+
if (entry.name.startsWith("."))
|
|
1742
|
+
continue;
|
|
1743
|
+
const symlink = entry.isSymbolicLink();
|
|
1744
|
+
if (!symlink && !entry.isDirectory())
|
|
1745
|
+
continue;
|
|
1746
|
+
if (!scope && entry.name.startsWith("@")) {
|
|
1747
|
+
read(join(dir, entry.name), entry.name);
|
|
1748
|
+
continue;
|
|
1749
|
+
}
|
|
1750
|
+
packages.push({ name: scope ? `${scope}/${entry.name}` : entry.name, symlink });
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
read(nodeModulesDir, undefined);
|
|
1754
|
+
return packages;
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Read the dependency names a package manager installs for a manifest. Peer dependencies are left out: managed installs
|
|
1758
|
+
* disable peer resolution (npm's --legacy-peer-deps, bun's --omit=peer, pnpm's auto-install-peers=false), so a
|
|
1759
|
+
* peer does not keep a package in the tree.
|
|
1760
|
+
*/
|
|
1761
|
+
readNpmManifestDependencies(packageJsonPath, includeDevDependencies) {
|
|
1762
|
+
const fields = includeDevDependencies
|
|
1763
|
+
? ["dependencies", "devDependencies", "optionalDependencies"]
|
|
1764
|
+
: ["dependencies", "optionalDependencies"];
|
|
1765
|
+
try {
|
|
1766
|
+
const pkg = JSON.parse(stripBom(readFileSync(packageJsonPath, "utf-8")));
|
|
1767
|
+
return fields.flatMap((field) => {
|
|
1768
|
+
const deps = pkg[field];
|
|
1769
|
+
return deps && typeof deps === "object" ? Object.keys(deps) : [];
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
catch {
|
|
1773
|
+
return undefined;
|
|
1774
|
+
}
|
|
1555
1775
|
}
|
|
1556
1776
|
async uninstallNpm(source, scope) {
|
|
1557
|
-
const
|
|
1558
|
-
if (!existsSync(
|
|
1777
|
+
const root = this.getNpmInstallRoot(scope, false);
|
|
1778
|
+
if (!existsSync(root)) {
|
|
1559
1779
|
return;
|
|
1560
1780
|
}
|
|
1781
|
+
// npm writes broken nested package-lock.json paths when --prefix goes through a symlink.
|
|
1782
|
+
const installRoot = realpathSync(root);
|
|
1561
1783
|
const packageManagerName = this.getPackageManagerName();
|
|
1562
1784
|
if (packageManagerName === "bun") {
|
|
1563
|
-
await this.
|
|
1785
|
+
await this.runNpmCommandInRoot(installRoot, ["uninstall", source.name, "--cwd", installRoot], "remove", `npm:${source.name}`);
|
|
1564
1786
|
return;
|
|
1565
1787
|
}
|
|
1566
1788
|
const args = ["uninstall", source.name, "--prefix", installRoot];
|
|
1567
1789
|
if (packageManagerName !== "pnpm") {
|
|
1568
|
-
args.push("--legacy-peer-deps");
|
|
1790
|
+
args.push("--legacy-peer-deps", "--no-audit", "--no-fund");
|
|
1569
1791
|
}
|
|
1570
|
-
await this.
|
|
1792
|
+
await this.runNpmCommandInRoot(installRoot, args, "remove", `npm:${source.name}`);
|
|
1571
1793
|
}
|
|
1572
1794
|
async installGit(source, scope) {
|
|
1573
1795
|
const targetDir = this.getGitInstallPath(source, scope);
|
|
@@ -1647,20 +1869,31 @@ export class DefaultPackageManager {
|
|
|
1647
1869
|
return join(dirname(targetDir), `.${basename(targetDir)}.pi-update-incomplete`);
|
|
1648
1870
|
}
|
|
1649
1871
|
async cleanAndInstallGitDependencies(targetDir, markerPath) {
|
|
1650
|
-
// Clean untracked files (extensions should be pristine).
|
|
1651
|
-
//
|
|
1872
|
+
// Clean untracked files (extensions should be pristine). On Windows, files loaded by
|
|
1873
|
+
// another process (e.g. a native module of this extension in another pi session) cannot
|
|
1874
|
+
// be deleted, so git clean fails. Still install dependencies for the new commit, but keep
|
|
1875
|
+
// the marker so the next update retries the clean.
|
|
1876
|
+
let cleaned = true;
|
|
1652
1877
|
try {
|
|
1653
1878
|
await this.runCommand("git", ["clean", "-fdx"], { cwd: targetDir });
|
|
1654
1879
|
}
|
|
1655
1880
|
catch (error) {
|
|
1656
|
-
|
|
1657
|
-
|
|
1881
|
+
cleaned = false;
|
|
1882
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1883
|
+
this.emitProgress({
|
|
1884
|
+
type: "progress",
|
|
1885
|
+
action: "update",
|
|
1886
|
+
source: targetDir,
|
|
1887
|
+
message: `Could not remove all untracked files in ${targetDir} (${reason}). Files may be in use by another HUMAIN Code CLI session; close it and run the update again.`,
|
|
1888
|
+
});
|
|
1658
1889
|
}
|
|
1659
1890
|
const packageJsonPath = join(targetDir, "package.json");
|
|
1660
1891
|
if (existsSync(packageJsonPath)) {
|
|
1661
1892
|
await this.runNpmCommand(this.getGitDependencyInstallArgs(), { cwd: targetDir });
|
|
1662
1893
|
}
|
|
1663
|
-
|
|
1894
|
+
if (cleaned) {
|
|
1895
|
+
rmSync(markerPath, { force: true });
|
|
1896
|
+
}
|
|
1664
1897
|
}
|
|
1665
1898
|
async ensureGitRef(targetDir, fetchArgs, ref) {
|
|
1666
1899
|
// Fetch only the ref we will reset to, avoiding unrelated branch/tag noise.
|
|
@@ -1688,11 +1921,22 @@ export class DefaultPackageManager {
|
|
|
1688
1921
|
await this.runCommand("git", ["reset", "--hard", commitRef], { cwd: targetDir });
|
|
1689
1922
|
await this.cleanAndInstallGitDependencies(targetDir, markerPath);
|
|
1690
1923
|
}
|
|
1691
|
-
async refreshTemporaryGitSource(source, sourceStr) {
|
|
1924
|
+
async refreshTemporaryGitSource(source, sourceStr, installedPath) {
|
|
1692
1925
|
if (isOfflineModeEnabled()) {
|
|
1693
1926
|
return;
|
|
1694
1927
|
}
|
|
1695
1928
|
try {
|
|
1929
|
+
// A ref can name a moving branch, so refresh refs too. Skip the network call only when the
|
|
1930
|
+
// ref is a commit hash that is already checked out.
|
|
1931
|
+
if (source.ref && /^[0-9a-f]{7,64}$/i.test(source.ref)) {
|
|
1932
|
+
const head = await this.runCommandCapture("git", ["rev-parse", "HEAD"], {
|
|
1933
|
+
cwd: installedPath,
|
|
1934
|
+
timeoutMs: NETWORK_TIMEOUT_MS,
|
|
1935
|
+
});
|
|
1936
|
+
if (head.trim().toLowerCase().startsWith(source.ref.toLowerCase())) {
|
|
1937
|
+
return;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1696
1940
|
await this.withProgress("pull", sourceStr, `Refreshing ${sourceStr}...`, async () => {
|
|
1697
1941
|
await this.updateGit(source, "temporary");
|
|
1698
1942
|
});
|
|
@@ -1870,6 +2114,14 @@ export class DefaultPackageManager {
|
|
|
1870
2114
|
return resolvePath(input, baseDir, { homeDir: getHomeDir(), trim: true });
|
|
1871
2115
|
}
|
|
1872
2116
|
collectPackageResources(packageRoot, accumulator, filter, metadata) {
|
|
2117
|
+
const manifest = readPiManifest(join(packageRoot, "package.json"));
|
|
2118
|
+
const changelogPath = resolvePackageChangelogPath(packageRoot, manifest);
|
|
2119
|
+
if (changelogPath) {
|
|
2120
|
+
metadata.changelogPath = changelogPath;
|
|
2121
|
+
}
|
|
2122
|
+
else {
|
|
2123
|
+
delete metadata.changelogPath;
|
|
2124
|
+
}
|
|
1873
2125
|
if (filter) {
|
|
1874
2126
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1875
2127
|
const patterns = filter[resourceType];
|
|
@@ -1886,8 +2138,7 @@ export class DefaultPackageManager {
|
|
|
1886
2138
|
}
|
|
1887
2139
|
return true;
|
|
1888
2140
|
}
|
|
1889
|
-
|
|
1890
|
-
if (manifest) {
|
|
2141
|
+
if (manifest && hasManifestResourceFields(manifest)) {
|
|
1891
2142
|
for (const resourceType of RESOURCE_TYPES) {
|
|
1892
2143
|
const entries = manifest[resourceType];
|
|
1893
2144
|
this.addManifestEntries(entries, packageRoot, resourceType, this.getTargetMap(accumulator, resourceType), metadata);
|
|
@@ -2047,7 +2298,7 @@ export class DefaultPackageManager {
|
|
|
2047
2298
|
const userAgentsSkillsDir = join(getHomeDir(), ".agents", "skills");
|
|
2048
2299
|
const projectTrusted = this.settingsManager.isProjectTrusted();
|
|
2049
2300
|
const projectAgentsSkillDirs = projectTrusted
|
|
2050
|
-
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) =>
|
|
2301
|
+
? collectAncestorAgentsSkillDirs(this.cwd).filter((dir) => !pathsEqual(dir, userAgentsSkillsDir))
|
|
2051
2302
|
: [];
|
|
2052
2303
|
const addResources = (resourceType, paths, metadata, overrides, baseDir) => {
|
|
2053
2304
|
const target = this.getTargetMap(accumulator, resourceType);
|
|
@@ -2148,10 +2399,10 @@ export class DefaultPackageManager {
|
|
|
2148
2399
|
resolved.sort((a, b) => resourcePrecedenceRank(a.metadata) - resourcePrecedenceRank(b.metadata));
|
|
2149
2400
|
const seen = new Set();
|
|
2150
2401
|
return resolved.filter((entry) => {
|
|
2151
|
-
const
|
|
2152
|
-
if (seen.has(
|
|
2402
|
+
const pathKey = getResourcePathKey(entry.path);
|
|
2403
|
+
if (seen.has(pathKey))
|
|
2153
2404
|
return false;
|
|
2154
|
-
seen.add(
|
|
2405
|
+
seen.add(pathKey);
|
|
2155
2406
|
return true;
|
|
2156
2407
|
});
|
|
2157
2408
|
};
|