@humain/humain-code 0.4.18 → 0.5.3
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 +284 -1
- package/README.md +3 -1
- package/dist/agent-monitor/client.d.ts +2 -2
- package/dist/agent-monitor/client.d.ts.map +1 -1
- package/dist/agent-monitor/client.js +3 -2
- package/dist/agent-monitor/client.js.map +1 -1
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +67 -0
- package/dist/bundle/chunks/anthropic.js +10 -9
- 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-QEF72EIZ.js → chunk-A6B2QMA7.js} +40 -96
- package/dist/bundle/chunks/{chunk-YMBXWW36.js → chunk-AO6FF5JL.js} +9 -8
- 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-DU6POZ7E.js +10 -0
- package/dist/bundle/chunks/chunk-EY3LZOUP.js +1963 -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-L5OUCJ7N.js → chunk-L2VKM23Q.js} +87 -13
- 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-P4UKLIQB.js → chunk-ODJUBJK2.js} +4 -4
- 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-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-FZUJXM6D.js → chunk-UDB6NI4G.js} +309 -240
- package/dist/bundle/chunks/{chunk-3UXBFT4Q.js → chunk-UJLCKIMZ.js} +1906 -1661
- 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-7VY5IL74.js → chunk-Y3OPKKDR.js} +3 -77
- 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-ENEFJH2B.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-CJBWWYHE.js +13 -0
- package/dist/bundle/chunks/{dist-XVXV2CL4.js → dist-IBUWEKEE.js} +3 -3
- package/dist/bundle/chunks/{dist-ZJIYY3GA.js → dist-RKNCFFGM.js} +452 -448
- 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 +44 -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 +10 -9
- 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 +10 -9
- package/dist/bundle/chunks/{pi-messages-SAOV3JNW.js → pi-messages-MOQQDZBK.js} +5 -4
- package/dist/bundle/chunks/radius.js +9 -8
- package/dist/bundle/chunks/{runtime-HJEUOD4R.js → runtime-K3F2QDQP.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-5D6QIJPN.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 +33 -7
- 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 +123 -14
- 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/safe-credential-error.d.ts +11 -0
- package/dist/core/safe-credential-error.d.ts.map +1 -0
- package/dist/core/safe-credential-error.js +14 -0
- package/dist/core/safe-credential-error.js.map +1 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +12 -10
- 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/settings-schema.d.ts +3 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +6 -0
- package/dist/core/settings-schema.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/gateway/catalog.d.ts +36 -0
- package/dist/humain/gateway/catalog.d.ts.map +1 -0
- package/dist/humain/gateway/catalog.js +74 -0
- package/dist/humain/gateway/catalog.js.map +1 -0
- package/dist/humain/gateway/client.d.ts +58 -0
- package/dist/humain/gateway/client.d.ts.map +1 -0
- package/dist/humain/gateway/client.js +212 -0
- package/dist/humain/gateway/client.js.map +1 -0
- package/dist/humain/gateway/constants.d.ts +23 -0
- package/dist/humain/gateway/constants.d.ts.map +1 -0
- package/dist/humain/gateway/constants.js +32 -0
- package/dist/humain/gateway/constants.js.map +1 -0
- package/dist/humain/gateway/http.d.ts +18 -0
- package/dist/humain/gateway/http.d.ts.map +1 -0
- package/dist/humain/gateway/http.js +274 -0
- package/dist/humain/gateway/http.js.map +1 -0
- package/dist/humain/gateway/login.d.ts +13 -0
- package/dist/humain/gateway/login.d.ts.map +1 -0
- package/dist/humain/gateway/login.js +121 -0
- package/dist/humain/gateway/login.js.map +1 -0
- package/dist/humain/gateway/provider.d.ts +34 -0
- package/dist/humain/gateway/provider.d.ts.map +1 -0
- package/dist/humain/gateway/provider.js +253 -0
- package/dist/humain/gateway/provider.js.map +1 -0
- package/dist/humain/gateway/secret-store.d.ts +19 -0
- package/dist/humain/gateway/secret-store.d.ts.map +1 -0
- package/dist/humain/gateway/secret-store.js +252 -0
- package/dist/humain/gateway/secret-store.js.map +1 -0
- package/dist/humain/gateway/session-store.d.ts +42 -0
- package/dist/humain/gateway/session-store.d.ts.map +1 -0
- package/dist/humain/gateway/session-store.js +175 -0
- package/dist/humain/gateway/session-store.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 +5 -2
- package/dist/humain/index.js.map +1 -1
- package/dist/humain/login-menu.d.ts +14 -0
- package/dist/humain/login-menu.d.ts.map +1 -0
- package/dist/humain/login-menu.js +21 -0
- package/dist/humain/login-menu.js.map +1 -0
- package/dist/humain/node-http.d.ts.map +1 -1
- package/dist/humain/node-http.js +6 -31
- package/dist/humain/node-http.js.map +1 -1
- package/dist/humain/redact-assistant-message.d.ts +4 -0
- package/dist/humain/redact-assistant-message.d.ts.map +1 -0
- package/dist/humain/redact-assistant-message.js +34 -0
- package/dist/humain/redact-assistant-message.js.map +1 -0
- 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 +32 -6
- 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/login-dialog.d.ts +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +3 -2
- package/dist/modes/interactive/components/login-dialog.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.d.ts +11 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +17 -4
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.d.ts +5 -4
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +11 -9
- package/dist/modes/interactive/components/radius-login-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 +15 -17
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +143 -158
- 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/sleep.d.ts +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js +10 -6
- package/dist/utils/sleep.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/humain-code.md +13 -1
- package/docs/index.md +1 -1
- package/docs/models-configuration.md +197 -0
- package/docs/models.md +24 -6
- package/docs/providers.md +58 -2
- package/docs/quickstart.md +8 -1
- 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/schemas/settings.schema.json +19 -0
- 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,4 +1,4 @@
|
|
|
1
|
-
// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)),
|
|
1
|
+
// Derived from Pi-Bolt (MIT, Copyright (c) 2026 OpenSec (Pi-Bolt)), commits d82b859e, c6f24dd9; modified for HUMAIN Code CLI.
|
|
2
2
|
/**
|
|
3
3
|
* Interactive mode for the coding agent.
|
|
4
4
|
* Handles TUI rendering and user interaction, delegating business logic to AgentSession.
|
|
@@ -32,6 +32,7 @@ import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
|
32
32
|
import { getOAuthAccountRemovalSuccessor } from "../../core/oauth-account-pool.js";
|
|
33
33
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
34
34
|
import { RADIUS_MCP_URL, RADIUS_PROVIDER_ID, writeRadiusMcpServer } from "../../core/radius.js";
|
|
35
|
+
import { SafeCredentialError } from "../../core/safe-credential-error.js";
|
|
35
36
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
36
37
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
37
38
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
@@ -44,6 +45,7 @@ import { resolveAdhdSessionMode } from "../../humain/adhd/index.js";
|
|
|
44
45
|
import { renderHumainCodeIcon } from "../../humain/brand-logo.js";
|
|
45
46
|
import { CAVEMAN_LEVELS, getCavemanDefaultMode, resolveCavemanSessionMode } from "../../humain/caveman/index.js";
|
|
46
47
|
import { bindFlowAccountsHost, createFlowAccountReporter, FLOW_ACCOUNT_PERSISTENCE_NOTICE, flowUsageTargets, formatFlowAccountAdvanced, listFlowAccountMetadata, nodeLabelContainsStoredKey, readFlowNodeFallbackState, refreshFlowCatalog, updateFlowNodeFallback, } from "../../humain/flow-accounts-host.js";
|
|
48
|
+
import { ACCOUNT_LOGIN_LABEL, API_KEY_LOGIN_LABEL, HUMAIN_LOGIN_LABEL, HUMAIN_SHIMMER_COLORS, humainLoginProviders, topLevelLoginOptions, } from "../../humain/login-menu.js";
|
|
47
49
|
import { RUNTIME_MODES, readDefaultMode, resolveSessionMode as resolvePonytailSessionMode, } from "../../humain/ponytail/index.js";
|
|
48
50
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
49
51
|
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
@@ -77,8 +79,8 @@ import { FooterComponent, formatTokens } from "./components/footer.js";
|
|
|
77
79
|
import { formatKeyText, keyDisplayText, keyHint, keyText, rawKeyHint } from "./components/keybinding-hints.js";
|
|
78
80
|
import { LoginDialogComponent } from "./components/login-dialog.js";
|
|
79
81
|
import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
|
|
80
|
-
import { ModelSelectorComponent } from "./components/model-selector.js";
|
|
81
|
-
import {
|
|
82
|
+
import { ModelSelectorComponent, modelSelectionStatus } from "./components/model-selector.js";
|
|
83
|
+
import { formatAuthSelectorProviderType, OAuthSelectorComponent, } from "./components/oauth-selector.js";
|
|
82
84
|
import { createLoginMenuSelector } from "./components/radius-login-selector.js";
|
|
83
85
|
import { ScopedModelsSelectorComponent } from "./components/scoped-models-selector.js";
|
|
84
86
|
import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
@@ -281,6 +283,8 @@ export class InteractiveMode {
|
|
|
281
283
|
lastEscapeTime = 0;
|
|
282
284
|
changelogMarkdown = undefined;
|
|
283
285
|
startupNoticesShown = false;
|
|
286
|
+
/** The /model save-as-default tip is shown once per run. */
|
|
287
|
+
modelSaveTipShown = false;
|
|
284
288
|
anthropicSubscriptionWarningShown = false;
|
|
285
289
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
286
290
|
lastStatusSpacer = undefined;
|
|
@@ -334,11 +338,10 @@ export class InteractiveMode {
|
|
|
334
338
|
bugReportHintShown = false;
|
|
335
339
|
installChangeWarningShown = false;
|
|
336
340
|
// Extension UI state
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
extensionEditor = undefined;
|
|
341
|
+
// Extension dialogs shown in the editor slot (select, confirm, input, editor, inline custom).
|
|
342
|
+
// The last entry is visible; see pushExtensionDialog().
|
|
343
|
+
// `cancel` settles the dialog's pending promise when it is closed without an answer, so callers never hang.
|
|
344
|
+
extensionDialogs = [];
|
|
342
345
|
extensionTerminalInputSubscriptions = new Set();
|
|
343
346
|
// Extension widgets (components rendered above/below the editor)
|
|
344
347
|
extensionWidgetsAbove = new Map();
|
|
@@ -1945,14 +1948,8 @@ export class InteractiveMode {
|
|
|
1945
1948
|
resetExtensionUI() {
|
|
1946
1949
|
// Release first: aborting resolves pending account dialogs before their UI is hidden.
|
|
1947
1950
|
this.releaseFlowAccountsHost();
|
|
1948
|
-
if (this.
|
|
1949
|
-
this.
|
|
1950
|
-
}
|
|
1951
|
-
if (this.extensionInput) {
|
|
1952
|
-
this.hideExtensionInput();
|
|
1953
|
-
}
|
|
1954
|
-
if (this.extensionEditor) {
|
|
1955
|
-
this.hideExtensionEditor();
|
|
1951
|
+
if (this.extensionDialogs.length > 0) {
|
|
1952
|
+
this.closeExtensionDialogs();
|
|
1956
1953
|
}
|
|
1957
1954
|
this.ui.hideOverlay();
|
|
1958
1955
|
this.clearExtensionTerminalInputListeners();
|
|
@@ -2162,6 +2159,45 @@ export class InteractiveMode {
|
|
|
2162
2159
|
setToolsExpanded: (expanded) => this.setToolsExpanded(expanded),
|
|
2163
2160
|
};
|
|
2164
2161
|
}
|
|
2162
|
+
/**
|
|
2163
|
+
* Show an extension dialog in the editor slot.
|
|
2164
|
+
* Dialogs form a stack: a new dialog hides the visible one, and closing the visible dialog shows
|
|
2165
|
+
* the previous one again. Every dialog stays answerable, so no dialog promise is left pending,
|
|
2166
|
+
* and dialogs opened from inside another dialog (for example a confirm from a custom component) work.
|
|
2167
|
+
*/
|
|
2168
|
+
pushExtensionDialog(component, blocked, cancel) {
|
|
2169
|
+
this.disposeActiveSelector();
|
|
2170
|
+
this.extensionDialogs.push({ component, blocked, cancel });
|
|
2171
|
+
this.showTopExtensionDialog();
|
|
2172
|
+
}
|
|
2173
|
+
/** Close every extension dialog and settle its pending promise, then show the editor. */
|
|
2174
|
+
closeExtensionDialogs() {
|
|
2175
|
+
const dialogs = this.extensionDialogs;
|
|
2176
|
+
this.extensionDialogs = [];
|
|
2177
|
+
for (const dialog of dialogs) {
|
|
2178
|
+
dialog.component.dispose?.();
|
|
2179
|
+
dialog.cancel?.();
|
|
2180
|
+
}
|
|
2181
|
+
this.showTopExtensionDialog();
|
|
2182
|
+
}
|
|
2183
|
+
/** Remove an extension dialog. If it was visible, show the previous dialog or the editor. */
|
|
2184
|
+
removeExtensionDialog(component) {
|
|
2185
|
+
const index = this.extensionDialogs.findIndex((dialog) => dialog.component === component);
|
|
2186
|
+
if (index === -1)
|
|
2187
|
+
return;
|
|
2188
|
+
this.extensionDialogs.splice(index, 1);
|
|
2189
|
+
if (index === this.extensionDialogs.length)
|
|
2190
|
+
this.showTopExtensionDialog();
|
|
2191
|
+
}
|
|
2192
|
+
showTopExtensionDialog() {
|
|
2193
|
+
const top = this.extensionDialogs.at(-1);
|
|
2194
|
+
const component = top?.component ?? this.editor;
|
|
2195
|
+
this.editorContainer.clear();
|
|
2196
|
+
this.editorContainer.addChild(component);
|
|
2197
|
+
this.ui.setFocus(component);
|
|
2198
|
+
this.programStatus.setBlocked("extension-dialog", top?.blocked);
|
|
2199
|
+
this.ui.requestRender();
|
|
2200
|
+
}
|
|
2165
2201
|
/**
|
|
2166
2202
|
* Show a selector for extensions.
|
|
2167
2203
|
*/
|
|
@@ -2171,48 +2207,18 @@ export class InteractiveMode {
|
|
|
2171
2207
|
resolve(undefined);
|
|
2172
2208
|
return;
|
|
2173
2209
|
}
|
|
2174
|
-
const
|
|
2175
|
-
this.hideExtensionSelector();
|
|
2176
|
-
resolve(undefined);
|
|
2177
|
-
};
|
|
2178
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2179
|
-
this.extensionSelectorSettle = () => {
|
|
2180
|
-
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2181
|
-
resolve(undefined);
|
|
2182
|
-
};
|
|
2183
|
-
this.extensionSelector = new ExtensionSelectorComponent(title, options, (option) => {
|
|
2210
|
+
const finish = (option) => {
|
|
2184
2211
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2212
|
+
selector.dispose();
|
|
2213
|
+
this.removeExtensionDialog(selector);
|
|
2185
2214
|
resolve(option);
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
}, { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
|
|
2192
|
-
this.disposeActiveSelector();
|
|
2193
|
-
this.editorContainer.clear();
|
|
2194
|
-
this.editorContainer.addChild(this.extensionSelector);
|
|
2195
|
-
this.ui.setFocus(this.extensionSelector);
|
|
2196
|
-
// Extension dialogs share the editor slot: opening one replaces the status of a displaced one.
|
|
2197
|
-
this.programStatus.setBlocked("extension-dialog", blocked);
|
|
2198
|
-
this.ui.requestRender();
|
|
2215
|
+
};
|
|
2216
|
+
const onAbort = () => finish(undefined);
|
|
2217
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2218
|
+
const selector = new ExtensionSelectorComponent(title, options, (option) => finish(option), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout, onToggleToolsExpanded: () => this.toggleToolOutputExpansion() });
|
|
2219
|
+
this.pushExtensionDialog(selector, blocked, onAbort);
|
|
2199
2220
|
});
|
|
2200
2221
|
}
|
|
2201
|
-
/**
|
|
2202
|
-
* Hide the extension selector.
|
|
2203
|
-
*/
|
|
2204
|
-
hideExtensionSelector() {
|
|
2205
|
-
const settle = this.extensionSelectorSettle;
|
|
2206
|
-
this.extensionSelectorSettle = undefined;
|
|
2207
|
-
settle?.();
|
|
2208
|
-
this.extensionSelector?.dispose();
|
|
2209
|
-
this.editorContainer.clear();
|
|
2210
|
-
this.editorContainer.addChild(this.editor);
|
|
2211
|
-
this.extensionSelector = undefined;
|
|
2212
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2213
|
-
this.ui.setFocus(this.editor);
|
|
2214
|
-
this.ui.requestRender();
|
|
2215
|
-
}
|
|
2216
2222
|
/**
|
|
2217
2223
|
* Show a confirmation dialog for extensions.
|
|
2218
2224
|
*/
|
|
@@ -2236,71 +2242,31 @@ export class InteractiveMode {
|
|
|
2236
2242
|
resolve(undefined);
|
|
2237
2243
|
return;
|
|
2238
2244
|
}
|
|
2239
|
-
const
|
|
2240
|
-
this.hideExtensionInput();
|
|
2241
|
-
resolve(undefined);
|
|
2242
|
-
};
|
|
2243
|
-
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2244
|
-
this.extensionInput = new ExtensionInputComponent(title, placeholder, (value) => {
|
|
2245
|
+
const finish = (value) => {
|
|
2245
2246
|
opts?.signal?.removeEventListener("abort", onAbort);
|
|
2246
|
-
|
|
2247
|
+
input.dispose();
|
|
2248
|
+
this.removeExtensionDialog(input);
|
|
2247
2249
|
resolve(value);
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
this.disposeActiveSelector();
|
|
2254
|
-
this.editorContainer.clear();
|
|
2255
|
-
this.editorContainer.addChild(this.extensionInput);
|
|
2256
|
-
this.ui.setFocus(this.extensionInput);
|
|
2257
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2258
|
-
this.ui.requestRender();
|
|
2250
|
+
};
|
|
2251
|
+
const onAbort = () => finish(undefined);
|
|
2252
|
+
opts?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
2253
|
+
const input = new ExtensionInputComponent(title, placeholder, (value) => finish(value), () => finish(undefined), { tui: this.ui, timeout: opts?.timeout });
|
|
2254
|
+
this.pushExtensionDialog(input, { kind: "question", message: title }, onAbort);
|
|
2259
2255
|
});
|
|
2260
2256
|
}
|
|
2261
|
-
/**
|
|
2262
|
-
* Hide the extension input.
|
|
2263
|
-
*/
|
|
2264
|
-
hideExtensionInput() {
|
|
2265
|
-
this.extensionInput?.dispose();
|
|
2266
|
-
this.editorContainer.clear();
|
|
2267
|
-
this.editorContainer.addChild(this.editor);
|
|
2268
|
-
this.extensionInput = undefined;
|
|
2269
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2270
|
-
this.ui.setFocus(this.editor);
|
|
2271
|
-
this.ui.requestRender();
|
|
2272
|
-
}
|
|
2273
2257
|
/**
|
|
2274
2258
|
* Show a multi-line editor for extensions (with Ctrl+G support).
|
|
2275
2259
|
*/
|
|
2276
2260
|
showExtensionEditor(title, prefill) {
|
|
2277
2261
|
return new Promise((resolve) => {
|
|
2278
|
-
|
|
2279
|
-
this.
|
|
2262
|
+
const finish = (value) => {
|
|
2263
|
+
this.removeExtensionDialog(editor);
|
|
2280
2264
|
resolve(value);
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
}, undefined, this.settingsManager.getExternalEditorCommand());
|
|
2285
|
-
this.disposeActiveSelector();
|
|
2286
|
-
this.editorContainer.clear();
|
|
2287
|
-
this.editorContainer.addChild(this.extensionEditor);
|
|
2288
|
-
this.ui.setFocus(this.extensionEditor);
|
|
2289
|
-
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2290
|
-
this.ui.requestRender();
|
|
2265
|
+
};
|
|
2266
|
+
const editor = new ExtensionEditorComponent(this.ui, this.keybindings, title, prefill, (value) => finish(value), () => finish(undefined), undefined, this.settingsManager.getExternalEditorCommand());
|
|
2267
|
+
this.pushExtensionDialog(editor, { kind: "question", message: title }, () => finish(undefined));
|
|
2291
2268
|
});
|
|
2292
2269
|
}
|
|
2293
|
-
/**
|
|
2294
|
-
* Hide the extension editor.
|
|
2295
|
-
*/
|
|
2296
|
-
hideExtensionEditor() {
|
|
2297
|
-
this.editorContainer.clear();
|
|
2298
|
-
this.editorContainer.addChild(this.editor);
|
|
2299
|
-
this.extensionEditor = undefined;
|
|
2300
|
-
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2301
|
-
this.ui.setFocus(this.editor);
|
|
2302
|
-
this.ui.requestRender();
|
|
2303
|
-
}
|
|
2304
2270
|
/**
|
|
2305
2271
|
* Set a custom editor component from an extension.
|
|
2306
2272
|
* Pass undefined to restore the default editor.
|
|
@@ -2391,17 +2357,16 @@ export class InteractiveMode {
|
|
|
2391
2357
|
async showExtensionCustom(factory, options) {
|
|
2392
2358
|
const savedText = this.editor.getText();
|
|
2393
2359
|
const isOverlay = options?.overlay ?? false;
|
|
2394
|
-
const restoreEditor = () => {
|
|
2395
|
-
this.editorContainer.clear();
|
|
2396
|
-
this.editorContainer.addChild(this.editor);
|
|
2397
|
-
this.editor.setText(savedText);
|
|
2398
|
-
this.ui.setFocus(this.editor);
|
|
2399
|
-
this.ui.requestRender();
|
|
2400
|
-
};
|
|
2401
2360
|
return new Promise((resolve, reject) => {
|
|
2402
2361
|
let component;
|
|
2403
2362
|
let overlayHandle;
|
|
2404
2363
|
let closed = false;
|
|
2364
|
+
const restoreEditor = () => {
|
|
2365
|
+
if (component)
|
|
2366
|
+
this.removeExtensionDialog(component);
|
|
2367
|
+
this.editor.setText(savedText);
|
|
2368
|
+
this.ui.requestRender();
|
|
2369
|
+
};
|
|
2405
2370
|
const close = (result) => {
|
|
2406
2371
|
if (closed)
|
|
2407
2372
|
return;
|
|
@@ -2435,19 +2400,15 @@ export class InteractiveMode {
|
|
|
2435
2400
|
return opts;
|
|
2436
2401
|
}
|
|
2437
2402
|
// Fallback: use component's width property if available
|
|
2438
|
-
const w =
|
|
2403
|
+
const w = c.width;
|
|
2439
2404
|
return w ? { width: w } : undefined;
|
|
2440
2405
|
};
|
|
2441
|
-
overlayHandle = this.ui.showOverlay(
|
|
2406
|
+
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2442
2407
|
// Expose handle to caller for visibility control
|
|
2443
2408
|
options?.onHandle?.(overlayHandle);
|
|
2444
2409
|
}
|
|
2445
2410
|
else {
|
|
2446
|
-
this.
|
|
2447
|
-
this.editorContainer.clear();
|
|
2448
|
-
this.editorContainer.addChild(component);
|
|
2449
|
-
this.ui.setFocus(component);
|
|
2450
|
-
this.ui.requestRender();
|
|
2411
|
+
this.pushExtensionDialog(c);
|
|
2451
2412
|
}
|
|
2452
2413
|
})
|
|
2453
2414
|
.catch((err) => {
|
|
@@ -3061,7 +3022,14 @@ export class InteractiveMode {
|
|
|
3061
3022
|
this.maybeShowInstallChangeWarning();
|
|
3062
3023
|
const component = this.pendingTools.get(event.toolCallId);
|
|
3063
3024
|
if (component) {
|
|
3064
|
-
component
|
|
3025
|
+
// Only what the component draws: the result's structuredContent can hold up to 1 MiB of bash output
|
|
3026
|
+
// (2 MiB as a JavaScript string), which the component would keep for the rest of the session.
|
|
3027
|
+
component.updateResult({
|
|
3028
|
+
content: event.result.content,
|
|
3029
|
+
details: event.result.details,
|
|
3030
|
+
isError: event.isError,
|
|
3031
|
+
durationMs: event.durationMs,
|
|
3032
|
+
});
|
|
3065
3033
|
this.pendingTools.delete(event.toolCallId);
|
|
3066
3034
|
this.ui.requestRender();
|
|
3067
3035
|
}
|
|
@@ -4721,7 +4689,18 @@ export class InteractiveMode {
|
|
|
4721
4689
|
this.footer.invalidate();
|
|
4722
4690
|
this.updateEditorBorderColor();
|
|
4723
4691
|
done();
|
|
4724
|
-
this.
|
|
4692
|
+
const isDefault = this.settingsManager.getDefaultProvider() === model.provider &&
|
|
4693
|
+
this.settingsManager.getDefaultModel() === model.id;
|
|
4694
|
+
const showTip = !persist && !isDefault && !this.modelSaveTipShown;
|
|
4695
|
+
if (showTip)
|
|
4696
|
+
this.modelSaveTipShown = true;
|
|
4697
|
+
this.showStatus(modelSelectionStatus({
|
|
4698
|
+
model,
|
|
4699
|
+
persist,
|
|
4700
|
+
isDefault,
|
|
4701
|
+
showTip,
|
|
4702
|
+
saveKey: keyDisplayText("app.models.save"),
|
|
4703
|
+
}));
|
|
4725
4704
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
|
|
4726
4705
|
}
|
|
4727
4706
|
catch (error) {
|
|
@@ -5272,8 +5251,12 @@ export class InteractiveMode {
|
|
|
5272
5251
|
}
|
|
5273
5252
|
finally {
|
|
5274
5253
|
this.activeFlowAccountsSignal = undefined;
|
|
5275
|
-
if (signal.aborted
|
|
5276
|
-
|
|
5254
|
+
if (signal.aborted) {
|
|
5255
|
+
// Dialogs opened without the signal (for example by a provider login) are closed here.
|
|
5256
|
+
const top = this.extensionDialogs.at(-1);
|
|
5257
|
+
if (top?.component instanceof ExtensionSelectorComponent)
|
|
5258
|
+
top.cancel?.();
|
|
5259
|
+
}
|
|
5277
5260
|
}
|
|
5278
5261
|
}
|
|
5279
5262
|
async showFlowProviderList(signal) {
|
|
@@ -5727,28 +5710,23 @@ export class InteractiveMode {
|
|
|
5727
5710
|
}
|
|
5728
5711
|
}
|
|
5729
5712
|
showLoginAuthTypeSelector(providerOptions) {
|
|
5730
|
-
//
|
|
5731
|
-
const radiusOption = providerOptions
|
|
5732
|
-
? undefined
|
|
5733
|
-
: this.getLoginProviderOptions("oauth").find((provider) => provider.id === RADIUS_PROVIDER_ID);
|
|
5734
|
-
const radiusText = radiusOption ? `Sign in with ${radiusOption.name}` : undefined;
|
|
5735
|
-
const radiusLabel = radiusOption ? `${radiusText}${formatAuthSelectorProviderStatus(radiusOption)}` : undefined;
|
|
5713
|
+
// HUMAIN: the top-level selector offers "Sign in with HUMAIN" first instead of Radius (docs/upstream-decisions.md).
|
|
5736
5714
|
const oauthProvider = providerOptions?.find((provider) => provider.authType === "oauth");
|
|
5737
5715
|
const oauthLoginLabel = oauthProvider?.method && "loginLabel" in oauthProvider.method ? oauthProvider.method.loginLabel : undefined;
|
|
5738
|
-
const subscriptionLabel = oauthLoginLabel ??
|
|
5739
|
-
const apiKeyLabel =
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5716
|
+
const subscriptionLabel = oauthLoginLabel ?? ACCOUNT_LOGIN_LABEL;
|
|
5717
|
+
const apiKeyLabel = API_KEY_LOGIN_LABEL;
|
|
5718
|
+
let options;
|
|
5719
|
+
if (providerOptions) {
|
|
5720
|
+
const availableAuthTypes = new Set(providerOptions.map((provider) => provider.authType));
|
|
5721
|
+
options = [];
|
|
5722
|
+
if (availableAuthTypes.has("oauth"))
|
|
5723
|
+
options.push(subscriptionLabel);
|
|
5724
|
+
if (availableAuthTypes.has("api_key"))
|
|
5725
|
+
options.push(apiKeyLabel);
|
|
5746
5726
|
}
|
|
5747
|
-
|
|
5748
|
-
options
|
|
5727
|
+
else {
|
|
5728
|
+
options = topLevelLoginOptions({ oauth: true, apiKey: true });
|
|
5749
5729
|
}
|
|
5750
|
-
if (radiusLabel)
|
|
5751
|
-
options.push(radiusLabel);
|
|
5752
5730
|
if (options.length === 0) {
|
|
5753
5731
|
this.showStatus("No login methods available.");
|
|
5754
5732
|
return;
|
|
@@ -5766,8 +5744,8 @@ export class InteractiveMode {
|
|
|
5766
5744
|
this.showSelector((done) => {
|
|
5767
5745
|
const onSelect = (option) => {
|
|
5768
5746
|
done();
|
|
5769
|
-
if (
|
|
5770
|
-
|
|
5747
|
+
if (!providerOptions && option === HUMAIN_LOGIN_LABEL) {
|
|
5748
|
+
this.showLoginProviderSelector(undefined, undefined, true);
|
|
5771
5749
|
return;
|
|
5772
5750
|
}
|
|
5773
5751
|
const authType = option === subscriptionLabel ? "oauth" : "api_key";
|
|
@@ -5784,20 +5762,24 @@ export class InteractiveMode {
|
|
|
5784
5762
|
done();
|
|
5785
5763
|
this.ui.requestRender();
|
|
5786
5764
|
};
|
|
5787
|
-
const selector =
|
|
5788
|
-
?
|
|
5789
|
-
:
|
|
5765
|
+
const selector = providerOptions
|
|
5766
|
+
? new ExtensionSelectorComponent(title, options, onSelect, onCancel)
|
|
5767
|
+
: createLoginMenuSelector(this.ui, title, options, { label: HUMAIN_LOGIN_LABEL, text: HUMAIN_LOGIN_LABEL, colors: HUMAIN_SHIMMER_COLORS }, onSelect, onCancel);
|
|
5790
5768
|
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5791
5769
|
});
|
|
5792
5770
|
}
|
|
5793
|
-
showLoginProviderSelector(authType, initialSearchInput) {
|
|
5794
|
-
const providerOptions =
|
|
5771
|
+
showLoginProviderSelector(authType, initialSearchInput, humainOnly = false) {
|
|
5772
|
+
const providerOptions = humainOnly
|
|
5773
|
+
? humainLoginProviders(this.getLoginProviderOptions())
|
|
5774
|
+
: this.getLoginProviderOptions(authType);
|
|
5795
5775
|
if (providerOptions.length === 0) {
|
|
5796
|
-
const message =
|
|
5797
|
-
? "No
|
|
5798
|
-
: authType === "
|
|
5799
|
-
? "No
|
|
5800
|
-
:
|
|
5776
|
+
const message = humainOnly
|
|
5777
|
+
? "No HUMAIN providers available."
|
|
5778
|
+
: authType === "oauth"
|
|
5779
|
+
? "No account providers available."
|
|
5780
|
+
: authType === "api_key"
|
|
5781
|
+
? "No API key providers available."
|
|
5782
|
+
: "No login providers available.";
|
|
5801
5783
|
this.showStatus(message);
|
|
5802
5784
|
return;
|
|
5803
5785
|
}
|
|
@@ -5808,10 +5790,10 @@ export class InteractiveMode {
|
|
|
5808
5790
|
if (!providerOption) {
|
|
5809
5791
|
return;
|
|
5810
5792
|
}
|
|
5811
|
-
await this.startProviderLogin(providerOption, () => this.showLoginProviderSelector(authType, initialSearchInput));
|
|
5793
|
+
await this.startProviderLogin(providerOption, () => this.showLoginProviderSelector(authType, initialSearchInput, humainOnly));
|
|
5812
5794
|
}, () => {
|
|
5813
5795
|
done();
|
|
5814
|
-
if (authType) {
|
|
5796
|
+
if (authType || humainOnly) {
|
|
5815
5797
|
this.showLoginAuthTypeSelector();
|
|
5816
5798
|
}
|
|
5817
5799
|
else {
|
|
@@ -6006,6 +5988,9 @@ export class InteractiveMode {
|
|
|
6006
5988
|
else if (errorMsg === "Login cancelled") {
|
|
6007
5989
|
onBack?.();
|
|
6008
5990
|
}
|
|
5991
|
+
else if (error instanceof SafeCredentialError) {
|
|
5992
|
+
this.showError(`Sign-in failed for ${providerName}: ${errorMsg}`);
|
|
5993
|
+
}
|
|
6009
5994
|
else {
|
|
6010
5995
|
this.showError(`Failed to save API key for ${providerName}: ${errorMsg}`);
|
|
6011
5996
|
}
|
|
@@ -6041,7 +6026,7 @@ export class InteractiveMode {
|
|
|
6041
6026
|
if (prompt.signal?.aborted)
|
|
6042
6027
|
throw new Error("Login cancelled");
|
|
6043
6028
|
if (prompt.type === "manual_code")
|
|
6044
|
-
return dialog.showManualInput(prompt.message, prompt.signal);
|
|
6029
|
+
return dialog.showManualInput(prompt.message, prompt.signal, prompt.secret);
|
|
6045
6030
|
if (prompt.type !== "select") {
|
|
6046
6031
|
return dialog.showPrompt(prompt.message, prompt.placeholder, prompt.type === "secret", prompt.signal);
|
|
6047
6032
|
}
|