@frontmcp/plugin-codecall 1.9.3 → 1.9.5
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 +5 -0
- package/codecall.symbol.d.ts +2 -0
- package/codecall.symbol.d.ts.map +1 -1
- package/codecall.types.d.ts +6 -0
- package/codecall.types.d.ts.map +1 -1
- package/errors/tool-call.errors.d.ts +1 -0
- package/errors/tool-call.errors.d.ts.map +1 -1
- package/esm/index.mjs +134 -46
- package/esm/package.json +6 -6
- package/index.js +134 -46
- package/package.json +6 -6
- package/providers/code-call.config.d.ts +2 -0
- package/providers/code-call.config.d.ts.map +1 -1
- package/services/enclave.service.d.ts.map +1 -1
- package/services/tool-search.service.d.ts +16 -1
- package/services/tool-search.service.d.ts.map +1 -1
- package/tools/execute.schema.d.ts.map +1 -1
- package/tools/execute.tool.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,11 @@ const app = new FrontMcp({
|
|
|
54
54
|
});
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## Limits
|
|
58
|
+
|
|
59
|
+
- **Calls to one tool**: more than `vm.rapidEnumerationThreshold` calls (default 30) to one tool within about 2 seconds stop the script with `[RAPID_ENUMERATION]`; calls made through `parallel()` count. Set per-tool values with `vm.rapidEnumerationOverrides` (`{ 'users:get': 100 }`). The sandbox's message says "in 5s", but it keeps only the last 2 seconds of calls.
|
|
60
|
+
- **Embedding model**: `embedding.strategy: 'ml'` downloads its model on first use. When the model can't be loaded or used (offline with nothing cached, `@huggingface/transformers` missing, or embedding the tools fails), CodeCall logs one warning and searches with TF-IDF. A tool whose metadata can't be read is skipped with a warning; the others stay searchable.
|
|
61
|
+
|
|
57
62
|
## Modes
|
|
58
63
|
|
|
59
64
|
- **codecall_only**: Hide all tools except CodeCall meta-tools
|
package/codecall.symbol.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface ResolvedCodeCallVmOptions {
|
|
|
37
37
|
allowConsole: boolean;
|
|
38
38
|
maxSanitizeDepth: number;
|
|
39
39
|
maxSanitizeProperties: number;
|
|
40
|
+
rapidEnumerationThreshold?: number;
|
|
41
|
+
rapidEnumerationOverrides?: Record<string, number>;
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* A tool's public description as handed to sandboxed scripts. Schemas are plain JSON Schema
|
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;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CAChE;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3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EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAEhF;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAErD;;OAEG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
package/codecall.types.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export declare const codeCallVmOptionsSchema: import("@frontmcp/lazy-zod").ZodDe
|
|
|
75
75
|
allowConsole: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
76
76
|
maxSanitizeDepth: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
77
77
|
maxSanitizeProperties: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
78
|
+
rapidEnumerationThreshold: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
79
|
+
rapidEnumerationOverrides: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber>>;
|
|
78
80
|
}, import("zod/v4/core").$strip>>;
|
|
79
81
|
export declare const codeCallDirectCallsOptionsSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
80
82
|
enabled: import("@frontmcp/lazy-zod").ZodBoolean;
|
|
@@ -166,6 +168,8 @@ declare const codeCallPluginOptionsObjectSchema: import("@frontmcp/lazy-zod").Zo
|
|
|
166
168
|
allowConsole: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
167
169
|
maxSanitizeDepth: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
168
170
|
maxSanitizeProperties: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
171
|
+
rapidEnumerationThreshold: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
172
|
+
rapidEnumerationOverrides: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber>>;
|
|
169
173
|
}, import("zod/v4/core").$strip>>;
|
|
170
174
|
embedding: import("zod").ZodPipe<import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
171
175
|
strategy: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodEnum<{
|
|
@@ -243,6 +247,8 @@ export declare const codeCallPluginOptionsSchema: import("zod").ZodPrefault<impo
|
|
|
243
247
|
allowConsole: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
244
248
|
maxSanitizeDepth: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
245
249
|
maxSanitizeProperties: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
250
|
+
rapidEnumerationThreshold: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
|
|
251
|
+
rapidEnumerationOverrides: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodNumber>>;
|
|
246
252
|
}, import("zod/v4/core").$strip>>;
|
|
247
253
|
embedding: import("zod").ZodPipe<import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodObject<{
|
|
248
254
|
strategy: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodEnum<{
|
package/codecall.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecall.types.d.ts","sourceRoot":"","sources":["../src/codecall.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAIvC;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM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,GAAG,IAAI,CAAC;QAC9B,QAAQ,CAAC,EAAE;YACT,KAAK,EAAE,OAAO,CAAC;YACf,MAAM,CAAC,EAAE,OAAO,CAAC;SAClB,EAAE,CAAC;KACL,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAIF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,0BAA0B;QAClC;;;WAGG;QACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;KACjC;CACF"}
|
|
@@ -8,6 +8,7 @@ export declare const TOOL_CALL_ERROR_CODES: {
|
|
|
8
8
|
readonly EXECUTION: "EXECUTION";
|
|
9
9
|
readonly TIMEOUT: "TIMEOUT";
|
|
10
10
|
readonly ACCESS_DENIED: "ACCESS_DENIED";
|
|
11
|
+
readonly RATE_LIMITED: "RATE_LIMITED";
|
|
11
12
|
readonly SELF_REFERENCE: "SELF_REFERENCE";
|
|
12
13
|
};
|
|
13
14
|
export type ToolCallErrorCode = (typeof TOOL_CALL_ERROR_CODES)[keyof typeof TOOL_CALL_ERROR_CODES];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call.errors.d.ts","sourceRoot":"","sources":["../../src/errors/tool-call.errors.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"tool-call.errors.d.ts","sourceRoot":"","sources":["../../src/errors/tool-call.errors.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;CAQxB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEnG;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QA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@default varies by preset (secure: 2000)
|
|
87
87
|
*/
|
|
88
|
-
maxSanitizeProperties: z.number().positive().optional()
|
|
88
|
+
maxSanitizeProperties: z.number().positive().optional(),
|
|
89
|
+
/**
|
|
90
|
+
* Calls a script may make to one tool within about 2 seconds; one more stops the script with
|
|
91
|
+
* `[RAPID_ENUMERATION]`. Calls made through `parallel()` count. The sandbox's message says "in 5s",
|
|
92
|
+
* but it keeps only the last 2 seconds of calls.
|
|
93
|
+
* @default 30
|
|
94
|
+
*/
|
|
95
|
+
rapidEnumerationThreshold: z.number().int().positive().optional(),
|
|
96
|
+
/**
|
|
97
|
+
* Per-tool values of `rapidEnumerationThreshold`, by tool name, e.g. `{ 'users:get': 100 }`.
|
|
98
|
+
*/
|
|
99
|
+
rapidEnumerationOverrides: z.record(z.string(), z.number().int().positive()).optional()
|
|
89
100
|
}).default(() => DEFAULT_VM_OPTIONS);
|
|
90
101
|
var codeCallDirectCallsOptionsSchema = z.object({
|
|
91
102
|
/**
|
|
@@ -300,6 +311,10 @@ var MAX_ITERATIONS_PER_LOOP = 1e4;
|
|
|
300
311
|
function maxToolCallsOf(vmOptions) {
|
|
301
312
|
return vmOptions.maxSteps || 100;
|
|
302
313
|
}
|
|
314
|
+
var SANDBOX_RAPID_ENUMERATION_THRESHOLD = 30;
|
|
315
|
+
function rapidEnumerationThresholdOf(vmOptions) {
|
|
316
|
+
return vmOptions.rapidEnumerationThreshold ?? SANDBOX_RAPID_ENUMERATION_THRESHOLD;
|
|
317
|
+
}
|
|
303
318
|
function resolveVmOptions(vmOptions) {
|
|
304
319
|
const preset = vmOptions?.preset ?? "secure";
|
|
305
320
|
const base = presetDefaults(preset);
|
|
@@ -608,6 +623,7 @@ var TOOL_CALL_ERROR_CODES = {
|
|
|
608
623
|
EXECUTION: "EXECUTION",
|
|
609
624
|
TIMEOUT: "TIMEOUT",
|
|
610
625
|
ACCESS_DENIED: "ACCESS_DENIED",
|
|
626
|
+
RATE_LIMITED: "RATE_LIMITED",
|
|
611
627
|
SELF_REFERENCE: "SELF_REFERENCE"
|
|
612
628
|
};
|
|
613
629
|
function createToolCallError(code, toolName, rawMessage) {
|
|
@@ -630,6 +646,8 @@ function getSanitizedMessage(code, toolName, rawMessage) {
|
|
|
630
646
|
return `Tool "${toolName}" execution timed out`;
|
|
631
647
|
case TOOL_CALL_ERROR_CODES.ACCESS_DENIED:
|
|
632
648
|
return `Access denied for tool "${toolName}"`;
|
|
649
|
+
case TOOL_CALL_ERROR_CODES.RATE_LIMITED:
|
|
650
|
+
return `Tool "${toolName}" was rate limited`;
|
|
633
651
|
case TOOL_CALL_ERROR_CODES.SELF_REFERENCE:
|
|
634
652
|
return `Cannot call CodeCall tools from within AgentScript`;
|
|
635
653
|
default:
|
|
@@ -1475,6 +1493,10 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
|
|
|
1475
1493
|
"ie",
|
|
1476
1494
|
"eg"
|
|
1477
1495
|
]);
|
|
1496
|
+
var DEFAULT_EMBEDDING_MODEL = "Xenova/all-MiniLM-L6-v2";
|
|
1497
|
+
function messageOf(error) {
|
|
1498
|
+
return error instanceof Error ? error.message : String(error);
|
|
1499
|
+
}
|
|
1478
1500
|
var ToolSearchService = class _ToolSearchService {
|
|
1479
1501
|
static MAX_SUBSCRIPTION_RETRIES = 100;
|
|
1480
1502
|
static INITIAL_RETRY_DELAY_MS = 10;
|
|
@@ -1487,6 +1509,9 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1487
1509
|
scope;
|
|
1488
1510
|
unsubscribe;
|
|
1489
1511
|
synonymService = null;
|
|
1512
|
+
synonymExpansion;
|
|
1513
|
+
/** The reindex in progress: later tool changes queue behind it and `search()` waits for it. */
|
|
1514
|
+
indexing;
|
|
1490
1515
|
// Subscription tracking for async initialization
|
|
1491
1516
|
subscriptionPromise;
|
|
1492
1517
|
subscriptionResolved = false;
|
|
@@ -1500,7 +1525,7 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1500
1525
|
this.scope = scope;
|
|
1501
1526
|
const embeddingOptions = config.embeddingOptions || {
|
|
1502
1527
|
strategy: "tfidf",
|
|
1503
|
-
modelName:
|
|
1528
|
+
modelName: DEFAULT_EMBEDDING_MODEL,
|
|
1504
1529
|
cacheDir: "./.cache/transformers",
|
|
1505
1530
|
useHNSW: false,
|
|
1506
1531
|
synonymExpansion: { enabled: true, replaceDefaults: false, maxExpansionsPerTerm: 5 }
|
|
@@ -1520,21 +1545,18 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1520
1545
|
}
|
|
1521
1546
|
if (this.strategy === "ml") {
|
|
1522
1547
|
this.vectorDB = new VectoriaDB({
|
|
1523
|
-
modelName: embeddingOptions.modelName ||
|
|
1548
|
+
modelName: embeddingOptions.modelName || DEFAULT_EMBEDDING_MODEL,
|
|
1524
1549
|
cacheDir: embeddingOptions.cacheDir || "./.cache/transformers",
|
|
1525
1550
|
defaultTopK: this.config.defaultTopK,
|
|
1526
1551
|
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold,
|
|
1527
1552
|
useHNSW: embeddingOptions.useHNSW || false
|
|
1528
1553
|
});
|
|
1529
1554
|
} else {
|
|
1530
|
-
this.vectorDB =
|
|
1531
|
-
defaultTopK: this.config.defaultTopK,
|
|
1532
|
-
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold
|
|
1533
|
-
});
|
|
1555
|
+
this.vectorDB = this.createTfidfIndex();
|
|
1534
1556
|
}
|
|
1535
|
-
|
|
1536
|
-
if (this.strategy === "tfidf"
|
|
1537
|
-
this.synonymService =
|
|
1557
|
+
this.synonymExpansion = config.synonymExpansion ?? embeddingOptions.synonymExpansion;
|
|
1558
|
+
if (this.strategy === "tfidf") {
|
|
1559
|
+
this.synonymService = this.createSynonymService();
|
|
1538
1560
|
}
|
|
1539
1561
|
this.subscriptionPromise = new Promise((resolve, reject) => {
|
|
1540
1562
|
this.subscriptionResolve = resolve;
|
|
@@ -1542,6 +1564,17 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1542
1564
|
});
|
|
1543
1565
|
this.setupSubscription();
|
|
1544
1566
|
}
|
|
1567
|
+
createTfidfIndex() {
|
|
1568
|
+
return new TFIDFVectoria({
|
|
1569
|
+
defaultTopK: this.config.defaultTopK,
|
|
1570
|
+
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
createSynonymService() {
|
|
1574
|
+
const synonymExpansion = this.synonymExpansion;
|
|
1575
|
+
if (synonymExpansion === false || synonymExpansion?.enabled === false) return null;
|
|
1576
|
+
return new SynonymExpansionService(synonymExpansion ?? {});
|
|
1577
|
+
}
|
|
1545
1578
|
/**
|
|
1546
1579
|
* Ensures the service is subscribed to tool changes before proceeding.
|
|
1547
1580
|
* Public methods should call this before accessing tools.
|
|
@@ -1582,10 +1615,21 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1582
1615
|
*/
|
|
1583
1616
|
subscribeToToolChanges() {
|
|
1584
1617
|
this.unsubscribe = this.scope.tools.subscribe({ immediate: true }, (event) => {
|
|
1585
|
-
this.
|
|
1618
|
+
this.queueReindex(event.snapshot);
|
|
1586
1619
|
});
|
|
1587
1620
|
this.markSubscribed();
|
|
1588
1621
|
}
|
|
1622
|
+
/** Reindex from `tools` once the reindex in progress (if any) is done; a failure is logged, never thrown. */
|
|
1623
|
+
queueReindex(tools) {
|
|
1624
|
+
const reindex = () => this.handleToolChange(tools);
|
|
1625
|
+
const run = (this.indexing ? this.indexing.then(reindex) : reindex()).catch((error) => {
|
|
1626
|
+
this.scope.logger.warn(`CodeCall tool search could not index the tools: ${messageOf(error)}`);
|
|
1627
|
+
});
|
|
1628
|
+
this.indexing = run;
|
|
1629
|
+
void run.then(() => {
|
|
1630
|
+
if (this.indexing === run) this.indexing = void 0;
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1589
1633
|
/**
|
|
1590
1634
|
* Marks the subscription as resolved, allowing pending operations to proceed.
|
|
1591
1635
|
*/
|
|
@@ -1597,49 +1641,73 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1597
1641
|
}
|
|
1598
1642
|
}
|
|
1599
1643
|
/**
|
|
1600
|
-
* Handles tool change events by reindexing all tools from the snapshot
|
|
1644
|
+
* Handles tool change events by reindexing all tools from the snapshot. The new index replaces the
|
|
1645
|
+
* current one only once it is built, and a tool that can't be read is skipped, so the other tools
|
|
1646
|
+
* stay searchable.
|
|
1601
1647
|
*/
|
|
1602
1648
|
async handleToolChange(tools) {
|
|
1603
|
-
this.vectorDB
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
await this.vectorDB.initialize();
|
|
1611
|
-
this.mlInitialized = true;
|
|
1612
|
-
}
|
|
1613
|
-
const filteredTools = tools.filter((tool) => this.shouldIndexTool(tool));
|
|
1614
|
-
if (filteredTools.length === 0) {
|
|
1615
|
-
this.initialized = true;
|
|
1616
|
-
return;
|
|
1649
|
+
if (tools.length > 0 && !this.mlInitialized && this.strategy === "ml" && this.vectorDB instanceof VectoriaDB) {
|
|
1650
|
+
try {
|
|
1651
|
+
await this.vectorDB.initialize();
|
|
1652
|
+
this.mlInitialized = true;
|
|
1653
|
+
} catch (error) {
|
|
1654
|
+
this.fallBackToTfidf(error);
|
|
1655
|
+
}
|
|
1617
1656
|
}
|
|
1618
|
-
const
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1657
|
+
const availabilityByTool = /* @__PURE__ */ new Map();
|
|
1658
|
+
const documents = tools.flatMap((tool) => this.toDocuments(tool, availabilityByTool));
|
|
1659
|
+
await this.replaceIndex(documents);
|
|
1660
|
+
this.availabilityByTool = availabilityByTool;
|
|
1661
|
+
this.initialized = true;
|
|
1662
|
+
}
|
|
1663
|
+
/** The tool's search document, or none when CodeCall may not execute it or it can't be read. */
|
|
1664
|
+
toDocuments(tool, availabilityByTool) {
|
|
1665
|
+
try {
|
|
1666
|
+
if (!this.shouldIndexTool(tool)) return [];
|
|
1622
1667
|
const toolName = tool.name;
|
|
1623
|
-
const
|
|
1624
|
-
return {
|
|
1668
|
+
const document = {
|
|
1625
1669
|
id: toolName,
|
|
1626
|
-
text:
|
|
1670
|
+
text: this.extractSearchableText(tool),
|
|
1627
1671
|
metadata: {
|
|
1628
1672
|
id: toolName,
|
|
1629
1673
|
toolName,
|
|
1630
|
-
qualifiedName,
|
|
1631
|
-
appId,
|
|
1674
|
+
qualifiedName: tool.fullName || toolName,
|
|
1675
|
+
appId: this.extractAppId(tool),
|
|
1632
1676
|
toolInstance: tool
|
|
1633
1677
|
}
|
|
1634
1678
|
};
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
this.vectorDB.reindex();
|
|
1679
|
+
availabilityByTool.set(toolName, tool.metadata.availableWhen);
|
|
1680
|
+
return [document];
|
|
1681
|
+
} catch (error) {
|
|
1682
|
+
this.scope.logger.warn(`CodeCall tool search skipped tool "${tool.name}": ${messageOf(error)}`);
|
|
1683
|
+
return [];
|
|
1641
1684
|
}
|
|
1642
|
-
|
|
1685
|
+
}
|
|
1686
|
+
/** Index `documents` in place of the current contents; embeddings that fail fall back to TF-IDF. */
|
|
1687
|
+
async replaceIndex(documents) {
|
|
1688
|
+
if (this.vectorDB instanceof VectoriaDB) {
|
|
1689
|
+
try {
|
|
1690
|
+
this.vectorDB.clear();
|
|
1691
|
+
if (documents.length > 0) await this.vectorDB.addMany(documents);
|
|
1692
|
+
return;
|
|
1693
|
+
} catch (error) {
|
|
1694
|
+
this.fallBackToTfidf(error);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
const index = this.createTfidfIndex();
|
|
1698
|
+
index.addDocuments(documents);
|
|
1699
|
+
index.reindex();
|
|
1700
|
+
this.vectorDB = index;
|
|
1701
|
+
}
|
|
1702
|
+
/** The embedding model could not be loaded or used: search with TF-IDF for the rest of the process. */
|
|
1703
|
+
fallBackToTfidf(error) {
|
|
1704
|
+
const modelName = this.config.embeddingOptions.modelName || DEFAULT_EMBEDDING_MODEL;
|
|
1705
|
+
this.scope.logger.warn(
|
|
1706
|
+
`CodeCall could not use embedding model "${modelName}" (${messageOf(error)}); tool search uses TF-IDF instead`
|
|
1707
|
+
);
|
|
1708
|
+
this.strategy = "tfidf";
|
|
1709
|
+
this.vectorDB = this.createTfidfIndex();
|
|
1710
|
+
this.synonymService = this.createSynonymService();
|
|
1643
1711
|
}
|
|
1644
1712
|
/**
|
|
1645
1713
|
* Whether a tool belongs in the search index: exactly when CodeCall may execute it.
|
|
@@ -1745,6 +1813,7 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1745
1813
|
*/
|
|
1746
1814
|
async search(query, options = {}) {
|
|
1747
1815
|
await this.ensureSubscribed();
|
|
1816
|
+
await this.indexing;
|
|
1748
1817
|
const { topK = this.config.defaultTopK, appIds, excludeToolNames = [], surface } = options;
|
|
1749
1818
|
const minScore = this.config.defaultSimilarityThreshold;
|
|
1750
1819
|
const filter = (metadata) => {
|
|
@@ -2307,6 +2376,7 @@ ${policyIssues.map((issue) => `${issue.code}${issue.location ? ` (line ${issue.l
|
|
|
2307
2376
|
// errors due to Double VM architecture. Console output from user scripts goes to stdout
|
|
2308
2377
|
// via enclave's internal console, not to this logs array. Only mcpLog/mcpNotify are captured.
|
|
2309
2378
|
};
|
|
2379
|
+
const { rapidEnumerationThreshold, rapidEnumerationOverrides } = this.vmOptions;
|
|
2310
2380
|
const options = {
|
|
2311
2381
|
timeout: this.vmOptions.timeoutMs,
|
|
2312
2382
|
maxToolCalls: maxToolCallsOf(this.vmOptions),
|
|
@@ -2325,7 +2395,13 @@ ${policyIssues.map((issue) => `${issue.code}${issue.location ? ` (line ${issue.l
|
|
|
2325
2395
|
// Tool namespaces (`acme.getUser()` for a tool named `acme.getUser`) are built by the sandbox
|
|
2326
2396
|
// itself: a method call is exactly `callTool('acme.getUser', args, options)`, with the
|
|
2327
2397
|
// sandbox's tool-call cap, rate limit, suspicious-sequence checks and `throwOnError`.
|
|
2328
|
-
toolNamespaces: toSandboxToolNamespaces(environment.toolNamespaces, Object.keys(globals))
|
|
2398
|
+
toolNamespaces: toSandboxToolNamespaces(environment.toolNamespaces, Object.keys(globals)),
|
|
2399
|
+
doubleVm: {
|
|
2400
|
+
parentValidation: {
|
|
2401
|
+
...rapidEnumerationThreshold !== void 0 && { rapidEnumerationThreshold },
|
|
2402
|
+
...rapidEnumerationOverrides !== void 0 && { rapidEnumerationOverrides }
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2329
2405
|
};
|
|
2330
2406
|
const enclave = createEnclave(options);
|
|
2331
2407
|
try {
|
|
@@ -3520,6 +3596,7 @@ function buildExecuteToolDescription(vmOptions) {
|
|
|
3520
3596
|
const namespaces = ["Math", "JSON"].filter((name) => !blockedNames.has(name)).map((name) => `${name}.*, `);
|
|
3521
3597
|
const timeoutSeconds = vmOptions.timeoutMs / 1e3;
|
|
3522
3598
|
const maxToolCalls = maxToolCallsOf(vmOptions);
|
|
3599
|
+
const callsPerTool = rapidEnumerationThresholdOf(vmOptions);
|
|
3523
3600
|
return `Execute AgentScript (safe JS subset) for multi-tool orchestration.
|
|
3524
3601
|
|
|
3525
3602
|
API: await callTool(name, args, opts?)
|
|
@@ -3538,9 +3615,9 @@ return results;
|
|
|
3538
3615
|
ALLOWED: ${loops}, arrow fn, map/filter/reduce/find, ${namespaces.join("")}if/else, destructuring, spread, template literals
|
|
3539
3616
|
BLOCKED: ${blockedLoops}, console (use mcpLog), function decl, ${[...blockedNames].join(", ")}
|
|
3540
3617
|
|
|
3541
|
-
ERRORS: NOT_FOUND | VALIDATION | EXECUTION | TIMEOUT | ACCESS_DENIED
|
|
3618
|
+
ERRORS: NOT_FOUND | VALIDATION | EXECUTION | TIMEOUT | ACCESS_DENIED | RATE_LIMITED
|
|
3542
3619
|
STATUS: ok | syntax_error | illegal_access | runtime_error | tool_error | timeout
|
|
3543
|
-
LIMITS: ${MAX_ITERATIONS_PER_LOOP} iterations per loop, ${timeoutSeconds}s timeout, ${maxToolCalls} tool calls`;
|
|
3620
|
+
LIMITS: ${MAX_ITERATIONS_PER_LOOP} iterations per loop, ${timeoutSeconds}s timeout, ${maxToolCalls} tool calls, ${callsPerTool} calls to one tool per 2s (parallel() included)`;
|
|
3544
3621
|
}
|
|
3545
3622
|
var executeToolDescription = buildExecuteToolDescription(resolveVmOptions());
|
|
3546
3623
|
var executeToolInputSchema = {
|
|
@@ -3629,6 +3706,13 @@ function getErrorCode(error) {
|
|
|
3629
3706
|
if (!(error instanceof Error)) {
|
|
3630
3707
|
return TOOL_CALL_ERROR_CODES.EXECUTION;
|
|
3631
3708
|
}
|
|
3709
|
+
const { code, statusCode } = error;
|
|
3710
|
+
if (code === "INVALID_INPUT") {
|
|
3711
|
+
return TOOL_CALL_ERROR_CODES.VALIDATION;
|
|
3712
|
+
}
|
|
3713
|
+
if (statusCode === 429) {
|
|
3714
|
+
return TOOL_CALL_ERROR_CODES.RATE_LIMITED;
|
|
3715
|
+
}
|
|
3632
3716
|
if (error.name === "ZodError" || error.message?.includes("validation")) {
|
|
3633
3717
|
return TOOL_CALL_ERROR_CODES.VALIDATION;
|
|
3634
3718
|
}
|
|
@@ -3640,6 +3724,10 @@ function getErrorCode(error) {
|
|
|
3640
3724
|
}
|
|
3641
3725
|
return TOOL_CALL_ERROR_CODES.EXECUTION;
|
|
3642
3726
|
}
|
|
3727
|
+
function publicMessageOf(error) {
|
|
3728
|
+
const { getPublicMessage } = error;
|
|
3729
|
+
return typeof getPublicMessage === "function" ? getPublicMessage.call(error) : error.message;
|
|
3730
|
+
}
|
|
3643
3731
|
var ExecuteTool = class extends ToolContext5 {
|
|
3644
3732
|
/**
|
|
3645
3733
|
* Resolve the server-side CodeCall policy for a tool name (GHSA-6w3j-82v5-6qrr).
|
|
@@ -3722,7 +3810,7 @@ var ExecuteTool = class extends ToolContext5 {
|
|
|
3722
3810
|
return { success: true, data: result };
|
|
3723
3811
|
} catch (error) {
|
|
3724
3812
|
const errorCode = getErrorCode(error);
|
|
3725
|
-
const rawMessage = error instanceof Error ? error
|
|
3813
|
+
const rawMessage = error instanceof Error ? publicMessageOf(error) : void 0;
|
|
3726
3814
|
audit?.logToolCallFailure(executionId, name, callDepth, Date.now() - toolCallStartedAt, errorCode);
|
|
3727
3815
|
const sanitizedError = createToolCallError(errorCode, name, rawMessage);
|
|
3728
3816
|
if (throwOnError) {
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-codecall",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/agentfront/frontmcp/issues"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://
|
|
27
|
+
"homepage": "https://frontmcp.dev/reference/plugins/codecall",
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@enclave-vm/ast": "^2.16.0",
|
|
52
52
|
"@enclave-vm/core": "^2.16.0",
|
|
53
|
-
"@frontmcp/protocol": "1.9.
|
|
54
|
-
"@frontmcp/sdk": "1.9.
|
|
53
|
+
"@frontmcp/protocol": "1.9.5",
|
|
54
|
+
"@frontmcp/sdk": "1.9.5",
|
|
55
55
|
"acorn": "^8.15.0",
|
|
56
56
|
"vectoriadb": "^2.3.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
60
|
-
"@frontmcp/plugin-cache": "1.9.
|
|
59
|
+
"@frontmcp/lazy-zod": "1.9.5",
|
|
60
|
+
"@frontmcp/plugin-cache": "1.9.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"reflect-metadata": "^0.2.2"
|
package/index.js
CHANGED
|
@@ -119,7 +119,18 @@ var codeCallVmOptionsSchema = import_lazy_zod.z.object({
|
|
|
119
119
|
* Limits array sizes and object keys in return values
|
|
120
120
|
* @default varies by preset (secure: 2000)
|
|
121
121
|
*/
|
|
122
|
-
maxSanitizeProperties: import_lazy_zod.z.number().positive().optional()
|
|
122
|
+
maxSanitizeProperties: import_lazy_zod.z.number().positive().optional(),
|
|
123
|
+
/**
|
|
124
|
+
* Calls a script may make to one tool within about 2 seconds; one more stops the script with
|
|
125
|
+
* `[RAPID_ENUMERATION]`. Calls made through `parallel()` count. The sandbox's message says "in 5s",
|
|
126
|
+
* but it keeps only the last 2 seconds of calls.
|
|
127
|
+
* @default 30
|
|
128
|
+
*/
|
|
129
|
+
rapidEnumerationThreshold: import_lazy_zod.z.number().int().positive().optional(),
|
|
130
|
+
/**
|
|
131
|
+
* Per-tool values of `rapidEnumerationThreshold`, by tool name, e.g. `{ 'users:get': 100 }`.
|
|
132
|
+
*/
|
|
133
|
+
rapidEnumerationOverrides: import_lazy_zod.z.record(import_lazy_zod.z.string(), import_lazy_zod.z.number().int().positive()).optional()
|
|
123
134
|
}).default(() => DEFAULT_VM_OPTIONS);
|
|
124
135
|
var codeCallDirectCallsOptionsSchema = import_lazy_zod.z.object({
|
|
125
136
|
/**
|
|
@@ -334,6 +345,10 @@ var MAX_ITERATIONS_PER_LOOP = 1e4;
|
|
|
334
345
|
function maxToolCallsOf(vmOptions) {
|
|
335
346
|
return vmOptions.maxSteps || 100;
|
|
336
347
|
}
|
|
348
|
+
var SANDBOX_RAPID_ENUMERATION_THRESHOLD = 30;
|
|
349
|
+
function rapidEnumerationThresholdOf(vmOptions) {
|
|
350
|
+
return vmOptions.rapidEnumerationThreshold ?? SANDBOX_RAPID_ENUMERATION_THRESHOLD;
|
|
351
|
+
}
|
|
337
352
|
function resolveVmOptions(vmOptions) {
|
|
338
353
|
const preset = vmOptions?.preset ?? "secure";
|
|
339
354
|
const base = presetDefaults(preset);
|
|
@@ -642,6 +657,7 @@ var TOOL_CALL_ERROR_CODES = {
|
|
|
642
657
|
EXECUTION: "EXECUTION",
|
|
643
658
|
TIMEOUT: "TIMEOUT",
|
|
644
659
|
ACCESS_DENIED: "ACCESS_DENIED",
|
|
660
|
+
RATE_LIMITED: "RATE_LIMITED",
|
|
645
661
|
SELF_REFERENCE: "SELF_REFERENCE"
|
|
646
662
|
};
|
|
647
663
|
function createToolCallError(code, toolName, rawMessage) {
|
|
@@ -664,6 +680,8 @@ function getSanitizedMessage(code, toolName, rawMessage) {
|
|
|
664
680
|
return `Tool "${toolName}" execution timed out`;
|
|
665
681
|
case TOOL_CALL_ERROR_CODES.ACCESS_DENIED:
|
|
666
682
|
return `Access denied for tool "${toolName}"`;
|
|
683
|
+
case TOOL_CALL_ERROR_CODES.RATE_LIMITED:
|
|
684
|
+
return `Tool "${toolName}" was rate limited`;
|
|
667
685
|
case TOOL_CALL_ERROR_CODES.SELF_REFERENCE:
|
|
668
686
|
return `Cannot call CodeCall tools from within AgentScript`;
|
|
669
687
|
default:
|
|
@@ -1509,6 +1527,10 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
|
|
|
1509
1527
|
"ie",
|
|
1510
1528
|
"eg"
|
|
1511
1529
|
]);
|
|
1530
|
+
var DEFAULT_EMBEDDING_MODEL = "Xenova/all-MiniLM-L6-v2";
|
|
1531
|
+
function messageOf(error) {
|
|
1532
|
+
return error instanceof Error ? error.message : String(error);
|
|
1533
|
+
}
|
|
1512
1534
|
var ToolSearchService = class _ToolSearchService {
|
|
1513
1535
|
static MAX_SUBSCRIPTION_RETRIES = 100;
|
|
1514
1536
|
static INITIAL_RETRY_DELAY_MS = 10;
|
|
@@ -1521,6 +1543,9 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1521
1543
|
scope;
|
|
1522
1544
|
unsubscribe;
|
|
1523
1545
|
synonymService = null;
|
|
1546
|
+
synonymExpansion;
|
|
1547
|
+
/** The reindex in progress: later tool changes queue behind it and `search()` waits for it. */
|
|
1548
|
+
indexing;
|
|
1524
1549
|
// Subscription tracking for async initialization
|
|
1525
1550
|
subscriptionPromise;
|
|
1526
1551
|
subscriptionResolved = false;
|
|
@@ -1534,7 +1559,7 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1534
1559
|
this.scope = scope;
|
|
1535
1560
|
const embeddingOptions = config.embeddingOptions || {
|
|
1536
1561
|
strategy: "tfidf",
|
|
1537
|
-
modelName:
|
|
1562
|
+
modelName: DEFAULT_EMBEDDING_MODEL,
|
|
1538
1563
|
cacheDir: "./.cache/transformers",
|
|
1539
1564
|
useHNSW: false,
|
|
1540
1565
|
synonymExpansion: { enabled: true, replaceDefaults: false, maxExpansionsPerTerm: 5 }
|
|
@@ -1554,21 +1579,18 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1554
1579
|
}
|
|
1555
1580
|
if (this.strategy === "ml") {
|
|
1556
1581
|
this.vectorDB = new import_vectoriadb.VectoriaDB({
|
|
1557
|
-
modelName: embeddingOptions.modelName ||
|
|
1582
|
+
modelName: embeddingOptions.modelName || DEFAULT_EMBEDDING_MODEL,
|
|
1558
1583
|
cacheDir: embeddingOptions.cacheDir || "./.cache/transformers",
|
|
1559
1584
|
defaultTopK: this.config.defaultTopK,
|
|
1560
1585
|
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold,
|
|
1561
1586
|
useHNSW: embeddingOptions.useHNSW || false
|
|
1562
1587
|
});
|
|
1563
1588
|
} else {
|
|
1564
|
-
this.vectorDB =
|
|
1565
|
-
defaultTopK: this.config.defaultTopK,
|
|
1566
|
-
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold
|
|
1567
|
-
});
|
|
1589
|
+
this.vectorDB = this.createTfidfIndex();
|
|
1568
1590
|
}
|
|
1569
|
-
|
|
1570
|
-
if (this.strategy === "tfidf"
|
|
1571
|
-
this.synonymService =
|
|
1591
|
+
this.synonymExpansion = config.synonymExpansion ?? embeddingOptions.synonymExpansion;
|
|
1592
|
+
if (this.strategy === "tfidf") {
|
|
1593
|
+
this.synonymService = this.createSynonymService();
|
|
1572
1594
|
}
|
|
1573
1595
|
this.subscriptionPromise = new Promise((resolve, reject) => {
|
|
1574
1596
|
this.subscriptionResolve = resolve;
|
|
@@ -1576,6 +1598,17 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1576
1598
|
});
|
|
1577
1599
|
this.setupSubscription();
|
|
1578
1600
|
}
|
|
1601
|
+
createTfidfIndex() {
|
|
1602
|
+
return new import_vectoriadb.TFIDFVectoria({
|
|
1603
|
+
defaultTopK: this.config.defaultTopK,
|
|
1604
|
+
defaultSimilarityThreshold: this.config.defaultSimilarityThreshold
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
createSynonymService() {
|
|
1608
|
+
const synonymExpansion = this.synonymExpansion;
|
|
1609
|
+
if (synonymExpansion === false || synonymExpansion?.enabled === false) return null;
|
|
1610
|
+
return new SynonymExpansionService(synonymExpansion ?? {});
|
|
1611
|
+
}
|
|
1579
1612
|
/**
|
|
1580
1613
|
* Ensures the service is subscribed to tool changes before proceeding.
|
|
1581
1614
|
* Public methods should call this before accessing tools.
|
|
@@ -1616,10 +1649,21 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1616
1649
|
*/
|
|
1617
1650
|
subscribeToToolChanges() {
|
|
1618
1651
|
this.unsubscribe = this.scope.tools.subscribe({ immediate: true }, (event) => {
|
|
1619
|
-
this.
|
|
1652
|
+
this.queueReindex(event.snapshot);
|
|
1620
1653
|
});
|
|
1621
1654
|
this.markSubscribed();
|
|
1622
1655
|
}
|
|
1656
|
+
/** Reindex from `tools` once the reindex in progress (if any) is done; a failure is logged, never thrown. */
|
|
1657
|
+
queueReindex(tools) {
|
|
1658
|
+
const reindex = () => this.handleToolChange(tools);
|
|
1659
|
+
const run = (this.indexing ? this.indexing.then(reindex) : reindex()).catch((error) => {
|
|
1660
|
+
this.scope.logger.warn(`CodeCall tool search could not index the tools: ${messageOf(error)}`);
|
|
1661
|
+
});
|
|
1662
|
+
this.indexing = run;
|
|
1663
|
+
void run.then(() => {
|
|
1664
|
+
if (this.indexing === run) this.indexing = void 0;
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1623
1667
|
/**
|
|
1624
1668
|
* Marks the subscription as resolved, allowing pending operations to proceed.
|
|
1625
1669
|
*/
|
|
@@ -1631,49 +1675,73 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1631
1675
|
}
|
|
1632
1676
|
}
|
|
1633
1677
|
/**
|
|
1634
|
-
* Handles tool change events by reindexing all tools from the snapshot
|
|
1678
|
+
* Handles tool change events by reindexing all tools from the snapshot. The new index replaces the
|
|
1679
|
+
* current one only once it is built, and a tool that can't be read is skipped, so the other tools
|
|
1680
|
+
* stay searchable.
|
|
1635
1681
|
*/
|
|
1636
1682
|
async handleToolChange(tools) {
|
|
1637
|
-
this.vectorDB.
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
await this.vectorDB.initialize();
|
|
1645
|
-
this.mlInitialized = true;
|
|
1646
|
-
}
|
|
1647
|
-
const filteredTools = tools.filter((tool) => this.shouldIndexTool(tool));
|
|
1648
|
-
if (filteredTools.length === 0) {
|
|
1649
|
-
this.initialized = true;
|
|
1650
|
-
return;
|
|
1683
|
+
if (tools.length > 0 && !this.mlInitialized && this.strategy === "ml" && this.vectorDB instanceof import_vectoriadb.VectoriaDB) {
|
|
1684
|
+
try {
|
|
1685
|
+
await this.vectorDB.initialize();
|
|
1686
|
+
this.mlInitialized = true;
|
|
1687
|
+
} catch (error) {
|
|
1688
|
+
this.fallBackToTfidf(error);
|
|
1689
|
+
}
|
|
1651
1690
|
}
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1691
|
+
const availabilityByTool = /* @__PURE__ */ new Map();
|
|
1692
|
+
const documents = tools.flatMap((tool) => this.toDocuments(tool, availabilityByTool));
|
|
1693
|
+
await this.replaceIndex(documents);
|
|
1694
|
+
this.availabilityByTool = availabilityByTool;
|
|
1695
|
+
this.initialized = true;
|
|
1696
|
+
}
|
|
1697
|
+
/** The tool's search document, or none when CodeCall may not execute it or it can't be read. */
|
|
1698
|
+
toDocuments(tool, availabilityByTool) {
|
|
1699
|
+
try {
|
|
1700
|
+
if (!this.shouldIndexTool(tool)) return [];
|
|
1656
1701
|
const toolName = tool.name;
|
|
1657
|
-
const
|
|
1658
|
-
return {
|
|
1702
|
+
const document = {
|
|
1659
1703
|
id: toolName,
|
|
1660
|
-
text:
|
|
1704
|
+
text: this.extractSearchableText(tool),
|
|
1661
1705
|
metadata: {
|
|
1662
1706
|
id: toolName,
|
|
1663
1707
|
toolName,
|
|
1664
|
-
qualifiedName,
|
|
1665
|
-
appId,
|
|
1708
|
+
qualifiedName: tool.fullName || toolName,
|
|
1709
|
+
appId: this.extractAppId(tool),
|
|
1666
1710
|
toolInstance: tool
|
|
1667
1711
|
}
|
|
1668
1712
|
};
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
this.vectorDB.reindex();
|
|
1713
|
+
availabilityByTool.set(toolName, tool.metadata.availableWhen);
|
|
1714
|
+
return [document];
|
|
1715
|
+
} catch (error) {
|
|
1716
|
+
this.scope.logger.warn(`CodeCall tool search skipped tool "${tool.name}": ${messageOf(error)}`);
|
|
1717
|
+
return [];
|
|
1675
1718
|
}
|
|
1676
|
-
|
|
1719
|
+
}
|
|
1720
|
+
/** Index `documents` in place of the current contents; embeddings that fail fall back to TF-IDF. */
|
|
1721
|
+
async replaceIndex(documents) {
|
|
1722
|
+
if (this.vectorDB instanceof import_vectoriadb.VectoriaDB) {
|
|
1723
|
+
try {
|
|
1724
|
+
this.vectorDB.clear();
|
|
1725
|
+
if (documents.length > 0) await this.vectorDB.addMany(documents);
|
|
1726
|
+
return;
|
|
1727
|
+
} catch (error) {
|
|
1728
|
+
this.fallBackToTfidf(error);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
const index = this.createTfidfIndex();
|
|
1732
|
+
index.addDocuments(documents);
|
|
1733
|
+
index.reindex();
|
|
1734
|
+
this.vectorDB = index;
|
|
1735
|
+
}
|
|
1736
|
+
/** The embedding model could not be loaded or used: search with TF-IDF for the rest of the process. */
|
|
1737
|
+
fallBackToTfidf(error) {
|
|
1738
|
+
const modelName = this.config.embeddingOptions.modelName || DEFAULT_EMBEDDING_MODEL;
|
|
1739
|
+
this.scope.logger.warn(
|
|
1740
|
+
`CodeCall could not use embedding model "${modelName}" (${messageOf(error)}); tool search uses TF-IDF instead`
|
|
1741
|
+
);
|
|
1742
|
+
this.strategy = "tfidf";
|
|
1743
|
+
this.vectorDB = this.createTfidfIndex();
|
|
1744
|
+
this.synonymService = this.createSynonymService();
|
|
1677
1745
|
}
|
|
1678
1746
|
/**
|
|
1679
1747
|
* Whether a tool belongs in the search index: exactly when CodeCall may execute it.
|
|
@@ -1779,6 +1847,7 @@ var ToolSearchService = class _ToolSearchService {
|
|
|
1779
1847
|
*/
|
|
1780
1848
|
async search(query, options = {}) {
|
|
1781
1849
|
await this.ensureSubscribed();
|
|
1850
|
+
await this.indexing;
|
|
1782
1851
|
const { topK = this.config.defaultTopK, appIds, excludeToolNames = [], surface } = options;
|
|
1783
1852
|
const minScore = this.config.defaultSimilarityThreshold;
|
|
1784
1853
|
const filter = (metadata) => {
|
|
@@ -2335,6 +2404,7 @@ ${policyIssues.map((issue) => `${issue.code}${issue.location ? ` (line ${issue.l
|
|
|
2335
2404
|
// errors due to Double VM architecture. Console output from user scripts goes to stdout
|
|
2336
2405
|
// via enclave's internal console, not to this logs array. Only mcpLog/mcpNotify are captured.
|
|
2337
2406
|
};
|
|
2407
|
+
const { rapidEnumerationThreshold, rapidEnumerationOverrides } = this.vmOptions;
|
|
2338
2408
|
const options = {
|
|
2339
2409
|
timeout: this.vmOptions.timeoutMs,
|
|
2340
2410
|
maxToolCalls: maxToolCallsOf(this.vmOptions),
|
|
@@ -2353,7 +2423,13 @@ ${policyIssues.map((issue) => `${issue.code}${issue.location ? ` (line ${issue.l
|
|
|
2353
2423
|
// Tool namespaces (`acme.getUser()` for a tool named `acme.getUser`) are built by the sandbox
|
|
2354
2424
|
// itself: a method call is exactly `callTool('acme.getUser', args, options)`, with the
|
|
2355
2425
|
// sandbox's tool-call cap, rate limit, suspicious-sequence checks and `throwOnError`.
|
|
2356
|
-
toolNamespaces: toSandboxToolNamespaces(environment.toolNamespaces, Object.keys(globals))
|
|
2426
|
+
toolNamespaces: toSandboxToolNamespaces(environment.toolNamespaces, Object.keys(globals)),
|
|
2427
|
+
doubleVm: {
|
|
2428
|
+
parentValidation: {
|
|
2429
|
+
...rapidEnumerationThreshold !== void 0 && { rapidEnumerationThreshold },
|
|
2430
|
+
...rapidEnumerationOverrides !== void 0 && { rapidEnumerationOverrides }
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2357
2433
|
};
|
|
2358
2434
|
const enclave = createEnclave(options);
|
|
2359
2435
|
try {
|
|
@@ -3548,6 +3624,7 @@ function buildExecuteToolDescription(vmOptions) {
|
|
|
3548
3624
|
const namespaces = ["Math", "JSON"].filter((name) => !blockedNames.has(name)).map((name) => `${name}.*, `);
|
|
3549
3625
|
const timeoutSeconds = vmOptions.timeoutMs / 1e3;
|
|
3550
3626
|
const maxToolCalls = maxToolCallsOf(vmOptions);
|
|
3627
|
+
const callsPerTool = rapidEnumerationThresholdOf(vmOptions);
|
|
3551
3628
|
return `Execute AgentScript (safe JS subset) for multi-tool orchestration.
|
|
3552
3629
|
|
|
3553
3630
|
API: await callTool(name, args, opts?)
|
|
@@ -3566,9 +3643,9 @@ return results;
|
|
|
3566
3643
|
ALLOWED: ${loops}, arrow fn, map/filter/reduce/find, ${namespaces.join("")}if/else, destructuring, spread, template literals
|
|
3567
3644
|
BLOCKED: ${blockedLoops}, console (use mcpLog), function decl, ${[...blockedNames].join(", ")}
|
|
3568
3645
|
|
|
3569
|
-
ERRORS: NOT_FOUND | VALIDATION | EXECUTION | TIMEOUT | ACCESS_DENIED
|
|
3646
|
+
ERRORS: NOT_FOUND | VALIDATION | EXECUTION | TIMEOUT | ACCESS_DENIED | RATE_LIMITED
|
|
3570
3647
|
STATUS: ok | syntax_error | illegal_access | runtime_error | tool_error | timeout
|
|
3571
|
-
LIMITS: ${MAX_ITERATIONS_PER_LOOP} iterations per loop, ${timeoutSeconds}s timeout, ${maxToolCalls} tool calls`;
|
|
3648
|
+
LIMITS: ${MAX_ITERATIONS_PER_LOOP} iterations per loop, ${timeoutSeconds}s timeout, ${maxToolCalls} tool calls, ${callsPerTool} calls to one tool per 2s (parallel() included)`;
|
|
3572
3649
|
}
|
|
3573
3650
|
var executeToolDescription = buildExecuteToolDescription(resolveVmOptions());
|
|
3574
3651
|
var executeToolInputSchema = {
|
|
@@ -3657,6 +3734,13 @@ function getErrorCode(error) {
|
|
|
3657
3734
|
if (!(error instanceof Error)) {
|
|
3658
3735
|
return TOOL_CALL_ERROR_CODES.EXECUTION;
|
|
3659
3736
|
}
|
|
3737
|
+
const { code, statusCode } = error;
|
|
3738
|
+
if (code === "INVALID_INPUT") {
|
|
3739
|
+
return TOOL_CALL_ERROR_CODES.VALIDATION;
|
|
3740
|
+
}
|
|
3741
|
+
if (statusCode === 429) {
|
|
3742
|
+
return TOOL_CALL_ERROR_CODES.RATE_LIMITED;
|
|
3743
|
+
}
|
|
3660
3744
|
if (error.name === "ZodError" || error.message?.includes("validation")) {
|
|
3661
3745
|
return TOOL_CALL_ERROR_CODES.VALIDATION;
|
|
3662
3746
|
}
|
|
@@ -3668,6 +3752,10 @@ function getErrorCode(error) {
|
|
|
3668
3752
|
}
|
|
3669
3753
|
return TOOL_CALL_ERROR_CODES.EXECUTION;
|
|
3670
3754
|
}
|
|
3755
|
+
function publicMessageOf(error) {
|
|
3756
|
+
const { getPublicMessage } = error;
|
|
3757
|
+
return typeof getPublicMessage === "function" ? getPublicMessage.call(error) : error.message;
|
|
3758
|
+
}
|
|
3671
3759
|
var ExecuteTool = class extends import_sdk9.ToolContext {
|
|
3672
3760
|
/**
|
|
3673
3761
|
* Resolve the server-side CodeCall policy for a tool name (GHSA-6w3j-82v5-6qrr).
|
|
@@ -3750,7 +3838,7 @@ var ExecuteTool = class extends import_sdk9.ToolContext {
|
|
|
3750
3838
|
return { success: true, data: result };
|
|
3751
3839
|
} catch (error) {
|
|
3752
3840
|
const errorCode = getErrorCode(error);
|
|
3753
|
-
const rawMessage = error instanceof Error ? error
|
|
3841
|
+
const rawMessage = error instanceof Error ? publicMessageOf(error) : void 0;
|
|
3754
3842
|
audit?.logToolCallFailure(executionId, name, callDepth, Date.now() - toolCallStartedAt, errorCode);
|
|
3755
3843
|
const sanitizedError = createToolCallError(errorCode, name, rawMessage);
|
|
3756
3844
|
if (throwOnError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/plugin-codecall",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/agentfront/frontmcp/issues"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://
|
|
27
|
+
"homepage": "https://frontmcp.dev/reference/plugins/codecall",
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@enclave-vm/ast": "^2.16.0",
|
|
52
52
|
"@enclave-vm/core": "^2.16.0",
|
|
53
|
-
"@frontmcp/protocol": "1.9.
|
|
54
|
-
"@frontmcp/sdk": "1.9.
|
|
53
|
+
"@frontmcp/protocol": "1.9.5",
|
|
54
|
+
"@frontmcp/sdk": "1.9.5",
|
|
55
55
|
"acorn": "^8.15.0",
|
|
56
56
|
"vectoriadb": "^2.3.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@frontmcp/lazy-zod": "1.9.
|
|
60
|
-
"@frontmcp/plugin-cache": "1.9.
|
|
59
|
+
"@frontmcp/lazy-zod": "1.9.5",
|
|
60
|
+
"@frontmcp/plugin-cache": "1.9.5"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"reflect-metadata": "^0.2.2"
|
|
@@ -31,5 +31,7 @@ export default class CodeCallConfig extends BaseConfig<CodeCallPluginOptions & {
|
|
|
31
31
|
export declare const MAX_ITERATIONS_PER_LOOP = 10000;
|
|
32
32
|
/** Tool calls a script may make: `vm.maxSteps`, else 100. */
|
|
33
33
|
export declare function maxToolCallsOf(vmOptions: ResolvedCodeCallVmOptions): number;
|
|
34
|
+
/** Calls to one tool a script may make within about 2 seconds: `vm.rapidEnumerationThreshold`, else 30. */
|
|
35
|
+
export declare function rapidEnumerationThresholdOf(vmOptions: ResolvedCodeCallVmOptions): number;
|
|
34
36
|
export declare function resolveVmOptions(vmOptions?: CodeCallVmOptions): ResolvedCodeCallVmOptions;
|
|
35
37
|
//# sourceMappingURL=code-call.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-call.config.d.ts","sourceRoot":"","sources":["../../src/providers/code-call.config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAA2B,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACp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B,CAAC;CACH;AA2DD;;;;;;;;GAQG;AACH;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CASpD;AAOD,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;IACtD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;gBAE5C,MAAM,EAAE,cAAc;IAOlC;;;;;;;OAOG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAkIhG;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAgGzB"}
|
|
@@ -87,6 +87,9 @@ export declare class ToolSearchService implements ToolSearch {
|
|
|
87
87
|
private scope;
|
|
88
88
|
private unsubscribe?;
|
|
89
89
|
private synonymService;
|
|
90
|
+
private readonly synonymExpansion;
|
|
91
|
+
/** The reindex in progress: later tool changes queue behind it and `search()` waits for it. */
|
|
92
|
+
private indexing?;
|
|
90
93
|
private subscriptionPromise;
|
|
91
94
|
private subscriptionResolved;
|
|
92
95
|
private subscriptionResolve;
|
|
@@ -96,6 +99,8 @@ export declare class ToolSearchService implements ToolSearch {
|
|
|
96
99
|
/** `availableWhen` of each indexed tool, by indexed name, for per-caller surface filtering. */
|
|
97
100
|
private availabilityByTool;
|
|
98
101
|
constructor(config: ToolSearchServiceConfig | undefined, scope: ScopeEntry);
|
|
102
|
+
private createTfidfIndex;
|
|
103
|
+
private createSynonymService;
|
|
99
104
|
/**
|
|
100
105
|
* Ensures the service is subscribed to tool changes before proceeding.
|
|
101
106
|
* Public methods should call this before accessing tools.
|
|
@@ -110,14 +115,24 @@ export declare class ToolSearchService implements ToolSearch {
|
|
|
110
115
|
* Subscribes to tool changes once scope.tools is available.
|
|
111
116
|
*/
|
|
112
117
|
private subscribeToToolChanges;
|
|
118
|
+
/** Reindex from `tools` once the reindex in progress (if any) is done; a failure is logged, never thrown. */
|
|
119
|
+
private queueReindex;
|
|
113
120
|
/**
|
|
114
121
|
* Marks the subscription as resolved, allowing pending operations to proceed.
|
|
115
122
|
*/
|
|
116
123
|
private markSubscribed;
|
|
117
124
|
/**
|
|
118
|
-
* Handles tool change events by reindexing all tools from the snapshot
|
|
125
|
+
* Handles tool change events by reindexing all tools from the snapshot. The new index replaces the
|
|
126
|
+
* current one only once it is built, and a tool that can't be read is skipped, so the other tools
|
|
127
|
+
* stay searchable.
|
|
119
128
|
*/
|
|
120
129
|
private handleToolChange;
|
|
130
|
+
/** The tool's search document, or none when CodeCall may not execute it or it can't be read. */
|
|
131
|
+
private toDocuments;
|
|
132
|
+
/** Index `documents` in place of the current contents; embeddings that fail fall back to TF-IDF. */
|
|
133
|
+
private replaceIndex;
|
|
134
|
+
/** The embedding model could not be loaded or used: search with TF-IDF for the rest of the process. */
|
|
135
|
+
private fallBackToTfidf;
|
|
121
136
|
/**
|
|
122
137
|
* Whether a tool belongs in the search index: exactly when CodeCall may execute it.
|
|
123
138
|
* The decision is `codecall:execute`'s own, so search cannot show a tool execution refuses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-search.service.d.ts","sourceRoot":"","sources":["../../src/services/tool-search.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,KAAK,EACV,iBAAiB,IAAI,uBAAuB,EAC5C,gBAAgB,IAAI,sBAAsB,EAC1C,UAAU,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,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F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,MAAM,MAAM,qBAAqB,GAC7B,gBAAgB,GAChB,yBAAyB,GACzB,2BAA2B,GAC3B,0BAA0B,GAC1B,uBAAuB,GACvB,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.tool.d.ts","sourceRoot":"","sources":["../../src/tools/execute.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,WAAW,EAAkB,MAAM,eAAe,CAAC;AAyBlF,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.tool.d.ts","sourceRoot":"","sources":["../../src/tools/execute.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,WAAW,EAAkB,MAAM,eAAe,CAAC;AAyBlF,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAuD1B,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAIjB,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA6VvE"}
|