diff --git a/deno.lock b/deno.lock index f6c2cf7..e238ee9 100644 --- a/deno.lock +++ b/deno.lock @@ -20,6 +20,7 @@ "npm:@ai-sdk/provider@2": "2.0.0", "npm:@hono/zod-openapi@~0.19.2": "0.19.10_hono@4.9.10_zod@3.25.76", "npm:@mcpc-tech/handle-sandbox@^0.0.7": "0.0.7", + "npm:@mcpc-tech/plugin-code-execution@^0.0.3": "0.0.3_@opentelemetry+api@1.9.0_ajv@8.17.1", "npm:@mcpc-tech/ripgrep-napi@^0.0.4": "0.0.4", "npm:@modelcontextprotocol/sdk@^1.8.0": "1.17.5_express@5.1.0_zod@3.25.76", "npm:@opentelemetry/api@^1.9.0": "1.9.0", @@ -258,6 +259,29 @@ ], "tarball": "https://mirrors.tencent.com/npm/@mcpc-tech/handle-sandbox/-/handle-sandbox-0.0.7.tgz" }, + "@mcpc-tech/plugin-code-execution@0.0.3_@opentelemetry+api@1.9.0_ajv@8.17.1": { + "integrity": "sha512-kfefq7H1CvmGEzzfytK3HY6bDwXJpddAHDwQnS0PZ+x+F9hYIu1tGtN/OTC8cD/dK59kpPkeZv1sek3YZ4ZHmg==", + "dependencies": [ + "@mcpc-tech/handle-sandbox", + "@mcpc-tech/ripgrep-napi", + "@modelcontextprotocol/sdk", + "@opentelemetry/api", + "@opentelemetry/exporter-trace-otlp-http", + "@opentelemetry/resources@1.30.1_@opentelemetry+api@1.9.0", + "@opentelemetry/sdk-trace-base@1.30.1_@opentelemetry+api@1.9.0", + "@opentelemetry/sdk-trace-node", + "@opentelemetry/semantic-conventions@1.38.0", + "@segment/ajv-human-errors", + "ajv@8.17.1", + "ajv-formats", + "cheerio", + "json-schema-to-zod", + "json-schema-traverse@1.0.0", + "jsonrepair", + "zod" + ], + "tarball": "https://mirrors.tencent.com/npm/@mcpc-tech/plugin-code-execution/-/plugin-code-execution-0.0.3.tgz" + }, "@mcpc-tech/ripgrep-napi-android-arm-eabi@0.0.4": { "integrity": "sha512-Y52S9IdbqMYvet7hDGk/DRdKFM7ED6tSQmBtrWVzdeqVWPMayZvrKdlcceBykdKjbmgnlqtulzEtHBF2iXmXwA==", "os": ["android"], @@ -1575,6 +1599,7 @@ "jsr:@std/assert@^1.0.14", "jsr:@std/http@^1.0.14", "npm:@hono/zod-openapi@~0.19.2", + "npm:@mcpc-tech/plugin-code-execution@^0.0.3", "npm:@mcpc-tech/ripgrep-napi@^0.0.4", "npm:@modelcontextprotocol/sdk@^1.8.0", "npm:hono@^4.7.5", @@ -1624,7 +1649,7 @@ }, "packages/plugin-code-execution": { "dependencies": [ - "jsr:@mcpc/core@~0.3.4", + "jsr:@mcpc/core@~0.3.5", "jsr:@std/assert@1", "npm:@mcpc-tech/handle-sandbox@^0.0.7", "npm:@modelcontextprotocol/sdk@^1.8.0" diff --git a/packages/core/deno.json b/packages/core/deno.json index 2063c75..c596110 100644 --- a/packages/core/deno.json +++ b/packages/core/deno.json @@ -1,6 +1,6 @@ { "name": "@mcpc/core", - "version": "0.3.4", + "version": "0.3.5", "repository": { "type": "git", "url": "git+https://github.com/mcpc-tech/mcpc.git" diff --git a/packages/core/src/prompts/types.ts b/packages/core/src/prompts/types.ts index 70075d2..8f5d2fe 100644 --- a/packages/core/src/prompts/types.ts +++ b/packages/core/src/prompts/types.ts @@ -34,7 +34,7 @@ export type ExecutionMode = | "agentic_workflow" | "agentic_sampling" | "agentic_workflow_sampling" - | "custom"; + | (string & Record); /** * Prompt template configuration diff --git a/packages/plugin-code-execution/README.md b/packages/plugin-code-execution/README.md index 1fa3754..edb00fb 100644 --- a/packages/plugin-code-execution/README.md +++ b/packages/plugin-code-execution/README.md @@ -67,7 +67,7 @@ const server = await mcpc( }), ], options: { - mode: "custom", + mode: "code_execution", }, }], ); diff --git a/packages/plugin-code-execution/deno.json b/packages/plugin-code-execution/deno.json index 4cc035b..761f116 100644 --- a/packages/plugin-code-execution/deno.json +++ b/packages/plugin-code-execution/deno.json @@ -1,6 +1,6 @@ { "name": "@mcpc/plugin-code-execution", - "version": "0.0.3", + "version": "0.0.4", "repository": { "type": "git", "url": "git+https://github.com/mcpc-tech/mcpc.git" @@ -13,7 +13,7 @@ "imports": { "@std/assert": "jsr:@std/assert@^1.0.0", "@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.8.0", - "@mcpc/core": "jsr:@mcpc/core@^0.3.4", + "@mcpc/core": "jsr:@mcpc/core@^0.3.5", "@mcpc-tech/handle-sandbox": "npm:@mcpc-tech/handle-sandbox@^0.0.7" }, "publish": { diff --git a/packages/plugin-code-execution/examples/basic-usage.ts b/packages/plugin-code-execution/examples/basic-usage.ts index 14f5b4f..37ab838 100644 --- a/packages/plugin-code-execution/examples/basic-usage.ts +++ b/packages/plugin-code-execution/examples/basic-usage.ts @@ -42,7 +42,7 @@ The code can call MCP tools via \`callMCPTool(toolName, params)\` function.`, }), ], options: { - mode: "custom" as const, + mode: "code_execution" as const, }, }, ]; diff --git a/packages/plugin-code-execution/src/plugin.ts b/packages/plugin-code-execution/src/plugin.ts index 8a73632..6495570 100644 --- a/packages/plugin-code-execution/src/plugin.ts +++ b/packages/plugin-code-execution/src/plugin.ts @@ -23,7 +23,7 @@ export function createCodeExecutionPlugin( return { name: "code_execution", version: "1.0.0", - apply: "custom", + apply: "code_execution", registerAgentTool: (context: AgentToolRegistrationContext) => { const { server, name, description, allToolNames } = context; diff --git a/packages/plugin-code-execution/tests/code_execution.test.ts b/packages/plugin-code-execution/tests/code_execution.test.ts index c65797f..f319376 100644 --- a/packages/plugin-code-execution/tests/code_execution.test.ts +++ b/packages/plugin-code-execution/tests/code_execution.test.ts @@ -23,7 +23,7 @@ Deno.test( deps: { mcpServers: {} }, plugins: [createCodeExecutionPlugin()], options: { - mode: "custom", + mode: "code_execution", }, }, ], @@ -61,7 +61,7 @@ Deno.test( deps: { mcpServers: {} }, plugins: [createCodeExecutionPlugin()], options: { - mode: "custom", + mode: "code_execution", }, }, ], @@ -99,7 +99,7 @@ Deno.test( deps: { mcpServers: {} }, plugins: [createCodeExecutionPlugin()], options: { - mode: "custom", + mode: "code_execution", }, }, ],