@executor-js/plugin-mcp 0.1.0 → 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.
Files changed (45) hide show
  1. package/dist/AddMcpSource-VM3HY26S.js +762 -0
  2. package/dist/AddMcpSource-VM3HY26S.js.map +1 -0
  3. package/dist/EditMcpSource-WELWGRJG.js +259 -0
  4. package/dist/EditMcpSource-WELWGRJG.js.map +1 -0
  5. package/dist/McpSourceSummary-7TDQXLT5.js +85 -0
  6. package/dist/McpSourceSummary-7TDQXLT5.js.map +1 -0
  7. package/dist/api/group.d.ts +109 -17
  8. package/dist/api/index.d.ts +391 -0
  9. package/dist/chunk-2ETJ6LQH.js +239 -0
  10. package/dist/chunk-2ETJ6LQH.js.map +1 -0
  11. package/dist/chunk-OOOH3IO4.js +2194 -0
  12. package/dist/chunk-OOOH3IO4.js.map +1 -0
  13. package/dist/chunk-SKSXXFOA.js +104 -0
  14. package/dist/chunk-SKSXXFOA.js.map +1 -0
  15. package/dist/chunk-Z4CRPOLI.js +186 -0
  16. package/dist/chunk-Z4CRPOLI.js.map +1 -0
  17. package/dist/chunk-ZIRGIRGP.js +115 -0
  18. package/dist/chunk-ZIRGIRGP.js.map +1 -0
  19. package/dist/client.js +51 -0
  20. package/dist/client.js.map +1 -0
  21. package/dist/core.js +26 -2
  22. package/dist/index.js +2 -1
  23. package/dist/react/McpRemoteSourceFields.d.ts +18 -0
  24. package/dist/react/McpSourceSummary.d.ts +5 -0
  25. package/dist/react/atoms.d.ts +206 -6
  26. package/dist/react/client.d.ts +113 -16
  27. package/dist/react/index.d.ts +1 -1
  28. package/dist/react/plugin-client.d.ts +9 -2
  29. package/dist/sdk/binding-store.d.ts +106 -1
  30. package/dist/sdk/index.d.ts +1 -1
  31. package/dist/sdk/invoke.d.ts +2 -0
  32. package/dist/sdk/plugin.d.ts +142 -114
  33. package/dist/sdk/probe-shape-real-servers.live.test.d.ts +1 -0
  34. package/dist/sdk/probe-shape.d.ts +17 -3
  35. package/dist/sdk/stored-source.d.ts +9 -6
  36. package/dist/sdk/types.d.ts +138 -13
  37. package/dist/{stdio-connector-KNHLETKM.js → stdio-connector-AA5S6UUJ.js} +1 -1
  38. package/dist/{stdio-connector-KNHLETKM.js.map → stdio-connector-AA5S6UUJ.js.map} +1 -1
  39. package/dist/testing/index.d.ts +1 -0
  40. package/dist/{sdk/test-utils.d.ts → testing/server.d.ts} +0 -6
  41. package/dist/testing.js +51 -0
  42. package/dist/testing.js.map +1 -0
  43. package/package.json +17 -4
  44. package/dist/chunk-C2GNZGFJ.js +0 -1622
  45. package/dist/chunk-C2GNZGFJ.js.map +0 -1
@@ -0,0 +1,186 @@
1
+ // src/sdk/types.ts
2
+ import { Effect, Schema } from "effect";
3
+ import {
4
+ ConfiguredCredentialValueSchema,
5
+ CredentialBindingValue,
6
+ credentialSlotKey,
7
+ ScopedSecretCredentialInput,
8
+ ScopeId,
9
+ SecretBackedMap,
10
+ SecretBackedValue
11
+ } from "@executor-js/sdk/core";
12
+ var McpRemoteTransport = Schema.Literals(["streamable-http", "sse", "auto"]);
13
+ var McpTransport = Schema.Literals(["streamable-http", "sse", "stdio", "auto"]);
14
+ var ConfiguredMcpCredentialValue = ConfiguredCredentialValueSchema;
15
+ var McpCredentialInput = Schema.Union([
16
+ ScopedSecretCredentialInput,
17
+ SecretBackedValue,
18
+ ConfiguredMcpCredentialValue
19
+ ]);
20
+ var mcpHeaderSlot = (name) => credentialSlotKey("header", name);
21
+ var mcpQueryParamSlot = (name) => credentialSlotKey("query_param", name);
22
+ var MCP_HEADER_AUTH_SLOT = "auth:header";
23
+ var MCP_OAUTH_CONNECTION_SLOT = "auth:oauth2:connection";
24
+ var MCP_OAUTH_CLIENT_ID_SLOT = "auth:oauth2:client-id";
25
+ var MCP_OAUTH_CLIENT_SECRET_SLOT = "auth:oauth2:client-secret";
26
+ var JsonObject = Schema.Record(Schema.String, Schema.Unknown);
27
+ var McpConnectionAuth = Schema.Union([
28
+ Schema.Struct({ kind: Schema.Literal("none") }),
29
+ Schema.Struct({
30
+ kind: Schema.Literal("header"),
31
+ headerName: Schema.String,
32
+ secretSlot: Schema.String,
33
+ prefix: Schema.optional(Schema.String)
34
+ }),
35
+ Schema.Struct({
36
+ kind: Schema.Literal("oauth2"),
37
+ connectionSlot: Schema.String,
38
+ clientIdSlot: Schema.optional(Schema.String),
39
+ clientSecretSlot: Schema.optional(Schema.String)
40
+ })
41
+ ]);
42
+ var McpConnectionAuthInput = Schema.Union([
43
+ McpConnectionAuth,
44
+ Schema.Struct({
45
+ kind: Schema.Literal("header"),
46
+ headerName: Schema.String,
47
+ secretId: Schema.String,
48
+ prefix: Schema.optional(Schema.String),
49
+ targetScope: Schema.optional(ScopeId),
50
+ secretScopeId: Schema.optional(ScopeId)
51
+ }),
52
+ Schema.Struct({
53
+ kind: Schema.Literal("oauth2"),
54
+ connectionId: Schema.String,
55
+ clientIdSecretId: Schema.optional(Schema.String),
56
+ clientSecretSecretId: Schema.optional(Schema.NullOr(Schema.String))
57
+ })
58
+ ]);
59
+ var McpSourceBindingValue = CredentialBindingValue;
60
+ var McpSourceBindingInputSchema = Schema.Struct({
61
+ sourceId: Schema.String,
62
+ sourceScope: ScopeId,
63
+ scope: ScopeId,
64
+ slot: Schema.String,
65
+ value: McpSourceBindingValue
66
+ });
67
+ var McpSourceBindingInput = class extends Schema.Class(
68
+ "McpSourceBindingInput"
69
+ )(McpSourceBindingInputSchema.fields) {
70
+ };
71
+ var McpSourceBindingRef = class extends Schema.Class("McpSourceBindingRef")({
72
+ sourceId: Schema.String,
73
+ sourceScopeId: ScopeId,
74
+ scopeId: ScopeId,
75
+ slot: Schema.String,
76
+ value: McpSourceBindingValue,
77
+ createdAt: Schema.Date,
78
+ updatedAt: Schema.Date
79
+ }) {
80
+ };
81
+ var StringMap = Schema.Record(Schema.String, Schema.String);
82
+ var McpRemoteSourceData = Schema.Struct({
83
+ transport: Schema.Literal("remote"),
84
+ /** The MCP server endpoint URL */
85
+ endpoint: Schema.String,
86
+ /** Transport preference for this remote source */
87
+ remoteTransport: McpRemoteTransport.pipe(
88
+ Schema.optionalKey,
89
+ Schema.withConstructorDefault(Effect.succeed("auto"))
90
+ ),
91
+ /** Extra query params appended to the endpoint URL */
92
+ queryParams: Schema.optional(Schema.Record(Schema.String, ConfiguredMcpCredentialValue)),
93
+ /** Extra headers sent on every request */
94
+ headers: Schema.optional(Schema.Record(Schema.String, ConfiguredMcpCredentialValue)),
95
+ /** Auth configuration */
96
+ auth: McpConnectionAuth
97
+ });
98
+ var McpStdioSourceData = Schema.Struct({
99
+ transport: Schema.Literal("stdio"),
100
+ /** The command to run */
101
+ command: Schema.String,
102
+ /** Arguments to the command */
103
+ args: Schema.optional(Schema.Array(Schema.String)),
104
+ /** Environment variables */
105
+ env: Schema.optional(StringMap),
106
+ /** Working directory */
107
+ cwd: Schema.optional(Schema.String)
108
+ });
109
+ var McpStoredSourceData = Schema.Union([McpRemoteSourceData, McpStdioSourceData]);
110
+ var McpToolAnnotations = Schema.Struct({
111
+ title: Schema.optional(Schema.String),
112
+ readOnlyHint: Schema.optional(Schema.Boolean),
113
+ destructiveHint: Schema.optional(Schema.Boolean),
114
+ idempotentHint: Schema.optional(Schema.Boolean),
115
+ openWorldHint: Schema.optional(Schema.Boolean)
116
+ });
117
+ var McpToolBinding = class extends Schema.Class("McpToolBinding")({
118
+ toolId: Schema.String,
119
+ toolName: Schema.String,
120
+ description: Schema.NullOr(Schema.String),
121
+ inputSchema: Schema.optional(Schema.Unknown),
122
+ outputSchema: Schema.optional(Schema.Unknown),
123
+ annotations: Schema.optional(McpToolAnnotations)
124
+ }) {
125
+ };
126
+
127
+ // src/sdk/errors.ts
128
+ import { Schema as Schema2 } from "effect";
129
+ var McpConnectionError = class extends Schema2.TaggedErrorClass()(
130
+ "McpConnectionError",
131
+ {
132
+ transport: Schema2.String,
133
+ message: Schema2.String
134
+ },
135
+ { httpApiStatus: 400 }
136
+ ) {
137
+ };
138
+ var McpToolDiscoveryError = class extends Schema2.TaggedErrorClass()(
139
+ "McpToolDiscoveryError",
140
+ {
141
+ stage: Schema2.Literals(["connect", "list_tools"]),
142
+ message: Schema2.String
143
+ },
144
+ { httpApiStatus: 400 }
145
+ ) {
146
+ };
147
+ var McpInvocationError = class extends Schema2.TaggedErrorClass()(
148
+ "McpInvocationError",
149
+ {
150
+ toolName: Schema2.String,
151
+ message: Schema2.String
152
+ },
153
+ { httpApiStatus: 400 }
154
+ ) {
155
+ };
156
+ var McpOAuthError = class extends Schema2.TaggedErrorClass()(
157
+ "McpOAuthError",
158
+ {
159
+ message: Schema2.String
160
+ },
161
+ { httpApiStatus: 400 }
162
+ ) {
163
+ };
164
+
165
+ export {
166
+ ConfiguredMcpCredentialValue,
167
+ McpCredentialInput,
168
+ mcpHeaderSlot,
169
+ mcpQueryParamSlot,
170
+ MCP_HEADER_AUTH_SLOT,
171
+ MCP_OAUTH_CONNECTION_SLOT,
172
+ MCP_OAUTH_CLIENT_ID_SLOT,
173
+ MCP_OAUTH_CLIENT_SECRET_SLOT,
174
+ McpConnectionAuth,
175
+ McpConnectionAuthInput,
176
+ McpSourceBindingInputSchema,
177
+ McpSourceBindingInput,
178
+ McpSourceBindingRef,
179
+ McpStoredSourceData,
180
+ McpToolAnnotations,
181
+ McpToolBinding,
182
+ McpConnectionError,
183
+ McpToolDiscoveryError,
184
+ McpInvocationError
185
+ };
186
+ //# sourceMappingURL=chunk-Z4CRPOLI.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 ConfiguredCredentialValueSchema,\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 = ConfiguredCredentialValueSchema;\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 McpSourceBindingInputSchema = Schema.Struct({\n sourceId: Schema.String,\n sourceScope: ScopeId,\n scope: ScopeId,\n slot: Schema.String,\n value: McpSourceBindingValue,\n});\n\nexport class McpSourceBindingInput extends Schema.Class<McpSourceBindingInput>(\n \"McpSourceBindingInput\",\n)(McpSourceBindingInputSchema.fields) {}\n\nexport class McpSourceBindingRef extends Schema.Class<McpSourceBindingRef>(\"McpSourceBindingRef\")({\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}) {}\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 class McpToolBinding extends Schema.Class<McpToolBinding>(\"McpToolBinding\")({\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}) {}\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,UAAU,IAAI;AAChF,IAAM,oBAAoB,CAAC,SAAyB,kBAAkB,eAAe,IAAI;AACzF,IAAM,uBAAuB;AAC7B,IAAM,4BAA4B;AAClC,IAAM,2BAA2B;AACjC,IAAM,+BAA+B;AAU5C,IAAM,aAAa,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAGvD,IAAM,oBAAoB,OAAO,MAAM;AAAA,EAC5C,OAAO,OAAO,EAAE,MAAM,OAAO,QAAQ,MAAM,EAAE,CAAC;AAAA,EAC9C,OAAO,OAAO;AAAA,IACZ,MAAM,OAAO,QAAQ,QAAQ;AAAA,IAC7B,YAAY,OAAO;AAAA,IACnB,YAAY,OAAO;AAA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,EACxC,aAAa,OAAO,SAAS,OAAO,OAAO;AAAA,EAC3C,cAAc,OAAO,SAAS,OAAO,OAAO;AAAA,EAC5C,aAAa,OAAO,SAAS,kBAAkB;AACjD,CAAC,EAAE;AAAC;;;ACzKJ,SAAS,UAAAA,eAAc;AAEhB,IAAM,qBAAN,cAAiCA,QAAO,iBAAqC;AAAA,EAClF;AAAA,EACA;AAAA,IACE,WAAWA,QAAO;AAAA,IAClB,SAASA,QAAO;AAAA,EAClB;AAAA,EACA,EAAE,eAAe,IAAI;AACvB,EAAE;AAAC;AAEI,IAAM,wBAAN,cAAoCA,QAAO,iBAAwC;AAAA,EACxF;AAAA,EACA;AAAA,IACE,OAAOA,QAAO,SAAS,CAAC,WAAW,YAAY,CAAC;AAAA,IAChD,SAASA,QAAO;AAAA,EAClB;AAAA,EACA,EAAE,eAAe,IAAI;AACvB,EAAE;AAAC;AAEI,IAAM,qBAAN,cAAiCA,QAAO,iBAAqC;AAAA,EAClF;AAAA,EACA;AAAA,IACE,UAAUA,QAAO;AAAA,IACjB,SAASA,QAAO;AAAA,EAClB;AAAA,EACA,EAAE,eAAe,IAAI;AACvB,EAAE;AAAC;AAEI,IAAM,gBAAN,cAA4BA,QAAO,iBAAgC;AAAA,EACxE;AAAA,EACA;AAAA,IACE,SAASA,QAAO;AAAA,EAClB;AAAA,EACA,EAAE,eAAe,IAAI;AACvB,EAAE;AAAC;","names":["Schema"]}
@@ -0,0 +1,115 @@
1
+ // src/react/McpRemoteSourceFields.tsx
2
+ import { Badge } from "@executor-js/react/components/badge";
3
+ import {
4
+ CardStack,
5
+ CardStackContent,
6
+ CardStackEntry,
7
+ CardStackEntryActions,
8
+ CardStackEntryContent,
9
+ CardStackEntryDescription,
10
+ CardStackEntryField,
11
+ CardStackEntryMedia,
12
+ CardStackEntryTitle
13
+ } from "@executor-js/react/components/card-stack";
14
+ import { FieldError } from "@executor-js/react/components/field";
15
+ import { Input } from "@executor-js/react/components/input";
16
+ import { Skeleton } from "@executor-js/react/components/skeleton";
17
+ import { SourceFavicon } from "@executor-js/react/components/source-favicon";
18
+ import { IOSSpinner } from "@executor-js/react/components/spinner";
19
+ import { Button } from "@executor-js/react/components/button";
20
+ import {
21
+ SourceIdentityFieldRows
22
+ } from "@executor-js/react/plugins/source-identity";
23
+ import { jsx, jsxs } from "react/jsx-runtime";
24
+ function McpRemoteSourceFields(props) {
25
+ const previewDescription = props.preview ? props.preview.connected ? props.preview.toolCount === null ? null : `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? "s" : ""} available` : "OAuth required to discover tools" : null;
26
+ if (props.preview) {
27
+ return /* @__PURE__ */ jsx(CardStack, { children: /* @__PURE__ */ jsxs(CardStackContent, { className: "border-t-0", children: [
28
+ /* @__PURE__ */ jsxs(CardStackEntry, { children: [
29
+ /* @__PURE__ */ jsx(CardStackEntryMedia, { children: /* @__PURE__ */ jsx(SourceFavicon, { url: props.url, size: 32 }) }),
30
+ /* @__PURE__ */ jsxs(CardStackEntryContent, { children: [
31
+ /* @__PURE__ */ jsx(CardStackEntryTitle, { children: props.preview.serverName ?? props.preview.name }),
32
+ previewDescription ? /* @__PURE__ */ jsx(CardStackEntryDescription, { children: previewDescription }) : null
33
+ ] }),
34
+ /* @__PURE__ */ jsx(CardStackEntryActions, { children: props.preview.connected ? /* @__PURE__ */ jsx(
35
+ Badge,
36
+ {
37
+ variant: "outline",
38
+ className: "border-emerald-500/20 bg-emerald-500/10 text-[10px] text-emerald-600 dark:text-emerald-400",
39
+ children: "Connected"
40
+ }
41
+ ) : /* @__PURE__ */ jsx(
42
+ Badge,
43
+ {
44
+ variant: "outline",
45
+ className: "border-amber-500/20 bg-amber-500/10 text-[10px] text-amber-600 dark:text-amber-400",
46
+ children: "OAuth required"
47
+ }
48
+ ) })
49
+ ] }),
50
+ /* @__PURE__ */ jsx(
51
+ SourceIdentityFieldRows,
52
+ {
53
+ identity: props.identity,
54
+ namePlaceholder: "e.g. Linear",
55
+ namespaceReadOnly: props.namespaceReadOnly
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsx(CardStackEntryField, { label: "Server URL", children: /* @__PURE__ */ jsx(
59
+ Input,
60
+ {
61
+ value: props.url,
62
+ onChange: (e) => props.onUrlChange(e.target.value),
63
+ placeholder: "https://mcp.example.com",
64
+ className: "w-full font-mono text-sm",
65
+ disabled: props.urlDisabled
66
+ }
67
+ ) })
68
+ ] }) });
69
+ }
70
+ if (props.probing) {
71
+ return /* @__PURE__ */ jsx(CardStack, { children: /* @__PURE__ */ jsx(CardStackContent, { className: "border-t-0", children: /* @__PURE__ */ jsxs(CardStackEntry, { children: [
72
+ /* @__PURE__ */ jsx(CardStackEntryMedia, { children: /* @__PURE__ */ jsx(Skeleton, { className: "size-4 rounded" }) }),
73
+ /* @__PURE__ */ jsxs(CardStackEntryContent, { children: [
74
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-40" }),
75
+ /* @__PURE__ */ jsx(Skeleton, { className: "mt-1 h-3 w-32" })
76
+ ] }),
77
+ /* @__PURE__ */ jsx(CardStackEntryActions, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20 rounded-full" }) })
78
+ ] }) }) });
79
+ }
80
+ return /* @__PURE__ */ jsx(CardStack, { children: /* @__PURE__ */ jsx(CardStackContent, { className: "border-t-0", children: /* @__PURE__ */ jsxs(CardStackEntryField, { label: "Server URL", children: [
81
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
82
+ /* @__PURE__ */ jsx(
83
+ Input,
84
+ {
85
+ value: props.url,
86
+ onChange: (e) => props.onUrlChange(e.target.value),
87
+ placeholder: "https://mcp.example.com",
88
+ className: "w-full pr-9 font-mono text-sm",
89
+ "aria-invalid": props.error ? true : void 0,
90
+ disabled: props.urlDisabled
91
+ }
92
+ ),
93
+ props.probing && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute right-2 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(IOSSpinner, { className: "size-4" }) })
94
+ ] }),
95
+ props.error && /* @__PURE__ */ jsxs("div", { className: "mt-2 space-y-2", children: [
96
+ /* @__PURE__ */ jsx(FieldError, { children: props.error }),
97
+ props.onRetry && /* @__PURE__ */ jsx(
98
+ Button,
99
+ {
100
+ type: "button",
101
+ variant: "outline",
102
+ size: "sm",
103
+ onClick: props.onRetry,
104
+ className: "h-7 px-2 text-xs",
105
+ children: "Try again"
106
+ }
107
+ )
108
+ ] })
109
+ ] }) }) });
110
+ }
111
+
112
+ export {
113
+ McpRemoteSourceFields
114
+ };
115
+ //# sourceMappingURL=chunk-ZIRGIRGP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/McpRemoteSourceFields.tsx"],"sourcesContent":["import { Badge } from \"@executor-js/react/components/badge\";\nimport {\n CardStack,\n CardStackContent,\n CardStackEntry,\n CardStackEntryActions,\n CardStackEntryContent,\n CardStackEntryDescription,\n CardStackEntryField,\n CardStackEntryMedia,\n CardStackEntryTitle,\n} from \"@executor-js/react/components/card-stack\";\nimport { FieldError } from \"@executor-js/react/components/field\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport { Skeleton } from \"@executor-js/react/components/skeleton\";\nimport { SourceFavicon } from \"@executor-js/react/components/source-favicon\";\nimport { IOSSpinner } from \"@executor-js/react/components/spinner\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport {\n SourceIdentityFieldRows,\n type SourceIdentity,\n} from \"@executor-js/react/plugins/source-identity\";\n\nexport type McpRemoteSourcePreview = {\n readonly name: string;\n readonly serverName: string | null;\n readonly connected: boolean;\n readonly toolCount: number | null;\n};\n\nexport function McpRemoteSourceFields(props: {\n readonly url: string;\n readonly onUrlChange: (url: string) => void;\n readonly identity: SourceIdentity;\n readonly preview: McpRemoteSourcePreview | null;\n readonly probing?: boolean;\n readonly error?: string | null;\n readonly onRetry?: () => void;\n readonly namespaceReadOnly?: boolean;\n readonly urlDisabled?: boolean;\n}) {\n const previewDescription = props.preview\n ? props.preview.connected\n ? props.preview.toolCount === null\n ? null\n : `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? \"s\" : \"\"} available`\n : \"OAuth required to discover tools\"\n : null;\n\n if (props.preview) {\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n <CardStackEntryMedia>\n <SourceFavicon url={props.url} size={32} />\n </CardStackEntryMedia>\n <CardStackEntryContent>\n <CardStackEntryTitle>\n {props.preview.serverName ?? props.preview.name}\n </CardStackEntryTitle>\n {previewDescription ? (\n <CardStackEntryDescription>{previewDescription}</CardStackEntryDescription>\n ) : null}\n </CardStackEntryContent>\n <CardStackEntryActions>\n {props.preview.connected ? (\n <Badge\n variant=\"outline\"\n className=\"border-emerald-500/20 bg-emerald-500/10 text-[10px] text-emerald-600 dark:text-emerald-400\"\n >\n Connected\n </Badge>\n ) : (\n <Badge\n variant=\"outline\"\n className=\"border-amber-500/20 bg-amber-500/10 text-[10px] text-amber-600 dark:text-amber-400\"\n >\n OAuth required\n </Badge>\n )}\n </CardStackEntryActions>\n </CardStackEntry>\n <SourceIdentityFieldRows\n identity={props.identity}\n namePlaceholder=\"e.g. Linear\"\n namespaceReadOnly={props.namespaceReadOnly}\n />\n <CardStackEntryField label=\"Server URL\">\n <Input\n value={props.url}\n onChange={(e) => props.onUrlChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://mcp.example.com\"\n className=\"w-full font-mono text-sm\"\n disabled={props.urlDisabled}\n />\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n );\n }\n\n if (props.probing) {\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n <CardStackEntryMedia>\n <Skeleton className=\"size-4 rounded\" />\n </CardStackEntryMedia>\n <CardStackEntryContent>\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"mt-1 h-3 w-32\" />\n </CardStackEntryContent>\n <CardStackEntryActions>\n <Skeleton className=\"h-4 w-20 rounded-full\" />\n </CardStackEntryActions>\n </CardStackEntry>\n </CardStackContent>\n </CardStack>\n );\n }\n\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntryField label=\"Server URL\">\n <div className=\"relative\">\n <Input\n value={props.url}\n onChange={(e) => props.onUrlChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://mcp.example.com\"\n className=\"w-full pr-9 font-mono text-sm\"\n aria-invalid={props.error ? true : undefined}\n disabled={props.urlDisabled}\n />\n {props.probing && (\n <div className=\"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2\">\n <IOSSpinner className=\"size-4\" />\n </div>\n )}\n </div>\n {props.error && (\n <div className=\"mt-2 space-y-2\">\n <FieldError>{props.error}</FieldError>\n {props.onRetry && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={props.onRetry}\n className=\"h-7 px-2 text-xs\"\n >\n Try again\n </Button>\n )}\n </div>\n )}\n </CardStackEntryField>\n </CardStackContent>\n </CardStack>\n );\n}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAEK;AAkCO,cAEF,YAFE;AAzBP,SAAS,sBAAsB,OAUnC;AACD,QAAM,qBAAqB,MAAM,UAC7B,MAAM,QAAQ,YACZ,MAAM,QAAQ,cAAc,OAC1B,OACA,GAAG,MAAM,QAAQ,SAAS,QAAQ,MAAM,QAAQ,cAAc,IAAI,MAAM,EAAE,eAC5E,qCACF;AAEJ,MAAI,MAAM,SAAS;AACjB,WACE,oBAAC,aACC,+BAAC,oBAAiB,WAAU,cAC1B;AAAA,2BAAC,kBACC;AAAA,4BAAC,uBACC,8BAAC,iBAAc,KAAK,MAAM,KAAK,MAAM,IAA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UACC,OAAO,MAAM;AAAA,UACb,UAAU,CAAC,MAAM,MAAM,YAAa,EAAE,OAA4B,KAAK;AAAA,UACvE,aAAY;AAAA,UACZ,WAAU;AAAA,UACV,gBAAc,MAAM,QAAQ,OAAO;AAAA,UACnC,UAAU,MAAM;AAAA;AAAA,MAClB;AAAA,MACC,MAAM,WACL,oBAAC,SAAI,WAAU,iEACb,8BAAC,cAAW,WAAU,UAAS,GACjC;AAAA,OAEJ;AAAA,IACC,MAAM,SACL,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,cAAY,gBAAM,OAAM;AAAA,MACxB,MAAM,WACL;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,SAAS,MAAM;AAAA,UACf,WAAU;AAAA,UACX;AAAA;AAAA,MAED;AAAA,OAEJ;AAAA,KAEJ,GACF,GACF;AAEJ;","names":[]}
package/dist/client.js ADDED
@@ -0,0 +1,51 @@
1
+ import {
2
+ mcpPresets
3
+ } from "./chunk-SKSXXFOA.js";
4
+
5
+ // src/react/plugin-client.tsx
6
+ import { defineClientPlugin } from "@executor-js/sdk/client";
7
+
8
+ // src/react/source-plugin.tsx
9
+ import { lazy } from "react";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var importAdd = () => import("./AddMcpSource-VM3HY26S.js");
12
+ var importEdit = () => import("./EditMcpSource-WELWGRJG.js");
13
+ var importSummary = () => import("./McpSourceSummary-7TDQXLT5.js");
14
+ var LazyAddMcpSource = lazy(importAdd);
15
+ var LazyEditMcpSource = lazy(importEdit);
16
+ var LazyMcpSourceSummary = lazy(importSummary);
17
+ var createMcpSourcePlugin = (options) => {
18
+ const allowStdio = options?.allowStdio ?? false;
19
+ const AddWithFlag = (props) => /* @__PURE__ */ jsx(LazyAddMcpSource, { ...props, allowStdio });
20
+ const presets = allowStdio ? mcpPresets : mcpPresets.filter(
21
+ (p) => !("transport" in p && p.transport === "stdio")
22
+ );
23
+ return {
24
+ key: "mcp",
25
+ label: "MCP",
26
+ add: AddWithFlag,
27
+ edit: LazyEditMcpSource,
28
+ summary: LazyMcpSourceSummary,
29
+ presets,
30
+ preload: () => {
31
+ void importAdd();
32
+ void importEdit();
33
+ void importSummary();
34
+ }
35
+ };
36
+ };
37
+ var mcpSourcePlugin = createMcpSourcePlugin();
38
+
39
+ // src/react/plugin-client.tsx
40
+ function createMcpClientPlugin(config) {
41
+ return defineClientPlugin({
42
+ id: "mcp",
43
+ sourcePlugin: createMcpSourcePlugin({
44
+ allowStdio: config?.allowStdio ?? false
45
+ })
46
+ });
47
+ }
48
+ export {
49
+ createMcpClientPlugin as default
50
+ };
51
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/plugin-client.tsx","../src/react/source-plugin.tsx"],"sourcesContent":["// ---------------------------------------------------------------------------\n// @executor-js/plugin-mcp/client — `defineClientPlugin` factory entry.\n//\n// Default-exports a factory rather than a value: at build time the\n// `@executor-js/vite-plugin` reads each plugin spec's `clientConfig`\n// from `executor.config.ts` and emits `__p(<JSON.stringify(clientConfig)>)`\n// into the virtual `plugins-client` module. So `allowStdio` flows from\n// the server-side `mcpPlugin({ dangerouslyAllowStdioMCP })` straight\n// into the bundle — no parallel client-side flag, no per-host shim,\n// no runtime fetch.\n// ---------------------------------------------------------------------------\n\nimport { defineClientPlugin } from \"@executor-js/sdk/client\";\n\nimport { createMcpSourcePlugin } from \"./source-plugin\";\n\nexport interface McpClientConfig {\n /**\n * Mirrors `dangerouslyAllowStdioMCP` on the server-side plugin. When\n * false, the AddMcpSource UI hides the stdio tab and stdio presets.\n * Defaults to false — same default as the server flag.\n */\n readonly allowStdio?: boolean;\n}\n\nexport default function createMcpClientPlugin(config?: McpClientConfig) {\n return defineClientPlugin({\n id: \"mcp\" as const,\n sourcePlugin: createMcpSourcePlugin({\n allowStdio: config?.allowStdio ?? false,\n }),\n });\n}\n","import { lazy, type ComponentProps, type ComponentType } from \"react\";\nimport type { SourcePlugin } from \"@executor-js/sdk/client\";\nimport { mcpPresets } from \"../sdk/presets\";\n\nconst importAdd = () => import(\"./AddMcpSource\");\nconst importEdit = () => import(\"./EditMcpSource\");\nconst importSummary = () => import(\"./McpSourceSummary\");\n\nconst LazyAddMcpSource = lazy(importAdd);\nconst LazyEditMcpSource = lazy(importEdit);\nconst LazyMcpSourceSummary = lazy(importSummary);\n\ntype AddProps = ComponentProps<SourcePlugin[\"add\"]>;\n\nexport interface McpSourcePluginOptions {\n /**\n * Enable the stdio transport in the add-source UI (tab + presets).\n *\n * Off by default — stdio is a high-risk transport on any server deployment\n * (see `dangerouslyAllowStdioMCP` on the server-side plugin). Only enable in\n * trusted local contexts where the server has the matching flag set.\n */\n readonly allowStdio?: boolean;\n}\n\nexport const createMcpSourcePlugin = (options?: McpSourcePluginOptions): SourcePlugin => {\n const allowStdio = options?.allowStdio ?? false;\n\n const AddWithFlag: ComponentType<AddProps> = (props) => (\n <LazyAddMcpSource {...props} allowStdio={allowStdio} />\n );\n\n const presets = allowStdio\n ? mcpPresets\n : mcpPresets.filter(\n (p) => !(\"transport\" in p && (p as { transport?: string }).transport === \"stdio\"),\n );\n\n return {\n key: \"mcp\",\n label: \"MCP\",\n add: AddWithFlag,\n edit: LazyEditMcpSource,\n summary: LazyMcpSourceSummary,\n presets,\n preload: () => {\n void importAdd();\n void importEdit();\n void importSummary();\n },\n };\n};\n\n/** @deprecated Use `createMcpSourcePlugin({ allowStdio })` instead. */\nexport const mcpSourcePlugin: SourcePlugin = createMcpSourcePlugin();\n"],"mappings":";;;;;AAYA,SAAS,0BAA0B;;;ACZnC,SAAS,YAAqD;AA6B1D;AAzBJ,IAAM,YAAY,MAAM,OAAO,4BAAgB;AAC/C,IAAM,aAAa,MAAM,OAAO,6BAAiB;AACjD,IAAM,gBAAgB,MAAM,OAAO,gCAAoB;AAEvD,IAAM,mBAAmB,KAAK,SAAS;AACvC,IAAM,oBAAoB,KAAK,UAAU;AACzC,IAAM,uBAAuB,KAAK,aAAa;AAexC,IAAM,wBAAwB,CAAC,YAAmD;AACvF,QAAM,aAAa,SAAS,cAAc;AAE1C,QAAM,cAAuC,CAAC,UAC5C,oBAAC,oBAAkB,GAAG,OAAO,YAAwB;AAGvD,QAAM,UAAU,aACZ,aACA,WAAW;AAAA,IACT,CAAC,MAAM,EAAE,eAAe,KAAM,EAA6B,cAAc;AAAA,EAC3E;AAEJ,SAAO;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,SAAS,MAAM;AACb,WAAK,UAAU;AACf,WAAK,WAAW;AAChB,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AACF;AAGO,IAAM,kBAAgC,sBAAsB;;;AD7BpD,SAAR,sBAAuC,QAA0B;AACtE,SAAO,mBAAmB;AAAA,IACxB,IAAI;AAAA,IACJ,cAAc,sBAAsB;AAAA,MAClC,YAAY,QAAQ,cAAc;AAAA,IACpC,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
package/dist/core.js CHANGED
@@ -1,13 +1,37 @@
1
1
  import {
2
- McpConnectionAuth,
3
2
  makeMcpStore,
4
3
  mcpPlugin,
5
4
  mcpSchema
6
- } from "./chunk-C2GNZGFJ.js";
5
+ } from "./chunk-OOOH3IO4.js";
6
+ import {
7
+ ConfiguredMcpCredentialValue,
8
+ MCP_HEADER_AUTH_SLOT,
9
+ MCP_OAUTH_CLIENT_ID_SLOT,
10
+ MCP_OAUTH_CLIENT_SECRET_SLOT,
11
+ MCP_OAUTH_CONNECTION_SLOT,
12
+ McpConnectionAuth,
13
+ McpConnectionAuthInput,
14
+ McpCredentialInput,
15
+ McpSourceBindingInput,
16
+ McpSourceBindingRef,
17
+ mcpHeaderSlot,
18
+ mcpQueryParamSlot
19
+ } from "./chunk-Z4CRPOLI.js";
7
20
  export {
21
+ ConfiguredMcpCredentialValue,
22
+ MCP_HEADER_AUTH_SLOT,
23
+ MCP_OAUTH_CLIENT_ID_SLOT,
24
+ MCP_OAUTH_CLIENT_SECRET_SLOT,
25
+ MCP_OAUTH_CONNECTION_SLOT,
8
26
  McpConnectionAuth,
27
+ McpConnectionAuthInput,
28
+ McpCredentialInput,
29
+ McpSourceBindingInput,
30
+ McpSourceBindingRef,
9
31
  makeMcpStore,
32
+ mcpHeaderSlot,
10
33
  mcpPlugin,
34
+ mcpQueryParamSlot,
11
35
  mcpSchema
12
36
  };
13
37
  //# sourceMappingURL=core.js.map
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  mcpPlugin
3
- } from "./chunk-C2GNZGFJ.js";
3
+ } from "./chunk-OOOH3IO4.js";
4
+ import "./chunk-Z4CRPOLI.js";
4
5
  export {
5
6
  mcpPlugin
6
7
  };
@@ -0,0 +1,18 @@
1
+ import { type SourceIdentity } from "@executor-js/react/plugins/source-identity";
2
+ export type McpRemoteSourcePreview = {
3
+ readonly name: string;
4
+ readonly serverName: string | null;
5
+ readonly connected: boolean;
6
+ readonly toolCount: number | null;
7
+ };
8
+ export declare function McpRemoteSourceFields(props: {
9
+ readonly url: string;
10
+ readonly onUrlChange: (url: string) => void;
11
+ readonly identity: SourceIdentity;
12
+ readonly preview: McpRemoteSourcePreview | null;
13
+ readonly probing?: boolean;
14
+ readonly error?: string | null;
15
+ readonly onRetry?: () => void;
16
+ readonly namespaceReadOnly?: boolean;
17
+ readonly urlDisabled?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export default function McpSourceSummary(props: {
2
+ readonly sourceId: string;
3
+ readonly variant?: "badge" | "panel";
4
+ readonly onAction?: () => void;
5
+ }): import("react/jsx-runtime").JSX.Element | null;