@sammorrowdrums/mcpi-ext 0.1.0 → 0.2.0
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/.github/workflows/ci.yml +1 -1
- package/README.md +109 -139
- package/docs/code-mode.md +38 -0
- package/docs/skills.md +57 -0
- package/docs/tool-cli.md +54 -0
- package/images/code-mode-histogram.png +0 -0
- package/images/skills-enabling-mcp-tools.png +0 -0
- package/images/tool-cli-grep.png +0 -0
- package/mise.toml +1 -13
- package/package.json +5 -7
- package/scripts/test-tool-cli-smoke.mjs +40 -9
- package/src/index.ts +24 -3
- package/src/tool-cli/index.ts +2 -2
- package/dist/code-mode/code-mode-integration.test.d.ts +0 -2
- package/dist/code-mode/code-mode-integration.test.d.ts.map +0 -1
- package/dist/code-mode/code-mode-integration.test.js +0 -116
- package/dist/code-mode/code-mode-integration.test.js.map +0 -1
- package/dist/code-mode/eligibility.d.ts +0 -10
- package/dist/code-mode/eligibility.d.ts.map +0 -1
- package/dist/code-mode/eligibility.js +0 -14
- package/dist/code-mode/eligibility.js.map +0 -1
- package/dist/code-mode/eligibility.test.d.ts +0 -2
- package/dist/code-mode/eligibility.test.d.ts.map +0 -1
- package/dist/code-mode/eligibility.test.js +0 -53
- package/dist/code-mode/eligibility.test.js.map +0 -1
- package/dist/code-mode/executor.d.ts +0 -35
- package/dist/code-mode/executor.d.ts.map +0 -1
- package/dist/code-mode/executor.js +0 -120
- package/dist/code-mode/executor.js.map +0 -1
- package/dist/code-mode/executor.test.d.ts +0 -2
- package/dist/code-mode/executor.test.d.ts.map +0 -1
- package/dist/code-mode/executor.test.js +0 -130
- package/dist/code-mode/executor.test.js.map +0 -1
- package/dist/code-mode/index.d.ts +0 -65
- package/dist/code-mode/index.d.ts.map +0 -1
- package/dist/code-mode/index.js +0 -175
- package/dist/code-mode/index.js.map +0 -1
- package/dist/code-mode/tools.d.ts +0 -45
- package/dist/code-mode/tools.d.ts.map +0 -1
- package/dist/code-mode/tools.js +0 -70
- package/dist/code-mode/tools.js.map +0 -1
- package/dist/code-mode/type-hints.d.ts +0 -20
- package/dist/code-mode/type-hints.d.ts.map +0 -1
- package/dist/code-mode/type-hints.js +0 -189
- package/dist/code-mode/type-hints.js.map +0 -1
- package/dist/code-mode/type-hints.test.d.ts +0 -2
- package/dist/code-mode/type-hints.test.d.ts.map +0 -1
- package/dist/code-mode/type-hints.test.js +0 -157
- package/dist/code-mode/type-hints.test.js.map +0 -1
- package/dist/docker-e2e.d.ts +0 -55
- package/dist/docker-e2e.d.ts.map +0 -1
- package/dist/docker-e2e.js +0 -235
- package/dist/docker-e2e.js.map +0 -1
- package/dist/docker-e2e.test.d.ts +0 -2
- package/dist/docker-e2e.test.d.ts.map +0 -1
- package/dist/docker-e2e.test.js +0 -176
- package/dist/docker-e2e.test.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -128
- package/dist/index.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -8
- package/dist/index.test.js.map +0 -1
- package/dist/mcp/client-manager.d.ts +0 -46
- package/dist/mcp/client-manager.d.ts.map +0 -1
- package/dist/mcp/client-manager.js +0 -148
- package/dist/mcp/client-manager.js.map +0 -1
- package/dist/mcp/client-manager.test.d.ts +0 -2
- package/dist/mcp/client-manager.test.d.ts.map +0 -1
- package/dist/mcp/client-manager.test.js +0 -204
- package/dist/mcp/client-manager.test.js.map +0 -1
- package/dist/mcp/config-loader.d.ts +0 -8
- package/dist/mcp/config-loader.d.ts.map +0 -1
- package/dist/mcp/config-loader.js +0 -43
- package/dist/mcp/config-loader.js.map +0 -1
- package/dist/mcp/config-loader.test.d.ts +0 -2
- package/dist/mcp/config-loader.test.d.ts.map +0 -1
- package/dist/mcp/config-loader.test.js +0 -93
- package/dist/mcp/config-loader.test.js.map +0 -1
- package/dist/mcp/config.d.ts +0 -46
- package/dist/mcp/config.d.ts.map +0 -1
- package/dist/mcp/config.js +0 -28
- package/dist/mcp/config.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -5
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -4
- package/dist/mcp/index.js.map +0 -1
- package/dist/skills/discover.d.ts +0 -10
- package/dist/skills/discover.d.ts.map +0 -1
- package/dist/skills/discover.js +0 -60
- package/dist/skills/discover.js.map +0 -1
- package/dist/skills/format.d.ts +0 -10
- package/dist/skills/format.d.ts.map +0 -1
- package/dist/skills/format.js +0 -38
- package/dist/skills/format.js.map +0 -1
- package/dist/skills/format.test.d.ts +0 -2
- package/dist/skills/format.test.d.ts.map +0 -1
- package/dist/skills/format.test.js +0 -63
- package/dist/skills/format.test.js.map +0 -1
- package/dist/skills/index.d.ts +0 -6
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -6
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/load-skill-tool.d.ts +0 -40
- package/dist/skills/load-skill-tool.d.ts.map +0 -1
- package/dist/skills/load-skill-tool.js +0 -104
- package/dist/skills/load-skill-tool.js.map +0 -1
- package/dist/skills/mcp-tool-proxy.d.ts +0 -11
- package/dist/skills/mcp-tool-proxy.d.ts.map +0 -1
- package/dist/skills/mcp-tool-proxy.js +0 -116
- package/dist/skills/mcp-tool-proxy.js.map +0 -1
- package/dist/skills/skill-integration.test.d.ts +0 -2
- package/dist/skills/skill-integration.test.d.ts.map +0 -1
- package/dist/skills/skill-integration.test.js +0 -119
- package/dist/skills/skill-integration.test.js.map +0 -1
- package/dist/skills/skill-registry.d.ts +0 -39
- package/dist/skills/skill-registry.d.ts.map +0 -1
- package/dist/skills/skill-registry.js +0 -48
- package/dist/skills/skill-registry.js.map +0 -1
- package/dist/skills/skill-registry.test.d.ts +0 -2
- package/dist/skills/skill-registry.test.d.ts.map +0 -1
- package/dist/skills/skill-registry.test.js +0 -67
- package/dist/skills/skill-registry.test.js.map +0 -1
- package/dist/test-servers/weather-server.d.ts +0 -12
- package/dist/test-servers/weather-server.d.ts.map +0 -1
- package/dist/test-servers/weather-server.js +0 -139
- package/dist/test-servers/weather-server.js.map +0 -1
- package/dist/test-servers/weather-stdio.d.ts +0 -2
- package/dist/test-servers/weather-stdio.d.ts.map +0 -1
- package/dist/test-servers/weather-stdio.js +0 -11
- package/dist/test-servers/weather-stdio.js.map +0 -1
- package/dist/tool-cli/cli.d.ts +0 -3
- package/dist/tool-cli/cli.d.ts.map +0 -1
- package/dist/tool-cli/cli.js +0 -179
- package/dist/tool-cli/cli.js.map +0 -1
- package/dist/tool-cli/constants.d.ts +0 -7
- package/dist/tool-cli/constants.d.ts.map +0 -1
- package/dist/tool-cli/constants.js +0 -15
- package/dist/tool-cli/constants.js.map +0 -1
- package/dist/tool-cli/format.d.ts +0 -8
- package/dist/tool-cli/format.d.ts.map +0 -1
- package/dist/tool-cli/format.js +0 -57
- package/dist/tool-cli/format.js.map +0 -1
- package/dist/tool-cli/format.test.d.ts +0 -2
- package/dist/tool-cli/format.test.d.ts.map +0 -1
- package/dist/tool-cli/format.test.js +0 -30
- package/dist/tool-cli/format.test.js.map +0 -1
- package/dist/tool-cli/index.d.ts +0 -4
- package/dist/tool-cli/index.d.ts.map +0 -1
- package/dist/tool-cli/index.js +0 -4
- package/dist/tool-cli/index.js.map +0 -1
- package/dist/tool-cli/rpc-client.d.ts +0 -6
- package/dist/tool-cli/rpc-client.d.ts.map +0 -1
- package/dist/tool-cli/rpc-client.js +0 -25
- package/dist/tool-cli/rpc-client.js.map +0 -1
- package/dist/tool-cli/rpc-server.d.ts +0 -48
- package/dist/tool-cli/rpc-server.d.ts.map +0 -1
- package/dist/tool-cli/rpc-server.js +0 -220
- package/dist/tool-cli/rpc-server.js.map +0 -1
- package/dist/tool-cli/rpc-server.test.d.ts +0 -2
- package/dist/tool-cli/rpc-server.test.d.ts.map +0 -1
- package/dist/tool-cli/rpc-server.test.js +0 -154
- package/dist/tool-cli/rpc-server.test.js.map +0 -1
- package/src/tool-cli/cli.ts +0 -232
- package/src/tool-cli/constants.ts +0 -15
- package/src/tool-cli/rpc-client.ts +0 -39
- package/src/tool-cli/rpc-server.test.ts +0 -193
- package/src/tool-cli/rpc-server.ts +0 -287
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { executeInSandbox, normalizeCode } from "./executor.js";
|
|
3
|
-
describe("normalizeCode", () => {
|
|
4
|
-
it("strips markdown code fences", () => {
|
|
5
|
-
expect(normalizeCode("```js\nconst x = 1;\n```")).toBe("const x = 1;");
|
|
6
|
-
});
|
|
7
|
-
it("strips typescript fences", () => {
|
|
8
|
-
expect(normalizeCode("```typescript\nconst x = 1;\n```")).toBe("const x = 1;");
|
|
9
|
-
});
|
|
10
|
-
it("wraps arrow function in invocation", () => {
|
|
11
|
-
expect(normalizeCode("async () => { return 42; }")).toBe("return (async () => { return 42; })();");
|
|
12
|
-
});
|
|
13
|
-
it("wraps function declaration in invocation", () => {
|
|
14
|
-
const code = "async function main() { return 42; }";
|
|
15
|
-
const result = normalizeCode(code);
|
|
16
|
-
expect(result).toContain("async function main()");
|
|
17
|
-
expect(result).toContain("return main();");
|
|
18
|
-
});
|
|
19
|
-
it("strips export default", () => {
|
|
20
|
-
const result = normalizeCode("export default async () => { return 42; }");
|
|
21
|
-
expect(result).toContain("return (async () => { return 42; })();");
|
|
22
|
-
});
|
|
23
|
-
it("leaves bare code as-is", () => {
|
|
24
|
-
expect(normalizeCode("const x = 1;\nreturn x;")).toBe("const x = 1;\nreturn x;");
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
describe("executeInSandbox", () => {
|
|
28
|
-
it("executes simple code and returns result", async () => {
|
|
29
|
-
const result = await executeInSandbox("return 2 + 2;", [], async () => ({}), {
|
|
30
|
-
timeoutMs: 5000,
|
|
31
|
-
});
|
|
32
|
-
expect(result.result).toBe(4);
|
|
33
|
-
expect(result.error).toBeUndefined();
|
|
34
|
-
});
|
|
35
|
-
it("captures console.log output", async () => {
|
|
36
|
-
const result = await executeInSandbox('console.log("hello", "world"); return 1;', [], async () => ({}), { timeoutMs: 5000 });
|
|
37
|
-
expect(result.result).toBe(1);
|
|
38
|
-
expect(result.logs).toContain("hello world");
|
|
39
|
-
});
|
|
40
|
-
it("dispatches tool calls through the callback", async () => {
|
|
41
|
-
const dispatched = [];
|
|
42
|
-
const dispatch = async (name, args) => {
|
|
43
|
-
dispatched.push({ name, args });
|
|
44
|
-
return { results: ["doc1", "doc2"] };
|
|
45
|
-
};
|
|
46
|
-
const code = `
|
|
47
|
-
const result = await codemode.search_docs({ query: "test" });
|
|
48
|
-
return result;
|
|
49
|
-
`;
|
|
50
|
-
const result = await executeInSandbox(code, ["search_docs"], dispatch, { timeoutMs: 5000 });
|
|
51
|
-
expect(result.error).toBeUndefined();
|
|
52
|
-
expect(result.result).toEqual({ results: ["doc1", "doc2"] });
|
|
53
|
-
expect(dispatched).toHaveLength(1);
|
|
54
|
-
expect(dispatched[0].name).toBe("search_docs");
|
|
55
|
-
expect(dispatched[0].args).toEqual({ query: "test" });
|
|
56
|
-
});
|
|
57
|
-
it("handles tools with special characters in names", async () => {
|
|
58
|
-
const dispatched = [];
|
|
59
|
-
const dispatch = async (name) => {
|
|
60
|
-
dispatched.push(name);
|
|
61
|
-
return { ok: true };
|
|
62
|
-
};
|
|
63
|
-
const code = `
|
|
64
|
-
const result = await codemode.github_list_repos({});
|
|
65
|
-
return result;
|
|
66
|
-
`;
|
|
67
|
-
const result = await executeInSandbox(code, ["github.list-repos"], dispatch, {
|
|
68
|
-
timeoutMs: 5000,
|
|
69
|
-
});
|
|
70
|
-
expect(result.error).toBeUndefined();
|
|
71
|
-
expect(dispatched).toContain("github.list-repos");
|
|
72
|
-
});
|
|
73
|
-
it("returns error for invalid code", async () => {
|
|
74
|
-
const result = await executeInSandbox("throw new Error('boom');", [], async () => ({}), {
|
|
75
|
-
timeoutMs: 5000,
|
|
76
|
-
});
|
|
77
|
-
expect(result.error).toContain("boom");
|
|
78
|
-
expect(result.result).toBeUndefined();
|
|
79
|
-
});
|
|
80
|
-
it("enforces timeout", async () => {
|
|
81
|
-
const result = await executeInSandbox("while(true) {}", [], async () => ({}), {
|
|
82
|
-
timeoutMs: 100,
|
|
83
|
-
});
|
|
84
|
-
expect(result.error).toBeDefined();
|
|
85
|
-
expect(result.result).toBeUndefined();
|
|
86
|
-
});
|
|
87
|
-
it("chains multiple tool calls", async () => {
|
|
88
|
-
const calls = [];
|
|
89
|
-
const dispatch = async (name, args) => {
|
|
90
|
-
calls.push(name);
|
|
91
|
-
if (name === "list_items")
|
|
92
|
-
return { items: ["a", "b", "c"] };
|
|
93
|
-
if (name === "get_details")
|
|
94
|
-
return { detail: `info for ${args.id}` };
|
|
95
|
-
return {};
|
|
96
|
-
};
|
|
97
|
-
const code = `
|
|
98
|
-
const { items } = await codemode.list_items({});
|
|
99
|
-
const details = [];
|
|
100
|
-
for (const id of items) {
|
|
101
|
-
const d = await codemode.get_details({ id });
|
|
102
|
-
details.push(d.detail);
|
|
103
|
-
}
|
|
104
|
-
return details;
|
|
105
|
-
`;
|
|
106
|
-
const result = await executeInSandbox(code, ["list_items", "get_details"], dispatch, {
|
|
107
|
-
timeoutMs: 5000,
|
|
108
|
-
});
|
|
109
|
-
expect(result.error).toBeUndefined();
|
|
110
|
-
expect(result.result).toEqual(["info for a", "info for b", "info for c"]);
|
|
111
|
-
expect(calls).toEqual(["list_items", "get_details", "get_details", "get_details"]);
|
|
112
|
-
});
|
|
113
|
-
it("prevents imports", async () => {
|
|
114
|
-
const code = 'import("fs")';
|
|
115
|
-
const result = await executeInSandbox(code, [], async () => ({}), { timeoutMs: 5000 });
|
|
116
|
-
expect(result.error).toBeDefined();
|
|
117
|
-
});
|
|
118
|
-
it("listTools returns available tools", async () => {
|
|
119
|
-
const code = `
|
|
120
|
-
const tools = await codemode.listTools();
|
|
121
|
-
return tools;
|
|
122
|
-
`;
|
|
123
|
-
const result = await executeInSandbox(code, ["search", "execute"], async () => ({}), {
|
|
124
|
-
timeoutMs: 5000,
|
|
125
|
-
});
|
|
126
|
-
expect(result.error).toBeUndefined();
|
|
127
|
-
expect(result.result).toEqual(["search", "execute"]);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
//# sourceMappingURL=executor.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executor.test.js","sourceRoot":"","sources":["../../src/code-mode/executor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEhE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,aAAa,CAAC,kCAAkC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC,CAAC,IAAI,CACtD,wCAAwC,CACzC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG,sCAAsC,CAAC;QACpD,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;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IAAI,EAAE;QACjD,MAAM,IAAI,GAAG;;;KAGZ,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;YACnF,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { McpClientManager, McpTool } from "../mcp/index.js";
|
|
2
|
-
import type { ExecuteResult, ExecutorOptions } from "./executor.js";
|
|
3
|
-
export { getEligibleTools, isEligibleForCodeMode } from "./eligibility.js";
|
|
4
|
-
export type { ExecuteResult, ExecutorOptions } from "./executor.js";
|
|
5
|
-
export { executeInSandbox, normalizeCode } from "./executor.js";
|
|
6
|
-
export { createCodeExecuteTool, createCodeSearchTool } from "./tools.js";
|
|
7
|
-
export { generateTypeHints, jsonSchemaToTypeString, sanitizeToolName } from "./type-hints.js";
|
|
8
|
-
export interface CodeModeManagerOptions extends ExecutorOptions {
|
|
9
|
-
/** Log function for status messages. */
|
|
10
|
-
log?: (msg: string) => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Orchestrates code mode: discovers eligible tools, generates type hints,
|
|
14
|
-
* and executes model-generated code in a sandbox with tool dispatch.
|
|
15
|
-
*/
|
|
16
|
-
export declare class CodeModeManager {
|
|
17
|
-
private mcpManager;
|
|
18
|
-
private eligibleTools;
|
|
19
|
-
private typeHints;
|
|
20
|
-
private options;
|
|
21
|
-
constructor(options?: CodeModeManagerOptions);
|
|
22
|
-
/** Initialize with MCP manager, discover eligible tools, generate type hints. */
|
|
23
|
-
initialize(mcpManager: McpClientManager): void;
|
|
24
|
-
/** Refresh eligible tools and type hints (call on tools/list_changed). */
|
|
25
|
-
refresh(): void;
|
|
26
|
-
/** Get the type hints string for injection into system prompt. */
|
|
27
|
-
getTypeHints(): string;
|
|
28
|
-
/** Get eligible tools. */
|
|
29
|
-
getEligibleTools(): McpTool[];
|
|
30
|
-
/** Whether code mode has any eligible tools. */
|
|
31
|
-
get isActive(): boolean;
|
|
32
|
-
/** Execute code in search mode (tool catalog queries). */
|
|
33
|
-
searchTools(code: string): Promise<ExecuteResult>;
|
|
34
|
-
/** Execute code that chains MCP tool calls. */
|
|
35
|
-
executeCode(code: string): Promise<ExecuteResult>;
|
|
36
|
-
/** Create the Pi tool definitions for code_search and code_execute. */
|
|
37
|
-
createTools(): {
|
|
38
|
-
codeSearch: {
|
|
39
|
-
name: string;
|
|
40
|
-
label: string;
|
|
41
|
-
description: string;
|
|
42
|
-
parameters: import("typebox").TObject<{
|
|
43
|
-
code: import("typebox").TString;
|
|
44
|
-
}>;
|
|
45
|
-
execute(_toolCallId: string, params: {
|
|
46
|
-
code: string;
|
|
47
|
-
}, _signal: AbortSignal | undefined, _onUpdate: undefined, _ctx: import("@sammorrowdrums/mcpi").ExtensionContext): Promise<import("@sammorrowdrums/mcpi-agent").AgentToolResult<import("./tools.js").CodeModeToolDetails>>;
|
|
48
|
-
};
|
|
49
|
-
codeExecute: {
|
|
50
|
-
name: string;
|
|
51
|
-
label: string;
|
|
52
|
-
description: string;
|
|
53
|
-
parameters: import("typebox").TObject<{
|
|
54
|
-
code: import("typebox").TString;
|
|
55
|
-
}>;
|
|
56
|
-
execute(_toolCallId: string, params: {
|
|
57
|
-
code: string;
|
|
58
|
-
}, _signal: AbortSignal | undefined, _onUpdate: undefined, _ctx: import("@sammorrowdrums/mcpi").ExtensionContext): Promise<import("@sammorrowdrums/mcpi-agent").AgentToolResult<import("./tools.js").CodeModeToolDetails>>;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
/** Format a system prompt section for code mode. */
|
|
62
|
-
formatSystemPromptSection(): string;
|
|
63
|
-
private execute;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-mode/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKpE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,wCAAwC;IACxC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,GAAE,sBAA2B;IAIhD,iFAAiF;IACjF,UAAU,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI;IAK9C,0EAA0E;IAC1E,OAAO,IAAI,IAAI;IASf,kEAAkE;IAClE,YAAY,IAAI,MAAM;IAItB,0BAA0B;IAC1B,gBAAgB,IAAI,OAAO,EAAE;IAI7B,gDAAgD;IAChD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,0DAA0D;IACpD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvD,+CAA+C;IACzC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAIvD,uEAAuE;IACvE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;IAOX,oDAAoD;IACpD,yBAAyB,IAAI,MAAM;YAwErB,OAAO;CAqDtB"}
|
package/dist/code-mode/index.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { getEligibleTools } from "./eligibility.js";
|
|
2
|
-
import { executeInSandbox } from "./executor.js";
|
|
3
|
-
import { createCodeExecuteTool, createCodeSearchTool } from "./tools.js";
|
|
4
|
-
import { generateTypeHints } from "./type-hints.js";
|
|
5
|
-
export { getEligibleTools, isEligibleForCodeMode } from "./eligibility.js";
|
|
6
|
-
export { executeInSandbox, normalizeCode } from "./executor.js";
|
|
7
|
-
export { createCodeExecuteTool, createCodeSearchTool } from "./tools.js";
|
|
8
|
-
export { generateTypeHints, jsonSchemaToTypeString, sanitizeToolName } from "./type-hints.js";
|
|
9
|
-
/**
|
|
10
|
-
* Orchestrates code mode: discovers eligible tools, generates type hints,
|
|
11
|
-
* and executes model-generated code in a sandbox with tool dispatch.
|
|
12
|
-
*/
|
|
13
|
-
export class CodeModeManager {
|
|
14
|
-
mcpManager = null;
|
|
15
|
-
eligibleTools = [];
|
|
16
|
-
typeHints = "";
|
|
17
|
-
options;
|
|
18
|
-
constructor(options = {}) {
|
|
19
|
-
this.options = options;
|
|
20
|
-
}
|
|
21
|
-
/** Initialize with MCP manager, discover eligible tools, generate type hints. */
|
|
22
|
-
initialize(mcpManager) {
|
|
23
|
-
this.mcpManager = mcpManager;
|
|
24
|
-
this.refresh();
|
|
25
|
-
}
|
|
26
|
-
/** Refresh eligible tools and type hints (call on tools/list_changed). */
|
|
27
|
-
refresh() {
|
|
28
|
-
if (!this.mcpManager)
|
|
29
|
-
return;
|
|
30
|
-
this.eligibleTools = getEligibleTools(this.mcpManager);
|
|
31
|
-
this.typeHints = generateTypeHints(this.eligibleTools);
|
|
32
|
-
this.options.log?.(`[code-mode] ${this.eligibleTools.length} eligible tool(s), ${this.typeHints.length} chars of type hints`);
|
|
33
|
-
}
|
|
34
|
-
/** Get the type hints string for injection into system prompt. */
|
|
35
|
-
getTypeHints() {
|
|
36
|
-
return this.typeHints;
|
|
37
|
-
}
|
|
38
|
-
/** Get eligible tools. */
|
|
39
|
-
getEligibleTools() {
|
|
40
|
-
return this.eligibleTools;
|
|
41
|
-
}
|
|
42
|
-
/** Whether code mode has any eligible tools. */
|
|
43
|
-
get isActive() {
|
|
44
|
-
return this.eligibleTools.length > 0;
|
|
45
|
-
}
|
|
46
|
-
/** Execute code in search mode (tool catalog queries). */
|
|
47
|
-
async searchTools(code) {
|
|
48
|
-
return this.execute(code);
|
|
49
|
-
}
|
|
50
|
-
/** Execute code that chains MCP tool calls. */
|
|
51
|
-
async executeCode(code) {
|
|
52
|
-
return this.execute(code);
|
|
53
|
-
}
|
|
54
|
-
/** Create the Pi tool definitions for code_search and code_execute. */
|
|
55
|
-
createTools() {
|
|
56
|
-
return {
|
|
57
|
-
codeSearch: createCodeSearchTool(this),
|
|
58
|
-
codeExecute: createCodeExecuteTool(this),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/** Format a system prompt section for code mode. */
|
|
62
|
-
formatSystemPromptSection() {
|
|
63
|
-
if (!this.isActive)
|
|
64
|
-
return "";
|
|
65
|
-
return [
|
|
66
|
-
"",
|
|
67
|
-
"<code_mode>",
|
|
68
|
-
"## Code mode",
|
|
69
|
-
"",
|
|
70
|
-
"`code_execute` runs vanilla JavaScript in a sandboxed V8 isolate. Use it for:",
|
|
71
|
-
"",
|
|
72
|
-
"1. **Arbitrary computation** — math, string manipulation, date arithmetic, data transformation,",
|
|
73
|
-
" or any calculation the user asks for. No MCP tools needed; plain JS works.",
|
|
74
|
-
"2. **Multi-tool aggregation** — counting, filtering, trending, or transforming results across",
|
|
75
|
-
" many tool calls. Write a loop inside one `code_execute` instead of making many separate tool calls.",
|
|
76
|
-
"3. **Pagination** — fetch batches in a loop until exhausted, then compute over the full dataset.",
|
|
77
|
-
"",
|
|
78
|
-
"Use `code_search` first to discover what tools are available before writing execution code.",
|
|
79
|
-
"",
|
|
80
|
-
"**Code mode tools are always available — you do not need to call `load_skill` first.**",
|
|
81
|
-
"",
|
|
82
|
-
"### Choosing the right approach",
|
|
83
|
-
"",
|
|
84
|
-
"- **Skill** (`load_skill`) — a curated workflow exists for this domain task (e.g., a GitHub skill for PR management).",
|
|
85
|
-
"- **tool-cli** — you need to discover what tools exist, or make a quick ad-hoc tool call.",
|
|
86
|
-
"- **Code mode** (`code_execute`) — you need computation: math, aggregation, looping over results,",
|
|
87
|
-
" data transformation, or chaining multiple tool calls with logic in between.",
|
|
88
|
-
"",
|
|
89
|
-
"Pick based on what the task needs, not a fixed order. A calculation goes straight to code mode;",
|
|
90
|
-
"a single lookup goes to a skill or tool-cli; exploration starts with tool-cli or `code_search`.",
|
|
91
|
-
"",
|
|
92
|
-
"**If unsure what's available**, start with `code_search` or `tool-cli --help` to see what you have.",
|
|
93
|
-
"After producing a result, verify it makes sense — run a quick sanity check or spot-check values.",
|
|
94
|
-
"",
|
|
95
|
-
"### How to write code",
|
|
96
|
-
"",
|
|
97
|
-
"Write vanilla JavaScript (not TypeScript, not Node.js). No `require`, `import`, `fetch`,",
|
|
98
|
-
"`fs`, `process`, or any Node.js/browser APIs. The only external API is the `codemode` namespace",
|
|
99
|
-
"for MCP tool calls (optional — pure computation works without it). Always `return` the final result.",
|
|
100
|
-
"",
|
|
101
|
-
"**Write ONE `code_execute` call that does the whole job.** Loops, comparisons, pagination,",
|
|
102
|
-
"and aggregation all happen inside a single execution.",
|
|
103
|
-
"",
|
|
104
|
-
"```javascript",
|
|
105
|
-
"// Pure computation — no tools needed",
|
|
106
|
-
"const factorial = (n) => n <= 1 ? 1 : n * factorial(n - 1);",
|
|
107
|
-
"return { result: factorial(20), formatted: factorial(20).toLocaleString() };",
|
|
108
|
-
"```",
|
|
109
|
-
"",
|
|
110
|
-
"```javascript",
|
|
111
|
-
"// Aggregate across paginated MCP tool results",
|
|
112
|
-
"const counts = {};",
|
|
113
|
-
"let page = 1;",
|
|
114
|
-
"while (true) {",
|
|
115
|
-
" const result = await codemode.list_items({ page, perPage: 100 });",
|
|
116
|
-
" for (const item of result.items) {",
|
|
117
|
-
" counts[item.category] = (counts[item.category] || 0) + 1;",
|
|
118
|
-
" }",
|
|
119
|
-
" if (result.items.length < 100) break;",
|
|
120
|
-
" page++;",
|
|
121
|
-
"}",
|
|
122
|
-
"return counts;",
|
|
123
|
-
"```",
|
|
124
|
-
"",
|
|
125
|
-
"### Available tools",
|
|
126
|
-
"",
|
|
127
|
-
"```typescript",
|
|
128
|
-
this.typeHints,
|
|
129
|
-
"```",
|
|
130
|
-
"</code_mode>",
|
|
131
|
-
].join("\n");
|
|
132
|
-
}
|
|
133
|
-
async execute(code) {
|
|
134
|
-
if (!this.mcpManager) {
|
|
135
|
-
return { result: undefined, error: "Code mode not initialized", logs: [] };
|
|
136
|
-
}
|
|
137
|
-
// Refresh eligible tools in case MCP servers changed since initialization
|
|
138
|
-
this.refresh();
|
|
139
|
-
const toolNames = this.eligibleTools.map((t) => t.name);
|
|
140
|
-
const dispatch = async (toolName, args) => {
|
|
141
|
-
const tool = this.eligibleTools.find((t) => t.name === toolName);
|
|
142
|
-
if (!tool) {
|
|
143
|
-
throw new Error(`Tool "${toolName}" not found in code mode eligible tools`);
|
|
144
|
-
}
|
|
145
|
-
const client = this.mcpManager?.getClient(tool.serverName);
|
|
146
|
-
if (!client) {
|
|
147
|
-
throw new Error(`MCP server "${tool.serverName}" is not connected`);
|
|
148
|
-
}
|
|
149
|
-
const result = await client.callTool({ name: toolName, arguments: args });
|
|
150
|
-
// Prefer structuredContent (typed output) over raw content
|
|
151
|
-
if (result.structuredContent) {
|
|
152
|
-
return result.structuredContent;
|
|
153
|
-
}
|
|
154
|
-
// Fall back to parsing text content
|
|
155
|
-
if (Array.isArray(result.content)) {
|
|
156
|
-
const textParts = result.content
|
|
157
|
-
.filter((c) => typeof c === "object" && c !== null && "text" in c)
|
|
158
|
-
.map((c) => c.text);
|
|
159
|
-
const combined = textParts.join("\n");
|
|
160
|
-
try {
|
|
161
|
-
return JSON.parse(combined);
|
|
162
|
-
}
|
|
163
|
-
catch {
|
|
164
|
-
return combined;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return result;
|
|
168
|
-
};
|
|
169
|
-
return executeInSandbox(code, toolNames, dispatch, {
|
|
170
|
-
memoryLimit: this.options.memoryLimit,
|
|
171
|
-
timeoutMs: this.options.timeoutMs,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-mode/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAO9F;;;GAGG;AACH,MAAM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AAQ,IAAI,CAAC,KAAK,IAAI,IAAI,MAAM,IAAI,CAAC,CACrD;qBACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBAEtB,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,CAAC;oBACH,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC9B,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,QAAQ,CAAC;gBAClB,CAAC;YACH,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE;YACjD,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW;YACrC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;SAClC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { AgentToolResult, ExtensionContext } from "@sammorrowdrums/mcpi";
|
|
2
|
-
import { Type, type Static } from "typebox";
|
|
3
|
-
import type { CodeModeManager } from "./index.js";
|
|
4
|
-
declare const CodeInput: Type.TObject<{
|
|
5
|
-
code: Type.TString;
|
|
6
|
-
}>;
|
|
7
|
-
type CodeInputType = Static<typeof CodeInput>;
|
|
8
|
-
export interface CodeModeToolDetails {
|
|
9
|
-
executionMs: number;
|
|
10
|
-
logs: string[];
|
|
11
|
-
error?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Create the `code_search` tool for querying the tool catalog.
|
|
15
|
-
*
|
|
16
|
-
* The model writes JavaScript to discover and filter available tools.
|
|
17
|
-
* The sandbox provides `codemode.listTools()` and `codemode.describeTools(names)`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createCodeSearchTool(manager: CodeModeManager): {
|
|
20
|
-
name: string;
|
|
21
|
-
label: string;
|
|
22
|
-
description: string;
|
|
23
|
-
parameters: Type.TObject<{
|
|
24
|
-
code: Type.TString;
|
|
25
|
-
}>;
|
|
26
|
-
execute(_toolCallId: string, params: CodeInputType, _signal: AbortSignal | undefined, _onUpdate: undefined, _ctx: ExtensionContext): Promise<AgentToolResult<CodeModeToolDetails>>;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Create the `code_execute` tool for chaining tool calls.
|
|
30
|
-
*
|
|
31
|
-
* The model writes JavaScript that calls read-only MCP tools via
|
|
32
|
-
* the `codemode` namespace (e.g. `codemode.search_docs({ query: 'test' })`).
|
|
33
|
-
* Code runs in a sandbox with no access to filesystem, network, or Node.js APIs.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createCodeExecuteTool(manager: CodeModeManager): {
|
|
36
|
-
name: string;
|
|
37
|
-
label: string;
|
|
38
|
-
description: string;
|
|
39
|
-
parameters: Type.TObject<{
|
|
40
|
-
code: Type.TString;
|
|
41
|
-
}>;
|
|
42
|
-
execute(_toolCallId: string, params: CodeInputType, _signal: AbortSignal | undefined, _onUpdate: undefined, _ctx: ExtensionContext): Promise<AgentToolResult<CodeModeToolDetails>>;
|
|
43
|
-
};
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/code-mode/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,QAAA,MAAM,SAAS;;EAKb,CAAC;AAEH,KAAK,aAAa,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoCD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe;;;;;;;yBAS1C,MAAM,UACX,aAAa,WACZ,WAAW,GAAG,SAAS,aACrB,SAAS,QACd,gBAAgB,GACrB,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;EAMnD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,eAAe;;;;;;;yBAS3C,MAAM,UACX,aAAa,WACZ,WAAW,GAAG,SAAS,aACrB,SAAS,QACd,gBAAgB,GACrB,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;EAMnD"}
|
package/dist/code-mode/tools.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
const CodeInput = Type.Object({
|
|
3
|
-
code: Type.String({
|
|
4
|
-
description: "JavaScript code to execute. Use the `codemode` namespace to call tools (e.g. `codemode.search_docs({ query: 'test' })`). Always `return` your final result. Code runs in a sandbox with no access to filesystem, network, or Node.js APIs.",
|
|
5
|
-
}),
|
|
6
|
-
});
|
|
7
|
-
/** Format an ExecuteResult into a tool response. Falls back to logs if result is undefined. */
|
|
8
|
-
function formatResult(result, executionMs, errorPrefix) {
|
|
9
|
-
if (result.error) {
|
|
10
|
-
return {
|
|
11
|
-
content: [{ type: "text", text: `${errorPrefix}: ${result.error}` }],
|
|
12
|
-
details: { executionMs, logs: result.logs, error: result.error },
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
// If code didn't return a value, fall back to captured console output
|
|
16
|
-
const output = result.result !== undefined && result.result !== null
|
|
17
|
-
? typeof result.result === "string"
|
|
18
|
-
? result.result
|
|
19
|
-
: JSON.stringify(result.result, null, 2)
|
|
20
|
-
: result.logs.length > 0
|
|
21
|
-
? result.logs.join("\n")
|
|
22
|
-
: "(no return value)";
|
|
23
|
-
const logsSection = result.result !== undefined && result.logs.length > 0
|
|
24
|
-
? `\n\nLogs:\n${result.logs.join("\n")}`
|
|
25
|
-
: "";
|
|
26
|
-
return {
|
|
27
|
-
content: [{ type: "text", text: output + logsSection }],
|
|
28
|
-
details: { executionMs, logs: result.logs },
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create the `code_search` tool for querying the tool catalog.
|
|
33
|
-
*
|
|
34
|
-
* The model writes JavaScript to discover and filter available tools.
|
|
35
|
-
* The sandbox provides `codemode.listTools()` and `codemode.describeTools(names)`.
|
|
36
|
-
*/
|
|
37
|
-
export function createCodeSearchTool(manager) {
|
|
38
|
-
return {
|
|
39
|
-
name: "code_search",
|
|
40
|
-
label: "Code Search",
|
|
41
|
-
description: "Discover available read-only MCP tools by writing JavaScript. Use `codemode.listTools()` to list tools and `codemode.describeTools(names)` for type info. Use this before code_execute to understand what data sources are available.",
|
|
42
|
-
parameters: CodeInput,
|
|
43
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
44
|
-
const start = performance.now();
|
|
45
|
-
const result = await manager.searchTools(params.code);
|
|
46
|
-
return formatResult(result, Math.round(performance.now() - start), "Code search error");
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Create the `code_execute` tool for chaining tool calls.
|
|
52
|
-
*
|
|
53
|
-
* The model writes JavaScript that calls read-only MCP tools via
|
|
54
|
-
* the `codemode` namespace (e.g. `codemode.search_docs({ query: 'test' })`).
|
|
55
|
-
* Code runs in a sandbox with no access to filesystem, network, or Node.js APIs.
|
|
56
|
-
*/
|
|
57
|
-
export function createCodeExecuteTool(manager) {
|
|
58
|
-
return {
|
|
59
|
-
name: "code_execute",
|
|
60
|
-
label: "Code Execute",
|
|
61
|
-
description: "Execute JavaScript that chains read-only MCP tool calls for computation over data. Use when you need to aggregate, filter, loop, or transform results across multiple tool calls. Access tools via `codemode.toolName(args)`. Runs in a sandbox — no filesystem, network, or Node.js API access.",
|
|
62
|
-
parameters: CodeInput,
|
|
63
|
-
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
64
|
-
const start = performance.now();
|
|
65
|
-
const result = await manager.executeCode(params.code);
|
|
66
|
-
return formatResult(result, Math.round(performance.now() - start), "Code execution error");
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/code-mode/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAI5C,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QAChB,WAAW,EACT,4OAA4O;KAC/O,CAAC;CACH,CAAC,CAAC;AAUH,+FAA+F;AAC/F,SAAS,YAAY,CACnB,MAAqB,EACrB,WAAmB,EACnB,WAAmB;IAEnB,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,KAAK,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YACpE,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;SACjE,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,MAAM,MAAM,GACV,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QACnD,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;YACjC,CAAC,CAAC,MAAM,CAAC,MAAM;YACf,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM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C5D,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,kSAAkS;QACpS,UAAU,EAAE,SAAS;QAErB,KAAK,CAAC,OAAO,CACX,WAAmB,EACnB,MAAqB,EACrB,OAAgC,EAChC,SAAoB,EACpB,IAAsB;YAEtB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACtD,OAAO,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE,sBAAsB,CAAC,CAAC;QAC7F,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { McpTool } from "../mcp/index.js";
|
|
2
|
-
type JsonSchema = Record<string, unknown>;
|
|
3
|
-
/**
|
|
4
|
-
* Convert a JSON Schema to a TypeScript type string.
|
|
5
|
-
*
|
|
6
|
-
* Handles objects, arrays, primitives, enums, anyOf/oneOf/allOf, $ref,
|
|
7
|
-
* and circular references (depth guard at 20).
|
|
8
|
-
*/
|
|
9
|
-
export declare function jsonSchemaToTypeString(schema: JsonSchema, definitions?: Record<string, JsonSchema>, depth?: number, seen?: Set<JsonSchema>): string;
|
|
10
|
-
/** Sanitize a tool name to be a valid JS identifier. */
|
|
11
|
-
export declare function sanitizeToolName(name: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Generate TypeScript type declarations for a set of MCP tools.
|
|
14
|
-
*
|
|
15
|
-
* Produces a `declare const codemode: { ... }` block with type-safe
|
|
16
|
-
* method signatures the model can use when writing code.
|
|
17
|
-
*/
|
|
18
|
-
export declare function generateTypeHints(tools: McpTool[]): string;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=type-hints.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-hints.d.ts","sourceRoot":"","sources":["../../src/code-mode/type-hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,KAAK,SAAI,EACT,IAAI,kBAAwB,GAC3B,MAAM,CAqER;AAyED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAwC1D"}
|