@humain/terminal 0.0.6 → 0.0.8
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 +62 -0
- package/README.md +17 -10
- 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-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-74NVHVNZ.js +16 -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-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-MA4UUCYX.js +18 -0
- package/dist/bundle/chunks/chunk-MMFBCF6F.js +5986 -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-PSKDLDLZ.js +44 -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-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-FF7M7XHT.js +2 -0
- package/dist/bundle/chunks/google-vertex-YMUBFRBA.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-562J2I52.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-O4M7IQML.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-L4AHDQ5D.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/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.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 +62 -15
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +240 -104
- 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 +7 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +9 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +59 -36
- 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/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +44 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +56 -10
- 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 +6 -3
- 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 +17 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +68 -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/client.d.ts +6 -0
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js +7 -0
- package/dist/extensions/llama/client.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 +3 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +29 -4
- 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 +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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 +19 -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 +9 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +128 -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 +15 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +224 -130
- 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 +7 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +10 -2
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +3 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +14 -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 +23 -9
- 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 +17 -0
- package/docs/custom-provider.md +12 -9
- package/docs/environment-variables.md +11 -8
- package/docs/extensions.md +35 -7
- package/docs/json.md +7 -2
- package/docs/keybindings.md +9 -9
- package/docs/llama-cpp.md +2 -0
- package/docs/models.md +8 -2
- package/docs/packages.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +32 -3
- package/docs/sdk.md +7 -2
- package/docs/settings.md +23 -7
- package/docs/skills.md +3 -2
- package/docs/terminal-setup.md +20 -0
- package/docs/usage.md +14 -10
- 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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// types.ts - Core type definitions
|
|
2
2
|
import type {
|
|
3
|
+
CallToolResult,
|
|
3
4
|
ContentBlock as McpContentBlock,
|
|
4
5
|
ListPromptsResult,
|
|
5
6
|
ListResourcesResult,
|
|
@@ -7,7 +8,7 @@ import type {
|
|
|
7
8
|
Transport as McpTransport,
|
|
8
9
|
} from "@modelcontextprotocol/client";
|
|
9
10
|
import type { TextContent, ImageContent } from "@earendil-works/pi-ai";
|
|
10
|
-
import type { UiStreamMode } from "./ui-stream-types.ts";
|
|
11
|
+
import type { UiStreamMode, UiStreamSummary } from "./ui-stream-types.ts";
|
|
11
12
|
import type { UiToolVisibility } from "./ui-tool-visibility.ts";
|
|
12
13
|
|
|
13
14
|
export type Transport = McpTransport;
|
|
@@ -43,6 +44,15 @@ export interface McpStatusSnapshot {
|
|
|
43
44
|
readonly disabledCount: number;
|
|
44
45
|
}
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Minimal event-bus surface the status publisher needs. Lives here (leaf
|
|
49
|
+
* module) so `state.ts` can reference it without importing `mcp-status.ts`,
|
|
50
|
+
* which imports the state type back — an import cycle at type level.
|
|
51
|
+
*/
|
|
52
|
+
export interface McpStatusEventBus {
|
|
53
|
+
emit(channel: string, data: unknown): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
46
56
|
// Import sources for config
|
|
47
57
|
export type ImportKind =
|
|
48
58
|
| "cursor"
|
|
@@ -155,6 +165,30 @@ export interface UiHostContext {
|
|
|
155
165
|
|
|
156
166
|
export type UiDisplayMode = "inline" | "fullscreen" | "pip";
|
|
157
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Live handle to a started UI tool session. Lives here (leaf module) so
|
|
170
|
+
* `state.ts` can reference it without importing `ui-server.ts`, which
|
|
171
|
+
* imports the state type back — an import cycle at type level.
|
|
172
|
+
*/
|
|
173
|
+
export interface UiServerHandle {
|
|
174
|
+
url: string;
|
|
175
|
+
port: number;
|
|
176
|
+
sessionToken: string;
|
|
177
|
+
serverName: string;
|
|
178
|
+
toolName: string;
|
|
179
|
+
viewer?: "browser" | "glimpse" | "suppressed";
|
|
180
|
+
windowOpen?: boolean;
|
|
181
|
+
close: (reason?: string) => void;
|
|
182
|
+
sendToolInput: (args: Record<string, unknown>) => void;
|
|
183
|
+
sendToolResult: (result: CallToolResult) => void;
|
|
184
|
+
sendResultPatch: (result: CallToolResult) => void;
|
|
185
|
+
sendToolCancelled: (reason: string) => void;
|
|
186
|
+
sendHostContext: (context: UiHostContext) => void;
|
|
187
|
+
/** Get accumulated messages from this session */
|
|
188
|
+
getSessionMessages: () => UiSessionMessages;
|
|
189
|
+
getStreamSummary: () => UiStreamSummary | undefined;
|
|
190
|
+
}
|
|
191
|
+
|
|
158
192
|
// Re-export stream types from the shared lightweight module.
|
|
159
193
|
// This allows the example package to import stream schemas without pulling the full types.ts dependency graph.
|
|
160
194
|
export {
|
|
@@ -344,7 +378,7 @@ export interface OAuthConfig {
|
|
|
344
378
|
scope?: string;
|
|
345
379
|
/** Extra authorization URL parameters for provider-specific extensions. Flow-owned parameters cannot be overridden. */
|
|
346
380
|
authorizationParams?: Record<string, string>;
|
|
347
|
-
/** Exact authorization-code redirect URI for pre-registered clients */
|
|
381
|
+
/** Exact authorization-code redirect URI for pre-registered clients. HTTPS redirects use manual callback URL completion. */
|
|
348
382
|
redirectUri?: string;
|
|
349
383
|
/** Client display name for dynamic registration */
|
|
350
384
|
clientName?: string;
|
|
@@ -352,6 +386,8 @@ export interface OAuthConfig {
|
|
|
352
386
|
clientUri?: string;
|
|
353
387
|
/** Client logo URL for dynamic registration; shown on consent screens */
|
|
354
388
|
logoUri?: string;
|
|
389
|
+
/** HTTPS URL for an authorization-server metadata document used instead of MCP discovery */
|
|
390
|
+
authServerMetadataUrl?: string;
|
|
355
391
|
/** Security-weakening escape hatch for known-misconfigured authorization servers. */
|
|
356
392
|
skipIssuerMetadataValidation?: boolean;
|
|
357
393
|
}
|
|
@@ -506,6 +542,16 @@ export interface McpSettings {
|
|
|
506
542
|
idleTimeout?: number; // minutes, default 10, 0 to disable
|
|
507
543
|
requestTimeoutMs?: number; // milliseconds, overrides the SDK request timeout when > 0
|
|
508
544
|
directTools?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Validate direct-tool inputs against the advertised schema after recovering
|
|
547
|
+
* one JSON string layer for object and array properties. Defaults to false.
|
|
548
|
+
*/
|
|
549
|
+
strictDirectToolArguments?: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* Include the byte-bounded raw MCP result in direct-tool details. The default
|
|
552
|
+
* `lean` mode keeps the existing small details object.
|
|
553
|
+
*/
|
|
554
|
+
directToolResultDetails?: "lean" | "bounded";
|
|
509
555
|
/** Show the advisory when 75 or more direct tools resolve. Defaults to true. */
|
|
510
556
|
warnOnLargeDirectTools?: boolean;
|
|
511
557
|
/** Register the trusted MCP-only JavaScript scripting tool. Defaults to true; set false to hide it. */
|
|
@@ -642,6 +688,9 @@ export interface ServerCacheEntry {
|
|
|
642
688
|
resources: CachedResource[];
|
|
643
689
|
prompts?: CachedPrompt[];
|
|
644
690
|
instructions?: string;
|
|
691
|
+
/** Server-level hints from the aggregated tools/list result. */
|
|
692
|
+
ttlMs?: ListToolsResult["ttlMs"];
|
|
693
|
+
cacheScope?: ListToolsResult["cacheScope"];
|
|
645
694
|
cachedAt: number;
|
|
646
695
|
}
|
|
647
696
|
|
|
@@ -35,10 +35,13 @@ import {
|
|
|
35
35
|
type UiProxyRequestBody,
|
|
36
36
|
type UiProxyResult,
|
|
37
37
|
type UiResourceContent,
|
|
38
|
+
type UiServerHandle,
|
|
38
39
|
type UiSessionMessages,
|
|
39
40
|
type UiStreamSummary,
|
|
40
41
|
} from "./types.ts";
|
|
41
42
|
|
|
43
|
+
export type { UiServerHandle };
|
|
44
|
+
|
|
42
45
|
const MAX_BODY_SIZE = 2 * 1024 * 1024;
|
|
43
46
|
const ABANDONED_GRACE_MS = 60_000;
|
|
44
47
|
const WATCHDOG_INTERVAL_MS = 5_000;
|
|
@@ -75,25 +78,6 @@ export interface UiServerOptions {
|
|
|
75
78
|
onComplete?: (reason: string) => void;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
export interface UiServerHandle {
|
|
79
|
-
url: string;
|
|
80
|
-
port: number;
|
|
81
|
-
sessionToken: string;
|
|
82
|
-
serverName: string;
|
|
83
|
-
toolName: string;
|
|
84
|
-
viewer?: "browser" | "glimpse" | "suppressed";
|
|
85
|
-
windowOpen?: boolean;
|
|
86
|
-
close: (reason?: string) => void;
|
|
87
|
-
sendToolInput: (args: Record<string, unknown>) => void;
|
|
88
|
-
sendToolResult: (result: CallToolResult) => void;
|
|
89
|
-
sendResultPatch: (result: CallToolResult) => void;
|
|
90
|
-
sendToolCancelled: (reason: string) => void;
|
|
91
|
-
sendHostContext: (context: UiHostContext) => void;
|
|
92
|
-
/** Get accumulated messages from this session */
|
|
93
|
-
getSessionMessages: () => UiSessionMessages;
|
|
94
|
-
getStreamSummary: () => UiStreamSummary | undefined;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
81
|
export async function startUiServer(options: UiServerOptions): Promise<UiServerHandle> {
|
|
98
82
|
const sessionToken = options.sessionToken ?? randomUUID();
|
|
99
83
|
const uiResourceToken = randomUUID();
|
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
type UiStreamMode,
|
|
16
16
|
} from "./types.ts";
|
|
17
17
|
import { logger } from "./logger.ts";
|
|
18
|
-
import { startUiServer
|
|
18
|
+
import { startUiServer } from "./ui-server.ts";
|
|
19
|
+
import type { UiServerHandle } from "./types.ts";
|
|
19
20
|
import { isGlimpseAvailable, openGlimpseWindow } from "./glimpse-ui.ts";
|
|
20
21
|
import type { SessionRecoveryDeps } from "./session-recovery.ts";
|
|
21
22
|
import { combineAbortSignals, isAbortError } from "./runtime-owner.ts";
|
|
@@ -71,18 +71,20 @@ export function getConfigPathFromArgv(): string | undefined {
|
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
export function interpolateEnvVars(value: string): string
|
|
74
|
+
export function interpolateEnvVars(value: string): string;
|
|
75
|
+
export function interpolateEnvVars(value: string, environment: NodeJS.ProcessEnv): string;
|
|
76
|
+
export function interpolateEnvVars(value: string, environment: NodeJS.ProcessEnv = process.env): string {
|
|
75
77
|
return value
|
|
76
|
-
.replace(/\$\{(\w+)\}/g, (_, name) =>
|
|
77
|
-
.replace(/\$env:(\w+)/g, (_, name) =>
|
|
78
|
-
.replace(/\{env:(\w+)\}/g, (_, name) =>
|
|
78
|
+
.replace(/\$\{(\w+)\}/g, (_, name) => environment[name] ?? "")
|
|
79
|
+
.replace(/\$env:(\w+)/g, (_, name) => environment[name] ?? "")
|
|
80
|
+
.replace(/\{env:(\w+)\}/g, (_, name) => environment[name] ?? "");
|
|
79
81
|
}
|
|
80
82
|
|
|
81
|
-
function getMissingEnvVars(value: string): string[] {
|
|
83
|
+
function getMissingEnvVars(value: string, environment: NodeJS.ProcessEnv): string[] {
|
|
82
84
|
const missing = new Set<string>();
|
|
83
85
|
for (const match of value.matchAll(/\$\{(\w+)\}|\$env:(\w+)|\{env:(\w+)\}/g)) {
|
|
84
86
|
const name = match[1] ?? match[2] ?? match[3];
|
|
85
|
-
if (name &&
|
|
87
|
+
if (name && environment[name] === undefined) {
|
|
86
88
|
missing.add(name);
|
|
87
89
|
}
|
|
88
90
|
}
|
|
@@ -99,17 +101,17 @@ export function toStringRecord(value: unknown): Record<string, string> | undefin
|
|
|
99
101
|
return Object.keys(result).length > 0 ? result : undefined;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
function interpolateSecretExpression(value: string): string {
|
|
103
|
-
if (value.startsWith("!!")) return interpolateEnvVars(value.slice(1));
|
|
104
|
-
return value.startsWith("!") ? value : interpolateEnvVars(value);
|
|
104
|
+
function interpolateSecretExpression(value: string, environment: NodeJS.ProcessEnv): string {
|
|
105
|
+
if (value.startsWith("!!")) return interpolateEnvVars(value.slice(1), environment);
|
|
106
|
+
return value.startsWith("!") ? value : interpolateEnvVars(value, environment);
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
export function interpolateEnvRecord(values: Record<string, string> | undefined): Record<string, string> | undefined {
|
|
109
|
+
export function interpolateEnvRecord(values: Record<string, string> | undefined, environment: NodeJS.ProcessEnv = process.env): Record<string, string> | undefined {
|
|
108
110
|
if (!values) return undefined;
|
|
109
111
|
|
|
110
112
|
return Object.fromEntries(Object.entries(values).map(([key, value]) => [
|
|
111
113
|
key,
|
|
112
|
-
interpolateSecretExpression(value),
|
|
114
|
+
interpolateSecretExpression(value, environment),
|
|
113
115
|
]));
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -164,18 +166,18 @@ export function resolveCommandSecretsRecord(
|
|
|
164
166
|
]));
|
|
165
167
|
}
|
|
166
168
|
|
|
167
|
-
export function resolveServerUrl(definition: Pick<ServerEntry, "url"
|
|
169
|
+
export function resolveServerUrl(definition: Pick<ServerEntry, "url">, environment: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
168
170
|
if (definition.url == null) return undefined;
|
|
169
171
|
if (typeof definition.url !== "string") {
|
|
170
172
|
throw new Error("MCP server URL must be a string");
|
|
171
173
|
}
|
|
172
174
|
|
|
173
|
-
const missing = getMissingEnvVars(definition.url);
|
|
175
|
+
const missing = getMissingEnvVars(definition.url, environment);
|
|
174
176
|
if (missing.length > 0) {
|
|
175
177
|
throw new Error(`Missing environment variable${missing.length === 1 ? "" : "s"} in MCP server URL: ${missing.join(", ")}`);
|
|
176
178
|
}
|
|
177
179
|
|
|
178
|
-
const resolved = interpolateEnvVars(definition.url);
|
|
180
|
+
const resolved = interpolateEnvVars(definition.url, environment);
|
|
179
181
|
try {
|
|
180
182
|
new URL(resolved);
|
|
181
183
|
} catch (error) {
|
|
@@ -184,10 +186,10 @@ export function resolveServerUrl(definition: Pick<ServerEntry, "url">): string |
|
|
|
184
186
|
return resolved;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
export function resolveConfigPath(value: string | undefined): string | undefined {
|
|
189
|
+
export function resolveConfigPath(value: string | undefined, environment: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
188
190
|
if (value === undefined) return undefined;
|
|
189
191
|
|
|
190
|
-
const resolved = interpolateEnvVars(value);
|
|
192
|
+
const resolved = interpolateEnvVars(value, environment);
|
|
191
193
|
if (resolved === "~") return homedir();
|
|
192
194
|
if (resolved.startsWith("~/") || resolved.startsWith("~\\")) {
|
|
193
195
|
return join(homedir(), resolved.slice(2));
|
|
@@ -195,11 +197,11 @@ export function resolveConfigPath(value: string | undefined): string | undefined
|
|
|
195
197
|
return resolved;
|
|
196
198
|
}
|
|
197
199
|
|
|
198
|
-
export function resolveBearerToken(definition: Pick<ServerEntry, "bearerToken" | "bearerTokenEnv"
|
|
200
|
+
export function resolveBearerToken(definition: Pick<ServerEntry, "bearerToken" | "bearerTokenEnv">, environment: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
199
201
|
if (definition.bearerToken !== undefined) {
|
|
200
|
-
return interpolateSecretExpression(definition.bearerToken);
|
|
202
|
+
return interpolateSecretExpression(definition.bearerToken, environment);
|
|
201
203
|
}
|
|
202
|
-
return definition.bearerTokenEnv ?
|
|
204
|
+
return definition.bearerTokenEnv ? environment[definition.bearerTokenEnv] : undefined;
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
/** Remove OSC control strings, including payloads that have no terminator. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-adapter.d.ts","sourceRoot":"","sources":["../../src/humain/mcp-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-adapter.d.ts","sourceRoot":"","sources":["../../src/humain/mcp-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,wBAAgB,sCAAsC,IAAI,gBAAgB,CAKzE"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { getPackageDir } from "../config.js";
|
|
1
2
|
import mcpAdapter from "./mcp-adapter/vendor/index.bundle.mjs";
|
|
2
3
|
export function createHumainMcpAdapterExtensionFactory() {
|
|
4
|
+
if (!process.env.PI_PACKAGE_DIR?.trim()) {
|
|
5
|
+
process.env.PI_PACKAGE_DIR = getPackageDir();
|
|
6
|
+
}
|
|
3
7
|
return mcpAdapter;
|
|
4
8
|
}
|
|
5
9
|
//# sourceMappingURL=mcp-adapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-adapter.js","sourceRoot":"","sources":["../../src/humain/mcp-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-adapter.js","sourceRoot":"","sources":["../../src/humain/mcp-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAE/D,MAAM,UAAU,sCAAsC;IACrD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,EAAE,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,aAAa,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["import { getPackageDir } from \"../config.ts\";\nimport type { ExtensionFactory } from \"../core/extensions/types.ts\";\nimport mcpAdapter from \"./mcp-adapter/vendor/index.bundle.mjs\";\n\nexport function createHumainMcpAdapterExtensionFactory(): ExtensionFactory {\n\tif (!process.env.PI_PACKAGE_DIR?.trim()) {\n\t\tprocess.env.PI_PACKAGE_DIR = getPackageDir();\n\t}\n\treturn mcpAdapter;\n}\n"]}
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
import { type BrowserCookiePreset } from "./gemini-web-config.ts";
|
|
1
2
|
export type CookieMap = Record<string, string>;
|
|
3
|
+
export type BrowserCookieAttemptStatus = "missing-database" | "missing-required-cookies" | "password-read-failed" | "decryption-failed" | "sqlite-unavailable" | "sqlite-query-failed" | "unsafe-profile" | "no-host-cookies";
|
|
4
|
+
export interface BrowserCookieAttemptDiagnostic {
|
|
5
|
+
browser: string;
|
|
6
|
+
profile: string;
|
|
7
|
+
status: BrowserCookieAttemptStatus;
|
|
8
|
+
}
|
|
9
|
+
export interface BrowserCookieDiagnosticDetails {
|
|
10
|
+
message: string;
|
|
11
|
+
attempts: BrowserCookieAttemptDiagnostic[];
|
|
12
|
+
}
|
|
2
13
|
export declare function getLastGoogleCookieDiagnostic(): string | null;
|
|
3
14
|
export declare function getLastBrowserCookieDiagnostic(): string | null;
|
|
15
|
+
export declare function getLastGoogleCookieDiagnosticDetails(): BrowserCookieDiagnosticDetails | null;
|
|
4
16
|
export declare function getGoogleCookies(options?: {
|
|
17
|
+
browser?: BrowserCookiePreset;
|
|
5
18
|
profile?: string;
|
|
6
19
|
requiredCookies?: string[];
|
|
7
20
|
}): Promise<{
|
|
@@ -10,6 +23,7 @@ export declare function getGoogleCookies(options?: {
|
|
|
10
23
|
} | null>;
|
|
11
24
|
export declare function getBrowserCookiesForHosts(options: {
|
|
12
25
|
hosts: string[];
|
|
26
|
+
browser?: BrowserCookiePreset;
|
|
13
27
|
profile?: string;
|
|
14
28
|
requiredCookies?: string[];
|
|
15
29
|
cookieNames?: Iterable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome-cookies.d.ts","sourceRoot":"","sources":["../../../../src/humain/web-access/vendor/chrome-cookies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chrome-cookies.d.ts","sourceRoot":"","sources":["../../../../src/humain/web-access/vendor/chrome-cookies.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAe/C,MAAM,MAAM,0BAA0B,GACnC,kBAAkB,GAClB,0BAA0B,GAC1B,sBAAsB,GACtB,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,GACrB,gBAAgB,GAChB,iBAAiB,CAAC;AAErB,MAAM,WAAW,8BAA8B;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,0BAA0B,CAAC;CACnC;AAED,MAAM,WAAW,8BAA8B;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,8BAA8B,EAAE,CAAC;CAC3C;AA2CD,wBAAgB,6BAA6B,IAAI,MAAM,GAAG,IAAI,CAE7D;AAED,wBAAgB,8BAA8B,IAAI,MAAM,GAAG,IAAI,CAE9D;AAED,wBAAgB,oCAAoC,IAAI,8BAA8B,GAAG,IAAI,CAE5F;AAED,wBAAsB,gBAAgB,CACrC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GACvF,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAS5D;AAED,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,GACjL,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAsLnF"}
|
|
@@ -15,21 +15,22 @@ const ALL_COOKIE_NAMES = new Set([
|
|
|
15
15
|
"__Secure-3PSIDTS", "__Secure-3PAPISID", "SIDCC",
|
|
16
16
|
]);
|
|
17
17
|
const MACOS_BROWSER_CONFIGS = [
|
|
18
|
-
{ name: "Helium", baseDir: "Library/Application Support/net.imput.helium", keychainService: "Helium Storage Key", keychainAccount: "Helium" },
|
|
19
|
-
{ name: "Chrome", baseDir: "Library/Application Support/Google/Chrome", keychainService: "Chrome Safe Storage", keychainAccount: "Chrome" },
|
|
20
|
-
{ name: "Brave", baseDir: "Library/Application Support/BraveSoftware/Brave-Browser", keychainService: "Brave Safe Storage", keychainAccount: "Brave" },
|
|
21
|
-
{ name: "Arc", baseDir: "Library/Application Support/Arc/User Data", keychainService: "Arc Safe Storage", keychainAccount: "Arc" },
|
|
18
|
+
{ id: "helium", name: "Helium", baseDir: "Library/Application Support/net.imput.helium", keychainService: "Helium Storage Key", keychainAccount: "Helium" },
|
|
19
|
+
{ id: "chrome", name: "Chrome", baseDir: "Library/Application Support/Google/Chrome", keychainService: "Chrome Safe Storage", keychainAccount: "Chrome" },
|
|
20
|
+
{ id: "brave", name: "Brave", baseDir: "Library/Application Support/BraveSoftware/Brave-Browser", keychainService: "Brave Safe Storage", keychainAccount: "Brave" },
|
|
21
|
+
{ id: "arc", name: "Arc", baseDir: "Library/Application Support/Arc/User Data", keychainService: "Arc Safe Storage", keychainAccount: "Arc" },
|
|
22
22
|
];
|
|
23
23
|
const LINUX_BROWSER_CONFIGS = [
|
|
24
|
-
{ name: "Chromium", baseDir: ".config/chromium", secretToolApp: "chromium" },
|
|
25
|
-
{ name: "Chrome", baseDir: ".config/google-chrome", secretToolApp: "chrome" },
|
|
24
|
+
{ id: "chromium", name: "Chromium", baseDir: ".config/chromium", secretToolApp: "chromium" },
|
|
25
|
+
{ id: "chrome", name: "Chrome", baseDir: ".config/google-chrome", secretToolApp: "chrome" },
|
|
26
26
|
];
|
|
27
27
|
const WINDOWS_BROWSER_CONFIGS = [
|
|
28
|
-
{ name: "Chrome", baseDir: "Google/Chrome/User Data", usesLocalAppData: true },
|
|
29
|
-
{ name: "Edge", baseDir: "Microsoft/Edge/User Data", usesLocalAppData: true },
|
|
28
|
+
{ id: "chrome", name: "Chrome", baseDir: "Google/Chrome/User Data", usesLocalAppData: true },
|
|
29
|
+
{ id: "edge", name: "Edge", baseDir: "Microsoft/Edge/User Data", usesLocalAppData: true },
|
|
30
30
|
];
|
|
31
31
|
const browserPasswordCache = new Map();
|
|
32
32
|
let lastCookieDiagnostic = null;
|
|
33
|
+
let lastCookieDiagnosticDetails = null;
|
|
33
34
|
let sqliteModule = null;
|
|
34
35
|
let sqliteImportAttempted = false;
|
|
35
36
|
export function getLastGoogleCookieDiagnostic() {
|
|
@@ -38,9 +39,13 @@ export function getLastGoogleCookieDiagnostic() {
|
|
|
38
39
|
export function getLastBrowserCookieDiagnostic() {
|
|
39
40
|
return lastCookieDiagnostic;
|
|
40
41
|
}
|
|
42
|
+
export function getLastGoogleCookieDiagnosticDetails() {
|
|
43
|
+
return lastCookieDiagnosticDetails;
|
|
44
|
+
}
|
|
41
45
|
export async function getGoogleCookies(options) {
|
|
42
46
|
return getBrowserCookiesForHosts({
|
|
43
47
|
hosts: GOOGLE_ORIGINS.map((origin) => new URL(origin).hostname),
|
|
48
|
+
browser: options?.browser,
|
|
44
49
|
profile: options?.profile,
|
|
45
50
|
requiredCookies: options?.requiredCookies,
|
|
46
51
|
cookieNames: ALL_COOKIE_NAMES,
|
|
@@ -49,30 +54,37 @@ export async function getGoogleCookies(options) {
|
|
|
49
54
|
}
|
|
50
55
|
export async function getBrowserCookiesForHosts(options) {
|
|
51
56
|
lastCookieDiagnostic = null;
|
|
57
|
+
lastCookieDiagnosticDetails = null;
|
|
52
58
|
if (!isBrowserCookieAccessAllowed()) {
|
|
53
|
-
|
|
59
|
+
setCookieDiagnostic("Browser cookie access is disabled; enable allowBrowserCookies to use browser cookies.");
|
|
54
60
|
return null;
|
|
55
61
|
}
|
|
56
62
|
const currentPlatform = process.platform;
|
|
57
|
-
const
|
|
63
|
+
const platformConfigs = currentPlatform === "darwin" ? MACOS_BROWSER_CONFIGS : currentPlatform === "linux" ? LINUX_BROWSER_CONFIGS : currentPlatform === "win32" ? WINDOWS_BROWSER_CONFIGS : [];
|
|
64
|
+
const configs = options.browser ? platformConfigs.filter((config) => config.id === options.browser) : platformConfigs;
|
|
65
|
+
if (options.browser && configs.length === 0) {
|
|
66
|
+
setCookieDiagnostic(`Browser preset '${options.browser}' is not supported on this platform.`);
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
58
69
|
if (configs.length === 0) {
|
|
59
|
-
|
|
70
|
+
setCookieDiagnostic("Chromium cookie extraction is unsupported on this platform.");
|
|
60
71
|
return null;
|
|
61
72
|
}
|
|
62
73
|
const warningSet = new Set();
|
|
63
74
|
const rawProfile = typeof options.profile === "string" ? options.profile.trim() : "";
|
|
64
75
|
const requestedProfile = normalizeProfileName(options.profile);
|
|
65
76
|
if (rawProfile && !requestedProfile) {
|
|
66
|
-
|
|
77
|
+
setCookieDiagnostic("Configured Chromium profile must be a profile directory name, not a path.");
|
|
67
78
|
return null;
|
|
68
79
|
}
|
|
69
80
|
const requiredCookies = normalizeCookieNames(options.requiredCookies);
|
|
70
81
|
const cookieNames = normalizeCookieNames(options.cookieNames ? [...options.cookieNames] : undefined);
|
|
71
82
|
const hosts = normalizeHosts(options.hosts);
|
|
72
83
|
if (hosts.length === 0) {
|
|
73
|
-
|
|
84
|
+
setCookieDiagnostic("No valid cookie hosts were requested.");
|
|
74
85
|
return null;
|
|
75
86
|
}
|
|
87
|
+
const attempts = [];
|
|
76
88
|
const home = currentPlatform === "win32" ? process.env.USERPROFILE || homedir() : homedir();
|
|
77
89
|
let sawCookieDatabase = false;
|
|
78
90
|
let sawRequiredCookies = false;
|
|
@@ -80,19 +92,25 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
80
92
|
let sawBackendFailure;
|
|
81
93
|
let sawUnsafeProfilePath = false;
|
|
82
94
|
let sawWindowsAppBoundCookie = false;
|
|
95
|
+
let sawDecryptionFailure = false;
|
|
83
96
|
for (const config of configs) {
|
|
84
97
|
const profiles = requestedProfile ? [requestedProfile] : listBrowserProfiles(home, config);
|
|
85
98
|
for (const profile of profiles) {
|
|
86
99
|
const profilePath = resolveProfilePath(home, config, profile);
|
|
87
100
|
if (profilePath === "outside-root") {
|
|
88
101
|
sawUnsafeProfilePath = true;
|
|
102
|
+
recordCookieAttempt(attempts, config, profile, "unsafe-profile");
|
|
89
103
|
continue;
|
|
90
104
|
}
|
|
91
|
-
if (!profilePath)
|
|
105
|
+
if (!profilePath) {
|
|
106
|
+
recordCookieAttempt(attempts, config, profile, "missing-database");
|
|
92
107
|
continue;
|
|
108
|
+
}
|
|
93
109
|
const cookiesPath = cookieDatabasePath(profilePath, config);
|
|
94
|
-
if (!cookiesPath)
|
|
110
|
+
if (!cookiesPath) {
|
|
111
|
+
recordCookieAttempt(attempts, config, profile, "missing-database");
|
|
95
112
|
continue;
|
|
113
|
+
}
|
|
96
114
|
sawCookieDatabase = true;
|
|
97
115
|
const tempDir = mkdtempSync(join(tmpdir(), "pi-chrome-cookies-"));
|
|
98
116
|
try {
|
|
@@ -102,10 +120,15 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
102
120
|
copySidecar(cookiesPath, tempDb, "-shm");
|
|
103
121
|
if (requiredCookies?.length) {
|
|
104
122
|
const preflight = await hasCookieNames(tempDb, hosts, requiredCookies);
|
|
105
|
-
if (preflight.failure)
|
|
123
|
+
if (preflight.failure) {
|
|
106
124
|
sawBackendFailure = preflight.failure;
|
|
107
|
-
|
|
125
|
+
recordCookieAttempt(attempts, config, profile, preflight.failure === "unavailable" ? "sqlite-unavailable" : "sqlite-query-failed");
|
|
108
126
|
continue;
|
|
127
|
+
}
|
|
128
|
+
if (!preflight.present) {
|
|
129
|
+
recordCookieAttempt(attempts, config, profile, "missing-required-cookies");
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
109
132
|
sawRequiredCookies = true;
|
|
110
133
|
}
|
|
111
134
|
const key = currentPlatform === "win32"
|
|
@@ -115,20 +138,25 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
115
138
|
warningSet.add(currentPlatform === "win32"
|
|
116
139
|
? `Could not read ${config.name} Windows cookie encryption key`
|
|
117
140
|
: `Could not read ${config.name} cookie encryption password`);
|
|
141
|
+
recordCookieAttempt(attempts, config, profile, "password-read-failed");
|
|
118
142
|
continue;
|
|
119
143
|
}
|
|
120
144
|
const metaVersion = await readMetaVersion(tempDb);
|
|
121
|
-
if (metaVersion.failure)
|
|
145
|
+
if (metaVersion.failure) {
|
|
122
146
|
sawBackendFailure = metaVersion.failure;
|
|
147
|
+
recordCookieAttempt(attempts, config, profile, metaVersion.failure === "unavailable" ? "sqlite-unavailable" : "sqlite-query-failed");
|
|
148
|
+
}
|
|
123
149
|
if (metaVersion.value === null)
|
|
124
150
|
continue;
|
|
125
151
|
const rowsResult = await queryCookieRows(tempDb, hosts, cookieNames ?? null, Boolean(options.requestUrl));
|
|
126
152
|
if (rowsResult.status === "failure") {
|
|
127
153
|
sawBackendFailure = rowsResult.failure;
|
|
154
|
+
recordCookieAttempt(attempts, config, profile, rowsResult.failure === "unavailable" ? "sqlite-unavailable" : "sqlite-query-failed");
|
|
128
155
|
continue;
|
|
129
156
|
}
|
|
130
157
|
const entries = [];
|
|
131
158
|
const cookies = {};
|
|
159
|
+
const requiredDecryptFailures = new Set();
|
|
132
160
|
for (const row of rowsResult.rows) {
|
|
133
161
|
const name = typeof row.name === "string" ? row.name : "";
|
|
134
162
|
if (!name)
|
|
@@ -141,6 +169,8 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
141
169
|
value = currentPlatform === "win32"
|
|
142
170
|
? decryptWindowsCookieValue(encrypted, key, metaVersion.value >= 24)
|
|
143
171
|
: decryptCookieValue(encrypted, key, metaVersion.value >= 24);
|
|
172
|
+
if (!value && requiredCookies?.includes(name))
|
|
173
|
+
requiredDecryptFailures.add(name);
|
|
144
174
|
}
|
|
145
175
|
if (!value)
|
|
146
176
|
continue;
|
|
@@ -153,10 +183,22 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
153
183
|
}
|
|
154
184
|
if (entries.length > 0)
|
|
155
185
|
sawAnyHostCookie = true;
|
|
156
|
-
if (requiredCookies?.length && !requiredCookies.every((name) => Boolean(cookies[name])))
|
|
186
|
+
if (requiredCookies?.length && !requiredCookies.every((name) => Boolean(cookies[name]))) {
|
|
187
|
+
if (requiredCookies.some((name) => !cookies[name] && requiredDecryptFailures.has(name))) {
|
|
188
|
+
sawDecryptionFailure = true;
|
|
189
|
+
recordCookieAttempt(attempts, config, profile, "decryption-failed");
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
recordCookieAttempt(attempts, config, profile, "missing-required-cookies");
|
|
193
|
+
}
|
|
157
194
|
continue;
|
|
158
|
-
|
|
195
|
+
}
|
|
196
|
+
if (entries.length === 0) {
|
|
197
|
+
recordCookieAttempt(attempts, config, profile, requiredDecryptFailures.size > 0 ? "decryption-failed" : "no-host-cookies");
|
|
198
|
+
if (requiredDecryptFailures.size > 0)
|
|
199
|
+
sawDecryptionFailure = true;
|
|
159
200
|
continue;
|
|
201
|
+
}
|
|
160
202
|
return {
|
|
161
203
|
cookies,
|
|
162
204
|
warnings: [...warningSet],
|
|
@@ -169,38 +211,48 @@ export async function getBrowserCookiesForHosts(options) {
|
|
|
169
211
|
}
|
|
170
212
|
}
|
|
171
213
|
if (sawBackendFailure === "unavailable") {
|
|
172
|
-
|
|
214
|
+
setCookieDiagnostic("SQLite backend unavailable: install sqlite3 or use a runtime with SQLite support.", attempts);
|
|
173
215
|
}
|
|
174
216
|
else if (sawBackendFailure === "query") {
|
|
175
|
-
|
|
217
|
+
setCookieDiagnostic("SQLite query failed while reading the copied Chromium cookie database.", attempts);
|
|
176
218
|
}
|
|
177
219
|
else if (sawUnsafeProfilePath) {
|
|
178
|
-
|
|
220
|
+
setCookieDiagnostic("Configured Chromium profile must resolve inside the browser profile root.", attempts);
|
|
179
221
|
}
|
|
180
222
|
else if (!sawCookieDatabase) {
|
|
181
|
-
|
|
223
|
+
setCookieDiagnostic(requestedProfile
|
|
182
224
|
? `Chromium profile '${requestedProfile}' does not contain a cookie database.`
|
|
183
|
-
: "No detected Chromium profile contains a cookie database.";
|
|
225
|
+
: "No detected Chromium profile contains a cookie database.", attempts);
|
|
184
226
|
}
|
|
185
227
|
else if (requiredCookies?.length && !sawRequiredCookies) {
|
|
186
|
-
|
|
228
|
+
setCookieDiagnostic(`No detected Chromium profile contains the required ${options.requiredLabel ?? "browser"} cookies.`, attempts);
|
|
187
229
|
}
|
|
188
230
|
else if (sawWindowsAppBoundCookie) {
|
|
189
|
-
|
|
231
|
+
setCookieDiagnostic("Windows Chromium v20 app-bound cookies are not supported.", attempts);
|
|
232
|
+
}
|
|
233
|
+
else if (warningSet.size > 0) {
|
|
234
|
+
setCookieDiagnostic([...warningSet][0], attempts);
|
|
235
|
+
}
|
|
236
|
+
else if (sawDecryptionFailure) {
|
|
237
|
+
setCookieDiagnostic(`Required ${options.requiredLabel ?? "browser"} cookies could not be decrypted.`, attempts);
|
|
190
238
|
}
|
|
191
239
|
else if (!sawAnyHostCookie) {
|
|
192
|
-
|
|
240
|
+
setCookieDiagnostic(options.requestUrl
|
|
193
241
|
? "No detected Chromium profile contains cookies for the requested URL."
|
|
194
|
-
: "No detected Chromium profile contains cookies for the requested host.";
|
|
195
|
-
}
|
|
196
|
-
else if (warningSet.size > 0) {
|
|
197
|
-
lastCookieDiagnostic = [...warningSet][0];
|
|
242
|
+
: "No detected Chromium profile contains cookies for the requested host.", attempts);
|
|
198
243
|
}
|
|
199
244
|
else {
|
|
200
|
-
|
|
245
|
+
setCookieDiagnostic("Required Gemini cookies were not available or could not be decrypted.", attempts);
|
|
201
246
|
}
|
|
202
247
|
return null;
|
|
203
248
|
}
|
|
249
|
+
function setCookieDiagnostic(message, attempts = []) {
|
|
250
|
+
lastCookieDiagnostic = message;
|
|
251
|
+
lastCookieDiagnosticDetails = { message, attempts };
|
|
252
|
+
}
|
|
253
|
+
function recordCookieAttempt(attempts, config, profile, status) {
|
|
254
|
+
attempts.push({ browser: config.name, profile, status });
|
|
255
|
+
}
|
|
204
256
|
function normalizeProfileName(value) {
|
|
205
257
|
if (typeof value !== "string")
|
|
206
258
|
return undefined;
|