History

remove legacy compatibility codepaths

Rhys Sullivan committed 7 months ago

Commit ddd3aaa1 parent e2977a021 files · +111 −1158Browse files

Showing the changes to plugins/mcp (2 of 21 files). Show all

Unified · Split

2 files
  1. plugins/mcp/sdk/index.ts +0 −56
  2. plugins/mcp/sdk/tools.test.ts +1 −1
plugins/mcp/sdk/index.ts+0−56
@@ -249,37 +249,12 @@ const normalizeStringArray = ( · 248 unmodified lines
249249 return normalized.length > 0 ? normalized : null;
250250 };
251251
252−const decodeMcpAuthOption = Schema.decodeUnknownOption(McpConnectionAuthSchema);
253252 const decodeMcpCurrentLocalConfigOption = Schema.decodeUnknownOption(
254253 createPluginLocalConfigEntrySchema({
255254 kind: "mcp",
256255 config: McpStoredSourceDataSchema,
257256 }),
258257 );
259−const decodeMcpLegacyLocalConfigOption = Schema.decodeUnknownOption(
260− Schema.Struct({
261− kind: Schema.Literal("mcp"),
262− name: Schema.optional(Schema.String),
263− namespace: Schema.optional(Schema.String),
264− enabled: Schema.optional(Schema.Boolean),
265− connection: Schema.optional(
266− Schema.Struct({
267− endpoint: Schema.optional(Schema.NullOr(Schema.String)),
268− auth: Schema.optional(Schema.Unknown),
269− }),
270− ),
271− binding: Schema.Struct({
272− transport: Schema.optional(Schema.NullOr(SourceTransportSchema)),
273− queryParams: Schema.optional(Schema.NullOr(StringMapSchema)),
274− headers: Schema.optional(Schema.NullOr(StringMapSchema)),
275− command: Schema.optional(Schema.NullOr(Schema.String)),
276− args: Schema.optional(Schema.NullOr(StringArraySchema)),
277− env: Schema.optional(Schema.NullOr(StringMapSchema)),
278− cwd: Schema.optional(Schema.NullOr(Schema.String)),
279− }),
280− config: Schema.optional(Schema.Unknown),
281− }),
282−);
283258
284259 const normalizeStoredSourceData = (
285260 input: McpConnectInput | McpSourceConfigPayload,
@@ -399,37 +374,6 @@ const mcpStoredSourceDataFromLocalConfig = ( · 113 unmodified lines
399374 return Effect.succeed(current.value.config);
400375 }
401376
402− const legacy = decodeMcpLegacyLocalConfigOption(config);
403− if (Option.isSome(legacy)) {
404− const auth = decodeMcpAuthOption(legacy.value.connection?.auth);
405− if (
406− legacy.value.connection?.auth !== undefined &&
407− Option.isNone(auth)
408− ) {
409− return runtimeEffectError(
410− "plugins/mcp/sdk",
411− "Unsupported MCP auth configuration in local source config.",
412− );
413− }
414−
415− return normalizeStoredSourceData({
416− name: legacy.value.name ?? "MCP",
417− endpoint: legacy.value.connection?.endpoint ?? null,
418− transport: legacy.value.binding.transport ?? null,
419− queryParams: legacy.value.binding.queryParams ?? null,
420− headers: legacy.value.binding.headers ?? null,
421− command: legacy.value.binding.command ?? null,
422− args: legacy.value.binding.args ?? null,
423− env: legacy.value.binding.env ?? null,
424− cwd: legacy.value.binding.cwd ?? null,
425− auth: Option.isSome(auth)
426− ? auth.value
427− : {
428− kind: "none",
429− },
430− });
431− }
432−
433377 return runtimeEffectError(
434378 "plugins/mcp/sdk",
435379 "Unsupported MCP local source config.",
plugins/mcp/sdk/tools.test.ts+1−1
@@ -500,7 +500,7 @@ describe("codemode-mcp", () => { · 499 unmodified lines
500500 action: "accept" as const,
501501 };
502502 }),
503− path: "executor.sources.add" as ToolPath,
503+ path: "executor.mcp.createSource" as ToolPath,
504504 sourceKey: "executor",
505505 args: {
506506 endpoint: "https://example.com/mcp",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t