@herbertgao/pi-extensions 2026.9.10 → 2026.9.12
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/README.md +1 -0
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/node_modules/@herbertgao/pi-bark/package.json +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -2
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +2 -2
- package/node_modules/@herbertgao/resume-from/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/README.md +3 -3
- package/node_modules/@herbertgao/sol-pi/THIRD_PARTY_NOTICES.md +4 -4
- package/node_modules/@herbertgao/sol-pi/agents-install.md +4 -4
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +6 -6
- package/node_modules/@herbertgao/sol-pi/package.json +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
- package/node_modules/@narumitw/pi-btw/dist/index.ts +39 -89
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
- package/node_modules/@narumitw/pi-btw/package.json +4 -4
- package/node_modules/@narumitw/pi-btw/src/btw.ts +28 -87
- package/node_modules/@narumitw/pi-btw/src/main-tree-picker.ts +8 -0
- package/node_modules/@narumitw/pi-btw/src/side-thread.ts +40 -37
- package/node_modules/@narumitw/pi-caffeinate/README.md +21 -66
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +10 -41
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +50 -51
- package/node_modules/@narumitw/pi-caffeinate/src/caffeinate.ts +637 -663
- package/node_modules/@narumitw/pi-caffeinate/src/dbus-inhibit.ts +114 -120
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +29 -29
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitors.ts +108 -126
- package/node_modules/@narumitw/pi-caffeinate/src/settings.ts +124 -128
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +62 -0
- package/node_modules/pi-mcp-adapter/README.md +75 -7
- package/node_modules/pi-mcp-adapter/bearer-command-resolver.ts +193 -0
- package/node_modules/pi-mcp-adapter/cli.js +56 -5
- package/node_modules/pi-mcp-adapter/commands.ts +96 -5
- package/node_modules/pi-mcp-adapter/config.ts +73 -6
- package/node_modules/pi-mcp-adapter/direct-tool-surface.ts +22 -28
- package/node_modules/pi-mcp-adapter/direct-tools.ts +13 -5
- package/node_modules/pi-mcp-adapter/dist/abort.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/abort.js +36 -0
- package/node_modules/pi-mcp-adapter/dist/abort.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js +194 -0
- package/node_modules/pi-mcp-adapter/dist/bearer-command-resolver.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/config.d.ts +5 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +75 -6
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/consent-manager.d.ts +18 -0
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js +88 -0
- package/node_modules/pi-mcp-adapter/dist/consent-manager.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js +316 -0
- package/node_modules/pi-mcp-adapter/dist/elicitation-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/errors.d.ts +131 -0
- package/node_modules/pi-mcp-adapter/dist/errors.js +278 -0
- package/node_modules/pi-mcp-adapter/dist/errors.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.d.ts +8 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.js +88 -0
- package/node_modules/pi-mcp-adapter/dist/http-ca.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.d.ts +15 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.js +340 -0
- package/node_modules/pi-mcp-adapter/dist/jev-client.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.d.ts +77 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js +2 -0
- package/node_modules/pi-mcp-adapter/dist/jev-contracts.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.d.ts +22 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js +85 -0
- package/node_modules/pi-mcp-adapter/dist/jev-key-store.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js +55 -0
- package/node_modules/pi-mcp-adapter/dist/json-schema-validator.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.d.ts +56 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js +410 -0
- package/node_modules/pi-mcp-adapter/dist/lifecycle.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/logger.d.ts +51 -0
- package/node_modules/pi-mcp-adapter/dist/logger.js +131 -0
- package/node_modules/pi-mcp-adapter/dist/logger.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.d.ts +26 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js +103 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-fetch.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.d.ts +118 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js +1098 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth-flow.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.d.ts +168 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js +1117 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-auth.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +7 -140
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.d.ts +53 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js +441 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-callback-server.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.d.ts +148 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js +689 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-oauth-provider.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js +166 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-probe.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.d.ts +102 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js +369 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-tasks.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.d.ts +95 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js +242 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-trace.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +2 -11
- package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.d.ts +6 -0
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js +505 -0
- package/node_modules/pi-mcp-adapter/dist/npx-resolver.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.d.ts +10 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js +312 -0
- package/node_modules/pi-mcp-adapter/dist/request-headers-command.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.d.ts +13 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js +97 -0
- package/node_modules/pi-mcp-adapter/dist/runtime-owner.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js +203 -0
- package/node_modules/pi-mcp-adapter/dist/sampling-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.d.ts +11 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js +172 -0
- package/node_modules/pi-mcp-adapter/dist/secure-keyring.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.d.ts +157 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.js +1743 -0
- package/node_modules/pi-mcp-adapter/dist/server-manager.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.d.ts +34 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js +140 -0
- package/node_modules/pi-mcp-adapter/dist/session-approvals.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.d.ts +26 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js +142 -0
- package/node_modules/pi-mcp-adapter/dist/session-recovery.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/state.d.ts +73 -0
- package/node_modules/pi-mcp-adapter/dist/state.js +2 -0
- package/node_modules/pi-mcp-adapter/dist/state.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +36 -0
- package/node_modules/pi-mcp-adapter/dist/types.js +18 -0
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.d.ts +17 -0
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js +219 -0
- package/node_modules/pi-mcp-adapter/dist/ui-resource-handler.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.d.ts +15 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js +85 -0
- package/node_modules/pi-mcp-adapter/dist/unix-socket-transport.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.d.ts +1 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js +13 -0
- package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -1
- package/node_modules/pi-mcp-adapter/elicitation-handler.ts +29 -19
- package/node_modules/pi-mcp-adapter/examples/jev-accessibility-loop.mjs +85 -0
- package/node_modules/pi-mcp-adapter/examples/jev-semantic-filter.mjs +34 -0
- package/node_modules/pi-mcp-adapter/index.ts +129 -6
- package/node_modules/pi-mcp-adapter/init.ts +6 -19
- package/node_modules/pi-mcp-adapter/jev-client.ts +273 -0
- package/node_modules/pi-mcp-adapter/jev-contracts.ts +53 -0
- package/node_modules/pi-mcp-adapter/jev-key-store.ts +79 -0
- package/node_modules/pi-mcp-adapter/lifecycle.ts +14 -3
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +7 -142
- package/node_modules/pi-mcp-adapter/mcp-code.ts +119 -11
- package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +4 -0
- package/node_modules/pi-mcp-adapter/mcp-references.ts +5 -3
- package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +5 -0
- package/node_modules/pi-mcp-adapter/mcp-tasks.ts +467 -0
- package/node_modules/pi-mcp-adapter/metadata-cache.ts +2 -13
- package/node_modules/pi-mcp-adapter/namespace-tools.ts +1 -1
- package/node_modules/pi-mcp-adapter/package.json +17 -9
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +319 -166
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +6 -3
- package/node_modules/pi-mcp-adapter/search-ranking.ts +38 -7
- package/node_modules/pi-mcp-adapter/secure-keyring.ts +170 -0
- package/node_modules/pi-mcp-adapter/semantic-search.ts +186 -0
- package/node_modules/pi-mcp-adapter/server-manager.ts +293 -50
- package/node_modules/pi-mcp-adapter/session-approvals.ts +14 -0
- package/node_modules/pi-mcp-adapter/skills/mcp-scripting/SKILL.md +2 -0
- package/node_modules/pi-mcp-adapter/state.ts +3 -1
- package/node_modules/pi-mcp-adapter/tool-approval.ts +26 -4
- package/node_modules/pi-mcp-adapter/tool-metadata.ts +6 -14
- package/node_modules/pi-mcp-adapter/tool-registrar.ts +8 -6
- package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +4 -1
- package/node_modules/pi-mcp-adapter/types.ts +53 -0
- package/node_modules/pi-mcp-adapter/ui-server.ts +17 -9
- package/node_modules/pi-mcp-adapter/utils.ts +16 -0
- package/node_modules/pi-multi-account/CHANGELOG.md +1209 -0
- package/node_modules/pi-multi-account/CONTRIBUTING.md +61 -0
- package/node_modules/pi-multi-account/LICENSE +21 -0
- package/node_modules/pi-multi-account/README.md +197 -0
- package/node_modules/pi-multi-account/SECURITY.md +27 -0
- package/node_modules/pi-multi-account/auth-file-transaction.ts +56 -0
- package/node_modules/pi-multi-account/child-usability.ts +233 -0
- package/node_modules/pi-multi-account/compaction-summary.ts +32 -0
- package/node_modules/pi-multi-account/completion-route-planner.ts +224 -0
- package/node_modules/pi-multi-account/context-guard.ts +420 -0
- package/node_modules/pi-multi-account/cursor/LICENSE +21 -0
- package/node_modules/pi-multi-account/cursor/NOTICE +2 -0
- package/node_modules/pi-multi-account/cursor/auth.ts +165 -0
- package/node_modules/pi-multi-account/cursor/bridge-handle.ts +155 -0
- package/node_modules/pi-multi-account/cursor/conversation-registry.ts +104 -0
- package/node_modules/pi-multi-account/cursor/cursor-models-raw.json +611 -0
- package/node_modules/pi-multi-account/cursor/cursor-shared.ts +192 -0
- package/node_modules/pi-multi-account/cursor/h2-bridge.mjs +175 -0
- package/node_modules/pi-multi-account/cursor/index.ts +572 -0
- package/node_modules/pi-multi-account/cursor/message-parsing.ts +323 -0
- package/node_modules/pi-multi-account/cursor/prompt-usage.ts +53 -0
- package/node_modules/pi-multi-account/cursor/proto/agent_pb.ts +15294 -0
- package/node_modules/pi-multi-account/cursor/proxy.ts +2510 -0
- package/node_modules/pi-multi-account/cursor/session-lifecycle.ts +40 -0
- package/node_modules/pi-multi-account/cursor/sse-keepalive.ts +24 -0
- package/node_modules/pi-multi-account/cursor/stream-lifecycle.ts +193 -0
- package/node_modules/pi-multi-account/cursor/upstream-watchdog.ts +88 -0
- package/node_modules/pi-multi-account/cursor-bridge.ts +240 -0
- package/node_modules/pi-multi-account/cursor-model-name.ts +12 -0
- package/node_modules/pi-multi-account/index.ts +11825 -0
- package/node_modules/pi-multi-account/model-catalog.ts +354 -0
- package/node_modules/pi-multi-account/package.json +101 -0
- package/node_modules/pi-multi-account/pi-contract.ts +281 -0
- package/node_modules/pi-multi-account/provider-payload-stream.ts +44 -0
- package/node_modules/pi-multi-account/provider-priority.ts +189 -0
- package/node_modules/pi-multi-account/slot-proxy-auth.ts +167 -0
- package/node_modules/pi-multi-account/slot-proxy.ts +344 -0
- package/node_modules/pi-multi-account/state-file-transaction.ts +67 -0
- package/node_modules/pi-multi-account/usage.ts +1099 -0
- package/node_modules/pi-typesafe/README.md +6 -2
- package/node_modules/pi-typesafe/dist/client.d.ts +11 -0
- package/node_modules/pi-typesafe/dist/client.js +45 -10
- package/node_modules/pi-typesafe/dist/index.d.ts +2 -2
- package/node_modules/pi-typesafe/dist/index.js +1 -1
- package/node_modules/pi-typesafe/package.json +2 -2
- package/node_modules/pi-web-access/CHANGELOG.md +36 -0
- package/node_modules/pi-web-access/README.md +75 -18
- package/node_modules/pi-web-access/anysearch.ts +4 -15
- package/node_modules/pi-web-access/bocha.ts +3 -22
- package/node_modules/pi-web-access/brave.ts +3 -21
- package/node_modules/pi-web-access/brightdata.ts +5 -32
- package/node_modules/pi-web-access/content-find.ts +168 -53
- package/node_modules/pi-web-access/curator-page.ts +4 -1
- package/node_modules/pi-web-access/curator-run.ts +2 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/dist/index.js +24620 -0
- package/node_modules/pi-web-access/domain-filter-normalization.ts +14 -0
- package/node_modules/pi-web-access/duckduckgo.ts +3 -21
- package/node_modules/pi-web-access/extract.ts +3 -1
- package/node_modules/pi-web-access/firecrawl.ts +5 -29
- package/node_modules/pi-web-access/gemini-search.ts +81 -32
- package/node_modules/pi-web-access/index.ts +149 -148
- package/node_modules/pi-web-access/jina-search.ts +4 -15
- package/node_modules/pi-web-access/kagi.ts +4 -13
- package/node_modules/pi-web-access/kimi-search.ts +5 -30
- package/node_modules/pi-web-access/mistral-search.ts +1 -15
- package/node_modules/pi-web-access/ollama.ts +2 -7
- package/node_modules/pi-web-access/openai-search.ts +174 -36
- package/node_modules/pi-web-access/opencode-session-headers.ts +24 -0
- package/node_modules/pi-web-access/package.json +10 -4
- package/node_modules/pi-web-access/page-query.ts +10 -2
- package/node_modules/pi-web-access/parallel.ts +1 -15
- package/node_modules/pi-web-access/pdf-extract.ts +3 -0
- package/node_modules/pi-web-access/querit.ts +5 -29
- package/node_modules/pi-web-access/search-answer-formatting.ts +11 -0
- package/node_modules/pi-web-access/search-result-count-normalization.ts +4 -0
- package/node_modules/pi-web-access/search1api.ts +5 -29
- package/node_modules/pi-web-access/searchinfinity.ts +5 -29
- package/node_modules/pi-web-access/searxng.ts +3 -21
- package/node_modules/pi-web-access/serpapi.ts +5 -28
- package/node_modules/pi-web-access/serpbase.ts +3 -22
- package/node_modules/pi-web-access/serpdive.ts +3 -21
- package/node_modules/pi-web-access/serper.ts +5 -28
- package/node_modules/pi-web-access/serply.ts +197 -0
- package/node_modules/pi-web-access/source-check.ts +11 -47
- package/node_modules/pi-web-access/summary-review.ts +7 -3
- package/node_modules/pi-web-access/tavily.ts +3 -21
- package/node_modules/pi-web-access/tinyfish.ts +5 -29
- package/node_modules/pi-web-access/utils.ts +9 -1
- package/node_modules/pi-web-access/valyu.ts +5 -28
- package/node_modules/pi-web-access/xai-search.ts +1 -15
- package/node_modules/pi-web-access/xcrawl.ts +5 -32
- package/package.json +23 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getToolUiResourceUri } from "./ui-app-bridge-helpers.ts";
|
|
2
2
|
import type { McpExtensionState } from "./state.ts";
|
|
3
3
|
import type { ToolMetadata, McpTool, McpResource, ServerEntry, ToolPrefix } from "./types.ts";
|
|
4
|
-
import { createToolSelectorCandidateIndex, formatToolName, getToolNameCandidates, isToolAllowed, resolveToolPrefix } from "./types.ts";
|
|
4
|
+
import { createToolSelectorCandidateIndex, formatToolName, getToolNameCandidates, isToolAllowed, resolveToolPrefix, resolveUniqueNameOwnership } from "./types.ts";
|
|
5
5
|
import { resourceNameToToolName } from "./resource-tools.ts";
|
|
6
6
|
import { extractToolUiStreamMode } from "./utils.ts";
|
|
7
7
|
import { extractUiToolVisibility, isUiToolVisibleToModel } from "./ui-tool-visibility.ts";
|
|
@@ -18,7 +18,6 @@ export function buildToolMetadata(
|
|
|
18
18
|
): { metadata: ToolMetadata[]; failedTools: string[] } {
|
|
19
19
|
const metadata: ToolMetadata[] = [];
|
|
20
20
|
const failedTools: string[] = [];
|
|
21
|
-
const seenNames = new Set<string>();
|
|
22
21
|
const effectivePrefix = resolveToolPrefix(definition, prefix);
|
|
23
22
|
const hasToolFilters =
|
|
24
23
|
(Array.isArray(definition.includeTools) && definition.includeTools.length > 0) ||
|
|
@@ -86,16 +85,10 @@ export function buildToolMetadata(
|
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
const name = formatToolName(tool.name, serverName, effectivePrefix);
|
|
89
|
-
if (seenNames.has(name)) {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
88
|
const uiVisibility = extractUiToolVisibility(tool._meta);
|
|
94
89
|
if (!isUiToolVisibleToModel(uiVisibility)) {
|
|
95
90
|
continue;
|
|
96
91
|
}
|
|
97
|
-
seenNames.add(name);
|
|
98
|
-
|
|
99
92
|
let uiResourceUri: string | undefined;
|
|
100
93
|
try {
|
|
101
94
|
uiResourceUri = getToolUiResourceUri({ _meta: tool._meta });
|
|
@@ -123,11 +116,6 @@ export function buildToolMetadata(
|
|
|
123
116
|
}
|
|
124
117
|
|
|
125
118
|
const name = formatToolName(baseName, serverName, effectivePrefix);
|
|
126
|
-
if (seenNames.has(name)) {
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
seenNames.add(name);
|
|
130
|
-
|
|
131
119
|
metadata.push({
|
|
132
120
|
name,
|
|
133
121
|
originalName: baseName,
|
|
@@ -137,7 +125,11 @@ export function buildToolMetadata(
|
|
|
137
125
|
}
|
|
138
126
|
}
|
|
139
127
|
|
|
140
|
-
|
|
128
|
+
const ownership = resolveUniqueNameOwnership(metadata, (tool) => tool.name);
|
|
129
|
+
for (const colliding of ownership.collisions.values()) {
|
|
130
|
+
failedTools.push(...colliding.map((tool) => tool.originalName));
|
|
131
|
+
}
|
|
132
|
+
return { metadata: ownership.unique, failedTools };
|
|
141
133
|
}
|
|
142
134
|
|
|
143
135
|
export function getToolNames(state: McpExtensionState, serverName: string): string[] {
|
|
@@ -230,18 +230,20 @@ export function transformMcpContent(content: McpContent[], scope?: object): Cont
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
|
-
* Resolve a tool result's content blocks,
|
|
234
|
-
* when content is empty.
|
|
233
|
+
* Resolve a tool result's content blocks, appending structuredContent when it
|
|
234
|
+
* coexists with ordinary content and falling back to it when content is empty.
|
|
235
235
|
*/
|
|
236
236
|
export function resolveMcpResultContent(result: Record<string, unknown>, scope?: object): ContentBlock[] {
|
|
237
237
|
const blocks = transformMcpContent((Array.isArray(result.content) ? result.content : []) as McpContent[], scope);
|
|
238
|
-
if (blocks.length > 0) return blocks;
|
|
239
|
-
|
|
240
238
|
if (result.structuredContent !== undefined && result.structuredContent !== null) {
|
|
241
|
-
|
|
239
|
+
const structured = stringifyStructuredContent(result.structuredContent);
|
|
240
|
+
if (blocks.length > 0) {
|
|
241
|
+
return [...blocks, { type: "text" as const, text: `structuredContent:\n${structured}` }];
|
|
242
|
+
}
|
|
243
|
+
return [{ type: "text" as const, text: structured }];
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
return
|
|
246
|
+
return blocks;
|
|
245
247
|
}
|
|
246
248
|
|
|
247
249
|
function stringifyStructuredContent(value: unknown): string {
|
|
@@ -225,7 +225,10 @@ export function formatMcpProxyToolCallLines(
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
if (args.connect) return [`mcp connect ${args.connect}`];
|
|
228
|
-
if (args.describe)
|
|
228
|
+
if (args.describe) {
|
|
229
|
+
const target = args.server ? `${args.describe} @ ${args.server}` : args.describe;
|
|
230
|
+
return [`mcp describe ${target}`];
|
|
231
|
+
}
|
|
229
232
|
|
|
230
233
|
if (args.search) {
|
|
231
234
|
let line = `mcp search ${args.search}`;
|
|
@@ -498,6 +498,15 @@ export interface ServerEntry {
|
|
|
498
498
|
* with no fallback. `auto` and `2026-07-28` must be set explicitly.
|
|
499
499
|
*/
|
|
500
500
|
protocolVersion?: "legacy" | "auto" | "2026-07-28";
|
|
501
|
+
/**
|
|
502
|
+
* MCP Tasks extension (io.modelcontextprotocol/tasks, SEP-2663) support.
|
|
503
|
+
* On 2026-07-28 connections where the server advertises the extension, tool
|
|
504
|
+
* calls that return a task handle are transparently polled to completion,
|
|
505
|
+
* task-time elicitation is routed through the normal elicitation UI, and
|
|
506
|
+
* aborting a call cancels the remote task. Enabled by default; set to
|
|
507
|
+
* false to keep the plain synchronous call path.
|
|
508
|
+
*/
|
|
509
|
+
tasks?: boolean;
|
|
501
510
|
// Keep configuration visible without allowing connections or execution.
|
|
502
511
|
disabled?: boolean;
|
|
503
512
|
}
|
|
@@ -576,6 +585,8 @@ export interface McpToolApprovalRequest {
|
|
|
576
585
|
claim(handler: McpToolApprovalHandler): boolean;
|
|
577
586
|
}
|
|
578
587
|
|
|
588
|
+
export type { JevAnswer, JevErrorCode, JevEvaluateInput, JevEvaluationData, JevEvaluationEnvelope, JevJson, JevQuestion } from "./jev-contracts.ts";
|
|
589
|
+
|
|
579
590
|
export interface McpSettings {
|
|
580
591
|
toolPrefix?: ToolPrefix;
|
|
581
592
|
/** Show the plug prefix in MCP status and connection text (default: true). Set to false to disable it. */
|
|
@@ -593,6 +604,8 @@ export interface McpSettings {
|
|
|
593
604
|
idleTimeout?: number; // minutes, default 10, 0 to disable
|
|
594
605
|
requestTimeoutMs?: number; // milliseconds, overrides the SDK request timeout when > 0
|
|
595
606
|
directTools?: boolean | "search";
|
|
607
|
+
/** Register per-server mcp__<server> namespace proxies. Defaults to true. */
|
|
608
|
+
namespaceProxyTools?: boolean;
|
|
596
609
|
/**
|
|
597
610
|
* Validate direct-tool inputs against the advertised schema after recovering
|
|
598
611
|
* one JSON string layer for object and array properties. Defaults to false.
|
|
@@ -607,6 +620,25 @@ export interface McpSettings {
|
|
|
607
620
|
warnOnLargeDirectTools?: boolean;
|
|
608
621
|
/** Register the trusted MCP-only JavaScript scripting tool. Defaults to true; set false to hide it. */
|
|
609
622
|
scriptMode?: boolean;
|
|
623
|
+
/** Optional TypeSafe Jev integrations. A valid key enables semantic search; script evaluation remains disabled by default. */
|
|
624
|
+
jev?: false | {
|
|
625
|
+
semanticSearch?: boolean;
|
|
626
|
+
scriptEvaluation?: boolean;
|
|
627
|
+
/** Restrict semantic-search metadata and allow script-evaluation sources. Semantic search defaults to every enabled server. */
|
|
628
|
+
allowedServers?: string[];
|
|
629
|
+
model?: string;
|
|
630
|
+
requestTimeoutMs?: number;
|
|
631
|
+
maxRetries?: number;
|
|
632
|
+
maxStateBytes?: number;
|
|
633
|
+
maxQuestionsPerRequest?: number;
|
|
634
|
+
maxEvaluationsPerScript?: number;
|
|
635
|
+
maxEvaluationBytesPerScript?: number;
|
|
636
|
+
/** Cumulative provider-reported input plus output tokens per script. Defaults to 32768. */
|
|
637
|
+
maxEvaluationTokensPerScript?: number;
|
|
638
|
+
/** Maximum semantic candidates per request. Defaults to 127; range 2..127. */
|
|
639
|
+
semanticCandidateLimit?: number;
|
|
640
|
+
semanticMinProbability?: number;
|
|
641
|
+
};
|
|
610
642
|
/** Render MCP tool results as compact self-rendered rows by default, or as the legacy boxed row. */
|
|
611
643
|
toolResultRendering?: "compact" | "boxed";
|
|
612
644
|
/** 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. */
|
|
@@ -815,6 +847,9 @@ export function formatToolName(
|
|
|
815
847
|
): string {
|
|
816
848
|
const p = getServerPrefix(serverName, prefix);
|
|
817
849
|
const sanitized = toolName.replace(/\./g, "_");
|
|
850
|
+
if (p && sanitized.startsWith(`${p}_`) && sanitized.length > p.length + 1) {
|
|
851
|
+
return sanitized;
|
|
852
|
+
}
|
|
818
853
|
return p ? `${p}_${sanitized}` : sanitized;
|
|
819
854
|
}
|
|
820
855
|
|
|
@@ -825,6 +860,24 @@ export function resolveToolPrefix(
|
|
|
825
860
|
return definition?.toolPrefix ?? globalPrefix ?? "server";
|
|
826
861
|
}
|
|
827
862
|
|
|
863
|
+
/** A canonical name has an owner only when exactly one eligible entry produces it. */
|
|
864
|
+
export function resolveUniqueNameOwnership<T>(
|
|
865
|
+
entries: readonly T[],
|
|
866
|
+
getName: (entry: T) => string,
|
|
867
|
+
): { unique: T[]; collisions: Map<string, T[]> } {
|
|
868
|
+
const owners = new Map<string, T[]>();
|
|
869
|
+
for (const entry of entries) {
|
|
870
|
+
const name = getName(entry);
|
|
871
|
+
const named = owners.get(name) ?? [];
|
|
872
|
+
named.push(entry);
|
|
873
|
+
owners.set(name, named);
|
|
874
|
+
}
|
|
875
|
+
const collisions = new Map([...owners].filter(([, named]) => named.length > 1));
|
|
876
|
+
return {
|
|
877
|
+
unique: entries.filter((entry) => !collisions.has(getName(entry))),
|
|
878
|
+
collisions,
|
|
879
|
+
};
|
|
880
|
+
}
|
|
828
881
|
|
|
829
882
|
/**
|
|
830
883
|
* Resolve a configured MCP server name from a prefixed tool name.
|
|
@@ -19,10 +19,11 @@ import {
|
|
|
19
19
|
SANDBOX_RESOURCE_PATH_PREFIX,
|
|
20
20
|
} from "./sandbox-proxy-template.ts";
|
|
21
21
|
import { logger } from "./logger.ts";
|
|
22
|
-
import type { McpServerManager } from "./server-manager.ts";
|
|
22
|
+
import type { McpServerManager, ServerConnection } from "./server-manager.ts";
|
|
23
23
|
import type { McpExtensionState } from "./state.ts";
|
|
24
24
|
import { SessionRecoveryAuthRequiredError, withSessionRecovery, type SessionRecoveryDeps } from "./session-recovery.ts";
|
|
25
25
|
import { ensureToolCallApproved, isToolCallApprovalRequired } from "./tool-approval.ts";
|
|
26
|
+
import { callToolViaTaskSession } from "./mcp-tasks.ts";
|
|
26
27
|
import { extractUiToolVisibility, isUiToolCallableByApp, isUiToolVisibleToModel } from "./ui-tool-visibility.ts";
|
|
27
28
|
import { resourceNameToToolName } from "./resource-tools.ts";
|
|
28
29
|
import {
|
|
@@ -530,6 +531,19 @@ export async function startUiServer(options: UiServerOptions): Promise<UiServerH
|
|
|
530
531
|
try {
|
|
531
532
|
options.manager.touch(options.serverName);
|
|
532
533
|
options.manager.incrementInFlight(options.serverName);
|
|
534
|
+
const callTool = async (conn: ServerConnection) => {
|
|
535
|
+
await options.manager.ensureListen?.(options.serverName, conn);
|
|
536
|
+
const requestOptions = options.manager.getRequestOptions?.(options.serverName);
|
|
537
|
+
if (conn.taskSession) {
|
|
538
|
+
return callToolViaTaskSession(conn.taskSession, {
|
|
539
|
+
name: callArgs.name,
|
|
540
|
+
args: callArgs.arguments,
|
|
541
|
+
requestTimeoutMs: requestOptions?.timeout,
|
|
542
|
+
signal: requestOptions?.signal,
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
return conn.client.callTool(callArgs, requestOptions);
|
|
546
|
+
};
|
|
533
547
|
const result = options.config
|
|
534
548
|
? await withSessionRecovery(
|
|
535
549
|
{
|
|
@@ -538,15 +552,9 @@ export async function startUiServer(options: UiServerOptions): Promise<UiServerH
|
|
|
538
552
|
...(options.onNeedsAuth ? { onNeedsAuth: options.onNeedsAuth } : {}),
|
|
539
553
|
},
|
|
540
554
|
options.serverName,
|
|
541
|
-
|
|
542
|
-
await options.manager.ensureListen?.(options.serverName, conn);
|
|
543
|
-
return conn.client.callTool(callArgs, options.manager.getRequestOptions?.(options.serverName));
|
|
544
|
-
},
|
|
555
|
+
callTool,
|
|
545
556
|
)
|
|
546
|
-
: await (
|
|
547
|
-
await options.manager.ensureListen?.(options.serverName, connection);
|
|
548
|
-
return connection.client.callTool(callArgs, options.manager.getRequestOptions?.(options.serverName));
|
|
549
|
-
})();
|
|
557
|
+
: await callTool(connection);
|
|
550
558
|
sendJson(res, 200, { ok: true, result });
|
|
551
559
|
} finally {
|
|
552
560
|
options.manager.decrementInFlight(options.serverName);
|
|
@@ -426,6 +426,22 @@ export function formatMcpStatus(config: Pick<McpConfig, "settings">, message: st
|
|
|
426
426
|
return `${config.settings?.showStatusIcon === false ? "MCP: " : "🔌 MCP: "}${message}`;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
export function formatMcpFooterStatus(
|
|
430
|
+
config: Pick<McpConfig, "settings">,
|
|
431
|
+
enabledCount: number,
|
|
432
|
+
disabledCount: number,
|
|
433
|
+
connectedCount: number,
|
|
434
|
+
): string | undefined {
|
|
435
|
+
if (enabledCount + disabledCount === 0 || config.settings?.mcpFooterStatus === "off") return undefined;
|
|
436
|
+
const footerStatus = config.settings?.mcpFooterStatus ?? "full";
|
|
437
|
+
if (footerStatus === "compact") return `MCP ${connectedCount}/${enabledCount}`;
|
|
438
|
+
|
|
439
|
+
let status = `${enabledCount} ${enabledCount === 1 ? "server" : "servers"} enabled`;
|
|
440
|
+
if (connectedCount > 0) status += ` (${connectedCount} connected)`;
|
|
441
|
+
if (disabledCount > 0) status += ` (${disabledCount} disabled)`;
|
|
442
|
+
return formatMcpStatus(config, status);
|
|
443
|
+
}
|
|
444
|
+
|
|
429
445
|
/**
|
|
430
446
|
* Extract the adapter-owned UI stream mode from tool metadata.
|
|
431
447
|
*/
|