Skip to content

Commit 3293d5e

Browse files
committed
feat(plugin-code-execution): replace Deno with handle-sandbox and update dependencies
1 parent a996487 commit 3293d5e

File tree

12 files changed

+157
-937
lines changed

12 files changed

+157
-937
lines changed

deno.lock

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugin-code-execution/deno.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mcpc/plugin-code-execution",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/mcpc-tech/mcpc.git"
@@ -13,8 +13,8 @@
1313
"imports": {
1414
"@std/assert": "jsr:@std/assert@^1.0.0",
1515
"@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.8.0",
16-
"@mcpc/core": "jsr:@mcpc/core@^0.3.2",
17-
"deno": "npm:deno@^2.5.6"
16+
"@mcpc/core": "jsr:@mcpc/core@^0.3.3",
17+
"@mcpc-tech/handle-sandbox": "npm:@mcpc-tech/handle-sandbox@^0.0.7"
1818
},
1919
"publish": {
2020
"exclude": ["examples/**", "tests/**", "logs/**"]

packages/plugin-code-execution/mod.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ export {
1717
SandboxExecutor,
1818
type ToolCallHandler,
1919
} from "./src/sandbox-executor.ts";
20-
export { JsonRpcHandler } from "./src/json-rpc.ts";
21-
export * from "./src/types.ts";

packages/plugin-code-execution/sandbox/runtime.ts

Lines changed: 0 additions & 167 deletions
This file was deleted.

packages/plugin-code-execution/src/json-rpc.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

packages/plugin-code-execution/src/plugin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function createCodeExecutionPlugin(
7777
const contentParts: CallToolResult["content"] = [];
7878

7979
// Execute code
80-
if (code && hasDefinitions.length > 0) {
80+
if (code) {
8181
if (!executor) throw new Error("Sandbox not initialized");
8282

8383
const result = await executor.executeCode(code, hasDefinitions);
@@ -90,6 +90,7 @@ export function createCodeExecutionPlugin(
9090
const needsDefinitions = definitionsOf.filter(
9191
(def) => !hasDefinitions.includes(def),
9292
);
93+
console.log("Needs definitions for:", needsDefinitions);
9394

9495
if (needsDefinitions.length > 0) {
9596
const definitionTexts: string[] = [];
@@ -124,10 +125,12 @@ export function createCodeExecutionPlugin(
124125
);
125126
},
126127

127-
dispose: () => {
128+
dispose: async () => {
128129
if (executor) {
129130
executor.stop();
130131
executor = null;
132+
// Wait for process to terminate
133+
await new Promise((resolve) => setTimeout(resolve, 100));
131134
}
132135
},
133136
};

0 commit comments

Comments
 (0)