@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
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
import type { CallToolResult, ContentBlock as McpContentBlock, ListPromptsResult, ListResourcesResult, ListToolsResult, Transport as McpTransport } from "@modelcontextprotocol/client";
|
|
2
|
+
import type { TextContent, ImageContent } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { UiStreamMode, UiStreamSummary } from "./ui-stream-types.ts";
|
|
4
|
+
import type { UiToolVisibility } from "./ui-tool-visibility.ts";
|
|
5
|
+
export type Transport = McpTransport;
|
|
6
|
+
/** Versioned shared-event-bus channel for read-only MCP runtime snapshots. */
|
|
7
|
+
export declare const MCP_STATUS_EVENT = "pi-mcp-adapter/status/v1";
|
|
8
|
+
export declare const MCP_STATUS_SNAPSHOT_VERSION: 1;
|
|
9
|
+
export type McpServerRuntimeStatus = "connected" | "cached" | "failed" | "needs-auth" | "not-connected" | "disabled";
|
|
10
|
+
export interface McpServerStatusSnapshot {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly status: McpServerRuntimeStatus;
|
|
13
|
+
readonly toolCount: number;
|
|
14
|
+
readonly resourceCount?: number;
|
|
15
|
+
readonly failedAgoSeconds?: number;
|
|
16
|
+
readonly disabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface McpStatusSnapshot {
|
|
19
|
+
readonly version: typeof MCP_STATUS_SNAPSHOT_VERSION;
|
|
20
|
+
readonly servers: ReadonlyArray<McpServerStatusSnapshot>;
|
|
21
|
+
readonly totalTools: number;
|
|
22
|
+
readonly totalResources: number;
|
|
23
|
+
readonly connectedCount: number;
|
|
24
|
+
readonly disabledCount: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Minimal event-bus surface the status publisher needs. Lives here (leaf
|
|
28
|
+
* module) so `state.ts` can reference it without importing `mcp-status.ts`,
|
|
29
|
+
* which imports the state type back — an import cycle at type level.
|
|
30
|
+
*/
|
|
31
|
+
export interface McpStatusEventBus {
|
|
32
|
+
emit(channel: string, data: unknown): void;
|
|
33
|
+
}
|
|
34
|
+
export type ImportKind = "cursor" | "claude-code" | "claude-desktop" | "codex" | "opencode" | "windsurf" | "vscode";
|
|
35
|
+
type SdkTool = ListToolsResult["tools"][number];
|
|
36
|
+
type SdkResource = ListResourcesResult["resources"][number];
|
|
37
|
+
type SdkPrompt = ListPromptsResult["prompts"][number];
|
|
38
|
+
type SdkPromptArgument = NonNullable<SdkPrompt["arguments"]>[number];
|
|
39
|
+
export interface McpTool {
|
|
40
|
+
name: SdkTool["name"];
|
|
41
|
+
title?: SdkTool["title"];
|
|
42
|
+
description?: SdkTool["description"];
|
|
43
|
+
inputSchema?: SdkTool["inputSchema"];
|
|
44
|
+
_meta?: SdkTool["_meta"];
|
|
45
|
+
}
|
|
46
|
+
export interface McpResource {
|
|
47
|
+
uri: SdkResource["uri"];
|
|
48
|
+
name: SdkResource["name"];
|
|
49
|
+
description?: SdkResource["description"];
|
|
50
|
+
mimeType?: SdkResource["mimeType"];
|
|
51
|
+
_meta?: SdkResource["_meta"];
|
|
52
|
+
}
|
|
53
|
+
export interface McpPromptArgument {
|
|
54
|
+
name: SdkPromptArgument["name"];
|
|
55
|
+
description?: SdkPromptArgument["description"];
|
|
56
|
+
required?: SdkPromptArgument["required"];
|
|
57
|
+
}
|
|
58
|
+
export interface McpPrompt {
|
|
59
|
+
name: SdkPrompt["name"];
|
|
60
|
+
title?: SdkPrompt["title"];
|
|
61
|
+
description?: SdkPrompt["description"];
|
|
62
|
+
arguments?: SdkPrompt["arguments"];
|
|
63
|
+
_meta?: SdkPrompt["_meta"];
|
|
64
|
+
}
|
|
65
|
+
export interface UiResourceMeta {
|
|
66
|
+
csp?: UiResourceCsp;
|
|
67
|
+
permissions?: UiResourcePermissions;
|
|
68
|
+
domain?: string;
|
|
69
|
+
prefersBorder?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface UiResourceContent {
|
|
72
|
+
uri: string;
|
|
73
|
+
html: string;
|
|
74
|
+
mimeType?: string;
|
|
75
|
+
meta: UiResourceMeta;
|
|
76
|
+
}
|
|
77
|
+
export interface UiProxyRequestBody<TParams> {
|
|
78
|
+
token: string;
|
|
79
|
+
params: TParams;
|
|
80
|
+
}
|
|
81
|
+
export interface UiProxyResult<T = Record<string, unknown>> {
|
|
82
|
+
ok: boolean;
|
|
83
|
+
result?: T;
|
|
84
|
+
error?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface UiResourceCsp {
|
|
87
|
+
resourceDomains?: string[];
|
|
88
|
+
connectDomains?: string[];
|
|
89
|
+
frameDomains?: string[];
|
|
90
|
+
baseUriDomains?: string[];
|
|
91
|
+
}
|
|
92
|
+
export interface UiResourcePermissions {
|
|
93
|
+
camera?: {};
|
|
94
|
+
microphone?: {};
|
|
95
|
+
geolocation?: {};
|
|
96
|
+
clipboardWrite?: {};
|
|
97
|
+
}
|
|
98
|
+
export interface UiToolInfo {
|
|
99
|
+
id?: string | number;
|
|
100
|
+
tool: {
|
|
101
|
+
name: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
inputSchema?: unknown;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface UiHostContext {
|
|
107
|
+
toolInfo?: UiToolInfo;
|
|
108
|
+
theme?: "light" | "dark";
|
|
109
|
+
styles?: Record<string, unknown>;
|
|
110
|
+
displayMode?: UiDisplayMode;
|
|
111
|
+
availableDisplayModes?: UiDisplayMode[];
|
|
112
|
+
containerDimensions?: {
|
|
113
|
+
width?: number;
|
|
114
|
+
maxWidth?: number;
|
|
115
|
+
height?: number;
|
|
116
|
+
maxHeight?: number;
|
|
117
|
+
};
|
|
118
|
+
[key: string]: unknown;
|
|
119
|
+
}
|
|
120
|
+
export type UiDisplayMode = "inline" | "fullscreen" | "pip";
|
|
121
|
+
/**
|
|
122
|
+
* Live handle to a started UI tool session. Lives here (leaf module) so
|
|
123
|
+
* `state.ts` can reference it without importing `ui-server.ts`, which
|
|
124
|
+
* imports the state type back — an import cycle at type level.
|
|
125
|
+
*/
|
|
126
|
+
export interface UiServerHandle {
|
|
127
|
+
url: string;
|
|
128
|
+
port: number;
|
|
129
|
+
sessionToken: string;
|
|
130
|
+
serverName: string;
|
|
131
|
+
toolName: string;
|
|
132
|
+
viewer?: "browser" | "glimpse" | "suppressed";
|
|
133
|
+
windowOpen?: boolean;
|
|
134
|
+
close: (reason?: string) => void;
|
|
135
|
+
sendToolInput: (args: Record<string, unknown>) => void;
|
|
136
|
+
sendToolResult: (result: CallToolResult) => void;
|
|
137
|
+
sendResultPatch: (result: CallToolResult) => void;
|
|
138
|
+
sendToolCancelled: (reason: string) => void;
|
|
139
|
+
sendHostContext: (context: UiHostContext) => void;
|
|
140
|
+
/** Get accumulated messages from this session */
|
|
141
|
+
getSessionMessages: () => UiSessionMessages;
|
|
142
|
+
getStreamSummary: () => UiStreamSummary | undefined;
|
|
143
|
+
}
|
|
144
|
+
export { UI_STREAM_HOST_CONTEXT_KEY, UI_STREAM_REQUEST_META_KEY, UI_STREAM_RESULT_PATCH_METHOD, SERVER_STREAM_RESULT_PATCH_METHOD, UI_STREAM_STRUCTURED_CONTENT_KEY, uiStreamModeSchema, visualizationStreamPhaseSchema, visualizationStreamFrameTypeSchema, visualizationStreamStatusSchema, uiStreamHostContextSchema, visualizationStreamEnvelopeSchema, uiStreamCallToolResultSchema, uiStreamResultPatchNotificationSchema, serverStreamResultPatchNotificationSchema, getUiStreamHostContext, getVisualizationStreamEnvelope, type UiStreamMode, type VisualizationStreamPhase, type VisualizationStreamFrameType, type VisualizationStreamStatus, type UiStreamHostContext, type VisualizationStreamEnvelope, type UiStreamCallToolResult, type UiStreamResultPatchNotification, type ServerStreamResultPatchNotification, type UiStreamSummary, } from "./ui-stream-types.ts";
|
|
145
|
+
export interface UiMessageParams {
|
|
146
|
+
role?: string;
|
|
147
|
+
content?: unknown[];
|
|
148
|
+
type?: "prompt" | "notify" | "intent" | "message";
|
|
149
|
+
message?: string;
|
|
150
|
+
prompt?: string;
|
|
151
|
+
intent?: string;
|
|
152
|
+
params?: Record<string, unknown>;
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Extract prompt text from either legacy MCP UI message shapes or native AppBridge user messages.
|
|
157
|
+
*/
|
|
158
|
+
export declare function extractUiPromptText(params: UiMessageParams): string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Structured UI handoff recovered from a canonical prompt envelope.
|
|
161
|
+
*/
|
|
162
|
+
export interface UiPromptHandoff {
|
|
163
|
+
intent: string;
|
|
164
|
+
params: Record<string, unknown>;
|
|
165
|
+
raw: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Parse a canonical named UI handoff encoded as `intent\n{json}`.
|
|
169
|
+
*/
|
|
170
|
+
export declare function parseUiPromptHandoff(prompt: string): UiPromptHandoff | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Accumulated messages from a UI session.
|
|
173
|
+
* Collected during the session and available when it ends.
|
|
174
|
+
*/
|
|
175
|
+
export interface UiSessionMessages {
|
|
176
|
+
prompts: string[];
|
|
177
|
+
notifications: string[];
|
|
178
|
+
intents: Array<{
|
|
179
|
+
intent: string;
|
|
180
|
+
params?: Record<string, unknown>;
|
|
181
|
+
}>;
|
|
182
|
+
contexts: UiModelContextUpdate[];
|
|
183
|
+
}
|
|
184
|
+
export interface UiModelContextUpdate {
|
|
185
|
+
summary: string;
|
|
186
|
+
truncated: boolean;
|
|
187
|
+
payload?: Record<string, unknown>;
|
|
188
|
+
}
|
|
189
|
+
export interface UiModelContextParams {
|
|
190
|
+
content?: McpContentBlock[];
|
|
191
|
+
structuredContent?: Record<string, unknown>;
|
|
192
|
+
}
|
|
193
|
+
export declare function createUiModelContextUpdate(params: UiModelContextParams, maxChars?: number): UiModelContextUpdate | undefined;
|
|
194
|
+
export interface UiOpenLinkResult {
|
|
195
|
+
isError?: boolean;
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
}
|
|
198
|
+
export interface UiDisplayModeRequest {
|
|
199
|
+
mode?: UiDisplayMode;
|
|
200
|
+
}
|
|
201
|
+
export interface UiDisplayModeResult {
|
|
202
|
+
mode: UiDisplayMode;
|
|
203
|
+
[key: string]: unknown;
|
|
204
|
+
}
|
|
205
|
+
export interface McpContent {
|
|
206
|
+
type: "text" | "image" | "audio" | "resource" | "resource_link";
|
|
207
|
+
text?: string;
|
|
208
|
+
data?: string;
|
|
209
|
+
mimeType?: string;
|
|
210
|
+
resource?: {
|
|
211
|
+
uri: string;
|
|
212
|
+
text?: string;
|
|
213
|
+
blob?: string;
|
|
214
|
+
};
|
|
215
|
+
uri?: string;
|
|
216
|
+
name?: string;
|
|
217
|
+
description?: string;
|
|
218
|
+
}
|
|
219
|
+
export type ContentBlock = TextContent | ImageContent;
|
|
220
|
+
export interface OAuthConfig {
|
|
221
|
+
/** OAuth grant type (defaults to authorization_code) */
|
|
222
|
+
grantType?: "authorization_code" | "client_credentials";
|
|
223
|
+
/** Pre-registered client ID (optional, dynamic registration used if not provided) */
|
|
224
|
+
clientId?: string;
|
|
225
|
+
/** Client secret for confidential clients */
|
|
226
|
+
clientSecret?: string;
|
|
227
|
+
/** Requested OAuth scopes */
|
|
228
|
+
scope?: string;
|
|
229
|
+
/** Extra authorization URL parameters for provider-specific extensions. Flow-owned parameters cannot be overridden. */
|
|
230
|
+
authorizationParams?: Record<string, string>;
|
|
231
|
+
/** Exact authorization-code redirect URI for pre-registered clients. HTTPS redirects use manual callback URL completion. */
|
|
232
|
+
redirectUri?: string;
|
|
233
|
+
/** Client display name for dynamic registration */
|
|
234
|
+
clientName?: string;
|
|
235
|
+
/** Client homepage URI for dynamic registration */
|
|
236
|
+
clientUri?: string;
|
|
237
|
+
/** Client logo URL for dynamic registration; shown on consent screens */
|
|
238
|
+
logoUri?: string;
|
|
239
|
+
/** HTTPS URL for an authorization-server metadata document used instead of MCP discovery */
|
|
240
|
+
authServerMetadataUrl?: string;
|
|
241
|
+
/** Security-weakening escape hatch for known-misconfigured authorization servers. */
|
|
242
|
+
skipIssuerMetadataValidation?: boolean;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Trusted executable invoked for every outbound HTTP request. The adapter
|
|
246
|
+
* writes a versioned JSON request envelope to stdin and expects a JSON object
|
|
247
|
+
* containing headers on stdout. This is intended for caller-bound signing
|
|
248
|
+
* schemes whose headers depend on the exact request body.
|
|
249
|
+
*/
|
|
250
|
+
export interface HttpRequestHeadersCommand {
|
|
251
|
+
command: string;
|
|
252
|
+
args?: string[];
|
|
253
|
+
env?: Record<string, string>;
|
|
254
|
+
timeoutMs?: number;
|
|
255
|
+
}
|
|
256
|
+
export interface ServerEntry {
|
|
257
|
+
command?: string;
|
|
258
|
+
args?: string[];
|
|
259
|
+
/** Explicit rmcp-mux Unix-domain socket path. Mutually exclusive with command and url. */
|
|
260
|
+
socket?: string;
|
|
261
|
+
env?: Record<string, string>;
|
|
262
|
+
cwd?: string;
|
|
263
|
+
url?: string;
|
|
264
|
+
headers?: Record<string, string>;
|
|
265
|
+
/** Add or replace HTTP headers by running a trusted command for each request. */
|
|
266
|
+
requestHeadersCommand?: HttpRequestHeadersCommand;
|
|
267
|
+
/**
|
|
268
|
+
* Authentication type:
|
|
269
|
+
* - 'oauth' - Use OAuth 2.1 (auto-discovers endpoints, supports dynamic client registration)
|
|
270
|
+
* - 'bearer' - Use static Bearer token
|
|
271
|
+
* - false - Disable authentication
|
|
272
|
+
* If not specified and url is present, OAuth will be auto-detected unless custom headers are configured
|
|
273
|
+
*/
|
|
274
|
+
auth?: "oauth" | "bearer" | false;
|
|
275
|
+
bearerToken?: string;
|
|
276
|
+
bearerTokenEnv?: string;
|
|
277
|
+
/** Read a static bearer token from the adapter-owned OS credential store. */
|
|
278
|
+
bearerTokenStore?: true;
|
|
279
|
+
/**
|
|
280
|
+
* OAuth configuration (optional).
|
|
281
|
+
* If not provided, the SDK will attempt dynamic client registration.
|
|
282
|
+
* Set to false to explicitly disable OAuth for this server.
|
|
283
|
+
*/
|
|
284
|
+
oauth?: OAuthConfig | false;
|
|
285
|
+
lifecycle?: "keep-alive" | "lazy" | "lazy-keep-alive" | "eager";
|
|
286
|
+
idleTimeout?: number;
|
|
287
|
+
requestTimeoutMs?: number;
|
|
288
|
+
exposeResources?: boolean;
|
|
289
|
+
directTools?: boolean | string[];
|
|
290
|
+
toolPrefix?: ToolPrefix;
|
|
291
|
+
includeTools?: string[];
|
|
292
|
+
excludeTools?: string[];
|
|
293
|
+
/**
|
|
294
|
+
* Extra search keywords per tool, keyed by original name, prefixed name, or
|
|
295
|
+
* glob (same matching rules as includeTools/excludeTools). Keywords boost
|
|
296
|
+
* mcp({ search }) ranking only — they never appear in tool schemas,
|
|
297
|
+
* describe output, or the metadata cache.
|
|
298
|
+
*/
|
|
299
|
+
searchKeywords?: Record<string, string[]>;
|
|
300
|
+
approveTools?: boolean | string[];
|
|
301
|
+
debug?: boolean;
|
|
302
|
+
/** Enable metadata-only JSONL protocol tracing for this server. */
|
|
303
|
+
trace?: boolean;
|
|
304
|
+
/** Force a specific HTTP MCP transport. Used by Agent Plugins, whose `type` declares the transport and forbids client fallback. */
|
|
305
|
+
httpTransport?: "streamable-http" | "sse";
|
|
306
|
+
/** Client-managed persistent data directory for Agent Plugin stdio servers. */
|
|
307
|
+
pluginDataDir?: string;
|
|
308
|
+
/** Treat env values as already resolved literals. Used for Agent Plugin env rules. */
|
|
309
|
+
literalEnv?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* MCP protocol era negotiation for this server. Defaults to `"legacy"`
|
|
312
|
+
* (byte-equivalent to pre-2026 behavior — no `versionNegotiation` is sent).
|
|
313
|
+
* `"auto"` offers the SDK's default 2026-07-28+ modern versions with
|
|
314
|
+
* legacy fallback; `"2026-07-28"` pins the connection to that revision
|
|
315
|
+
* with no fallback. `auto` and `2026-07-28` must be set explicitly.
|
|
316
|
+
*/
|
|
317
|
+
protocolVersion?: "legacy" | "auto" | "2026-07-28";
|
|
318
|
+
disabled?: boolean;
|
|
319
|
+
}
|
|
320
|
+
/** Only the literal boolean `true` disables a server. */
|
|
321
|
+
export declare function isServerDisabled(definition: ServerEntry | undefined): boolean;
|
|
322
|
+
export interface McpOutputGuardSettings {
|
|
323
|
+
/** Maximum inline MCP text output bytes before truncation/spill-to-disk. Defaults to 51200 (50 KiB). */
|
|
324
|
+
maxBytes?: number;
|
|
325
|
+
/** Maximum inline MCP text output lines before truncation/spill-to-disk. Defaults to 2000. */
|
|
326
|
+
maxLines?: number;
|
|
327
|
+
/** Maximum details.mcpResult JSON bytes kept raw; larger results are summarized and spilled to disk. Defaults to 16384 (16 KiB). */
|
|
328
|
+
detailsMaxBytes?: number;
|
|
329
|
+
}
|
|
330
|
+
export type ToolPrefix = "server" | "none" | "short" | "mcp";
|
|
331
|
+
export type HostConfigDiscovery = "off" | "prompt" | "on";
|
|
332
|
+
export type McpFooterStatus = "full" | "compact" | "off";
|
|
333
|
+
export interface McpTraceSettings {
|
|
334
|
+
/** Enable tracing for all servers unless a server sets trace to false. */
|
|
335
|
+
enabled?: boolean;
|
|
336
|
+
/** JSONL destination; relative paths are resolved from the session cwd. */
|
|
337
|
+
file?: string;
|
|
338
|
+
/** Maximum per-session trace file size in bytes. */
|
|
339
|
+
maxBytes?: number;
|
|
340
|
+
/** Maximum events retained in the per-session trace file. */
|
|
341
|
+
maxEvents?: number;
|
|
342
|
+
}
|
|
343
|
+
export declare const MCP_TOOL_APPROVAL_REQUEST_EVENT: "pi-mcp-adapter:tool-approval-request";
|
|
344
|
+
export type McpToolApprovalOrigin = "proxy" | "direct" | "script" | "resource" | "iframe";
|
|
345
|
+
export type McpToolApprovalDecision = "allow_once" | "allow_for_session" | "deny" | "abstain";
|
|
346
|
+
export type McpToolApprovalHandler = () => McpToolApprovalDecision | Promise<McpToolApprovalDecision>;
|
|
347
|
+
export interface McpToolApprovalRequest {
|
|
348
|
+
requestId: string;
|
|
349
|
+
serverName: string;
|
|
350
|
+
originalToolName: string;
|
|
351
|
+
prefixedToolName: string;
|
|
352
|
+
args: Record<string, unknown>;
|
|
353
|
+
origin: McpToolApprovalOrigin;
|
|
354
|
+
signal?: AbortSignal;
|
|
355
|
+
claim(handler: McpToolApprovalHandler): boolean;
|
|
356
|
+
}
|
|
357
|
+
export interface McpSettings {
|
|
358
|
+
toolPrefix?: ToolPrefix;
|
|
359
|
+
/** Show the plug prefix in MCP status and connection text (default: true). Set to false to disable it. */
|
|
360
|
+
showStatusIcon?: boolean;
|
|
361
|
+
/** Footer status verbosity: full details, compact connected/enabled count, or no footer status. Defaults to full. */
|
|
362
|
+
mcpFooterStatus?: McpFooterStatus;
|
|
363
|
+
/** Show successful startup connection notifications. Defaults to true. */
|
|
364
|
+
notifyOnStartupConnect?: boolean;
|
|
365
|
+
/** Discover detected host-specific MCP configs only when explicitly enabled. */
|
|
366
|
+
hostConfigDiscovery?: HostConfigDiscovery;
|
|
367
|
+
/** Agent Plugin package directories to load MCP servers from. */
|
|
368
|
+
agentPluginPaths?: string[];
|
|
369
|
+
idleTimeout?: number;
|
|
370
|
+
requestTimeoutMs?: number;
|
|
371
|
+
directTools?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Validate direct-tool inputs against the advertised schema after recovering
|
|
374
|
+
* one JSON string layer for object and array properties. Defaults to false.
|
|
375
|
+
*/
|
|
376
|
+
strictDirectToolArguments?: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Include the byte-bounded raw MCP result in direct-tool details. The default
|
|
379
|
+
* `lean` mode keeps the existing small details object.
|
|
380
|
+
*/
|
|
381
|
+
directToolResultDetails?: "lean" | "bounded";
|
|
382
|
+
/** Show the advisory when 75 or more direct tools resolve. Defaults to true. */
|
|
383
|
+
warnOnLargeDirectTools?: boolean;
|
|
384
|
+
/** Register the trusted MCP-only JavaScript scripting tool. Defaults to true; set false to hide it. */
|
|
385
|
+
scriptMode?: boolean;
|
|
386
|
+
/** Render MCP tool results as compact self-rendered rows by default, or as the legacy boxed row. */
|
|
387
|
+
toolResultRendering?: "compact" | "boxed";
|
|
388
|
+
/** Number of result text lines to show before expansion. Supports 1, 2, or 3. Defaults to 1 in compact mode and 3 in boxed mode. */
|
|
389
|
+
collapsedResultLines?: 1 | 2 | 3;
|
|
390
|
+
/** Default approval gate for matching tools/resources; per-server settings override it. */
|
|
391
|
+
approveTools?: boolean | string[];
|
|
392
|
+
disableProxyTool?: boolean;
|
|
393
|
+
/** Freeze direct-tool registration after the initial sync. Automatic metadata updates
|
|
394
|
+
* (reconnects, lazy-connect, tool-list-changed) won't rebuild the system prompt,
|
|
395
|
+
* preserving the prompt-cache prefix. The agent rediscovers explicitly via
|
|
396
|
+
* mcp({ connect: "server" }). Default: false. */
|
|
397
|
+
freezeDirectTools?: boolean;
|
|
398
|
+
autoAuth?: boolean;
|
|
399
|
+
sampling?: boolean;
|
|
400
|
+
samplingAutoApprove?: boolean;
|
|
401
|
+
elicitation?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* Guard oversized MCP tool/resource output before it is returned to the model.
|
|
404
|
+
* Defaults to true (50 KiB / 2,000 lines inline text, 16 KiB details.mcpResult).
|
|
405
|
+
* Set to false to restore raw MCP output behavior, or pass an object to tune
|
|
406
|
+
* the limits. Env kill switch: MCP_OUTPUT_GUARD=0.
|
|
407
|
+
*/
|
|
408
|
+
outputGuard?: boolean | McpOutputGuardSettings;
|
|
409
|
+
/**
|
|
410
|
+
* Opt-in metadata-only MCP protocol tracing. Payloads, prompts, tool
|
|
411
|
+
* arguments/results, authorization data, and URLs are never persisted.
|
|
412
|
+
*/
|
|
413
|
+
trace?: McpTraceSettings;
|
|
414
|
+
/**
|
|
415
|
+
* Message returned in tool results when a server needs (re-)authentication.
|
|
416
|
+
* "${server}" is substituted with the server name. Defaults to a TUI
|
|
417
|
+
* instruction when unset.
|
|
418
|
+
*/
|
|
419
|
+
authRequiredMessage?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Legacy OAuth tokens.json import directory.
|
|
422
|
+
* Relative paths are resolved from the project root (cwd).
|
|
423
|
+
* Takes precedence over the agent's mcp-oauth/ legacy import directory but
|
|
424
|
+
* can still be overridden by the MCP_OAUTH_DIR env variable.
|
|
425
|
+
*
|
|
426
|
+
* Persistent OAuth credentials are stored in the operating system credential
|
|
427
|
+
* store, not this directory. Existing plaintext tokens.json files found here
|
|
428
|
+
* are imported once and removed.
|
|
429
|
+
*/
|
|
430
|
+
oauthDir?: string;
|
|
431
|
+
}
|
|
432
|
+
export interface McpConfig {
|
|
433
|
+
mcpServers: Record<string, ServerEntry>;
|
|
434
|
+
imports?: ImportKind[];
|
|
435
|
+
settings?: McpSettings;
|
|
436
|
+
}
|
|
437
|
+
export interface McpAdapterOptions {
|
|
438
|
+
config?: McpConfig;
|
|
439
|
+
configPath?: string;
|
|
440
|
+
}
|
|
441
|
+
export type ServerDefinition = ServerEntry;
|
|
442
|
+
export interface ToolMetadata {
|
|
443
|
+
name: string;
|
|
444
|
+
originalName: string;
|
|
445
|
+
description: string;
|
|
446
|
+
resourceUri?: string;
|
|
447
|
+
uiResourceUri?: string;
|
|
448
|
+
uiVisibility?: UiToolVisibility[];
|
|
449
|
+
inputSchema?: unknown;
|
|
450
|
+
uiStreamMode?: UiStreamMode;
|
|
451
|
+
}
|
|
452
|
+
export interface PromptMetadata {
|
|
453
|
+
serverName: string;
|
|
454
|
+
originalName: string;
|
|
455
|
+
commandName: string;
|
|
456
|
+
title?: string;
|
|
457
|
+
description: string;
|
|
458
|
+
arguments: McpPromptArgument[];
|
|
459
|
+
}
|
|
460
|
+
export interface DirectToolSpec {
|
|
461
|
+
serverName: string;
|
|
462
|
+
originalName: string;
|
|
463
|
+
prefixedName: string;
|
|
464
|
+
description: string;
|
|
465
|
+
inputSchema?: unknown;
|
|
466
|
+
resourceUri?: string;
|
|
467
|
+
uiResourceUri?: string;
|
|
468
|
+
uiStreamMode?: UiStreamMode;
|
|
469
|
+
}
|
|
470
|
+
export interface ServerProvenance {
|
|
471
|
+
path: string;
|
|
472
|
+
kind: "user" | "project" | "import";
|
|
473
|
+
importKind?: string;
|
|
474
|
+
}
|
|
475
|
+
export interface McpAuthResult {
|
|
476
|
+
ok: boolean;
|
|
477
|
+
message?: string;
|
|
478
|
+
}
|
|
479
|
+
export interface CachedTool {
|
|
480
|
+
name: string;
|
|
481
|
+
description?: string;
|
|
482
|
+
inputSchema?: unknown;
|
|
483
|
+
uiResourceUri?: string;
|
|
484
|
+
uiVisibility?: UiToolVisibility[];
|
|
485
|
+
uiStreamMode?: "eager" | "stream-first";
|
|
486
|
+
}
|
|
487
|
+
export interface CachedResource {
|
|
488
|
+
uri: string;
|
|
489
|
+
name: string;
|
|
490
|
+
description?: string;
|
|
491
|
+
}
|
|
492
|
+
export interface CachedPrompt {
|
|
493
|
+
name: string;
|
|
494
|
+
title?: string;
|
|
495
|
+
description?: string;
|
|
496
|
+
arguments?: {
|
|
497
|
+
name: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
required?: boolean;
|
|
500
|
+
}[];
|
|
501
|
+
}
|
|
502
|
+
export interface ServerCacheEntry {
|
|
503
|
+
configHash: string;
|
|
504
|
+
tools: CachedTool[];
|
|
505
|
+
resources: CachedResource[];
|
|
506
|
+
prompts?: CachedPrompt[];
|
|
507
|
+
instructions?: string;
|
|
508
|
+
/** Server-level hints from the aggregated tools/list result. */
|
|
509
|
+
ttlMs?: ListToolsResult["ttlMs"];
|
|
510
|
+
cacheScope?: ListToolsResult["cacheScope"];
|
|
511
|
+
cachedAt: number;
|
|
512
|
+
}
|
|
513
|
+
export interface MetadataCache {
|
|
514
|
+
version: number;
|
|
515
|
+
servers: Record<string, ServerCacheEntry>;
|
|
516
|
+
}
|
|
517
|
+
export interface McpPanelCallbacks {
|
|
518
|
+
reconnect: (serverName: string) => Promise<boolean>;
|
|
519
|
+
canAuthenticate: (serverName: string) => boolean;
|
|
520
|
+
authenticate: (serverName: string) => Promise<McpAuthResult>;
|
|
521
|
+
getConnectionStatus: (serverName: string) => "connected" | "idle" | "failed" | "needs-auth" | "disabled";
|
|
522
|
+
getFailureMessage?: (serverName: string) => string | null;
|
|
523
|
+
refreshCacheAfterReconnect: (serverName: string) => ServerCacheEntry | null;
|
|
524
|
+
}
|
|
525
|
+
export interface McpPanelResult {
|
|
526
|
+
changes: Map<string, true | string[] | false>;
|
|
527
|
+
cancelled: boolean;
|
|
528
|
+
}
|
|
529
|
+
export declare function getServerPrefix(serverName: string, mode: ToolPrefix): string;
|
|
530
|
+
/**
|
|
531
|
+
* Format a tool name with server prefix.
|
|
532
|
+
*/
|
|
533
|
+
export declare function formatToolName(toolName: string, serverName: string, prefix: ToolPrefix): string;
|
|
534
|
+
export declare function resolveToolPrefix(definition?: Pick<ServerEntry, "toolPrefix">, globalPrefix?: ToolPrefix): ToolPrefix;
|
|
535
|
+
/**
|
|
536
|
+
* Resolve a configured MCP server name from a prefixed tool name.
|
|
537
|
+
*
|
|
538
|
+
* When the proxy tool is addressed with a fully-qualified name such as
|
|
539
|
+
* `searxng_searxng_web_search`, downstream policy systems (for example a
|
|
540
|
+
* permission gate) need to recover the owning server so they can evaluate
|
|
541
|
+
* server-scoped rules against the bare server name. This performs the inverse
|
|
542
|
+
* of {@link getServerPrefix}: it finds the longest configured server prefix
|
|
543
|
+
* that the tool name starts with and returns that server's name.
|
|
544
|
+
*
|
|
545
|
+
* @param toolName - the tool name as passed to the proxy `mcp({ tool })` call.
|
|
546
|
+
* @param serverNames - the configured MCP server names (keys of `mcpServers`).
|
|
547
|
+
* @param prefix - the active tool-prefix mode.
|
|
548
|
+
* @returns the resolved server name, or `undefined` when no prefix matches or
|
|
549
|
+
* the prefix mode is `"none"`.
|
|
550
|
+
*/
|
|
551
|
+
export declare function resolveServerFromToolName(toolName: string, serverNames: Iterable<string>, prefix: ToolPrefix): string | undefined;
|
|
552
|
+
export declare function sanitizePromptName(name: string): string;
|
|
553
|
+
export declare function formatPromptCommandName(promptName: string, serverName: string, prefix: ToolPrefix): string;
|
|
554
|
+
export declare function getToolNameCandidates(toolName: string, serverName: string, prefix: ToolPrefix, includeLegacy?: boolean): Set<string>;
|
|
555
|
+
export interface ToolSelectorCandidateIndex {
|
|
556
|
+
readonly allCurrentCandidates: ReadonlySet<string>;
|
|
557
|
+
readonly matchingCountByPattern: Map<string, number>;
|
|
558
|
+
readonly matcherByPattern: Map<string, RegExp>;
|
|
559
|
+
readonly additionalCurrentCandidatesByToolName?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
560
|
+
}
|
|
561
|
+
export declare function createToolSelectorCandidateIndex(allCurrentCandidates: Set<string>, additionalCurrentCandidatesByToolName?: ReadonlyMap<string, ReadonlySet<string>>): ToolSelectorCandidateIndex;
|
|
562
|
+
export declare function matchesToolPattern(candidates: Set<string>, patterns?: unknown): boolean;
|
|
563
|
+
export type ToolSelectorCandidateContext = Set<string> | ToolSelectorCandidateIndex;
|
|
564
|
+
export declare function isToolIncluded(toolName: string, serverName: string, prefix: ToolPrefix, includeTools?: unknown, otherCurrentCandidates?: ToolSelectorCandidateContext): boolean;
|
|
565
|
+
export declare function isToolExcluded(toolName: string, serverName: string, prefix: ToolPrefix, excludeTools?: unknown, otherCurrentCandidates?: ToolSelectorCandidateContext): boolean;
|
|
566
|
+
export declare function isToolAllowed(toolName: string, serverName: string, prefix: ToolPrefix, includeTools?: unknown, excludeTools?: unknown, otherCurrentCandidates?: ToolSelectorCandidateContext): boolean;
|