@executor-js/plugin-mcp 1.5.21 → 1.5.23
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-GOIRH5FQ.js → AddMcpSource-I67EKOO6.js} +28 -68
- package/dist/AddMcpSource-I67EKOO6.js.map +1 -0
- package/dist/{EditMcpSource-AS3ZTP6W.js → EditMcpSource-GPXZQFL5.js} +3 -3
- package/dist/{McpAccountsPanel-4F5WE7FH.js → McpAccountsPanel-CNUWTJ4R.js} +7 -7
- package/dist/McpAccountsPanel-CNUWTJ4R.js.map +1 -0
- package/dist/api/group.d.ts +86 -0
- package/dist/api/index.d.ts +89 -1
- package/dist/{chunk-AMC5G2HJ.js → chunk-N6NNZDXN.js} +20 -2
- package/dist/chunk-N6NNZDXN.js.map +1 -0
- package/dist/{chunk-4V3H3DDH.js → chunk-OCDAATE3.js} +24 -4
- package/dist/chunk-OCDAATE3.js.map +1 -0
- package/dist/{chunk-5GLUVX3H.js → chunk-OHITN5WV.js} +124 -9
- package/dist/chunk-OHITN5WV.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 +92 -9
- package/dist/react/client.d.ts +83 -0
- package/dist/sdk/plugin.d.ts +23 -1
- package/dist/sdk/types.d.ts +89 -2
- package/package.json +3 -3
- package/dist/AddMcpSource-GOIRH5FQ.js.map +0 -1
- package/dist/McpAccountsPanel-4F5WE7FH.js.map +0 -1
- package/dist/chunk-4V3H3DDH.js.map +0 -1
- package/dist/chunk-5GLUVX3H.js.map +0 -1
- package/dist/chunk-AMC5G2HJ.js.map +0 -1
- /package/dist/{EditMcpSource-AS3ZTP6W.js.map → EditMcpSource-GPXZQFL5.js.map} +0 -0
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
mcpAuthMethodInputFromEditorValue,
|
|
7
7
|
mcpWireAuthInput,
|
|
8
8
|
probeMcpEndpoint
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-N6NNZDXN.js";
|
|
10
|
+
import "./chunk-OCDAATE3.js";
|
|
11
11
|
|
|
12
12
|
// src/react/AddMcpSource.tsx
|
|
13
13
|
import { useReducer, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -26,9 +26,9 @@ import {
|
|
|
26
26
|
} from "@executor-js/react/components/card-stack";
|
|
27
27
|
import { FloatActions } from "@executor-js/react/components/float-actions";
|
|
28
28
|
import { Input as Input2 } from "@executor-js/react/components/input";
|
|
29
|
-
import {
|
|
30
|
-
import { Textarea as Textarea2 } from "@executor-js/react/components/textarea";
|
|
29
|
+
import { TagInput } from "@executor-js/react/components/tag-input";
|
|
31
30
|
import {
|
|
31
|
+
integrationDisplayNameFromStdio,
|
|
32
32
|
integrationDisplayNameFromUrl,
|
|
33
33
|
slugifyNamespace,
|
|
34
34
|
IntegrationIdentityFields,
|
|
@@ -178,17 +178,20 @@ function McpRemoteSourceFields(props) {
|
|
|
178
178
|
|
|
179
179
|
// src/react/AddMcpSource.tsx
|
|
180
180
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
181
|
-
var STDIO_ENV_ESCAPE_REPLACEMENTS = {
|
|
182
|
-
"\\": "\\",
|
|
183
|
-
n: "\n",
|
|
184
|
-
r: "\r",
|
|
185
|
-
t: " ",
|
|
186
|
-
'"': '"'
|
|
187
|
-
};
|
|
188
181
|
function findPreset(id) {
|
|
189
182
|
if (!id) return void 0;
|
|
190
183
|
return mcpPresets.find((p) => p.id === id);
|
|
191
184
|
}
|
|
185
|
+
function parseStdioArgs(raw) {
|
|
186
|
+
if (!raw.trim()) return [];
|
|
187
|
+
const args = [];
|
|
188
|
+
const regex = /[^\s"]+|"([^"]*)"/g;
|
|
189
|
+
let match;
|
|
190
|
+
while ((match = regex.exec(raw)) !== null) {
|
|
191
|
+
args.push(match[1] ?? match[0]);
|
|
192
|
+
}
|
|
193
|
+
return args;
|
|
194
|
+
}
|
|
192
195
|
var init = { step: "url", url: "" };
|
|
193
196
|
function reducer(state, action) {
|
|
194
197
|
return Match.value(action).pipe(
|
|
@@ -247,9 +250,9 @@ function AddMcpSource(props) {
|
|
|
247
250
|
const [stdioArgs, setStdioArgs] = useState(
|
|
248
251
|
isStdioPreset && preset.args ? preset.args.join(" ") : ""
|
|
249
252
|
);
|
|
250
|
-
const [
|
|
253
|
+
const [stdioEnvVars, setStdioEnvVars] = useState([]);
|
|
251
254
|
const stdioIdentity = useIntegrationIdentity({
|
|
252
|
-
fallbackName: isStdioPreset ? preset.name : stdioCommand
|
|
255
|
+
fallbackName: isStdioPreset ? preset.name : integrationDisplayNameFromStdio(stdioCommand, parseStdioArgs(stdioArgs), "MCP") ?? stdioCommand
|
|
253
256
|
});
|
|
254
257
|
const [stdioAdding, setStdioAdding] = useState(false);
|
|
255
258
|
const [stdioError, setStdioError] = useState(null);
|
|
@@ -363,41 +366,6 @@ function AddMcpSource(props) {
|
|
|
363
366
|
if (slug === null) return;
|
|
364
367
|
props.onComplete(slug);
|
|
365
368
|
}, [probe, authMethodList.rows, registerIntegration, props]);
|
|
366
|
-
const parseStdioArgs = (raw) => {
|
|
367
|
-
if (!raw.trim()) return [];
|
|
368
|
-
const args = [];
|
|
369
|
-
const regex = /[^\s"]+|"([^"]*)"/g;
|
|
370
|
-
let match;
|
|
371
|
-
while ((match = regex.exec(raw)) !== null) {
|
|
372
|
-
args.push(match[1] ?? match[0]);
|
|
373
|
-
}
|
|
374
|
-
return args;
|
|
375
|
-
};
|
|
376
|
-
const parseStdioEnvValue = (raw) => {
|
|
377
|
-
const value2 = raw.trim();
|
|
378
|
-
if (value2.length < 2) return value2;
|
|
379
|
-
const quote = value2[0];
|
|
380
|
-
if (quote !== '"' && quote !== "'" || value2[value2.length - 1] !== quote) {
|
|
381
|
-
return value2;
|
|
382
|
-
}
|
|
383
|
-
const inner = value2.slice(1, -1);
|
|
384
|
-
if (quote === "'") return inner;
|
|
385
|
-
return inner.replace(
|
|
386
|
-
/\\([\\nrt"])/g,
|
|
387
|
-
(_, escaped) => STDIO_ENV_ESCAPE_REPLACEMENTS[escaped] ?? escaped
|
|
388
|
-
);
|
|
389
|
-
};
|
|
390
|
-
const parseStdioEnv = (raw) => {
|
|
391
|
-
if (!raw.trim()) return void 0;
|
|
392
|
-
const env = {};
|
|
393
|
-
for (const line of raw.split("\n")) {
|
|
394
|
-
const eq = line.indexOf("=");
|
|
395
|
-
if (eq > 0) {
|
|
396
|
-
env[line.slice(0, eq).trim()] = parseStdioEnvValue(line.slice(eq + 1));
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
return Object.keys(env).length > 0 ? env : void 0;
|
|
400
|
-
};
|
|
401
369
|
const handleAddStdio = useCallback(async () => {
|
|
402
370
|
const cmd = stdioCommand.trim();
|
|
403
371
|
if (!cmd) return;
|
|
@@ -412,7 +380,7 @@ function AddMcpSource(props) {
|
|
|
412
380
|
...slug ? { slug } : {},
|
|
413
381
|
command: cmd,
|
|
414
382
|
args: parseStdioArgs(stdioArgs),
|
|
415
|
-
|
|
383
|
+
envVars: stdioEnvVars.length > 0 ? stdioEnvVars : void 0
|
|
416
384
|
},
|
|
417
385
|
reactivityKeys: integrationWriteKeys
|
|
418
386
|
});
|
|
@@ -422,7 +390,7 @@ function AddMcpSource(props) {
|
|
|
422
390
|
return;
|
|
423
391
|
}
|
|
424
392
|
props.onComplete(exit.value.slug);
|
|
425
|
-
}, [stdioCommand, stdioArgs,
|
|
393
|
+
}, [stdioCommand, stdioArgs, stdioEnvVars, stdioIdentity, doAddServer, props]);
|
|
426
394
|
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col gap-6", children: [
|
|
427
395
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
428
396
|
/* @__PURE__ */ jsx2("h1", { className: "text-xl font-semibold text-foreground", children: "Add MCP Source" }),
|
|
@@ -501,10 +469,7 @@ function AddMcpSource(props) {
|
|
|
501
469
|
children: "Cancel"
|
|
502
470
|
}
|
|
503
471
|
),
|
|
504
|
-
(probe || isProbing) && /* @__PURE__ */ jsx2(Button2, { type: "button", onClick: handleAddRemote, disabled: !canAdd,
|
|
505
|
-
/* @__PURE__ */ jsx2(Spinner, { className: "size-3.5" }),
|
|
506
|
-
" Adding\u2026"
|
|
507
|
-
] }) : "Add source" })
|
|
472
|
+
(probe || isProbing) && /* @__PURE__ */ jsx2(Button2, { type: "button", onClick: handleAddRemote, disabled: !canAdd, loading: isAdding, children: "Add source" })
|
|
508
473
|
] })
|
|
509
474
|
] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
510
475
|
/* @__PURE__ */ jsx2(CardStack2, { children: /* @__PURE__ */ jsxs2(CardStackContent2, { className: "border-t-0", children: [
|
|
@@ -544,16 +509,13 @@ function AddMcpSource(props) {
|
|
|
544
509
|
CardStackEntryField2,
|
|
545
510
|
{
|
|
546
511
|
label: "Environment variables",
|
|
547
|
-
description: "-
|
|
512
|
+
description: "- Names only; secret values are entered when you connect.",
|
|
548
513
|
children: /* @__PURE__ */ jsx2(
|
|
549
|
-
|
|
514
|
+
TagInput,
|
|
550
515
|
{
|
|
551
|
-
|
|
552
|
-
onChange:
|
|
553
|
-
placeholder: "
|
|
554
|
-
rows: 3,
|
|
555
|
-
maxRows: 10,
|
|
556
|
-
className: "font-mono text-sm"
|
|
516
|
+
values: stdioEnvVars,
|
|
517
|
+
onChange: setStdioEnvVars,
|
|
518
|
+
placeholder: "Add an env var, e.g. GITHUB_TOKEN"
|
|
557
519
|
}
|
|
558
520
|
)
|
|
559
521
|
}
|
|
@@ -578,11 +540,9 @@ function AddMcpSource(props) {
|
|
|
578
540
|
{
|
|
579
541
|
type: "button",
|
|
580
542
|
onClick: handleAddStdio,
|
|
581
|
-
disabled: !stdioCommand.trim() ||
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
" Adding\u2026"
|
|
585
|
-
] }) : "Add source"
|
|
543
|
+
disabled: !stdioCommand.trim() || stdioSlugExists,
|
|
544
|
+
loading: stdioAdding,
|
|
545
|
+
children: "Add source"
|
|
586
546
|
}
|
|
587
547
|
)
|
|
588
548
|
] })
|
|
@@ -592,4 +552,4 @@ function AddMcpSource(props) {
|
|
|
592
552
|
export {
|
|
593
553
|
AddMcpSource as default
|
|
594
554
|
};
|
|
595
|
-
//# sourceMappingURL=AddMcpSource-
|
|
555
|
+
//# sourceMappingURL=AddMcpSource-I67EKOO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/AddMcpSource.tsx","../src/react/McpRemoteSourceFields.tsx"],"sourcesContent":["import { useReducer, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useAtomSet } from \"@effect/atom-react\";\nimport * as Exit from \"effect/Exit\";\nimport * as Match from \"effect/Match\";\n\nimport { Button } from \"@executor-js/react/components/button\";\nimport {\n AuthMethodListEditor,\n useAuthMethodList,\n type AuthMethodRow,\n type AuthMethodSeed,\n} from \"@executor-js/react/components/auth-method-list-editor\";\nimport {\n CardStack,\n CardStackContent,\n CardStackEntryField,\n} from \"@executor-js/react/components/card-stack\";\nimport { FloatActions } from \"@executor-js/react/components/float-actions\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport { TagInput } from \"@executor-js/react/components/tag-input\";\nimport {\n integrationDisplayNameFromStdio,\n integrationDisplayNameFromUrl,\n slugifyNamespace,\n IntegrationIdentityFields,\n useIntegrationIdentity,\n} from \"@executor-js/react/plugins/integration-identity\";\nimport {\n addIntegrationErrorMessage,\n errorMessageFromExit,\n FormErrorAlert,\n SlugCollisionAlert,\n useSlugAlreadyExists,\n} from \"@executor-js/react/lib/integration-add\";\n\nimport { integrationWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\nimport type { McpAuthMethodInput } from \"../sdk/types\";\nimport { probeMcpEndpoint, addMcpServer } from \"./atoms\";\nimport { McpRemoteSourceFields } from \"./McpRemoteSourceFields\";\nimport { mcpAuthMethodInputFromEditorValue, mcpWireAuthInput } from \"./auth-method-config\";\nimport { mcpPresets, type McpPreset } from \"../sdk/presets\";\n\n// The remote add flow REGISTERS the server's declared auth methods through the\n// shared `AuthMethodListEditor` — accounts (the API key value / OAuth sign-in)\n// are added later from the integration's detail hub (P6: add without auth,\n// connect later). The probe SEEDS the list (detected OAuth → an OAuth row; a\n// 401 without OAuth → a bearer-header row; open server → a no-auth row) and\n// the user can add alternate methods (e.g. an API key alongside OAuth, or a\n// declared method on a server that advertises none).\n\n// ---------------------------------------------------------------------------\n// Preset lookup\n// ---------------------------------------------------------------------------\n\nfunction findPreset(id: string | undefined): McpPreset | undefined {\n if (!id) return undefined;\n return mcpPresets.find((p) => p.id === id);\n}\n\n// Splits the raw args field into tokens, honoring double-quoted groups so an\n// argument with spaces stays intact.\nfunction parseStdioArgs(raw: string): string[] {\n if (!raw.trim()) return [];\n const args: string[] = [];\n const regex = /[^\\s\"]+|\"([^\"]*)\"/g;\n let match;\n while ((match = regex.exec(raw)) !== null) {\n args.push(match[1] ?? match[0]);\n }\n return args;\n}\n\n// ---------------------------------------------------------------------------\n// State machine (remote flow)\n// ---------------------------------------------------------------------------\n\ntype ProbeResult = {\n connected: boolean;\n requiresAuthentication: boolean;\n requiresOAuth: boolean;\n supportsDynamicRegistration: boolean;\n name: string;\n slug: string;\n toolCount: number | null;\n serverName: string | null;\n instructions: string | null;\n};\n\ntype State =\n | { step: \"url\"; url: string }\n | { step: \"probing\"; url: string; probe: ProbeResult | null }\n | { step: \"probed\"; url: string; probe: ProbeResult }\n | { step: \"adding\"; url: string; probe: ProbeResult }\n | {\n step: \"error\";\n url: string;\n probe: ProbeResult | null;\n error: string;\n };\n\ntype Action =\n | { type: \"set-url\"; url: string }\n | { type: \"probe-start\" }\n | { type: \"probe-ok\"; probe: ProbeResult }\n | { type: \"probe-fail\"; error: string }\n | { type: \"add-start\" }\n | { type: \"add-fail\"; error: string }\n | { type: \"retry\" };\n\nconst init: State = { step: \"url\", url: \"\" };\n\nfunction reducer(state: State, action: Action): State {\n return Match.value(action).pipe(\n Match.discriminator(\"type\")(\"set-url\", (a): State => ({ step: \"url\", url: a.url })),\n Match.discriminator(\"type\")(\n \"probe-start\",\n (): State => ({\n step: \"probing\",\n url: state.url,\n probe: \"probe\" in state ? state.probe : null,\n }),\n ),\n Match.discriminator(\"type\")(\n \"probe-ok\",\n (a): State => ({ step: \"probed\", url: state.url, probe: a.probe }),\n ),\n Match.discriminator(\"type\")(\n \"probe-fail\",\n (a): State => ({\n step: \"error\",\n url: state.url,\n probe: null,\n error: a.error,\n }),\n ),\n Match.discriminator(\"type\")(\"add-start\", (): State => {\n const probe = \"probe\" in state ? state.probe : null;\n if (!probe) return state;\n return { step: \"adding\", url: state.url, probe };\n }),\n Match.discriminator(\"type\")(\"add-fail\", (a): State => {\n if (state.step !== \"adding\") return state;\n return {\n step: \"error\",\n url: state.url,\n probe: state.probe,\n error: a.error,\n };\n }),\n Match.discriminator(\"type\")(\"retry\", (): State => {\n if (state.step !== \"error\") return state;\n return state.probe\n ? { step: \"probed\", url: state.url, probe: state.probe }\n : { step: \"url\", url: state.url };\n }),\n Match.exhaustive,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\nexport default function AddMcpSource(props: {\n onComplete: (slug?: string) => void;\n onCancel: () => void;\n initialUrl?: string;\n initialPreset?: string;\n /** Whether the stdio transport is enabled on the server. */\n allowStdio?: boolean;\n}) {\n const allowStdio = props.allowStdio ?? false;\n const rawPreset = findPreset(props.initialPreset);\n // Drop stdio presets when stdio is disabled — the caller should have\n // already filtered these out, but defence-in-depth.\n const preset = rawPreset?.transport === \"stdio\" && !allowStdio ? undefined : rawPreset;\n const isStdioPreset = preset?.transport === \"stdio\";\n\n const [transport, setTransport] = useState<\"remote\" | \"stdio\">(\n isStdioPreset && allowStdio ? \"stdio\" : \"remote\",\n );\n\n // --- Stdio state ---\n const [stdioCommand, setStdioCommand] = useState(isStdioPreset ? preset.command : \"\");\n const [stdioArgs, setStdioArgs] = useState(\n isStdioPreset && preset.args ? preset.args.join(\" \") : \"\",\n );\n const [stdioEnvVars, setStdioEnvVars] = useState<string[]>([]);\n const stdioIdentity = useIntegrationIdentity({\n fallbackName: isStdioPreset\n ? preset.name\n : (integrationDisplayNameFromStdio(stdioCommand, parseStdioArgs(stdioArgs), \"MCP\") ??\n stdioCommand),\n });\n const [stdioAdding, setStdioAdding] = useState(false);\n const [stdioError, setStdioError] = useState<string | null>(null);\n\n // --- Remote state ---\n const remoteUrl =\n !isStdioPreset && preset?.transport === undefined && preset?.url\n ? preset.url\n : (props.initialUrl ?? \"\");\n\n const [state, dispatch] = useReducer(\n reducer,\n remoteUrl ? { step: \"url\" as const, url: remoteUrl } : init,\n );\n\n const doProbe = useAtomSet(probeMcpEndpoint, { mode: \"promiseExit\" });\n const doAddServer = useAtomSet(addMcpServer, { mode: \"promiseExit\" });\n\n const probe = \"probe\" in state ? state.probe : null;\n\n // The probe seeds the method list: detected OAuth → an OAuth row; a 401\n // without OAuth metadata → a bearer-header row; an open server → a no-auth\n // row. The user can edit any row or add alternate methods alongside.\n const authMethodSeeds: readonly AuthMethodSeed[] = useMemo(() => {\n if (!probe) return [];\n if (probe.requiresOAuth) {\n return [\n {\n value: { kind: \"oauth\", authorizationUrl: \"\", tokenUrl: \"\", scopes: [] },\n label: \"Detected\",\n },\n ];\n }\n if (probe.requiresAuthentication) {\n return [\n {\n value: {\n kind: \"apikey\",\n placements: [{ carrier: \"header\", name: \"Authorization\", prefix: \"Bearer \" }],\n },\n label: \"Detected\",\n },\n ];\n }\n return [{ value: { kind: \"none\" }, label: \"Detected\" }];\n }, [probe]);\n const authMethodList = useAuthMethodList(authMethodSeeds);\n\n const remoteIdentity = useIntegrationIdentity({\n fallbackName:\n integrationDisplayNameFromUrl(state.url, \"MCP\") ?? probe?.serverName ?? probe?.name ?? \"\",\n });\n // Agent-visible description: prefilled from the server's `instructions`\n // until the user types (null = untouched, keep deriving from the probe).\n const [descriptionDraft, setDescriptionDraft] = useState<string | null>(null);\n const resolvedDescription = descriptionDraft ?? probe?.instructions ?? \"\";\n const isProbing = state.step === \"probing\";\n const isAdding = state.step === \"adding\";\n\n // Pre-empt the API's `IntegrationAlreadyExistsError`: adding an integration\n // whose slug already exists clobbers the existing one's connections/policies,\n // so the API blocks it. Surface that here from the tenant-scoped catalog list.\n // A blank derived namespace lets the server assign the slug, so only flag a\n // collision when the user-derived slug is non-empty.\n const remoteSlug = slugifyNamespace(remoteIdentity.namespace);\n const stdioSlug = slugifyNamespace(stdioIdentity.namespace);\n const remoteSlugExists = useSlugAlreadyExists(remoteSlug);\n const stdioSlugExists = useSlugAlreadyExists(stdioSlug);\n\n const canAdd = Boolean(probe) && !isAdding && !remoteSlugExists;\n // Probe failures are shown inline on the URL field; other failures\n // (add server) render in the bottom error block.\n const probeError = state.step === \"error\" && state.probe === null ? state.error : null;\n const otherError = state.step === \"error\" && state.probe !== null ? state.error : null;\n\n // ---- Remote actions ----\n\n const handleProbe = useCallback(async () => {\n dispatch({ type: \"probe-start\" });\n const exit = await doProbe({\n payload: { endpoint: state.url.trim() },\n });\n if (Exit.isFailure(exit)) {\n dispatch({\n type: \"probe-fail\",\n error: errorMessageFromExit(exit, \"Failed to connect\"),\n });\n return;\n }\n dispatch({ type: \"probe-ok\", probe: exit.value });\n }, [state.url, doProbe]);\n\n // Keep the latest handleProbe in a ref so the debounced effect can call it\n // without depending on its identity (which changes every render).\n const handleProbeRef = useRef(handleProbe);\n handleProbeRef.current = handleProbe;\n\n // Auto-probe whenever the URL changes (debounced) while we're on the\n // remote transport and not already probing/probed.\n useEffect(() => {\n if (transport !== \"remote\") return;\n if (state.step !== \"url\") return;\n const trimmed = state.url.trim();\n if (!trimmed) return;\n const handle = setTimeout(() => {\n handleProbeRef.current();\n }, 400);\n return () => clearTimeout(handle);\n }, [transport, state.step, state.url]);\n\n // Register the integration with the declared auth methods, returning the\n // assigned slug (or null on failure — an error is dispatched in that case).\n const registerIntegration = useCallback(\n async (authenticationTemplate: readonly McpAuthMethodInput[]): Promise<string | null> => {\n const displayName = remoteIdentity.name.trim() || probe?.serverName || probe?.name || \"MCP\";\n const slug = slugifyNamespace(remoteIdentity.namespace) || undefined;\n const exit = await doAddServer({\n payload: {\n transport: \"remote\" as const,\n name: displayName,\n ...(resolvedDescription.trim().length > 0\n ? { description: resolvedDescription.trim() }\n : {}),\n endpoint: state.url.trim(),\n ...(slug ? { slug } : {}),\n authenticationTemplate,\n },\n reactivityKeys: integrationWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n dispatch({\n type: \"add-fail\",\n error: addIntegrationErrorMessage(exit, slug ?? displayName, \"Failed to add server\"),\n });\n return null;\n }\n return exit.value.slug;\n },\n [doAddServer, probe, remoteIdentity, resolvedDescription, state.url],\n );\n\n const handleAddRemote = useCallback(async () => {\n if (!probe) return;\n dispatch({ type: \"add-start\" });\n // Every row registers as a declared method (a lone no-auth row registers\n // the open-server method). Slugs are assigned server-side by kind.\n const methods = authMethodList.rows.map((row: AuthMethodRow) =>\n mcpWireAuthInput(mcpAuthMethodInputFromEditorValue(row.value)),\n );\n const slug = await registerIntegration(\n methods.length > 0 ? methods : [{ kind: \"none\" as const }],\n );\n if (slug === null) return;\n props.onComplete(slug);\n }, [probe, authMethodList.rows, registerIntegration, props]);\n\n // ---- Stdio actions ----\n\n const handleAddStdio = useCallback(async () => {\n const cmd = stdioCommand.trim();\n if (!cmd) return;\n setStdioAdding(true);\n setStdioError(null);\n const displayName = stdioIdentity.name.trim() || cmd;\n const slug = slugifyNamespace(stdioIdentity.namespace) || undefined;\n const exit = await doAddServer({\n payload: {\n transport: \"stdio\" as const,\n name: displayName,\n ...(slug ? { slug } : {}),\n command: cmd,\n args: parseStdioArgs(stdioArgs),\n envVars: stdioEnvVars.length > 0 ? stdioEnvVars : undefined,\n },\n reactivityKeys: integrationWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n setStdioError(addIntegrationErrorMessage(exit, slug ?? displayName, \"Failed to add server\"));\n setStdioAdding(false);\n return;\n }\n props.onComplete(exit.value.slug);\n }, [stdioCommand, stdioArgs, stdioEnvVars, stdioIdentity, doAddServer, props]);\n\n // ---- Render ----\n\n return (\n <div className=\"flex flex-1 flex-col gap-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">Add MCP Source</h1>\n <p className=\"mt-1 text-[13px] text-muted-foreground\">\n Connect to an MCP server to discover and use its tools.\n </p>\n </div>\n\n {/* Transport toggle — only shown when stdio is enabled server-side */}\n {allowStdio && (\n <div className=\"flex gap-1 rounded-lg border border-border bg-muted/30 p-1\">\n <Button\n variant=\"ghost\"\n type=\"button\"\n onClick={() => setTransport(\"remote\")}\n className={`flex-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${\n transport === \"remote\"\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground\"\n }`}\n >\n Remote\n </Button>\n <Button\n variant=\"ghost\"\n type=\"button\"\n onClick={() => setTransport(\"stdio\")}\n className={`flex-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${\n transport === \"stdio\"\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground\"\n }`}\n >\n Stdio\n </Button>\n </div>\n )}\n\n {transport === \"remote\" ? (\n <>\n <McpRemoteSourceFields\n url={state.url}\n onUrlChange={(url) => dispatch({ type: \"set-url\", url })}\n identity={remoteIdentity}\n description={resolvedDescription}\n onDescriptionChange={setDescriptionDraft}\n preview={probe}\n probing={isProbing}\n error={probeError}\n onRetry={handleProbe}\n />\n\n {/* Authentication — declares the auth methods to register through the\n shared list editor. The credentials themselves (API key value /\n OAuth sign-in) are added from the integration's detail hub after\n adding. */}\n {probe && (\n <AuthMethodListEditor\n list={authMethodList}\n title=\"How does this server authenticate?\"\n oauthMetadata=\"discovered\"\n emptyHint=\"No methods declared. Add a method, or add the server without auth and connect from the integration page later.\"\n footerHint=\"Every method here is registered with the server. Connect an account from the integration page after adding.\"\n />\n )}\n\n {/* Error (add server). Probe errors show inline on the field. */}\n {otherError && (\n <div className=\"space-y-2\">\n <FormErrorAlert message={otherError} />\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => dispatch({ type: \"retry\" })}\n className=\"text-xs\"\n >\n Try again\n </Button>\n </div>\n )}\n\n {remoteSlugExists && !isAdding && <SlugCollisionAlert slug={remoteSlug} />}\n\n <FloatActions>\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onCancel()}\n disabled={isAdding}\n >\n Cancel\n </Button>\n {(probe || isProbing) && (\n <Button type=\"button\" onClick={handleAddRemote} disabled={!canAdd} loading={isAdding}>\n Add source\n </Button>\n )}\n </FloatActions>\n </>\n ) : (\n <>\n {/* Stdio form */}\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntryField\n label=\"Command\"\n description=\"- The executable to run (e.g. npx, uvx, node).\"\n >\n <Input\n value={stdioCommand}\n onChange={(e) => setStdioCommand((e.target as HTMLInputElement).value)}\n placeholder=\"npx\"\n className=\"font-mono text-sm\"\n />\n </CardStackEntryField>\n\n <CardStackEntryField\n label=\"Arguments\"\n description=\"- Space-separated arguments passed to the command.\"\n >\n <Input\n value={stdioArgs}\n onChange={(e) => setStdioArgs((e.target as HTMLInputElement).value)}\n placeholder=\"-y chrome-devtools-mcp@latest\"\n className=\"font-mono text-sm\"\n />\n </CardStackEntryField>\n\n <CardStackEntryField\n label=\"Environment variables\"\n description=\"- Names only; secret values are entered when you connect.\"\n >\n <TagInput\n values={stdioEnvVars}\n onChange={setStdioEnvVars}\n placeholder=\"Add an env var, e.g. GITHUB_TOKEN\"\n />\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n\n <IntegrationIdentityFields identity={stdioIdentity} namePlaceholder=\"My MCP Server\" />\n\n {/* Stdio error */}\n {stdioError && <FormErrorAlert message={stdioError} />}\n\n {stdioSlugExists && !stdioAdding && <SlugCollisionAlert slug={stdioSlug} />}\n\n <FloatActions>\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onCancel()}\n disabled={stdioAdding}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n onClick={handleAddStdio}\n disabled={!stdioCommand.trim() || stdioSlugExists}\n loading={stdioAdding}\n >\n Add source\n </Button>\n </FloatActions>\n </>\n )}\n </div>\n );\n}\n","import { Badge } from \"@executor-js/react/components/badge\";\nimport {\n CardStack,\n CardStackContent,\n CardStackEntry,\n CardStackEntryActions,\n CardStackEntryContent,\n CardStackEntryDescription,\n CardStackEntryField,\n CardStackEntryMedia,\n CardStackEntryTitle,\n} from \"@executor-js/react/components/card-stack\";\nimport { FieldError } from \"@executor-js/react/components/field\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport { Textarea } from \"@executor-js/react/components/textarea\";\nimport { Skeleton } from \"@executor-js/react/components/skeleton\";\nimport { IntegrationFavicon } from \"@executor-js/react/components/integration-favicon\";\nimport { IOSSpinner } from \"@executor-js/react/components/spinner\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport {\n IntegrationIdentityFieldRows,\n type IntegrationIdentity,\n} from \"@executor-js/react/plugins/integration-identity\";\n\nexport type McpRemoteSourcePreview = {\n readonly name: string;\n readonly serverName: string | null;\n readonly connected: boolean;\n readonly requiresAuthentication: boolean;\n readonly requiresOAuth: boolean;\n readonly toolCount: number | null;\n};\n\nexport function McpRemoteSourceFields(props: {\n readonly url: string;\n readonly onUrlChange: (url: string) => void;\n readonly identity: IntegrationIdentity;\n /** The integration's agent-visible description (prefilled from the server's\n * `instructions` when the probe connected). */\n readonly description?: string;\n readonly onDescriptionChange?: (value: string) => void;\n readonly preview: McpRemoteSourcePreview | null;\n readonly probing?: boolean;\n readonly error?: string | null;\n readonly onRetry?: () => void;\n readonly namespaceReadOnly?: boolean;\n readonly urlDisabled?: boolean;\n}) {\n const previewDescription = props.preview\n ? props.preview.connected\n ? props.preview.toolCount === null\n ? null\n : `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? \"s\" : \"\"} available`\n : props.preview.requiresOAuth\n ? \"OAuth required to discover tools\"\n : props.preview.requiresAuthentication\n ? \"Authentication required to discover tools\"\n : \"Ready to add\"\n : null;\n\n if (props.preview) {\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n <CardStackEntryMedia>\n <IntegrationFavicon url={props.url} size={32} />\n </CardStackEntryMedia>\n <CardStackEntryContent>\n <CardStackEntryTitle>\n {props.preview.serverName ?? props.preview.name}\n </CardStackEntryTitle>\n {previewDescription ? (\n <CardStackEntryDescription>{previewDescription}</CardStackEntryDescription>\n ) : null}\n </CardStackEntryContent>\n <CardStackEntryActions>\n {props.preview.connected ? (\n <Badge\n variant=\"outline\"\n className=\"border-border bg-muted text-[10px] text-foreground\"\n >\n Connected\n </Badge>\n ) : props.preview.requiresOAuth ? (\n <Badge\n variant=\"outline\"\n className=\"border-border bg-muted text-[10px] text-muted-foreground\"\n >\n OAuth required\n </Badge>\n ) : (\n <Badge\n variant=\"outline\"\n className=\"border-border bg-muted text-[10px] text-muted-foreground\"\n >\n Auth required\n </Badge>\n )}\n </CardStackEntryActions>\n </CardStackEntry>\n <IntegrationIdentityFieldRows\n identity={props.identity}\n namePlaceholder=\"e.g. Linear\"\n namespaceReadOnly={props.namespaceReadOnly}\n />\n {props.onDescriptionChange && (\n <CardStackEntryField label=\"Description\">\n <Textarea\n value={props.description ?? \"\"}\n onChange={(e) =>\n props.onDescriptionChange?.((e.target as HTMLTextAreaElement).value)\n }\n placeholder=\"What this server offers and when to reach for it\"\n rows={2}\n maxRows={6}\n className=\"text-sm\"\n />\n <p className=\"text-[11px] text-muted-foreground\">\n Agent-visible. Prefilled from the server's instructions when it sends any.\n </p>\n </CardStackEntryField>\n )}\n <CardStackEntryField label=\"Server URL\">\n <Input\n value={props.url}\n onChange={(e) => props.onUrlChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://mcp.example.com\"\n className=\"w-full font-mono text-sm\"\n disabled={props.urlDisabled}\n />\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n );\n }\n\n if (props.probing) {\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n <CardStackEntryMedia>\n <Skeleton className=\"size-4 rounded\" />\n </CardStackEntryMedia>\n <CardStackEntryContent>\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"mt-1 h-3 w-32\" />\n </CardStackEntryContent>\n <CardStackEntryActions>\n <Skeleton className=\"h-4 w-20 rounded-full\" />\n </CardStackEntryActions>\n </CardStackEntry>\n </CardStackContent>\n </CardStack>\n );\n }\n\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntryField label=\"Server URL\">\n <div className=\"relative\">\n <Input\n value={props.url}\n onChange={(e) => props.onUrlChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://mcp.example.com\"\n className=\"w-full pr-9 font-mono text-sm\"\n aria-invalid={props.error ? true : undefined}\n disabled={props.urlDisabled}\n />\n {props.probing && (\n <div className=\"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2\">\n <IOSSpinner className=\"size-4\" />\n </div>\n )}\n </div>\n {props.error && (\n <div className=\"mt-2 space-y-2\">\n <FieldError>{props.error}</FieldError>\n {props.onRetry && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={props.onRetry}\n className=\"h-7 px-2 text-xs\"\n >\n Try again\n </Button>\n )}\n </div>\n )}\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAC9E,SAAS,kBAAkB;AAC3B,YAAY,UAAU;AACtB,YAAY,WAAW;AAEvB,SAAS,UAAAA,eAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EACE,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B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AAAA,gBACC,QAAQ;AAAA,gBACR,UAAU;AAAA,gBACV,aAAY;AAAA;AAAA,YACd;AAAA;AAAA,QACF;AAAA,SACF,GACF;AAAA,MAEA,gBAAAA,KAAC,6BAA0B,UAAU,eAAe,iBAAgB,iBAAgB;AAAA,MAGnF,cAAc,gBAAAA,KAAC,kBAAe,SAAS,YAAY;AAAA,MAEnD,mBAAmB,CAAC,eAAe,gBAAAA,KAAC,sBAAmB,MAAM,WAAW;AAAA,MAEzE,gBAAAC,MAAC,gBACC;AAAA,wBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,SAAS,MAAM,MAAM,SAAS;AAAA,YAC9B,UAAU;AAAA,YACX;AAAA;AAAA,QAED;AAAA,QACA,gBAAAF;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAS;AAAA,YACT,UAAU,CAAC,aAAa,KAAK,KAAK;AAAA,YAClC,SAAS;AAAA,YACV;AAAA;AAAA,QAED;AAAA,SACF;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":["Button","CardStack","CardStackContent","CardStackEntryField","Input","jsx","jsxs","Button","CardStack","CardStackContent","CardStackEntryField","Input"]}
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
mcpAuthMethodInputFromEditorValue,
|
|
5
5
|
mcpServerAtom,
|
|
6
6
|
mcpWireAuthInput
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-N6NNZDXN.js";
|
|
8
|
+
import "./chunk-OCDAATE3.js";
|
|
9
9
|
|
|
10
10
|
// src/react/EditMcpSource.tsx
|
|
11
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -156,4 +156,4 @@ function EditMcpSource({ sourceId, onPendingChange }) {
|
|
|
156
156
|
export {
|
|
157
157
|
EditMcpSource as default
|
|
158
158
|
};
|
|
159
|
-
//# sourceMappingURL=EditMcpSource-
|
|
159
|
+
//# sourceMappingURL=EditMcpSource-GPXZQFL5.js.map
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
mcpAuthMethodInputsFromPlacements,
|
|
5
5
|
mcpServerAtom,
|
|
6
6
|
mcpWireAuthInput
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-N6NNZDXN.js";
|
|
8
|
+
import "./chunk-OCDAATE3.js";
|
|
9
9
|
|
|
10
10
|
// src/react/McpAccountsPanel.tsx
|
|
11
11
|
import { useCallback, useMemo } from "react";
|
|
@@ -28,12 +28,12 @@ function McpAccountsPanel(props) {
|
|
|
28
28
|
const config = server?.config ?? null;
|
|
29
29
|
const remote = config !== null && config.transport === "remote" ? config : null;
|
|
30
30
|
const existingTemplate = useMemo(
|
|
31
|
-
() =>
|
|
32
|
-
[
|
|
31
|
+
() => config?.authenticationTemplate ?? [],
|
|
32
|
+
[config]
|
|
33
33
|
);
|
|
34
34
|
const methods = useMemo(
|
|
35
|
-
() =>
|
|
36
|
-
[existingTemplate, remote]
|
|
35
|
+
() => config ? authMethodsFromConfig(existingTemplate, remote?.endpoint ?? "") : [],
|
|
36
|
+
[existingTemplate, config, remote]
|
|
37
37
|
);
|
|
38
38
|
const configure = useCallback(
|
|
39
39
|
async (input) => {
|
|
@@ -80,4 +80,4 @@ function McpAccountsPanel(props) {
|
|
|
80
80
|
export {
|
|
81
81
|
McpAccountsPanel as default
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=McpAccountsPanel-
|
|
83
|
+
//# sourceMappingURL=McpAccountsPanel-CNUWTJ4R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/McpAccountsPanel.tsx"],"sourcesContent":["import { useCallback, useMemo } from \"react\";\nimport { useAtomSet, useAtomValue } from \"@effect/atom-react\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nimport * as Exit from \"effect/Exit\";\n\nimport { IntegrationSlug } from \"@executor-js/sdk/shared\";\nimport type { IntegrationAccountHandoff } from \"@executor-js/sdk/client\";\nimport { AccountsSection } from \"@executor-js/react/components/accounts-section\";\nimport type { AuthMethod, Placement } from \"@executor-js/react/lib/auth-placements\";\nimport {\n useCustomMethodActions,\n type AuthMethodsCodec,\n type ConfigureAuthMethods,\n} from \"@executor-js/react/lib/custom-auth-methods\";\nimport { integrationWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\n\nimport { configureMcpAuth, mcpServerAtom } from \"./atoms\";\nimport {\n authMethodsFromConfig,\n mcpAuthMethodInputsFromPlacements,\n mcpWireAuthInput,\n} from \"./auth-method-config\";\nimport type { McpAuthMethod } from \"../sdk/types\";\n\n// ---------------------------------------------------------------------------\n// MCP Accounts hub — fills the generic detail page's `accounts` slot.\n//\n// Reads the integration's declared `authenticationTemplate` (via `getServer`),\n// converts it to generic `AuthMethod[]`, and composes the generic\n// `AccountsSection` — whose Add-account offers those methods plus a \"+ Custom\n// method\" row. The custom-method create/remove is the shared skeleton\n// (`useCustomMethodActions`) parameterized by the MCP codec and the\n// merge-append `configureAuth` endpoint, so adding an API key method never\n// displaces a declared OAuth method. Stdio servers have no remote credential\n// to configure — no methods, no custom-method affordance.\n// ---------------------------------------------------------------------------\n\nexport default function McpAccountsPanel(props: {\n readonly sourceId: string;\n readonly integrationName: string;\n readonly accountHandoff?: IntegrationAccountHandoff | null;\n}) {\n const { sourceId, integrationName, accountHandoff } = props;\n const slug = IntegrationSlug.make(sourceId);\n const serverResult = useAtomValue(mcpServerAtom(slug));\n const doConfigureAuth = useAtomSet(configureMcpAuth, { mode: \"promiseExit\" });\n\n const server = AsyncResult.isSuccess(serverResult) ? serverResult.value : null;\n const config = server?.config ?? null;\n const remote = config !== null && config.transport === \"remote\" ? config : null;\n\n const existingTemplate = useMemo<readonly McpAuthMethod[]>(\n () => config?.authenticationTemplate ?? [],\n [config],\n );\n\n // Stdio servers declare a `stdio_env` / `none` method too, so their\n // auto-created connection and its env credentials surface here. The endpoint\n // only feeds remote oauth methods' probe URL; stdio has none.\n const methods = useMemo<readonly AuthMethod[]>(\n () => (config ? authMethodsFromConfig(existingTemplate, remote?.endpoint ?? \"\") : []),\n [existingTemplate, config, remote],\n );\n\n const configure = useCallback<ConfigureAuthMethods<McpAuthMethod>>(\n async (input) => {\n const exit = await doConfigureAuth({\n params: { slug },\n payload: {\n authenticationTemplate: input.authenticationTemplate.map(mcpWireAuthInput),\n ...(input.mode ? { mode: input.mode } : {}),\n },\n reactivityKeys: integrationWriteKeys,\n });\n return Exit.map(exit, (result) => result.authenticationTemplate);\n },\n [doConfigureAuth, slug],\n );\n\n const codec = useMemo<AuthMethodsCodec<McpAuthMethod>>(\n () => ({\n toAuthMethods: (templates: readonly McpAuthMethod[]) =>\n authMethodsFromConfig(templates, remote?.endpoint ?? \"\"),\n // MCP custom methods are header credentials; the inputs omit slugs and\n // the backend merge backfills `custom_<id>`.\n templatesFromPlacements: (placements: readonly Placement[]) =>\n mcpAuthMethodInputsFromPlacements(placements) as readonly McpAuthMethod[],\n slugOf: (template: McpAuthMethod) => template.slug,\n }),\n [remote?.endpoint],\n );\n\n const { createCustomMethod, removeCustomMethod } = useCustomMethodActions({\n existing: existingTemplate,\n codec,\n configure,\n });\n\n const canConfigureAuth = remote !== null;\n\n return (\n <div className=\"mx-auto max-w-3xl space-y-8 px-6 py-8\">\n <AccountsSection\n integration={slug}\n integrationName={integrationName}\n methods={methods}\n accountHandoff={accountHandoff}\n createCustomMethod={canConfigureAuth ? createCustomMethod : undefined}\n removeCustomMethod={canConfigureAuth ? removeCustomMethod : undefined}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,aAAa,eAAe;AACrC,SAAS,YAAY,oBAAoB;AACzC,YAAY,iBAAiB;AAC7B,YAAY,UAAU;AAEtB,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,OAGK;AACP,SAAS,4BAA4B;AAwF/B;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B;AAEA,QAAM,EAAE,oBAAoB,mBAAmB,IAAI,uBAAuB;AAAA,IACxE,UAAU;AAAA,IACV;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,mBAAmB,WAAW;AAEpC,SACE,oBAAC,SAAI,WAAU,yCACb;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,MACA,oBAAoB,mBAAmB,qBAAqB;AAAA,MAC5D,oBAAoB,mBAAmB,qBAAqB;AAAA;AAAA,EAC9D,GACF;AAEJ;","names":[]}
|
package/dist/api/group.d.ts
CHANGED
|
@@ -64,6 +64,10 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
64
64
|
readonly description: Schema.optional<Schema.String>;
|
|
65
65
|
readonly command: Schema.String;
|
|
66
66
|
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
67
|
+
/** Declare the secret env vars this server needs, by name. Their values are
|
|
68
|
+
* supplied as the connection's secrets (the connect step), not here. */
|
|
69
|
+
readonly envVars: Schema.optional<Schema.$Array<Schema.String>>;
|
|
70
|
+
/** One-shot secret env values (programmatic). The UI sends `envVars`. */
|
|
67
71
|
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
68
72
|
readonly cwd: Schema.optional<Schema.String>;
|
|
69
73
|
readonly slug: Schema.optional<Schema.String>;
|
|
@@ -104,6 +108,10 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
104
108
|
}>, Schema.Struct<{
|
|
105
109
|
readonly slug: Schema.String;
|
|
106
110
|
readonly kind: Schema.Literal<"oauth2">;
|
|
111
|
+
}>, Schema.Struct<{
|
|
112
|
+
readonly slug: Schema.String;
|
|
113
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
114
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
107
115
|
}>]>>;
|
|
108
116
|
}>, Schema.Struct<{
|
|
109
117
|
readonly transport: Schema.Literal<"stdio">;
|
|
@@ -111,6 +119,28 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
111
119
|
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
112
120
|
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
113
121
|
readonly cwd: Schema.optional<Schema.String>;
|
|
122
|
+
readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
123
|
+
readonly slug: Schema.String;
|
|
124
|
+
readonly kind: Schema.Literal<"none">;
|
|
125
|
+
}>, Schema.Struct<{
|
|
126
|
+
readonly slug: Schema.String;
|
|
127
|
+
readonly kind: Schema.Literal<"apikey">;
|
|
128
|
+
readonly label: Schema.optional<Schema.String>;
|
|
129
|
+
readonly placements: Schema.$Array<Schema.Struct<{
|
|
130
|
+
readonly carrier: Schema.Literals<readonly ["header", "query"]>;
|
|
131
|
+
readonly name: Schema.String;
|
|
132
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
133
|
+
readonly variable: Schema.optional<Schema.String>;
|
|
134
|
+
readonly literal: Schema.optional<Schema.String>;
|
|
135
|
+
}>>;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly slug: Schema.String;
|
|
138
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
139
|
+
}>, Schema.Struct<{
|
|
140
|
+
readonly slug: Schema.String;
|
|
141
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
142
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
143
|
+
}>]>>>;
|
|
114
144
|
}>]>;
|
|
115
145
|
}>>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"configureServer", "POST", "/mcp/servers/:slug/config", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
116
146
|
slug: Schema.brand<Schema.String, "IntegrationSlug">;
|
|
@@ -138,6 +168,10 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
138
168
|
}>, Schema.Struct<{
|
|
139
169
|
readonly slug: Schema.String;
|
|
140
170
|
readonly kind: Schema.Literal<"oauth2">;
|
|
171
|
+
}>, Schema.Struct<{
|
|
172
|
+
readonly slug: Schema.String;
|
|
173
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
174
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
141
175
|
}>]>>;
|
|
142
176
|
}>, Schema.Struct<{
|
|
143
177
|
readonly transport: Schema.Literal<"stdio">;
|
|
@@ -145,6 +179,28 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
145
179
|
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
146
180
|
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
147
181
|
readonly cwd: Schema.optional<Schema.String>;
|
|
182
|
+
readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
183
|
+
readonly slug: Schema.String;
|
|
184
|
+
readonly kind: Schema.Literal<"none">;
|
|
185
|
+
}>, Schema.Struct<{
|
|
186
|
+
readonly slug: Schema.String;
|
|
187
|
+
readonly kind: Schema.Literal<"apikey">;
|
|
188
|
+
readonly label: Schema.optional<Schema.String>;
|
|
189
|
+
readonly placements: Schema.$Array<Schema.Struct<{
|
|
190
|
+
readonly carrier: Schema.Literals<readonly ["header", "query"]>;
|
|
191
|
+
readonly name: Schema.String;
|
|
192
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
193
|
+
readonly variable: Schema.optional<Schema.String>;
|
|
194
|
+
readonly literal: Schema.optional<Schema.String>;
|
|
195
|
+
}>>;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly slug: Schema.String;
|
|
198
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
199
|
+
}>, Schema.Struct<{
|
|
200
|
+
readonly slug: Schema.String;
|
|
201
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
202
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
203
|
+
}>]>>>;
|
|
148
204
|
}>]>;
|
|
149
205
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
150
206
|
readonly config: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -170,6 +226,10 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
170
226
|
}>, Schema.Struct<{
|
|
171
227
|
readonly slug: Schema.String;
|
|
172
228
|
readonly kind: Schema.Literal<"oauth2">;
|
|
229
|
+
}>, Schema.Struct<{
|
|
230
|
+
readonly slug: Schema.String;
|
|
231
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
232
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
173
233
|
}>]>>;
|
|
174
234
|
}>, Schema.Struct<{
|
|
175
235
|
readonly transport: Schema.Literal<"stdio">;
|
|
@@ -177,6 +237,28 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
177
237
|
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
178
238
|
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
179
239
|
readonly cwd: Schema.optional<Schema.String>;
|
|
240
|
+
readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
241
|
+
readonly slug: Schema.String;
|
|
242
|
+
readonly kind: Schema.Literal<"none">;
|
|
243
|
+
}>, Schema.Struct<{
|
|
244
|
+
readonly slug: Schema.String;
|
|
245
|
+
readonly kind: Schema.Literal<"apikey">;
|
|
246
|
+
readonly label: Schema.optional<Schema.String>;
|
|
247
|
+
readonly placements: Schema.$Array<Schema.Struct<{
|
|
248
|
+
readonly carrier: Schema.Literals<readonly ["header", "query"]>;
|
|
249
|
+
readonly name: Schema.String;
|
|
250
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
251
|
+
readonly variable: Schema.optional<Schema.String>;
|
|
252
|
+
readonly literal: Schema.optional<Schema.String>;
|
|
253
|
+
}>>;
|
|
254
|
+
}>, Schema.Struct<{
|
|
255
|
+
readonly slug: Schema.String;
|
|
256
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
257
|
+
}>, Schema.Struct<{
|
|
258
|
+
readonly slug: Schema.String;
|
|
259
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
260
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
261
|
+
}>]>>>;
|
|
180
262
|
}>]>;
|
|
181
263
|
}>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"configureAuth", "POST", "/mcp/servers/:slug/auth", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
182
264
|
slug: Schema.brand<Schema.String, "IntegrationSlug">;
|
|
@@ -219,5 +301,9 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
219
301
|
}>, Schema.Struct<{
|
|
220
302
|
readonly slug: Schema.String;
|
|
221
303
|
readonly kind: Schema.Literal<"oauth2">;
|
|
304
|
+
}>, Schema.Struct<{
|
|
305
|
+
readonly slug: Schema.String;
|
|
306
|
+
readonly kind: Schema.Literal<"stdio_env">;
|
|
307
|
+
readonly vars: Schema.$Array<Schema.String>;
|
|
222
308
|
}>]>>;
|
|
223
309
|
}>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never>, false>;
|