@humain/humain-code 0.4.18 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +247 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +67 -0
- package/dist/bundle/chunks/anthropic.js +2 -2
- package/dist/bundle/chunks/azure-openai-responses-QJFYQ3DF.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +152 -200
- package/dist/bundle/chunks/chunk-2GCMACT4.js +1956 -0
- package/dist/bundle/chunks/{chunk-7VY5IL74.js → chunk-476XBL3W.js} +3 -3
- package/dist/bundle/chunks/{chunk-P4UKLIQB.js → chunk-5C4VL2AR.js} +4 -4
- package/dist/bundle/chunks/{chunk-QEF72EIZ.js → chunk-A6B2QMA7.js} +40 -96
- package/dist/bundle/chunks/{chunk-3UXBFT4Q.js → chunk-A6YBWW4T.js} +1428 -1334
- package/dist/bundle/chunks/{chunk-OWLBGSXY.js → chunk-CN3Q5UNB.js} +388 -310
- package/dist/bundle/chunks/{chunk-SCIGZFN5.js → chunk-DNGJMRJW.js} +11 -11
- package/dist/bundle/chunks/{chunk-YMBXWW36.js → chunk-DR37WKFZ.js} +9 -8
- package/dist/bundle/chunks/chunk-DU6POZ7E.js +10 -0
- package/dist/bundle/chunks/{chunk-G6ABHCPB.js → chunk-FO2NYB6O.js} +655 -663
- package/dist/bundle/chunks/{chunk-RXOCQRBG.js → chunk-GEISZXXH.js} +1 -1
- package/dist/bundle/chunks/{chunk-OKALNPTJ.js → chunk-HIZWUSPN.js} +24 -24
- package/dist/bundle/chunks/{chunk-MVYV6MJY.js → chunk-HT5YN3LX.js} +1 -1
- package/dist/bundle/chunks/chunk-IDU5BNNI.js +15 -0
- package/dist/bundle/chunks/{chunk-TIFFHHW6.js → chunk-JCXXRCP6.js} +5 -5
- package/dist/bundle/chunks/{chunk-QYCOHSI7.js → chunk-KKCMWB63.js} +8 -7
- package/dist/bundle/chunks/{chunk-SCBU5WOP.js → chunk-M74U5X4S.js} +30 -23
- package/dist/bundle/chunks/{chunk-AWCJWXGD.js → chunk-MIJHJNNQ.js} +3 -2
- package/dist/bundle/chunks/{chunk-Y26OS23T.js → chunk-N7CQ3UV3.js} +4 -4
- package/dist/bundle/chunks/{chunk-XQZG5HPT.js → chunk-O4DO5RWS.js} +11 -6
- package/dist/bundle/chunks/chunk-OR25QDSS.js +365 -0
- package/dist/bundle/chunks/{chunk-7PRU6YW3.js → chunk-OZNC2W4B.js} +306 -286
- package/dist/bundle/chunks/{chunk-Z33NNMNB.js → chunk-PH7UP57J.js} +1 -1
- package/dist/bundle/chunks/{chunk-HPSQKIWK.js → chunk-PS7DGA7B.js} +1 -1
- package/dist/bundle/chunks/chunk-Q3SFYT2X.js +1965 -0
- package/dist/bundle/chunks/chunk-QW6PTCAB.js +10 -0
- package/dist/bundle/chunks/{chunk-5CDES42D.js → chunk-QWXPGBAG.js} +1 -1
- package/dist/bundle/chunks/{chunk-NCQ6WAQK.js → chunk-ROZV2IYD.js} +1 -1
- package/dist/bundle/chunks/{chunk-3XDL5ZE4.js → chunk-RTXDU3AA.js} +148 -122
- package/dist/bundle/chunks/{chunk-L5OUCJ7N.js → chunk-T3HXWZG4.js} +11 -11
- package/dist/bundle/chunks/{chunk-FZUJXM6D.js → chunk-UDB6NI4G.js} +309 -240
- package/dist/bundle/chunks/chunk-UTNHGOFS.js +88 -0
- package/dist/bundle/chunks/{chunk-H2FY3PEV.js → chunk-V62QBESW.js} +4 -3
- package/dist/bundle/chunks/{chunk-NSMMDV3N.js → chunk-XA7CJAYH.js} +4 -3
- package/dist/bundle/chunks/chunk-XQX7S3GM.js +7 -0
- package/dist/bundle/chunks/chunk-YFOLLX5D.js +23 -0
- package/dist/bundle/chunks/{chunk-YRCLNWFV.js → chunk-ZI7TK7HM.js} +1 -1
- package/dist/bundle/chunks/{chunk-V76YPIMT.js → chunk-ZR4GF4WU.js} +21 -15
- package/dist/bundle/chunks/{cli-2NKM2RNJ.js → cli-VXU7OWFU.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-T7TPP7SQ.js +4 -0
- package/dist/bundle/chunks/codemode-worker.js +27 -27
- package/dist/bundle/chunks/compat-S2IBVV6V.js +13 -0
- package/dist/bundle/chunks/{dist-ZJIYY3GA.js → dist-645GFIWH.js} +452 -448
- package/dist/bundle/chunks/{dist-XVXV2CL4.js → dist-IBUWEKEE.js} +3 -3
- package/dist/bundle/chunks/dist-YFMJEHPH.js +8 -0
- package/dist/bundle/chunks/{dist-cjs-AXBW3N4F.js → dist-cjs-HTASUQXQ.js} +82 -80
- package/dist/bundle/chunks/{easter-egg-3d-VGJ77XZQ.js → easter-egg-3d-YOPLCOVW.js} +2 -2
- package/dist/bundle/chunks/es-YEFEOGR3.js +1905 -0
- package/dist/bundle/chunks/{esm-GIR7QH65.js → esm-R6HJ4QEG.js} +5 -5
- package/dist/bundle/chunks/{event-streams-NXFTZDSF.js → event-streams-BR2IL6C5.js} +1 -1
- package/dist/bundle/chunks/{execute-ZBEZNJ4E.js → execute-2JXEKQ2X.js} +17 -8
- package/dist/bundle/chunks/{extract-RFWEHH6W.js → extract-OTCGZGTL.js} +50 -47
- package/dist/bundle/chunks/github-copilot.js +42 -40
- package/dist/bundle/chunks/google-generative-ai-HVPCGIZ6.js +21 -0
- package/dist/bundle/chunks/google-vertex-UM5MAALA.js +25 -0
- package/dist/bundle/chunks/host-ZHEL5XQW.js +2 -0
- package/dist/bundle/chunks/{https-proxy-agent-7CAXVAFH.js → https-proxy-agent-JQICCRPH.js} +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-AGCW7HYN.js → llama-cpp-classify-B3G57LVR.js} +5 -5
- package/dist/bundle/chunks/{mistral-conversations-G3GN6CMT.js → mistral-conversations-AH72RLXK.js} +11 -11
- package/dist/bundle/chunks/{node-A6SZ3T7E.js → node-SJPZTR4K.js} +190 -190
- package/dist/bundle/chunks/{node-DZCAT4Q6.js → node-VSA4ZN7D.js} +1 -1
- package/dist/bundle/chunks/openai-chatgpt.js +2 -2
- package/dist/bundle/chunks/{openai-codex-responses-FJFDAWHI.js → openai-codex-responses-L366637C.js} +48 -47
- package/dist/bundle/chunks/openai-codex.js +2 -2
- package/dist/bundle/chunks/openai-completions-ZP62QXJX.js +83 -0
- package/dist/bundle/chunks/{openai-decisions-HESOHYZB.js → openai-decisions-WOWUC65P.js} +1 -1
- package/dist/bundle/chunks/openai-responses-DXUGSUTN.js +26 -0
- package/dist/bundle/chunks/openrouter-images-5K47HDAT.js +8 -0
- package/dist/bundle/chunks/openrouter.js +2 -2
- package/dist/bundle/chunks/{pi-messages-SAOV3JNW.js → pi-messages-MOQQDZBK.js} +5 -4
- package/dist/bundle/chunks/radius.js +2 -2
- package/dist/bundle/chunks/{runtime-HJEUOD4R.js → runtime-5VFZTMWL.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-43OCHGKP.js +3 -0
- package/dist/bundle/chunks/{undici-4BK3MVJV.js → undici-EK3EUI2E.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-GU6AW5ZK.js +5 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/flow/package.json +4 -4
- package/dist/bundle/index.js +6 -6
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/cli/args.d.ts +6 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +11 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +3 -1
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/coordination/broker/broker.d.ts +6 -2
- package/dist/coordination/broker/broker.d.ts.map +1 -1
- package/dist/coordination/broker/broker.js +20 -8
- package/dist/coordination/broker/broker.js.map +1 -1
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +4 -2
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/coordination/transport/discovery.d.ts +10 -3
- package/dist/coordination/transport/discovery.d.ts.map +1 -1
- package/dist/coordination/transport/discovery.js +18 -5
- package/dist/coordination/transport/discovery.js.map +1 -1
- package/dist/core/agent-session.d.ts +35 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +163 -40
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +47 -0
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -0
- package/dist/core/anthropic-subscription-usage.js +170 -0
- package/dist/core/anthropic-subscription-usage.js.map +1 -0
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +7 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/client-identity.d.ts +13 -0
- package/dist/core/client-identity.d.ts.map +1 -0
- package/dist/core/client-identity.js +25 -0
- package/dist/core/client-identity.js.map +1 -0
- package/dist/core/codex-usage.d.ts +37 -1
- package/dist/core/codex-usage.d.ts.map +1 -1
- package/dist/core/codex-usage.js +104 -11
- package/dist/core/codex-usage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -15
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.html +1 -0
- package/dist/core/export-html/template.js +2 -1
- package/dist/core/export-html/vendor/marked-cjk-friendly.min.js +6 -0
- package/dist/core/export-html/vendor/marked.min.js +30 -29
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +3 -0
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +14 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +86 -2
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +3 -0
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/model-config.d.ts +920 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +48 -24
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +18 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +20 -0
- 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 +14 -6
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +9 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +99 -12
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/output-guard.d.ts +13 -1
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/output-guard.js +101 -11
- package/dist/core/output-guard.js.map +1 -1
- package/dist/core/provider-composer.d.ts +2 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +7 -3
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +7 -2
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +8 -9
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +4 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +242 -26
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts +6 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +93 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +3 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +37 -12
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +102 -24
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/index.d.ts.map +1 -1
- package/dist/extensions/index.js +3 -1
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/mcp/config.d.ts.map +1 -1
- package/dist/extensions/mcp/config.js +3 -2
- package/dist/extensions/mcp/config.js.map +1 -1
- package/dist/extensions/usage/index.d.ts +15 -0
- package/dist/extensions/usage/index.d.ts.map +1 -0
- package/dist/extensions/usage/index.js +110 -0
- package/dist/extensions/usage/index.js.map +1 -0
- package/dist/extensions/usage/overview.d.ts +90 -0
- package/dist/extensions/usage/overview.d.ts.map +1 -0
- package/dist/extensions/usage/overview.js +215 -0
- package/dist/extensions/usage/overview.js.map +1 -0
- package/dist/extensions/usage/popup.d.ts +21 -0
- package/dist/extensions/usage/popup.d.ts.map +1 -0
- package/dist/extensions/usage/popup.js +98 -0
- package/dist/extensions/usage/popup.js.map +1 -0
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +21 -2
- package/dist/humain/bundled-extension-names.d.ts +6 -0
- package/dist/humain/bundled-extension-names.d.ts.map +1 -0
- package/dist/humain/bundled-extension-names.js +9 -0
- package/dist/humain/bundled-extension-names.js.map +1 -0
- package/dist/humain/index.d.ts +2 -2
- package/dist/humain/index.d.ts.map +1 -1
- package/dist/humain/index.js +3 -2
- package/dist/humain/index.js.map +1 -1
- package/dist/humain/web-access/vendor/anysearch.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/anysearch.js +3 -3
- package/dist/humain/web-access/vendor/anysearch.js.map +1 -1
- package/dist/humain/web-access/vendor/bocha.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/bocha.js +3 -3
- package/dist/humain/web-access/vendor/bocha.js.map +1 -1
- package/dist/humain/web-access/vendor/brightdata-unlocker.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/brightdata-unlocker.js +2 -2
- package/dist/humain/web-access/vendor/brightdata-unlocker.js.map +1 -1
- package/dist/humain/web-access/vendor/brightdata.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/brightdata.js +3 -3
- package/dist/humain/web-access/vendor/brightdata.js.map +1 -1
- package/dist/humain/web-access/vendor/ceramic.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ceramic.js +2 -2
- package/dist/humain/web-access/vendor/ceramic.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +3 -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 +2 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/deepseek.d.ts +11 -1
- package/dist/humain/web-access/vendor/deepseek.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/deepseek.js +170 -5
- package/dist/humain/web-access/vendor/deepseek.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +63 -6
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.d.ts +5 -3
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +33 -7
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts +1 -0
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +18 -3
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/jina-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/jina-search.js +6 -4
- package/dist/humain/web-access/vendor/jina-search.js.map +1 -1
- package/dist/humain/web-access/vendor/kagi.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/kagi.js +4 -4
- package/dist/humain/web-access/vendor/kagi.js.map +1 -1
- package/dist/humain/web-access/vendor/keenable.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/keenable.js +2 -2
- package/dist/humain/web-access/vendor/keenable.js.map +1 -1
- package/dist/humain/web-access/vendor/linkup.d.ts +6 -0
- package/dist/humain/web-access/vendor/linkup.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/linkup.js +167 -0
- package/dist/humain/web-access/vendor/linkup.js.map +1 -0
- package/dist/humain/web-access/vendor/mistral-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js +3 -3
- package/dist/humain/web-access/vendor/mistral-search.js.map +1 -1
- package/dist/humain/web-access/vendor/ollama.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ollama.js +4 -4
- package/dist/humain/web-access/vendor/ollama.js.map +1 -1
- package/dist/humain/web-access/vendor/parallel.js +6 -7
- package/dist/humain/web-access/vendor/parallel.js.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.js +4 -3
- package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
- package/dist/humain/web-access/vendor/querit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/querit.js +3 -3
- package/dist/humain/web-access/vendor/querit.js.map +1 -1
- package/dist/humain/web-access/vendor/search1api.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/search1api.js +3 -3
- package/dist/humain/web-access/vendor/search1api.js.map +1 -1
- package/dist/humain/web-access/vendor/searchinfinity.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/searchinfinity.js +3 -3
- package/dist/humain/web-access/vendor/searchinfinity.js.map +1 -1
- package/dist/humain/web-access/vendor/serpapi.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/serpapi.js +6 -5
- package/dist/humain/web-access/vendor/serpapi.js.map +1 -1
- package/dist/humain/web-access/vendor/serpbase.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/serpbase.js +4 -4
- package/dist/humain/web-access/vendor/serpbase.js.map +1 -1
- package/dist/humain/web-access/vendor/serpdive.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/serpdive.js +3 -3
- package/dist/humain/web-access/vendor/serpdive.js.map +1 -1
- package/dist/humain/web-access/vendor/serper.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/serper.js +5 -4
- package/dist/humain/web-access/vendor/serper.js.map +1 -1
- package/dist/humain/web-access/vendor/serply.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/serply.js +2 -2
- package/dist/humain/web-access/vendor/serply.js.map +1 -1
- package/dist/humain/web-access/vendor/utils.d.ts +3 -1
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +27 -2
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/valyu.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/valyu.js +3 -3
- package/dist/humain/web-access/vendor/valyu.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +2 -0
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +3 -0
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.js +51 -8
- package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
- package/dist/humain/web-access/vendor/xcrawl.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/xcrawl.js +3 -3
- package/dist/humain/web-access/vendor/xcrawl.js.map +1 -1
- package/dist/humain/web-access/vendor/you.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/you.js +2 -2
- package/dist/humain/web-access/vendor/you.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +15 -2
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +14 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +62 -7
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +2 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +6 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/easter-egg-3d.js +1 -1
- package/dist/modes/interactive/components/easter-egg-3d.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +10 -2
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +141 -66
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +16 -3
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/themed-text.js +3 -2
- package/dist/modes/interactive/components/themed-text.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +17 -6
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +3 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +4 -2
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -17
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +90 -122
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +2 -5
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -3
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +2 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +3 -2
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +3 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +1 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.js +3 -2
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +45 -13
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +4 -3
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/codemode.md +2 -2
- package/docs/compaction.md +3 -3
- package/docs/coordination.md +1 -1
- package/docs/custom-provider.md +53 -1
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +133 -10
- package/docs/models-configuration.md +197 -0
- package/docs/models.md +21 -5
- package/docs/settings.md +1 -1
- package/docs/slash-commands.md +10 -0
- package/docs/tui.md +70 -0
- package/docs/windows.md +16 -2
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/plugins/pi-example-plugin/package.json +2 -2
- package/npm-shrinkwrap.json +243 -219
- package/package.json +21 -20
- package/schemas/models.schema.json +84 -30
- package/src/coordination/UPSTREAM.md +36 -3
- package/src/coordination/upstream.json +3 -3
- package/src/humain/web-access/UPSTREAM.md +72 -1
- package/src/humain/web-access/upstream.json +5 -4
- package/dist/bundle/chunks/anthropic-messages-TSNY5MWH.js +0 -67
- package/dist/bundle/chunks/azure-openai-responses-Z4DCXO2G.js +0 -15
- package/dist/bundle/chunks/chunk-26EAEXO5.js +0 -167
- package/dist/bundle/chunks/chunk-2ZFUMXOZ.js +0 -1790
- package/dist/bundle/chunks/chunk-5K5RFXXO.js +0 -74
- package/dist/bundle/chunks/chunk-PY7SOXCA.js +0 -10
- package/dist/bundle/chunks/chunk-UGJAAWNC.js +0 -7
- package/dist/bundle/chunks/chunk-UGXYG7HN.js +0 -22
- package/dist/bundle/chunks/chunk-VEYTRNQC.js +0 -5
- package/dist/bundle/chunks/chunk-X3O5MCKJ.js +0 -7
- package/dist/bundle/chunks/chunk-YLYOJQQX.js +0 -1951
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-MUJQ6LT2.js +0 -4
- package/dist/bundle/chunks/compat-VDGEZSVM.js +0 -13
- package/dist/bundle/chunks/dist-LKDZAEUQ.js +0 -7
- package/dist/bundle/chunks/es-N6YFJOD7.js +0 -1901
- package/dist/bundle/chunks/google-generative-ai-4OVYRP24.js +0 -21
- package/dist/bundle/chunks/google-vertex-3WQAZJQD.js +0 -25
- package/dist/bundle/chunks/host-63SNKK5Y.js +0 -2
- package/dist/bundle/chunks/openai-completions-IC7WRLTI.js +0 -82
- package/dist/bundle/chunks/openai-responses-XXCYDFSM.js +0 -24
- package/dist/bundle/chunks/openrouter-images-DT2HMZNO.js +0 -8
- package/dist/bundle/chunks/typesafe-system-one-HCMGHK6A.js +0 -2
- package/dist/bundle/chunks/virtual-modules-CFJTDIXL.js +0 -5
- package/dist/core/provider-attribution.d.ts +0 -4
- package/dist/core/provider-attribution.d.ts.map +0 -1
- package/dist/core/provider-attribution.js +0 -85
- package/dist/core/provider-attribution.js.map +0 -1
- /package/dist/bundle/chunks/{chunk-WZMA7HAJ.js → chunk-XQRYOCHA.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{__commonJS}from"./chunk-JXWJOIH4.js";var require_core=__commonJS({"node_modules/highlight.js/lib/core.js"(exports,module){function deepFreeze(obj){return obj instanceof Map?obj.clear=obj.delete=obj.set=function(){throw new Error("map is read-only")}:obj instanceof Set&&(obj.add=obj.clear=obj.delete=function(){throw new Error("set is read-only")}),Object.freeze(obj),Object.getOwnPropertyNames(obj).forEach(name=>{let prop=obj[name],type=typeof prop;(type==="object"||type==="function")&&!Object.isFrozen(prop)&&deepFreeze(
|
|
3
|
-
mode.data===void 0&&(mode.data={}),this.data=mode.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function escapeHTML(value){return value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function inherit$1(original,...objects){let result=Object.create(null);for(let key in original)result[key]=original[key];return objects.forEach(function(obj){for(let key in obj)result[key]=
|
|
4
|
-
scope,scopeToCSSClass=(name,{prefix})=>{if(name.startsWith("language:"))return name.replace("language:","language-");if(name.includes(".")){let pieces=name.split(".");return[`${prefix}${pieces.shift()}`,...pieces.map((x,i)=>`${x}${"_".repeat(i+1)}`)].join(" ")}return`${prefix}${name}`},HTMLRenderer=class{constructor(parseTree,options){this.buffer="",this.classPrefix=options.classPrefix,parseTree.walk(this)}addText(text){this.
|
|
5
|
-
let className=scopeToCSSClass(node.scope,{prefix:this.classPrefix});this.span(className)}closeNode(node){emitsWrappingTags(node)&&(this.buffer+=SPAN_CLOSE)}value(){return this.buffer}span(className){this.buffer+=`<span class="${className}">`}},newNode=(opts={})=>{let result={children:[]};return Object.assign(result,opts),result},TokenTree=class _TokenTree{constructor(){this.rootNode=newNode(),this.stack=[this.rootNode]}get top(){
|
|
6
|
-
this.top.children.push(node)}openNode(scope){let node=newNode({scope});this.add(node),this.stack.push(node)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(builder){return this.constructor._walk(builder,this.rootNode)}static _walk(builder,node){return typeof node=="string"?builder.addText(node):node.children&&
|
|
7
|
-
builder.closeNode(node)),builder}static _collapse(node){typeof node!="string"&&node.children&&(node.children.every(el=>typeof el=="string")?node.children=[node.children.join("")]:node.children.forEach(child=>{_TokenTree._collapse(child)}))}},TokenTreeEmitter=class extends TokenTree{constructor(options){super(),this.options=options}addText(text){text!==""&&this.add(text)}startScope(scope){this.openNode(scope)}endScope(){
|
|
8
|
-
scope=`language:${name}`),this.add(node)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function source(re){return re?typeof re=="string"?re:re.source:null}function lookahead(re){return concat("(?=",re,")")}function anyNumberOfTimes(re){return concat("(?:",re,")*")}function optional(re){return concat("(?:",re,")?")}function concat(...args){return args.map(x=>source(
|
|
9
|
-
1];return typeof opts=="object"&&opts.constructor===Object?(args.splice(args.length-1,1),opts):{}}function either(...args){return"("+(stripOptionsFromArgs(args).capture?"":"?:")+args.map(x=>source(x)).join("|")+")"}function countMatchGroups(re){return new RegExp(re.toString()+"|").exec("").length-1}function startsWith(re,lexeme){let match=re&&re.exec(lexeme);return match&&match.index===0}var BACKREF_RE=new RegExp(either(/\[(?:[^\\\]]|\\.)*\]
|
|
10
|
-
|
|
11
|
-
joinWith)}var MATCH_NOTHING_RE=/\b\B/,IDENT_RE="[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",NUMBER_RE="\\b\\d+(\\.\\d+)?",C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BINARY_NUMBER_RE="\\b(0b[01]+)",RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG=(opts={})=>{let beginShebang=/^#![ ]*\//;
|
|
12
|
-
|
|
2
|
+
import{__commonJS}from"./chunk-JXWJOIH4.js";var require_core=__commonJS({"packages/coding-agent/node_modules/highlight.js/lib/core.js"(exports,module){function deepFreeze(obj){return obj instanceof Map?obj.clear=obj.delete=obj.set=function(){throw new Error("map is read-only")}:obj instanceof Set&&(obj.add=obj.clear=obj.delete=function(){throw new Error("set is read-only")}),Object.freeze(obj),Object.getOwnPropertyNames(obj).forEach(name=>{let prop=obj[name],type=typeof prop;(type==="object"||type==="function")&&!Object.isFrozen(prop)&&deepFreeze(
|
|
3
|
+
prop)}),obj}var Response=class{constructor(mode){mode.data===void 0&&(mode.data={}),this.data=mode.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function escapeHTML(value){return value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function inherit$1(original,...objects){let result=Object.create(null);for(let key in original)result[key]=original[key];return objects.forEach(function(obj){for(let key in obj)result[key]=
|
|
4
|
+
obj[key]}),result}var SPAN_CLOSE="</span>",emitsWrappingTags=node=>!!node.scope,scopeToCSSClass=(name,{prefix})=>{if(name.startsWith("language:"))return name.replace("language:","language-");if(name.includes(".")){let pieces=name.split(".");return[`${prefix}${pieces.shift()}`,...pieces.map((x,i)=>`${x}${"_".repeat(i+1)}`)].join(" ")}return`${prefix}${name}`},HTMLRenderer=class{constructor(parseTree,options){this.buffer="",this.classPrefix=options.classPrefix,parseTree.walk(this)}addText(text){this.
|
|
5
|
+
buffer+=escapeHTML(text)}openNode(node){if(!emitsWrappingTags(node))return;let className=scopeToCSSClass(node.scope,{prefix:this.classPrefix});this.span(className)}closeNode(node){emitsWrappingTags(node)&&(this.buffer+=SPAN_CLOSE)}value(){return this.buffer}span(className){this.buffer+=`<span class="${className}">`}},newNode=(opts={})=>{let result={children:[]};return Object.assign(result,opts),result},TokenTree=class _TokenTree{constructor(){this.rootNode=newNode(),this.stack=[this.rootNode]}get top(){
|
|
6
|
+
return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(node){this.top.children.push(node)}openNode(scope){let node=newNode({scope});this.add(node),this.stack.push(node)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(builder){return this.constructor._walk(builder,this.rootNode)}static _walk(builder,node){return typeof node=="string"?builder.addText(node):node.children&&
|
|
7
|
+
(builder.openNode(node),node.children.forEach(child=>this._walk(builder,child)),builder.closeNode(node)),builder}static _collapse(node){typeof node!="string"&&node.children&&(node.children.every(el=>typeof el=="string")?node.children=[node.children.join("")]:node.children.forEach(child=>{_TokenTree._collapse(child)}))}},TokenTreeEmitter=class extends TokenTree{constructor(options){super(),this.options=options}addText(text){text!==""&&this.add(text)}startScope(scope){this.openNode(scope)}endScope(){
|
|
8
|
+
this.closeNode()}__addSublanguage(emitter,name){let node=emitter.root;name&&(node.scope=`language:${name}`),this.add(node)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function source(re){return re?typeof re=="string"?re:re.source:null}function lookahead(re){return concat("(?=",re,")")}function anyNumberOfTimes(re){return concat("(?:",re,")*")}function optional(re){return concat("(?:",re,")?")}function concat(...args){return args.map(x=>source(
|
|
9
|
+
x)).join("")}function stripOptionsFromArgs(args){let opts=args[args.length-1];return typeof opts=="object"&&opts.constructor===Object?(args.splice(args.length-1,1),opts):{}}function either(...args){return"("+(stripOptionsFromArgs(args).capture?"":"?:")+args.map(x=>source(x)).join("|")+")"}function countMatchGroups(re){return new RegExp(re.toString()+"|").exec("").length-1}function startsWith(re,lexeme){let match=re&&re.exec(lexeme);return match&&match.index===0}var BACKREF_RE=new RegExp(either(/\[(?:[^\\\]]|\\.)*\]/,
|
|
10
|
+
/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function _rewriteBackreferences(regexps,{joinWith}){let numCaptures=0;return regexps.map(regex=>{numCaptures+=1;let offset=numCaptures,re=source(regex),out="";for(;re.length>0;){let match=BACKREF_RE.exec(re);if(!match){out+=re;break}out+=re.substring(0,match.index),re=re.substring(match.index+match[0].length),match[0][0]==="\\"&&match[1]?out+="\\"+String(Number(match[1])+offset):(out+=match[0],(match[0]==="("||/^\(\?[<']/.test(
|
|
11
|
+
match[0]))&&numCaptures++)}return out}).map(re=>`(${re})`).join(joinWith)}var MATCH_NOTHING_RE=/\b\B/,IDENT_RE="[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",NUMBER_RE="\\b\\d+(\\.\\d+)?",C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BINARY_NUMBER_RE="\\b(0b[01]+)",RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG=(opts={})=>{let beginShebang=/^#![ ]*\//;
|
|
12
|
+
return opts.binary&&(opts.begin=concat(beginShebang,/.*\b/,opts.binary,/\b.*/)),inherit$1({scope:"meta",begin:beginShebang,end:/$/,relevance:0,"on:begin":(m,resp)=>{m.index!==0&&resp.ignoreMatch()}},opts)},BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},APOS_STRING_MODE={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[BACKSLASH_ESCAPE]},QUOTE_STRING_MODE={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[BACKSLASH_ESCAPE]},PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},
|
|
13
13
|
COMMENT=function(begin,end,modeOptions={}){let mode=inherit$1({scope:"comment",begin,end,contains:[]},modeOptions);mode.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let ENGLISH_WORD=either("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return mode.contains.push({begin:concat(/[ ]+/,"(",ENGLISH_WORD,
|
|
14
14
|
/[.]?[:]?([.][ ]|[ ])/,"){3}")}),mode},C_LINE_COMMENT_MODE=COMMENT("//","$"),C_BLOCK_COMMENT_MODE=COMMENT("/\\*","\\*/"),HASH_COMMENT_MODE=COMMENT("#","$"),NUMBER_MODE={scope:"number",begin:NUMBER_RE,relevance:0},C_NUMBER_MODE={scope:"number",begin:C_NUMBER_RE,relevance:0},BINARY_NUMBER_MODE={scope:"number",begin:BINARY_NUMBER_RE,relevance:0},REGEXP_MODE={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[BACKSLASH_ESCAPE]}]},
|
|
15
15
|
TITLE_MODE={scope:"title",begin:IDENT_RE,relevance:0},UNDERSCORE_TITLE_MODE={scope:"title",begin:UNDERSCORE_IDENT_RE,relevance:0},METHOD_GUARD={begin:"\\.\\s*"+UNDERSCORE_IDENT_RE,relevance:0},END_SAME_AS_BEGIN=function(mode){return Object.assign(mode,{"on:begin":(m,resp)=>{resp.data._beginMatch=m[1]},"on:end":(m,resp)=>{resp.data._beginMatch!==m[1]&&resp.ignoreMatch()}})},MODES=Object.freeze({__proto__:null,APOS_STRING_MODE,BACKSLASH_ESCAPE,BINARY_NUMBER_MODE,BINARY_NUMBER_RE,COMMENT,C_BLOCK_COMMENT_MODE,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-
|
|
2
|
+
import{mcpNamespace,require_proper_lockfile,validateMcpServerConfig}from"./chunk-T3HXWZG4.js";import{CONFIG_DIR_NAME,canonicalizePath,resolvePath,stripBom}from"./chunk-ZI7TK7HM.js";import{__toESM}from"./chunk-JXWJOIH4.js";import{spawn}from"node:child_process";function openBrowser(target){let[cmd,args]=process.platform==="darwin"?["open",[target]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",target]]:["xdg-open",[target]];spawn(cmd,args,{stdio:"ignore",detached:!0}).on("error",()=>{}).unref()}var import_proper_lockfile=__toESM(require_proper_lockfile(),1);import{existsSync,mkdirSync,readFileSync,writeFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join}from"node:path";var TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES=["settings.json","mcp.json","extensions","skills","prompts","themes","SYSTEM.md","APPEND_SYSTEM.md"];function normalizeCwd(cwd){return canonicalizePath(resolvePath(cwd))}function findNearestTrustEntry(data,cwd){let currentDir=normalizeCwd(cwd);for(;;){let value=data[currentDir];if(value===!0||value===!1)return{path:currentDir,decision:value};let parentDir=dirname(currentDir);if(parentDir===currentDir)return null;currentDir=parentDir}}function getProjectTrustParentPath(cwd){
|
|
3
3
|
let trustPath=normalizeCwd(cwd),parentDir=dirname(trustPath);return parentDir===trustPath?void 0:parentDir}function getProjectTrustOptions(cwd,options){let trustPath=normalizeCwd(cwd),trustOptions=[{label:"Trust",trusted:!0,updates:[{path:trustPath,decision:!0}],savedPath:trustPath}],parentPath=getProjectTrustParentPath(cwd);return parentPath!==void 0&&trustOptions.push({label:`Trust parent folder (${parentPath})`,trusted:!0,updates:[{path:parentPath,decision:!0},{path:trustPath,decision:null}],
|
|
4
4
|
savedPath:parentPath}),options?.includeSessionOnly&&trustOptions.push({label:"Trust (this session only)",trusted:!0,updates:[]}),trustOptions.push({label:"Do not trust",trusted:!1,updates:[{path:trustPath,decision:!1}],savedPath:trustPath}),options?.includeSessionOnly&&trustOptions.push({label:"Do not trust (this session only)",trusted:!1,updates:[]}),trustOptions}function readTrustFile(path){if(!existsSync(path))return{};let parsed;try{parsed=JSON.parse(stripBom(readFileSync(path,"utf-8")))}catch(error){
|
|
5
5
|
let message=error instanceof Error?error.message:String(error);throw new Error(`Failed to read trust store ${path}: ${message}`)}if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Invalid trust store ${path}: expected an object`);let data={};for(let[key,value]of Object.entries(parsed)){if(value!==!0&&value!==!1&&value!==null)throw new Error(`Invalid trust store ${path}: value for ${JSON.stringify(key)} must be true, false, or null`);data[key]=value}return data}function writeTrustFile(path,data){
|
|
@@ -7,14 +7,15 @@ let sorted={};for(let key of Object.keys(data).sort()){let value=data[key];(valu
|
|
|
7
7
|
`,"utf-8")}function acquireTrustLockSync(path){let trustDir=dirname(path);mkdirSync(trustDir,{recursive:!0});let maxAttempts=10,delayMs=20,lastError;for(let attempt=1;attempt<=maxAttempts;attempt++)try{return import_proper_lockfile.default.lockSync(trustDir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;lastError=error;let start=Date.now();for(;Date.now()-start<
|
|
8
8
|
delayMs;);}throw lastError instanceof Error?lastError:new Error("Failed to acquire trust store lock")}function withTrustFileLock(path,fn){let release=acquireTrustLockSync(path);try{return fn()}finally{release()}}function hasTrustRequiringProjectResources(cwd){let homeDir=canonicalizePath(resolvePath(process.env.HOME||homedir())),userAgentsSkillsDir=join(homeDir,".agents","skills"),currentDir=canonicalizePath(resolvePath(cwd)),configDir=join(currentDir,CONFIG_DIR_NAME);if(TRUST_REQUIRING_PROJECT_CONFIG_RESOURCES.
|
|
9
9
|
some(entry=>existsSync(join(configDir,entry))))return!0;for(;;){let agentsSkillsDir=join(currentDir,".agents","skills");if(agentsSkillsDir!==userAgentsSkillsDir&&existsSync(agentsSkillsDir))return!0;let parentDir=dirname(currentDir);if(parentDir===currentDir)return!1;currentDir=parentDir}}var ProjectTrustStore=class{trustPath;constructor(agentDir){this.trustPath=join(resolvePath(agentDir),"trust.json")}get(cwd){return this.getEntry(cwd)?.decision??null}getEntry(cwd){return withTrustFileLock(this.
|
|
10
|
-
trustPath,()=>{let data=readTrustFile(this.trustPath);return findNearestTrustEntry(data,cwd)})}set(cwd,decision){this.setMany([{path:cwd,decision}])}setMany(decisions){withTrustFileLock(this.trustPath,()=>{let data=readTrustFile(this.trustPath);for(let{path,decision}of decisions){let key=normalizeCwd(path);decision===null?delete data[key]:data[key]=decision}writeTrustFile(this.trustPath,data)})}};var import_proper_lockfile2=__toESM(require_proper_lockfile(),1);import{randomUUID}from"node:crypto";import{chmodSync,existsSync as existsSync2,lstatSync,mkdirSync as mkdirSync2,readFileSync as readFileSync2,realpathSync,renameSync,rmSync,statSync,writeFileSync as writeFileSync2}from"node:fs";import{basename,dirname as dirname2,join as join2}from"node:path";var OVERRIDE_KEYS=["enabled","exposure","toolExposure"];function isOverride(value){return value.command===void 0&&value.url===void 0&&value.type===void 0}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function readConfigFile(path,scope,state){let{servers,errors}=state;if(!existsSync2(path))return;let parsed;try{parsed=JSON.parse(readFileSync2(path,"utf8"))}catch(error){errors.push(`${path}: ${error instanceof Error?error.message:String(error)}`);
|
|
11
|
-
if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers)){errors.push(`${path}: expected an object with an "mcpServers" object`);return}typeof parsed.autoEnableCodemode=="boolean"?state.autoEnableCodemode=parsed.autoEnableCodemode:parsed.autoEnableCodemode!==void 0&&errors.push(`${path}: autoEnableCodemode must be a boolean`);for(let[name,value]of Object.entries(parsed.mcpServers??{})){if(scope==="project"&&isRecord(value)&&isOverride(value)){let base=servers.get(name),
|
|
12
|
-
keys(value).filter(key=>!OVERRIDE_KEYS.includes(key));if(!base)errors.push(`${path}: server "${name}" needs "command" or "url", or a global server to override`);else if(extra.length>0)errors.push(`${path}: server "${name}": an override can only set ${OVERRIDE_KEYS.join(", ")}`);else{let config2=validateMcpServerConfig(name,{...base.config,...value});typeof config2=="string"?errors.push(`${path}: ${config2}`):servers.set(name,{...base,config:config2,override:path})}continue}let config=validateMcpServerConfig(
|
|
10
|
+
trustPath,()=>{let data=readTrustFile(this.trustPath);return findNearestTrustEntry(data,cwd)})}set(cwd,decision){this.setMany([{path:cwd,decision}])}setMany(decisions){withTrustFileLock(this.trustPath,()=>{let data=readTrustFile(this.trustPath);for(let{path,decision}of decisions){let key=normalizeCwd(path);decision===null?delete data[key]:data[key]=decision}writeTrustFile(this.trustPath,data)})}};var import_proper_lockfile2=__toESM(require_proper_lockfile(),1);import{randomUUID}from"node:crypto";import{chmodSync,existsSync as existsSync2,lstatSync,mkdirSync as mkdirSync2,readFileSync as readFileSync2,realpathSync,renameSync,rmSync,statSync,writeFileSync as writeFileSync2}from"node:fs";import{basename,dirname as dirname2,join as join2}from"node:path";var OVERRIDE_KEYS=["enabled","exposure","toolExposure"];function isOverride(value){return value.command===void 0&&value.url===void 0&&value.type===void 0}function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function readConfigFile(path,scope,state){let{servers,errors}=state;if(!existsSync2(path))return;let parsed;try{parsed=JSON.parse(stripBom(readFileSync2(path,"utf8")))}catch(error){errors.push(`${path}: ${error instanceof Error?error.message:String(error)}`);
|
|
11
|
+
return}if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers)){errors.push(`${path}: expected an object with an "mcpServers" object`);return}typeof parsed.autoEnableCodemode=="boolean"?state.autoEnableCodemode=parsed.autoEnableCodemode:parsed.autoEnableCodemode!==void 0&&errors.push(`${path}: autoEnableCodemode must be a boolean`);for(let[name,value]of Object.entries(parsed.mcpServers??{})){if(scope==="project"&&isRecord(value)&&isOverride(value)){let base=servers.get(name),
|
|
12
|
+
extra=Object.keys(value).filter(key=>!OVERRIDE_KEYS.includes(key));if(!base)errors.push(`${path}: server "${name}" needs "command" or "url", or a global server to override`);else if(extra.length>0)errors.push(`${path}: server "${name}": an override can only set ${OVERRIDE_KEYS.join(", ")}`);else{let config2=validateMcpServerConfig(name,{...base.config,...value});typeof config2=="string"?errors.push(`${path}: ${config2}`):servers.set(name,{...base,config:config2,override:path})}continue}let config=validateMcpServerConfig(
|
|
13
13
|
name,value);if(typeof config=="string"){errors.push(`${path}: ${config}`);continue}let clash=[...servers.keys()].find(other=>other!==name&&mcpNamespace(other)===mcpNamespace(name));if(clash){errors.push(`${path}: server "${name}" conflicts with "${clash}"`);continue}if(scope==="project"&&"url"in config&&config.auth){errors.push(`${path}: server "${name}": auth is only allowed in the global mcp.json`);continue}servers.set(name,{name,config,source:path,scope})}}function loadMcpConfig(options){let state={
|
|
14
14
|
servers:new Map,errors:[]};readConfigFile(join2(options.agentDir,"mcp.json"),"global",state);let projectConfig=options.projectTrusted?join2(options.cwd,CONFIG_DIR_NAME,"mcp.json"):void 0;return projectConfig&&readConfigFile(projectConfig,"project",state),{servers:[...state.servers.values()],...state.autoEnableCodemode===void 0?{}:{autoEnableCodemode:state.autoEnableCodemode},errors:state.errors,...projectConfig?{projectConfig}:{}}}function updateMcpServerConfig(path,name,patch,options={}){editMcpServers(
|
|
15
15
|
path,(servers,parsed)=>{let server=servers?.[name];if(server===void 0&&options.override&&(server={},parsed.mcpServers={...servers,[name]:server}),!isRecord(server))throw new Error(`${path} does not define MCP server "${name}"`);let keepDefaults=isOverride(server);return patch.enabled!==void 0&&(patch.enabled&&!keepDefaults?delete server.enabled:server.enabled=patch.enabled),patch.exposure!==void 0&&(patch.exposure==="codemode"&&!keepDefaults?delete server.exposure:server.exposure=patch.exposure),
|
|
16
|
-
!0})}function addMcpServerConfig(path,name,config){return updateMcpConfigLocked(path,servers=>{let replaced=servers[name]!==void 0;return servers[name]=config,replaced})}function updateMcpConfigLocked(path,mutate){let result;return editMcpServers(path,(servers,parsed)=>{let target=servers??{},before=JSON.stringify(target);return result=mutate(target),JSON.stringify(target)===before?!1:(parsed.mcpServers=target,!0)}),result}function removeMcpServerConfig(path,name){if(!existsSync2(path))return!1;let removed=!1;return editMcpServers(path,servers=>!servers||servers[name]===void 0?!1:(delete servers[name],removed=!0,!0)),removed}function parseMcpFile(path,text){let parsed=text===void 0?{}:JSON.parse(text);if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers))throw new Error(`${path}: expected an object with an "mcpServers" object`);return{parsed,servers:isRecord(parsed.mcpServers)?parsed.
|
|
17
|
-
void 0}}function canonicalMcpPath(path){mkdirSync2(dirname2(path),{recursive:!0});let isSymlink=!1;try{isSymlink=lstatSync(path).isSymbolicLink()}catch(error){if(error.code!=="ENOENT")throw error;return join2(realpathSync(dirname2(path)),basename(path))}try{return realpathSync(path)}catch(error){throw isSymlink&&error.code==="ENOENT"?new Error(`Refusing to modify ${path}: it is a dangling symlink. Create its target or remove the link.`):error}}function acquireMcpLockSync(path){let dir=dirname2(
|
|
18
|
-
maxAttempts=50,delayMs=20;for(let attempt=1;;attempt++)try{return import_proper_lockfile2.default.lockSync(dir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;let start=Date.now();for(;Date.now()-start<delayMs;);}}function editMcpServers(path,edit){let canonical=canonicalMcpPath(path),release=acquireMcpLockSync(canonical);try{if(canonicalMcpPath(path)!==
|
|
19
|
-
throw new Error(`Refusing to modify ${path}: it changed while waiting for the lock. Retry.`);let text=existsSync2(canonical)?readFileSync2(canonical,"utf8"):void 0,{parsed,servers}=parseMcpFile(path,text);if(!edit(servers,parsed))return;let indent=text&&/^([ \t]+)\S/m.exec(text)?.[1]||" ",targetPath=canonical,tempPath=join2(dirname2(targetPath),`${randomUUID()}.tmp`),mode=text!==void 0?statSync(targetPath).mode&511:384;try{writeFileSync2(tempPath,`${JSON.stringify(parsed,null,indent)}
|
|
16
|
+
!0})}function addMcpServerConfig(path,name,config){return updateMcpConfigLocked(path,servers=>{let replaced=servers[name]!==void 0;return servers[name]=config,replaced})}function updateMcpConfigLocked(path,mutate){let result;return editMcpServers(path,(servers,parsed)=>{let target=servers??{},before=JSON.stringify(target);return result=mutate(target),JSON.stringify(target)===before?!1:(parsed.mcpServers=target,!0)}),result}function removeMcpServerConfig(path,name){if(!existsSync2(path))return!1;let removed=!1;return editMcpServers(path,servers=>!servers||servers[name]===void 0?!1:(delete servers[name],removed=!0,!0)),removed}function parseMcpFile(path,text){let parsed=text===void 0?{}:JSON.parse(stripBom(text));if(!isRecord(parsed)||parsed.mcpServers!==void 0&&!isRecord(parsed.mcpServers))throw new Error(`${path}: expected an object with an "mcpServers" object`);return{parsed,servers:isRecord(parsed.mcpServers)?parsed.
|
|
17
|
+
mcpServers:void 0}}function canonicalMcpPath(path){mkdirSync2(dirname2(path),{recursive:!0});let isSymlink=!1;try{isSymlink=lstatSync(path).isSymbolicLink()}catch(error){if(error.code!=="ENOENT")throw error;return join2(realpathSync(dirname2(path)),basename(path))}try{return realpathSync(path)}catch(error){throw isSymlink&&error.code==="ENOENT"?new Error(`Refusing to modify ${path}: it is a dangling symlink. Create its target or remove the link.`):error}}function acquireMcpLockSync(path){let dir=dirname2(
|
|
18
|
+
path),maxAttempts=50,delayMs=20;for(let attempt=1;;attempt++)try{return import_proper_lockfile2.default.lockSync(dir,{realpath:!1,lockfilePath:`${path}.lock`})}catch(error){if((typeof error=="object"&&error!==null&&"code"in error?String(error.code):void 0)!=="ELOCKED"||attempt===maxAttempts)throw error;let start=Date.now();for(;Date.now()-start<delayMs;);}}function editMcpServers(path,edit){let canonical=canonicalMcpPath(path),release=acquireMcpLockSync(canonical);try{if(canonicalMcpPath(path)!==
|
|
19
|
+
canonical)throw new Error(`Refusing to modify ${path}: it changed while waiting for the lock. Retry.`);let text=existsSync2(canonical)?readFileSync2(canonical,"utf8"):void 0,{parsed,servers}=parseMcpFile(path,text);if(!edit(servers,parsed))return;let indent=text&&/^([ \t]+)\S/m.exec(text)?.[1]||" ",targetPath=canonical,tempPath=join2(dirname2(targetPath),`${randomUUID()}.tmp`),mode=text!==void 0?statSync(targetPath).mode&511:384;try{writeFileSync2(tempPath,`${JSON.stringify(parsed,null,indent)}\
|
|
20
|
+
|
|
20
21
|
`,{flag:"wx",mode}),chmodSync(tempPath,mode),renameSync(tempPath,targetPath)}catch(error){throw rmSync(tempPath,{force:!0}),error}}finally{release()}}export{openBrowser,getProjectTrustOptions,hasTrustRequiringProjectResources,ProjectTrustStore,loadMcpConfig,updateMcpServerConfig,addMcpServerConfig,updateMcpConfigLocked,removeMcpServerConfig};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
+
import{isRecord,parseClassifierUsage,postClassifierRequest,requiredNumber}from"./chunk-XQX7S3GM.js";import{formatProviderError,normalizeProviderError}from"./chunk-HT5YN3LX.js";var IMAGE_OPT_IN_HEADERS={"TypeSafe-Danger-Zone-Images":"true"};function probabilities(label,value,id){if(!isRecord(value))throw new Error(`${label} returned invalid probabilities for ${id}`);return Object.fromEntries(Object.entries(value).map(([key,probability])=>[key,requiredNumber(label,probability,`probability for ${id}.${key}`)]))}function parseAnswers(label,value,context){if(!isRecord(value))throw new Error(`${label} returned an unexpected response`);let answers=[];for(let[id,question]of Object.
|
|
3
|
+
entries(context.questions)){let answer=value[id];if(!isRecord(answer))throw new Error(`${label} did not return an answer for ${id}`);if(question.type==="choice"){if(answer.type!=="choice"||typeof answer.choice!="string")throw new Error(`${label} did not return a choice answer for ${id}`);answers.push([id,{type:"choice",choice:answer.choice,probabilities:probabilities(label,answer.probabilities,id),confidence:requiredNumber(label,answer.confidence,`confidence for ${id}`)}])}else if(question.type===
|
|
4
|
+
"score"){if(answer.type!=="score")throw new Error(`${label} did not return a score answer for ${id}`);answers.push([id,{type:"score",score:requiredNumber(label,answer.score,`score for ${id}`),confidence:requiredNumber(label,answer.confidence,`confidence for ${id}`)}])}else{if(answer.type!=="noul")throw new Error(`${label} did not return a bool answer for ${id}`);answers.push([id,{type:"bool",probability:requiredNumber(label,answer.noul,`probability for ${id}`)}])}}return Object.fromEntries(answers)}
|
|
5
|
+
var ASSET_FORMATS={"image/png":"png","image/jpeg":"jpeg"},DATA_URL_TYPES=new Set(["image/png","image/jpeg","image/webp"]),MAX_DATA_URL_IMAGES=4;function addImages(label,model,input,images,request){if(input==="images"){if(images.length>MAX_DATA_URL_IMAGES)throw new Error(`${label} accepts at most ${MAX_DATA_URL_IMAGES} images per request, got ${images.length}`);request.images=images.map(image=>{if(!DATA_URL_TYPES.has(image.mimeType))throw new Error(`${label} accepts PNG, JPEG, and WebP images for\
|
|
6
|
+
${model.id}, got ${image.mimeType}`);return`data:${image.mimeType};base64,${image.data}`});return}if(input==="state-image-urls"){let parts=images.map(image=>({type:"image_url",image_url:{url:`data:${image.mimeType};base64,${image.data}`}}));request.state=[...parts,request.state];return}let assets={};images.forEach((image,index)=>{let format=ASSET_FORMATS[image.mimeType];if(!format)throw new Error(`${label} accepts PNG and JPEG images for ${model.id}, got ${image.mimeType}`);assets[`<image-${index+
|
|
7
|
+
1}>`]={type:"image",format,data_base64:image.data}}),request.assets=assets,request.state=[...Object.keys(assets),request.state]}function wireRequest(context){return{state:context.state,questions:Object.fromEntries(Object.entries(context.questions).map(([id,question])=>[id,question.type==="bool"?{...question,type:"noul"}:question]))}}async function classifySystemOne(transport,model,context,options){let output={api:model.api,provider:model.provider,model:model.id,answers:{},stopReason:"stop",timestamp:Date.
|
|
8
|
+
now()};try{if(model.api!==transport.api)throw new Error(`Unsupported classifier API: ${model.api}`);let request=wireRequest(context),requestOptions=options;if(context.images?.length){if(!model.input.includes("image"))throw new Error(`${transport.label} does not support image input for ${model.id}`);let detected=transport.detectCompat(model),imageInput=model.compat?.imageInput??detected.imageInput;addImages(transport.label,model,imageInput,context.images,request),(model.compat?.sendImageOptInHeader??
|
|
9
|
+
detected.sendImageOptInHeader)&&(requestOptions={...options,headers:{...IMAGE_OPT_IN_HEADERS,...options?.headers}})}let body=await postClassifierRequest(transport.label,transport.url(model),model,transport.payload(model,request),requestOptions),result=transport.output(body),usage=parseClassifierUsage(result.usage,model);return usage&&(output.usage=usage),output.answers=parseAnswers(transport.label,result.answers,context),output}catch(error){return output.stopReason=options?.signal?.aborted?"abor\
|
|
10
|
+
ted":"error",output.errorMessage=formatProviderError(normalizeProviderError(error),`${transport.label} error`),output}}export{classifySystemOne};
|