@humain/terminal 0.0.6 → 0.0.7
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 +52 -0
- package/README.md +10 -4
- package/dist/bundle/chunks/anthropic-messages-GDMGYAZB.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-ZN52D6YC.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +77 -0
- package/dist/bundle/chunks/chunk-3D3G2X5U.js +6 -0
- package/dist/bundle/chunks/chunk-3VI4HD7D.js +31 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-72KO4OMP.js +2 -0
- package/dist/bundle/chunks/chunk-7DDKXS2Q.js +2 -0
- package/dist/bundle/chunks/chunk-ARF4OE6X.js +105 -0
- package/dist/bundle/chunks/chunk-BOW22LW6.js +42 -0
- package/dist/bundle/chunks/chunk-BZQ53VGE.js +70 -0
- package/dist/bundle/chunks/chunk-CBHC6EL7.js +133 -0
- package/dist/bundle/chunks/chunk-D7XAASZM.js +4 -0
- package/dist/bundle/chunks/chunk-ECWELYBH.js +17 -0
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
- package/dist/bundle/chunks/chunk-H2O6VOXT.js +11 -0
- package/dist/bundle/chunks/chunk-HNVPY4LZ.js +5995 -0
- package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
- package/dist/bundle/chunks/chunk-JXWJOIH4.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-LVVZS2NO.js +12 -0
- package/dist/bundle/chunks/chunk-M2GYSCCG.js +44 -0
- package/dist/bundle/chunks/chunk-MA4UUCYX.js +18 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-SGTGQNNP.js +4 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TXBQIIIO.js +2 -0
- package/dist/bundle/chunks/chunk-WJZ4KLGL.js +2 -0
- package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
- package/dist/bundle/chunks/dist-7DSXV2TY.js +9 -0
- package/dist/bundle/chunks/dist-BXEVYJIO.js +7 -0
- package/dist/bundle/chunks/es-P2KNSZYR.js +9 -0
- package/dist/bundle/chunks/es5-FGTJ7ZFW.js +2 -0
- package/dist/bundle/chunks/event-streams-JOSQQSII.js +2 -0
- package/dist/bundle/chunks/extract-2L7ZVN7F.js +106 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-XT7NQJ2E.js +2 -0
- package/dist/bundle/chunks/google-vertex-IDQ6Z53W.js +2 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/mistral-conversations-HHDZ4FHR.js +5 -0
- package/dist/bundle/chunks/multipart-parser-FMGQ7342.js +3 -0
- package/dist/bundle/chunks/node-XY3CBY3C.js +294 -0
- package/dist/bundle/chunks/node-ZHY4LHC7.js +15 -0
- package/dist/bundle/chunks/openai-codex-responses-HRVCDY54.js +8 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-6QBYTBXY.js +7 -0
- package/dist/bundle/chunks/openai-responses-4MWLJHIK.js +2 -0
- package/dist/bundle/chunks/openrouter-images-Y2PCWAQH.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pdfjs-UKQT3OWY.js +107 -0
- package/dist/bundle/chunks/pi-messages-57K43J6J.js +8 -0
- package/dist/bundle/chunks/promise-J5TGSM32.js +2 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-QKGKDFSU.js +4 -0
- package/dist/bundle/chunks/undici-D6ABF53Q.js +2 -0
- package/dist/bundle/chunks/webapi-AFS5FDJJ.js +5 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/client.js +2 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +29 -9
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +19 -11
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +50 -14
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +163 -95
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +6 -7
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +3 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +4 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +41 -32
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js +9 -0
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +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 +115 -48
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +38 -9
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +3 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +20 -19
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +26 -5
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +14 -8
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +22 -14
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +2 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +10 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +4 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +32 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +2 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +9 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +51 -10
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +51 -33
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +16 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +62 -29
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +0 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +2 -5
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +20 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/index.d.ts +4 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +19 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +4 -1
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +2 -1
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +2 -0
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -2
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/humain/agent-execution-protocol.d.ts +1 -217
- package/dist/humain/agent-execution-protocol.d.ts.map +1 -1
- package/dist/humain/agent-execution-protocol.js +1 -203
- package/dist/humain/agent-execution-protocol.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +107 -16
- package/dist/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
- package/dist/humain/mcp-adapter/vendor/README.md +47 -15
- package/dist/humain/mcp-adapter/vendor/cli.js +4 -4
- package/dist/humain/mcp-adapter/vendor/commands.ts +5 -3
- package/dist/humain/mcp-adapter/vendor/config.ts +46 -5
- package/dist/humain/mcp-adapter/vendor/direct-tools.ts +103 -92
- package/dist/humain/mcp-adapter/vendor/dist/agent-dir.d.ts +10 -0
- package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js +63 -0
- package/dist/humain/mcp-adapter/vendor/dist/agent-dir.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.d.ts +8 -0
- package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js +356 -0
- package/dist/humain/mcp-adapter/vendor/dist/agent-plugin-loader.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/config.d.ts +123 -0
- package/dist/humain/mcp-adapter/vendor/dist/config.js +1088 -0
- package/dist/humain/mcp-adapter/vendor/dist/config.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.d.ts +24 -0
- package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js +336 -0
- package/dist/humain/mcp-adapter/vendor/dist/mcp-bearer-store.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.d.ts +19 -0
- package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js +319 -0
- package/dist/humain/mcp-adapter/vendor/dist/metadata-cache.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.d.ts +2 -0
- package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js +156 -0
- package/dist/humain/mcp-adapter/vendor/dist/package-mcp-loader.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/resource-tools.d.ts +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js +15 -0
- package/dist/humain/mcp-adapter/vendor/dist/resource-tools.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/types.d.ts +566 -0
- package/dist/humain/mcp-adapter/vendor/dist/types.js +287 -0
- package/dist/humain/mcp-adapter/vendor/dist/types.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.d.ts +6 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js +37 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-app-bridge-helpers.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.d.ts +104 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js +59 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-stream-types.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.d.ts +4 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js +27 -0
- package/dist/humain/mcp-adapter/vendor/dist/ui-tool-visibility.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/dist/utils.d.ts +32 -0
- package/dist/humain/mcp-adapter/vendor/dist/utils.js +338 -0
- package/dist/humain/mcp-adapter/vendor/dist/utils.js.map +1 -0
- package/dist/humain/mcp-adapter/vendor/failure-backoff.ts +23 -0
- package/dist/humain/mcp-adapter/vendor/index.bundle.mjs +4870 -3878
- package/dist/humain/mcp-adapter/vendor/index.ts +294 -88
- package/dist/humain/mcp-adapter/vendor/init.ts +41 -30
- package/dist/humain/mcp-adapter/vendor/lifecycle.ts +16 -8
- package/dist/humain/mcp-adapter/vendor/mcp-auth-flow.ts +124 -32
- package/dist/humain/mcp-adapter/vendor/mcp-bearer-store.ts +0 -2
- package/dist/humain/mcp-adapter/vendor/mcp-code.ts +2 -0
- package/dist/humain/mcp-adapter/vendor/mcp-oauth-provider.ts +155 -16
- package/dist/humain/mcp-adapter/vendor/mcp-output-guard.ts +95 -7
- package/dist/humain/mcp-adapter/vendor/mcp-probe.ts +18 -4
- package/dist/humain/mcp-adapter/vendor/mcp-references.ts +376 -0
- package/dist/humain/mcp-adapter/vendor/mcp-status.ts +8 -19
- package/dist/humain/mcp-adapter/vendor/metadata-cache.ts +20 -12
- package/dist/humain/mcp-adapter/vendor/namespace-tools.ts +276 -0
- package/dist/humain/mcp-adapter/vendor/package.json +26 -8
- package/dist/humain/mcp-adapter/vendor/proxy-modes.ts +128 -32
- package/dist/humain/mcp-adapter/vendor/request-headers-command.ts +1 -1
- package/dist/humain/mcp-adapter/vendor/search-ranking.ts +2 -0
- package/dist/humain/mcp-adapter/vendor/server-manager.ts +69 -12
- package/dist/humain/mcp-adapter/vendor/state.ts +1 -3
- package/dist/humain/mcp-adapter/vendor/tool-result-renderer.ts +16 -2
- package/dist/humain/mcp-adapter/vendor/types.ts +51 -2
- package/dist/humain/mcp-adapter/vendor/ui-server.ts +3 -19
- package/dist/humain/mcp-adapter/vendor/ui-session.ts +2 -1
- package/dist/humain/mcp-adapter/vendor/utils.ts +21 -19
- package/dist/humain/mcp-adapter.d.ts.map +1 -1
- package/dist/humain/mcp-adapter.js +4 -0
- package/dist/humain/mcp-adapter.js.map +1 -1
- package/dist/humain/web-access/vendor/chrome-cookies.d.ts +14 -0
- package/dist/humain/web-access/vendor/chrome-cookies.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/chrome-cookies.js +85 -33
- package/dist/humain/web-access/vendor/chrome-cookies.js.map +1 -1
- package/dist/humain/web-access/vendor/credential-source.d.ts +1 -1
- package/dist/humain/web-access/vendor/credential-source.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/credential-source.js +3 -1
- package/dist/humain/web-access/vendor/credential-source.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.d.ts +2 -29
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +10 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts +2 -29
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +4 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts +11 -0
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +163 -20
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -0
- package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.js +11 -0
- package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-adc.d.ts +10 -0
- package/dist/humain/web-access/vendor/gemini-adc.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/gemini-adc.js +268 -0
- package/dist/humain/web-access/vendor/gemini-adc.js.map +1 -0
- package/dist/humain/web-access/vendor/gemini-api.d.ts +7 -1
- package/dist/humain/web-access/vendor/gemini-api.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-api.js +51 -15
- package/dist/humain/web-access/vendor/gemini-api.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.d.ts +9 -4
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +63 -21
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-url-context.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-url-context.js +3 -2
- package/dist/humain/web-access/vendor/gemini-url-context.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-web-config.d.ts +8 -1
- package/dist/humain/web-access/vendor/gemini-web-config.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-web-config.js +49 -4
- package/dist/humain/web-access/vendor/gemini-web-config.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-web.d.ts +2 -1
- package/dist/humain/web-access/vendor/gemini-web.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-web.js +8 -3
- package/dist/humain/web-access/vendor/gemini-web.js.map +1 -1
- package/dist/humain/web-access/vendor/github-api.d.ts +1 -1
- package/dist/humain/web-access/vendor/github-api.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/github-api.js +6 -4
- 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 +50 -3
- package/dist/humain/web-access/vendor/github-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/github-issue-pr.d.ts +27 -0
- package/dist/humain/web-access/vendor/github-issue-pr.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/github-issue-pr.js +701 -0
- package/dist/humain/web-access/vendor/github-issue-pr.js.map +1 -0
- package/dist/humain/web-access/vendor/index.d.ts +3 -31
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +643 -530
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/kimi-search.d.ts +5 -0
- package/dist/humain/web-access/vendor/kimi-search.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/kimi-search.js +228 -0
- package/dist/humain/web-access/vendor/kimi-search.js.map +1 -0
- package/dist/humain/web-access/vendor/openai-search.d.ts +3 -0
- package/dist/humain/web-access/vendor/openai-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/openai-search.js +89 -16
- package/dist/humain/web-access/vendor/openai-search.js.map +1 -1
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +56 -8
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js +6 -1
- package/dist/humain/web-access/vendor/ssrf-protection.js.map +1 -1
- package/dist/humain/web-access/vendor/utils.d.ts +12 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +343 -1
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/xcrawl.d.ts +4 -0
- package/dist/humain/web-access/vendor/xcrawl.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/xcrawl.js +251 -0
- package/dist/humain/web-access/vendor/xcrawl.js.map +1 -0
- package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
- package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -14
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +4 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +9 -3
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +53 -10
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +7 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +118 -55
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +151 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +68 -17
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +176 -106
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts +16 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -0
- package/dist/modes/interactive/session-share.js +188 -0
- package/dist/modes/interactive/session-share.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +6 -5
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +16 -13
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +20 -6
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +3 -2
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -7
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +189 -3
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/changelog.d.ts +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +12 -2
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/management-http.d.ts +5 -3
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js +14 -10
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +17 -5
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +1 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +64 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/version-check.js +4 -4
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +15 -0
- package/docs/custom-provider.md +5 -2
- package/docs/environment-variables.md +7 -7
- package/docs/extensions.md +17 -7
- package/docs/json.md +7 -2
- package/docs/keybindings.md +8 -8
- package/docs/llama-cpp.md +2 -0
- package/docs/models.md +8 -2
- package/docs/packages.md +2 -2
- package/docs/rpc.md +9 -3
- package/docs/sdk.md +7 -2
- package/docs/settings.md +11 -3
- package/docs/skills.md +3 -2
- package/docs/terminal-setup.md +8 -0
- package/docs/usage.md +10 -7
- package/docs/windows.md +15 -1
- package/examples/extensions/border-status-editor.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +70 -8
- package/examples/extensions/custom-provider-anthropic/package.json +2 -2
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/git-checkpoint.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/notify.ts +3 -1
- package/examples/extensions/sandbox/package-lock.json +14 -40
- package/examples/extensions/sandbox/package.json +2 -2
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +4 -4
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +293 -221
- package/package.json +21 -18
- package/src/humain/mcp-adapter/UPSTREAM.md +15 -5
- package/src/humain/mcp-adapter/upstream.json +4 -3
- package/src/humain/mcp-adapter/vendor/CHANGELOG.md +82 -0
- package/src/humain/web-access/UPSTREAM.md +1 -1
- package/src/humain/web-access/upstream.json +6 -4
|
@@ -9,11 +9,12 @@ import * as path from "node:path";
|
|
|
9
9
|
import * as TuiLayouts from "@earendil-works/pi-tui";
|
|
10
10
|
import { CombinedAutocompleteProvider, Container, fuzzyFilter, getCapabilities, hyperlink, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TuiAltScreen, TuiMainScreen, visibleWidth, } from "@earendil-works/pi-tui";
|
|
11
11
|
import chalk from "chalk";
|
|
12
|
-
import { spawn
|
|
13
|
-
import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath,
|
|
12
|
+
import { spawn } from "child_process";
|
|
13
|
+
import { APP_NAME, APP_TITLE, CONFIG_DIR_NAME, getAgentDir, getAuthPath, getDebugLogPath, getDocsPath, VERSION, } from "../../config.js";
|
|
14
14
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
15
15
|
import { SessionImportFileNotFoundError } from "../../core/agent-session-runtime.js";
|
|
16
16
|
import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, } from "../../core/cache-stats.js";
|
|
17
|
+
import { DEFAULT_THINKING_LEVEL, THINKING_LEVEL_OPTIONS } from "../../core/defaults.js";
|
|
17
18
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
18
19
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
19
20
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
@@ -35,12 +36,12 @@ import { openBrowser } from "../../utils/open-browser.js";
|
|
|
35
36
|
import { getCwdRelativePath } from "../../utils/paths.js";
|
|
36
37
|
import { getPiUserAgent } from "../../utils/pi-user-agent.js";
|
|
37
38
|
import { killTrackedDetachedChildren } from "../../utils/shell.js";
|
|
39
|
+
import { loadAllHighlightLanguages } from "../../utils/syntax-highlight.js";
|
|
38
40
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
39
41
|
import { checkForNewPiVersion } from "../../utils/version-check.js";
|
|
40
42
|
import { ArminComponent } from "./components/armin.js";
|
|
41
43
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
42
44
|
import { BashExecutionComponent } from "./components/bash-execution.js";
|
|
43
|
-
import { BorderedLoader } from "./components/bordered-loader.js";
|
|
44
45
|
import { BranchSummaryMessageComponent } from "./components/branch-summary-message.js";
|
|
45
46
|
import { CompactionSummaryMessageComponent } from "./components/compaction-summary-message.js";
|
|
46
47
|
import { CustomEditor } from "./components/custom-editor.js";
|
|
@@ -63,6 +64,7 @@ import { SessionSelectorComponent } from "./components/session-selector.js";
|
|
|
63
64
|
import { SettingsSelectorComponent } from "./components/settings-selector.js";
|
|
64
65
|
import { SkillInvocationMessageComponent } from "./components/skill-invocation-message.js";
|
|
65
66
|
import { BranchSummaryStatusIndicator, CompactionStatusIndicator, IdleStatus, RetryStatusIndicator, WorkingStatusIndicator, } from "./components/status-indicator.js";
|
|
67
|
+
import { ThinkingSelectorComponent } from "./components/thinking-selector.js";
|
|
66
68
|
import { ToolExecutionComponent } from "./components/tool-execution.js";
|
|
67
69
|
import { TreeSelectorComponent } from "./components/tree-selector.js";
|
|
68
70
|
import { TrustSelectorComponent } from "./components/trust-selector.js";
|
|
@@ -71,6 +73,7 @@ import { UserMessageSelectorComponent } from "./components/user-message-selector
|
|
|
71
73
|
import { editInExternalEditor } from "./external-editor.js";
|
|
72
74
|
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
73
75
|
import { getModelSearchText } from "./model-search.js";
|
|
76
|
+
import { shareSession } from "./session-share.js";
|
|
74
77
|
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
75
78
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
76
79
|
function isExpandable(obj) {
|
|
@@ -89,6 +92,9 @@ class ExpandableText extends Text {
|
|
|
89
92
|
function isCustomSessionEntry(item) {
|
|
90
93
|
return "type" in item && item.type === "custom";
|
|
91
94
|
}
|
|
95
|
+
function isCompactionCostNotice(item) {
|
|
96
|
+
return "type" in item && item.type === "compaction_cost";
|
|
97
|
+
}
|
|
92
98
|
const DEAD_TERMINAL_ERROR_CODES = new Set(["EIO", "EPIPE", "ENOTCONN"]);
|
|
93
99
|
function isDeadTerminalError(error) {
|
|
94
100
|
if (!error || typeof error !== "object" || !("code" in error)) {
|
|
@@ -128,6 +134,11 @@ export function formatResumeCommand(sessionManager) {
|
|
|
128
134
|
function hasDefaultModelProvider(providerId) {
|
|
129
135
|
return providerId in defaultModelPerProvider;
|
|
130
136
|
}
|
|
137
|
+
function llamaCppPostLoginGuidance(actionLabel, loadedModelCount) {
|
|
138
|
+
return loadedModelCount === 0
|
|
139
|
+
? `${actionLabel}. No llama.cpp models are loaded. Use /llama to load a model, then /model to select it.`
|
|
140
|
+
: `${actionLabel}. Use /model to select a loaded llama.cpp model, or /llama to manage models.`;
|
|
141
|
+
}
|
|
131
142
|
const AUTH_TYPE_ORDER = { oauth: 0, api_key: 1 };
|
|
132
143
|
function createFuzzyAutocompleteItems(items, prefix, getSearchText, toAutocompleteItem) {
|
|
133
144
|
const filtered = fuzzyFilter(items, prefix, getSearchText);
|
|
@@ -430,6 +441,15 @@ export class InteractiveMode {
|
|
|
430
441
|
}));
|
|
431
442
|
};
|
|
432
443
|
}
|
|
444
|
+
const thinkingCommand = slashCommands.find((command) => command.name === "thinking");
|
|
445
|
+
if (thinkingCommand) {
|
|
446
|
+
thinkingCommand.getArgumentCompletions = (prefix) => {
|
|
447
|
+
return createFuzzyAutocompleteItems(this.session.getAvailableThinkingLevels(), prefix, (level) => level, (level) => ({
|
|
448
|
+
value: level,
|
|
449
|
+
label: level,
|
|
450
|
+
}));
|
|
451
|
+
};
|
|
452
|
+
}
|
|
433
453
|
const loginCommand = slashCommands.find((command) => command.name === "login");
|
|
434
454
|
if (loginCommand) {
|
|
435
455
|
loginCommand.getArgumentCompletions = (prefix) => {
|
|
@@ -714,6 +734,14 @@ export class InteractiveMode {
|
|
|
714
734
|
});
|
|
715
735
|
// Initialize available provider count for footer display
|
|
716
736
|
await this.updateAvailableProviderCount();
|
|
737
|
+
// Flush the completed startup state before loading the remaining syntax grammars.
|
|
738
|
+
this.ui.renderNow();
|
|
739
|
+
void loadAllHighlightLanguages().then(() => {
|
|
740
|
+
if (!this.isInitialized)
|
|
741
|
+
return;
|
|
742
|
+
this.ui.invalidate();
|
|
743
|
+
this.ui.requestRender();
|
|
744
|
+
});
|
|
717
745
|
}
|
|
718
746
|
/**
|
|
719
747
|
* Update terminal title with session name and cwd.
|
|
@@ -769,7 +797,18 @@ export class InteractiveMode {
|
|
|
769
797
|
}
|
|
770
798
|
});
|
|
771
799
|
// Show startup warnings
|
|
772
|
-
const { migratedProviders, modelFallbackMessage, initialMessage, initialImages, initialMessages } = this.options;
|
|
800
|
+
const { migratedProviders, startupDiagnostics, modelFallbackMessage, initialMessage, initialImages, initialMessages, } = this.options;
|
|
801
|
+
for (const diagnostic of startupDiagnostics ?? []) {
|
|
802
|
+
if (diagnostic.type === "error") {
|
|
803
|
+
this.showError(diagnostic.message);
|
|
804
|
+
}
|
|
805
|
+
else if (diagnostic.type === "warning") {
|
|
806
|
+
this.showWarning(diagnostic.message);
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
this.showStatus(diagnostic.message);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
773
812
|
if (migratedProviders && migratedProviders.length > 0) {
|
|
774
813
|
this.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(", ")}`);
|
|
775
814
|
}
|
|
@@ -890,7 +929,7 @@ export class InteractiveMode {
|
|
|
890
929
|
this.reportInstallTelemetry(VERSION);
|
|
891
930
|
return undefined;
|
|
892
931
|
}
|
|
893
|
-
const newEntries = getNewEntries(entries, lastVersion);
|
|
932
|
+
const newEntries = getNewEntries(entries, lastVersion, VERSION);
|
|
894
933
|
if (newEntries.length > 0) {
|
|
895
934
|
this.settingsManager.setLastChangelogVersion(VERSION);
|
|
896
935
|
this.reportInstallTelemetry(VERSION);
|
|
@@ -2311,6 +2350,12 @@ export class InteractiveMode {
|
|
|
2311
2350
|
await this.handleModelCommand(searchTerm);
|
|
2312
2351
|
return;
|
|
2313
2352
|
}
|
|
2353
|
+
if (text === "/thinking" || text.startsWith("/thinking ")) {
|
|
2354
|
+
const searchTerm = text.startsWith("/thinking ") ? text.slice(10).trim() : undefined;
|
|
2355
|
+
this.editor.setText("");
|
|
2356
|
+
this.handleThinkingCommand(searchTerm);
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2314
2359
|
if (text === "/export" || text.startsWith("/export ")) {
|
|
2315
2360
|
await this.handleExportCommand(text);
|
|
2316
2361
|
this.editor.setText("");
|
|
@@ -2689,9 +2734,21 @@ export class InteractiveMode {
|
|
|
2689
2734
|
}
|
|
2690
2735
|
}
|
|
2691
2736
|
else if (event.result) {
|
|
2737
|
+
const entries = this.sessionManager.buildContextEntries();
|
|
2738
|
+
if (entries[0]?.type !== "compaction") {
|
|
2739
|
+
throw new Error("Completed compaction is missing from the session context");
|
|
2740
|
+
}
|
|
2692
2741
|
this.chatContainer.clear();
|
|
2693
|
-
|
|
2742
|
+
// The latest compaction is prepended for model context; append it below at its chronological position.
|
|
2743
|
+
this.renderSessionEntries(entries.slice(1));
|
|
2694
2744
|
this.addMessageToChat(createCompactionSummaryMessage(event.result.summary, event.result.tokensBefore, new Date().toISOString()));
|
|
2745
|
+
if (event.result.usage) {
|
|
2746
|
+
this.addCompactionCostNotice({
|
|
2747
|
+
type: "compaction_cost",
|
|
2748
|
+
kind: "compaction",
|
|
2749
|
+
usage: event.result.usage,
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2695
2752
|
this.footer.invalidate();
|
|
2696
2753
|
}
|
|
2697
2754
|
else if (event.errorMessage) {
|
|
@@ -2913,6 +2970,10 @@ export class InteractiveMode {
|
|
|
2913
2970
|
this.addCustomEntryToChat(item);
|
|
2914
2971
|
continue;
|
|
2915
2972
|
}
|
|
2973
|
+
if (isCompactionCostNotice(item)) {
|
|
2974
|
+
this.addCompactionCostNotice(item);
|
|
2975
|
+
continue;
|
|
2976
|
+
}
|
|
2916
2977
|
const message = item;
|
|
2917
2978
|
// Assistant messages need special handling for tool calls
|
|
2918
2979
|
if (message.role === "assistant") {
|
|
@@ -2980,10 +3041,28 @@ export class InteractiveMode {
|
|
|
2980
3041
|
if (entry.type === "custom") {
|
|
2981
3042
|
return [entry];
|
|
2982
3043
|
}
|
|
2983
|
-
|
|
3044
|
+
const messages = sessionEntryToContextMessages(entry);
|
|
3045
|
+
if ((entry.type === "compaction" || entry.type === "branch_summary") && entry.usage && messages.length > 0) {
|
|
3046
|
+
return [...messages, { type: "compaction_cost", kind: entry.type, usage: entry.usage }];
|
|
3047
|
+
}
|
|
3048
|
+
return messages;
|
|
2984
3049
|
});
|
|
2985
3050
|
this.renderSessionItems(items, options);
|
|
2986
3051
|
}
|
|
3052
|
+
/**
|
|
3053
|
+
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
3054
|
+
* from persisted summary usage and is not stored as a separate session entry.
|
|
3055
|
+
*/
|
|
3056
|
+
addCompactionCostNotice(notice) {
|
|
3057
|
+
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3058
|
+
return;
|
|
3059
|
+
const { usage } = notice;
|
|
3060
|
+
const tokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;
|
|
3061
|
+
const cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : "";
|
|
3062
|
+
const label = notice.kind === "compaction" ? "Compaction" : "Branch summary";
|
|
3063
|
+
this.chatContainer.addChild(new Spacer(1));
|
|
3064
|
+
this.chatContainer.addChild(new Text(theme.fg("warning", `${label}: ${formatTokens(tokens)} tokens billed${cost}`), 1, 0));
|
|
3065
|
+
}
|
|
2987
3066
|
/**
|
|
2988
3067
|
* Show a transcript notice when a completed assistant message paid for a
|
|
2989
3068
|
* significant cache miss. Only states observable facts: the miss itself,
|
|
@@ -3614,8 +3693,14 @@ export class InteractiveMode {
|
|
|
3614
3693
|
showSettingsSelector() {
|
|
3615
3694
|
this.showSelector((done) => {
|
|
3616
3695
|
let selector;
|
|
3696
|
+
const defaultProvider = this.settingsManager.getDefaultProvider();
|
|
3697
|
+
const defaultModelId = this.settingsManager.getDefaultModel();
|
|
3698
|
+
const defaultModel = defaultProvider && defaultModelId ? `${defaultProvider}/${defaultModelId}` : "not set";
|
|
3617
3699
|
selector = new SettingsSelectorComponent({
|
|
3618
3700
|
autoCompact: this.session.autoCompactionEnabled,
|
|
3701
|
+
defaultModel,
|
|
3702
|
+
currentModel: this.session.model,
|
|
3703
|
+
availableDefaultModels: this.session.modelRuntime.getAvailableSnapshot(),
|
|
3619
3704
|
showImages: this.settingsManager.getShowImages(),
|
|
3620
3705
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3621
3706
|
autoResizeImages: this.settingsManager.getImageAutoResize(),
|
|
@@ -3625,8 +3710,9 @@ export class InteractiveMode {
|
|
|
3625
3710
|
followUpMode: this.session.followUpMode,
|
|
3626
3711
|
transport: this.settingsManager.getTransport(),
|
|
3627
3712
|
httpIdleTimeoutMs: this.settingsManager.getHttpIdleTimeoutMs(),
|
|
3628
|
-
thinkingLevel: this.
|
|
3629
|
-
availableThinkingLevels:
|
|
3713
|
+
thinkingLevel: this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL,
|
|
3714
|
+
availableThinkingLevels: [...THINKING_LEVEL_OPTIONS],
|
|
3715
|
+
modelThinkingLevels: this.settingsManager.getAllModelThinkingLevels(),
|
|
3630
3716
|
currentTheme: this.themeController.getThemeSelection() || "dark",
|
|
3631
3717
|
terminalTheme: this.themeController.getTerminalTheme(),
|
|
3632
3718
|
availableThemes: getAvailableThemes(),
|
|
@@ -3695,10 +3781,26 @@ export class InteractiveMode {
|
|
|
3695
3781
|
configureHttpDispatcher(timeoutMs);
|
|
3696
3782
|
this.showStatus(`HTTP idle timeout: ${formatHttpIdleTimeoutMs(timeoutMs)}`);
|
|
3697
3783
|
},
|
|
3698
|
-
|
|
3699
|
-
this.
|
|
3700
|
-
|
|
3701
|
-
this.
|
|
3784
|
+
onModelThinkingLevelChange: (provider, modelId, level) => {
|
|
3785
|
+
this.settingsManager.setModelThinkingLevel(provider, modelId, level);
|
|
3786
|
+
// If the override is for the current model, apply it to the session too
|
|
3787
|
+
const current = this.session.model;
|
|
3788
|
+
if (current && current.provider === provider && current.id === modelId) {
|
|
3789
|
+
this.session.setThinkingLevel(level);
|
|
3790
|
+
this.footer.invalidate();
|
|
3791
|
+
this.updateEditorBorderColor();
|
|
3792
|
+
}
|
|
3793
|
+
},
|
|
3794
|
+
onModelThinkingLevelRemove: (provider, modelId) => {
|
|
3795
|
+
this.settingsManager.removeModelThinkingLevel(provider, modelId);
|
|
3796
|
+
// If the override was for the current model, revert to global default
|
|
3797
|
+
const current = this.session.model;
|
|
3798
|
+
if (current && current.provider === provider && current.id === modelId) {
|
|
3799
|
+
const globalDefault = this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL;
|
|
3800
|
+
this.session.setThinkingLevel(globalDefault);
|
|
3801
|
+
this.footer.invalidate();
|
|
3802
|
+
this.updateEditorBorderColor();
|
|
3803
|
+
}
|
|
3702
3804
|
},
|
|
3703
3805
|
onThemeChange: (themeSetting) => {
|
|
3704
3806
|
this.settingsManager.setTheme(themeSetting);
|
|
@@ -3819,6 +3921,44 @@ export class InteractiveMode {
|
|
|
3819
3921
|
return { component: selector, focus: selector.getSettingsList() };
|
|
3820
3922
|
});
|
|
3821
3923
|
}
|
|
3924
|
+
handleThinkingCommand(searchTerm) {
|
|
3925
|
+
const availableLevels = this.session.getAvailableThinkingLevels();
|
|
3926
|
+
if (!searchTerm) {
|
|
3927
|
+
this.showThinkingSelector();
|
|
3928
|
+
return;
|
|
3929
|
+
}
|
|
3930
|
+
const normalized = searchTerm.trim().toLowerCase();
|
|
3931
|
+
const level = availableLevels.find((candidate) => candidate.toLowerCase() === normalized);
|
|
3932
|
+
if (!level) {
|
|
3933
|
+
this.showError(`Unknown thinking level "${searchTerm}". Available levels: ${availableLevels.join(", ")}.`);
|
|
3934
|
+
return;
|
|
3935
|
+
}
|
|
3936
|
+
this.selectThinkingLevel(level, false);
|
|
3937
|
+
}
|
|
3938
|
+
selectThinkingLevel(level, persist) {
|
|
3939
|
+
try {
|
|
3940
|
+
this.session.setThinkingLevel(level, { persist });
|
|
3941
|
+
this.footer.invalidate();
|
|
3942
|
+
this.updateEditorBorderColor();
|
|
3943
|
+
this.showStatus(persist ? `Default thinking level: ${level}` : `Thinking level: ${level}`);
|
|
3944
|
+
}
|
|
3945
|
+
catch (error) {
|
|
3946
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
showThinkingSelector() {
|
|
3950
|
+
this.showSelector((done) => {
|
|
3951
|
+
const selectLevel = (level, persist) => {
|
|
3952
|
+
this.selectThinkingLevel(level, persist);
|
|
3953
|
+
done();
|
|
3954
|
+
};
|
|
3955
|
+
const selector = new ThinkingSelectorComponent(this.session.thinkingLevel ?? DEFAULT_THINKING_LEVEL, this.session.getAvailableThinkingLevels(), (level) => selectLevel(level, false), () => {
|
|
3956
|
+
done();
|
|
3957
|
+
this.ui.requestRender();
|
|
3958
|
+
}, (level) => selectLevel(level, true), this.settingsManager.getDefaultThinkingLevel() ?? DEFAULT_THINKING_LEVEL);
|
|
3959
|
+
return { component: selector, focus: selector };
|
|
3960
|
+
});
|
|
3961
|
+
}
|
|
3822
3962
|
async handleModelCommand(searchTerm) {
|
|
3823
3963
|
if (!searchTerm) {
|
|
3824
3964
|
this.showModelSelector();
|
|
@@ -3827,7 +3967,7 @@ export class InteractiveMode {
|
|
|
3827
3967
|
const model = await this.findExactModelMatch(searchTerm);
|
|
3828
3968
|
if (model) {
|
|
3829
3969
|
try {
|
|
3830
|
-
await this.session.setModel(model);
|
|
3970
|
+
await this.session.setModel(model, { persist: false });
|
|
3831
3971
|
this.footer.invalidate();
|
|
3832
3972
|
this.updateEditorBorderColor();
|
|
3833
3973
|
this.showStatus(`Model: ${model.id}`);
|
|
@@ -3956,13 +4096,13 @@ export class InteractiveMode {
|
|
|
3956
4096
|
}
|
|
3957
4097
|
showModelSelector(initialSearchInput) {
|
|
3958
4098
|
this.showSelector((done) => {
|
|
3959
|
-
const
|
|
4099
|
+
const selectModel = async (model, persist) => {
|
|
3960
4100
|
try {
|
|
3961
|
-
await this.session.setModel(model);
|
|
4101
|
+
await this.session.setModel(model, { persist });
|
|
3962
4102
|
this.footer.invalidate();
|
|
3963
4103
|
this.updateEditorBorderColor();
|
|
3964
4104
|
done();
|
|
3965
|
-
this.showStatus(`Model: ${model.id}`);
|
|
4105
|
+
this.showStatus(persist ? `Default model: ${model.provider}/${model.id}` : `Model: ${model.id}`);
|
|
3966
4106
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(model);
|
|
3967
4107
|
this.checkDaxnutsEasterEgg(model);
|
|
3968
4108
|
}
|
|
@@ -3970,10 +4110,13 @@ export class InteractiveMode {
|
|
|
3970
4110
|
done();
|
|
3971
4111
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
3972
4112
|
}
|
|
3973
|
-
}
|
|
4113
|
+
};
|
|
4114
|
+
const defaultProvider = this.settingsManager.getDefaultProvider();
|
|
4115
|
+
const defaultModel = this.settingsManager.getDefaultModel();
|
|
4116
|
+
const selector = new ModelSelectorComponent(this.ui, this.session.model, this.session.modelRuntime, this.session.scopedModels, (model) => selectModel(model, false), () => {
|
|
3974
4117
|
done();
|
|
3975
4118
|
this.ui.requestRender();
|
|
3976
|
-
}, initialSearchInput);
|
|
4119
|
+
}, initialSearchInput, (model) => selectModel(model, true), defaultProvider && defaultModel ? { provider: defaultProvider, id: defaultModel } : undefined);
|
|
3977
4120
|
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
3978
4121
|
});
|
|
3979
4122
|
}
|
|
@@ -4529,7 +4672,11 @@ export class InteractiveMode {
|
|
|
4529
4672
|
if (isUnknownModel(previousModel)) {
|
|
4530
4673
|
const availableModels = this.session.modelRuntime.getAvailableSnapshot();
|
|
4531
4674
|
const providerModels = availableModels.filter((model) => model.provider === providerId);
|
|
4532
|
-
|
|
4675
|
+
// Matches LLAMA_PROVIDER_ID from extensions/llama/provider.ts; kept inline to avoid coupling interactive mode to the built-in extension.
|
|
4676
|
+
if (providerId === "llama.cpp") {
|
|
4677
|
+
selectionError = llamaCppPostLoginGuidance(actionLabel, providerModels.length);
|
|
4678
|
+
}
|
|
4679
|
+
else if (!hasDefaultModelProvider(providerId)) {
|
|
4533
4680
|
selectionError = `${actionLabel}, but no default model is configured for provider "${providerId}". Use /model to select a model.`;
|
|
4534
4681
|
}
|
|
4535
4682
|
else if (providerModels.length === 0) {
|
|
@@ -4543,7 +4690,7 @@ export class InteractiveMode {
|
|
|
4543
4690
|
}
|
|
4544
4691
|
else {
|
|
4545
4692
|
try {
|
|
4546
|
-
await this.session.setModel(selectedModel);
|
|
4693
|
+
await this.session.setModel(selectedModel, { persist: true });
|
|
4547
4694
|
}
|
|
4548
4695
|
catch (error) {
|
|
4549
4696
|
selectedModel = undefined;
|
|
@@ -4913,91 +5060,14 @@ export class InteractiveMode {
|
|
|
4913
5060
|
}
|
|
4914
5061
|
}
|
|
4915
5062
|
async handleShareCommand() {
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
}
|
|
4924
|
-
catch {
|
|
4925
|
-
this.showError("GitHub CLI (gh) is not installed. Install it from https://cli.github.com/");
|
|
4926
|
-
return;
|
|
4927
|
-
}
|
|
4928
|
-
// Export to a temp file
|
|
4929
|
-
const tmpFile = path.join(os.tmpdir(), "session.html");
|
|
4930
|
-
try {
|
|
4931
|
-
await this.session.exportToHtml(tmpFile, { themeName: theme.name });
|
|
4932
|
-
}
|
|
4933
|
-
catch (error) {
|
|
4934
|
-
this.showError(`Failed to export session: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4935
|
-
return;
|
|
4936
|
-
}
|
|
4937
|
-
// Show cancellable loader, replacing the editor
|
|
4938
|
-
const loader = new BorderedLoader(this.ui, theme, "Creating gist...");
|
|
4939
|
-
this.editorContainer.clear();
|
|
4940
|
-
this.editorContainer.addChild(loader);
|
|
4941
|
-
this.ui.setFocus(loader);
|
|
4942
|
-
this.ui.requestRender();
|
|
4943
|
-
const restoreEditor = () => {
|
|
4944
|
-
loader.dispose();
|
|
4945
|
-
this.editorContainer.clear();
|
|
4946
|
-
this.editorContainer.addChild(this.editor);
|
|
4947
|
-
this.ui.setFocus(this.editor);
|
|
4948
|
-
try {
|
|
4949
|
-
fs.unlinkSync(tmpFile);
|
|
4950
|
-
}
|
|
4951
|
-
catch {
|
|
4952
|
-
// Ignore cleanup errors
|
|
4953
|
-
}
|
|
4954
|
-
};
|
|
4955
|
-
// Create a secret gist asynchronously
|
|
4956
|
-
let proc = null;
|
|
4957
|
-
loader.onAbort = () => {
|
|
4958
|
-
proc?.kill();
|
|
4959
|
-
restoreEditor();
|
|
4960
|
-
this.showStatus("Share cancelled");
|
|
4961
|
-
};
|
|
4962
|
-
try {
|
|
4963
|
-
const result = await new Promise((resolve) => {
|
|
4964
|
-
proc = spawn("gh", ["gist", "create", "--public=false", tmpFile]);
|
|
4965
|
-
let stdout = "";
|
|
4966
|
-
let stderr = "";
|
|
4967
|
-
proc.stdout?.on("data", (data) => {
|
|
4968
|
-
stdout += data.toString();
|
|
4969
|
-
});
|
|
4970
|
-
proc.stderr?.on("data", (data) => {
|
|
4971
|
-
stderr += data.toString();
|
|
4972
|
-
});
|
|
4973
|
-
proc.on("close", (code) => resolve({ stdout, stderr, code }));
|
|
4974
|
-
});
|
|
4975
|
-
if (loader.signal.aborted)
|
|
4976
|
-
return;
|
|
4977
|
-
restoreEditor();
|
|
4978
|
-
if (result.code !== 0) {
|
|
4979
|
-
const errorMsg = result.stderr?.trim() || "Unknown error";
|
|
4980
|
-
this.showError(`Failed to create gist: ${errorMsg}`);
|
|
4981
|
-
return;
|
|
4982
|
-
}
|
|
4983
|
-
// Extract gist ID from the URL returned by gh
|
|
4984
|
-
// gh returns something like: https://gist.github.com/username/GIST_ID
|
|
4985
|
-
const gistUrl = result.stdout?.trim();
|
|
4986
|
-
const gistId = gistUrl?.split("/").pop();
|
|
4987
|
-
if (!gistId) {
|
|
4988
|
-
this.showError("Failed to parse gist ID from gh output");
|
|
4989
|
-
return;
|
|
4990
|
-
}
|
|
4991
|
-
// Create the preview URL
|
|
4992
|
-
const previewUrl = getShareViewerUrl(gistId);
|
|
4993
|
-
this.showStatus(`Share URL: ${previewUrl}\nGist: ${gistUrl}`);
|
|
4994
|
-
}
|
|
4995
|
-
catch (error) {
|
|
4996
|
-
if (!loader.signal.aborted) {
|
|
4997
|
-
restoreEditor();
|
|
4998
|
-
this.showError(`Failed to create gist: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4999
|
-
}
|
|
5000
|
-
}
|
|
5063
|
+
await shareSession({
|
|
5064
|
+
session: this.session,
|
|
5065
|
+
ui: this.ui,
|
|
5066
|
+
editorContainer: this.editorContainer,
|
|
5067
|
+
editor: this.editor,
|
|
5068
|
+
showStatus: (message) => this.showStatus(message),
|
|
5069
|
+
showError: (message) => this.showError(message),
|
|
5070
|
+
});
|
|
5001
5071
|
}
|
|
5002
5072
|
async handleCopyCommand(options = {}) {
|
|
5003
5073
|
const text = this.session.getLastAssistantText();
|