@frontmcp/plugin-codecall 1.5.6 → 1.6.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/README.md +1 -1
- package/codecall.symbol.d.ts +19 -6
- package/codecall.symbol.d.ts.map +1 -1
- package/esm/index.mjs +18 -5
- package/esm/package.json +6 -6
- package/index.js +18 -5
- package/package.json +6 -6
- package/tools/execute.tool.d.ts.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.d.ts.map +1 -1
- package/utils/mcp-result.d.ts.map +1 -1
- package/utils/plain-json.d.ts +11 -0
- package/utils/plain-json.d.ts.map +1 -0
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @frontmcp/plugin-codecall @frontmcp/plugin-cache
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import { CodeCallPlugin } from '@frontmcp/plugin-codecall';
|
|
17
16
|
import { CachePlugin } from '@frontmcp/plugin-cache';
|
|
17
|
+
import { CodeCallPlugin } from '@frontmcp/plugin-codecall';
|
|
18
18
|
import { FrontMcp } from '@frontmcp/sdk';
|
|
19
19
|
|
|
20
20
|
const app = new FrontMcp({
|
package/codecall.symbol.d.ts
CHANGED
|
@@ -38,6 +38,17 @@ export interface ResolvedCodeCallVmOptions {
|
|
|
38
38
|
maxSanitizeDepth: number;
|
|
39
39
|
maxSanitizeProperties: number;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* A tool's public description as handed to sandboxed scripts. Schemas are plain JSON Schema
|
|
43
|
+
* documents, never the registry's declared schema objects, and are `null` when the tool has
|
|
44
|
+
* no schema to advertise.
|
|
45
|
+
*/
|
|
46
|
+
export interface CodeCallToolDescription {
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
inputSchema: Record<string, unknown> | null;
|
|
50
|
+
outputSchema: Record<string, unknown> | null;
|
|
51
|
+
}
|
|
41
52
|
/**
|
|
42
53
|
* Environment available to code running inside the VM.
|
|
43
54
|
* The plugin is responsible for wiring this to the underlying tool pipeline.
|
|
@@ -58,12 +69,14 @@ export interface CodeCallVmEnvironment {
|
|
|
58
69
|
* - Security guard errors (self-reference, access control) are NEVER catchable
|
|
59
70
|
*/
|
|
60
71
|
callTool: <TInput, TResult>(name: string, input: TInput, options?: CallToolOptions) => Promise<TResult | ToolCallResult<TResult>>;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Look up a tool's public description.
|
|
74
|
+
*
|
|
75
|
+
* Returns `undefined` when the tool is unknown, is a CodeCall meta-tool, falls outside the
|
|
76
|
+
* script's `allowedTools` whitelist, or when its schemas have no plain JSON form (a circular
|
|
77
|
+
* schema, for example) — callers cannot distinguish "not visible" from "not projectable".
|
|
78
|
+
*/
|
|
79
|
+
getTool: (name: string) => CodeCallToolDescription | undefined;
|
|
67
80
|
console?: Console;
|
|
68
81
|
mcpLog?: (level: 'debug' | 'info' | 'warn' | 'error', message: string, metadata?: Record<string, unknown>) => void;
|
|
69
82
|
mcpNotify?: (event: string, payload: Record<string, unknown>) => void;
|
package/codecall.symbol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecall.symbol.d.ts","sourceRoot":"","sources":["../src/codecall.symbol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,sBAAsB,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,YAAY,CAAC;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;I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E,CAAC,CAAC;IAEhF;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEnC;;OAEG;IACH,aAAa,IAAI,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
package/esm/index.mjs
CHANGED
|
@@ -2289,6 +2289,17 @@ function generateSmartExample(toolName, inputSchema, description) {
|
|
|
2289
2289
|
}
|
|
2290
2290
|
}
|
|
2291
2291
|
|
|
2292
|
+
// plugins/plugin-codecall/src/utils/plain-json.ts
|
|
2293
|
+
function toPlainJson(value) {
|
|
2294
|
+
try {
|
|
2295
|
+
const serialized = JSON.stringify(value);
|
|
2296
|
+
if (serialized === void 0) return void 0;
|
|
2297
|
+
return JSON.parse(serialized);
|
|
2298
|
+
} catch {
|
|
2299
|
+
return void 0;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2292
2303
|
// plugins/plugin-codecall/src/utils/mcp-result.ts
|
|
2293
2304
|
function extractResultFromCallToolResult(mcpResult) {
|
|
2294
2305
|
if (mcpResult.isError) {
|
|
@@ -2309,7 +2320,7 @@ function extractResultFromCallToolResult(mcpResult) {
|
|
|
2309
2320
|
return content[0].text;
|
|
2310
2321
|
}
|
|
2311
2322
|
}
|
|
2312
|
-
return content;
|
|
2323
|
+
return toPlainJson(content);
|
|
2313
2324
|
}
|
|
2314
2325
|
|
|
2315
2326
|
// plugins/plugin-codecall/src/tools/describe.schema.ts
|
|
@@ -2701,15 +2712,17 @@ var ExecuteTool = class extends ToolContext5 {
|
|
|
2701
2712
|
},
|
|
2702
2713
|
getTool: (name) => {
|
|
2703
2714
|
try {
|
|
2715
|
+
if (isBlockedSelfReference(name)) return void 0;
|
|
2716
|
+
if (allowedToolSet && !allowedToolSet.has(name)) return void 0;
|
|
2704
2717
|
const tools = this.scope.tools.getTools(true);
|
|
2705
2718
|
const tool = tools.find((t) => t.name === name || t.fullName === name);
|
|
2706
2719
|
if (!tool) return void 0;
|
|
2707
|
-
return {
|
|
2720
|
+
return toPlainJson({
|
|
2708
2721
|
name: tool.name,
|
|
2709
2722
|
description: tool.metadata?.description,
|
|
2710
|
-
inputSchema: tool.
|
|
2711
|
-
outputSchema: tool.
|
|
2712
|
-
};
|
|
2723
|
+
inputSchema: tool.getInputJsonSchema?.() ?? null,
|
|
2724
|
+
outputSchema: tool.getOutputJsonSchema?.() ?? null
|
|
2725
|
+
});
|
|
2713
2726
|
} catch {
|
|
2714
2727
|
return void 0;
|
|
2715
2728
|
}
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-codecall",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "CodeCall plugin for FrontMCP - AgentScript-based meta-tools for orchestrating MCP tools",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@enclave-vm/core": "^2.15.
|
|
52
|
-
"@frontmcp/protocol": "1.
|
|
53
|
-
"@frontmcp/sdk": "1.
|
|
51
|
+
"@enclave-vm/core": "^2.15.1",
|
|
52
|
+
"@frontmcp/protocol": "1.6.0",
|
|
53
|
+
"@frontmcp/sdk": "1.6.0",
|
|
54
54
|
"vectoriadb": "^2.3.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@frontmcp/lazy-zod": "1.
|
|
58
|
-
"@frontmcp/plugin-cache": "1.
|
|
57
|
+
"@frontmcp/lazy-zod": "1.6.0",
|
|
58
|
+
"@frontmcp/plugin-cache": "1.6.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"reflect-metadata": "^0.2.2"
|
package/index.js
CHANGED
|
@@ -2326,6 +2326,17 @@ function generateSmartExample(toolName, inputSchema, description) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
|
|
2329
|
+
// plugins/plugin-codecall/src/utils/plain-json.ts
|
|
2330
|
+
function toPlainJson(value) {
|
|
2331
|
+
try {
|
|
2332
|
+
const serialized = JSON.stringify(value);
|
|
2333
|
+
if (serialized === void 0) return void 0;
|
|
2334
|
+
return JSON.parse(serialized);
|
|
2335
|
+
} catch {
|
|
2336
|
+
return void 0;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2329
2340
|
// plugins/plugin-codecall/src/utils/mcp-result.ts
|
|
2330
2341
|
function extractResultFromCallToolResult(mcpResult) {
|
|
2331
2342
|
if (mcpResult.isError) {
|
|
@@ -2346,7 +2357,7 @@ function extractResultFromCallToolResult(mcpResult) {
|
|
|
2346
2357
|
return content[0].text;
|
|
2347
2358
|
}
|
|
2348
2359
|
}
|
|
2349
|
-
return content;
|
|
2360
|
+
return toPlainJson(content);
|
|
2350
2361
|
}
|
|
2351
2362
|
|
|
2352
2363
|
// plugins/plugin-codecall/src/tools/describe.schema.ts
|
|
@@ -2738,15 +2749,17 @@ var ExecuteTool = class extends import_sdk7.ToolContext {
|
|
|
2738
2749
|
},
|
|
2739
2750
|
getTool: (name) => {
|
|
2740
2751
|
try {
|
|
2752
|
+
if (isBlockedSelfReference(name)) return void 0;
|
|
2753
|
+
if (allowedToolSet && !allowedToolSet.has(name)) return void 0;
|
|
2741
2754
|
const tools = this.scope.tools.getTools(true);
|
|
2742
2755
|
const tool = tools.find((t) => t.name === name || t.fullName === name);
|
|
2743
2756
|
if (!tool) return void 0;
|
|
2744
|
-
return {
|
|
2757
|
+
return toPlainJson({
|
|
2745
2758
|
name: tool.name,
|
|
2746
2759
|
description: tool.metadata?.description,
|
|
2747
|
-
inputSchema: tool.
|
|
2748
|
-
outputSchema: tool.
|
|
2749
|
-
};
|
|
2760
|
+
inputSchema: tool.getInputJsonSchema?.() ?? null,
|
|
2761
|
+
outputSchema: tool.getOutputJsonSchema?.() ?? null
|
|
2762
|
+
});
|
|
2750
2763
|
} catch {
|
|
2751
2764
|
return void 0;
|
|
2752
2765
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-codecall",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "CodeCall plugin for FrontMCP - AgentScript-based meta-tools for orchestrating MCP tools",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@enclave-vm/core": "^2.15.
|
|
52
|
-
"@frontmcp/protocol": "1.
|
|
53
|
-
"@frontmcp/sdk": "1.
|
|
51
|
+
"@enclave-vm/core": "^2.15.1",
|
|
52
|
+
"@frontmcp/protocol": "1.6.0",
|
|
53
|
+
"@frontmcp/sdk": "1.6.0",
|
|
54
54
|
"vectoriadb": "^2.3.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@frontmcp/lazy-zod": "1.
|
|
58
|
-
"@frontmcp/plugin-cache": "1.
|
|
57
|
+
"@frontmcp/lazy-zod": "1.6.0",
|
|
58
|
+
"@frontmcp/plugin-cache": "1.6.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"reflect-metadata": "^0.2.2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.tool.d.ts","sourceRoot":"","sources":["../../src/tools/execute.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAclD,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAyC1B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAC5C,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.tool.d.ts","sourceRoot":"","sources":["../../src/tools/execute.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAclD,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAyC1B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAC5C,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAqPvE"}
|
package/utils/index.d.ts
CHANGED
package/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-result.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-result.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-result.d.ts","sourceRoot":"","sources":["../../src/utils/mcp-result.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CA6BlF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize a value into a fresh, plain JSON structure.
|
|
3
|
+
*
|
|
4
|
+
* The result is a JSON projection, not a copy: prototypes, methods, `undefined` members and
|
|
5
|
+
* anything else without a JSON form are gone, and Dates become strings. Callers therefore
|
|
6
|
+
* name the shape they expect (`toPlainJson<MyShape>(value)`) rather than inheriting the
|
|
7
|
+
* input's type, which would over-promise. Returns `undefined` when the value has no JSON
|
|
8
|
+
* representation at all.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toPlainJson<T = unknown>(value: unknown): T | undefined;
|
|
11
|
+
//# sourceMappingURL=plain-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain-json.d.ts","sourceRoot":"","sources":["../../src/utils/plain-json.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS,CAQtE"}
|