@humain/humain-code 0.5.4 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +170 -0
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-FGFIMZUF.js +66 -0
- package/dist/bundle/chunks/azure-openai-responses-6JNTC7KO.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +261 -237
- package/dist/bundle/chunks/chunk-2H3LUS62.js +1966 -0
- package/dist/bundle/chunks/{chunk-GEISZXXH.js → chunk-4ZBGTJJM.js} +1 -1
- package/dist/bundle/chunks/{chunk-QWXPGBAG.js → chunk-5JSLXC2A.js} +1 -1
- package/dist/bundle/chunks/{chunk-L2VKM23Q.js → chunk-6DE7LJKV.js} +21 -21
- package/dist/bundle/chunks/{chunk-V62QBESW.js → chunk-6E6RHNOU.js} +11 -10
- package/dist/bundle/chunks/chunk-7RZ5BS7U.js +2 -0
- package/dist/bundle/chunks/chunk-AHSNQWZU.js +24 -0
- package/dist/bundle/chunks/{chunk-UJLCKIMZ.js → chunk-AOH2O5CP.js} +3469 -3133
- package/dist/bundle/chunks/{chunk-ODJUBJK2.js → chunk-B7NJMF7B.js} +11 -11
- package/dist/bundle/chunks/chunk-BQ3TMEWD.js +7 -0
- package/dist/bundle/chunks/{chunk-KKCMWB63.js → chunk-C6VERWRZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-CN3Q5UNB.js → chunk-CFHOPLW5.js} +658 -574
- package/dist/bundle/chunks/chunk-CVC2GV26.js +1986 -0
- package/dist/bundle/chunks/{chunk-DU6POZ7E.js → chunk-DHW3REC5.js} +1 -1
- package/dist/bundle/chunks/{chunk-UTNHGOFS.js → chunk-EDONIPUJ.js} +38 -38
- package/dist/bundle/chunks/{chunk-FO2NYB6O.js → chunk-FDGW5ZTG.js} +1147 -1110
- package/dist/bundle/chunks/{chunk-XQX7S3GM.js → chunk-GICL5V54.js} +1 -1
- package/dist/bundle/chunks/chunk-H7Y4QY7K.js +11 -0
- package/dist/bundle/chunks/chunk-HW6HMUXS.js +188 -0
- package/dist/bundle/chunks/chunk-I6AQOITY.js +53 -0
- package/dist/bundle/chunks/{chunk-ZI7TK7HM.js → chunk-IADQJFNH.js} +21 -17
- package/dist/bundle/chunks/chunk-J7AP2BUJ.js +3 -0
- package/dist/bundle/chunks/chunk-JFE52VSN.js +120 -0
- package/dist/bundle/chunks/{chunk-MIJHJNNQ.js → chunk-LDGCU6PD.js} +127 -3
- package/dist/bundle/chunks/{chunk-PS7DGA7B.js → chunk-M4CHQBAI.js} +1 -1
- package/dist/bundle/chunks/{chunk-YDBNMIA3.js → chunk-NN53K2QQ.js} +19 -1
- package/dist/bundle/chunks/{chunk-RTXDU3AA.js → chunk-ONR6Q3II.js} +255 -195
- package/dist/bundle/chunks/{chunk-Y3OPKKDR.js → chunk-P4P7OZ7R.js} +34 -32
- package/dist/bundle/chunks/{chunk-OZNC2W4B.js → chunk-PCTLFSQG.js} +444 -411
- package/dist/bundle/chunks/{chunk-YFBDR4IW.js → chunk-PNGNZXOI.js} +3 -3
- package/dist/bundle/chunks/{chunk-UDB6NI4G.js → chunk-RGUZULEE.js} +593 -481
- package/dist/bundle/chunks/chunk-RO5YPAJH.js +23 -0
- package/dist/bundle/chunks/{chunk-A6B2QMA7.js → chunk-RU7ADKA7.js} +176 -162
- package/dist/bundle/chunks/{chunk-JCXXRCP6.js → chunk-T3KDZFM4.js} +16 -16
- package/dist/bundle/chunks/{chunk-HT5YN3LX.js → chunk-TEOMXMW6.js} +3 -3
- package/dist/bundle/chunks/{chunk-HIZWUSPN.js → chunk-VEGJT52D.js} +77 -77
- package/dist/bundle/chunks/{chunk-IDU5BNNI.js → chunk-XMZGB3H4.js} +12 -3
- package/dist/bundle/chunks/chunk-YEPHPMQC.js +647 -0
- package/dist/bundle/chunks/{chunk-XA7CJAYH.js → chunk-YRUIJ5AH.js} +48 -42
- package/dist/bundle/chunks/{cli-ENEFJH2B.js → cli-BNCWK54K.js} +21 -17
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T7TPP7SQ.js → cloudflare-workers-ai-system-one-KI6W3USX.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +81 -75
- package/dist/bundle/chunks/compat-I5VPOXFT.js +13 -0
- package/dist/bundle/chunks/dist-J5IUPLMH.js +37 -0
- package/dist/bundle/chunks/{dist-RKNCFFGM.js → dist-SKBR3C7C.js} +720 -696
- package/dist/bundle/chunks/dist-TVRQXUY6.js +8 -0
- package/dist/bundle/chunks/{dist-cjs-HTASUQXQ.js → dist-cjs-2SKN226B.js} +77 -77
- package/dist/bundle/chunks/{easter-egg-3d-YOPLCOVW.js → easter-egg-3d-673VRP6Y.js} +1 -1
- package/dist/bundle/chunks/{esm-R6HJ4QEG.js → esm-WPALMLUO.js} +3 -3
- package/dist/bundle/chunks/{event-streams-BR2IL6C5.js → event-streams-7YGFEPBZ.js} +1 -1
- package/dist/bundle/chunks/{execute-2JXEKQ2X.js → execute-PIUR5MUV.js} +23 -23
- package/dist/bundle/chunks/{extract-OTCGZGTL.js → extract-4O5Z5725.js} +74 -71
- package/dist/bundle/chunks/github-copilot.js +50 -51
- package/dist/bundle/chunks/google-generative-ai-635YZEHN.js +22 -0
- package/dist/bundle/chunks/google-vertex-I3ZJ3SB2.js +26 -0
- package/dist/bundle/chunks/host-OQOEIWHK.js +2 -0
- package/dist/bundle/chunks/image-resize-worker.js +3 -2
- package/dist/bundle/chunks/kimi-coding.js +13 -14
- package/dist/bundle/chunks/{llama-cpp-classify-B3G57LVR.js → llama-cpp-classify-PP63BYDF.js} +1 -1
- package/dist/bundle/chunks/meta.js +10 -10
- package/dist/bundle/chunks/mistral-conversations-OKG5GKXR.js +42 -0
- package/dist/bundle/chunks/{node-VSA4ZN7D.js → node-UGQUSQE6.js} +1 -1
- package/dist/bundle/chunks/{node-SJPZTR4K.js → node-UNHECG4X.js} +168 -157
- package/dist/bundle/chunks/openai-codex-responses-6JYZIFT4.js +100 -0
- package/dist/bundle/chunks/openai-completions-YBNI6CAP.js +82 -0
- package/dist/bundle/chunks/{openai-decisions-WOWUC65P.js → openai-decisions-5G5YBFRQ.js} +1 -1
- package/dist/bundle/chunks/openai-responses-C3APJ6MK.js +27 -0
- package/dist/bundle/chunks/{openrouter-images-5K47HDAT.js → openrouter-images-FCJT7C7I.js} +2 -2
- package/dist/bundle/chunks/{pdfjs-EK6K7CXX.js → pdfjs-AKD6EBKN.js} +196 -175
- package/dist/bundle/chunks/pdfjs-decoders-OFXX4HDZ.js +2 -0
- package/dist/bundle/chunks/pdfjs-jbig2-TXR26KRI.js +278 -0
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +326 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +671 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +974 -0
- package/dist/bundle/chunks/pi-messages-UHYZYEOC.js +25 -0
- package/dist/bundle/chunks/radius.js +8 -8
- package/dist/bundle/chunks/{runtime-K3F2QDQP.js → runtime-KE3HDSRT.js} +1 -1
- package/dist/bundle/chunks/{turndown.cjs-U7XOXH4O.js → turndown.cjs-WKGZX7NZ.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-43OCHGKP.js → typesafe-system-one-VYVAMWQV.js} +1 -1
- package/dist/bundle/chunks/{undici-EK3EUI2E.js → undici-C6S56CGI.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-KDUZIB3W.js +23 -0
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/flow/package.json +5 -5
- package/dist/bundle/index.js +10 -10
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -8
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +29 -5
- package/dist/config.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts +8 -5
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +32 -6
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +19 -1
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +23 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +142 -39
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +4 -0
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +71 -1
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/codex-reset.d.ts +45 -0
- package/dist/core/codex-reset.d.ts.map +1 -0
- package/dist/core/codex-reset.js +190 -0
- package/dist/core/codex-reset.js.map +1 -0
- package/dist/core/codex-usage.d.ts +4 -2
- package/dist/core/codex-usage.d.ts.map +1 -1
- package/dist/core/codex-usage.js +9 -4
- package/dist/core/codex-usage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +3 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +25 -10
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +37 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +274 -65
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +19 -6
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +49 -11
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +9 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +105 -61
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.css +9 -0
- package/dist/core/export-html/template.html +2 -0
- package/dist/core/export-html/template.js +200 -62
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/types.d.ts +27 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts +7 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +107 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +56 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +14 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +9 -4
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +15 -5
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1691 -2042
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts +35 -4
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +70 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +16 -10
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +21 -17
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +29 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +311 -60
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +164 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -0
- package/dist/core/pi-ai-schemas.js +21 -0
- package/dist/core/pi-ai-schemas.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +1 -0
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +4 -0
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/resource-loader.d.ts +4 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +38 -23
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +4 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +66 -26
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +2 -0
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +2 -0
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/settings-manager.d.ts +19 -8
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +70 -16
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +15 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +37 -3
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +9 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +13 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/subscription-credits.d.ts +14 -0
- package/dist/core/subscription-credits.d.ts.map +1 -0
- package/dist/core/subscription-credits.js +10 -0
- package/dist/core/subscription-credits.js.map +1 -0
- package/dist/core/subscription-reset-status.d.ts +10 -0
- package/dist/core/subscription-reset-status.d.ts.map +1 -0
- package/dist/core/subscription-reset-status.js +2 -0
- package/dist/core/subscription-reset-status.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +7 -3
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +4 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +42 -12
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/edit.d.ts.map +1 -1
- package/dist/core/tools/renderers/edit.js +3 -3
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +37 -29
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +9 -8
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +8 -5
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/core/usage-totals.d.ts.map +1 -1
- package/dist/core/usage-totals.js +2 -0
- package/dist/core/usage-totals.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +17 -9
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +33 -8
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +16 -4
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.js +4 -3
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +1 -1
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +7 -3
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +1 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +56 -28
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +21 -6
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +104 -36
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/extensions/usage/confirmation.d.ts +40 -0
- package/dist/extensions/usage/confirmation.d.ts.map +1 -0
- package/dist/extensions/usage/confirmation.js +198 -0
- package/dist/extensions/usage/confirmation.js.map +1 -0
- package/dist/extensions/usage/index.d.ts +4 -4
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +352 -33
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +8 -1
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +54 -11
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/popup.d.ts +37 -6
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +396 -45
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +564 -130
- package/dist/humain/node-provider.d.ts.map +1 -1
- package/dist/humain/node-provider.js +1 -0
- package/dist/humain/node-provider.js.map +1 -1
- package/dist/humain/web-access/host.d.ts +2 -1
- package/dist/humain/web-access/host.d.ts.map +1 -1
- package/dist/humain/web-access/host.js +1 -1
- package/dist/humain/web-access/host.js.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts +2 -0
- package/dist/humain/web-access/vendor/brave-rate-limit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/brave-rate-limit.js +2 -2
- package/dist/humain/web-access/vendor/brave-rate-limit.js.map +1 -1
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts +5 -0
- package/dist/humain/web-access/vendor/cloudflare-search.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js +230 -0
- package/dist/humain/web-access/vendor/cloudflare-search.js.map +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +18 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +12 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +33 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +84 -0
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts +3 -0
- package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.js +54 -49
- package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
- package/dist/humain/web-access/vendor/exa.d.ts +8 -3
- package/dist/humain/web-access/vendor/exa.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/exa.js +129 -14
- package/dist/humain/web-access/vendor/exa.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +68 -10
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.js +2 -2
- package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
- package/dist/humain/web-access/vendor/field-extract.d.ts +38 -0
- package/dist/humain/web-access/vendor/field-extract.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/field-extract.js +350 -0
- package/dist/humain/web-access/vendor/field-extract.js.map +1 -0
- package/dist/humain/web-access/vendor/gemini-search.d.ts +15 -4
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +198 -16
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/github-api.js +1 -1
- package/dist/humain/web-access/vendor/github-api.js.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/github-extract.js +3 -2
- package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +137 -118
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js +1 -1
- package/dist/humain/web-access/vendor/mistral-search.js.map +1 -1
- package/dist/humain/web-access/vendor/ninerouter.d.ts +4 -0
- package/dist/humain/web-access/vendor/ninerouter.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/ninerouter.js +110 -0
- package/dist/humain/web-access/vendor/ninerouter.js.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts +27 -0
- package/dist/humain/web-access/vendor/offtopic-judge.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js +61 -0
- package/dist/humain/web-access/vendor/offtopic-judge.js.map +1 -0
- package/dist/humain/web-access/vendor/openai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/openai-search.js +39 -13
- package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
- package/dist/humain/web-access/vendor/outcrawl.d.ts +4 -0
- package/dist/humain/web-access/vendor/outcrawl.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/outcrawl.js +196 -0
- package/dist/humain/web-access/vendor/outcrawl.js.map +1 -0
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +13 -3
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.d.ts +1 -3
- package/dist/humain/web-access/vendor/pdf-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/pdf-extract.js +0 -2
- package/dist/humain/web-access/vendor/pdf-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.d.ts +3 -0
- package/dist/humain/web-access/vendor/perplexity.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/perplexity.js.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.d.ts +2 -2
- package/dist/humain/web-access/vendor/query-rewrite.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/query-rewrite.js +39 -13
- package/dist/humain/web-access/vendor/query-rewrite.js.map +1 -1
- package/dist/humain/web-access/vendor/searchapi.d.ts +4 -0
- package/dist/humain/web-access/vendor/searchapi.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/searchapi.js +195 -0
- package/dist/humain/web-access/vendor/searchapi.js.map +1 -0
- package/dist/humain/web-access/vendor/sofya.d.ts +4 -0
- package/dist/humain/web-access/vendor/sofya.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/sofya.js +193 -0
- package/dist/humain/web-access/vendor/sofya.js.map +1 -0
- package/dist/humain/web-access/vendor/source-check.d.ts +5 -1
- package/dist/humain/web-access/vendor/source-check.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/source-check.js +34 -16
- package/dist/humain/web-access/vendor/source-check.js.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts +7 -0
- package/dist/humain/web-access/vendor/ssrf-protection.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js +24 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts +8 -3
- package/dist/humain/web-access/vendor/summary-model-scope.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js +15 -1
- package/dist/humain/web-access/vendor/summary-model-scope.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts +7 -2
- package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.js +32 -28
- package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
- package/dist/humain/web-access/vendor/tabstack.d.ts +6 -0
- package/dist/humain/web-access/vendor/tabstack.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/tabstack.js +236 -0
- package/dist/humain/web-access/vendor/tabstack.js.map +1 -0
- package/dist/humain/web-access/vendor/tool-arguments.js +1 -1
- package/dist/humain/web-access/vendor/tool-arguments.js.map +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts +8 -0
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js +46 -0
- package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -0
- package/dist/humain/web-access/vendor/utils.d.ts +9 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +113 -27
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts +4 -0
- package/dist/humain/web-access/vendor/web-tool-contract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-contract.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +17 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +99 -22
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts +1 -1
- package/dist/humain/web-access/vendor/xai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/xai-search.js +6 -5
- package/dist/humain/web-access/vendor/xai-search.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +20 -9
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-code-block.d.ts +34 -0
- package/dist/modes/interactive/components/assistant-code-block.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-code-block.js +160 -0
- package/dist/modes/interactive/components/assistant-code-block.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +31 -10
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +276 -73
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +2 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +4 -17
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +7 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js +3 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +4 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +4 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +6 -5
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +107 -11
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +3 -2
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -1
- package/dist/modes/interactive/components/mermaid.js +18 -6
- package/dist/modes/interactive/components/mermaid.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +17 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +13 -4
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +14 -3
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts +4 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +86 -22
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +2 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +16 -24
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +2 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +2 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +15 -5
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +5 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +9 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +4 -3
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +20 -18
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +16 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +259 -83
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-search.d.ts +10 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.js +21 -0
- package/dist/modes/interactive/model-search.js.map +1 -1
- package/dist/modes/interactive/oauth-account-format.d.ts +10 -1
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +42 -0
- package/dist/modes/interactive/oauth-account-format.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +28 -24
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +3 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +55 -4
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +5 -2
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +4 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts +8 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +31 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +96 -6
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts +2 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +12 -2
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +156 -11
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +30 -35
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/cli.md +22 -12
- package/docs/compaction.md +32 -8
- package/docs/coordination.md +2 -0
- package/docs/custom-provider.md +4 -2
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +3169 -229
- package/docs/flow.md +2 -0
- package/docs/keybindings.md +24 -2
- package/docs/llama-cpp.md +30 -19
- package/docs/mcp.md +4 -2
- package/docs/message-types.md +7 -7
- package/docs/packages.md +27 -1
- package/docs/sessions.md +11 -3
- package/docs/settings.md +21 -9
- package/docs/slash-commands.md +51 -11
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/tui.md +3 -1
- package/docs/windows.md +27 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-anthropic/index.ts +27 -31
- package/examples/extensions/custom-provider-anthropic/package-lock.json +7 -7
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +14 -24
- package/examples/extensions/gondolin/package.json +2 -2
- package/examples/extensions/preset.ts +2 -0
- package/examples/extensions/reload-runtime.ts +17 -5
- package/examples/extensions/todo.ts +7 -0
- package/examples/extensions/tools.ts +2 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +252 -0
- package/npm-shrinkwrap.json +289 -277
- package/package.json +29 -29
- package/schemas/keybindings.schema.json +28 -0
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +49 -0
- package/src/humain/ponytail/UPSTREAM.md +16 -2
- package/src/humain/ponytail/upstream.json +4 -4
- package/src/humain/web-access/UPSTREAM.md +48 -1
- package/src/humain/web-access/upstream.json +9 -6
- package/src/humain/web-access/vendor/CHANGELOG.md +1223 -0
- package/dist/bundle/chunks/anthropic-messages-ZP5KUK52.js +0 -67
- package/dist/bundle/chunks/azure-openai-responses-QJFYQ3DF.js +0 -15
- package/dist/bundle/chunks/chunk-2GCMACT4.js +0 -1956
- package/dist/bundle/chunks/chunk-AO6FF5JL.js +0 -21
- package/dist/bundle/chunks/chunk-EY3LZOUP.js +0 -1963
- package/dist/bundle/chunks/chunk-M74U5X4S.js +0 -119
- package/dist/bundle/chunks/chunk-N7CQ3UV3.js +0 -80
- package/dist/bundle/chunks/chunk-OR25QDSS.js +0 -365
- package/dist/bundle/chunks/chunk-PH7UP57J.js +0 -6
- package/dist/bundle/chunks/chunk-QW6PTCAB.js +0 -10
- package/dist/bundle/chunks/chunk-ROZV2IYD.js +0 -125
- package/dist/bundle/chunks/chunk-YFOLLX5D.js +0 -23
- package/dist/bundle/chunks/chunk-ZR4GF4WU.js +0 -54
- package/dist/bundle/chunks/compat-CJBWWYHE.js +0 -13
- package/dist/bundle/chunks/dist-IBUWEKEE.js +0 -24
- package/dist/bundle/chunks/dist-YFMJEHPH.js +0 -8
- package/dist/bundle/chunks/google-generative-ai-HVPCGIZ6.js +0 -21
- package/dist/bundle/chunks/google-vertex-UM5MAALA.js +0 -25
- package/dist/bundle/chunks/host-ZHEL5XQW.js +0 -2
- package/dist/bundle/chunks/mistral-conversations-AH72RLXK.js +0 -44
- package/dist/bundle/chunks/openai-codex-responses-L366637C.js +0 -98
- package/dist/bundle/chunks/openai-completions-ZP62QXJX.js +0 -83
- package/dist/bundle/chunks/openai-responses-DXUGSUTN.js +0 -26
- package/dist/bundle/chunks/pi-messages-MOQQDZBK.js +0 -23
- package/dist/bundle/chunks/virtual-modules-5D6QIJPN.js +0 -5
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -66
- package/examples/extensions/sandbox/package.json +0 -19
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
* Interactive mode for the coding agent.
|
|
4
4
|
* Handles TUI rendering and user interaction, delegating business logic to AgentSession.
|
|
5
5
|
*/
|
|
6
|
-
import * as crypto from "node:crypto";
|
|
7
6
|
import * as fs from "node:fs";
|
|
8
|
-
import * as os from "node:os";
|
|
9
7
|
import * as path from "node:path";
|
|
10
8
|
import { isRetryableAssistantError, } from "@earendil-works/pi-ai/compat";
|
|
11
9
|
import * as TuiLayouts from "@earendil-works/pi-tui";
|
|
@@ -13,14 +11,15 @@ import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities,
|
|
|
13
11
|
import chalk from "chalk";
|
|
14
12
|
import { spawn } from "child_process";
|
|
15
13
|
import { trackUserWait } from "../../agent-monitor/user-wait.js";
|
|
16
|
-
import { APP_COMMAND, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
|
|
14
|
+
import { APP_COMMAND, APP_TITLE, CONFIG_DIR_NAME, detectInstallChange, ENV_OFFLINE, getAgentDir, getAuthPath, getChangelogUrl, getDebugLogPath, getDocsPath, getInstallTelemetryUrl, VERSION, } from "../../config.js";
|
|
17
15
|
import { formatAccountUsageReport } from "../../core/account-reporting.js";
|
|
18
16
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
19
17
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
18
|
+
import { ANTHROPIC_USAGE_PROVIDER_ID } from "../../core/anthropic-subscription-usage.js";
|
|
20
19
|
import { AccountSourceReplacementError } from "../../core/auth-storage.js";
|
|
21
20
|
import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, } from "../../core/cache-stats.js";
|
|
22
21
|
import { formatCacheWarmingStatus, formatCacheWarmingUsage } from "../../core/cache-warmer.js";
|
|
23
|
-
import { CODEX_USAGE_PROVIDER_ID,
|
|
22
|
+
import { CODEX_USAGE_PROVIDER_ID, getCodexAvailability } from "../../core/codex-usage.js";
|
|
24
23
|
import { findExtensionStackMatches, recordCrash, takeUnnotifiedCrash } from "../../core/crash-log.js";
|
|
25
24
|
import { DEFAULT_THINKING_LEVEL, THINKING_LEVEL_OPTIONS } from "../../core/defaults.js";
|
|
26
25
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
@@ -36,6 +35,7 @@ import { SafeCredentialError } from "../../core/safe-credential-error.js";
|
|
|
36
35
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
37
36
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
38
37
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
38
|
+
import { getSourcePackageKey } from "../../core/source-info.js";
|
|
39
39
|
import { isInstallTelemetryEnabled } from "../../core/telemetry.js";
|
|
40
40
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
41
41
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
@@ -49,13 +49,14 @@ import { ACCOUNT_LOGIN_LABEL, API_KEY_LOGIN_LABEL, HUMAIN_LOGIN_LABEL, HUMAIN_SH
|
|
|
49
49
|
import { RUNTIME_MODES, readDefaultMode, resolveSessionMode as resolvePonytailSessionMode, } from "../../humain/ponytail/index.js";
|
|
50
50
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
51
51
|
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
52
|
-
import {
|
|
52
|
+
import { readClipboardImage, writePastedImage } from "../../utils/clipboard-image.js";
|
|
53
53
|
import { parseGitUrl } from "../../utils/git.js";
|
|
54
54
|
import { ensurePngTranscoderOnFirstUse } from "../../utils/image-convert.js";
|
|
55
|
-
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
55
|
+
import { getCwdRelativePath, shortenHomePath } from "../../utils/paths.js";
|
|
56
56
|
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
57
57
|
import { killTrackedDetachedChildren, killTrackedDetachedChildrenAsync } from "../../utils/shell.js";
|
|
58
58
|
import { loadAllHighlightLanguagesOnDemand } from "../../utils/syntax-highlight.js";
|
|
59
|
+
import { stripBom } from "../../utils/text.js";
|
|
59
60
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
60
61
|
import { checkForNewPiVersion } from "../../utils/version-check.js";
|
|
61
62
|
import { waitForSignalShutdown } from "../signal-shutdown.js";
|
|
@@ -101,7 +102,7 @@ import { getModelSearchText } from "./model-search.js";
|
|
|
101
102
|
import { formatOAuthAccountOption, formatOAuthAccountResetTime, } from "./oauth-account-format.js";
|
|
102
103
|
import { ProgramStatusReporter } from "./program-status-reporter.js";
|
|
103
104
|
import { shareSession } from "./session-share.js";
|
|
104
|
-
import { DEFAULT_THEME_NAME, getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
105
|
+
import { DEFAULT_THEME_NAME, getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getSelectListTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
105
106
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
106
107
|
import { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
107
108
|
export { createInteractiveTui, createInteractiveTuiReference } from "./tui-renderer.js";
|
|
@@ -282,6 +283,7 @@ export class InteractiveMode {
|
|
|
282
283
|
lastSigintTime = 0;
|
|
283
284
|
lastEscapeTime = 0;
|
|
284
285
|
changelogMarkdown = undefined;
|
|
286
|
+
extensionChangelogUpdates = [];
|
|
285
287
|
startupNoticesShown = false;
|
|
286
288
|
/** The /model save-as-default tip is shown once per run. */
|
|
287
289
|
modelSaveTipShown = false;
|
|
@@ -595,24 +597,44 @@ export class InteractiveMode {
|
|
|
595
597
|
return;
|
|
596
598
|
}
|
|
597
599
|
this.startupNoticesShown = true;
|
|
598
|
-
if (!this.changelogMarkdown) {
|
|
600
|
+
if (!this.changelogMarkdown && this.extensionChangelogUpdates.length === 0) {
|
|
599
601
|
return;
|
|
600
602
|
}
|
|
601
603
|
if (this.chatContainer.children.length > 0) {
|
|
602
604
|
this.chatContainer.addChild(new Spacer(1));
|
|
603
605
|
}
|
|
604
606
|
this.chatContainer.addChild(new DynamicBorder());
|
|
605
|
-
if (this.
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
if (this.changelogMarkdown) {
|
|
608
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
609
|
+
const versionMatch = this.changelogMarkdown.match(/##\s+\[?(\d+\.\d+\.\d+)\]?/);
|
|
610
|
+
const latestVersion = versionMatch ? versionMatch[1] : this.version;
|
|
611
|
+
const condensedText = `Updated to v${latestVersion}. Use ${theme.bold("/changelog")} to view full changelog.`;
|
|
612
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "What's New")), 1, 0));
|
|
616
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
617
|
+
this.chatContainer.addChild(new Markdown(this.changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));
|
|
618
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
619
|
+
}
|
|
610
620
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
this.
|
|
621
|
+
if (this.extensionChangelogUpdates.length > 0) {
|
|
622
|
+
if (this.changelogMarkdown) {
|
|
623
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
624
|
+
}
|
|
625
|
+
if (this.settingsManager.getCollapseChangelog()) {
|
|
626
|
+
const condensedText = this.extensionChangelogUpdates
|
|
627
|
+
.map((update) => `Updated ${update.name} to v${update.version}.`)
|
|
628
|
+
.join("\n");
|
|
629
|
+
this.chatContainer.addChild(new Text(condensedText, 1, 0));
|
|
630
|
+
}
|
|
631
|
+
else {
|
|
632
|
+
this.chatContainer.addChild(new ThemedText(() => theme.bold(theme.fg("accent", "Extension Updates")), 1, 0));
|
|
633
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
634
|
+
const markdown = this.extensionChangelogUpdates.map((update) => update.markdown).join("\n\n");
|
|
635
|
+
this.chatContainer.addChild(new Markdown(markdown, 1, 0, this.getMarkdownThemeWithSettings()));
|
|
636
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
637
|
+
}
|
|
616
638
|
}
|
|
617
639
|
this.chatContainer.addChild(new DynamicBorder());
|
|
618
640
|
}
|
|
@@ -689,20 +711,15 @@ export class InteractiveMode {
|
|
|
689
711
|
if (this.isInitialized)
|
|
690
712
|
return;
|
|
691
713
|
this.registerSignalHandlers();
|
|
692
|
-
// Load
|
|
714
|
+
// Load changelogs (only show new entries, skip for resumed sessions)
|
|
693
715
|
this.changelogMarkdown = this.getChangelogForDisplay();
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
.
|
|
701
|
-
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
702
|
-
const cycleHint = cycleKeys.length > 0
|
|
703
|
-
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
704
|
-
: "";
|
|
705
|
-
console.log(theme.fg("dim", `Model scope: ${modelList}${cycleHint}`));
|
|
716
|
+
this.extensionChangelogUpdates = this.getExtensionChangelogUpdates();
|
|
717
|
+
// Fullscreen renders on the alternate screen, so text printed to stdout here would stay in the shell
|
|
718
|
+
// after exit. Fullscreen shows the notice in the header instead (#11508).
|
|
719
|
+
if (this.renderer.mode !== "fullscreen") {
|
|
720
|
+
const modelScopeNotice = this.getModelScopeNotice();
|
|
721
|
+
if (modelScopeNotice)
|
|
722
|
+
console.log(modelScopeNotice);
|
|
706
723
|
}
|
|
707
724
|
// Keep one component tree and remount it when changing renderers.
|
|
708
725
|
this.renderWidgets(); // Initialize with default spacer
|
|
@@ -809,6 +826,8 @@ export class InteractiveMode {
|
|
|
809
826
|
this.builtInHeader = new Text("", 0, 0);
|
|
810
827
|
this.headerContainer.addChild(this.builtInHeader);
|
|
811
828
|
}
|
|
829
|
+
if (this.renderer.mode === "fullscreen")
|
|
830
|
+
this.showFullscreenModelScopeNotice();
|
|
812
831
|
this.ui.requestRender();
|
|
813
832
|
// Ensure fd and rg are available after mounting the TUI (downloads if missing, adds to PATH via getBinDir)
|
|
814
833
|
// so slow downloads do not make startup appear frozen.
|
|
@@ -870,7 +889,7 @@ export class InteractiveMode {
|
|
|
870
889
|
*/
|
|
871
890
|
async run() {
|
|
872
891
|
await this.init();
|
|
873
|
-
if (!process.env.PI_OFFLINE) {
|
|
892
|
+
if (!(process.env[ENV_OFFLINE] || process.env.PI_OFFLINE)) {
|
|
874
893
|
const controller = new AbortController();
|
|
875
894
|
const timeout = setTimeout(() => controller.abort(), 15_000);
|
|
876
895
|
void refreshModelCatalogs(this.session.modelRuntime, controller.signal)
|
|
@@ -967,7 +986,7 @@ export class InteractiveMode {
|
|
|
967
986
|
}
|
|
968
987
|
}
|
|
969
988
|
async checkForPackageUpdates() {
|
|
970
|
-
if (process.env.PI_OFFLINE) {
|
|
989
|
+
if (process.env[ENV_OFFLINE] || process.env.PI_OFFLINE) {
|
|
971
990
|
return [];
|
|
972
991
|
}
|
|
973
992
|
try {
|
|
@@ -1020,7 +1039,7 @@ export class InteractiveMode {
|
|
|
1020
1039
|
return "tmux extended-keys is off. Modified Enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.";
|
|
1021
1040
|
}
|
|
1022
1041
|
if (extendedKeysFormat === "xterm") {
|
|
1023
|
-
return "tmux extended-keys-format is xterm.
|
|
1042
|
+
return "tmux extended-keys-format is xterm. HUMAIN Code CLI works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.";
|
|
1024
1043
|
}
|
|
1025
1044
|
return undefined;
|
|
1026
1045
|
}
|
|
@@ -1050,14 +1069,66 @@ export class InteractiveMode {
|
|
|
1050
1069
|
}
|
|
1051
1070
|
return undefined;
|
|
1052
1071
|
}
|
|
1072
|
+
getExtensionChangelogUpdates() {
|
|
1073
|
+
// Skip changelog for resumed/continued sessions (already have messages)
|
|
1074
|
+
if (this.session.state.messages.length > 0) {
|
|
1075
|
+
return [];
|
|
1076
|
+
}
|
|
1077
|
+
const seenKeys = new Set();
|
|
1078
|
+
const updates = [];
|
|
1079
|
+
for (const { sourceInfo } of this.session.resourceLoader.getExtensions().extensions) {
|
|
1080
|
+
if (sourceInfo.origin !== "package" || !sourceInfo.baseDir || !sourceInfo.changelogPath) {
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
const key = getSourcePackageKey(sourceInfo);
|
|
1084
|
+
if (seenKeys.has(key)) {
|
|
1085
|
+
continue;
|
|
1086
|
+
}
|
|
1087
|
+
seenKeys.add(key);
|
|
1088
|
+
const pkg = this.readPackageJson(sourceInfo.baseDir);
|
|
1089
|
+
if (!pkg?.version) {
|
|
1090
|
+
continue;
|
|
1091
|
+
}
|
|
1092
|
+
const lastVersion = this.settingsManager.getExtensionChangelogVersion(key);
|
|
1093
|
+
if (!lastVersion) {
|
|
1094
|
+
// Fresh install - record the version, don't show changelog
|
|
1095
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1096
|
+
continue;
|
|
1097
|
+
}
|
|
1098
|
+
const newEntries = getNewEntries(parseChangelog(sourceInfo.changelogPath), lastVersion);
|
|
1099
|
+
if (newEntries.length > 0) {
|
|
1100
|
+
this.settingsManager.setExtensionChangelogVersion(key, pkg.version);
|
|
1101
|
+
const name = pkg.name || sourceInfo.source;
|
|
1102
|
+
// Prefix each "## [x.y.z]" heading with the package name so entries render like Pi's own.
|
|
1103
|
+
const markdown = newEntries
|
|
1104
|
+
.map((entry) => entry.content.replace(/^##\s+/, `## ${name} `))
|
|
1105
|
+
.join("\n\n")
|
|
1106
|
+
.trim();
|
|
1107
|
+
updates.push({ name, version: pkg.version, markdown });
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return updates;
|
|
1111
|
+
}
|
|
1112
|
+
readPackageJson(packageRoot) {
|
|
1113
|
+
try {
|
|
1114
|
+
const pkg = JSON.parse(stripBom(fs.readFileSync(path.join(packageRoot, "package.json"), "utf-8")));
|
|
1115
|
+
return {
|
|
1116
|
+
name: typeof pkg.name === "string" ? pkg.name : undefined,
|
|
1117
|
+
version: typeof pkg.version === "string" ? pkg.version : undefined,
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
catch {
|
|
1121
|
+
return undefined;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1053
1124
|
reportInstallTelemetry(version) {
|
|
1054
|
-
if (process.env.PI_OFFLINE) {
|
|
1125
|
+
if (process.env[ENV_OFFLINE] || process.env.PI_OFFLINE) {
|
|
1055
1126
|
return;
|
|
1056
1127
|
}
|
|
1057
1128
|
if (!isInstallTelemetryEnabled(this.settingsManager)) {
|
|
1058
1129
|
return;
|
|
1059
1130
|
}
|
|
1060
|
-
void fetch(
|
|
1131
|
+
void fetch(getInstallTelemetryUrl(version), {
|
|
1061
1132
|
headers: {
|
|
1062
1133
|
"User-Agent": getPiUserAgent(version),
|
|
1063
1134
|
},
|
|
@@ -1076,13 +1147,7 @@ export class InteractiveMode {
|
|
|
1076
1147
|
// Extension System
|
|
1077
1148
|
// =========================================================================
|
|
1078
1149
|
formatDisplayPath(p) {
|
|
1079
|
-
|
|
1080
|
-
let result = p;
|
|
1081
|
-
// Replace home directory with ~
|
|
1082
|
-
if (result.startsWith(home)) {
|
|
1083
|
-
result = `~${result.slice(home.length)}`;
|
|
1084
|
-
}
|
|
1085
|
-
return result;
|
|
1150
|
+
return shortenHomePath(p);
|
|
1086
1151
|
}
|
|
1087
1152
|
formatExtensionDisplayPath(path) {
|
|
1088
1153
|
let result = this.formatDisplayPath(path);
|
|
@@ -1106,6 +1171,27 @@ export class InteractiveMode {
|
|
|
1106
1171
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;
|
|
1107
1172
|
}
|
|
1108
1173
|
/** Startup details (model scope, loaded resources). Hidden by quietStartup: true or "header". */
|
|
1174
|
+
getModelScopeNotice() {
|
|
1175
|
+
if (this.session.scopedModels.length === 0 || !this.shouldShowStartupDetails())
|
|
1176
|
+
return undefined;
|
|
1177
|
+
const modelList = this.session.scopedModels
|
|
1178
|
+
.map((sm) => {
|
|
1179
|
+
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
|
1180
|
+
return `${sm.model.id}${thinkingStr}`;
|
|
1181
|
+
})
|
|
1182
|
+
.join(", ");
|
|
1183
|
+
const cycleKeys = this.keybindings.getKeys("app.model.cycleForward");
|
|
1184
|
+
const cycleHint = cycleKeys.length > 0
|
|
1185
|
+
? theme.fg("muted", ` (${formatKeyText(cycleKeys.join("/"), { capitalize: true })} to cycle)`)
|
|
1186
|
+
: "";
|
|
1187
|
+
return theme.fg("dim", `Model scope: ${modelList}${cycleHint}`);
|
|
1188
|
+
}
|
|
1189
|
+
showFullscreenModelScopeNotice() {
|
|
1190
|
+
if (!this.getModelScopeNotice())
|
|
1191
|
+
return;
|
|
1192
|
+
this.headerContainer.addChild(new ThemedText(() => this.getModelScopeNotice() ?? "", 1, 0));
|
|
1193
|
+
this.headerContainer.addChild(new Spacer(1));
|
|
1194
|
+
}
|
|
1109
1195
|
shouldShowStartupDetails() {
|
|
1110
1196
|
return this.options.verbose === true || this.settingsManager.getQuietStartup() === false;
|
|
1111
1197
|
}
|
|
@@ -1476,7 +1562,7 @@ export class InteractiveMode {
|
|
|
1476
1562
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
1477
1563
|
if (skillDiagnostics.length > 0) {
|
|
1478
1564
|
const warningLines = () => this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
1479
|
-
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill
|
|
1565
|
+
this.loadedResourcesContainer.addChild(new ThemedText(() => `${theme.fg("warning", "[Skill warnings]")}\n${warningLines()}`, 0, 0));
|
|
1480
1566
|
this.loadedResourcesContainer.addChild(new Spacer(1));
|
|
1481
1567
|
}
|
|
1482
1568
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
@@ -2275,8 +2361,12 @@ export class InteractiveMode {
|
|
|
2275
2361
|
this.editorComponentFactory = factory;
|
|
2276
2362
|
// Save text from current editor before switching
|
|
2277
2363
|
const currentText = this.editor.getText();
|
|
2278
|
-
|
|
2279
|
-
this.
|
|
2364
|
+
// An open extension dialog keeps the editor slot; the new editor is shown when the last dialog closes.
|
|
2365
|
+
const dialogOpen = this.extensionDialogs.length > 0;
|
|
2366
|
+
if (!dialogOpen) {
|
|
2367
|
+
this.disposeActiveSelector();
|
|
2368
|
+
this.editorContainer.clear();
|
|
2369
|
+
}
|
|
2280
2370
|
if (factory) {
|
|
2281
2371
|
// Create the custom editor with tui, theme, and keybindings
|
|
2282
2372
|
const newEditor = factory(this.ui, getEditorTheme(), this.keybindings);
|
|
@@ -2328,7 +2418,8 @@ export class InteractiveMode {
|
|
|
2328
2418
|
this.defaultEditor.setText(currentText);
|
|
2329
2419
|
this.editor = this.defaultEditor;
|
|
2330
2420
|
}
|
|
2331
|
-
|
|
2421
|
+
if (!dialogOpen)
|
|
2422
|
+
this.editorContainer.addChild(this.editor);
|
|
2332
2423
|
if (this.activeStatusIndicator) {
|
|
2333
2424
|
this.statusContainer.clear();
|
|
2334
2425
|
this.activeWorkingIndicatorEmbedded = this.setEditorWorkingStatusIndicator(this.activeStatusIndicator);
|
|
@@ -2336,8 +2427,10 @@ export class InteractiveMode {
|
|
|
2336
2427
|
this.statusContainer.addChild(this.activeStatusIndicator);
|
|
2337
2428
|
}
|
|
2338
2429
|
}
|
|
2339
|
-
|
|
2430
|
+
if (!dialogOpen)
|
|
2431
|
+
this.ui.setFocus(this.editor);
|
|
2340
2432
|
this.updateEditorBorderColor();
|
|
2433
|
+
this.ui.requestRender();
|
|
2341
2434
|
}
|
|
2342
2435
|
/**
|
|
2343
2436
|
* Show a notification for extensions.
|
|
@@ -2408,7 +2501,7 @@ export class InteractiveMode {
|
|
|
2408
2501
|
options?.onHandle?.(overlayHandle);
|
|
2409
2502
|
}
|
|
2410
2503
|
else {
|
|
2411
|
-
this.pushExtensionDialog(c);
|
|
2504
|
+
this.pushExtensionDialog(c, options?.blocked);
|
|
2412
2505
|
}
|
|
2413
2506
|
})
|
|
2414
2507
|
.catch((err) => {
|
|
@@ -2489,6 +2582,7 @@ export class InteractiveMode {
|
|
|
2489
2582
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
2490
2583
|
this.defaultEditor.onAction("app.editor.external", () => void this.handleOpenExternalEditor());
|
|
2491
2584
|
this.defaultEditor.onAction("app.message.copy", () => void this.handleCopyCommand({ flashConfirmation: true, preferSelection: true }));
|
|
2585
|
+
this.defaultEditor.onAction("app.block.copy", () => void this.handleCopyBlock());
|
|
2492
2586
|
this.defaultEditor.isAgentBusy = () => this.session.isStreaming || this.session.isCompacting;
|
|
2493
2587
|
this.defaultEditor.onAction("app.message.followUp", () => this.handleFollowUp());
|
|
2494
2588
|
this.defaultEditor.onAction("app.message.followUpWhileBusy", () => this.handleFollowUp());
|
|
@@ -2554,12 +2648,7 @@ export class InteractiveMode {
|
|
|
2554
2648
|
}
|
|
2555
2649
|
const image = await readClipboardImage();
|
|
2556
2650
|
if (image) {
|
|
2557
|
-
|
|
2558
|
-
const ext = extensionForImageMimeType(image.mimeType) ?? "png";
|
|
2559
|
-
const fileName = `pi-clipboard-${crypto.randomUUID()}.${ext}`;
|
|
2560
|
-
const filePath = path.join(tmpDir, fileName);
|
|
2561
|
-
fs.writeFileSync(filePath, Buffer.from(image.bytes));
|
|
2562
|
-
this.editor.insertTextAtCursor?.(filePath);
|
|
2651
|
+
this.editor.insertTextAtCursor?.(writePastedImage(image));
|
|
2563
2652
|
this.ui.requestRender();
|
|
2564
2653
|
return;
|
|
2565
2654
|
}
|
|
@@ -2903,7 +2992,7 @@ export class InteractiveMode {
|
|
|
2903
2992
|
this.ui.requestRender();
|
|
2904
2993
|
}
|
|
2905
2994
|
else if (event.message.role === "assistant") {
|
|
2906
|
-
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers());
|
|
2995
|
+
this.streamingComponent = new AssistantMessageComponent(undefined, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers(), () => this.ui.requestRender());
|
|
2907
2996
|
this.streamingMessage = event.message;
|
|
2908
2997
|
this.chatContainer.addChild(this.streamingComponent);
|
|
2909
2998
|
this.streamingComponent.updateContent(this.streamingMessage, true);
|
|
@@ -2931,8 +3020,8 @@ export class InteractiveMode {
|
|
|
2931
3020
|
}
|
|
2932
3021
|
else {
|
|
2933
3022
|
const component = this.pendingTools.get(content.id);
|
|
2934
|
-
|
|
2935
|
-
|
|
3023
|
+
// Existing rows request their own render when arguments change.
|
|
3024
|
+
component?.updateArgs(content.arguments);
|
|
2936
3025
|
}
|
|
2937
3026
|
}
|
|
2938
3027
|
}
|
|
@@ -3317,12 +3406,12 @@ export class InteractiveMode {
|
|
|
3317
3406
|
// Render user message separately if present
|
|
3318
3407
|
if (skillBlock.userMessage) {
|
|
3319
3408
|
this.chatContainer.addChild(new Spacer(1));
|
|
3320
|
-
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3409
|
+
const userComponent = new UserMessageComponent(skillBlock.userMessage, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3321
3410
|
this.chatContainer.addChild(userComponent);
|
|
3322
3411
|
}
|
|
3323
3412
|
}
|
|
3324
3413
|
else {
|
|
3325
|
-
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers());
|
|
3414
|
+
const userComponent = new UserMessageComponent(textContent, this.getMarkdownThemeWithSettings(), this.outputPad, this.getMarkdownTransformers(), options?.messageId, options?.timestamp);
|
|
3326
3415
|
this.chatContainer.addChild(userComponent);
|
|
3327
3416
|
}
|
|
3328
3417
|
if (options?.populateHistory) {
|
|
@@ -3332,7 +3421,7 @@ export class InteractiveMode {
|
|
|
3332
3421
|
break;
|
|
3333
3422
|
}
|
|
3334
3423
|
case "assistant": {
|
|
3335
|
-
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers());
|
|
3424
|
+
const assistantComponent = new AssistantMessageComponent(message, this.hideThinkingBlock, this.getMarkdownThemeWithSettings(), this.hiddenThinkingLabel, this.outputPad, this.getMarkdownTransformers(), () => this.ui.requestRender(), options?.messageId, options?.timestamp);
|
|
3336
3425
|
this.chatContainer.addChild(assistantComponent);
|
|
3337
3426
|
break;
|
|
3338
3427
|
}
|
|
@@ -3345,7 +3434,7 @@ export class InteractiveMode {
|
|
|
3345
3434
|
}
|
|
3346
3435
|
}
|
|
3347
3436
|
}
|
|
3348
|
-
renderSessionItems(items, options = {}) {
|
|
3437
|
+
renderSessionItems(items, messageMeta, options = {}) {
|
|
3349
3438
|
this.pendingTools.clear();
|
|
3350
3439
|
const renderedPendingTools = new Map();
|
|
3351
3440
|
// Cache misses are not persisted, unlike successful cache-warming usage.
|
|
@@ -3373,7 +3462,11 @@ export class InteractiveMode {
|
|
|
3373
3462
|
const message = item;
|
|
3374
3463
|
// Assistant messages need special handling for tool calls
|
|
3375
3464
|
if (message.role === "assistant") {
|
|
3376
|
-
|
|
3465
|
+
const meta = messageMeta?.get(message);
|
|
3466
|
+
this.addMessageToChat(message, {
|
|
3467
|
+
messageId: meta?.id,
|
|
3468
|
+
timestamp: meta?.timestamp,
|
|
3469
|
+
});
|
|
3377
3470
|
// Render tool call components
|
|
3378
3471
|
for (const content of message.content) {
|
|
3379
3472
|
if (content.type === "toolCall") {
|
|
@@ -3419,7 +3512,12 @@ export class InteractiveMode {
|
|
|
3419
3512
|
}
|
|
3420
3513
|
else {
|
|
3421
3514
|
// All other messages use standard rendering
|
|
3422
|
-
|
|
3515
|
+
const meta = messageMeta?.get(message);
|
|
3516
|
+
this.addMessageToChat(message, {
|
|
3517
|
+
...options,
|
|
3518
|
+
messageId: meta?.id,
|
|
3519
|
+
timestamp: meta?.timestamp,
|
|
3520
|
+
});
|
|
3423
3521
|
}
|
|
3424
3522
|
}
|
|
3425
3523
|
for (const [toolCallId, component] of renderedPendingTools) {
|
|
@@ -3437,17 +3535,21 @@ export class InteractiveMode {
|
|
|
3437
3535
|
// Selection coordinates point into the transcript being replaced (#9311).
|
|
3438
3536
|
if (this.renderer instanceof TuiAltScreen)
|
|
3439
3537
|
this.renderer.resetTextSelection();
|
|
3538
|
+
const messageMeta = new Map();
|
|
3440
3539
|
const items = entries.flatMap((entry) => {
|
|
3441
3540
|
if (entry.type === "custom" || (entry.type === "usage" && entry.kind === "cache_warm")) {
|
|
3442
3541
|
return [entry];
|
|
3443
3542
|
}
|
|
3444
3543
|
const messages = sessionEntryToContextMessages(entry);
|
|
3544
|
+
for (const msg of messages) {
|
|
3545
|
+
messageMeta.set(msg, { id: entry.id, timestamp: entry.timestamp });
|
|
3546
|
+
}
|
|
3445
3547
|
if ((entry.type === "compaction" || entry.type === "branch_summary") && entry.usage && messages.length > 0) {
|
|
3446
3548
|
return [...messages, { type: "compaction_cost", kind: entry.type, usage: entry.usage }];
|
|
3447
3549
|
}
|
|
3448
3550
|
return messages;
|
|
3449
3551
|
});
|
|
3450
|
-
this.renderSessionItems(items, options);
|
|
3552
|
+
this.renderSessionItems(items, messageMeta, options);
|
|
3451
3553
|
}
|
|
3452
3554
|
addCacheWarmingUsage(entry) {
|
|
3453
3555
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
@@ -3931,6 +4033,9 @@ export class InteractiveMode {
|
|
|
3931
4033
|
if (result.status === "complete") {
|
|
3932
4034
|
this.editor.setText(result.content);
|
|
3933
4035
|
}
|
|
4036
|
+
else {
|
|
4037
|
+
this.showStatus(result.message);
|
|
4038
|
+
}
|
|
3934
4039
|
}
|
|
3935
4040
|
finally {
|
|
3936
4041
|
this.ui.start();
|
|
@@ -3957,7 +4062,7 @@ export class InteractiveMode {
|
|
|
3957
4062
|
showNewVersionNotification(release) {
|
|
3958
4063
|
const updateInstruction = () => theme.fg("muted", `New version ${release.version} is available. Run `) +
|
|
3959
4064
|
theme.fg("accent", `${APP_COMMAND} update`);
|
|
3960
|
-
const changelogUrl =
|
|
4065
|
+
const changelogUrl = getChangelogUrl();
|
|
3961
4066
|
const changelogLine = () => {
|
|
3962
4067
|
const changelogLink = getCapabilities().hyperlinks
|
|
3963
4068
|
? hyperlink(theme.fg("accent", changelogUrl), changelogUrl)
|
|
@@ -5390,6 +5495,7 @@ export class InteractiveMode {
|
|
|
5390
5495
|
for (const account of accounts)
|
|
5391
5496
|
labelCounts.set(account.label, (labelCounts.get(account.label) ?? 0) + 1);
|
|
5392
5497
|
const isCodex = provider.id === CODEX_USAGE_PROVIDER_ID;
|
|
5498
|
+
const hasSubscriptionUsage = isCodex || provider.id === ANTHROPIC_USAGE_PROVIDER_ID;
|
|
5393
5499
|
const accountLabel = (account) => {
|
|
5394
5500
|
const auth = runtime.getProvider(provider.id)?.auth;
|
|
5395
5501
|
const subscription = account.type === "oauth" ? auth?.oauth?.isSubscription : auth?.apiKey?.isSubscription;
|
|
@@ -5406,7 +5512,7 @@ export class InteractiveMode {
|
|
|
5406
5512
|
const label = (labelCounts.get(account.label) ?? 0) > 1 ? `${account.label} [${account.key}]` : account.label;
|
|
5407
5513
|
return `${label} (${markers.join(", ")})`;
|
|
5408
5514
|
};
|
|
5409
|
-
const usageStates = accounts.map((account) =>
|
|
5515
|
+
const usageStates = accounts.map((account) => hasSubscriptionUsage && account.type === "oauth" ? { kind: "loading" } : { kind: "none" });
|
|
5410
5516
|
const sourceOptions = sources.map((source) => `${source.label} [read-only] (${source.effective ? "effective" : "shadowed"})`);
|
|
5411
5517
|
const addAccountOption = "Add another account…";
|
|
5412
5518
|
const policyOption = "Provider policy…";
|
|
@@ -5459,30 +5565,53 @@ export class InteractiveMode {
|
|
|
5459
5565
|
});
|
|
5460
5566
|
const controller = new AbortController();
|
|
5461
5567
|
let closed = false;
|
|
5462
|
-
if (
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5568
|
+
if (hasSubscriptionUsage) {
|
|
5569
|
+
const subscriptionAccounts = accounts.filter((account) => account.type === "oauth");
|
|
5570
|
+
let nextIndex = 0;
|
|
5571
|
+
const worker = async () => {
|
|
5572
|
+
while (!closed && nextIndex < subscriptionAccounts.length) {
|
|
5573
|
+
const account = subscriptionAccounts[nextIndex++];
|
|
5574
|
+
const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(10_000)]);
|
|
5575
|
+
let result;
|
|
5576
|
+
try {
|
|
5577
|
+
const registry = this.session.extensionRunner.getModelRegistry();
|
|
5578
|
+
const options = { accountKey: account.key, signal };
|
|
5579
|
+
result = await (isCodex ? registry.getCodexUsage(options) : registry.getAnthropicUsage(options));
|
|
5580
|
+
}
|
|
5581
|
+
catch {
|
|
5582
|
+
// Account removal or lookup failure must not hide other accounts or expose backend errors.
|
|
5583
|
+
}
|
|
5467
5584
|
if (closed)
|
|
5468
5585
|
return;
|
|
5469
|
-
const index = accounts.
|
|
5470
|
-
|
|
5586
|
+
const index = accounts.indexOf(account);
|
|
5587
|
+
const observed = usageAccounts.find((entry) => entry.key === account.key);
|
|
5588
|
+
// Preserve /accounts quota recovery; a credit balance alone never clears a cached denial.
|
|
5589
|
+
if (isCodex &&
|
|
5590
|
+
observed?.exhaustedUntil !== undefined &&
|
|
5591
|
+
result?.status === "ok" &&
|
|
5592
|
+
"usage" in result &&
|
|
5593
|
+
result.usage &&
|
|
5594
|
+
getCodexAvailability(result.usage) === "allowed") {
|
|
5595
|
+
try {
|
|
5596
|
+
if (await pool.clearExhaustion(provider.id, observed, { signal }))
|
|
5597
|
+
account.exhaustedUntil = undefined;
|
|
5598
|
+
}
|
|
5599
|
+
catch {
|
|
5600
|
+
// Failed reconciliation must not discard real usage or claim the cooldown was cleared.
|
|
5601
|
+
}
|
|
5602
|
+
}
|
|
5603
|
+
if (closed)
|
|
5471
5604
|
return;
|
|
5472
|
-
|
|
5473
|
-
accounts[index].exhaustedUntil = undefined;
|
|
5474
|
-
usageStates[index] =
|
|
5475
|
-
result.status === "ok"
|
|
5476
|
-
? { kind: "available", ...result.usage }
|
|
5477
|
-
: { kind: "unavailable", reason: result.reason };
|
|
5605
|
+
usageStates[index] = { kind: "subscription", result };
|
|
5478
5606
|
currentOptions = [
|
|
5479
|
-
...accounts.map((
|
|
5607
|
+
...accounts.map((entry, accountIndex) => formatOAuthAccountOption(accountLabel(entry), usageStates[accountIndex])),
|
|
5480
5608
|
...extraOptions,
|
|
5481
5609
|
];
|
|
5482
5610
|
selector.setOptions(currentOptions);
|
|
5483
5611
|
this.ui.requestRender();
|
|
5484
|
-
}
|
|
5485
|
-
}
|
|
5612
|
+
}
|
|
5613
|
+
};
|
|
5614
|
+
void Promise.all(Array.from({ length: Math.min(3, subscriptionAccounts.length) }, worker)).catch(() => { });
|
|
5486
5615
|
}
|
|
5487
5616
|
return {
|
|
5488
5617
|
component: selector,
|
|
@@ -6340,6 +6469,51 @@ export class InteractiveMode {
|
|
|
6340
6469
|
showError: (message) => this.showError(message),
|
|
6341
6470
|
}, hint);
|
|
6342
6471
|
}
|
|
6472
|
+
async handleCopyBlock() {
|
|
6473
|
+
const blocks = this.chatContainer.children
|
|
6474
|
+
.filter((component) => component instanceof AssistantMessageComponent)
|
|
6475
|
+
.flatMap((component) => component.getCodeBlocks())
|
|
6476
|
+
.reverse();
|
|
6477
|
+
if (blocks.length === 0) {
|
|
6478
|
+
this.showStatus("No assistant blocks to copy yet.");
|
|
6479
|
+
return;
|
|
6480
|
+
}
|
|
6481
|
+
const chosen = blocks.length === 1
|
|
6482
|
+
? 0
|
|
6483
|
+
: await new Promise((resolve) => {
|
|
6484
|
+
this.showSelector((done) => {
|
|
6485
|
+
const list = new TuiLayouts.SelectList(blocks.map((block, index) => ({
|
|
6486
|
+
value: String(index),
|
|
6487
|
+
label: `${index + 1}. ${block.language}`,
|
|
6488
|
+
description: TuiLayouts.stripTerminalSequences(block.text)
|
|
6489
|
+
.replace(/\p{Cc}/gu, " ")
|
|
6490
|
+
.replace(/\s+/g, " ")
|
|
6491
|
+
.trim()
|
|
6492
|
+
.slice(0, 80),
|
|
6493
|
+
})), Math.max(1, Math.min(8, this.ui.terminal.rows - 6)), getSelectListTheme());
|
|
6494
|
+
const finish = (index) => {
|
|
6495
|
+
resolve(index);
|
|
6496
|
+
done();
|
|
6497
|
+
this.ui.requestRender();
|
|
6498
|
+
};
|
|
6499
|
+
list.onSelect = (item) => finish(Number(item.value));
|
|
6500
|
+
list.onCancel = () => finish(undefined);
|
|
6501
|
+
const component = new Container();
|
|
6502
|
+
component.addChild(new Text("Copy assistant block (newest first)", 0, 0));
|
|
6503
|
+
component.addChild(new Text(`${keyHint("tui.select.confirm", "copy")} · ${keyHint("tui.select.cancel", "cancel")}`, 0, 0));
|
|
6504
|
+
component.addChild(new Spacer(1));
|
|
6505
|
+
component.addChild(list);
|
|
6506
|
+
return { component, focus: list, dispose: () => resolve(undefined) };
|
|
6507
|
+
});
|
|
6508
|
+
});
|
|
6509
|
+
if (chosen === undefined)
|
|
6510
|
+
return;
|
|
6511
|
+
const copied = await blocks[chosen]?.copy();
|
|
6512
|
+
if (copied === true)
|
|
6513
|
+
this.showStatus("Copied assistant block");
|
|
6514
|
+
else if (typeof copied === "string")
|
|
6515
|
+
this.showError(`Copy failed: ${copied}`);
|
|
6516
|
+
}
|
|
6343
6517
|
async handleCopyCommand(options = {}) {
|
|
6344
6518
|
if (options.preferSelection &&
|
|
6345
6519
|
this.ui instanceof TuiAltScreen &&
|
|
@@ -6531,6 +6705,7 @@ export class InteractiveMode {
|
|
|
6531
6705
|
const externalEditor = this.getAppKeyDisplay("app.editor.external");
|
|
6532
6706
|
const cycleModelBackward = this.getAppKeyDisplay("app.model.cycleBackward");
|
|
6533
6707
|
const copyMessage = this.getAppKeyDisplay("app.message.copy");
|
|
6708
|
+
const copyBlock = this.getAppKeyDisplay("app.block.copy");
|
|
6534
6709
|
const followUp = this.getAppKeyDisplay("app.message.followUp");
|
|
6535
6710
|
const followUpWhileBusy = this.getAppKeyDisplay("app.message.followUpWhileBusy");
|
|
6536
6711
|
const dequeue = this.getAppKeyDisplay("app.message.dequeue");
|
|
@@ -6575,6 +6750,7 @@ export class InteractiveMode {
|
|
|
6575
6750
|
| \`${toggleThinking}\` | Toggle thinking block visibility |
|
|
6576
6751
|
| \`${externalEditor}\` | Edit message in external editor |
|
|
6577
6752
|
| \`${copyMessage}\` | Copy selection or last assistant message |
|
|
6753
|
+
| \`${copyBlock}\` | Choose an assistant fenced block to copy |
|
|
6578
6754
|
| \`${followUp}\` | Queue follow-up message |
|
|
6579
6755
|
| \`${followUpWhileBusy}\` | Queue follow-up while busy (non-empty draft; autocomplete first) |
|
|
6580
6756
|
| \`${dequeue}\` | Restore queued messages |
|