@humain/humain-code 0.5.3 → 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 +180 -0
- package/README.md +2 -2
- 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/assets/humain-code-logo.svg +8 -0
- 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,23 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{hasIncompleteUsage}from"./chunk-YTVFIA3A.js";import{createRequestObserver,headersToRecord,providerHeadersToRecord}from"./chunk-QWXPGBAG.js";import{getProviderEnvValue}from"./chunk-FACBDLFU.js";import{parseStreamingJson,parseStreamingJsonWhileStreaming}from"./chunk-YDBNMIA3.js";import{AssistantMessageEventStream}from"./chunk-IJYVMOB4.js";import{appendAssistantMessageDiagnostic,createAssistantMessageDiagnostic,getIdentityHeaders}from"./chunk-IDU5BNNI.js";
|
|
3
|
-
import"./chunk-JXWJOIH4.js";var PiMessagesResponseError=class extends Error{code;diagnosticDetails;constructor(message,code,diagnosticDetails){super(message),this.name="PiMessagesResponseError",this.code=code,this.diagnosticDetails=diagnosticDetails}};function parsePiMessagesErrorBody(body){try{let parsed=JSON.parse(body),error=parsed?.error;return parsed&&typeof error=="object"&&error!==null&&!Array.isArray(error)?parsed:void 0}catch{return}}function truncateDiagnosticString(value){return value.length>8192?`${value.slice(
|
|
4
|
-
0,8192)}\u2026`:value}function formatPiMessagesResponseError(response,body,errorBody){let message=typeof errorBody?.error?.message=="string"?errorBody.error.message:void 0,code=typeof errorBody?.error?.code=="string"?errorBody.error.code:void 0,suffix=message??body,codeSuffix=code?` (${code})`:"";return`${response.status} ${response.statusText}: ${suffix}${codeSuffix}`}function createPiMessagesResponseError(model,url,response,body){let errorBody=parsePiMessagesErrorBody(body),code=typeof errorBody?.
|
|
5
|
-
error?.code=="string"?errorBody.error.code:void 0;return new PiMessagesResponseError(formatPiMessagesResponseError(response,body,errorBody),code,{version:1,provider:model.provider,model:model.id,url:url.toString(),status:response.status,statusText:response.statusText,...errorBody?.error===void 0?{}:{error:errorBody.error},...errorBody?{}:{body:truncateDiagnosticString(body)},timestampMs:Date.now()})}function createEmptyUsage(){return{usageIncomplete:!0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,
|
|
6
|
-
cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function appendRewriteDiagnostic(message,rewrite){rewrite&&appendAssistantMessageDiagnostic(message,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...rewrite}})}function createEventConverter(model){let partial={role:"assistant",content:[],api:model.api,provider:model.provider,model:model.id,usage:createEmptyUsage(),stopReason:"pending",timestamp:Date.now()},toolJson=new Map;return event=>{let terminalUsage;switch((event.type===
|
|
7
|
-
"done"||event.type==="error")&&(terminalUsage=event.usage?{...event.usage,usageIncomplete:event.usage.usageIncomplete===!0||hasIncompleteUsage([event.usage.input,event.usage.output,event.usage.cacheRead,event.usage.cacheWrite,event.usage.totalTokens],[event.usage.reasoning,event.usage.cacheWrite1h])}:createEmptyUsage()),event.type){case"done":for(let[contentIndex,json]of toolJson)partial.content[contentIndex].arguments=parseStreamingJson(json);return Object.assign(partial,{stopReason:event.reason,
|
|
8
|
-
usage:terminalUsage,responseId:event.responseId}),event.providerThinkingLevel!==void 0&&(partial.providerThinkingLevel=event.providerThinkingLevel),appendRewriteDiagnostic(partial,event.rewrite),{type:"done",reason:event.reason,message:partial};case"error":for(let[contentIndex,json]of toolJson)partial.content[contentIndex].arguments=parseStreamingJson(json);return Object.assign(partial,{stopReason:event.reason,usage:terminalUsage,errorMessage:event.errorMessage,responseId:event.responseId}),event.
|
|
9
|
-
providerThinkingLevel!==void 0&&(partial.providerThinkingLevel=event.providerThinkingLevel),appendRewriteDiagnostic(partial,event.rewrite),{type:"error",reason:event.reason,error:partial};case"start":break;case"text_start":partial.content[event.contentIndex]={type:"text",text:""};break;case"text_delta":partial.content[event.contentIndex].text+=event.delta;break;case"text_end":Object.assign(partial.content[event.contentIndex],{text:event.content,textSignature:event.contentSignature});break;case"t\
|
|
10
|
-
hinking_start":partial.content[event.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":partial.content[event.contentIndex].thinking+=event.delta;break;case"thinking_end":Object.assign(partial.content[event.contentIndex],{thinking:event.content,thinkingSignature:event.contentSignature,redacted:event.redacted});break;case"toolcall_start":partial.content[event.contentIndex]={type:"toolCall",id:event.id,name:event.toolName,arguments:{}},toolJson.set(event.contentIndex,"");break;case"\
|
|
11
|
-
toolcall_delta":{let json=`${toolJson.get(event.contentIndex)??""}${event.delta}`;toolJson.set(event.contentIndex,json);let block=partial.content[event.contentIndex];block.arguments=parseStreamingJsonWhileStreaming(block,json,block.arguments);break}case"toolcall_end":return Object.assign(partial.content[event.contentIndex],event.toolCall),toolJson.delete(event.contentIndex),{type:"toolcall_end",contentIndex:event.contentIndex,toolCall:partial.content[event.contentIndex],partial}}return{...event,
|
|
12
|
-
partial}}}async function*readPiMessagesEvents(stream2){let decoder=new TextDecoder,reader=stream2.getReader(),buffer="";try{for(;;){let{done,value}=await reader.read();buffer+=done?decoder.decode():decoder.decode(value,{stream:!0}),buffer=buffer.replace(/\r\n/g,`
|
|
13
|
-
`);let split=buffer.indexOf(`
|
|
14
|
-
|
|
15
|
-
`);for(;split!==-1;){let event=parsePiMessagesEvent(buffer.slice(0,split));event&&(yield event),buffer=buffer.slice(split+2),split=buffer.indexOf(`
|
|
16
|
-
|
|
17
|
-
`)}if(done)break}if(buffer.trim()){let event=parsePiMessagesEvent(buffer);event&&(yield event)}}finally{reader.releaseLock()}}function parsePiMessagesEvent(raw){let data=raw.split(`
|
|
18
|
-
`).find(line=>line.startsWith("data:"))?.slice(5).trim();return data&&data!=="[DONE]"?JSON.parse(data):void 0}function createErrorEvent(model,error,aborted){let reason=aborted?"aborted":"error",assistantMessage={role:"assistant",content:[],api:model.api,provider:model.provider,model:model.id,usage:createEmptyUsage(),stopReason:reason,errorMessage:error instanceof Error?error.message:String(error),timestamp:Date.now()};return!aborted&&error instanceof PiMessagesResponseError&&appendAssistantMessageDiagnostic(
|
|
19
|
-
assistantMessage,createAssistantMessageDiagnostic("pi_messages_response_failure",error,error.diagnosticDetails)),{type:"error",reason,error:assistantMessage}}function resolveCacheRetention(cacheRetention,env){return cacheRetention||(getProviderEnvValue("PI_CACHE_RETENTION",env)==="long"?"long":void 0)}var stream=(model,context,options)=>{let eventStream=new AssistantMessageEventStream,convertEvent=createEventConverter(model);return(async()=>{try{let apiKey=options?.apiKey;if(!apiKey)throw new Error(
|
|
20
|
-
`No API key provided for provider "${model.provider}"`);let url=new URL(`${model.baseUrl.replace(/\/+$/u,"")}/messages`);options?.debug&&url.searchParams.set("debug","1");let payload={model:model.id,context,options:{temperature:options?.temperature,maxTokens:options?.maxTokens,reasoning:options?.reasoning,cacheRetention:resolveCacheRetention(options?.cacheRetention,options?.env),sessionId:options?.sessionId,toolChoice:options?.toolChoice}},nextPayload=await options?.onPayload?.(payload,model);nextPayload!==
|
|
21
|
-
void 0&&(payload=nextPayload);let body=JSON.stringify(payload);await createRequestObserver(options,{api:model.api,provider:model.provider,model:model.id,operation:"chat"})(body);let response=await(options?.fetch??globalThis.fetch)(url,{method:"POST",headers:providerHeadersToRecord(getIdentityHeaders(model,options?.identity),{authorization:`Bearer ${apiKey}`,accept:"text/event-stream","content-type":"application/json"},options?.headers),body,signal:options?.signal});if(await options?.onResponse?.(
|
|
22
|
-
{status:response.status,headers:headersToRecord(response.headers)},model),!response.ok){let body2=await response.text();throw createPiMessagesResponseError(model,url,response,body2)}if(!response.body)throw new Error(`${model.provider} response has no body`);for await(let piEvent of readPiMessagesEvents(response.body)){await options?.onProviderStreamEvent?.(piEvent,model);let event=convertEvent(piEvent);if(eventStream.push(event),event.type==="done"||event.type==="error")return}throw new Error(`${model.
|
|
23
|
-
provider} stream ended without a terminal event`)}catch(error){eventStream.push(createErrorEvent(model,error,options?.signal?.aborted??!1))}})(),eventStream},streamSimple=(model,context,options)=>{let extra=options;return stream(model,context,{...options,reasoning:options?.reasoning,toolChoice:options?.toolChoice,debug:extra?.debug})};export{PiMessagesResponseError,stream,streamSimple};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{dist_exports as dist_exports3}from"./chunk-ODJUBJK2.js";import{dist_exports as dist_exports2}from"./chunk-UJLCKIMZ.js";import"./chunk-RTXDU3AA.js";import"./chunk-A6B2QMA7.js";import"./chunk-PS7DGA7B.js";import"./chunk-AO6FF5JL.js";import"./chunk-M74U5X4S.js";import{all_exports,compat_exports}from"./chunk-EY3LZOUP.js";import"./chunk-XA7CJAYH.js";import{dist_exports}from"./chunk-CN3Q5UNB.js";import"./chunk-XQRYOCHA.js";import"./chunk-DNGJMRJW.js";
|
|
3
|
-
import"./chunk-L2VKM23Q.js";import"./chunk-YFOLLX5D.js";import"./chunk-KKCMWB63.js";import"./chunk-V62QBESW.js";import"./chunk-KQM7ZGL6.js";import"./chunk-CIA6V3BP.js";import"./chunk-O4DO5RWS.js";import"./chunk-FACBDLFU.js";import"./chunk-ROZV2IYD.js";import"./chunk-ZI7TK7HM.js";import"./chunk-2GCMACT4.js";import"./chunk-N7CQ3UV3.js";import"./chunk-QW6PTCAB.js";import"./chunk-DBL35X7L.js";import"./chunk-YDBNMIA3.js";
|
|
4
|
-
import{models_exports}from"./chunk-UTNHGOFS.js";import"./chunk-IJYVMOB4.js";import"./chunk-IDU5BNNI.js";import{compile_exports,value_exports2 as value_exports}from"./chunk-MIJHJNNQ.js";import{build_exports}from"./chunk-HIZWUSPN.js";import"./chunk-JXWJOIH4.js";var oauth_exports={};var VIRTUAL_MODULES={typebox:build_exports,"typebox/compile":compile_exports,"typebox/value":value_exports,"@sinclair/typebox":build_exports,"@sinclair/typebox/compile":compile_exports,"@sinclair/typebox/value":value_exports,"@earendil-works/pi-agent-core":dist_exports2,"@earendil-works/pi-tui":dist_exports,"@earendil-works/pi-ai":compat_exports,"@earendil-works/pi-ai/compat":compat_exports,"@earendil-works/pi-ai/models":models_exports,"@earendil-works/pi-ai/oauth":oauth_exports,"@earendil-works\
|
|
5
|
-
/pi-ai/providers/all":all_exports,"@earendil-works/pi-coding-agent":dist_exports3,"@mariozechner/pi-agent-core":dist_exports2,"@mariozechner/pi-tui":dist_exports,"@mariozechner/pi-ai":compat_exports,"@mariozechner/pi-ai/compat":compat_exports,"@mariozechner/pi-ai/models":models_exports,"@mariozechner/pi-ai/oauth":oauth_exports,"@mariozechner/pi-ai/providers/all":all_exports,"@mariozechner/pi-coding-agent":dist_exports3};export{VIRTUAL_MODULES};
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sandbox Extension - OS-level sandboxing for bash commands
|
|
3
|
-
*
|
|
4
|
-
* Uses @anthropic-ai/sandbox-runtime to enforce filesystem and network
|
|
5
|
-
* restrictions on bash commands at the OS level (sandbox-exec on macOS,
|
|
6
|
-
* bubblewrap on Linux).
|
|
7
|
-
*
|
|
8
|
-
* Note: this example intentionally overrides the built-in `bash` tool to show
|
|
9
|
-
* how built-in tools can be replaced. Alternatively, you could sandbox `bash`
|
|
10
|
-
* via `tool_call` input mutation without replacing the tool.
|
|
11
|
-
*
|
|
12
|
-
* Config files (merged, project takes precedence):
|
|
13
|
-
* - ~/.humain-terminal/agent/extensions/sandbox.json (global)
|
|
14
|
-
* - <cwd>/.humain-terminal/sandbox.json (project-local)
|
|
15
|
-
*
|
|
16
|
-
* Example .pi/sandbox.json:
|
|
17
|
-
* ```json
|
|
18
|
-
* {
|
|
19
|
-
* "enabled": true,
|
|
20
|
-
* "network": {
|
|
21
|
-
* "allowedDomains": ["github.com", "*.github.com"],
|
|
22
|
-
* "deniedDomains": []
|
|
23
|
-
* },
|
|
24
|
-
* "filesystem": {
|
|
25
|
-
* "denyRead": ["~/.ssh", "~/.aws"],
|
|
26
|
-
* "allowWrite": [".", "/tmp"],
|
|
27
|
-
* "denyWrite": [".env"]
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* Usage:
|
|
33
|
-
* - `pi -e ./sandbox` - sandbox enabled with default/config settings
|
|
34
|
-
* - `pi -e ./sandbox --no-sandbox` - disable sandboxing
|
|
35
|
-
* - `/sandbox` - show current sandbox configuration
|
|
36
|
-
*
|
|
37
|
-
* Setup:
|
|
38
|
-
* 1. Copy sandbox/ directory to ~/.humain-terminal/agent/extensions/
|
|
39
|
-
* 2. Run `npm install` in ~/.humain-terminal/agent/extensions/sandbox/
|
|
40
|
-
*
|
|
41
|
-
* Linux also requires: bubblewrap, socat, ripgrep
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
import { spawn } from "node:child_process";
|
|
45
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
46
|
-
import { join } from "node:path";
|
|
47
|
-
import { SandboxManager, type SandboxRuntimeConfig } from "@anthropic-ai/sandbox-runtime";
|
|
48
|
-
import type { ExtensionAPI } from "@humain/humain-code";
|
|
49
|
-
import { type BashOperations, CONFIG_DIR_NAME, createBashTool, getAgentDir } from "@humain/humain-code";
|
|
50
|
-
|
|
51
|
-
interface SandboxConfig extends SandboxRuntimeConfig {
|
|
52
|
-
enabled?: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const DEFAULT_CONFIG: SandboxConfig = {
|
|
56
|
-
enabled: true,
|
|
57
|
-
network: {
|
|
58
|
-
allowedDomains: [
|
|
59
|
-
"npmjs.org",
|
|
60
|
-
"*.npmjs.org",
|
|
61
|
-
"registry.npmjs.org",
|
|
62
|
-
"registry.yarnpkg.com",
|
|
63
|
-
"pypi.org",
|
|
64
|
-
"*.pypi.org",
|
|
65
|
-
"github.com",
|
|
66
|
-
"*.github.com",
|
|
67
|
-
"api.github.com",
|
|
68
|
-
"raw.githubusercontent.com",
|
|
69
|
-
],
|
|
70
|
-
deniedDomains: [],
|
|
71
|
-
},
|
|
72
|
-
filesystem: {
|
|
73
|
-
denyRead: ["~/.ssh", "~/.aws", "~/.gnupg"],
|
|
74
|
-
allowWrite: [".", "/tmp"],
|
|
75
|
-
denyWrite: [".env", ".env.*", "*.pem", "*.key"],
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
function loadConfig(cwd: string): SandboxConfig {
|
|
80
|
-
const projectConfigPath = join(cwd, CONFIG_DIR_NAME, "sandbox.json");
|
|
81
|
-
const globalConfigPath = join(getAgentDir(), "extensions", "sandbox.json");
|
|
82
|
-
|
|
83
|
-
let globalConfig: Partial<SandboxConfig> = {};
|
|
84
|
-
let projectConfig: Partial<SandboxConfig> = {};
|
|
85
|
-
|
|
86
|
-
if (existsSync(globalConfigPath)) {
|
|
87
|
-
try {
|
|
88
|
-
globalConfig = JSON.parse(readFileSync(globalConfigPath, "utf-8"));
|
|
89
|
-
} catch (e) {
|
|
90
|
-
console.error(`Warning: Could not parse ${globalConfigPath}: ${e}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (existsSync(projectConfigPath)) {
|
|
95
|
-
try {
|
|
96
|
-
projectConfig = JSON.parse(readFileSync(projectConfigPath, "utf-8"));
|
|
97
|
-
} catch (e) {
|
|
98
|
-
console.error(`Warning: Could not parse ${projectConfigPath}: ${e}`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return deepMerge(deepMerge(DEFAULT_CONFIG, globalConfig), projectConfig);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function deepMerge(base: SandboxConfig, overrides: Partial<SandboxConfig>): SandboxConfig {
|
|
106
|
-
const result: SandboxConfig = { ...base };
|
|
107
|
-
|
|
108
|
-
if (overrides.enabled !== undefined) result.enabled = overrides.enabled;
|
|
109
|
-
if (overrides.network) {
|
|
110
|
-
result.network = { ...base.network, ...overrides.network };
|
|
111
|
-
}
|
|
112
|
-
if (overrides.filesystem) {
|
|
113
|
-
result.filesystem = { ...base.filesystem, ...overrides.filesystem };
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const extOverrides = overrides as {
|
|
117
|
-
ignoreViolations?: Record<string, string[]>;
|
|
118
|
-
enableWeakerNestedSandbox?: boolean;
|
|
119
|
-
};
|
|
120
|
-
const extResult = result as { ignoreViolations?: Record<string, string[]>; enableWeakerNestedSandbox?: boolean };
|
|
121
|
-
|
|
122
|
-
if (extOverrides.ignoreViolations) {
|
|
123
|
-
extResult.ignoreViolations = extOverrides.ignoreViolations;
|
|
124
|
-
}
|
|
125
|
-
if (extOverrides.enableWeakerNestedSandbox !== undefined) {
|
|
126
|
-
extResult.enableWeakerNestedSandbox = extOverrides.enableWeakerNestedSandbox;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return result;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function createSandboxedBashOps(): BashOperations {
|
|
133
|
-
return {
|
|
134
|
-
async exec(command, cwd, { onData, signal, timeout }) {
|
|
135
|
-
if (!existsSync(cwd)) {
|
|
136
|
-
throw new Error(`Working directory does not exist: ${cwd}`);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const wrappedCommand = await SandboxManager.wrapWithSandbox(command);
|
|
140
|
-
|
|
141
|
-
return new Promise((resolve, reject) => {
|
|
142
|
-
const child = spawn("bash", ["-c", wrappedCommand], {
|
|
143
|
-
cwd,
|
|
144
|
-
detached: true,
|
|
145
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
let timedOut = false;
|
|
149
|
-
let timeoutHandle: NodeJS.Timeout | undefined;
|
|
150
|
-
|
|
151
|
-
if (timeout !== undefined && timeout > 0) {
|
|
152
|
-
timeoutHandle = setTimeout(() => {
|
|
153
|
-
timedOut = true;
|
|
154
|
-
if (child.pid) {
|
|
155
|
-
try {
|
|
156
|
-
process.kill(-child.pid, "SIGKILL");
|
|
157
|
-
} catch {
|
|
158
|
-
child.kill("SIGKILL");
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, timeout * 1000);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
child.stdout?.on("data", onData);
|
|
165
|
-
child.stderr?.on("data", onData);
|
|
166
|
-
|
|
167
|
-
child.on("error", (err) => {
|
|
168
|
-
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
169
|
-
reject(err);
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const onAbort = () => {
|
|
173
|
-
if (child.pid) {
|
|
174
|
-
try {
|
|
175
|
-
process.kill(-child.pid, "SIGKILL");
|
|
176
|
-
} catch {
|
|
177
|
-
child.kill("SIGKILL");
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
183
|
-
|
|
184
|
-
child.on("close", (code) => {
|
|
185
|
-
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
186
|
-
signal?.removeEventListener("abort", onAbort);
|
|
187
|
-
|
|
188
|
-
if (signal?.aborted) {
|
|
189
|
-
reject(new Error("aborted"));
|
|
190
|
-
} else if (timedOut) {
|
|
191
|
-
reject(new Error(`timeout:${timeout}`));
|
|
192
|
-
} else {
|
|
193
|
-
resolve({ exitCode: code });
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export default function (pi: ExtensionAPI) {
|
|
202
|
-
pi.registerFlag("no-sandbox", {
|
|
203
|
-
description: "Disable OS-level sandboxing for bash commands",
|
|
204
|
-
type: "boolean",
|
|
205
|
-
default: false,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
const localCwd = process.cwd();
|
|
209
|
-
const localBash = createBashTool(localCwd);
|
|
210
|
-
|
|
211
|
-
let sandboxEnabled = false;
|
|
212
|
-
let sandboxInitialized = false;
|
|
213
|
-
|
|
214
|
-
pi.registerTool({
|
|
215
|
-
...localBash,
|
|
216
|
-
label: "bash (sandboxed)",
|
|
217
|
-
async execute(id, params, signal, onUpdate, _ctx) {
|
|
218
|
-
if (!sandboxEnabled || !sandboxInitialized) {
|
|
219
|
-
return localBash.execute(id, params, signal, onUpdate);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
const sandboxedBash = createBashTool(localCwd, {
|
|
223
|
-
operations: createSandboxedBashOps(),
|
|
224
|
-
});
|
|
225
|
-
return sandboxedBash.execute(id, params, signal, onUpdate);
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
pi.on("user_bash", () => {
|
|
230
|
-
if (!sandboxEnabled || !sandboxInitialized) return;
|
|
231
|
-
return { operations: createSandboxedBashOps() };
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
pi.on("session_start", async (_event, ctx) => {
|
|
235
|
-
const noSandbox = pi.getFlag("no-sandbox") as boolean;
|
|
236
|
-
|
|
237
|
-
if (noSandbox) {
|
|
238
|
-
sandboxEnabled = false;
|
|
239
|
-
ctx.ui.notify("Sandbox disabled via --no-sandbox", "warning");
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const config = loadConfig(ctx.cwd);
|
|
244
|
-
|
|
245
|
-
if (!config.enabled) {
|
|
246
|
-
sandboxEnabled = false;
|
|
247
|
-
ctx.ui.notify("Sandbox disabled via config", "info");
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const platform = process.platform;
|
|
252
|
-
if (platform !== "darwin" && platform !== "linux") {
|
|
253
|
-
sandboxEnabled = false;
|
|
254
|
-
ctx.ui.notify(`Sandbox not supported on ${platform}`, "warning");
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
try {
|
|
259
|
-
const configExt = config as unknown as {
|
|
260
|
-
ignoreViolations?: Record<string, string[]>;
|
|
261
|
-
enableWeakerNestedSandbox?: boolean;
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
await SandboxManager.initialize({
|
|
265
|
-
network: config.network,
|
|
266
|
-
filesystem: config.filesystem,
|
|
267
|
-
ignoreViolations: configExt.ignoreViolations,
|
|
268
|
-
enableWeakerNestedSandbox: configExt.enableWeakerNestedSandbox,
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
sandboxEnabled = true;
|
|
272
|
-
sandboxInitialized = true;
|
|
273
|
-
|
|
274
|
-
const networkCount = config.network?.allowedDomains?.length ?? 0;
|
|
275
|
-
const writeCount = config.filesystem?.allowWrite?.length ?? 0;
|
|
276
|
-
ctx.ui.setStatus(
|
|
277
|
-
"sandbox",
|
|
278
|
-
ctx.ui.theme.fg("accent", `🔒 Sandbox: ${networkCount} domains, ${writeCount} write paths`),
|
|
279
|
-
);
|
|
280
|
-
ctx.ui.notify("Sandbox initialized", "info");
|
|
281
|
-
} catch (err) {
|
|
282
|
-
sandboxEnabled = false;
|
|
283
|
-
ctx.ui.notify(`Sandbox initialization failed: ${err instanceof Error ? err.message : err}`, "error");
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
pi.on("session_shutdown", async () => {
|
|
288
|
-
if (sandboxInitialized) {
|
|
289
|
-
try {
|
|
290
|
-
await SandboxManager.reset();
|
|
291
|
-
} catch {
|
|
292
|
-
// Ignore cleanup errors
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
pi.registerCommand("sandbox", {
|
|
298
|
-
description: "Show sandbox configuration",
|
|
299
|
-
handler: async (_args, ctx) => {
|
|
300
|
-
if (!sandboxEnabled) {
|
|
301
|
-
ctx.ui.notify("Sandbox is disabled", "info");
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const config = loadConfig(ctx.cwd);
|
|
306
|
-
const lines = [
|
|
307
|
-
"Sandbox Configuration:",
|
|
308
|
-
"",
|
|
309
|
-
"Network:",
|
|
310
|
-
` Allowed: ${config.network?.allowedDomains?.join(", ") || "(none)"}`,
|
|
311
|
-
` Denied: ${config.network?.deniedDomains?.join(", ") || "(none)"}`,
|
|
312
|
-
"",
|
|
313
|
-
"Filesystem:",
|
|
314
|
-
` Deny Read: ${config.filesystem?.denyRead?.join(", ") || "(none)"}`,
|
|
315
|
-
` Allow Write: ${config.filesystem?.allowWrite?.join(", ") || "(none)"}`,
|
|
316
|
-
` Deny Write: ${config.filesystem?.denyWrite?.join(", ") || "(none)"}`,
|
|
317
|
-
];
|
|
318
|
-
ctx.ui.notify(lines.join("\n"), "info");
|
|
319
|
-
},
|
|
320
|
-
});
|
|
321
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.4.0",
|
|
4
|
-
"lockfileVersion": 3,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"packages": {
|
|
7
|
-
"": {
|
|
8
|
-
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.4.0",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@anthropic-ai/sandbox-runtime": "0.0.80"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"node_modules/@anthropic-ai/sandbox-runtime": {
|
|
15
|
-
"version": "0.0.80",
|
|
16
|
-
"resolved": "https://registry.npmjs.org/@anthropic-ai/sandbox-runtime/-/sandbox-runtime-0.0.80.tgz",
|
|
17
|
-
"integrity": "sha512-WG4P8faU/JDH90I8NLUBPmg7e72zhanlW3AVCD0OF06JCtId9IDFewFgv4YRvHLcnn//h1r6a1AMosBsMLpxnA==",
|
|
18
|
-
"license": "Apache-2.0",
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@pondwader/socks5-server": "^1.0.10",
|
|
21
|
-
"commander": "^12.1.0",
|
|
22
|
-
"node-forge": "^1.4.0",
|
|
23
|
-
"zod": "^3.25.0"
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"srt": "dist/cli.js"
|
|
27
|
-
},
|
|
28
|
-
"engines": {
|
|
29
|
-
"node": ">=22.12.0"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"node_modules/@pondwader/socks5-server": {
|
|
33
|
-
"version": "1.0.10",
|
|
34
|
-
"resolved": "https://registry.npmjs.org/@pondwader/socks5-server/-/socks5-server-1.0.10.tgz",
|
|
35
|
-
"integrity": "sha512-bQY06wzzR8D2+vVCUoBsr5QS2U6UgPUQRmErNwtsuI6vLcyRKkafjkr3KxbtGFf9aBBIV2mcvlsKD1UYaIV+sg==",
|
|
36
|
-
"license": "MIT"
|
|
37
|
-
},
|
|
38
|
-
"node_modules/commander": {
|
|
39
|
-
"version": "12.1.0",
|
|
40
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz",
|
|
41
|
-
"integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==",
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=18"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"node_modules/node-forge": {
|
|
48
|
-
"version": "1.4.0",
|
|
49
|
-
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
|
50
|
-
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
|
51
|
-
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">= 6.13.0"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"node_modules/zod": {
|
|
57
|
-
"version": "3.25.76",
|
|
58
|
-
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
|
|
59
|
-
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
|
60
|
-
"license": "MIT",
|
|
61
|
-
"funding": {
|
|
62
|
-
"url": "https://github.com/sponsors/colinhacks"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pi-extension-sandbox",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.4.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "echo 'nothing to clean'",
|
|
8
|
-
"build": "echo 'nothing to build'",
|
|
9
|
-
"check": "echo 'nothing to check'"
|
|
10
|
-
},
|
|
11
|
-
"pi": {
|
|
12
|
-
"extensions": [
|
|
13
|
-
"./index.ts"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@anthropic-ai/sandbox-runtime": "0.0.81"
|
|
18
|
-
}
|
|
19
|
-
}
|