@executor-js/plugin-mcp 0.0.2 → 0.2.1
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 +762 -0
- package/dist/AddMcpSource-VM3HY26S.js.map +1 -0
- package/dist/EditMcpSource-WELWGRJG.js +259 -0
- package/dist/EditMcpSource-WELWGRJG.js.map +1 -0
- package/dist/McpSourceSummary-7TDQXLT5.js +85 -0
- package/dist/McpSourceSummary-7TDQXLT5.js.map +1 -0
- package/dist/api/group.d.ts +115 -23
- package/dist/api/index.d.ts +391 -0
- package/dist/chunk-2ETJ6LQH.js +239 -0
- package/dist/chunk-2ETJ6LQH.js.map +1 -0
- package/dist/chunk-OOOH3IO4.js +2194 -0
- package/dist/chunk-OOOH3IO4.js.map +1 -0
- package/dist/chunk-SKSXXFOA.js +104 -0
- package/dist/chunk-SKSXXFOA.js.map +1 -0
- package/dist/chunk-Z4CRPOLI.js +186 -0
- package/dist/chunk-Z4CRPOLI.js.map +1 -0
- package/dist/chunk-ZIRGIRGP.js +115 -0
- package/dist/chunk-ZIRGIRGP.js.map +1 -0
- package/dist/client.js +51 -0
- package/dist/client.js.map +1 -0
- package/dist/core.js +26 -2
- package/dist/index.js +2 -1
- package/dist/react/McpRemoteSourceFields.d.ts +18 -0
- package/dist/react/McpSourceSummary.d.ts +5 -0
- package/dist/react/atoms.d.ts +211 -11
- package/dist/react/client.d.ts +114 -350
- package/dist/react/index.d.ts +1 -1
- package/dist/react/plugin-client.d.ts +9 -0
- package/dist/react/source-plugin.d.ts +1 -1
- package/dist/sdk/binding-store.d.ts +110 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/invoke.d.ts +2 -0
- package/dist/sdk/manifest.d.ts +2 -0
- package/dist/sdk/plugin.d.ts +168 -10
- package/dist/sdk/probe-shape-real-servers.live.test.d.ts +1 -0
- package/dist/sdk/probe-shape.d.ts +17 -3
- package/dist/sdk/stored-source.d.ts +9 -6
- package/dist/sdk/types.d.ts +153 -13
- package/dist/{stdio-connector-KNHLETKM.js → stdio-connector-AA5S6UUJ.js} +1 -1
- package/dist/{stdio-connector-KNHLETKM.js.map → stdio-connector-AA5S6UUJ.js.map} +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/server.d.ts +10 -0
- package/dist/testing.js +51 -0
- package/dist/testing.js.map +1 -0
- package/package.json +17 -4
- package/dist/chunk-DJANY5EU.js +0 -1325
- package/dist/chunk-DJANY5EU.js.map +0 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -1,2 +1,393 @@
|
|
|
1
|
+
import { type McpPluginOptions } from "../sdk/plugin";
|
|
2
|
+
import { McpExtensionService } from "./handlers";
|
|
1
3
|
export { McpGroup } from "./group";
|
|
2
4
|
export { McpHandlers, McpExtensionService } from "./handlers";
|
|
5
|
+
export declare const mcpHttpPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"mcp", {
|
|
6
|
+
probeEndpoint: (input: string | import("../sdk/plugin").McpProbeEndpointInput) => import("effect/Effect").Effect<{
|
|
7
|
+
connected: true;
|
|
8
|
+
requiresOAuth: false;
|
|
9
|
+
supportsDynamicRegistration: false;
|
|
10
|
+
name: string;
|
|
11
|
+
namespace: string;
|
|
12
|
+
toolCount: number;
|
|
13
|
+
serverName: string | null;
|
|
14
|
+
} | {
|
|
15
|
+
connected: false;
|
|
16
|
+
requiresOAuth: true;
|
|
17
|
+
supportsDynamicRegistration: boolean;
|
|
18
|
+
name: string;
|
|
19
|
+
namespace: string;
|
|
20
|
+
toolCount: null;
|
|
21
|
+
serverName: null;
|
|
22
|
+
}, import("@executor-js/storage-core").StorageFailure | import("../sdk/errors").McpConnectionError, never>;
|
|
23
|
+
addSource: (config: import("../promise").McpSourceConfig) => import("effect/Effect").Effect<{
|
|
24
|
+
toolCount: number;
|
|
25
|
+
namespace: string;
|
|
26
|
+
}, import("@executor-js/storage-core").StorageFailure | import("../sdk/errors").McpConnectionError | import("../sdk/errors").McpToolDiscoveryError, never>;
|
|
27
|
+
removeSource: (namespace: string, scope: string) => import("effect/Effect").Effect<void, import("@executor-js/storage-core").StorageFailure, never>;
|
|
28
|
+
refreshSource: (namespace: string, scope: string) => import("effect/Effect").Effect<{
|
|
29
|
+
toolCount: number;
|
|
30
|
+
}, import("@executor-js/storage-core").StorageFailure | import("../sdk/errors").McpConnectionError | import("../sdk/errors").McpToolDiscoveryError, never>;
|
|
31
|
+
getSource: (namespace: string, scope: string) => import("effect/Effect").Effect<import("../sdk").McpStoredSource | null, import("@executor-js/storage-core").StorageFailure, never>;
|
|
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 import("../sdk").McpSourceBindingRef[], import("@executor-js/storage-core").StorageFailure, never>;
|
|
34
|
+
setSourceBinding: (input: import("../sdk").McpSourceBindingInput) => import("effect/Effect").Effect<import("../sdk").McpSourceBindingRef, import("@executor-js/storage-core").StorageFailure, never>;
|
|
35
|
+
removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => import("effect/Effect").Effect<void, import("@executor-js/storage-core").StorageFailure, never>;
|
|
36
|
+
}, import("../sdk").McpBindingStore, McpPluginOptions, {
|
|
37
|
+
readonly mcp_source: {
|
|
38
|
+
readonly fields: {
|
|
39
|
+
readonly id: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
readonly required: true;
|
|
42
|
+
};
|
|
43
|
+
readonly scope_id: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
readonly required: true;
|
|
46
|
+
readonly index: true;
|
|
47
|
+
};
|
|
48
|
+
readonly name: {
|
|
49
|
+
readonly type: "string";
|
|
50
|
+
readonly required: true;
|
|
51
|
+
};
|
|
52
|
+
readonly config: {
|
|
53
|
+
readonly type: "json";
|
|
54
|
+
readonly required: true;
|
|
55
|
+
};
|
|
56
|
+
readonly auth_kind: {
|
|
57
|
+
readonly type: ["none", "header", "oauth2"];
|
|
58
|
+
readonly required: true;
|
|
59
|
+
readonly defaultValue: "none";
|
|
60
|
+
};
|
|
61
|
+
readonly auth_header_name: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly required: false;
|
|
64
|
+
};
|
|
65
|
+
readonly auth_header_slot: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly required: false;
|
|
68
|
+
};
|
|
69
|
+
readonly auth_header_prefix: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly required: false;
|
|
72
|
+
};
|
|
73
|
+
readonly auth_connection_slot: {
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
readonly required: false;
|
|
76
|
+
};
|
|
77
|
+
readonly auth_client_id_slot: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly required: false;
|
|
80
|
+
};
|
|
81
|
+
readonly auth_client_secret_slot: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly required: false;
|
|
84
|
+
};
|
|
85
|
+
readonly created_at: {
|
|
86
|
+
readonly type: "date";
|
|
87
|
+
readonly required: true;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly mcp_source_header: {
|
|
92
|
+
readonly fields: {
|
|
93
|
+
readonly id: {
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly required: true;
|
|
96
|
+
};
|
|
97
|
+
readonly scope_id: {
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
readonly required: true;
|
|
100
|
+
readonly index: true;
|
|
101
|
+
};
|
|
102
|
+
readonly source_id: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly required: true;
|
|
105
|
+
readonly index: true;
|
|
106
|
+
};
|
|
107
|
+
readonly name: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly required: true;
|
|
110
|
+
};
|
|
111
|
+
readonly kind: {
|
|
112
|
+
readonly type: ["text", "binding"];
|
|
113
|
+
readonly required: true;
|
|
114
|
+
};
|
|
115
|
+
readonly text_value: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly required: false;
|
|
118
|
+
};
|
|
119
|
+
readonly slot_key: {
|
|
120
|
+
readonly type: "string";
|
|
121
|
+
readonly required: false;
|
|
122
|
+
};
|
|
123
|
+
readonly prefix: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
readonly required: false;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
readonly mcp_source_query_param: {
|
|
130
|
+
readonly fields: {
|
|
131
|
+
readonly id: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly required: true;
|
|
134
|
+
};
|
|
135
|
+
readonly scope_id: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly required: true;
|
|
138
|
+
readonly index: true;
|
|
139
|
+
};
|
|
140
|
+
readonly source_id: {
|
|
141
|
+
readonly type: "string";
|
|
142
|
+
readonly required: true;
|
|
143
|
+
readonly index: true;
|
|
144
|
+
};
|
|
145
|
+
readonly name: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
readonly required: true;
|
|
148
|
+
};
|
|
149
|
+
readonly kind: {
|
|
150
|
+
readonly type: ["text", "binding"];
|
|
151
|
+
readonly required: true;
|
|
152
|
+
};
|
|
153
|
+
readonly text_value: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly required: false;
|
|
156
|
+
};
|
|
157
|
+
readonly slot_key: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly required: false;
|
|
160
|
+
};
|
|
161
|
+
readonly prefix: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly required: false;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
readonly mcp_binding: {
|
|
168
|
+
readonly fields: {
|
|
169
|
+
readonly id: {
|
|
170
|
+
readonly type: "string";
|
|
171
|
+
readonly required: true;
|
|
172
|
+
};
|
|
173
|
+
readonly scope_id: {
|
|
174
|
+
readonly type: "string";
|
|
175
|
+
readonly required: true;
|
|
176
|
+
readonly index: true;
|
|
177
|
+
};
|
|
178
|
+
readonly source_id: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
readonly required: true;
|
|
181
|
+
readonly index: true;
|
|
182
|
+
};
|
|
183
|
+
readonly binding: {
|
|
184
|
+
readonly type: "json";
|
|
185
|
+
readonly required: true;
|
|
186
|
+
};
|
|
187
|
+
readonly created_at: {
|
|
188
|
+
readonly type: "date";
|
|
189
|
+
readonly required: true;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}, typeof McpExtensionService, import("effect/Layer").Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<"executor", "mcp">, never, import("effect/unstable/http/HttpRouter").Request<"Requires", McpExtensionService>>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"mcp", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"probeEndpoint", "POST", "/scopes/:scopeId/mcp/probe", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
194
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
195
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
196
|
+
readonly endpoint: import("effect/Schema").String;
|
|
197
|
+
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<{
|
|
198
|
+
readonly secretId: import("effect/Schema").String;
|
|
199
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
200
|
+
}>]>>>;
|
|
201
|
+
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<{
|
|
202
|
+
readonly secretId: import("effect/Schema").String;
|
|
203
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
204
|
+
}>]>>>;
|
|
205
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
206
|
+
readonly connected: import("effect/Schema").Boolean;
|
|
207
|
+
readonly requiresOAuth: import("effect/Schema").Boolean;
|
|
208
|
+
readonly supportsDynamicRegistration: import("effect/Schema").Boolean;
|
|
209
|
+
readonly name: import("effect/Schema").String;
|
|
210
|
+
readonly namespace: import("effect/Schema").String;
|
|
211
|
+
readonly toolCount: import("effect/Schema").NullOr<import("effect/Schema").Number>;
|
|
212
|
+
readonly serverName: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
213
|
+
}>>, 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<"addSource", "POST", "/scopes/:scopeId/mcp/sources", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
214
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
215
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
216
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
217
|
+
readonly transport: import("effect/Schema").Literal<"remote">;
|
|
218
|
+
readonly name: import("effect/Schema").String;
|
|
219
|
+
readonly endpoint: import("effect/Schema").String;
|
|
220
|
+
readonly remoteTransport: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["streamable-http", "sse", "auto"]>>;
|
|
221
|
+
readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
222
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
223
|
+
readonly secretId: import("effect/Schema").String;
|
|
224
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
225
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
226
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
227
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
228
|
+
readonly secretId: import("effect/Schema").String;
|
|
229
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
230
|
+
}>]>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
231
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
232
|
+
readonly slot: import("effect/Schema").String;
|
|
233
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
234
|
+
}>]>]>>>;
|
|
235
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
236
|
+
readonly secretId: import("effect/Schema").String;
|
|
237
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
238
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
239
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
240
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
241
|
+
readonly secretId: import("effect/Schema").String;
|
|
242
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
243
|
+
}>]>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
244
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
245
|
+
readonly slot: import("effect/Schema").String;
|
|
246
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
247
|
+
}>]>]>>>;
|
|
248
|
+
readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
249
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
250
|
+
}>, import("effect/Schema").Struct<{
|
|
251
|
+
readonly kind: import("effect/Schema").Literal<"header">;
|
|
252
|
+
readonly headerName: import("effect/Schema").String;
|
|
253
|
+
readonly secretSlot: import("effect/Schema").String;
|
|
254
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
255
|
+
}>, import("effect/Schema").Struct<{
|
|
256
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
257
|
+
readonly connectionSlot: import("effect/Schema").String;
|
|
258
|
+
readonly clientIdSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
259
|
+
readonly clientSecretSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
260
|
+
}>]>, import("effect/Schema").Struct<{
|
|
261
|
+
readonly kind: import("effect/Schema").Literal<"header">;
|
|
262
|
+
readonly headerName: import("effect/Schema").String;
|
|
263
|
+
readonly secretId: import("effect/Schema").String;
|
|
264
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
265
|
+
readonly targetScope: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
266
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
267
|
+
}>, import("effect/Schema").Struct<{
|
|
268
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
269
|
+
readonly connectionId: import("effect/Schema").String;
|
|
270
|
+
readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
271
|
+
readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
272
|
+
}>]>>;
|
|
273
|
+
readonly credentialTargetScope: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
274
|
+
}>, import("effect/Schema").Struct<{
|
|
275
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
276
|
+
readonly transport: import("effect/Schema").Literal<"stdio">;
|
|
277
|
+
readonly name: import("effect/Schema").String;
|
|
278
|
+
readonly command: import("effect/Schema").String;
|
|
279
|
+
readonly args: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
280
|
+
readonly env: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
281
|
+
readonly cwd: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
282
|
+
readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
283
|
+
}>]>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
284
|
+
readonly toolCount: import("effect/Schema").Number;
|
|
285
|
+
readonly namespace: import("effect/Schema").String;
|
|
286
|
+
}>>, 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<"removeSource", "POST", "/scopes/:scopeId/mcp/sources/remove", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
287
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
288
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
289
|
+
readonly namespace: import("effect/Schema").String;
|
|
290
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
291
|
+
readonly removed: import("effect/Schema").Boolean;
|
|
292
|
+
}>>, 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<"refreshSource", "POST", "/scopes/:scopeId/mcp/sources/refresh", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
293
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
294
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
295
|
+
readonly namespace: import("effect/Schema").String;
|
|
296
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
297
|
+
readonly toolCount: import("effect/Schema").Number;
|
|
298
|
+
}>>, 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
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
300
|
+
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<typeof import("../sdk/stored-source").McpStoredSourceSchema>>, 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
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
303
|
+
namespace: import("effect/Schema").String;
|
|
304
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
305
|
+
readonly sourceScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
306
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
307
|
+
readonly endpoint: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
308
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
309
|
+
readonly secretId: import("effect/Schema").String;
|
|
310
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
311
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
312
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
313
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
314
|
+
readonly secretId: import("effect/Schema").String;
|
|
315
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
316
|
+
}>]>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
317
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
318
|
+
readonly slot: import("effect/Schema").String;
|
|
319
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
320
|
+
}>]>]>>>;
|
|
321
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
322
|
+
readonly secretId: import("effect/Schema").String;
|
|
323
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
324
|
+
readonly targetScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
325
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
326
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
327
|
+
readonly secretId: import("effect/Schema").String;
|
|
328
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
329
|
+
}>]>, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
330
|
+
readonly kind: import("effect/Schema").Literal<"binding">;
|
|
331
|
+
readonly slot: import("effect/Schema").String;
|
|
332
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
333
|
+
}>]>]>>>;
|
|
334
|
+
readonly credentialTargetScope: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
335
|
+
readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
336
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
337
|
+
}>, import("effect/Schema").Struct<{
|
|
338
|
+
readonly kind: import("effect/Schema").Literal<"header">;
|
|
339
|
+
readonly headerName: import("effect/Schema").String;
|
|
340
|
+
readonly secretSlot: import("effect/Schema").String;
|
|
341
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
342
|
+
}>, import("effect/Schema").Struct<{
|
|
343
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
344
|
+
readonly connectionSlot: import("effect/Schema").String;
|
|
345
|
+
readonly clientIdSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
346
|
+
readonly clientSecretSlot: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
347
|
+
}>]>, import("effect/Schema").Struct<{
|
|
348
|
+
readonly kind: import("effect/Schema").Literal<"header">;
|
|
349
|
+
readonly headerName: import("effect/Schema").String;
|
|
350
|
+
readonly secretId: import("effect/Schema").String;
|
|
351
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
352
|
+
readonly targetScope: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
353
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
354
|
+
}>, import("effect/Schema").Struct<{
|
|
355
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
356
|
+
readonly connectionId: import("effect/Schema").String;
|
|
357
|
+
readonly clientIdSecretId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
358
|
+
readonly clientSecretSecretId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
359
|
+
}>]>>;
|
|
360
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
361
|
+
readonly updated: import("effect/Schema").Boolean;
|
|
362
|
+
}>>, 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<"listSourceBindings", "GET", "/scopes/:scopeId/mcp/sources/:namespace/base/:sourceScopeId/bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
363
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
364
|
+
namespace: import("effect/Schema").String;
|
|
365
|
+
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<typeof import("../sdk").McpSourceBindingRef>>, 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
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
368
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
369
|
+
readonly sourceId: import("effect/Schema").String;
|
|
370
|
+
readonly sourceScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
371
|
+
readonly scope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
372
|
+
readonly slot: import("effect/Schema").String;
|
|
373
|
+
readonly value: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
374
|
+
readonly kind: import("effect/Schema").Literal<"text">;
|
|
375
|
+
readonly text: import("effect/Schema").String;
|
|
376
|
+
}>, import("effect/Schema").Struct<{
|
|
377
|
+
readonly kind: import("effect/Schema").Literal<"secret">;
|
|
378
|
+
readonly secretId: import("effect/Schema").brand<import("effect/Schema").String, "SecretId">;
|
|
379
|
+
readonly secretScopeId: import("effect/Schema").optional<import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">>;
|
|
380
|
+
}>, import("effect/Schema").Struct<{
|
|
381
|
+
readonly kind: import("effect/Schema").Literal<"connection">;
|
|
382
|
+
readonly connectionId: import("effect/Schema").brand<import("effect/Schema").String, "ConnectionId">;
|
|
383
|
+
}>]>;
|
|
384
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../sdk").McpSourceBindingRef>, 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
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
386
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
387
|
+
readonly sourceId: import("effect/Schema").String;
|
|
388
|
+
readonly sourceScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
389
|
+
readonly slot: import("effect/Schema").String;
|
|
390
|
+
readonly scope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
391
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
392
|
+
readonly removed: import("effect/Schema").Boolean;
|
|
393
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk/errors").McpConnectionError | typeof import("../sdk/errors").McpToolDiscoveryError>, never, never>, false>>;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import {
|
|
2
|
+
McpConnectionAuthInput,
|
|
3
|
+
McpConnectionError,
|
|
4
|
+
McpCredentialInput,
|
|
5
|
+
McpSourceBindingInputSchema,
|
|
6
|
+
McpSourceBindingRef,
|
|
7
|
+
McpStoredSourceData,
|
|
8
|
+
McpToolDiscoveryError
|
|
9
|
+
} from "./chunk-Z4CRPOLI.js";
|
|
10
|
+
|
|
11
|
+
// src/react/atoms.ts
|
|
12
|
+
import * as Atom from "effect/unstable/reactivity/Atom";
|
|
13
|
+
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
|
|
14
|
+
import { sourcesOptimisticAtom } from "@executor-js/react/api/atoms";
|
|
15
|
+
import { ReactivityKey } from "@executor-js/react/api/reactivity-keys";
|
|
16
|
+
|
|
17
|
+
// src/react/client.ts
|
|
18
|
+
import { createPluginAtomClient } from "@executor-js/sdk/client";
|
|
19
|
+
import { getBaseUrl } from "@executor-js/react/api/base-url";
|
|
20
|
+
|
|
21
|
+
// src/api/group.ts
|
|
22
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
23
|
+
import { Schema as Schema2 } from "effect";
|
|
24
|
+
import { InternalError, ScopeId as ScopeId2, SecretBackedMap } from "@executor-js/sdk/core";
|
|
25
|
+
|
|
26
|
+
// src/sdk/stored-source.ts
|
|
27
|
+
import { Schema } from "effect";
|
|
28
|
+
import { ScopeId } from "@executor-js/sdk/core";
|
|
29
|
+
var McpStoredSourceSchema = class extends Schema.Class("McpStoredSource")({
|
|
30
|
+
namespace: Schema.String,
|
|
31
|
+
scope: ScopeId,
|
|
32
|
+
name: Schema.String,
|
|
33
|
+
config: McpStoredSourceData
|
|
34
|
+
}) {
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/api/group.ts
|
|
38
|
+
var ScopeParams = { scopeId: ScopeId2 };
|
|
39
|
+
var SourceParams = { scopeId: ScopeId2, namespace: Schema2.String };
|
|
40
|
+
var SourceBindingParams = {
|
|
41
|
+
scopeId: ScopeId2,
|
|
42
|
+
namespace: Schema2.String,
|
|
43
|
+
sourceScopeId: ScopeId2
|
|
44
|
+
};
|
|
45
|
+
var AuthPayload = McpConnectionAuthInput;
|
|
46
|
+
var StringMap = Schema2.Record(Schema2.String, Schema2.String);
|
|
47
|
+
var AddRemoteSourcePayload = Schema2.Struct({
|
|
48
|
+
targetScope: ScopeId2,
|
|
49
|
+
transport: Schema2.Literal("remote"),
|
|
50
|
+
name: Schema2.String,
|
|
51
|
+
endpoint: Schema2.String,
|
|
52
|
+
remoteTransport: Schema2.optional(Schema2.Literals(["streamable-http", "sse", "auto"])),
|
|
53
|
+
namespace: Schema2.optional(Schema2.String),
|
|
54
|
+
queryParams: Schema2.optional(Schema2.Record(Schema2.String, McpCredentialInput)),
|
|
55
|
+
headers: Schema2.optional(Schema2.Record(Schema2.String, McpCredentialInput)),
|
|
56
|
+
auth: Schema2.optional(AuthPayload),
|
|
57
|
+
credentialTargetScope: Schema2.optional(ScopeId2)
|
|
58
|
+
});
|
|
59
|
+
var AddStdioSourcePayload = Schema2.Struct({
|
|
60
|
+
targetScope: ScopeId2,
|
|
61
|
+
transport: Schema2.Literal("stdio"),
|
|
62
|
+
name: Schema2.String,
|
|
63
|
+
command: Schema2.String,
|
|
64
|
+
args: Schema2.optional(Schema2.Array(Schema2.String)),
|
|
65
|
+
env: Schema2.optional(StringMap),
|
|
66
|
+
cwd: Schema2.optional(Schema2.String),
|
|
67
|
+
namespace: Schema2.optional(Schema2.String)
|
|
68
|
+
});
|
|
69
|
+
var AddSourcePayload = Schema2.Union([AddRemoteSourcePayload, AddStdioSourcePayload]);
|
|
70
|
+
var UpdateSourcePayload = Schema2.Struct({
|
|
71
|
+
sourceScope: ScopeId2,
|
|
72
|
+
name: Schema2.optional(Schema2.String),
|
|
73
|
+
endpoint: Schema2.optional(Schema2.String),
|
|
74
|
+
headers: Schema2.optional(Schema2.Record(Schema2.String, McpCredentialInput)),
|
|
75
|
+
queryParams: Schema2.optional(Schema2.Record(Schema2.String, McpCredentialInput)),
|
|
76
|
+
credentialTargetScope: Schema2.optional(ScopeId2),
|
|
77
|
+
auth: Schema2.optional(AuthPayload)
|
|
78
|
+
});
|
|
79
|
+
var UpdateSourceResponse = Schema2.Struct({
|
|
80
|
+
updated: Schema2.Boolean
|
|
81
|
+
});
|
|
82
|
+
var ProbeEndpointPayload = Schema2.Struct({
|
|
83
|
+
endpoint: Schema2.String,
|
|
84
|
+
headers: Schema2.optional(SecretBackedMap),
|
|
85
|
+
queryParams: Schema2.optional(SecretBackedMap)
|
|
86
|
+
});
|
|
87
|
+
var ProbeEndpointResponse = Schema2.Struct({
|
|
88
|
+
connected: Schema2.Boolean,
|
|
89
|
+
requiresOAuth: Schema2.Boolean,
|
|
90
|
+
supportsDynamicRegistration: Schema2.Boolean,
|
|
91
|
+
name: Schema2.String,
|
|
92
|
+
namespace: Schema2.String,
|
|
93
|
+
toolCount: Schema2.NullOr(Schema2.Number),
|
|
94
|
+
serverName: Schema2.NullOr(Schema2.String)
|
|
95
|
+
});
|
|
96
|
+
var NamespacePayload = Schema2.Struct({
|
|
97
|
+
namespace: Schema2.String
|
|
98
|
+
});
|
|
99
|
+
var RemoveBindingPayload = Schema2.Struct({
|
|
100
|
+
sourceId: Schema2.String,
|
|
101
|
+
sourceScope: ScopeId2,
|
|
102
|
+
slot: Schema2.String,
|
|
103
|
+
scope: ScopeId2
|
|
104
|
+
});
|
|
105
|
+
var AddSourceResponse = Schema2.Struct({
|
|
106
|
+
toolCount: Schema2.Number,
|
|
107
|
+
namespace: Schema2.String
|
|
108
|
+
});
|
|
109
|
+
var RefreshSourceResponse = Schema2.Struct({
|
|
110
|
+
toolCount: Schema2.Number
|
|
111
|
+
});
|
|
112
|
+
var RemoveSourceResponse = Schema2.Struct({
|
|
113
|
+
removed: Schema2.Boolean
|
|
114
|
+
});
|
|
115
|
+
var McpGroup = HttpApiGroup.make("mcp").add(
|
|
116
|
+
HttpApiEndpoint.post("probeEndpoint", "/scopes/:scopeId/mcp/probe", {
|
|
117
|
+
params: ScopeParams,
|
|
118
|
+
payload: ProbeEndpointPayload,
|
|
119
|
+
success: ProbeEndpointResponse,
|
|
120
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
121
|
+
})
|
|
122
|
+
).add(
|
|
123
|
+
HttpApiEndpoint.post("addSource", "/scopes/:scopeId/mcp/sources", {
|
|
124
|
+
params: ScopeParams,
|
|
125
|
+
payload: AddSourcePayload,
|
|
126
|
+
success: AddSourceResponse,
|
|
127
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
128
|
+
})
|
|
129
|
+
).add(
|
|
130
|
+
HttpApiEndpoint.post("removeSource", "/scopes/:scopeId/mcp/sources/remove", {
|
|
131
|
+
params: ScopeParams,
|
|
132
|
+
payload: NamespacePayload,
|
|
133
|
+
success: RemoveSourceResponse,
|
|
134
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
135
|
+
})
|
|
136
|
+
).add(
|
|
137
|
+
HttpApiEndpoint.post("refreshSource", "/scopes/:scopeId/mcp/sources/refresh", {
|
|
138
|
+
params: ScopeParams,
|
|
139
|
+
payload: NamespacePayload,
|
|
140
|
+
success: RefreshSourceResponse,
|
|
141
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
142
|
+
})
|
|
143
|
+
).add(
|
|
144
|
+
HttpApiEndpoint.get("getSource", "/scopes/:scopeId/mcp/sources/:namespace", {
|
|
145
|
+
params: SourceParams,
|
|
146
|
+
success: Schema2.NullOr(McpStoredSourceSchema),
|
|
147
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
148
|
+
})
|
|
149
|
+
).add(
|
|
150
|
+
HttpApiEndpoint.patch("updateSource", "/scopes/:scopeId/mcp/sources/:namespace", {
|
|
151
|
+
params: SourceParams,
|
|
152
|
+
payload: UpdateSourcePayload,
|
|
153
|
+
success: UpdateSourceResponse,
|
|
154
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
155
|
+
})
|
|
156
|
+
).add(
|
|
157
|
+
HttpApiEndpoint.get(
|
|
158
|
+
"listSourceBindings",
|
|
159
|
+
"/scopes/:scopeId/mcp/sources/:namespace/base/:sourceScopeId/bindings",
|
|
160
|
+
{
|
|
161
|
+
params: SourceBindingParams,
|
|
162
|
+
success: Schema2.Array(McpSourceBindingRef),
|
|
163
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
).add(
|
|
167
|
+
HttpApiEndpoint.post("setSourceBinding", "/scopes/:scopeId/mcp/source-bindings", {
|
|
168
|
+
params: ScopeParams,
|
|
169
|
+
payload: McpSourceBindingInputSchema,
|
|
170
|
+
success: McpSourceBindingRef,
|
|
171
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
172
|
+
})
|
|
173
|
+
).add(
|
|
174
|
+
HttpApiEndpoint.post("removeSourceBinding", "/scopes/:scopeId/mcp/source-bindings/remove", {
|
|
175
|
+
params: ScopeParams,
|
|
176
|
+
payload: RemoveBindingPayload,
|
|
177
|
+
success: Schema2.Struct({ removed: Schema2.Boolean }),
|
|
178
|
+
error: [InternalError, McpConnectionError, McpToolDiscoveryError]
|
|
179
|
+
})
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
// src/react/client.ts
|
|
183
|
+
var McpClient = createPluginAtomClient(McpGroup, {
|
|
184
|
+
baseUrl: getBaseUrl
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// src/react/atoms.ts
|
|
188
|
+
var mcpSourceAtom = (scopeId, namespace) => McpClient.query("mcp", "getSource", {
|
|
189
|
+
params: { scopeId, namespace },
|
|
190
|
+
timeToLive: "15 seconds",
|
|
191
|
+
reactivityKeys: [ReactivityKey.sources, ReactivityKey.tools]
|
|
192
|
+
});
|
|
193
|
+
var mcpSourceBindingsAtom = (scopeId, namespace, sourceScopeId) => McpClient.query("mcp", "listSourceBindings", {
|
|
194
|
+
params: { scopeId, namespace, sourceScopeId },
|
|
195
|
+
timeToLive: "15 seconds",
|
|
196
|
+
reactivityKeys: [ReactivityKey.sources, ReactivityKey.secrets, ReactivityKey.connections]
|
|
197
|
+
});
|
|
198
|
+
var probeMcpEndpoint = McpClient.mutation("mcp", "probeEndpoint");
|
|
199
|
+
var addMcpSource = McpClient.mutation("mcp", "addSource");
|
|
200
|
+
var addMcpSourceOptimistic = Atom.family(
|
|
201
|
+
(scopeId) => sourcesOptimisticAtom(scopeId).pipe(
|
|
202
|
+
Atom.optimisticFn({
|
|
203
|
+
reducer: (current, arg) => AsyncResult.map(current, (rows) => {
|
|
204
|
+
const id = arg.payload.namespace ?? `pending-${Math.random().toString(36).slice(2)}`;
|
|
205
|
+
const source = {
|
|
206
|
+
id,
|
|
207
|
+
scopeId: arg.payload.targetScope,
|
|
208
|
+
kind: "mcp",
|
|
209
|
+
pluginId: "mcp",
|
|
210
|
+
name: arg.payload.name ?? id,
|
|
211
|
+
...arg.payload.transport === "remote" ? { url: arg.payload.endpoint } : {},
|
|
212
|
+
canRemove: false,
|
|
213
|
+
canRefresh: false,
|
|
214
|
+
canEdit: false,
|
|
215
|
+
runtime: false
|
|
216
|
+
};
|
|
217
|
+
return [source, ...rows.filter((row) => row.id !== id)].sort(
|
|
218
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
219
|
+
);
|
|
220
|
+
}),
|
|
221
|
+
fn: addMcpSource
|
|
222
|
+
})
|
|
223
|
+
)
|
|
224
|
+
);
|
|
225
|
+
var removeMcpSource = McpClient.mutation("mcp", "removeSource");
|
|
226
|
+
var refreshMcpSource = McpClient.mutation("mcp", "refreshSource");
|
|
227
|
+
var updateMcpSource = McpClient.mutation("mcp", "updateSource");
|
|
228
|
+
var setMcpSourceBinding = McpClient.mutation("mcp", "setSourceBinding");
|
|
229
|
+
var removeMcpSourceBinding = McpClient.mutation("mcp", "removeSourceBinding");
|
|
230
|
+
|
|
231
|
+
export {
|
|
232
|
+
mcpSourceAtom,
|
|
233
|
+
mcpSourceBindingsAtom,
|
|
234
|
+
probeMcpEndpoint,
|
|
235
|
+
addMcpSourceOptimistic,
|
|
236
|
+
updateMcpSource,
|
|
237
|
+
setMcpSourceBinding
|
|
238
|
+
};
|
|
239
|
+
//# sourceMappingURL=chunk-2ETJ6LQH.js.map
|