@elizaos/cli 1.4.4 → 1.4.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/dist/BrowserWebSocketTransport-5YQPVDV7.js +7 -0
- package/dist/EnhancedEvaluationEngine-APOQ6INN.js +473 -0
- package/dist/EvaluationEngine-Y7ZQJBRC.js +9 -0
- package/dist/LocalEnvironmentProvider-JWFGG4IN.js +15 -0
- package/dist/NodeWebSocketTransport-PUO724EY.js +8 -0
- package/dist/ScreenRecorder-YK246DNJ.js +10 -0
- package/dist/agent-start-6QJQAMKA.js +13 -0
- package/dist/bidi-2SVNH6F7.js +15309 -0
- package/dist/{bun-exec-ULMPAIQC.js → bun-exec-NH4UCUY4.js} +1 -1
- package/dist/chunk-2ESYSVXG.js +48 -0
- package/dist/chunk-3AEYIKBZ.js +432 -0
- package/dist/chunk-5IWKEMEF.js +239 -0
- package/dist/chunk-5WZO2HMM.js +2644 -0
- package/dist/chunk-ABGBVB74.js +3501 -0
- package/dist/{chunk-NSNXXD3I.js → chunk-BCO32GR6.js} +2 -2
- package/dist/chunk-CGXTFHQP.js +25 -0
- package/dist/chunk-EXUFDTUD.js +3948 -0
- package/dist/chunk-FGGNHEXZ.js +211860 -0
- package/dist/chunk-FWYHSCLF.js +243 -0
- package/dist/chunk-I57T3WPO.js +165 -0
- package/dist/chunk-LBZLMFFF.js +221 -0
- package/dist/chunk-LG7YDBMV.js +401 -0
- package/dist/chunk-NHKLUXNE.js +166 -0
- package/dist/chunk-PUZHCSGF.js +828 -0
- package/dist/chunk-PWDR7CPA.js +7828 -0
- package/dist/{chunk-N5G5XSGP.js → chunk-Q6M2K53X.js} +3 -3
- package/dist/chunk-SVHCNBHM.js +289 -0
- package/dist/{chunk-HOC6B3QV.js → chunk-VFFOOPYS.js} +4 -238
- package/dist/chunk-WX37MM4G.js +292 -0
- package/dist/chunk-XFJIHUT3.js +6 -0
- package/dist/chunk-XPPESCCM.js +787 -0
- package/dist/chunk-YBDC5OZO.js +40 -0
- package/dist/commands/agent/actions/index.js +2 -2
- package/dist/commands/agent/index.js +2 -2
- package/dist/commands/create/actions/index.js +4 -3
- package/dist/commands/create/index.js +5 -4
- package/dist/commands/shared/index.js +1 -1
- package/dist/index.js +66796 -4986
- package/dist/js-yaml-KADNMPWR.js +35 -0
- package/dist/matrix-orchestrator-3WLRK7GG.js +1070 -0
- package/dist/matrix-runner-KDPETCKQ.js +160 -0
- package/dist/matrix-schema-PCO2KGJY.js +102 -0
- package/dist/parameter-override-ALOPPXCE.js +487 -0
- package/dist/{plugin-creator-TCUFII32.js → plugin-creator-J7GNPMPG.js} +1 -1
- package/dist/process-manager-IU2A3BTQ.js +9 -0
- package/dist/{registry-ELONUC44.js → registry-65KMEA7N.js} +2 -2
- package/dist/resource-monitor-EHZSH2P6.js +15 -0
- package/dist/run-isolation-PGLZ37Y7.js +29 -0
- package/dist/runtime-factory-Q4U5YBNV.js +22 -0
- package/dist/schema-C25LVPEK.js +17 -0
- package/dist/src/commands/report/src/assets/report_template.html +1704 -0
- package/dist/src-EJG4ILDC.js +5 -0
- package/dist/templates/plugin-quick-starter/package.json +2 -2
- package/dist/templates/plugin-starter/package.json +2 -2
- package/dist/templates/project-starter/package.json +4 -4
- package/dist/templates/project-tee-starter/package.json +4 -4
- package/dist/typescript-ZF3IK2DJ.js +5 -0
- package/dist/{utils-X6UXPLKD.js → utils-QFD2PW4X.js} +2 -2
- package/package.json +14 -8
- package/templates/plugin-quick-starter/package.json +2 -2
- package/templates/plugin-starter/package.json +2 -2
- package/templates/project-starter/package.json +4 -4
- package/templates/project-tee-starter/package.json +4 -4
- package/dist/chunk-3RG5ZIWI.js +0 -10
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import "./chunk-2ESYSVXG.js";
|
|
2
|
+
|
|
3
|
+
// src/commands/scenario/src/path-parser.ts
|
|
4
|
+
var pathCache = /* @__PURE__ */ new Map();
|
|
5
|
+
function parseParameterPath(path) {
|
|
6
|
+
if (pathCache.has(path)) {
|
|
7
|
+
return pathCache.get(path);
|
|
8
|
+
}
|
|
9
|
+
if (!path || typeof path !== "string") {
|
|
10
|
+
throw new Error("Path must be a non-empty string");
|
|
11
|
+
}
|
|
12
|
+
if (path.startsWith(".") || path.endsWith(".")) {
|
|
13
|
+
throw new Error("Path cannot start or end with a dot");
|
|
14
|
+
}
|
|
15
|
+
const segments = [];
|
|
16
|
+
let hasArrayAccess = false;
|
|
17
|
+
let currentSegment = "";
|
|
18
|
+
let i = 0;
|
|
19
|
+
let lastCharWasArrayClose = false;
|
|
20
|
+
while (i < path.length) {
|
|
21
|
+
const char = path[i];
|
|
22
|
+
if (char === ".") {
|
|
23
|
+
if (currentSegment === "" && !lastCharWasArrayClose) {
|
|
24
|
+
throw new Error("Empty segment in path (double dots or leading/trailing dots not allowed)");
|
|
25
|
+
} else if (currentSegment === "" && i === 0) {
|
|
26
|
+
throw new Error("Path cannot start or end with a dot");
|
|
27
|
+
} else if (currentSegment !== "") {
|
|
28
|
+
segments.push(currentSegment);
|
|
29
|
+
currentSegment = "";
|
|
30
|
+
}
|
|
31
|
+
lastCharWasArrayClose = false;
|
|
32
|
+
} else if (char === "[") {
|
|
33
|
+
if (currentSegment === "") {
|
|
34
|
+
throw new Error("Array access must follow a property name");
|
|
35
|
+
}
|
|
36
|
+
segments.push(currentSegment);
|
|
37
|
+
currentSegment = "";
|
|
38
|
+
const closingBracket = path.indexOf("]", i);
|
|
39
|
+
if (closingBracket === -1) {
|
|
40
|
+
throw new Error("Missing closing bracket for array index");
|
|
41
|
+
}
|
|
42
|
+
const indexStr = path.substring(i + 1, closingBracket);
|
|
43
|
+
if (!/^\d+$/.test(indexStr)) {
|
|
44
|
+
throw new Error(`Invalid array index: ${indexStr}`);
|
|
45
|
+
}
|
|
46
|
+
const index = parseInt(indexStr, 10);
|
|
47
|
+
segments.push(index);
|
|
48
|
+
hasArrayAccess = true;
|
|
49
|
+
i = closingBracket;
|
|
50
|
+
lastCharWasArrayClose = true;
|
|
51
|
+
} else if (char === "]") {
|
|
52
|
+
throw new Error("Unexpected closing bracket");
|
|
53
|
+
} else {
|
|
54
|
+
currentSegment += char;
|
|
55
|
+
lastCharWasArrayClose = false;
|
|
56
|
+
}
|
|
57
|
+
i++;
|
|
58
|
+
}
|
|
59
|
+
if (currentSegment !== "") {
|
|
60
|
+
segments.push(currentSegment);
|
|
61
|
+
} else if (path.endsWith(".")) {
|
|
62
|
+
throw new Error("Path cannot start or end with a dot");
|
|
63
|
+
}
|
|
64
|
+
if (segments.length === 0) {
|
|
65
|
+
throw new Error("Path cannot be empty");
|
|
66
|
+
}
|
|
67
|
+
for (const segment of segments) {
|
|
68
|
+
if (typeof segment === "string") {
|
|
69
|
+
if (!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(segment)) {
|
|
70
|
+
throw new Error(`Invalid property name in path: '${segment}'`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const result = {
|
|
75
|
+
segments,
|
|
76
|
+
hasArrayAccess,
|
|
77
|
+
originalPath: path
|
|
78
|
+
};
|
|
79
|
+
pathCache.set(path, result);
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
function isValidPathSyntax(path) {
|
|
83
|
+
try {
|
|
84
|
+
parseParameterPath(path);
|
|
85
|
+
return true;
|
|
86
|
+
} catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function normalizeParameterPath(path) {
|
|
91
|
+
if (!path || typeof path !== "string") {
|
|
92
|
+
return "";
|
|
93
|
+
}
|
|
94
|
+
let normalized = path.trim();
|
|
95
|
+
normalized = normalized.replace(/\.+/g, ".");
|
|
96
|
+
normalized = normalized.replace(/^\.+|\.+$/g, "");
|
|
97
|
+
return normalized;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// src/commands/scenario/src/deep-clone.ts
|
|
101
|
+
var cloneCache = /* @__PURE__ */ new WeakMap();
|
|
102
|
+
function deepClone(obj) {
|
|
103
|
+
if (obj === null || typeof obj !== "object") {
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
if (cloneCache.has(obj)) {
|
|
107
|
+
throw new Error("Circular reference detected in object to clone");
|
|
108
|
+
}
|
|
109
|
+
if (obj instanceof Date) {
|
|
110
|
+
return new Date(obj.getTime());
|
|
111
|
+
}
|
|
112
|
+
if (obj instanceof RegExp) {
|
|
113
|
+
return new RegExp(obj.source, obj.flags);
|
|
114
|
+
}
|
|
115
|
+
if (obj instanceof Error) {
|
|
116
|
+
const cloned = new obj.constructor(obj.message);
|
|
117
|
+
cloned.stack = obj.stack;
|
|
118
|
+
cloned.name = obj.name;
|
|
119
|
+
return cloned;
|
|
120
|
+
}
|
|
121
|
+
if (Array.isArray(obj)) {
|
|
122
|
+
cloneCache.set(obj, true);
|
|
123
|
+
try {
|
|
124
|
+
const cloned = obj.map((item) => deepClone(item));
|
|
125
|
+
cloneCache.delete(obj);
|
|
126
|
+
return cloned;
|
|
127
|
+
} catch (error) {
|
|
128
|
+
cloneCache.delete(obj);
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (obj.constructor === Object || obj.constructor === void 0) {
|
|
133
|
+
cloneCache.set(obj, true);
|
|
134
|
+
try {
|
|
135
|
+
const cloned = {};
|
|
136
|
+
for (const key in obj) {
|
|
137
|
+
if (obj.hasOwnProperty(key)) {
|
|
138
|
+
cloned[key] = deepClone(obj[key]);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
cloneCache.delete(obj);
|
|
142
|
+
return cloned;
|
|
143
|
+
} catch (error) {
|
|
144
|
+
cloneCache.delete(obj);
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
const cloned = Object.create(Object.getPrototypeOf(obj));
|
|
150
|
+
cloneCache.set(obj, true);
|
|
151
|
+
for (const key in obj) {
|
|
152
|
+
if (obj.hasOwnProperty(key)) {
|
|
153
|
+
cloned[key] = deepClone(obj[key]);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
cloneCache.delete(obj);
|
|
157
|
+
return cloned;
|
|
158
|
+
} catch {
|
|
159
|
+
return obj;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function hasCircularReference(obj) {
|
|
163
|
+
const visited = /* @__PURE__ */ new WeakSet();
|
|
164
|
+
function checkCircular(current) {
|
|
165
|
+
if (current === null || typeof current !== "object") {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
if (visited.has(current)) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
visited.add(current);
|
|
172
|
+
if (Array.isArray(current)) {
|
|
173
|
+
for (const item of current) {
|
|
174
|
+
if (checkCircular(item)) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
for (const key in current) {
|
|
180
|
+
if (current.hasOwnProperty(key)) {
|
|
181
|
+
if (checkCircular(current[key])) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
return checkCircular(obj);
|
|
190
|
+
}
|
|
191
|
+
function deepCloneWithLimit(obj, maxDepth = 50) {
|
|
192
|
+
function cloneWithDepth(current, depth) {
|
|
193
|
+
if (depth >= maxDepth) {
|
|
194
|
+
if (typeof current === "object" && current !== null) {
|
|
195
|
+
if (Array.isArray(current)) {
|
|
196
|
+
return [...current];
|
|
197
|
+
}
|
|
198
|
+
return { ...current };
|
|
199
|
+
}
|
|
200
|
+
return current;
|
|
201
|
+
}
|
|
202
|
+
if (current === null || typeof current !== "object") {
|
|
203
|
+
return current;
|
|
204
|
+
}
|
|
205
|
+
if (current instanceof Date) {
|
|
206
|
+
return new Date(current.getTime());
|
|
207
|
+
}
|
|
208
|
+
if (current instanceof RegExp) {
|
|
209
|
+
return new RegExp(current.source, current.flags);
|
|
210
|
+
}
|
|
211
|
+
if (Array.isArray(current)) {
|
|
212
|
+
return current.map((item) => cloneWithDepth(item, depth + 1));
|
|
213
|
+
}
|
|
214
|
+
const cloned = {};
|
|
215
|
+
for (const key in current) {
|
|
216
|
+
if (current.hasOwnProperty(key)) {
|
|
217
|
+
cloned[key] = cloneWithDepth(current[key], depth + 1);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return cloned;
|
|
221
|
+
}
|
|
222
|
+
return cloneWithDepth(obj, 0);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/commands/scenario/src/parameter-override.ts
|
|
226
|
+
function validateParameterPath(obj, path) {
|
|
227
|
+
if (!obj || typeof obj !== "object") {
|
|
228
|
+
return {
|
|
229
|
+
isValid: false,
|
|
230
|
+
error: "Target object is null or not an object",
|
|
231
|
+
pathExists: false,
|
|
232
|
+
targetType: typeof obj
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
try {
|
|
236
|
+
const parsedPath = parseParameterPath(path);
|
|
237
|
+
let current = obj;
|
|
238
|
+
let currentPath = "";
|
|
239
|
+
for (let i = 0; i < parsedPath.segments.length; i++) {
|
|
240
|
+
const segment = parsedPath.segments[i];
|
|
241
|
+
if (typeof segment === "number") {
|
|
242
|
+
currentPath += `[${segment}]`;
|
|
243
|
+
if (!Array.isArray(current)) {
|
|
244
|
+
return {
|
|
245
|
+
isValid: false,
|
|
246
|
+
error: `Expected array at path '${currentPath}', but found ${typeof current}`,
|
|
247
|
+
pathExists: false,
|
|
248
|
+
targetType: typeof current
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if (segment >= current.length || segment < 0) {
|
|
252
|
+
return {
|
|
253
|
+
isValid: false,
|
|
254
|
+
error: `Array index ${segment} is out of bounds at path '${currentPath}' (array length: ${current.length})`,
|
|
255
|
+
suggestion: segment >= current.length ? `Use index 0-${current.length - 1} or add more elements to the array` : "Array indices must be non-negative",
|
|
256
|
+
pathExists: false,
|
|
257
|
+
targetType: "array"
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
current = current[segment];
|
|
261
|
+
} else {
|
|
262
|
+
currentPath += currentPath ? `.${segment}` : segment;
|
|
263
|
+
if (!current || typeof current !== "object") {
|
|
264
|
+
return {
|
|
265
|
+
isValid: false,
|
|
266
|
+
error: `Expected object at path '${currentPath}', but found ${typeof current}`,
|
|
267
|
+
pathExists: false,
|
|
268
|
+
targetType: typeof current
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
if (!(segment in current)) {
|
|
272
|
+
const availableProps = Object.keys(current).slice(0, 5);
|
|
273
|
+
const suggestion = availableProps.length > 0 ? `Available properties: ${availableProps.join(", ")}${Object.keys(current).length > 5 ? "..." : ""}` : "Object has no properties";
|
|
274
|
+
return {
|
|
275
|
+
isValid: false,
|
|
276
|
+
error: `Property '${segment}' does not exist at path '${currentPath}'`,
|
|
277
|
+
suggestion,
|
|
278
|
+
pathExists: false,
|
|
279
|
+
targetType: "object"
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
current = current[segment];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
isValid: true,
|
|
287
|
+
pathExists: true,
|
|
288
|
+
targetType: Array.isArray(current) ? "array" : typeof current
|
|
289
|
+
};
|
|
290
|
+
} catch (error) {
|
|
291
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
292
|
+
let suggestion = "";
|
|
293
|
+
if (errorMessage.includes("bracket")) {
|
|
294
|
+
suggestion = "Use bracket notation for arrays: run[0].input instead of run.0.input";
|
|
295
|
+
} else if (errorMessage.includes("invalid")) {
|
|
296
|
+
suggestion = "Check path syntax: use dots for objects and brackets for arrays";
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
isValid: false,
|
|
300
|
+
error: `Invalid path format: ${errorMessage}`,
|
|
301
|
+
suggestion,
|
|
302
|
+
pathExists: false
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function validateParameterPathLegacy(obj, path) {
|
|
307
|
+
const result = validateParameterPath(obj, path);
|
|
308
|
+
return result.isValid;
|
|
309
|
+
}
|
|
310
|
+
function getValueAtPath(obj, path) {
|
|
311
|
+
const parsedPath = parseParameterPath(path);
|
|
312
|
+
let current = obj;
|
|
313
|
+
for (let i = 0; i < parsedPath.segments.length; i++) {
|
|
314
|
+
const segment = parsedPath.segments[i];
|
|
315
|
+
if (typeof segment === "number") {
|
|
316
|
+
if (!Array.isArray(current)) {
|
|
317
|
+
throw new Error(
|
|
318
|
+
`Expected array at path segment, but found ${typeof current} in path: ${path}`
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
if (segment >= current.length || segment < 0) {
|
|
322
|
+
throw new Error(`Array index out of bounds: ${segment} in path: ${path}`);
|
|
323
|
+
}
|
|
324
|
+
current = current[segment];
|
|
325
|
+
} else {
|
|
326
|
+
if (!current || typeof current !== "object") {
|
|
327
|
+
throw new Error(
|
|
328
|
+
`Expected object at path segment, but found ${typeof current} in path: ${path}`
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
if (!(segment in current)) {
|
|
332
|
+
throw new Error(`Property '${segment}' not found in path: ${path}`);
|
|
333
|
+
}
|
|
334
|
+
current = current[segment];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return current;
|
|
338
|
+
}
|
|
339
|
+
function setValueAtPath(obj, path, value) {
|
|
340
|
+
const parsedPath = parseParameterPath(path);
|
|
341
|
+
let current = obj;
|
|
342
|
+
for (let i = 0; i < parsedPath.segments.length - 1; i++) {
|
|
343
|
+
const segment = parsedPath.segments[i];
|
|
344
|
+
if (typeof segment === "number") {
|
|
345
|
+
if (!Array.isArray(current)) {
|
|
346
|
+
throw new Error(
|
|
347
|
+
`Expected array at path segment, but found ${typeof current} in path: ${path}`
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
if (segment >= current.length || segment < 0) {
|
|
351
|
+
throw new Error(`Array index out of bounds: ${segment} in path: ${path}`);
|
|
352
|
+
}
|
|
353
|
+
current = current[segment];
|
|
354
|
+
} else {
|
|
355
|
+
if (!current || typeof current !== "object") {
|
|
356
|
+
throw new Error(
|
|
357
|
+
`Expected object at path segment, but found ${typeof current} in path: ${path}`
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
if (!(segment in current)) {
|
|
361
|
+
throw new Error(`Property '${segment}' not found in path: ${path}`);
|
|
362
|
+
}
|
|
363
|
+
current = current[segment];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
const finalSegment = parsedPath.segments[parsedPath.segments.length - 1];
|
|
367
|
+
if (typeof finalSegment === "number") {
|
|
368
|
+
if (!Array.isArray(current)) {
|
|
369
|
+
throw new Error(
|
|
370
|
+
`Expected array for final segment, but found ${typeof current} in path: ${path}`
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
if (finalSegment >= current.length || finalSegment < 0) {
|
|
374
|
+
throw new Error(`Array index out of bounds: ${finalSegment} in path: ${path}`);
|
|
375
|
+
}
|
|
376
|
+
current[finalSegment] = value;
|
|
377
|
+
} else {
|
|
378
|
+
if (!current || typeof current !== "object") {
|
|
379
|
+
throw new Error(
|
|
380
|
+
`Expected object for final segment, but found ${typeof current} in path: ${path}`
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
current[finalSegment] = value;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function applyParameterOverride(scenario, path, value) {
|
|
387
|
+
const clonedScenario = deepClone(scenario);
|
|
388
|
+
setValueAtPath(clonedScenario, path, value);
|
|
389
|
+
return clonedScenario;
|
|
390
|
+
}
|
|
391
|
+
function applyMatrixOverrides(baseScenario, overrides) {
|
|
392
|
+
const parameterOverrides = Object.entries(overrides).map(
|
|
393
|
+
([path, value]) => ({
|
|
394
|
+
path,
|
|
395
|
+
value
|
|
396
|
+
})
|
|
397
|
+
);
|
|
398
|
+
return applyParameterOverrides(baseScenario, parameterOverrides);
|
|
399
|
+
}
|
|
400
|
+
function applyParameterOverrides(baseScenario, overrides) {
|
|
401
|
+
if (!baseScenario || typeof baseScenario !== "object") {
|
|
402
|
+
throw new Error("Base scenario must be a valid object");
|
|
403
|
+
}
|
|
404
|
+
if (!Array.isArray(overrides)) {
|
|
405
|
+
throw new Error("Overrides must be an array");
|
|
406
|
+
}
|
|
407
|
+
const modifiedScenario = deepClone(baseScenario);
|
|
408
|
+
for (const override of overrides) {
|
|
409
|
+
if (!override || typeof override !== "object") {
|
|
410
|
+
throw new Error("Each override must be an object with path and value properties");
|
|
411
|
+
}
|
|
412
|
+
if (!override.path || typeof override.path !== "string") {
|
|
413
|
+
throw new Error("Override path must be a non-empty string");
|
|
414
|
+
}
|
|
415
|
+
try {
|
|
416
|
+
const parsedPath = parseParameterPath(override.path);
|
|
417
|
+
let current = modifiedScenario;
|
|
418
|
+
for (let i = 0; i < parsedPath.segments.length; i++) {
|
|
419
|
+
const segment = parsedPath.segments[i];
|
|
420
|
+
if (typeof segment === "number") {
|
|
421
|
+
if (!Array.isArray(current)) {
|
|
422
|
+
throw new Error(`Expected array but found ${typeof current} at path: ${override.path}`);
|
|
423
|
+
}
|
|
424
|
+
if (segment >= current.length || segment < 0) {
|
|
425
|
+
throw new Error(`Array index out of bounds: ${segment} in path: ${override.path}`);
|
|
426
|
+
}
|
|
427
|
+
current = current[segment];
|
|
428
|
+
} else {
|
|
429
|
+
if (!current || typeof current !== "object" || !(segment in current)) {
|
|
430
|
+
throw new Error(`Invalid parameter path: ${override.path}`);
|
|
431
|
+
}
|
|
432
|
+
current = current[segment];
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
} catch (error) {
|
|
436
|
+
if (error instanceof Error) {
|
|
437
|
+
throw error;
|
|
438
|
+
}
|
|
439
|
+
throw new Error(`Invalid parameter path: ${override.path}`);
|
|
440
|
+
}
|
|
441
|
+
try {
|
|
442
|
+
setValueAtPath(modifiedScenario, override.path, override.value);
|
|
443
|
+
} catch (error) {
|
|
444
|
+
if (error instanceof Error) {
|
|
445
|
+
throw new Error(`Failed to apply override for path '${override.path}': ${error.message}`);
|
|
446
|
+
}
|
|
447
|
+
throw error;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return modifiedScenario;
|
|
451
|
+
}
|
|
452
|
+
function combinationToOverrides(combination) {
|
|
453
|
+
return Object.entries(combination).map(([path, value]) => ({
|
|
454
|
+
path,
|
|
455
|
+
value
|
|
456
|
+
}));
|
|
457
|
+
}
|
|
458
|
+
function validateMatrixParameterPaths(baseScenario, matrixAxes) {
|
|
459
|
+
const invalidPaths = [];
|
|
460
|
+
for (const axis of matrixAxes) {
|
|
461
|
+
const validation = validateParameterPath(baseScenario, axis.parameter);
|
|
462
|
+
if (!validation.isValid) {
|
|
463
|
+
invalidPaths.push(axis.parameter);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return {
|
|
467
|
+
valid: invalidPaths.length === 0,
|
|
468
|
+
invalidPaths
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
export {
|
|
472
|
+
applyMatrixOverrides,
|
|
473
|
+
applyParameterOverride,
|
|
474
|
+
applyParameterOverrides,
|
|
475
|
+
combinationToOverrides,
|
|
476
|
+
deepClone,
|
|
477
|
+
deepCloneWithLimit,
|
|
478
|
+
getValueAtPath,
|
|
479
|
+
hasCircularReference,
|
|
480
|
+
isValidPathSyntax,
|
|
481
|
+
normalizeParameterPath,
|
|
482
|
+
parseParameterPath,
|
|
483
|
+
setValueAtPath,
|
|
484
|
+
validateMatrixParameterPaths,
|
|
485
|
+
validateParameterPath,
|
|
486
|
+
validateParameterPathLegacy
|
|
487
|
+
};
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
setEnvVar,
|
|
25
25
|
setGitHubToken,
|
|
26
26
|
validateDataDir
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Q6M2K53X.js";
|
|
28
28
|
import "./chunk-FQYWRHLX.js";
|
|
29
29
|
import "./chunk-GXWWPFBO.js";
|
|
30
30
|
import "./chunk-I4L4T7QX.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-2ESYSVXG.js";
|
|
32
32
|
export {
|
|
33
33
|
checkDataDir,
|
|
34
34
|
ensureElizaDir,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ResourceMonitor,
|
|
3
|
+
calculateDiskUsage,
|
|
4
|
+
createResourceMonitor,
|
|
5
|
+
formatBytes,
|
|
6
|
+
getSystemResources
|
|
7
|
+
} from "./chunk-3AEYIKBZ.js";
|
|
8
|
+
import "./chunk-2ESYSVXG.js";
|
|
9
|
+
export {
|
|
10
|
+
ResourceMonitor,
|
|
11
|
+
calculateDiskUsage,
|
|
12
|
+
createResourceMonitor,
|
|
13
|
+
formatBytes,
|
|
14
|
+
getSystemResources
|
|
15
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkDiskSpace,
|
|
3
|
+
cleanupIsolatedEnvironment,
|
|
4
|
+
createIsolatedEnvironment,
|
|
5
|
+
createIsolatedEnvironmentVariables,
|
|
6
|
+
ensureIsolatedDatabase,
|
|
7
|
+
estimateRunDiskSpace,
|
|
8
|
+
generateRunId,
|
|
9
|
+
getIsolatedTempDir,
|
|
10
|
+
monitorIsolatedResources,
|
|
11
|
+
resetRunSequence,
|
|
12
|
+
validateIsolationContext,
|
|
13
|
+
writeTemporaryScenario
|
|
14
|
+
} from "./chunk-LBZLMFFF.js";
|
|
15
|
+
import "./chunk-2ESYSVXG.js";
|
|
16
|
+
export {
|
|
17
|
+
checkDiskSpace,
|
|
18
|
+
cleanupIsolatedEnvironment,
|
|
19
|
+
createIsolatedEnvironment,
|
|
20
|
+
createIsolatedEnvironmentVariables,
|
|
21
|
+
ensureIsolatedDatabase,
|
|
22
|
+
estimateRunDiskSpace,
|
|
23
|
+
generateRunId,
|
|
24
|
+
getIsolatedTempDir,
|
|
25
|
+
monitorIsolatedResources,
|
|
26
|
+
resetRunSequence,
|
|
27
|
+
validateIsolationContext,
|
|
28
|
+
writeTemporaryScenario
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
askAgentViaApi,
|
|
3
|
+
createScenarioAgent,
|
|
4
|
+
createScenarioServer,
|
|
5
|
+
createScenarioServerAndAgent,
|
|
6
|
+
shutdownScenarioServer
|
|
7
|
+
} from "./chunk-PUZHCSGF.js";
|
|
8
|
+
import "./chunk-WX37MM4G.js";
|
|
9
|
+
import "./chunk-I57T3WPO.js";
|
|
10
|
+
import "./chunk-5IWKEMEF.js";
|
|
11
|
+
import "./chunk-Q6M2K53X.js";
|
|
12
|
+
import "./chunk-FQYWRHLX.js";
|
|
13
|
+
import "./chunk-GXWWPFBO.js";
|
|
14
|
+
import "./chunk-I4L4T7QX.js";
|
|
15
|
+
import "./chunk-2ESYSVXG.js";
|
|
16
|
+
export {
|
|
17
|
+
askAgentViaApi,
|
|
18
|
+
createScenarioAgent,
|
|
19
|
+
createScenarioServer,
|
|
20
|
+
createScenarioServerAndAgent,
|
|
21
|
+
shutdownScenarioServer
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CapabilityCheckSchema,
|
|
3
|
+
EnhancedEvaluationResultSchema,
|
|
4
|
+
EvaluationSchema,
|
|
5
|
+
LLMJudgeResultSchema,
|
|
6
|
+
ScenarioRunResultSchema,
|
|
7
|
+
ScenarioSchema
|
|
8
|
+
} from "./chunk-NHKLUXNE.js";
|
|
9
|
+
import "./chunk-2ESYSVXG.js";
|
|
10
|
+
export {
|
|
11
|
+
CapabilityCheckSchema,
|
|
12
|
+
EnhancedEvaluationResultSchema,
|
|
13
|
+
EvaluationSchema,
|
|
14
|
+
LLMJudgeResultSchema,
|
|
15
|
+
ScenarioRunResultSchema,
|
|
16
|
+
ScenarioSchema
|
|
17
|
+
};
|