@executor-js/plugin-mcp 0.2.1 → 1.4.21
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/dist/{AddMcpSource-VM3HY26S.js → AddMcpSource-TLAL463B.js} +3 -3
- package/dist/{EditMcpSource-WELWGRJG.js → EditMcpSource-CWN6HIC4.js} +4 -4
- package/dist/EditMcpSource-CWN6HIC4.js.map +1 -0
- package/dist/{McpSourceSummary-7TDQXLT5.js → McpSourceSummary-257JNETP.js} +3 -3
- package/dist/api/group.d.ts +77 -5
- package/dist/api/index.d.ts +115 -5
- package/dist/{chunk-2ETJ6LQH.js → chunk-4ORPFRLI.js} +6 -7
- package/dist/chunk-4ORPFRLI.js.map +1 -0
- package/dist/{chunk-Z4CRPOLI.js → chunk-M6REVU6O.js} +8 -15
- package/dist/chunk-M6REVU6O.js.map +1 -0
- package/dist/{chunk-OOOH3IO4.js → chunk-NQT7NAGE.js} +95 -12
- package/dist/chunk-NQT7NAGE.js.map +1 -0
- package/dist/client.js +3 -3
- package/dist/core.js +2 -2
- package/dist/index.js +2 -2
- package/dist/react/atoms.d.ts +83 -3
- package/dist/react/client.d.ts +77 -3
- package/dist/sdk/plugin.d.ts +38 -2
- package/dist/sdk/stored-source.d.ts +3 -5
- package/dist/sdk/types.d.ts +8 -28
- package/package.json +4 -4
- package/dist/EditMcpSource-WELWGRJG.js.map +0 -1
- package/dist/chunk-2ETJ6LQH.js.map +0 -1
- package/dist/chunk-OOOH3IO4.js.map +0 -1
- package/dist/chunk-Z4CRPOLI.js.map +0 -1
- /package/dist/{AddMcpSource-VM3HY26S.js.map → AddMcpSource-TLAL463B.js.map} +0 -0
- /package/dist/{McpSourceSummary-7TDQXLT5.js.map → McpSourceSummary-257JNETP.js.map} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
McpToolDiscoveryError,
|
|
13
13
|
mcpHeaderSlot,
|
|
14
14
|
mcpQueryParamSlot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-M6REVU6O.js";
|
|
16
16
|
|
|
17
17
|
// src/sdk/binding-store.ts
|
|
18
18
|
import { Effect, Option, Schema } from "effect";
|
|
@@ -172,7 +172,7 @@ var rowsToValueMap = (rows) => {
|
|
|
172
172
|
const name = row.name;
|
|
173
173
|
if (row.kind === "binding" && typeof row.slot_key === "string") {
|
|
174
174
|
const prefix = row.prefix;
|
|
175
|
-
out[name] = prefix ?
|
|
175
|
+
out[name] = prefix ? ConfiguredCredentialBinding.make({ kind: "binding", slot: row.slot_key, prefix }) : ConfiguredCredentialBinding.make({ kind: "binding", slot: row.slot_key });
|
|
176
176
|
} else if (row.kind === "text" && typeof row.text_value === "string") {
|
|
177
177
|
out[name] = row.text_value;
|
|
178
178
|
}
|
|
@@ -668,11 +668,11 @@ var McpElicitParams = Schema3.Union([
|
|
|
668
668
|
})
|
|
669
669
|
]);
|
|
670
670
|
var decodeElicitParams = Schema3.decodeUnknownSync(McpElicitParams);
|
|
671
|
-
var toElicitationRequest = (params) => params.mode === "url" ?
|
|
671
|
+
var toElicitationRequest = (params) => params.mode === "url" ? UrlElicitation.make({
|
|
672
672
|
message: params.message,
|
|
673
673
|
url: params.url,
|
|
674
674
|
elicitationId: params.elicitationId ?? params.id ?? ""
|
|
675
|
-
}) :
|
|
675
|
+
}) : FormElicitation.make({
|
|
676
676
|
message: params.message,
|
|
677
677
|
requestedSchema: params.requestedSchema
|
|
678
678
|
});
|
|
@@ -960,7 +960,7 @@ var normalizeNamespace = (config) => config.namespace ?? deriveMcpNamespace({
|
|
|
960
960
|
endpoint: config.transport === "remote" ? config.endpoint : void 0,
|
|
961
961
|
command: config.transport === "stdio" ? config.command : void 0
|
|
962
962
|
});
|
|
963
|
-
var toBinding = (entry) =>
|
|
963
|
+
var toBinding = (entry) => McpToolBinding.make({
|
|
964
964
|
toolId: entry.toolId,
|
|
965
965
|
toolName: entry.toolName,
|
|
966
966
|
description: entry.description,
|
|
@@ -991,7 +991,7 @@ var userFacingProbeMessage = (shape) => {
|
|
|
991
991
|
};
|
|
992
992
|
var scopeRanks = (ctx) => new Map(ctx.scopes.map((scope, index) => [String(scope.id), index]));
|
|
993
993
|
var scopeRank = (ranks, scopeId) => ranks.get(scopeId) ?? Infinity;
|
|
994
|
-
var coreBindingToMcpBinding = (binding) =>
|
|
994
|
+
var coreBindingToMcpBinding = (binding) => McpSourceBindingRef.make({
|
|
995
995
|
sourceId: binding.sourceId,
|
|
996
996
|
sourceScopeId: binding.sourceScopeId,
|
|
997
997
|
scopeId: binding.scopeId,
|
|
@@ -1082,7 +1082,7 @@ var canonicalizeCredentialMap = (values, slotForName) => {
|
|
|
1082
1082
|
continue;
|
|
1083
1083
|
}
|
|
1084
1084
|
const slot = slotForName(name);
|
|
1085
|
-
nextValues[name] =
|
|
1085
|
+
nextValues[name] = ConfiguredCredentialBinding2.make({
|
|
1086
1086
|
kind: "binding",
|
|
1087
1087
|
slot,
|
|
1088
1088
|
prefix: value.prefix
|
|
@@ -1497,6 +1497,70 @@ var authToConfig = (auth) => {
|
|
|
1497
1497
|
connectionId: auth.connectionId
|
|
1498
1498
|
};
|
|
1499
1499
|
};
|
|
1500
|
+
var toCredentialInput = (bySlot, configured) => {
|
|
1501
|
+
if (typeof configured === "string") return configured;
|
|
1502
|
+
const value = bySlot.get(configured.slot);
|
|
1503
|
+
if (!value) return void 0;
|
|
1504
|
+
if (value.kind === "secret") {
|
|
1505
|
+
return {
|
|
1506
|
+
secretId: value.secretId,
|
|
1507
|
+
...configured.prefix ? { prefix: configured.prefix } : {}
|
|
1508
|
+
};
|
|
1509
|
+
}
|
|
1510
|
+
if (value.kind === "text") return value.text;
|
|
1511
|
+
return void 0;
|
|
1512
|
+
};
|
|
1513
|
+
var toCredentialInputMap = (bySlot, values) => {
|
|
1514
|
+
if (!values) return void 0;
|
|
1515
|
+
const out = {};
|
|
1516
|
+
for (const [name, configured] of Object.entries(values)) {
|
|
1517
|
+
const input = toCredentialInput(bySlot, configured);
|
|
1518
|
+
if (input !== void 0) out[name] = input;
|
|
1519
|
+
}
|
|
1520
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
1521
|
+
};
|
|
1522
|
+
var toAuthInput = (bySlot, auth) => {
|
|
1523
|
+
if (auth.kind === "none") return { kind: "none" };
|
|
1524
|
+
if (auth.kind === "header") {
|
|
1525
|
+
const value = bySlot.get(auth.secretSlot);
|
|
1526
|
+
if (value?.kind !== "secret") return void 0;
|
|
1527
|
+
return {
|
|
1528
|
+
kind: "header",
|
|
1529
|
+
headerName: auth.headerName,
|
|
1530
|
+
secretId: value.secretId,
|
|
1531
|
+
prefix: auth.prefix
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
const connection = bySlot.get(auth.connectionSlot);
|
|
1535
|
+
if (connection?.kind !== "connection") return void 0;
|
|
1536
|
+
return { kind: "oauth2", connectionId: connection.connectionId };
|
|
1537
|
+
};
|
|
1538
|
+
var inputFormFromStored = (bindings, stored, scope, sourceName, namespace) => {
|
|
1539
|
+
if (stored.transport === "stdio") {
|
|
1540
|
+
return {
|
|
1541
|
+
transport: "stdio",
|
|
1542
|
+
scope,
|
|
1543
|
+
name: sourceName,
|
|
1544
|
+
namespace,
|
|
1545
|
+
command: stored.command,
|
|
1546
|
+
args: stored.args ? [...stored.args] : void 0,
|
|
1547
|
+
env: stored.env,
|
|
1548
|
+
cwd: stored.cwd
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
const bySlot = new Map(bindings.map((b) => [b.slotKey, b.value]));
|
|
1552
|
+
return {
|
|
1553
|
+
transport: "remote",
|
|
1554
|
+
scope,
|
|
1555
|
+
name: sourceName,
|
|
1556
|
+
namespace,
|
|
1557
|
+
endpoint: stored.endpoint,
|
|
1558
|
+
remoteTransport: stored.remoteTransport,
|
|
1559
|
+
headers: toCredentialInputMap(bySlot, stored.headers),
|
|
1560
|
+
queryParams: toCredentialInputMap(bySlot, stored.queryParams),
|
|
1561
|
+
auth: toAuthInput(bySlot, stored.auth)
|
|
1562
|
+
};
|
|
1563
|
+
};
|
|
1500
1564
|
var toMcpConfigEntry = (namespace, sourceName, config) => {
|
|
1501
1565
|
if (config.transport === "stdio") {
|
|
1502
1566
|
const entry2 = {
|
|
@@ -1921,6 +1985,7 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
1921
1985
|
...canonicalAuth ? { auth: canonicalAuth.auth } : {},
|
|
1922
1986
|
...canonicalQueryParams ? { queryParams: canonicalQueryParams.values } : {}
|
|
1923
1987
|
};
|
|
1988
|
+
const sourceName = input.name?.trim() || existing.name;
|
|
1924
1989
|
const affectedPrefixes = [
|
|
1925
1990
|
...input.headers !== void 0 ? ["header:"] : [],
|
|
1926
1991
|
...input.queryParams !== void 0 ? ["query_param:"] : [],
|
|
@@ -1932,7 +1997,7 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
1932
1997
|
yield* ctx.storage.putSource({
|
|
1933
1998
|
namespace,
|
|
1934
1999
|
scope,
|
|
1935
|
-
name:
|
|
2000
|
+
name: sourceName,
|
|
1936
2001
|
config: updatedConfig
|
|
1937
2002
|
});
|
|
1938
2003
|
if (affectedPrefixes.length > 0 || directBindings.length > 0) {
|
|
@@ -1950,6 +2015,21 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
1950
2015
|
}
|
|
1951
2016
|
})
|
|
1952
2017
|
);
|
|
2018
|
+
if (configFile) {
|
|
2019
|
+
const bindings = yield* ctx.credentialBindings.listForSource({
|
|
2020
|
+
pluginId: MCP_PLUGIN_ID,
|
|
2021
|
+
sourceId: namespace,
|
|
2022
|
+
sourceScope: ScopeId.make(scope)
|
|
2023
|
+
});
|
|
2024
|
+
const inputForm = inputFormFromStored(
|
|
2025
|
+
bindings,
|
|
2026
|
+
updatedConfig,
|
|
2027
|
+
scope,
|
|
2028
|
+
sourceName,
|
|
2029
|
+
namespace
|
|
2030
|
+
);
|
|
2031
|
+
yield* configFile.upsertSource(toMcpConfigEntry(namespace, sourceName, inputForm)).pipe(Effect6.withSpan("mcp.plugin.config_file.upsert"));
|
|
2032
|
+
}
|
|
1953
2033
|
}).pipe(
|
|
1954
2034
|
Effect6.withSpan("mcp.plugin.update_source", {
|
|
1955
2035
|
attributes: { "mcp.source.namespace": namespace }
|
|
@@ -2089,7 +2169,7 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
2089
2169
|
Effect6.withSpan("mcp.plugin.discover_tools")
|
|
2090
2170
|
);
|
|
2091
2171
|
if (connected) {
|
|
2092
|
-
return
|
|
2172
|
+
return SourceDetectionResult.make({
|
|
2093
2173
|
kind: "mcp",
|
|
2094
2174
|
confidence: "high",
|
|
2095
2175
|
endpoint: trimmed,
|
|
@@ -2099,7 +2179,7 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
2099
2179
|
}
|
|
2100
2180
|
const shape = yield* probeMcpEndpointShape(trimmed, { httpClientLayer });
|
|
2101
2181
|
if (shape.kind === "mcp") {
|
|
2102
|
-
return
|
|
2182
|
+
return SourceDetectionResult.make({
|
|
2103
2183
|
kind: "mcp",
|
|
2104
2184
|
confidence: "high",
|
|
2105
2185
|
endpoint: trimmed,
|
|
@@ -2108,7 +2188,7 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
2108
2188
|
});
|
|
2109
2189
|
}
|
|
2110
2190
|
if (urlMatchesToken(parsed.value, "mcp")) {
|
|
2111
|
-
return
|
|
2191
|
+
return SourceDetectionResult.make({
|
|
2112
2192
|
kind: "mcp",
|
|
2113
2193
|
confidence: "low",
|
|
2114
2194
|
endpoint: trimmed,
|
|
@@ -2167,6 +2247,9 @@ var mcpPlugin = definePlugin((options) => {
|
|
|
2167
2247
|
yield* ctx.storage.removeSource(sourceId, scope);
|
|
2168
2248
|
})
|
|
2169
2249
|
);
|
|
2250
|
+
if (options?.configFile) {
|
|
2251
|
+
yield* options.configFile.removeSource(sourceId);
|
|
2252
|
+
}
|
|
2170
2253
|
}),
|
|
2171
2254
|
usagesForSecret: () => Effect6.succeed([]),
|
|
2172
2255
|
usagesForConnection: () => Effect6.succeed([]),
|
|
@@ -2191,4 +2274,4 @@ export {
|
|
|
2191
2274
|
makeMcpStore,
|
|
2192
2275
|
mcpPlugin
|
|
2193
2276
|
};
|
|
2194
|
-
//# sourceMappingURL=chunk-
|
|
2277
|
+
//# sourceMappingURL=chunk-NQT7NAGE.js.map
|