@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
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,133 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [0.5.3] - 2026-11-02
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- 0.5.2 was also tagged but not published: the tag pipeline ran the tests as the `node` user with root's unreadable `/root/.cargo/bin` on `PATH`, which turns a missing command's `ENOENT` into `EACCES` and failed tests that expect "not found" (`mcp-command`, Flow `verification-checks`). The tag pipeline now drops that directory from `PATH` for the test run. 0.5.3 ships the 0.5.1 and 0.5.2 changes with this fix.
|
|
8
|
+
|
|
9
|
+
## [0.5.2] - 2026-11-02
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- 0.5.1 was tagged but never published to npm: the tag pipeline's `scripts/check-biome.test.mjs` treated a missing `bun` as installed when `PATH` held an unreadable directory (root-installed Rust run as the `node` user), so the publish job was skipped. The test now skips unless the package manager actually runs. 0.5.2 ships the 0.5.1 changes below with this fix; the owner-authorized CI test evidence and waivers recorded for 0.5.1 apply to it as well.
|
|
14
|
+
|
|
15
|
+
## [0.5.1] - 2026-11-02
|
|
16
|
+
|
|
17
|
+
### New Features
|
|
18
|
+
|
|
19
|
+
- **HUMAIN Gateway:** sign in with your Microsoft account and use the models, budget, and limits of your [HUMAIN Gateway](https://gateway.humain.services) account, with no API key and no separate Gateway CLI. The session key stays in the OS keychain. See [HUMAIN Gateway](docs/providers.md#humain-gateway).
|
|
20
|
+
- **Sign in with HUMAIN:** `/login` now starts with one entry for HUMAIN Gateway and HUMAIN Node. See [Quickstart](docs/quickstart.md#3-choose-a-model).
|
|
21
|
+
- **Clearer default model choice:** `/model` explains that Enter is for this session and Ctrl+S saves the default for new sessions. See [Choose a model](docs/models.md#select-a-model).
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- Added the HUMAIN Gateway provider (`humain-gateway`): Microsoft sign-in through the browser or a masked paste-back code, session keys stored only in the OS keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager), account-scoped discovery of entitled chat models, HUMAIN Code harness-label blocking with reasons, budget and setup-state handling, and inference through the Responses API with Gateway-owned retries that never resend a request that may have been billed. Sign-in errors show their real reason. See [HUMAIN Gateway](docs/providers.md#humain-gateway).
|
|
26
|
+
- Added the `humainGateway.environment` setting (`production` by default, or `staging`), read from global settings only.
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- The owner authorized GitLab CI test evidence for HUMAIN Code CLI 0.5.1 (2026-11-02): the local full suite was not reliable on the release host (different timing-sensitive tests failed on each run under host load, each passing alone), so the release uses the `verify-main` full-suite job of the GitLab pipeline for the exact release commit. The release script accepts `HUMAIN_RELEASE_CI_PIPELINE=<id>` and refuses a pipeline that did not succeed on that commit; all other release checks and the Node/Bun smoke tests still run.
|
|
31
|
+
- The owner waived the blocking pi-web-access upstream release check for HUMAIN Code CLI 0.5.1 (2026-11-02): 0.5.1 ships the vendored pi-web-access 0.44.0 while 0.46.0 is available; the update is left to the upstream refresh. The release script accepts `HUMAIN_RELEASE_ALLOW_STALE_WEB_ACCESS=1` for such an explicit waiver.
|
|
32
|
+
- The owner granted a one-time paid Flow eval release-gate waiver for HUMAIN Code CLI 0.5.1 (2026-11-02). No passing Flow gate is claimed. All other checks, tests, Node/Bun smoke tests and post-publication public-registry install and real-prompt checks remain required.
|
|
33
|
+
- `/login` now starts with **Sign in with HUMAIN**, which lists HUMAIN Gateway and HUMAIN Node. The top-level Radius entry is removed; `/login radius` still works.
|
|
34
|
+
- `/model` now explains at the top that Enter uses a model for this session and Ctrl+S saves it as the default for new sessions, and choosing a model reports which of the two happened, with a one-time save tip.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- OAuth sign-in pages show the HUMAIN Code logo at the CLI icon's proportions with accent-colored bars, instead of a vertically squished mark.
|
|
39
|
+
- The OAuth loopback callback server rejects callbacks that repeat `code` or `state` and compares `state` in constant time.
|
|
40
|
+
|
|
41
|
+
## [0.5.0] - 2026-10-25
|
|
42
|
+
|
|
43
|
+
### New Features
|
|
44
|
+
|
|
45
|
+
- **Subscription and session stats with `/usage`**: inspect tokens, cost, context and duration, plus active Codex or Claude subscription windows and reset times. See [Usage](docs/slash-commands.md#usage).
|
|
46
|
+
- **Smoother streaming and lazy catalogs**: redraw changed transcript entries and Markdown blocks, keep input-dock lines between frames, and build provider catalogs only when needed. See [Rendering](docs/tui.md#keep-rendering-responsive) and [Pi-Bolt selective ports](../../docs/upstream-sync-v1.4.0.md#vendored-upstreams).
|
|
47
|
+
- **Image input for classifiers**: codemode `models.classify()` accepts images for supported Jev, Clef and OpenRouter classifiers. See [Classifier models](docs/models.md#use-classifier-models) and [Codemode models](docs/codemode.md#models).
|
|
48
|
+
- **More reliable compaction and codemode queuing**: summaries use the model's output limit, and parallel scripts wait for a free worker instead of failing immediately. See [Compaction](docs/compaction.md#compaction) and [Codemode limits](docs/codemode.md#limits).
|
|
49
|
+
|
|
50
|
+
### Breaking Changes
|
|
51
|
+
|
|
52
|
+
- Anthropic Messages requests no longer send `temperature`, for any model or Anthropic-compatible endpoint, after the update to `@anthropic-ai/sdk` 1.2.0 and API version 2026-10-21. Caller temperature settings are ignored; `compat.supportsTemperature` is still accepted in `models.json` but has no effect.
|
|
53
|
+
- Provider SDK callers must replace `telemetryContext` with `telemetry?: TelemetrySpan` (a parent span, not an adapter), and replace the removed `@earendil-works/pi-ai/utils/pi-user-agent` / `getPiUserAgent()` with `formatUserAgent()`. `resolveTranscriptTools()` now takes `TranscriptToolSupport` (`"none"`, `"additions"`, or `"changes"`) instead of a boolean; `TranscriptTools.anchorsAdditions` becomes `foldedSystemMessages` ([Pi 1.4.0](../ai/CHANGELOG.md#140---2026-10-21), [#10940](https://github.com/earendil-works/pi/issues/10940)).
|
|
54
|
+
- Extensions' `before_provider_headers` handlers no longer see provider attribution headers, which pi-ai now adds through client identity. Return a header value to override one, or `null` to remove it; HUMAIN attribution and telemetry opt-out remain supported.
|
|
55
|
+
- Experimental Durable storage automatically migrates SQLite databases to schema v2 on open, rebuilding the task table. **Back up databases before first use if rollback may be needed: Pi 1.3.0 or earlier cannot reopen a migrated database.** JSONL needs no migration, but older runtimes cannot resume sleeping tasks. See [Durable migration notes](../durable/CHANGELOG.md#140---2026-10-21).
|
|
56
|
+
- Durable task integrations must replace removed `TaskRuntime.sleep()` with `sleepUntil()` or a committed `sleeping` state, handle that new state, and add `setTimer()` and `ToolExecutionApi.now()` to custom wrappers or fakes. `defineDoc()` and `defineDocFamily()` now require `checkpointWhen`; use `() => false` to retain delta-only changes. Chord `Context` implementations must provide a `telemetry` span. See [Durable API changes](../durable/CHANGELOG.md#140---2026-10-21).
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- Added interactive `/usage` as a replaceable built-in extension. It shows session tokens, cost (a lower bound when usage is incomplete), context and duration. Codex shows every window reported by the active account, resets and credits; Claude shows live 5h, weekly, per-model and extra-usage limits, with Claude Code's cached limits and their age as fallback. API-key sessions do not fetch subscription limits, and no DeepSeek balance or OpenRouter credit requests are added. See [Usage](docs/slash-commands.md#usage).
|
|
61
|
+
- Added `ModelRegistry.getCodexUsage()` and `getAnthropicUsage()` for the active pooled account only, without switching accounts or clearing cooldowns. Claude uses Anthropic's undocumented subscription usage endpoint without redirects, caches successes for 60 seconds and honors `Retry-After`.
|
|
62
|
+
- Added Pi-Bolt's early read-only tool execution through `AgentOptions.earlyToolExecution`, `AgentLoopConfig.earlyToolExecution` and `Agent.earlyToolExecution`. HUMAIN enables it only for registered built-in `read` and `ls`, behind its pre-execution gates; blocking extension handlers disable early starts, and aborted, changed or unused results are discarded.
|
|
63
|
+
- Added Pi 1.4.0 client identity APIs: provider request `identity`, `createModels({ identity })`, `withClientIdentity()`, `formatUserAgent()`, `getIdentityHeaders()`, `getOpenCodeSessionHeaders()`, `mergeClientIdentity()`, `PI_ATTRIBUTION` and `PI_AI_VERSION`, plus `AgentOptions.identity`, `Agent.identity` and `HarnessOptions.identity`. HUMAIN retains `ClientIdentity.product`, `ClientAttribution.clientId`, Cloudflare and Vercel AI Gateway attribution. See [AI identity APIs](../ai/CHANGELOG.md#140---2026-10-21).
|
|
64
|
+
- Added opt-in model-request tracing and duration, token and cost metrics (`AI_TELEMETRY_SCHEMA`), Durable phase/report telemetry and propagation, Chord SQLite drivers and SQLite telemetry storage. Chord contexts support `withTelemetry()` and `traceIn()`; the experimental runtimes pass HUMAIN client identity to Durable.
|
|
65
|
+
- Added Durable IndexedDB storage, durable sleeps and host timers/wake notifications, per-model compaction thresholds, live model/settings getters and a default five-restart crash-loop guard with `Harness.retryTask()`. See [Durable 1.4.0](../durable/CHANGELOG.md#140---2026-10-21).
|
|
66
|
+
- Added TUI change-reporting and live-line rendering APIs for components and containers, including `markReportsChanges()`, `reportRenderChange()`, `renderChildLines()` and `renderLiveLines()`. See [TUI changelog](../tui/CHANGELOG.md).
|
|
67
|
+
- Added a Models Configuration reference generated from the `models.json` schema, listing all provider, model, model override, and compatibility fields ([#10790](https://github.com/earendil-works/pi/issues/10790))
|
|
68
|
+
- Codemode `models.classify()` now accepts `images` for TypeSafe's Jev and Cloudflare's Clef models on `typesafe`, `cloudflare-workers-ai`, and OpenRouter, and lists Clef Omni and Jev 1.14 on Workers AI.
|
|
69
|
+
- Provider-level `compat` in `models.json` now also applies to classifier models, with the System One fields `imageInput` and `sendImageOptInHeader` for proxies that serve another service's classifiers. Extension classifier models accept `compat` too.
|
|
70
|
+
- Added `MiniMax-M3.1-Flash` to the `minimax` and `minimax-cn` providers, with thinking levels low through max ([#11121](https://github.com/earendil-works/pi/issues/11121))
|
|
71
|
+
- Added support for the Rex terminal: OSC 8 hyperlinks, truecolor, and inline images ([#11131](https://github.com/earendil-works/pi/issues/11131), [#11150](https://github.com/earendil-works/pi/pull/11150) by [@petrroll](https://github.com/petrroll), [#11183](https://github.com/earendil-works/pi/pull/11183) by [@nihaals](https://github.com/nihaals))
|
|
4
72
|
|
|
5
73
|
### Changed
|
|
6
74
|
|
|
75
|
+
- Synced the stable Pi baseline from 1.3.0 to 1.4.0 (2026-10-21), selectively ported Pi-Bolt 1.0.0 (2026-10-23), and updated bundled pi-web-access to 0.44.0 and coordination (pi-intercom) to 0.18.1. See the [sync audit](../../docs/upstream-sync-v1.4.0.md) and [owner decisions](../../docs/upstream-decisions.md). Pi-Bolt's runtime/engine changes, request-body Blob reuse, plaintext session index and image validation bypasses remain excluded.
|
|
76
|
+
- Streaming renders only changed transcript entries and Markdown blocks, reuses editor/footer lines, and spaces non-input frames according to the last frame's duration. Input, resize, first and forced frames retain their responsiveness; no benchmark speedup is claimed.
|
|
77
|
+
- Built-in provider catalogs are materialized lazily, with lightweight ID/name listings for model selection. HUMAIN preserves pooled-account/configuration wrappers, extension providers and Bedrock region filtering.
|
|
78
|
+
- Agent and extension event dispatch avoid promise hops for synchronous listeners while preserving subscription order, awaited asynchronous handlers, error propagation and OAuth rotation ordering. Prompt sections and tool declarations reuse per-request work; session appends reuse file handles on non-Windows platforms, and JSON/RPC output batches writes with backpressure.
|
|
79
|
+
- Compaction, split-turn prefix and branch summaries no longer use the fixed `0.8 * reserveTokens`, `0.5 * reserveTokens` and 4096-token output caps. `generateSummary()` and `generateSummaryWithUsage()` ignore `reserveTokens`; `compaction.reserveTokens` only controls when compaction starts. Summaries use the model's output limit, reduced to fit the context window, and may be longer, slower and more expensive.
|
|
80
|
+
- Provider attribution now comes from pi-ai identity while HUMAIN keeps its product, client ID and Vercel/Cloudflare headers. With telemetry off, OpenCode no longer receives `x-opencode-client`; requests outside the session stream use pi-ai's default user agent.
|
|
81
|
+
- Web access 0.44.0 adds explicit-only Linkup search, opt-in DeepSeek Fetch, DeepSeek inline page content, gateway base URLs, configurable xAI endpoint/timeouts, default-provider-array fallback and deferred `toolActivation: "none"`. HUMAIN keeps eager/direct defaults, credential-safe redirects, SSRF checks, and HTTPS-only xAI endpoints except loopback; custom endpoints never receive host xAI sign-in credentials. See [Web refresh](src/humain/web-access/UPSTREAM.md#0440-refresh).
|
|
82
|
+
- Coordination 0.18.1 resolves exact live or offline targets before prefixes, then supports case-insensitive connected-session name prefixes. Ambiguous matches fail rather than guessing; HUMAIN's persistent mailbox and idle shutdown remain unchanged. See [Coordination adaptations](src/coordination/UPSTREAM.md#0181-incremental-adaptations).
|
|
83
|
+
- Changed HUMAIN's default GitHub Copilot model from `gpt-5.6-terra` to `gpt-6.1-sol`.
|
|
84
|
+
- Changed the default NVIDIA model to `nvidia/nemotron-3.5-super-vl-120b-a12b` ([#10910](https://github.com/earendil-works/pi/pull/10910) by [@cv](https://github.com/cv))
|
|
85
|
+
- Changed the default Xiaomi model to `mimo-v2.6-pro` for the `xiaomi` and Xiaomi Token Plan providers, since `mimo-v2.5-pro` left the catalog.
|
|
86
|
+
- Grok 4.3 and Grok 4.5 on the `xai` provider now offer the `xhigh` thinking level.
|
|
87
|
+
- Sign in with ChatGPT: ChatGPT Business workspace usage-limit errors are not retried and tell the user to ask their workspace admin to increase the limit.
|
|
88
|
+
- Requires `@humain/humain-code-contracts` 0.4.19, republished as a new patch for its TypeBox 1.4.3 dependency. Wire contracts and public APIs are unchanged; immutable 0.4.18 artifacts are not replaced.
|
|
89
|
+
- The owner granted a one-time paid Flow eval release-gate waiver for HUMAIN Code CLI 0.5.0 (2026-10-25). No passing Flow gate is claimed. All other checks, tests, Node/Bun smoke tests and post-publication public-registry install and real-prompt checks remain required. This does not change the historical 0.4.18 waiver below.
|
|
7
90
|
- The owner granted a one-time Flow eval release-gate waiver for the 0.4.18 install-integrity repair (2026-10-23). No passing Flow gate is claimed. All other checks, tests, Node/Bun smoke tests and post-publication public-registry install and real-prompt checks remain required.
|
|
8
91
|
|
|
9
92
|
### Fixed
|
|
10
93
|
|
|
94
|
+
- Replaced the Pi logo with the HUMAIN Code mark on browser OAuth success and error pages.
|
|
95
|
+
- Fixed bash execution returning the full-output file path before its stream flushed, so immediate reads no longer see an empty file.
|
|
96
|
+
- Fixed Windows MCP process-tree cleanup and missing-command handling when `SystemRoot` is empty: the fallback stays absolute instead of resolving tools relative to the working directory.
|
|
97
|
+
- Fixed release CI validation of unchanged published contracts versions by comparing uncompressed tarball contents rather than gzip bytes; registry integrity validation still applies.
|
|
98
|
+
- Distribution-lock tests validate the current contracts manifest version and require recorded integrity instead of hardcoding an earlier release.
|
|
99
|
+
- Fixed compaction and branch summaries failing with "generation hit the token cap" when reasoning used most of the fixed summary output limit. Summaries now use the model's output limit, and `compaction.reserveTokens` only controls when compaction starts ([#9512](https://github.com/earendil-works/pi/issues/9512), [#9075](https://github.com/earendil-works/pi/issues/9075)).
|
|
100
|
+
- Fixed `models.schema.json` missing descriptions for provider and model fields, so editors showed no hints for them ([#10790](https://github.com/earendil-works/pi/issues/10790))
|
|
101
|
+
- Fixed `humain-code update` failing with "Managed install marker is missing or invalid" when `managed-install.json` starts with a UTF-8 BOM, which Windows PowerShell 5.1 adds when it rewrites the file.
|
|
102
|
+
- Fixed HTML export showing literal asterisks for Markdown bold and italic next to CJK punctuation ([#3353](https://github.com/earendil-works/pi/issues/3353), [#10154](https://github.com/earendil-works/pi/issues/10154))
|
|
103
|
+
- Fixed the terminal staying in mouse-tracking, focus-reporting, Kitty keyboard, and alternate-screen modes when HUMAIN Code CLI exits without its normal terminal teardown, which flooded the shell prompt with escape sequences ([#11170](https://github.com/earendil-works/pi/issues/11170))
|
|
104
|
+
- Fixed concurrent extension `select`/`confirm`/`input`/`editor` dialogs and inline `custom()` components in interactive mode: a second dialog replaced the first and the first promise never settled; closing the visible dialog now shows the previous one again ([#11166](https://github.com/earendil-works/pi/issues/11166), [#9909](https://github.com/earendil-works/pi/issues/9909))
|
|
105
|
+
- Fixed pasting in the shell hanging after copying text in HUMAIN Code CLI and suspending it with Ctrl+Z on Linux: the background `wl-copy`/`xclip`/`xsel` process that keeps serving the clipboard was suspended along with HUMAIN Code CLI ([#11179](https://github.com/earendil-works/pi/issues/11179))
|
|
106
|
+
- Fixed codemode scripts failing immediately when both codemode workers are busy, for example with parallel codemode calls or in-process subagents. Scripts now wait up to 60 seconds for a free worker, and `HUMAIN_TERMINAL_CODEMODE_MAX_WORKERS` raises the limit of two workers ([#11184](https://github.com/earendil-works/pi/issues/11184))
|
|
107
|
+
- Fixed extensions failing to load when importing `@earendil-works/pi-ai/models` (e.g. for `clampThinkingLevel`) by exposing the subpath through the extension loader aliases and virtual modules ([#11156](https://github.com/earendil-works/pi/issues/11156))
|
|
108
|
+
- Fixed `mcp.json` files that start with a UTF-8 BOM failing to parse, which skipped all their MCP servers and made `humain-code mcp add`/`humain-code mcp remove` fail ([#11191](https://github.com/earendil-works/pi/issues/11191))
|
|
109
|
+
- Fixed `/compact <instructions>` ignoring the instructions when summarizing the start of a turn that compaction splits. When the split turn was the only new content since the last compaction, the instructions were ignored entirely ([#11058](https://github.com/earendil-works/pi/issues/11058))
|
|
110
|
+
- Fixed resumed sessions and `/tree` navigation leaving extension tools inactive when the branch recorded its tools before they were registered, such as tools from extensions installed after the session started. Extension tools the branch never added or removed are now active unless they are registered with `defaultActive: false` ([#11062](https://github.com/earendil-works/pi/issues/11062), [#11075](https://github.com/earendil-works/pi/issues/11075))
|
|
111
|
+
- Fixed sessions breaking after recovery from a response cut off at the output limit: the truncated tool call was omitted but its tool results were kept, so providers rejected every later request ([#11227](https://github.com/earendil-works/pi/issues/11227), [#11233](https://github.com/earendil-works/pi/pull/11233) by [@petrroll](https://github.com/petrroll))
|
|
112
|
+
- Fixed the `grep` tool following `RIPGREP_CONFIG_PATH`, where options such as `--fixed-strings` silently changed regex searches into literal ones. The tool now runs `rg --no-config` ([#11203](https://github.com/earendil-works/pi/issues/11203), [#11230](https://github.com/earendil-works/pi/pull/11230) by [@petrroll](https://github.com/petrroll))
|
|
113
|
+
- Fixed Windows shell detection rejecting runnable Microsoft Store shell aliases ([#9504](https://github.com/earendil-works/pi/pull/9504) by [@petrroll](https://github.com/petrroll))
|
|
114
|
+
- Fixed Windows shell detection missing PowerShell outside `PATH` and the legacy WSL `bash.exe` launcher when Windows is not installed in `C:\Windows`. HUMAIN Code CLI now checks `%ProgramFiles%\PowerShell\7`, `%SystemRoot%\System32\WindowsPowerShell\v1.0`, and `%SystemRoot%` ([#9501](https://github.com/earendil-works/pi/pull/9501) by [@petrroll](https://github.com/petrroll))
|
|
115
|
+
- Fixed GitHub Copilot sessions with large request bodies, such as many images, failing with HTTP 413 `failed to parse request` instead of compacting and retrying ([#11016](https://github.com/earendil-works/pi/pull/11016) by [@petrroll](https://github.com/petrroll))
|
|
116
|
+
- Fixed the `openai-codex` provider offering `gpt-5.5` and `gpt-5.3-codex-spark`, which always fail for ChatGPT accounts ([#11173](https://github.com/earendil-works/pi/pull/11173) by [@lucasmeijer](https://github.com/lucasmeijer))
|
|
117
|
+
- Fixed whitespace-only tool output (for example a bare `\r\n` from bash) making OpenAI Completions, OpenAI Responses, and Google requests fail with a 400 ([#8720](https://github.com/earendil-works/pi/issues/8720))
|
|
118
|
+
- Fixed automatic retry not triggering for more gateway upstream failures, `stream disconnected before completion` errors relayed by Codex CLI proxies, and transient Google Vertex OAuth token refresh failures, and retrying errors because of digits inside request ids or byte counts ([#10920](https://github.com/earendil-works/pi/issues/10920), [#11057](https://github.com/earendil-works/pi/issues/11057), [#10996](https://github.com/earendil-works/pi/issues/10996))
|
|
119
|
+
- Fixed OpenAI Responses models losing the prompt cache on every deferred tool load after a tool was removed ([#10940](https://github.com/earendil-works/pi/issues/10940))
|
|
120
|
+
- Fixed Cloudflare Workers AI classifier pricing: Clef Flash costs $0.038 and Jev $0.042 per million input tokens instead of Jev being listed as free.
|
|
121
|
+
- Fixed an unclosed `$$` display-math block swallowing or corrupting every Markdown table after it ([#11159](https://github.com/earendil-works/pi/issues/11159))
|
|
122
|
+
- Fixed Markdown bold and italic not rendering next to CJK punctuation ([#10730](https://github.com/earendil-works/pi/pull/10730) by [@theBucky](https://github.com/theBucky))
|
|
123
|
+
- Fixed `@` file autocomplete returning no results for queries containing regex metacharacters such as `[` or `(` ([#10972](https://github.com/earendil-works/pi/issues/10972))
|
|
124
|
+
|
|
11
125
|
- Corrected the contracts integrity in CLI and contracts 0.4.18 distribution locks. Local publication validates both exact tarballs against the CLI shrinkwrap and standalone installer lock before publishing either, without repacking. The distribution-entrypoint test follows the contracts manifest version instead of retaining a stale release number ([#65](https://gitlab.humain.com/humain/data-and-ai-modeling/standard/agentic/humain-terminal/-/issues/65)).
|
|
12
126
|
|
|
127
|
+
### Removed
|
|
128
|
+
|
|
129
|
+
- Accepted upstream retirement of Codex `gpt-5.5` and `gpt-5.3-codex-spark` ([#11173](https://github.com/earendil-works/pi/pull/11173) by [@lucasmeijer](https://github.com/lucasmeijer)); Copilot `claude-opus-4.6`, `claude-opus-4.7`, `gpt-5.4` and `gpt-5.5`; Baseten `moonshotai/Kimi-K2.6`; and Together `deepseek-ai/DeepSeek-R1` and `MiniMaxAI/MiniMax-M2.7`. Direct MiniMax hides M2, M2.1, M2.5 and M2.5-highspeed. Saved settings and scripts naming removed models must select a supported replacement; see [retired-model decisions](../../docs/upstream-decisions.md#retired-models-accepted).
|
|
130
|
+
|
|
13
131
|
## 0.4.17 publication addendum - 2026-10-23
|
|
14
132
|
|
|
15
133
|
### Changed
|
|
@@ -451,6 +569,171 @@ Version 0.4.16 was never published to npm and is superseded by 0.4.17. This rele
|
|
|
451
569
|
- Removed the vendored `pi-mcp-adapter` bundle, its upstream check and bundle scripts (see Breaking Changes).
|
|
452
570
|
- Removed the `@humain/terminal` extension import alias (see Breaking Changes).
|
|
453
571
|
|
|
572
|
+
## [1.4.0] - 2026-10-21
|
|
573
|
+
|
|
574
|
+
### New Features
|
|
575
|
+
|
|
576
|
+
- **Image input for classifiers**: codemode `models.classify()` accepts `images` for TypeSafe's Jev and Cloudflare's Clef models on `typesafe`, `cloudflare-workers-ai`, and OpenRouter. See [Use classifier models](docs/models.md#use-classifier-models) and [Codemode](docs/codemode.md#models).
|
|
577
|
+
- **Models Configuration reference**: every provider, model, model override, and compatibility field of `models.json`, generated from its schema. See [Models Configuration](docs/models-configuration.md).
|
|
578
|
+
- **Summaries without a fixed output cap**: compaction and branch summaries use the model's output limit, so long reasoning no longer makes them fail. See [Compaction](docs/compaction.md#compaction).
|
|
579
|
+
- **Codemode waits for a free worker**: parallel scripts and in-process subagents queue instead of failing, and `PI_CODEMODE_MAX_WORKERS` raises the limit. See [Codemode limits](docs/codemode.md#limits).
|
|
580
|
+
- **Rex terminal support**: OSC 8 hyperlinks, truecolor, and inline images.
|
|
581
|
+
|
|
582
|
+
### Added
|
|
583
|
+
|
|
584
|
+
- Added a Models Configuration reference generated from the `models.json` schema, listing all provider, model, model override, and compatibility fields ([#10790](https://github.com/earendil-works/pi/issues/10790))
|
|
585
|
+
- Codemode `models.classify()` now accepts `images` for TypeSafe's Jev and Cloudflare's Clef models on `typesafe`, `cloudflare-workers-ai`, and OpenRouter, and lists Clef Omni and Jev 1.14 on Workers AI.
|
|
586
|
+
- Provider-level `compat` in `models.json` now also applies to classifier models, with the System One fields `imageInput` and `sendImageOptInHeader` for proxies that serve another service's classifiers. Extension classifier models accept `compat` too.
|
|
587
|
+
- Added `MiniMax-M3.1-Flash` to the `minimax` and `minimax-cn` providers, with thinking levels low through max ([#11121](https://github.com/earendil-works/pi/issues/11121))
|
|
588
|
+
- Added support for the Rex terminal: OSC 8 hyperlinks, truecolor, and inline images ([#11131](https://github.com/earendil-works/pi/issues/11131), [#11150](https://github.com/earendil-works/pi/pull/11150) by [@petrroll](https://github.com/petrroll), [#11183](https://github.com/earendil-works/pi/pull/11183) by [@nihaals](https://github.com/nihaals))
|
|
589
|
+
|
|
590
|
+
### Changed
|
|
591
|
+
|
|
592
|
+
- Provider attribution headers now come from pi-ai's client identity. Extensions' `before_provider_headers` handlers no longer see the OpenRouter, NVIDIA NIM, and OpenCode attribution headers; returning `null` for one still removes it. Cloudflare requests send pi's detailed `User-Agent` instead of `pi-coding-agent`, as do GitHub release checks for tool downloads, and OpenCode requests send `x-opencode-client` whenever attribution is enabled, not only with a session.
|
|
593
|
+
- `generateSummary()` and `generateSummaryWithUsage()` now ignore their `reserveTokens` parameter. Summary requests use the model's output limit instead.
|
|
594
|
+
- Changed the default GitHub Copilot model from `gpt-5.4`, which Copilot retired, to `gpt-6.1-sol`.
|
|
595
|
+
- Changed the default NVIDIA model to `nvidia/nemotron-3.5-super-vl-120b-a12b` ([#10910](https://github.com/earendil-works/pi/pull/10910) by [@cv](https://github.com/cv))
|
|
596
|
+
- Changed the default Xiaomi model to `mimo-v2.6-pro` for the `xiaomi` and Xiaomi Token Plan providers, since `mimo-v2.5-pro` left the catalog.
|
|
597
|
+
- Grok 4.3 and Grok 4.5 on the `xai` provider now offer the `xhigh` thinking level.
|
|
598
|
+
- Sign in with ChatGPT: ChatGPT Business workspace usage-limit errors are not retried and tell the user to ask their workspace admin to increase the limit.
|
|
599
|
+
|
|
600
|
+
### Fixed
|
|
601
|
+
|
|
602
|
+
- Fixed compaction and branch summaries failing with "generation hit the token cap" when reasoning used most of the fixed summary output limit. Summaries now use the model's output limit, and `compaction.reserveTokens` only controls when compaction starts ([#9512](https://github.com/earendil-works/pi/issues/9512), [#9075](https://github.com/earendil-works/pi/issues/9075)).
|
|
603
|
+
- Fixed `models.schema.json` missing descriptions for provider and model fields, so editors showed no hints for them ([#10790](https://github.com/earendil-works/pi/issues/10790))
|
|
604
|
+
- Fixed `pi update` failing with "Managed install marker is missing or invalid" when `managed-install.json` starts with a UTF-8 BOM, which Windows PowerShell 5.1 adds when it rewrites the file.
|
|
605
|
+
- Fixed HTML export showing literal asterisks for Markdown bold and italic next to CJK punctuation ([#3353](https://github.com/earendil-works/pi/issues/3353), [#10154](https://github.com/earendil-works/pi/issues/10154))
|
|
606
|
+
- Fixed the terminal staying in mouse-tracking, focus-reporting, Kitty keyboard, and alternate-screen modes when pi exits without its normal terminal teardown, which flooded the shell prompt with escape sequences ([#11170](https://github.com/earendil-works/pi/issues/11170))
|
|
607
|
+
- Fixed concurrent extension `select`/`confirm`/`input`/`editor` dialogs and inline `custom()` components in interactive mode: a second dialog replaced the first and the first promise never settled; closing the visible dialog now shows the previous one again ([#11166](https://github.com/earendil-works/pi/issues/11166), [#9909](https://github.com/earendil-works/pi/issues/9909))
|
|
608
|
+
- Fixed pasting in the shell hanging after copying text in pi and suspending it with Ctrl+Z on Linux: the background `wl-copy`/`xclip`/`xsel` process that keeps serving the clipboard was suspended along with pi ([#11179](https://github.com/earendil-works/pi/issues/11179))
|
|
609
|
+
- Fixed codemode scripts failing immediately when both codemode workers are busy, for example with parallel codemode calls or in-process subagents. Scripts now wait up to 60 seconds for a free worker, and `PI_CODEMODE_MAX_WORKERS` raises the limit of two workers ([#11184](https://github.com/earendil-works/pi/issues/11184))
|
|
610
|
+
- Fixed extensions failing to load when importing `@earendil-works/pi-ai/models` (e.g. for `clampThinkingLevel`) by exposing the subpath through the extension loader aliases and virtual modules ([#11156](https://github.com/earendil-works/pi/issues/11156))
|
|
611
|
+
- Fixed `mcp.json` files that start with a UTF-8 BOM failing to parse, which skipped all their MCP servers and made `pi mcp add`/`pi mcp remove` fail ([#11191](https://github.com/earendil-works/pi/issues/11191))
|
|
612
|
+
- Fixed `/compact <instructions>` ignoring the instructions when summarizing the start of a turn that compaction splits. When the split turn was the only new content since the last compaction, the instructions were ignored entirely ([#11058](https://github.com/earendil-works/pi/issues/11058))
|
|
613
|
+
- Fixed resumed sessions and `/tree` navigation leaving extension tools inactive when the branch recorded its tools before they were registered, such as tools from extensions installed after the session started. Extension tools the branch never added or removed are now active unless they are registered with `defaultActive: false` ([#11062](https://github.com/earendil-works/pi/issues/11062), [#11075](https://github.com/earendil-works/pi/issues/11075))
|
|
614
|
+
- Fixed sessions breaking after recovery from a response cut off at the output limit: the truncated tool call was omitted but its tool results were kept, so providers rejected every later request ([#11227](https://github.com/earendil-works/pi/issues/11227), [#11233](https://github.com/earendil-works/pi/pull/11233) by [@petrroll](https://github.com/petrroll))
|
|
615
|
+
- Fixed the `grep` tool following `RIPGREP_CONFIG_PATH`, where options such as `--fixed-strings` silently changed regex searches into literal ones. The tool now runs `rg --no-config` ([#11203](https://github.com/earendil-works/pi/issues/11203), [#11230](https://github.com/earendil-works/pi/pull/11230) by [@petrroll](https://github.com/petrroll))
|
|
616
|
+
- Fixed Windows shell detection rejecting runnable Microsoft Store shell aliases ([#9504](https://github.com/earendil-works/pi/pull/9504) by [@petrroll](https://github.com/petrroll))
|
|
617
|
+
- Fixed Windows shell detection missing PowerShell outside `PATH` and the legacy WSL `bash.exe` launcher when Windows is not installed in `C:\Windows`. pi now checks `%ProgramFiles%\PowerShell\7`, `%SystemRoot%\System32\WindowsPowerShell\v1.0`, and `%SystemRoot%` ([#9501](https://github.com/earendil-works/pi/pull/9501) by [@petrroll](https://github.com/petrroll))
|
|
618
|
+
- Fixed GitHub Copilot sessions with large request bodies, such as many images, failing with HTTP 413 `failed to parse request` instead of compacting and retrying ([#11016](https://github.com/earendil-works/pi/pull/11016) by [@petrroll](https://github.com/petrroll))
|
|
619
|
+
- Fixed the `openai-codex` provider offering `gpt-5.5` and `gpt-5.3-codex-spark`, which always fail for ChatGPT accounts ([#11173](https://github.com/earendil-works/pi/pull/11173) by [@lucasmeijer](https://github.com/lucasmeijer))
|
|
620
|
+
- Fixed whitespace-only tool output (for example a bare `\r\n` from bash) making OpenAI Completions, OpenAI Responses, and Google requests fail with a 400 ([#8720](https://github.com/earendil-works/pi/issues/8720))
|
|
621
|
+
- Fixed automatic retry not triggering for more gateway upstream failures, `stream disconnected before completion` errors relayed by Codex CLI proxies, and transient Google Vertex OAuth token refresh failures, and retrying errors because of digits inside request ids or byte counts ([#10920](https://github.com/earendil-works/pi/issues/10920), [#11057](https://github.com/earendil-works/pi/issues/11057), [#10996](https://github.com/earendil-works/pi/issues/10996))
|
|
622
|
+
- Fixed OpenAI Responses models losing the prompt cache on every deferred tool load after a tool was removed ([#10940](https://github.com/earendil-works/pi/issues/10940))
|
|
623
|
+
- Fixed Cloudflare Workers AI classifier pricing: Clef Flash costs $0.038 and Jev $0.042 per million input tokens instead of Jev being listed as free.
|
|
624
|
+
- Fixed an unclosed `$$` display-math block swallowing or corrupting every Markdown table after it ([#11159](https://github.com/earendil-works/pi/issues/11159))
|
|
625
|
+
- Fixed Markdown bold and italic not rendering next to CJK punctuation ([#10730](https://github.com/earendil-works/pi/pull/10730) by [@theBucky](https://github.com/theBucky))
|
|
626
|
+
- Fixed `@` file autocomplete returning no results for queries containing regex metacharacters such as `[` or `(` ([#10972](https://github.com/earendil-works/pi/issues/10972))
|
|
627
|
+
|
|
628
|
+
## [1.3.0] - 2026-10-15
|
|
629
|
+
|
|
630
|
+
### New Features
|
|
631
|
+
|
|
632
|
+
- **Choose where `/share` uploads**: `sessionShareDestination` selects `auto`, `gist`, or `radius`. See [Sessions and context](docs/settings.md#sessions-and-context) and [Export or share a session](docs/sessions.md#export-or-share-a-session).
|
|
633
|
+
- **Cache-preserving thinking level changes on OpenAI GPT-6**: changing the thinking level mid-session with an API key keeps the prompt cache.
|
|
634
|
+
- **Kimi Code over Chat Completions**: tools added mid-conversation no longer invalidate the prompt cache. `models.json` base URL overrides must now include `/v1`. See [Providers](docs/providers.md).
|
|
635
|
+
- **Clean model switching**: thinking from a previous model is dropped instead of being shown to the new model as text.
|
|
636
|
+
- **Resumed sessions keep their active tools**: `--tools +name`/`-name` applies on top of them. See [Tools](docs/settings.md#tools).
|
|
637
|
+
|
|
638
|
+
### Added
|
|
639
|
+
|
|
640
|
+
- Changing the thinking level mid-session on OpenAI GPT-6 models (API key) now keeps the prompt cache ([#10853](https://github.com/earendil-works/pi/issues/10853))
|
|
641
|
+
- Added the `sessionShareDestination` setting to choose automatic, GitHub gist, or Radius uploads for `/share` ([#10870](https://github.com/earendil-works/pi/issues/10870) by [@vegarsti](https://github.com/vegarsti))
|
|
642
|
+
|
|
643
|
+
### Changed
|
|
644
|
+
|
|
645
|
+
- Changed the `kimi-coding` provider to use OpenAI Chat Completions at `https://api.kimi.com/coding/v1`, the protocol used by the official Kimi Code client. K3, K3-256K, and Kimi For Coding now accept tools added mid-conversation without invalidating the prompt cache. `models.json` overrides of the `kimi-coding` base URL must now include `/v1` ([#10720](https://github.com/earendil-works/pi/issues/10720))
|
|
646
|
+
- Changed model switching to drop thinking blocks from earlier assistant messages produced by a different model, instead of sending them as plain text. The new model previously saw the old model's reasoning as part of its replies and could start writing its own reasoning into the visible answer ([#10995](https://github.com/earendil-works/pi/issues/10995))
|
|
647
|
+
|
|
648
|
+
### Fixed
|
|
649
|
+
|
|
650
|
+
- Pinned internal Pi dependencies to exact release versions to prevent fresh installs from mixing incompatible packages ([#10865](https://github.com/earendil-works/pi/issues/10865))
|
|
651
|
+
- Fixed resumed sessions dropping tools activated during the session. Resume now restores the session's active tools, with `--tools +name`/`-name` entries applied to them, unless `--tools` with tool names, `--no-tools`, or `--no-builtin-tools` selects tools explicitly ([#10785](https://github.com/earendil-works/pi/issues/10785))
|
|
652
|
+
- Fixed stopping a codemode script or reaching its deadline waiting for a non-interruptible built-in to return on Bun ([#10748](https://github.com/earendil-works/pi/issues/10748))
|
|
653
|
+
- Fixed repeated codemode timeouts or aborts accumulating surviving workers; admission now limits live workers to two across sessions, counting cancelled workers until actual exit ([#10748](https://github.com/earendil-works/pi/issues/10748))
|
|
654
|
+
- Fixed `--model` choosing a provider by catalog order when several providers offer the match; Pi now prefers the provider with credentials and otherwise reports the ambiguity. `--models` and `enabledModels` add a model for each provider that offers it and warn about the ambiguity ([#10160](https://github.com/earendil-works/pi/issues/10160))
|
|
655
|
+
- Fixed `read` line-range labels for numeric-string or null arguments in the TUI, session tree, HTML exports, and examples ([#9887](https://github.com/earendil-works/pi/issues/9887))
|
|
656
|
+
- Fixed the Nix flake build failing when a provider switched APIs: the model catalog pin is now refreshed from the newest published catalog when its model API groups differ, and releases pin the newest catalog and build with it before tagging ([#10985](https://github.com/earendil-works/pi/issues/10985))
|
|
657
|
+
- Fixed the Nix package putting its Node.js first on `PATH`, which made bash tool shells use Pi's Node instead of the user's `node`/`npm`. Pi's Node is now only a fallback ([#10519](https://github.com/earendil-works/pi/issues/10519))
|
|
658
|
+
- Fixed prompt templates dropping empty quoted arguments (`""` or `''`), which shifted later positional arguments and prevented positional defaults from applying ([#10867](https://github.com/earendil-works/pi/issues/10867))
|
|
659
|
+
- Fixed the Nix package build failing in its install check because it still expected chord and esbuild, which Pi no longer depends on
|
|
660
|
+
- Fixed tool-call argument parsing dropping fields when a string contains an invalid `\u` escape such as `\usepackage` ([#10868](https://github.com/earendil-works/pi/issues/10868))
|
|
661
|
+
- Fixed Anthropic and Bedrock Claude requests failing with a 400 when an error tool result contains images; the images are now sent after the tool results of the turn, so the model still sees them ([#10794](https://github.com/earendil-works/pi/issues/10794))
|
|
662
|
+
- Fixed OpenCode Go Gemini models failing with a 404 by moving OpenCode Zen and OpenCode Go to the `opencode.ai/inference` endpoints, and added Google Generative AI support to the OpenCode Go provider
|
|
663
|
+
- Fixed OpenCode Go MiniMax M2.7 failing with "Model does not support this protocol" by using the Anthropic Messages API
|
|
664
|
+
- Fixed automatic retry not triggering for gateway `Unable to forward upstream stream` errors ([#10920](https://github.com/earendil-works/pi/issues/10920))
|
|
665
|
+
- Fixed automatic retry not triggering for `The service is temporarily unavailable` errors, which also made compaction fail on the first attempt ([#10965](https://github.com/earendil-works/pi/issues/10965))
|
|
666
|
+
- Fixed OpenAI-compatible responses showing thinking after the answer when a proxy such as LiteLLM sends reasoning and content in the same stream chunk ([#10926](https://github.com/earendil-works/pi/issues/10926))
|
|
667
|
+
- Fixed Gemini 4 Argon requests on Google Vertex failing with "Thinking budget is not supported", and its thinking level being ignored on the Gemini API ([#10890](https://github.com/earendil-works/pi/issues/10890))
|
|
668
|
+
- Fixed Xiaomi MiMo models failing with a 400 at the `minimal` thinking level; they now expose only the `off` and `high` levels ([#10818](https://github.com/earendil-works/pi/issues/10818))
|
|
669
|
+
- Fixed `openai-codex/gpt-6.1-sol` using a 272K context window instead of the 500K window Codex now provides ([#10840](https://github.com/earendil-works/pi/issues/10840))
|
|
670
|
+
- Fixed tool calls whose final arguments are malformed JSON silently running with only the fields parsed before the error; they now fail validation and show the model the raw arguments it sent ([#10897](https://github.com/earendil-works/pi/issues/10897))
|
|
671
|
+
- Fixed Claude Haiku 5.5 and Claude Opus 5 not supporting the `off` thinking level ([#10753](https://github.com/earendil-works/pi/issues/10753))
|
|
672
|
+
- Fixed `done()` of an extension's `ctx.ui.custom({ overlay: true })` closing the topmost overlay instead of its own, which left the finished overlay on screen and another extension's dialog unresolved ([#10648](https://github.com/earendil-works/pi/issues/10648), [#10999](https://github.com/earendil-works/pi/pull/10999) by [@masonc15](https://github.com/masonc15))
|
|
673
|
+
|
|
674
|
+
## [1.2.0] - 2026-10-12
|
|
675
|
+
|
|
676
|
+
### New Features
|
|
677
|
+
|
|
678
|
+
- **Per-key OpenRouter model lists**: with an OpenRouter key, Pi lists only the models that key may use, with the key's context size, max output, and prices, including regional endpoints set in `models.json`. See [OpenRouter](docs/providers.md#openrouter).
|
|
679
|
+
- **Published configuration schemas**: add `$schema` to `settings.json`, `models.json`, keybindings, and themes for editor validation and completion. See [Settings](docs/settings.md), [Models](docs/models.md), [Keybindings](docs/keybindings.md), and [Themes](docs/themes.md).
|
|
680
|
+
- **Clipboard copies over remote sessions**: `PI_CLIPBOARD_OSC52=1` sends copied text to a remote client's clipboard when Pi cannot detect the remote session, such as a multiplexer attached from another machine. See [Pi Process Configuration](docs/environment-variables.md#pi-process-configuration).
|
|
681
|
+
- **Codemode improvements**: tool declarations show input constraints such as integer, minimum/maximum, and default, and codemode rows show elapsed and total time. See [Codemode](docs/codemode.md).
|
|
682
|
+
- **`before_agent_start` for extension-triggered runs**: runs started by `pi.sendMessage(..., { triggerTurn: true })` go through the same setup as prompts. See [Events and concurrency](docs/extensions.md#events-and-concurrency).
|
|
683
|
+
|
|
684
|
+
### Breaking Changes
|
|
685
|
+
|
|
686
|
+
- Published generated configuration schemas for models, settings, keybindings, and themes at `https://pi.dev/schemas/*.schema.json`. The theme schema moved to `https://pi.dev/schemas/theme.schema.json`; themes loaded during startup now receive the same schema validation as later reloads. Update theme `$schema` references, define reusable colors under `vars`, and remove unsupported metadata ([#9880](https://github.com/earendil-works/pi/pull/9880), [#10751](https://github.com/earendil-works/pi/pull/10751) by [@christianklotz](https://github.com/christianklotz))
|
|
687
|
+
- Changed `before_agent_start` to also fire for runs started by `pi.sendMessage(..., { triggerTurn: true })` while idle. `BeforeAgentStartEvent` is now a union on `messageType`: `"user"` events carry `prompt` and `images`, and `"custom"` events carry the starting `message` and no `prompt`. Messages returned by handlers are added to both kinds of run, and pending `deliverAs: "nextTurn"` messages are delivered with the custom-message run. Handlers that should act only on user prompts must check `event.messageType === "user"` ([#10267](https://github.com/earendil-works/pi/issues/10267), [#5581](https://github.com/earendil-works/pi/issues/5581), [#10739](https://github.com/earendil-works/pi/pull/10739) by [@davidbrai](https://github.com/davidbrai))
|
|
688
|
+
- Changed the session to count as busy while a run starts, including during `before_agent_start` handlers: `ctx.isIdle()` is false, `pi.sendMessage()` queues into the starting run instead of starting a second run that failed with "Agent is already processing", `pi.sendUserMessage()` requires `deliverAs`, and an abort requested meanwhile aborts the run once it starts ([#10739](https://github.com/earendil-works/pi/pull/10739) by [@davidbrai](https://github.com/davidbrai))
|
|
689
|
+
- Changed `pi mcp list --json` to report `resources: true` for servers that offer resources instead of `resources` and `resourceTemplates` counts; Pi no longer lists resources when connecting ([#10526](https://github.com/earendil-works/pi/issues/10526))
|
|
690
|
+
|
|
691
|
+
### Added
|
|
692
|
+
|
|
693
|
+
- Added `reachesTools` to tool definitions, so tools that reach other tools (such as `codemode` and `tool_search`) declare which tools a call may reach; the MCP extension uses it to wait for the servers a call needs and to decide whether a replacement `codemode` or `tool_search` tool can reach MCP tools
|
|
694
|
+
- Added `aliases` to tool namespaces; codemode's `describeNamespace()` and the `namespace` option of `searchTools()` match them, and MCP namespaces use the server name
|
|
695
|
+
- Added per-key OpenRouter model lists: with an OpenRouter key, Pi lists only the chat models that key may use, with the key's context size, max output, and prices, including guardrails and regional endpoints set as the base URL in `models.json`. The list is saved and used offline ([#10353](https://github.com/earendil-works/pi/issues/10353), [#10672](https://github.com/earendil-works/pi/pull/10672) by [@davidbrai](https://github.com/davidbrai))
|
|
696
|
+
- Added `PI_CLIPBOARD_OSC52=1` to send copied text to the terminal with OSC 52 after the local clipboard write, so copies reach a remote client's clipboard when Pi cannot detect the remote session, such as multiplexer attaches from another machine or remote IDE daemons ([#10826](https://github.com/earendil-works/pi/issues/10826), [#10835](https://github.com/earendil-works/pi/issues/10835), [#10114](https://github.com/earendil-works/pi/issues/10114))
|
|
697
|
+
- Added elapsed time while a codemode script runs and its total time once finished to the codemode tool row, like bash rows ([#10708](https://github.com/earendil-works/pi/issues/10708))
|
|
698
|
+
|
|
699
|
+
### Changed
|
|
700
|
+
|
|
701
|
+
- Changed the `showHardwareCursor` setting to use only the terminal cursor instead of also drawing Pi's reverse-video cursor
|
|
702
|
+
- Changed codemode tool declarations to show input constraints such as integer, minimum/maximum, length, pattern, and default as `@` tags on property comments, so scripts see them without the tool repeating them in descriptions ([#10707](https://github.com/earendil-works/pi/issues/10707))
|
|
703
|
+
- Changed codemode declarations of MCP tools to spell out the result type (`content`, `structuredContent`, `isError`) instead of referring to `CallToolResult<T>`, which `describeTool()`, `searchTools()`, and `ALL_TOOLS` showed without defining it; the codemode description no longer includes the shared MCP types
|
|
704
|
+
- Changed `serializeConversation()` (compaction, branch summaries, bug reports) to omit thinking blocks; replayed thinking is often not in the live context, so including it could make a summarization request larger than the context it summarizes and fail
|
|
705
|
+
|
|
706
|
+
### Fixed
|
|
707
|
+
|
|
708
|
+
- Fixed codemode ignoring a `// @options:` line that is not the first line of the script, which ran the script without the requested `timeout_ms`; the call now fails with an error before the script runs ([#10631](https://github.com/earendil-works/pi/issues/10631))
|
|
709
|
+
- Fixed Mistral streams being aborted mid-generation (e.g. during long thinking) after the request timeout; the timeout now applies only to waiting for response headers ([#10609](https://github.com/earendil-works/pi/issues/10609))
|
|
710
|
+
- Fixed a symlinked `AGENTS.md` in a git worktree nested inside its main repo causing no project context file to load ([#10681](https://github.com/earendil-works/pi/issues/10681))
|
|
711
|
+
- Fixed the code mode tool description claiming every failed tool call rejects; a tool that declares an output schema resolves with its value on failure too (e.g. `bash` with a nonzero exit)
|
|
712
|
+
- Fixed runs started by `pi.sendMessage(..., { triggerTurn: true })` removing system prompt sections added in `before_agent_start` after their first tool call, which changed the prompt mid-run and broke the provider prompt cache twice per run ([#10267](https://github.com/earendil-works/pi/issues/10267), [#10739](https://github.com/earendil-works/pi/pull/10739) by [@davidbrai](https://github.com/davidbrai))
|
|
713
|
+
- Fixed codemode blocking the process for seconds to minutes after scripts with many `text()` calls; joining the output items was quadratic ([#10678](https://github.com/earendil-works/pi/issues/10678))
|
|
714
|
+
- Fixed print mode (`-p`) exiting 0 without a warning when the final response was cut off at the model's output token limit; it now prints the partial text, writes a warning to stderr, and exits 1 ([#10799](https://github.com/earendil-works/pi/issues/10799))
|
|
715
|
+
- Fixed `pi mcp login --help` and the CLI docs describing `--timeout` as only the wait for the browser; it limits the whole sign-in ([#10636](https://github.com/earendil-works/pi/issues/10636))
|
|
716
|
+
- Fixed `~` not being expanded in `!pattern`, `+path`, and `-path` entries of the `extensions`, `skills`, `prompts`, and `themes` settings, so entries like `!~/skills/pdf` matched nothing ([#10765](https://github.com/earendil-works/pi/issues/10765))
|
|
717
|
+
- Fixed MCP servers with resources registering no tools until every resource was listed; Pi no longer lists resources when connecting, so `/mcp` and `pi mcp list` show that a server offers resources instead of counting them ([#10526](https://github.com/earendil-works/pi/issues/10526))
|
|
718
|
+
- Fixed MCP tool calls failing when the server returns structured content that is not an object (an array, `null`, or a primitive, as MCP 2026-07-28 allows); codemode declarations of MCP tools without an output schema now type `structuredContent` as `unknown` instead of an object ([#10416](https://github.com/earendil-works/pi/issues/10416))
|
|
719
|
+
- Fixed reading or writing `auth.json` on Windows failing with `EPERM` when the previous lock folder was still being deleted; Pi now retries briefly before reporting the error ([#10801](https://github.com/earendil-works/pi/issues/10801))
|
|
720
|
+
- Fixed OpenRouter router models such as `openrouter/auto` showing a cost of -$1,000,000 per 1M tokens; OpenRouter's negative placeholder prices are now 0 ([#10672](https://github.com/earendil-works/pi/pull/10672) by [@davidbrai](https://github.com/davidbrai))
|
|
721
|
+
- Fixed Anthropic requests failing when the provider rejects the strict tool set for grammar size, tool count, or union limits; Pi now retries once with preferred tools non-strict ([#10409](https://github.com/earendil-works/pi/issues/10409))
|
|
722
|
+
- Fixed "The upstream provider returned an error" not being retried as a transient provider error ([#10842](https://github.com/earendil-works/pi/issues/10842))
|
|
723
|
+
- Fixed focused fullscreen overlays blocking mouse-wheel scrolling of the transcript ([#10769](https://github.com/earendil-works/pi/issues/10769))
|
|
724
|
+
- Fixed fragmented terminal color replies leaking hex values into the prompt and opening the external editor (related reports: [#10256](https://github.com/earendil-works/pi/issues/10256), [#10657](https://github.com/earendil-works/pi/issues/10657))
|
|
725
|
+
- Fixed inline images not rendering in Herdr since 1.1.0 ([#10774](https://github.com/earendil-works/pi/pull/10774) by [@ogulcancelik](https://github.com/ogulcancelik))
|
|
726
|
+
- Fixed key bindings that name a shifted symbol, such as `+` or `ctrl++`, not matching under the Kitty keyboard protocol or modifyOtherKeys ([#9880](https://github.com/earendil-works/pi/pull/9880) by [@christianklotz](https://github.com/christianklotz))
|
|
727
|
+
- Fixed the compaction status indicator embedded in a custom editor using the default muted colors instead of the editor border or thinking-level color, as the working indicator does ([#10809](https://github.com/earendil-works/pi/issues/10809), [#10810](https://github.com/earendil-works/pi/pull/10810) by [@Jay-Madden](https://github.com/Jay-Madden))
|
|
728
|
+
- Fixed MCP tool calls that were cancelled or timed out while waiting for an OAuth refresh still being sent to the server once the refresh finished ([#10598](https://github.com/earendil-works/pi/issues/10598))
|
|
729
|
+
- Fixed MCP OAuth sign-in accepting an authorization response with an `iss` parameter that could not be checked because no authorization server metadata was discovered; sign-in now fails with an issuer mismatch. Reported by [@AizenvoltPrime](https://github.com/AizenvoltPrime)
|
|
730
|
+
- Fixed codemode failing with a broken bridge error when Pi runs under `node --watch` on Node 24 or 26 ([#10725](https://github.com/earendil-works/pi/issues/10725))
|
|
731
|
+
|
|
732
|
+
### Removed
|
|
733
|
+
|
|
734
|
+
- Removed the unreleased experimental server, client, and plugin stack (`src/experimental`, `src/cli/experimental`) and its source-only `./client` and `./experimental/plugin` exports; none of it was part of the published package. The `@earendil-works/pi-client`, `@earendil-works/pi-protocol`, and `@earendil-works/pi-server` packages it used are removed and no longer released
|
|
735
|
+
- Removed the dependency on `@earendil-works/chord`
|
|
736
|
+
|
|
454
737
|
## [1.1.0] - 2026-10-07
|
|
455
738
|
|
|
456
739
|
### New Features
|
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ humain-code
|
|
|
41
41
|
|
|
42
42
|
The `humain-code` CLI is also available through the `humain-code-cli`, `hc`, `hcc`, `ht`, and `humain` aliases. The old `humain-terminal` command still works but is deprecated. The npm package is `@humain/humain-code` (formerly `@humain/terminal`). The `.humain-terminal` config directory and `HUMAIN_TERMINAL_*` environment variables are unchanged.
|
|
43
43
|
|
|
44
|
+
To use HUMAIN models, run `/login`, choose **Sign in with HUMAIN**, and pick **HUMAIN Gateway** (Microsoft sign-in, no API key) or **HUMAIN Node** (API key). Then choose a model with `/model`. See [HUMAIN Gateway](docs/providers.md#humain-gateway) and [HUMAIN Node](docs/providers.md#humain-node).
|
|
45
|
+
|
|
44
46
|
See the [documentation](docs/index.md) for full setup and usage instructions.
|
|
45
47
|
|
|
46
48
|
## Development
|
|
@@ -65,7 +67,7 @@ npm run check
|
|
|
65
67
|
|
|
66
68
|
For HUMAIN Code CLI contribution instructions, see [CONTRIBUTING.md](../../CONTRIBUTING.md) and [Development](docs/development.md). Upstream Pi contributions follow the linked upstream [CONTRIBUTING.md](https://github.com/earendil-works/pi/blob/main/CONTRIBUTING.md) and [AGENTS.md](https://github.com/earendil-works/pi/blob/main/AGENTS.md).
|
|
67
69
|
|
|
68
|
-
HUMAIN Code CLI also bundles web access, has built-in MCP support (see [MCP](docs/mcp.md)), and supports HUMAIN Node and Forge/DeployNow integrations. See [HUMAIN Code CLI](docs/humain-code.md) for those fork-specific workflows.
|
|
70
|
+
HUMAIN Code CLI also bundles web access, has built-in MCP support (see [MCP](docs/mcp.md)), and supports [HUMAIN Gateway](https://gateway.humain.services), HUMAIN Node, and Forge/DeployNow integrations. See [HUMAIN Code CLI](docs/humain-code.md) for those fork-specific workflows.
|
|
69
71
|
|
|
70
72
|
## License
|
|
71
73
|
|
|
@@ -23,6 +23,6 @@ export interface MonitorConnection {
|
|
|
23
23
|
createClient(options?: AgentMonitorClientOptions): AgentMonitorClient;
|
|
24
24
|
}
|
|
25
25
|
export declare function monitorLaunchSpec(runtime?: LaunchRuntime): BrokerLaunchSpec;
|
|
26
|
-
/** Throws when the agent directory cannot be used safely. */
|
|
27
|
-
export declare function defaultMonitorConnection(agentDir?: string): MonitorConnection;
|
|
26
|
+
/** Throws when the agent directory cannot be used safely. `startupTimeoutMs` defaults to ensureBroker's. */
|
|
27
|
+
export declare function defaultMonitorConnection(agentDir?: string, startupTimeoutMs?: number): MonitorConnection;
|
|
28
28
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/agent-monitor/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,EACN,KAAK,gBAAgB,EAGrB,KAAK,aAAa,EAClB,MAAM,kCAAkC,CAAC;AAI1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAON,KAAK,aAAa,EAClB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,yBAAyB;IACzC,KAAK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AC,UAAU,CAAS;IACpC,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAEhC,YAAY,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,yBAA8B,EAItE;IAED,WAAW,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqD5E;IAED,2FAA2F;IAC3F,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAElC;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAGhC;CACD;AAED,MAAM,WAAW,iBAAiB;IACjC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,YAAY,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAAC;CACtE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,aAAqC,GAAG,gBAAgB,CAKlG;AAED,4GAA4G;AAC5G,wBAAgB,wBAAwB,CACvC,QAAQ,GAAE,MAAsB,EAChC,gBAAgB,CAAC,EAAE,MAAM,GACvB,iBAAiB,CAcnB"}
|
|
@@ -92,8 +92,8 @@ export function monitorLaunchSpec(runtime = detectLaunchRuntime()) {
|
|
|
92
92
|
}
|
|
93
93
|
return getInternalCommandLaunchSpec(runtime, [AGENT_MONITOR_COMMAND]);
|
|
94
94
|
}
|
|
95
|
-
/** Throws when the agent directory cannot be used safely. */
|
|
96
|
-
export function defaultMonitorConnection(agentDir = getAgentDir()) {
|
|
95
|
+
/** Throws when the agent directory cannot be used safely. `startupTimeoutMs` defaults to ensureBroker's. */
|
|
96
|
+
export function defaultMonitorConnection(agentDir = getAgentDir(), startupTimeoutMs) {
|
|
97
97
|
const paths = resolveAgentMonitorPaths(agentDir);
|
|
98
98
|
return {
|
|
99
99
|
ensureMonitor: () => ensureBroker({
|
|
@@ -102,6 +102,7 @@ export function defaultMonitorConnection(agentDir = getAgentDir()) {
|
|
|
102
102
|
launch: monitorLaunchSpec(),
|
|
103
103
|
role: AGENT_MONITOR_ROLE,
|
|
104
104
|
protocol: AGENT_MONITOR_PROTOCOL,
|
|
105
|
+
startupTimeoutMs,
|
|
105
106
|
}),
|
|
106
107
|
createClient: (options) => new AgentMonitorClient(paths.socketPath, options),
|
|
107
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/agent-monitor/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAEN,mBAAmB,EACnB,4BAA4B,GAE5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EACN,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,wBAAwB,GAExB,MAAM,eAAe,CAAC;AAEvB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAMhC,gFAAgF;AAChF,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IAClC,UAAU,CAAS;IAC5B,MAAM,CAAyB;IAC/B,SAAS,GAAG,KAAK,CAAC;IACT,KAAK,CAAU;IAEhC,YAAY,UAAkB,EAAE,OAAO,GAA8B,EAAE;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UA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,CACnB,YAAY,CAAC;YACZ,KAAK;YACL,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;YAChC,MAAM,EAAE,iBAAiB,EAAE;YAC3B,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,sBAAsB;YAChC,gBAAgB;SAChB,CAAC;QACH,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC;KAC5E,CAAC;AACH,CAAC","sourcesContent":["import { EventEmitter } from \"node:events\";\nimport { realpathSync } from \"node:fs\";\nimport net from \"node:net\";\nimport { join } from \"node:path\";\nimport { getAgentDir, getPackageDir } from \"../config.ts\";\nimport {\n\ttype BrokerLaunchSpec,\n\tdetectLaunchRuntime,\n\tgetInternalCommandLaunchSpec,\n\ttype LaunchRuntime,\n} from \"../coordination/client/launch.ts\";\nimport { ensureBroker } from \"../coordination/client/spawn.ts\";\nimport { createMessageReader, writeMessage } from \"../coordination/transport/framing.ts\";\nimport { assertPrivateSocket } from \"../coordination/transport/paths.ts\";\nimport type { SessionRegistration } from \"../coordination/transport/types.ts\";\nimport {\n\tAGENT_MONITOR_COMMAND,\n\tAGENT_MONITOR_PROTOCOL,\n\tAGENT_MONITOR_ROLE,\n\tMAX_SNAPSHOT_FRAME_BYTES,\n\tparseSnapshot,\n\tresolveAgentMonitorPaths,\n\ttype SessionReport,\n} from \"./protocol.ts\";\n\nconst CONNECT_TIMEOUT_MS = 2000;\n\nexport interface AgentMonitorClientOptions {\n\tunref?: boolean;\n}\n\n/** One monitor connection. Fits ConnectionSupervisor, which owns reconnects. */\nexport class AgentMonitorClient extends EventEmitter {\n\tprivate readonly socketPath: string;\n\tprivate socket: net.Socket | undefined;\n\tprivate connected = false;\n\tprivate readonly unref: boolean;\n\n\tconstructor(socketPath: string, options: AgentMonitorClientOptions = {}) {\n\t\tsuper();\n\t\tthis.socketPath = socketPath;\n\t\tthis.unref = options.unref ?? false;\n\t}\n\n\tisConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\tconnect(registration: SessionRegistration, _sessionId: string): Promise<void> {\n\t\tassertPrivateSocket(this.socketPath);\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst socket = net.connect(this.socketPath);\n\t\t\tif (this.unref) socket.unref();\n\t\t\tthis.socket = socket;\n\t\t\tlet settled = false;\n\t\t\tconst fail = (error: Error) => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tsocket.destroy();\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tconst timer = setTimeout(() => fail(new Error(\"Agent monitor did not answer\")), CONNECT_TIMEOUT_MS);\n\t\t\tif (this.unref) timer.unref();\n\t\t\tsocket.on(\n\t\t\t\t\"data\",\n\t\t\t\tcreateMessageReader(\n\t\t\t\t\t(message) => {\n\t\t\t\t\t\tconst type = (message as { type?: unknown } | null)?.type;\n\t\t\t\t\t\tif (type === \"welcome\" && !settled) {\n\t\t\t\t\t\t\tsettled = true;\n\t\t\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\t\t\tthis.connected = true;\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t} else if (type === \"incompatible\") {\n\t\t\t\t\t\t\tfail(new Error(\"Agent monitor runs a different HUMAIN version\"));\n\t\t\t\t\t\t} else if (type === \"snapshot\") {\n\t\t\t\t\t\t\tconst snapshot = parseSnapshot(message);\n\t\t\t\t\t\t\tif (snapshot) this.emit(\"snapshot\", snapshot);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t(error) => socket.destroy(error),\n\t\t\t\t\tMAX_SNAPSHOT_FRAME_BYTES,\n\t\t\t\t),\n\t\t\t);\n\t\t\tsocket.on(\"connect\", () =>\n\t\t\t\twriteMessage(socket, {\n\t\t\t\t\ttype: \"hello\",\n\t\t\t\t\tprotocol: AGENT_MONITOR_PROTOCOL.name,\n\t\t\t\t\tversion: AGENT_MONITOR_PROTOCOL.version,\n\t\t\t\t\tpid: registration.pid,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tsocket.on(\"error\", (error) => fail(error));\n\t\t\tsocket.on(\"close\", () => {\n\t\t\t\tconst wasConnected = this.connected;\n\t\t\t\tthis.connected = false;\n\t\t\t\tif (!settled) fail(new Error(\"Agent monitor closed the connection\"));\n\t\t\t\telse if (wasConnected) this.emit(\"disconnected\");\n\t\t\t});\n\t\t});\n\t}\n\n\t/** Never blocks: writeMessage queues, and destroys a socket whose peer stopped reading. */\n\treport(report: SessionReport): void {\n\t\tif (this.connected && this.socket) writeMessage(this.socket, report);\n\t}\n\n\tasync disconnect(): Promise<void> {\n\t\tthis.socket?.destroy();\n\t\tthis.socket = undefined;\n\t}\n}\n\nexport interface MonitorConnection {\n\tensureMonitor(): Promise<void>;\n\tcreateClient(options?: AgentMonitorClientOptions): AgentMonitorClient;\n}\n\nexport function monitorLaunchSpec(runtime: LaunchRuntime = detectLaunchRuntime()): BrokerLaunchSpec {\n\tif (runtime === \"bundled-node\") {\n\t\treturn { command: process.execPath, args: [join(getPackageDir(), \"dist\", \"bundle\", \"agent-monitor.js\")] };\n\t}\n\treturn getInternalCommandLaunchSpec(runtime, [AGENT_MONITOR_COMMAND]);\n}\n\n/** Throws when the agent directory cannot be used safely. `startupTimeoutMs` defaults to ensureBroker's. */\nexport function defaultMonitorConnection(\n\tagentDir: string = getAgentDir(),\n\tstartupTimeoutMs?: number,\n): MonitorConnection {\n\tconst paths = resolveAgentMonitorPaths(agentDir);\n\treturn {\n\t\tensureMonitor: () =>\n\t\t\tensureBroker({\n\t\t\t\tpaths,\n\t\t\t\tagentDir: realpathSync(agentDir),\n\t\t\t\tlaunch: monitorLaunchSpec(),\n\t\t\t\trole: AGENT_MONITOR_ROLE,\n\t\t\t\tprotocol: AGENT_MONITOR_PROTOCOL,\n\t\t\t\tstartupTimeoutMs,\n\t\t\t}),\n\t\tcreateClient: (options) => new AgentMonitorClient(paths.socketPath, options),\n\t};\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{runAgentMonitorCommand}from"./chunks/chunk-
|
|
2
|
+
import{runAgentMonitorCommand}from"./chunks/chunk-ROZV2IYD.js";import"./chunks/chunk-ZI7TK7HM.js";import"./chunks/chunk-MIJHJNNQ.js";import"./chunks/chunk-HIZWUSPN.js";import"./chunks/chunk-JXWJOIH4.js";process.exitCode=await runAgentMonitorCommand(process.env);
|