@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
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
addMcpSourceOptimistic,
|
|
9
9
|
probeMcpEndpoint
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4ORPFRLI.js";
|
|
11
11
|
import {
|
|
12
12
|
MCP_OAUTH_CONNECTION_SLOT
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-M6REVU6O.js";
|
|
14
14
|
|
|
15
15
|
// src/react/AddMcpSource.tsx
|
|
16
16
|
import { useReducer, useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -759,4 +759,4 @@ function AddPlainHeaderRow({
|
|
|
759
759
|
export {
|
|
760
760
|
AddMcpSource as default
|
|
761
761
|
};
|
|
762
|
-
//# sourceMappingURL=AddMcpSource-
|
|
762
|
+
//# sourceMappingURL=AddMcpSource-TLAL463B.js.map
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
mcpSourceBindingsAtom,
|
|
7
7
|
setMcpSourceBinding,
|
|
8
8
|
updateMcpSource
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4ORPFRLI.js";
|
|
10
10
|
import {
|
|
11
11
|
McpSourceBindingInput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M6REVU6O.js";
|
|
13
13
|
|
|
14
14
|
// src/react/EditMcpSource.tsx
|
|
15
15
|
import { useState } from "react";
|
|
@@ -176,7 +176,7 @@ function RemoteEditForm(props) {
|
|
|
176
176
|
onConnected: async (connectionId) => {
|
|
177
177
|
await setBinding({
|
|
178
178
|
params: { scopeId: oauthCredentialTargetScope },
|
|
179
|
-
payload:
|
|
179
|
+
payload: McpSourceBindingInput.make({
|
|
180
180
|
sourceId: props.sourceId,
|
|
181
181
|
sourceScope,
|
|
182
182
|
scope: oauthCredentialTargetScope,
|
|
@@ -256,4 +256,4 @@ function EditMcpSource({
|
|
|
256
256
|
export {
|
|
257
257
|
EditMcpSource as default
|
|
258
258
|
};
|
|
259
|
-
//# sourceMappingURL=EditMcpSource-
|
|
259
|
+
//# sourceMappingURL=EditMcpSource-CWN6HIC4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/EditMcpSource.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { useAtomValue, useAtomSet } from \"@effect/atom-react\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nimport * as Exit from \"effect/Exit\";\nimport {\n mcpSourceAtom,\n mcpSourceBindingsAtom,\n setMcpSourceBinding,\n updateMcpSource,\n} from \"./atoms\";\nimport { connectionsAtom } from \"@executor-js/react/api/atoms\";\nimport { useScope, useScopeStack } from \"@executor-js/react/api/scope-context\";\nimport { connectionWriteKeys, sourceWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\nimport { slugifyNamespace, useSourceIdentity } from \"@executor-js/react/plugins/source-identity\";\nimport { useCredentialTargetScope } from \"@executor-js/react/plugins/credential-target-scope\";\nimport { useSecretPickerSecrets } from \"@executor-js/react/plugins/use-secret-picker-secrets\";\nimport {\n HttpCredentialsEditor,\n serializeHttpCredentials,\n serializeScopedHttpCredentials,\n type HttpCredentialsState,\n} from \"@executor-js/react/plugins/http-credentials\";\nimport {\n effectiveCredentialBindingForScope,\n httpCredentialsFromConfiguredCredentialBindings,\n initialCredentialTargetScope,\n} from \"@executor-js/react/plugins/credential-bindings\";\nimport { SourceOAuthConnectionControl } from \"@executor-js/react/plugins/source-oauth-connection\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport { Badge } from \"@executor-js/react/components/badge\";\nimport { ScopeId } from \"@executor-js/sdk/core\";\nimport { McpRemoteSourceFields } from \"./McpRemoteSourceFields\";\nimport {\n McpSourceBindingInput,\n type McpCredentialInput,\n type McpSourceBindingRef,\n} from \"../sdk/types\";\nimport type { McpStoredSourceSchemaType } from \"../sdk/stored-source\";\n\n// ---------------------------------------------------------------------------\n// Remote edit form\n// ---------------------------------------------------------------------------\n\nfunction RemoteEditForm(props: {\n sourceId: string;\n initial: McpStoredSourceSchemaType & { config: { transport: \"remote\" } };\n bindings: readonly McpSourceBindingRef[];\n onSave: () => void;\n}) {\n const displayScope = useScope();\n const scopeStack = useScopeStack();\n const sourceScope = ScopeId.make(props.initial.scope);\n const { credentialTargetScope, credentialScopeOptions } = useCredentialTargetScope({\n sourceScope,\n initialTargetScope: initialCredentialTargetScope(sourceScope, props.bindings),\n });\n const {\n credentialTargetScope: oauthCredentialTargetScope,\n setCredentialTargetScope: setOAuthCredentialTargetScope,\n } = useCredentialTargetScope({\n sourceScope,\n initialTargetScope: initialCredentialTargetScope(sourceScope, props.bindings),\n });\n const doUpdate = useAtomSet(updateMcpSource, { mode: \"promiseExit\" });\n const setBinding = useAtomSet(setMcpSourceBinding, { mode: \"promise\" });\n const secretList = useSecretPickerSecrets();\n const connectionsResult = useAtomValue(connectionsAtom(displayScope));\n\n const identity = useSourceIdentity({\n fallbackName: props.initial.name,\n fallbackNamespace: props.initial.namespace,\n });\n const [endpoint, setEndpoint] = useState(props.initial.config.endpoint);\n const [credentials, setCredentials] = useState<HttpCredentialsState>(() =>\n httpCredentialsFromConfiguredCredentialBindings({\n headers: props.initial.config.headers,\n queryParams: props.initial.config.queryParams,\n bindings: props.bindings,\n }),\n );\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [credentialsDirty, setCredentialsDirty] = useState(false);\n\n const identityDirty = identity.name.trim() !== props.initial.name.trim();\n const metadataDirty = identityDirty || endpoint.trim() !== props.initial.config.endpoint.trim();\n const dirty = metadataDirty || credentialsDirty;\n const oauth2 = props.initial.config.auth.kind === \"oauth2\" ? props.initial.config.auth : null;\n const connections = AsyncResult.isSuccess(connectionsResult) ? connectionsResult.value : [];\n const scopeRanks = new Map(scopeStack.map((scope, index) => [scope.id, index] as const));\n const connectionBinding = oauth2\n ? effectiveCredentialBindingForScope(\n props.bindings,\n oauth2.connectionSlot,\n oauthCredentialTargetScope,\n scopeRanks,\n )\n : null;\n const boundConnectionId =\n connectionBinding?.value.kind === \"connection\" ? connectionBinding.value.connectionId : null;\n const isConnected =\n boundConnectionId !== null &&\n connections.some((connection) => connection.id === boundConnectionId);\n const oauthRequestCredentials = serializeHttpCredentials(credentials);\n\n const handleCredentialsChange = (next: HttpCredentialsState) => {\n setCredentials(next);\n setCredentialsDirty(true);\n };\n\n const handleSave = async () => {\n setSaving(true);\n setError(null);\n const { headers, queryParams } = serializeScopedHttpCredentials(\n credentials,\n credentialTargetScope,\n );\n const payload: {\n sourceScope: ScopeId;\n name?: string;\n endpoint?: string;\n headers?: Record<string, McpCredentialInput>;\n queryParams?: Record<string, McpCredentialInput>;\n credentialTargetScope?: ScopeId;\n } = {\n sourceScope,\n name: metadataDirty ? identity.name.trim() || undefined : undefined,\n endpoint: metadataDirty ? endpoint.trim() || undefined : undefined,\n };\n if (credentialsDirty) {\n payload.headers = headers;\n payload.queryParams = queryParams as Record<string, McpCredentialInput>;\n payload.credentialTargetScope = credentialTargetScope;\n }\n const exit = await doUpdate({\n params: { scopeId: displayScope, namespace: props.sourceId },\n payload,\n reactivityKeys: sourceWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n setError(\"Failed to update source\");\n setSaving(false);\n return;\n }\n setCredentialsDirty(false);\n setSaving(false);\n props.onSave();\n };\n\n return (\n <div className=\"space-y-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">Edit MCP Source</h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Update the endpoint and headers for this MCP connection.\n </p>\n </div>\n\n <div className=\"flex items-center gap-3 rounded-lg border border-border bg-card px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-semibold text-card-foreground\">{props.sourceId}</p>\n </div>\n <Badge variant=\"secondary\" className=\"text-xs\">\n remote\n </Badge>\n </div>\n\n <McpRemoteSourceFields\n url={endpoint}\n onUrlChange={setEndpoint}\n identity={identity}\n preview={{\n name: props.initial.name,\n serverName: props.initial.name,\n connected: true,\n toolCount: null,\n }}\n namespaceReadOnly\n />\n\n <HttpCredentialsEditor\n credentials={credentials}\n onChange={handleCredentialsChange}\n existingSecrets={secretList}\n sourceName={identity.name}\n targetScope={credentialTargetScope}\n credentialScopeOptions={credentialScopeOptions}\n bindingScopeOptions={credentialScopeOptions}\n />\n\n {oauth2 && (\n <SourceOAuthConnectionControl\n popupName=\"mcp-oauth\"\n pluginId=\"mcp\"\n namespace={slugifyNamespace(props.initial.namespace) || \"mcp\"}\n fallbackNamespace=\"mcp\"\n endpoint={endpoint.trim()}\n tokenScope={oauthCredentialTargetScope}\n onTokenScopeChange={setOAuthCredentialTargetScope}\n credentialScopeOptions={credentialScopeOptions}\n connectionId={boundConnectionId}\n sourceLabel={`${identity.name.trim() || props.initial.namespace || \"MCP\"} OAuth`}\n headers={oauthRequestCredentials.headers}\n queryParams={oauthRequestCredentials.queryParams}\n isConnected={isConnected}\n onConnected={async (connectionId) => {\n await setBinding({\n params: { scopeId: oauthCredentialTargetScope },\n payload: McpSourceBindingInput.make({\n sourceId: props.sourceId,\n sourceScope,\n scope: oauthCredentialTargetScope,\n slot: oauth2.connectionSlot,\n value: { kind: \"connection\", connectionId },\n }),\n reactivityKeys: [...sourceWriteKeys, ...connectionWriteKeys],\n });\n }}\n reconnectingLabel=\"Reconnecting…\"\n signingInLabel=\"Signing in…\"\n />\n )}\n\n {error && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n )}\n\n <div className=\"flex items-center justify-between border-t border-border pt-4\">\n <Button variant=\"ghost\" onClick={props.onSave}>\n Cancel\n </Button>\n <Button onClick={handleSave} disabled={!dirty || saving}>\n {saving ? \"Saving…\" : \"Save changes\"}\n </Button>\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Stdio read-only view\n// ---------------------------------------------------------------------------\n\nfunction StdioReadOnly(props: {\n sourceId: string;\n initial: McpStoredSourceSchemaType & { config: { transport: \"stdio\" } };\n onSave: () => void;\n}) {\n const { command, args } = props.initial.config;\n return (\n <div className=\"space-y-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">Edit MCP Source</h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Stdio MCP sources cannot be edited in the UI. Modify the executor.jsonc config file\n directly.\n </p>\n </div>\n\n <div className=\"flex items-center gap-3 rounded-lg border border-border bg-card px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-semibold text-card-foreground\">{props.sourceId}</p>\n <p className=\"mt-0.5 text-xs text-muted-foreground font-mono\">\n {command} {(args ?? []).join(\" \")}\n </p>\n </div>\n <Badge variant=\"secondary\" className=\"text-xs\">\n stdio\n </Badge>\n </div>\n\n <div className=\"flex items-center justify-end border-t border-border pt-4\">\n <Button onClick={props.onSave}>Done</Button>\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Main component\n// ---------------------------------------------------------------------------\n\nexport default function EditMcpSource({\n sourceId,\n onSave,\n}: {\n readonly sourceId: string;\n readonly onSave: () => void;\n}) {\n const scopeId = useScope();\n const sourceResult = useAtomValue(mcpSourceAtom(scopeId, sourceId)) as AsyncResult.AsyncResult<\n McpStoredSourceSchemaType | null,\n unknown\n >;\n const source =\n AsyncResult.isSuccess(sourceResult) && sourceResult.value ? sourceResult.value : null;\n const sourceScope = source ? ScopeId.make(source.scope) : scopeId;\n const bindingsResult = useAtomValue(mcpSourceBindingsAtom(scopeId, sourceId, sourceScope));\n\n if (!AsyncResult.isSuccess(sourceResult) || !source || !AsyncResult.isSuccess(bindingsResult)) {\n return (\n <div className=\"space-y-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">Edit MCP Source</h1>\n <p className=\"mt-1 text-sm text-muted-foreground\">Loading configuration…</p>\n </div>\n </div>\n );\n }\n\n if (source.config.transport === \"stdio\") {\n return (\n <StdioReadOnly\n sourceId={sourceId}\n initial={source as McpStoredSourceSchemaType & { config: { transport: \"stdio\" } }}\n onSave={onSave}\n />\n );\n }\n\n return (\n <RemoteEditForm\n sourceId={sourceId}\n initial={source as McpStoredSourceSchemaType & { config: { transport: \"remote\" } }}\n bindings={b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AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpSourceAtom,
|
|
3
3
|
mcpSourceBindingsAtom
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-4ORPFRLI.js";
|
|
5
|
+
import "./chunk-M6REVU6O.js";
|
|
6
6
|
|
|
7
7
|
// src/react/McpSourceSummary.tsx
|
|
8
8
|
import { useAtomValue } from "@effect/atom-react";
|
|
@@ -82,4 +82,4 @@ function McpSourceSummary(props) {
|
|
|
82
82
|
export {
|
|
83
83
|
McpSourceSummary as default
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=McpSourceSummary-
|
|
85
|
+
//# sourceMappingURL=McpSourceSummary-257JNETP.js.map
|
package/dist/api/group.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { InternalError } from "@executor-js/sdk/core";
|
|
4
4
|
import { McpConnectionError, McpToolDiscoveryError } from "../sdk/errors";
|
|
5
|
-
import { McpStoredSourceSchema } from "../sdk/stored-source";
|
|
6
|
-
import { McpSourceBindingRef } from "../sdk/types";
|
|
7
5
|
export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.HttpApiEndpoint<"probeEndpoint", "POST", "/scopes/:scopeId/mcp/probe", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
8
6
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
9
7
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
@@ -112,7 +110,45 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
112
110
|
}>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/mcp/sources/:namespace", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
113
111
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
114
112
|
namespace: Schema.String;
|
|
115
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<
|
|
113
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<Schema.Struct<{
|
|
114
|
+
readonly namespace: Schema.String;
|
|
115
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
116
|
+
readonly name: Schema.String;
|
|
117
|
+
readonly config: Schema.Union<readonly [Schema.Struct<{
|
|
118
|
+
readonly transport: Schema.Literal<"remote">;
|
|
119
|
+
readonly endpoint: Schema.String;
|
|
120
|
+
readonly remoteTransport: Schema.withConstructorDefault<Schema.optionalKey<Schema.Literals<readonly ["streamable-http", "sse", "auto"]>>>;
|
|
121
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
122
|
+
readonly kind: Schema.Literal<"binding">;
|
|
123
|
+
readonly slot: Schema.String;
|
|
124
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
125
|
+
}>]>>>;
|
|
126
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
127
|
+
readonly kind: Schema.Literal<"binding">;
|
|
128
|
+
readonly slot: Schema.String;
|
|
129
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
130
|
+
}>]>>>;
|
|
131
|
+
readonly auth: Schema.Union<readonly [Schema.Struct<{
|
|
132
|
+
readonly kind: Schema.Literal<"none">;
|
|
133
|
+
}>, Schema.Struct<{
|
|
134
|
+
readonly kind: Schema.Literal<"header">;
|
|
135
|
+
readonly headerName: Schema.String;
|
|
136
|
+
readonly secretSlot: Schema.String;
|
|
137
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
138
|
+
}>, Schema.Struct<{
|
|
139
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
140
|
+
readonly connectionSlot: Schema.String;
|
|
141
|
+
readonly clientIdSlot: Schema.optional<Schema.String>;
|
|
142
|
+
readonly clientSecretSlot: Schema.optional<Schema.String>;
|
|
143
|
+
}>]>;
|
|
144
|
+
}>, Schema.Struct<{
|
|
145
|
+
readonly transport: Schema.Literal<"stdio">;
|
|
146
|
+
readonly command: Schema.String;
|
|
147
|
+
readonly args: Schema.optional<Schema.$Array<Schema.String>>;
|
|
148
|
+
readonly env: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
149
|
+
readonly cwd: Schema.optional<Schema.String>;
|
|
150
|
+
}>]>;
|
|
151
|
+
}>>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/mcp/sources/:namespace", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
116
152
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
117
153
|
namespace: Schema.String;
|
|
118
154
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
@@ -177,7 +213,25 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
177
213
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
178
214
|
namespace: Schema.String;
|
|
179
215
|
sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
180
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<
|
|
216
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
|
|
217
|
+
readonly sourceId: Schema.String;
|
|
218
|
+
readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
219
|
+
readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
220
|
+
readonly slot: Schema.String;
|
|
221
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
222
|
+
readonly kind: Schema.Literal<"text">;
|
|
223
|
+
readonly text: Schema.String;
|
|
224
|
+
}>, Schema.Struct<{
|
|
225
|
+
readonly kind: Schema.Literal<"secret">;
|
|
226
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
227
|
+
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
228
|
+
}>, Schema.Struct<{
|
|
229
|
+
readonly kind: Schema.Literal<"connection">;
|
|
230
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
231
|
+
}>]>;
|
|
232
|
+
readonly createdAt: Schema.Date;
|
|
233
|
+
readonly updatedAt: Schema.Date;
|
|
234
|
+
}>>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"setSourceBinding", "POST", "/scopes/:scopeId/mcp/source-bindings", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
181
235
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
182
236
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
183
237
|
readonly sourceId: Schema.String;
|
|
@@ -195,7 +249,25 @@ export declare const McpGroup: HttpApiGroup.HttpApiGroup<"mcp", HttpApiEndpoint.
|
|
|
195
249
|
readonly kind: Schema.Literal<"connection">;
|
|
196
250
|
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
197
251
|
}>]>;
|
|
198
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<
|
|
252
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
253
|
+
readonly sourceId: Schema.String;
|
|
254
|
+
readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
255
|
+
readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
256
|
+
readonly slot: Schema.String;
|
|
257
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
258
|
+
readonly kind: Schema.Literal<"text">;
|
|
259
|
+
readonly text: Schema.String;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly kind: Schema.Literal<"secret">;
|
|
262
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
263
|
+
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
264
|
+
}>, Schema.Struct<{
|
|
265
|
+
readonly kind: Schema.Literal<"connection">;
|
|
266
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
267
|
+
}>]>;
|
|
268
|
+
readonly createdAt: Schema.Date;
|
|
269
|
+
readonly updatedAt: Schema.Date;
|
|
270
|
+
}>>, HttpApiEndpoint.Json<typeof InternalError | typeof McpConnectionError | typeof McpToolDiscoveryError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"removeSourceBinding", "POST", "/scopes/:scopeId/mcp/source-bindings/remove", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
199
271
|
scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
200
272
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
201
273
|
readonly sourceId: Schema.String;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -30,8 +30,44 @@ export declare const mcpHttpPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
30
30
|
}, import("@executor-js/storage-core").StorageFailure | import("../sdk/errors").McpConnectionError | import("../sdk/errors").McpToolDiscoveryError, never>;
|
|
31
31
|
getSource: (namespace: string, scope: string) => import("effect/Effect").Effect<import("../sdk").McpStoredSource | null, import("@executor-js/storage-core").StorageFailure, never>;
|
|
32
32
|
updateSource: (namespace: string, scope: string, input: import("../promise").McpUpdateSourceInput) => import("effect/Effect").Effect<void, import("@executor-js/storage-core").StorageFailure | import("../sdk/errors").McpConnectionError, never>;
|
|
33
|
-
listSourceBindings: (sourceId: string, sourceScope: string) => import("effect/Effect").Effect<readonly
|
|
34
|
-
|
|
33
|
+
listSourceBindings: (sourceId: string, sourceScope: string) => import("effect/Effect").Effect<readonly {
|
|
34
|
+
readonly value: {
|
|
35
|
+
readonly text: string;
|
|
36
|
+
readonly kind: "text";
|
|
37
|
+
} | {
|
|
38
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
39
|
+
readonly kind: "secret";
|
|
40
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
41
|
+
} | {
|
|
42
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
43
|
+
readonly kind: "connection";
|
|
44
|
+
};
|
|
45
|
+
readonly createdAt: Date;
|
|
46
|
+
readonly sourceId: string;
|
|
47
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
48
|
+
readonly updatedAt: Date;
|
|
49
|
+
readonly slot: string;
|
|
50
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
51
|
+
}[], import("@executor-js/storage-core").StorageFailure, never>;
|
|
52
|
+
setSourceBinding: (input: import("../sdk").McpSourceBindingInput) => import("effect/Effect").Effect<{
|
|
53
|
+
readonly value: {
|
|
54
|
+
readonly text: string;
|
|
55
|
+
readonly kind: "text";
|
|
56
|
+
} | {
|
|
57
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
58
|
+
readonly kind: "secret";
|
|
59
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
62
|
+
readonly kind: "connection";
|
|
63
|
+
};
|
|
64
|
+
readonly createdAt: Date;
|
|
65
|
+
readonly sourceId: string;
|
|
66
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
67
|
+
readonly updatedAt: Date;
|
|
68
|
+
readonly slot: string;
|
|
69
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
70
|
+
}, import("@executor-js/storage-core").StorageFailure, never>;
|
|
35
71
|
removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => import("effect/Effect").Effect<void, import("@executor-js/storage-core").StorageFailure, never>;
|
|
36
72
|
}, import("../sdk").McpBindingStore, McpPluginOptions, {
|
|
37
73
|
readonly mcp_source: {
|
|
@@ -298,7 +334,45 @@ export declare const mcpHttpPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
298
334
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/mcp/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
299
335
|
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
300
336
|
namespace: import("effect/Schema").String;
|
|
301
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<
|
|
337
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
338
|
+
readonly namespace: import("effect/Schema").String;
|
|
339
|
+
readonly scope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
340
|
+
readonly name: import("effect/Schema").String;
|
|
341
|
+
readonly config: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
342
|
+
readonly transport: import("effect/Schema").Literal<"remote">;
|
|
343
|
+
readonly endpoint: import("effect/Schema").String;
|
|
344
|
+
readonly remoteTransport: import("effect/Schema").withConstructorDefault<import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["streamable-http", "sse", "auto"]>>>;
|
|
345
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
346
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
347
|
+
readonly slot: import("effect/Schema").String;
|
|
348
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
349
|
+
}>]>>>;
|
|
350
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
351
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
352
|
+
readonly slot: import("effect/Schema").String;
|
|
353
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
354
|
+
}>]>>>;
|
|
355
|
+
readonly auth: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
356
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
357
|
+
}>, import("effect/Schema").Struct<{
|
|
358
|
+
readonly kind: import("effect/Schema").Literal<"header">;
|
|
359
|
+
readonly headerName: import("effect/Schema").String;
|
|
360
|
+
readonly secretSlot: import("effect/Schema").String;
|
|
361
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
362
|
+
}>, import("effect/Schema").Struct<{
|
|
363
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
364
|
+
readonly connectionSlot: import("effect/Schema").String;
|
|
365
|
+
readonly clientIdSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
366
|
+
readonly clientSecretSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
367
|
+
}>]>;
|
|
368
|
+
}>, import("effect/Schema").Struct<{
|
|
369
|
+
readonly transport: import("effect/Schema").Literal<"stdio">;
|
|
370
|
+
readonly command: import("effect/Schema").String;
|
|
371
|
+
readonly args: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
372
|
+
readonly env: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
373
|
+
readonly cwd: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
374
|
+
}>]>;
|
|
375
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/mcp/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
302
376
|
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
303
377
|
namespace: import("effect/Schema").String;
|
|
304
378
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
@@ -363,7 +437,25 @@ export declare const mcpHttpPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
363
437
|
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
364
438
|
namespace: import("effect/Schema").String;
|
|
365
439
|
sourceScopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
366
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<
|
|
440
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
441
|
+
readonly sourceId: import("effect/Schema").String;
|
|
442
|
+
readonly sourceScopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
443
|
+
readonly scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
444
|
+
readonly slot: import("effect/Schema").String;
|
|
445
|
+
readonly value: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
446
|
+
readonly kind: import("effect/Schema").Literal<"text">;
|
|
447
|
+
readonly text: import("effect/Schema").String;
|
|
448
|
+
}>, import("effect/Schema").Struct<{
|
|
449
|
+
readonly kind: import("effect/Schema").Literal<"secret">;
|
|
450
|
+
readonly secretId: import("effect/Schema").brand<import("effect/Schema").String, "SecretId">;
|
|
451
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
452
|
+
}>, import("effect/Schema").Struct<{
|
|
453
|
+
readonly kind: import("effect/Schema").Literal<"connection">;
|
|
454
|
+
readonly connectionId: import("effect/Schema").brand<import("effect/Schema").String, "ConnectionId">;
|
|
455
|
+
}>]>;
|
|
456
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
457
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
458
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setSourceBinding", "POST", "/scopes/:scopeId/mcp/source-bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
367
459
|
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
368
460
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
369
461
|
readonly sourceId: import("effect/Schema").String;
|
|
@@ -381,7 +473,25 @@ export declare const mcpHttpPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
381
473
|
readonly kind: import("effect/Schema").Literal<"connection">;
|
|
382
474
|
readonly connectionId: import("effect/Schema").brand<import("effect/Schema").String, "ConnectionId">;
|
|
383
475
|
}>]>;
|
|
384
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<
|
|
476
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
477
|
+
readonly sourceId: import("effect/Schema").String;
|
|
478
|
+
readonly sourceScopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
479
|
+
readonly scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
480
|
+
readonly slot: import("effect/Schema").String;
|
|
481
|
+
readonly value: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
482
|
+
readonly kind: import("effect/Schema").Literal<"text">;
|
|
483
|
+
readonly text: import("effect/Schema").String;
|
|
484
|
+
}>, import("effect/Schema").Struct<{
|
|
485
|
+
readonly kind: import("effect/Schema").Literal<"secret">;
|
|
486
|
+
readonly secretId: import("effect/Schema").brand<import("effect/Schema").String, "SecretId">;
|
|
487
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
488
|
+
}>, import("effect/Schema").Struct<{
|
|
489
|
+
readonly kind: import("effect/Schema").Literal<"connection">;
|
|
490
|
+
readonly connectionId: import("effect/Schema").brand<import("effect/Schema").String, "ConnectionId">;
|
|
491
|
+
}>]>;
|
|
492
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
493
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
494
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeSourceBinding", "POST", "/scopes/:scopeId/mcp/source-bindings/remove", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
385
495
|
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
386
496
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
387
497
|
readonly sourceId: import("effect/Schema").String;
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
McpConnectionAuthInput,
|
|
3
3
|
McpConnectionError,
|
|
4
4
|
McpCredentialInput,
|
|
5
|
-
|
|
5
|
+
McpSourceBindingInput,
|
|
6
6
|
McpSourceBindingRef,
|
|
7
7
|
McpStoredSourceData,
|
|
8
8
|
McpToolDiscoveryError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M6REVU6O.js";
|
|
10
10
|
|
|
11
11
|
// src/react/atoms.ts
|
|
12
12
|
import * as Atom from "effect/unstable/reactivity/Atom";
|
|
@@ -26,13 +26,12 @@ import { InternalError, ScopeId as ScopeId2, SecretBackedMap } from "@executor-j
|
|
|
26
26
|
// src/sdk/stored-source.ts
|
|
27
27
|
import { Schema } from "effect";
|
|
28
28
|
import { ScopeId } from "@executor-js/sdk/core";
|
|
29
|
-
var McpStoredSourceSchema =
|
|
29
|
+
var McpStoredSourceSchema = Schema.Struct({
|
|
30
30
|
namespace: Schema.String,
|
|
31
31
|
scope: ScopeId,
|
|
32
32
|
name: Schema.String,
|
|
33
33
|
config: McpStoredSourceData
|
|
34
|
-
})
|
|
35
|
-
};
|
|
34
|
+
}).annotate({ identifier: "McpStoredSource" });
|
|
36
35
|
|
|
37
36
|
// src/api/group.ts
|
|
38
37
|
var ScopeParams = { scopeId: ScopeId2 };
|
|
@@ -166,7 +165,7 @@ var McpGroup = HttpApiGroup.make("mcp").add(
|
|
|
166
165
|
).add(
|
|
167
166
|
HttpApiEndpoint.post("setSourceBinding", "/scopes/:scopeId/mcp/source-bindings", {
|
|
168
167
|
params: ScopeParams,
|
|
169
|
-
payload:
|
|
168
|
+
payload: McpSourceBindingInput,
|
|
170
169
|
success: McpSourceBindingRef,
|
|
171
170
|
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
172
171
|
})
|
|
@@ -236,4 +235,4 @@ export {
|
|
|
236
235
|
updateMcpSource,
|
|
237
236
|
setMcpSourceBinding
|
|
238
237
|
};
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
238
|
+
//# sourceMappingURL=chunk-4ORPFRLI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/atoms.ts","../src/react/client.ts","../src/api/group.ts","../src/sdk/stored-source.ts"],"sourcesContent":["import type { ScopeId } from \"@executor-js/sdk/core\";\nimport * as Atom from \"effect/unstable/reactivity/Atom\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nimport { sourcesOptimisticAtom } from \"@executor-js/react/api/atoms\";\nimport { ReactivityKey } from \"@executor-js/react/api/reactivity-keys\";\nimport { McpClient } from \"./client\";\n\n// ---------------------------------------------------------------------------\n// Query atoms\n// ---------------------------------------------------------------------------\n\nexport const mcpSourceAtom = (scopeId: ScopeId, namespace: string) =>\n McpClient.query(\"mcp\", \"getSource\", {\n params: { scopeId, namespace },\n timeToLive: \"15 seconds\",\n reactivityKeys: [ReactivityKey.sources, ReactivityKey.tools],\n });\n\nexport const mcpSourceBindingsAtom = (\n scopeId: ScopeId,\n namespace: string,\n sourceScopeId: ScopeId,\n) =>\n McpClient.query(\"mcp\", \"listSourceBindings\", {\n params: { scopeId, namespace, sourceScopeId },\n timeToLive: \"15 seconds\",\n reactivityKeys: [ReactivityKey.sources, ReactivityKey.secrets, ReactivityKey.connections],\n });\n\n// ---------------------------------------------------------------------------\n// Mutation atoms\n// ---------------------------------------------------------------------------\n\nexport const probeMcpEndpoint = McpClient.mutation(\"mcp\", \"probeEndpoint\");\nexport const addMcpSource = McpClient.mutation(\"mcp\", \"addSource\");\nexport const addMcpSourceOptimistic = Atom.family((scopeId: ScopeId) =>\n sourcesOptimisticAtom(scopeId).pipe(\n Atom.optimisticFn({\n reducer: (current, arg) =>\n AsyncResult.map(current, (rows) => {\n const id = arg.payload.namespace ?? `pending-${Math.random().toString(36).slice(2)}`;\n const source = {\n id,\n scopeId: arg.payload.targetScope,\n kind: \"mcp\",\n pluginId: \"mcp\",\n name: arg.payload.name ?? id,\n ...(arg.payload.transport === \"remote\" ? { url: arg.payload.endpoint } : {}),\n canRemove: false,\n canRefresh: false,\n canEdit: false,\n runtime: false,\n };\n return [source, ...rows.filter((row) => row.id !== id)].sort((a, b) =>\n a.name.localeCompare(b.name),\n );\n }),\n fn: addMcpSource,\n }),\n ),\n);\nexport const removeMcpSource = McpClient.mutation(\"mcp\", \"removeSource\");\nexport const refreshMcpSource = McpClient.mutation(\"mcp\", \"refreshSource\");\nexport const updateMcpSource = McpClient.mutation(\"mcp\", \"updateSource\");\nexport const setMcpSourceBinding = McpClient.mutation(\"mcp\", \"setSourceBinding\");\nexport const removeMcpSourceBinding = McpClient.mutation(\"mcp\", \"removeSourceBinding\");\n","import { createPluginAtomClient } from \"@executor-js/sdk/client\";\nimport { getBaseUrl } from \"@executor-js/react/api/base-url\";\nimport { McpGroup } from \"../api/group\";\n\nexport const McpClient = createPluginAtomClient(McpGroup, {\n baseUrl: getBaseUrl,\n});\n","import { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\nimport { Schema } from \"effect\";\nimport { InternalError, ScopeId, SecretBackedMap } from \"@executor-js/sdk/core\";\n\nimport { McpConnectionError, McpToolDiscoveryError } from \"../sdk/errors\";\nimport { McpStoredSourceSchema } from \"../sdk/stored-source\";\nimport {\n McpConnectionAuthInput,\n McpCredentialInput,\n McpSourceBindingInput,\n McpSourceBindingRef,\n} from \"../sdk/types\";\n\n// ---------------------------------------------------------------------------\n// Params\n// ---------------------------------------------------------------------------\n\nconst ScopeParams = { scopeId: ScopeId };\nconst SourceParams = { scopeId: ScopeId, namespace: Schema.String };\nconst SourceBindingParams = {\n scopeId: ScopeId,\n namespace: Schema.String,\n sourceScopeId: ScopeId,\n};\n\n// ---------------------------------------------------------------------------\n// Auth payload (only for remote)\n// ---------------------------------------------------------------------------\n\nconst AuthPayload = McpConnectionAuthInput;\n\nconst StringMap = Schema.Record(Schema.String, Schema.String);\n// ---------------------------------------------------------------------------\n// Add source — discriminated union on transport\n// ---------------------------------------------------------------------------\n\nconst AddRemoteSourcePayload = Schema.Struct({\n targetScope: ScopeId,\n transport: Schema.Literal(\"remote\"),\n name: Schema.String,\n endpoint: Schema.String,\n remoteTransport: Schema.optional(Schema.Literals([\"streamable-http\", \"sse\", \"auto\"])),\n namespace: Schema.optional(Schema.String),\n queryParams: Schema.optional(Schema.Record(Schema.String, McpCredentialInput)),\n headers: Schema.optional(Schema.Record(Schema.String, McpCredentialInput)),\n auth: Schema.optional(AuthPayload),\n credentialTargetScope: Schema.optional(ScopeId),\n});\n\nconst AddStdioSourcePayload = Schema.Struct({\n targetScope: ScopeId,\n transport: Schema.Literal(\"stdio\"),\n name: Schema.String,\n command: Schema.String,\n args: Schema.optional(Schema.Array(Schema.String)),\n env: Schema.optional(StringMap),\n cwd: Schema.optional(Schema.String),\n namespace: Schema.optional(Schema.String),\n});\n\nconst AddSourcePayload = Schema.Union([AddRemoteSourcePayload, AddStdioSourcePayload]);\n\n// ---------------------------------------------------------------------------\n// Other payloads\n// ---------------------------------------------------------------------------\n\nconst UpdateSourcePayload = Schema.Struct({\n sourceScope: ScopeId,\n name: Schema.optional(Schema.String),\n endpoint: Schema.optional(Schema.String),\n headers: Schema.optional(Schema.Record(Schema.String, McpCredentialInput)),\n queryParams: Schema.optional(Schema.Record(Schema.String, McpCredentialInput)),\n credentialTargetScope: Schema.optional(ScopeId),\n auth: Schema.optional(AuthPayload),\n});\n\nconst UpdateSourceResponse = Schema.Struct({\n updated: Schema.Boolean,\n});\n\nconst ProbeEndpointPayload = Schema.Struct({\n endpoint: Schema.String,\n headers: Schema.optional(SecretBackedMap),\n queryParams: Schema.optional(SecretBackedMap),\n});\n\nconst ProbeEndpointResponse = Schema.Struct({\n connected: Schema.Boolean,\n requiresOAuth: Schema.Boolean,\n supportsDynamicRegistration: Schema.Boolean,\n name: Schema.String,\n namespace: Schema.String,\n toolCount: Schema.NullOr(Schema.Number),\n serverName: Schema.NullOr(Schema.String),\n});\n\nconst NamespacePayload = Schema.Struct({\n namespace: Schema.String,\n});\n\nconst RemoveBindingPayload = Schema.Struct({\n sourceId: Schema.String,\n sourceScope: ScopeId,\n slot: Schema.String,\n scope: ScopeId,\n});\n\n// ---------------------------------------------------------------------------\n// Responses\n// ---------------------------------------------------------------------------\n\nconst AddSourceResponse = Schema.Struct({\n toolCount: Schema.Number,\n namespace: Schema.String,\n});\n\nconst RefreshSourceResponse = Schema.Struct({\n toolCount: Schema.Number,\n});\n\nconst RemoveSourceResponse = Schema.Struct({\n removed: Schema.Boolean,\n});\n\n// ---------------------------------------------------------------------------\n// Group\n//\n// Plugin SDK errors (McpOAuthError etc.) are declared once at the group\n// level via `.addError(...)` — every endpoint inherits them. The errors\n// themselves carry their HTTP status via `HttpApiSchema.annotations`\n// in errors.ts, so handlers just `return yield* ext.foo(...)` and the\n// schema encodes whatever it gets.\n//\n// 5xx is handled at the API level: `CoreExecutorApi.addError(InternalError)`\n// adds a single shared opaque-by-schema 500 surface to every endpoint in\n// the entire API. Defects are captured + downgraded to it by an\n// HttpApiBuilder middleware (see apps/cloud/src/observability.ts).\n// No per-handler wrapping, no per-plugin InternalError.\n// ---------------------------------------------------------------------------\n\nexport const McpGroup = HttpApiGroup.make(\"mcp\")\n .add(\n HttpApiEndpoint.post(\"probeEndpoint\", \"/scopes/:scopeId/mcp/probe\", {\n params: ScopeParams,\n payload: ProbeEndpointPayload,\n success: ProbeEndpointResponse,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.post(\"addSource\", \"/scopes/:scopeId/mcp/sources\", {\n params: ScopeParams,\n payload: AddSourcePayload,\n success: AddSourceResponse,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.post(\"removeSource\", \"/scopes/:scopeId/mcp/sources/remove\", {\n params: ScopeParams,\n payload: NamespacePayload,\n success: RemoveSourceResponse,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.post(\"refreshSource\", \"/scopes/:scopeId/mcp/sources/refresh\", {\n params: ScopeParams,\n payload: NamespacePayload,\n success: RefreshSourceResponse,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.get(\"getSource\", \"/scopes/:scopeId/mcp/sources/:namespace\", {\n params: SourceParams,\n success: Schema.NullOr(McpStoredSourceSchema),\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.patch(\"updateSource\", \"/scopes/:scopeId/mcp/sources/:namespace\", {\n params: SourceParams,\n payload: UpdateSourcePayload,\n success: UpdateSourceResponse,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.get(\n \"listSourceBindings\",\n \"/scopes/:scopeId/mcp/sources/:namespace/base/:sourceScopeId/bindings\",\n {\n params: SourceBindingParams,\n success: Schema.Array(McpSourceBindingRef),\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n },\n ),\n )\n .add(\n HttpApiEndpoint.post(\"setSourceBinding\", \"/scopes/:scopeId/mcp/source-bindings\", {\n params: ScopeParams,\n payload: McpSourceBindingInput,\n success: McpSourceBindingRef,\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n )\n .add(\n HttpApiEndpoint.post(\"removeSourceBinding\", \"/scopes/:scopeId/mcp/source-bindings/remove\", {\n params: ScopeParams,\n payload: RemoveBindingPayload,\n success: Schema.Struct({ removed: Schema.Boolean }),\n error: [InternalError, McpConnectionError, McpToolDiscoveryError],\n }),\n );\n// Errors declared once at the group level — every endpoint inherits.\n// Plugin domain errors carry their own HttpApiSchema status (4xx);\n// `InternalError` is the shared opaque 500 translated at the HTTP\n// edge by `withCapture`. We only list errors an MCP *group*\n// endpoint can surface: `McpInvocationError` is thrown inside\n// `invokeTool` which is reached via the core `tools.invoke`\n// endpoint, not any MCP-group endpoint, so it doesn't belong here.\n// OAuth errors live on the shared `/oauth/*` group in `@executor-js/api`\n// now — the MCP group only declares its own plugin-domain errors.\n","import { Schema } from \"effect\";\nimport { ScopeId } from \"@executor-js/sdk/core\";\n\nimport { McpStoredSourceData } from \"./types\";\n\n// ---------------------------------------------------------------------------\n// Stored source — the shape persisted by the binding store and exposed\n// via the getSource HTTP endpoint.\n// ---------------------------------------------------------------------------\n\nexport const McpStoredSourceSchema = Schema.Struct({\n namespace: Schema.String,\n scope: ScopeId,\n name: Schema.String,\n config: McpStoredSourceData,\n}).annotate({ identifier: \"McpStoredSource\" });\nexport type McpStoredSourceSchema = typeof McpStoredSourceSchema.Type;\n\nexport type McpStoredSourceSchemaType = typeof McpStoredSourceSchema.Type;\n"],"mappings":";;;;;;;;;;;AACA,YAAY,UAAU;AACtB,YAAY,iBAAiB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;;;ACJ9B,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;;;ACD3B,SAAS,iBAAiB,oBAAoB;AAC9C,SAAS,UAAAA,eAAc;AACvB,SAAS,eAAe,WAAAC,UAAS,uBAAuB;;;ACFxD,SAAS,cAAc;AACvB,SAAS,eAAe;AASjB,IAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,WAAW,OAAO;AAAA,EAClB,OAAO;AAAA,EACP,MAAM,OAAO;AAAA,EACb,QAAQ;AACV,CAAC,EAAE,SAAS,EAAE,YAAY,kBAAkB,CAAC;;;ADE7C,IAAM,cAAc,EAAE,SAASC,SAAQ;AACvC,IAAM,eAAe,EAAE,SAASA,UAAS,WAAWC,QAAO,OAAO;AAClE,IAAM,sBAAsB;AAAA,EAC1B,SAASD;AAAA,EACT,WAAWC,QAAO;AAAA,EAClB,eAAeD;AACjB;AAMA,IAAM,cAAc;AAEpB,IAAM,YAAYC,QAAO,OAAOA,QAAO,QAAQA,QAAO,MAAM;AAK5D,IAAM,yBAAyBA,QAAO,OAAO;AAAA,EAC3C,aAAaD;AAAA,EACb,WAAWC,QAAO,QAAQ,QAAQ;AAAA,EAClC,MAAMA,QAAO;AAAA,EACb,UAAUA,QAAO;AAAA,EACjB,iBAAiBA,QAAO,SAASA,QAAO,SAAS,CAAC,mBAAmB,OAAO,MAAM,CAAC,CAAC;AAAA,EACpF,WAAWA,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c;AAChE,IAAM,mBAAmB,UAAU,SAAS,OAAO,eAAe;AAClE,IAAM,kBAAkB,UAAU,SAAS,OAAO,cAAc;AAChE,IAAM,sBAAsB,UAAU,SAAS,OAAO,kBAAkB;AACxE,IAAM,yBAAyB,UAAU,SAAS,OAAO,qBAAqB;","names":["Schema","ScopeId","ScopeId","Schema"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/sdk/types.ts
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
import {
|
|
4
|
-
|
|
4
|
+
ConfiguredCredentialValue,
|
|
5
5
|
CredentialBindingValue,
|
|
6
6
|
credentialSlotKey,
|
|
7
7
|
ScopedSecretCredentialInput,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@executor-js/sdk/core";
|
|
12
12
|
var McpRemoteTransport = Schema.Literals(["streamable-http", "sse", "auto"]);
|
|
13
13
|
var McpTransport = Schema.Literals(["streamable-http", "sse", "stdio", "auto"]);
|
|
14
|
-
var ConfiguredMcpCredentialValue =
|
|
14
|
+
var ConfiguredMcpCredentialValue = ConfiguredCredentialValue;
|
|
15
15
|
var McpCredentialInput = Schema.Union([
|
|
16
16
|
ScopedSecretCredentialInput,
|
|
17
17
|
SecretBackedValue,
|
|
@@ -57,18 +57,14 @@ var McpConnectionAuthInput = Schema.Union([
|
|
|
57
57
|
})
|
|
58
58
|
]);
|
|
59
59
|
var McpSourceBindingValue = CredentialBindingValue;
|
|
60
|
-
var
|
|
60
|
+
var McpSourceBindingInput = Schema.Struct({
|
|
61
61
|
sourceId: Schema.String,
|
|
62
62
|
sourceScope: ScopeId,
|
|
63
63
|
scope: ScopeId,
|
|
64
64
|
slot: Schema.String,
|
|
65
65
|
value: McpSourceBindingValue
|
|
66
66
|
});
|
|
67
|
-
var
|
|
68
|
-
"McpSourceBindingInput"
|
|
69
|
-
)(McpSourceBindingInputSchema.fields) {
|
|
70
|
-
};
|
|
71
|
-
var McpSourceBindingRef = class extends Schema.Class("McpSourceBindingRef")({
|
|
67
|
+
var McpSourceBindingRef = Schema.Struct({
|
|
72
68
|
sourceId: Schema.String,
|
|
73
69
|
sourceScopeId: ScopeId,
|
|
74
70
|
scopeId: ScopeId,
|
|
@@ -76,8 +72,7 @@ var McpSourceBindingRef = class extends Schema.Class("McpSourceBindingRef")({
|
|
|
76
72
|
value: McpSourceBindingValue,
|
|
77
73
|
createdAt: Schema.Date,
|
|
78
74
|
updatedAt: Schema.Date
|
|
79
|
-
})
|
|
80
|
-
};
|
|
75
|
+
});
|
|
81
76
|
var StringMap = Schema.Record(Schema.String, Schema.String);
|
|
82
77
|
var McpRemoteSourceData = Schema.Struct({
|
|
83
78
|
transport: Schema.Literal("remote"),
|
|
@@ -114,15 +109,14 @@ var McpToolAnnotations = Schema.Struct({
|
|
|
114
109
|
idempotentHint: Schema.optional(Schema.Boolean),
|
|
115
110
|
openWorldHint: Schema.optional(Schema.Boolean)
|
|
116
111
|
});
|
|
117
|
-
var McpToolBinding =
|
|
112
|
+
var McpToolBinding = Schema.Struct({
|
|
118
113
|
toolId: Schema.String,
|
|
119
114
|
toolName: Schema.String,
|
|
120
115
|
description: Schema.NullOr(Schema.String),
|
|
121
116
|
inputSchema: Schema.optional(Schema.Unknown),
|
|
122
117
|
outputSchema: Schema.optional(Schema.Unknown),
|
|
123
118
|
annotations: Schema.optional(McpToolAnnotations)
|
|
124
|
-
})
|
|
125
|
-
};
|
|
119
|
+
});
|
|
126
120
|
|
|
127
121
|
// src/sdk/errors.ts
|
|
128
122
|
import { Schema as Schema2 } from "effect";
|
|
@@ -173,7 +167,6 @@ export {
|
|
|
173
167
|
MCP_OAUTH_CLIENT_SECRET_SLOT,
|
|
174
168
|
McpConnectionAuth,
|
|
175
169
|
McpConnectionAuthInput,
|
|
176
|
-
McpSourceBindingInputSchema,
|
|
177
170
|
McpSourceBindingInput,
|
|
178
171
|
McpSourceBindingRef,
|
|
179
172
|
McpStoredSourceData,
|
|
@@ -183,4 +176,4 @@ export {
|
|
|
183
176
|
McpToolDiscoveryError,
|
|
184
177
|
McpInvocationError
|
|
185
178
|
};
|
|
186
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-M6REVU6O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sdk/types.ts","../src/sdk/errors.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\nimport {\n ConfiguredCredentialValue,\n CredentialBindingValue,\n credentialSlotKey,\n ScopedSecretCredentialInput,\n ScopeId,\n SecretBackedMap,\n SecretBackedValue,\n} from \"@executor-js/sdk/core\";\n\nexport { SecretBackedMap, SecretBackedValue };\n\n// ---------------------------------------------------------------------------\n// Remote transport type\n// ---------------------------------------------------------------------------\n\nexport const McpRemoteTransport = Schema.Literals([\"streamable-http\", \"sse\", \"auto\"]);\nexport type McpRemoteTransport = typeof McpRemoteTransport.Type;\n\n/** All transport types (used in the connector layer) */\nexport const McpTransport = Schema.Literals([\"streamable-http\", \"sse\", \"stdio\", \"auto\"]);\nexport type McpTransport = typeof McpTransport.Type;\n\nexport const ConfiguredMcpCredentialValue = ConfiguredCredentialValue;\nexport type ConfiguredMcpCredentialValue = typeof ConfiguredMcpCredentialValue.Type;\n\nexport const McpCredentialInput = Schema.Union([\n ScopedSecretCredentialInput,\n SecretBackedValue,\n ConfiguredMcpCredentialValue,\n]);\nexport type McpCredentialInput = typeof McpCredentialInput.Type;\n\nexport const mcpHeaderSlot = (name: string): string => credentialSlotKey(\"header\", name);\nexport const mcpQueryParamSlot = (name: string): string => credentialSlotKey(\"query_param\", name);\nexport const MCP_HEADER_AUTH_SLOT = \"auth:header\";\nexport const MCP_OAUTH_CONNECTION_SLOT = \"auth:oauth2:connection\";\nexport const MCP_OAUTH_CLIENT_ID_SLOT = \"auth:oauth2:client-id\";\nexport const MCP_OAUTH_CLIENT_SECRET_SLOT = \"auth:oauth2:client-secret\";\n\n// ---------------------------------------------------------------------------\n// Connection auth (only applies to remote sources)\n//\n// `oauth2` is a source-owned credential slot. Concrete per-user or\n// per-workspace connection ids live in core credential_binding rows.\n// ---------------------------------------------------------------------------\n\n/** JSON object loosely typed — used for opaque OAuth state we just round-trip. */\nconst JsonObject = Schema.Record(Schema.String, Schema.Unknown);\nexport { JsonObject as McpJsonObject };\n\nexport const McpConnectionAuth = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"none\") }),\n Schema.Struct({\n kind: Schema.Literal(\"header\"),\n headerName: Schema.String,\n secretSlot: Schema.String,\n prefix: Schema.optional(Schema.String),\n }),\n Schema.Struct({\n kind: Schema.Literal(\"oauth2\"),\n connectionSlot: Schema.String,\n clientIdSlot: Schema.optional(Schema.String),\n clientSecretSlot: Schema.optional(Schema.String),\n }),\n]);\nexport type McpConnectionAuth = typeof McpConnectionAuth.Type;\n\nexport const McpConnectionAuthInput = Schema.Union([\n McpConnectionAuth,\n Schema.Struct({\n kind: Schema.Literal(\"header\"),\n headerName: Schema.String,\n secretId: Schema.String,\n prefix: Schema.optional(Schema.String),\n targetScope: Schema.optional(ScopeId),\n secretScopeId: Schema.optional(ScopeId),\n }),\n Schema.Struct({\n kind: Schema.Literal(\"oauth2\"),\n connectionId: Schema.String,\n clientIdSecretId: Schema.optional(Schema.String),\n clientSecretSecretId: Schema.optional(Schema.NullOr(Schema.String)),\n }),\n]);\nexport type McpConnectionAuthInput = typeof McpConnectionAuthInput.Type;\n\nexport const McpSourceBindingValue = CredentialBindingValue;\nexport type McpSourceBindingValue = typeof McpSourceBindingValue.Type;\n\nexport const McpSourceBindingInput = Schema.Struct({\n sourceId: Schema.String,\n sourceScope: ScopeId,\n scope: ScopeId,\n slot: Schema.String,\n value: McpSourceBindingValue,\n});\nexport type McpSourceBindingInput = typeof McpSourceBindingInput.Type;\n\nexport const McpSourceBindingRef = Schema.Struct({\n sourceId: Schema.String,\n sourceScopeId: ScopeId,\n scopeId: ScopeId,\n slot: Schema.String,\n value: McpSourceBindingValue,\n createdAt: Schema.Date,\n updatedAt: Schema.Date,\n});\nexport type McpSourceBindingRef = typeof McpSourceBindingRef.Type;\n\n// ---------------------------------------------------------------------------\n// Stored source data — discriminated union on transport\n// ---------------------------------------------------------------------------\n\n/** Common fields for remote string map schemas */\nconst StringMap = Schema.Record(Schema.String, Schema.String);\n\nexport const McpRemoteSourceData = Schema.Struct({\n transport: Schema.Literal(\"remote\"),\n /** The MCP server endpoint URL */\n endpoint: Schema.String,\n /** Transport preference for this remote source */\n remoteTransport: McpRemoteTransport.pipe(\n Schema.optionalKey,\n Schema.withConstructorDefault(Effect.succeed(\"auto\" as const)),\n ),\n /** Extra query params appended to the endpoint URL */\n queryParams: Schema.optional(Schema.Record(Schema.String, ConfiguredMcpCredentialValue)),\n /** Extra headers sent on every request */\n headers: Schema.optional(Schema.Record(Schema.String, ConfiguredMcpCredentialValue)),\n /** Auth configuration */\n auth: McpConnectionAuth,\n});\nexport type McpRemoteSourceData = typeof McpRemoteSourceData.Type;\n\nexport const McpStdioSourceData = Schema.Struct({\n transport: Schema.Literal(\"stdio\"),\n /** The command to run */\n command: Schema.String,\n /** Arguments to the command */\n args: Schema.optional(Schema.Array(Schema.String)),\n /** Environment variables */\n env: Schema.optional(StringMap),\n /** Working directory */\n cwd: Schema.optional(Schema.String),\n});\nexport type McpStdioSourceData = typeof McpStdioSourceData.Type;\n\nexport const McpStoredSourceData = Schema.Union([McpRemoteSourceData, McpStdioSourceData]);\nexport type McpStoredSourceData = typeof McpStoredSourceData.Type;\n\n// ---------------------------------------------------------------------------\n// Tool binding — maps a registered ToolId back to the MCP tool name\n// ---------------------------------------------------------------------------\n\nexport const McpToolAnnotations = Schema.Struct({\n title: Schema.optional(Schema.String),\n readOnlyHint: Schema.optional(Schema.Boolean),\n destructiveHint: Schema.optional(Schema.Boolean),\n idempotentHint: Schema.optional(Schema.Boolean),\n openWorldHint: Schema.optional(Schema.Boolean),\n});\nexport type McpToolAnnotations = typeof McpToolAnnotations.Type;\n\nexport const McpToolBinding = Schema.Struct({\n toolId: Schema.String,\n toolName: Schema.String,\n description: Schema.NullOr(Schema.String),\n inputSchema: Schema.optional(Schema.Unknown),\n outputSchema: Schema.optional(Schema.Unknown),\n annotations: Schema.optional(McpToolAnnotations),\n});\nexport type McpToolBinding = typeof McpToolBinding.Type;\n","// MCP plugin tagged errors. Each carries an `HttpApiSchema` annotation so\n// it can be `.addError(...)` directly on the API group — handlers return\n// these and HttpApi encodes them as 4xx responses with a typed body. No\n// per-handler sanitisation step.\n\nimport { Schema } from \"effect\";\n\nexport class McpConnectionError extends Schema.TaggedErrorClass<McpConnectionError>()(\n \"McpConnectionError\",\n {\n transport: Schema.String,\n message: Schema.String,\n },\n { httpApiStatus: 400 },\n) {}\n\nexport class McpToolDiscoveryError extends Schema.TaggedErrorClass<McpToolDiscoveryError>()(\n \"McpToolDiscoveryError\",\n {\n stage: Schema.Literals([\"connect\", \"list_tools\"]),\n message: Schema.String,\n },\n { httpApiStatus: 400 },\n) {}\n\nexport class McpInvocationError extends Schema.TaggedErrorClass<McpInvocationError>()(\n \"McpInvocationError\",\n {\n toolName: Schema.String,\n message: Schema.String,\n },\n { httpApiStatus: 400 },\n) {}\n\nexport class McpOAuthError extends Schema.TaggedErrorClass<McpOAuthError>()(\n \"McpOAuthError\",\n {\n message: Schema.String,\n },\n { httpApiStatus: 400 },\n) {}\n"],"mappings":";AAAA,SAAS,QAAQ,cAAc;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQA,IAAM,qBAAqB,OAAO,SAAS,CAAC,mBAAmB,OAAO,MAAM,CAAC;AAI7E,IAAM,eAAe,OAAO,SAAS,CAAC,mBAAmB,OAAO,SAAS,MAAM,CAAC;AAGhF,IAAM,+BAA+B;AAGrC,IAAM,qBAAqB,OAAO,MAAM;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,gBAAgB,CAAC,SAAyB,kBAAkB,UAA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