@wix/evalforge-types 0.3.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/build/index.js +1047 -0
- package/build/index.js.map +7 -0
- package/build/index.mjs +928 -0
- package/build/index.mjs.map +7 -0
- package/build/types/common/base-entity.d.ts +26 -0
- package/build/types/common/index.d.ts +3 -0
- package/build/types/common/mcp.d.ts +17 -0
- package/build/types/common/models.d.ts +55 -0
- package/build/types/evaluation/eval-result.d.ts +239 -0
- package/build/types/evaluation/eval-run.d.ts +581 -0
- package/build/types/evaluation/index.d.ts +4 -0
- package/build/types/evaluation/live-trace.d.ts +47 -0
- package/build/types/evaluation/metrics.d.ts +157 -0
- package/build/types/improvement/improvement.d.ts +140 -0
- package/build/types/improvement/index.d.ts +1 -0
- package/build/types/index.d.ts +24 -0
- package/build/types/project/index.d.ts +1 -0
- package/build/types/project/project.d.ts +41 -0
- package/build/types/scenario/environment.d.ts +58 -0
- package/build/types/scenario/index.d.ts +2 -0
- package/build/types/scenario/test-scenario.d.ts +50 -0
- package/build/types/suite/index.d.ts +1 -0
- package/build/types/suite/test-suite.d.ts +37 -0
- package/build/types/target/agent.d.ts +53 -0
- package/build/types/target/index.d.ts +4 -0
- package/build/types/target/skill.d.ts +78 -0
- package/build/types/target/skills-group.d.ts +37 -0
- package/build/types/target/target.d.ts +17 -0
- package/build/types/template/index.d.ts +1 -0
- package/build/types/template/template.d.ts +38 -0
- package/build/types/test/base.d.ts +43 -0
- package/build/types/test/build-check.d.ts +29 -0
- package/build/types/test/command-execution.d.ts +31 -0
- package/build/types/test/file-content.d.ts +52 -0
- package/build/types/test/file-presence.d.ts +24 -0
- package/build/types/test/index.d.ts +124 -0
- package/build/types/test/llm.d.ts +36 -0
- package/build/types/test/playwright-nl.d.ts +28 -0
- package/build/types/test/site-config.d.ts +32 -0
- package/build/types/test/tool.d.ts +26 -0
- package/build/types/test/vitest.d.ts +30 -0
- package/package.json +50 -0
package/build/index.mjs
ADDED
|
@@ -0,0 +1,928 @@
|
|
|
1
|
+
// src/common/base-entity.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var BaseEntitySchema = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
description: z.string(),
|
|
7
|
+
createdAt: z.string(),
|
|
8
|
+
updatedAt: z.string(),
|
|
9
|
+
deleted: z.boolean().optional()
|
|
10
|
+
});
|
|
11
|
+
var TenantEntitySchema = BaseEntitySchema.extend({
|
|
12
|
+
projectId: z.string()
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
// src/common/mcp.ts
|
|
16
|
+
import { z as z2 } from "zod";
|
|
17
|
+
var MCPServerConfigSchema = z2.object({
|
|
18
|
+
/** Unique name for this MCP server */
|
|
19
|
+
name: z2.string(),
|
|
20
|
+
/** Command to start the MCP server */
|
|
21
|
+
command: z2.string(),
|
|
22
|
+
/** Command line arguments */
|
|
23
|
+
args: z2.array(z2.string()).optional(),
|
|
24
|
+
/** Environment variables for the server process */
|
|
25
|
+
envVars: z2.record(z2.string(), z2.string()).optional(),
|
|
26
|
+
/** Tools to disable for this MCP server */
|
|
27
|
+
disabledTools: z2.array(z2.string()).optional()
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// src/common/models.ts
|
|
31
|
+
import { z as z3 } from "zod";
|
|
32
|
+
var ModelIds = /* @__PURE__ */ ((ModelIds2) => {
|
|
33
|
+
ModelIds2["CLAUDE_3_HAIKU_1_0"] = "CLAUDE_3_HAIKU_1_0";
|
|
34
|
+
ModelIds2["CLAUDE_3_OPUS_1_0"] = "CLAUDE_3_OPUS_1_0";
|
|
35
|
+
ModelIds2["CLAUDE_3_SONNET_1_0"] = "CLAUDE_3_SONNET_1_0";
|
|
36
|
+
ModelIds2["CLAUDE_3_5_SONNET_1_0"] = "CLAUDE_3_5_SONNET_1_0";
|
|
37
|
+
ModelIds2["CLAUDE_3_5_SONNET_2_0"] = "CLAUDE_3_5_SONNET_2_0";
|
|
38
|
+
ModelIds2["CLAUDE_3_7_SONNET_1_0"] = "CLAUDE_3_7_SONNET_1_0";
|
|
39
|
+
ModelIds2["CLAUDE_4_OPUS_1_0"] = "CLAUDE_4_OPUS_1_0";
|
|
40
|
+
ModelIds2["CLAUDE_4_SONNET_1_0"] = "CLAUDE_4_SONNET_1_0";
|
|
41
|
+
return ModelIds2;
|
|
42
|
+
})(ModelIds || {});
|
|
43
|
+
var ModelIdsSchema = z3.enum(ModelIds);
|
|
44
|
+
var ModelConfigSchema = z3.object({
|
|
45
|
+
model: ModelIdsSchema,
|
|
46
|
+
temperature: z3.number().min(0).max(1).optional(),
|
|
47
|
+
maxTokens: z3.number().min(1).optional()
|
|
48
|
+
});
|
|
49
|
+
var ModelPricingSchema = z3.object({
|
|
50
|
+
inputPer1M: z3.number(),
|
|
51
|
+
outputPer1M: z3.number()
|
|
52
|
+
});
|
|
53
|
+
var ModelSchema = z3.object({
|
|
54
|
+
/** AI Gateway model ID */
|
|
55
|
+
id: ModelIdsSchema,
|
|
56
|
+
/** Display name */
|
|
57
|
+
name: z3.string(),
|
|
58
|
+
/** Provider (always 'anthropic') */
|
|
59
|
+
provider: z3.literal("anthropic"),
|
|
60
|
+
/** Provider's model identifier (e.g., "claude-3-5-sonnet-20241022") */
|
|
61
|
+
providerModelId: z3.string(),
|
|
62
|
+
/** Pricing per 1M tokens */
|
|
63
|
+
pricing: ModelPricingSchema
|
|
64
|
+
});
|
|
65
|
+
var AVAILABLE_MODELS = [
|
|
66
|
+
{
|
|
67
|
+
id: "CLAUDE_4_SONNET_1_0" /* CLAUDE_4_SONNET_1_0 */,
|
|
68
|
+
name: "Claude 4 Sonnet",
|
|
69
|
+
provider: "anthropic",
|
|
70
|
+
providerModelId: "claude-4-sonnet",
|
|
71
|
+
pricing: { inputPer1M: 3, outputPer1M: 15 }
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "CLAUDE_4_OPUS_1_0" /* CLAUDE_4_OPUS_1_0 */,
|
|
75
|
+
name: "Claude 4 Opus",
|
|
76
|
+
provider: "anthropic",
|
|
77
|
+
providerModelId: "claude-4-opus",
|
|
78
|
+
pricing: { inputPer1M: 15, outputPer1M: 75 }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "CLAUDE_3_7_SONNET_1_0" /* CLAUDE_3_7_SONNET_1_0 */,
|
|
82
|
+
name: "Claude 3.7 Sonnet",
|
|
83
|
+
provider: "anthropic",
|
|
84
|
+
providerModelId: "claude-3-7-sonnet",
|
|
85
|
+
pricing: { inputPer1M: 3, outputPer1M: 15 }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "CLAUDE_3_5_SONNET_2_0" /* CLAUDE_3_5_SONNET_2_0 */,
|
|
89
|
+
name: "Claude 3.5 Sonnet v2",
|
|
90
|
+
provider: "anthropic",
|
|
91
|
+
providerModelId: "claude-3-5-sonnet-20241022",
|
|
92
|
+
pricing: { inputPer1M: 3, outputPer1M: 15 }
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "CLAUDE_3_5_SONNET_1_0" /* CLAUDE_3_5_SONNET_1_0 */,
|
|
96
|
+
name: "Claude 3.5 Sonnet",
|
|
97
|
+
provider: "anthropic",
|
|
98
|
+
providerModelId: "claude-3-5-sonnet-20240620",
|
|
99
|
+
pricing: { inputPer1M: 3, outputPer1M: 15 }
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "CLAUDE_3_OPUS_1_0" /* CLAUDE_3_OPUS_1_0 */,
|
|
103
|
+
name: "Claude 3 Opus",
|
|
104
|
+
provider: "anthropic",
|
|
105
|
+
providerModelId: "claude-3-opus-20240229",
|
|
106
|
+
pricing: { inputPer1M: 15, outputPer1M: 75 }
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "CLAUDE_3_SONNET_1_0" /* CLAUDE_3_SONNET_1_0 */,
|
|
110
|
+
name: "Claude 3 Sonnet",
|
|
111
|
+
provider: "anthropic",
|
|
112
|
+
providerModelId: "claude-3-sonnet-20240229",
|
|
113
|
+
pricing: { inputPer1M: 3, outputPer1M: 15 }
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "CLAUDE_3_HAIKU_1_0" /* CLAUDE_3_HAIKU_1_0 */,
|
|
117
|
+
name: "Claude 3 Haiku",
|
|
118
|
+
provider: "anthropic",
|
|
119
|
+
providerModelId: "claude-3-haiku-20240307",
|
|
120
|
+
pricing: { inputPer1M: 0.25, outputPer1M: 1.25 }
|
|
121
|
+
}
|
|
122
|
+
];
|
|
123
|
+
var AVAILABLE_MODELS_MAP = Object.fromEntries(
|
|
124
|
+
AVAILABLE_MODELS.map((model) => [model.id, model])
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
// src/target/target.ts
|
|
128
|
+
var TargetSchema = TenantEntitySchema.extend({
|
|
129
|
+
// Base for all testable entities
|
|
130
|
+
// Specific targets add their own fields
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// src/target/agent.ts
|
|
134
|
+
import { z as z4 } from "zod";
|
|
135
|
+
var AgentSchema = TargetSchema.extend({
|
|
136
|
+
/** Command to run the agent */
|
|
137
|
+
runCommand: z4.string(),
|
|
138
|
+
/** Optional model configuration override */
|
|
139
|
+
modelConfig: ModelConfigSchema.optional()
|
|
140
|
+
});
|
|
141
|
+
var CreateAgentInputSchema = AgentSchema.omit({
|
|
142
|
+
id: true,
|
|
143
|
+
createdAt: true,
|
|
144
|
+
updatedAt: true,
|
|
145
|
+
deleted: true
|
|
146
|
+
});
|
|
147
|
+
var UpdateAgentInputSchema = CreateAgentInputSchema.partial();
|
|
148
|
+
|
|
149
|
+
// src/target/skill.ts
|
|
150
|
+
import { z as z5 } from "zod";
|
|
151
|
+
var SkillMetadataSchema = z5.object({
|
|
152
|
+
name: z5.string(),
|
|
153
|
+
description: z5.string(),
|
|
154
|
+
allowedTools: z5.array(z5.string()).optional(),
|
|
155
|
+
skills: z5.array(z5.string()).optional()
|
|
156
|
+
});
|
|
157
|
+
var SkillVersionSchema = z5.object({
|
|
158
|
+
id: z5.string(),
|
|
159
|
+
skillId: z5.string(),
|
|
160
|
+
skillMd: z5.string(),
|
|
161
|
+
metadata: SkillMetadataSchema,
|
|
162
|
+
model: ModelConfigSchema.optional(),
|
|
163
|
+
systemPrompt: z5.string().optional(),
|
|
164
|
+
version: z5.number(),
|
|
165
|
+
createdAt: z5.string(),
|
|
166
|
+
notes: z5.string().optional()
|
|
167
|
+
});
|
|
168
|
+
var SkillSchema = TargetSchema.extend({
|
|
169
|
+
/** The current SKILL.md content */
|
|
170
|
+
skillMd: z5.string()
|
|
171
|
+
});
|
|
172
|
+
var CreateSkillInputSchema = SkillSchema.omit({
|
|
173
|
+
id: true,
|
|
174
|
+
createdAt: true,
|
|
175
|
+
updatedAt: true,
|
|
176
|
+
deleted: true
|
|
177
|
+
});
|
|
178
|
+
var UpdateSkillInputSchema = CreateSkillInputSchema.partial();
|
|
179
|
+
|
|
180
|
+
// src/target/skills-group.ts
|
|
181
|
+
import { z as z6 } from "zod";
|
|
182
|
+
var SkillsGroupSchema = TenantEntitySchema.extend({
|
|
183
|
+
/** IDs of skills in this group */
|
|
184
|
+
skillIds: z6.array(z6.string())
|
|
185
|
+
});
|
|
186
|
+
var CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({
|
|
187
|
+
id: true,
|
|
188
|
+
createdAt: true,
|
|
189
|
+
updatedAt: true,
|
|
190
|
+
deleted: true
|
|
191
|
+
});
|
|
192
|
+
var UpdateSkillsGroupInputSchema = CreateSkillsGroupInputSchema.partial();
|
|
193
|
+
|
|
194
|
+
// src/test/index.ts
|
|
195
|
+
import { z as z17 } from "zod";
|
|
196
|
+
|
|
197
|
+
// src/test/base.ts
|
|
198
|
+
import { z as z7 } from "zod";
|
|
199
|
+
var TestType = /* @__PURE__ */ ((TestType2) => {
|
|
200
|
+
TestType2["LLM"] = "LLM";
|
|
201
|
+
TestType2["TOOL"] = "TOOL";
|
|
202
|
+
TestType2["SITE_CONFIG"] = "SITE_CONFIG";
|
|
203
|
+
TestType2["COMMAND_EXECUTION"] = "COMMAND_EXECUTION";
|
|
204
|
+
TestType2["FILE_PRESENCE"] = "FILE_PRESENCE";
|
|
205
|
+
TestType2["FILE_CONTENT"] = "FILE_CONTENT";
|
|
206
|
+
TestType2["BUILD_CHECK"] = "BUILD_CHECK";
|
|
207
|
+
TestType2["VITEST"] = "VITEST";
|
|
208
|
+
TestType2["PLAYWRIGHT_NL"] = "PLAYWRIGHT_NL";
|
|
209
|
+
return TestType2;
|
|
210
|
+
})(TestType || {});
|
|
211
|
+
var TestTypeSchema = z7.enum(TestType);
|
|
212
|
+
var TestImportance = /* @__PURE__ */ ((TestImportance2) => {
|
|
213
|
+
TestImportance2["LOW"] = "low";
|
|
214
|
+
TestImportance2["MEDIUM"] = "medium";
|
|
215
|
+
TestImportance2["HIGH"] = "high";
|
|
216
|
+
TestImportance2["CRITICAL"] = "critical";
|
|
217
|
+
return TestImportance2;
|
|
218
|
+
})(TestImportance || {});
|
|
219
|
+
var TestImportanceSchema = z7.enum(TestImportance);
|
|
220
|
+
var BaseTestSchema = z7.object({
|
|
221
|
+
id: z7.string(),
|
|
222
|
+
type: TestTypeSchema,
|
|
223
|
+
name: z7.string().min(3),
|
|
224
|
+
description: z7.string().optional(),
|
|
225
|
+
importance: TestImportanceSchema.optional()
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// src/test/llm.ts
|
|
229
|
+
import { z as z8 } from "zod";
|
|
230
|
+
var LLMTestSchema = BaseTestSchema.extend({
|
|
231
|
+
type: z8.literal("LLM" /* LLM */),
|
|
232
|
+
/** Maximum steps for the LLM to take */
|
|
233
|
+
maxSteps: z8.number().min(1).max(100),
|
|
234
|
+
/** Prompt to send to the evaluator */
|
|
235
|
+
prompt: z8.string().min(1),
|
|
236
|
+
/** ID of the evaluator agent to use */
|
|
237
|
+
evaluatorId: z8.string()
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// src/test/tool.ts
|
|
241
|
+
import { z as z9 } from "zod";
|
|
242
|
+
var ToolTestSchema = BaseTestSchema.extend({
|
|
243
|
+
type: z9.literal("TOOL" /* TOOL */),
|
|
244
|
+
/** Name of the tool that should be called */
|
|
245
|
+
toolName: z9.string().min(3),
|
|
246
|
+
/** Expected arguments for the tool call */
|
|
247
|
+
args: z9.record(z9.string(), z9.any()),
|
|
248
|
+
/** Expected content in the tool results */
|
|
249
|
+
resultsContent: z9.string()
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
// src/test/site-config.ts
|
|
253
|
+
import { z as z10 } from "zod";
|
|
254
|
+
var SiteConfigTestSchema = BaseTestSchema.extend({
|
|
255
|
+
type: z10.literal("SITE_CONFIG" /* SITE_CONFIG */),
|
|
256
|
+
/** URL to call */
|
|
257
|
+
url: z10.string().url(),
|
|
258
|
+
/** HTTP method */
|
|
259
|
+
method: z10.enum(["GET", "POST"]),
|
|
260
|
+
/** Request body (for POST) */
|
|
261
|
+
body: z10.string().optional(),
|
|
262
|
+
/** Expected HTTP status code */
|
|
263
|
+
expectedStatusCode: z10.number().int().min(100).max(599),
|
|
264
|
+
/** Expected response content */
|
|
265
|
+
expectedResponse: z10.string().optional(),
|
|
266
|
+
/** JMESPath expression to extract from response */
|
|
267
|
+
expectedResponseJMESPath: z10.string().optional()
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// src/test/command-execution.ts
|
|
271
|
+
import { z as z11 } from "zod";
|
|
272
|
+
var AllowedCommands = [
|
|
273
|
+
"yarn install --no-immutable && yarn build",
|
|
274
|
+
"npm run build",
|
|
275
|
+
"yarn typecheck"
|
|
276
|
+
];
|
|
277
|
+
var CommandExecutionTestSchema = BaseTestSchema.extend({
|
|
278
|
+
type: z11.literal("COMMAND_EXECUTION" /* COMMAND_EXECUTION */),
|
|
279
|
+
/** Command to execute (must be in AllowedCommands) */
|
|
280
|
+
command: z11.string().refine((value) => AllowedCommands.includes(value), {
|
|
281
|
+
message: `Command must be one of: ${AllowedCommands.join(", ")}`
|
|
282
|
+
}),
|
|
283
|
+
/** Expected exit code (default: 0) */
|
|
284
|
+
expectedExitCode: z11.number().default(0).optional()
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// src/test/file-presence.ts
|
|
288
|
+
import { z as z12 } from "zod";
|
|
289
|
+
var FilePresenceTestSchema = BaseTestSchema.extend({
|
|
290
|
+
type: z12.literal("FILE_PRESENCE" /* FILE_PRESENCE */),
|
|
291
|
+
/** Paths to check */
|
|
292
|
+
paths: z12.array(z12.string()),
|
|
293
|
+
/** Whether files should exist (true) or not exist (false) */
|
|
294
|
+
shouldExist: z12.boolean()
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// src/test/file-content.ts
|
|
298
|
+
import { z as z13 } from "zod";
|
|
299
|
+
var FileContentCheckSchema = z13.object({
|
|
300
|
+
/** Strings that must be present in the file */
|
|
301
|
+
contains: z13.array(z13.string()).optional(),
|
|
302
|
+
/** Strings that must NOT be present in the file */
|
|
303
|
+
notContains: z13.array(z13.string()).optional(),
|
|
304
|
+
/** Regex pattern the content must match */
|
|
305
|
+
matches: z13.string().optional(),
|
|
306
|
+
/** JSON path checks for structured content */
|
|
307
|
+
jsonPath: z13.array(
|
|
308
|
+
z13.object({
|
|
309
|
+
path: z13.string(),
|
|
310
|
+
value: z13.unknown()
|
|
311
|
+
})
|
|
312
|
+
).optional(),
|
|
313
|
+
/** Lines that should be added (for diff checking) */
|
|
314
|
+
added: z13.array(z13.string()).optional(),
|
|
315
|
+
/** Lines that should be removed (for diff checking) */
|
|
316
|
+
removed: z13.array(z13.string()).optional()
|
|
317
|
+
});
|
|
318
|
+
var FileContentTestSchema = BaseTestSchema.extend({
|
|
319
|
+
type: z13.literal("FILE_CONTENT" /* FILE_CONTENT */),
|
|
320
|
+
/** Path to the file to check */
|
|
321
|
+
path: z13.string(),
|
|
322
|
+
/** Content checks to perform */
|
|
323
|
+
checks: FileContentCheckSchema
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// src/test/build-check.ts
|
|
327
|
+
import { z as z14 } from "zod";
|
|
328
|
+
var BuildCheckTestSchema = BaseTestSchema.extend({
|
|
329
|
+
type: z14.literal("BUILD_CHECK" /* BUILD_CHECK */),
|
|
330
|
+
/** Build command to execute */
|
|
331
|
+
command: z14.string(),
|
|
332
|
+
/** Whether the build should succeed */
|
|
333
|
+
expectSuccess: z14.boolean(),
|
|
334
|
+
/** Maximum allowed warnings (optional) */
|
|
335
|
+
allowedWarnings: z14.number().optional(),
|
|
336
|
+
/** Timeout in milliseconds */
|
|
337
|
+
timeout: z14.number().optional()
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
// src/test/vitest.ts
|
|
341
|
+
import { z as z15 } from "zod";
|
|
342
|
+
var VitestTestSchema = BaseTestSchema.extend({
|
|
343
|
+
type: z15.literal("VITEST" /* VITEST */),
|
|
344
|
+
/** Test file content */
|
|
345
|
+
testFile: z15.string(),
|
|
346
|
+
/** Name of the test file */
|
|
347
|
+
testFileName: z15.string(),
|
|
348
|
+
/** Minimum pass rate required (0-100) */
|
|
349
|
+
minPassRate: z15.number().min(0).max(100)
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// src/test/playwright-nl.ts
|
|
353
|
+
import { z as z16 } from "zod";
|
|
354
|
+
var PlaywrightNLTestSchema = BaseTestSchema.extend({
|
|
355
|
+
type: z16.literal("PLAYWRIGHT_NL" /* PLAYWRIGHT_NL */),
|
|
356
|
+
/** Natural language steps to execute */
|
|
357
|
+
steps: z16.array(z16.string()),
|
|
358
|
+
/** Expected outcome description */
|
|
359
|
+
expectedOutcome: z16.string(),
|
|
360
|
+
/** Timeout in milliseconds */
|
|
361
|
+
timeout: z16.number().optional()
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
// src/test/index.ts
|
|
365
|
+
var TestSchema = z17.discriminatedUnion("type", [
|
|
366
|
+
LLMTestSchema,
|
|
367
|
+
ToolTestSchema,
|
|
368
|
+
SiteConfigTestSchema,
|
|
369
|
+
CommandExecutionTestSchema,
|
|
370
|
+
FilePresenceTestSchema,
|
|
371
|
+
FileContentTestSchema,
|
|
372
|
+
BuildCheckTestSchema,
|
|
373
|
+
VitestTestSchema,
|
|
374
|
+
PlaywrightNLTestSchema
|
|
375
|
+
]);
|
|
376
|
+
|
|
377
|
+
// src/scenario/environment.ts
|
|
378
|
+
import { z as z18 } from "zod";
|
|
379
|
+
var LocalProjectConfigSchema = z18.object({
|
|
380
|
+
/** Template ID to use for the local project */
|
|
381
|
+
templateId: z18.string().optional(),
|
|
382
|
+
/** Files to create in the project */
|
|
383
|
+
files: z18.array(
|
|
384
|
+
z18.object({
|
|
385
|
+
path: z18.string().min(1),
|
|
386
|
+
content: z18.string().min(1)
|
|
387
|
+
})
|
|
388
|
+
).optional()
|
|
389
|
+
});
|
|
390
|
+
var MetaSiteConfigSchema = z18.object({
|
|
391
|
+
configurations: z18.array(
|
|
392
|
+
z18.object({
|
|
393
|
+
name: z18.string().min(1),
|
|
394
|
+
apiCalls: z18.array(
|
|
395
|
+
z18.object({
|
|
396
|
+
url: z18.string().url(),
|
|
397
|
+
method: z18.enum(["POST", "PUT"]),
|
|
398
|
+
body: z18.string()
|
|
399
|
+
})
|
|
400
|
+
)
|
|
401
|
+
})
|
|
402
|
+
).optional()
|
|
403
|
+
});
|
|
404
|
+
var EnvironmentSchema = z18.object({
|
|
405
|
+
/** Local project configuration */
|
|
406
|
+
localProject: LocalProjectConfigSchema.optional(),
|
|
407
|
+
/** Meta site configuration */
|
|
408
|
+
metaSite: MetaSiteConfigSchema.optional()
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// src/scenario/test-scenario.ts
|
|
412
|
+
import { z as z19 } from "zod";
|
|
413
|
+
var ExpectedFileSchema = z19.object({
|
|
414
|
+
/** Relative path where the file should be created */
|
|
415
|
+
path: z19.string(),
|
|
416
|
+
/** Optional expected content */
|
|
417
|
+
content: z19.string().optional()
|
|
418
|
+
});
|
|
419
|
+
var TestScenarioSchema = TenantEntitySchema.extend({
|
|
420
|
+
/** The prompt sent to the agent to trigger the task */
|
|
421
|
+
triggerPrompt: z19.string().min(10),
|
|
422
|
+
/** ID of the template to use for this scenario */
|
|
423
|
+
templateId: z19.string().optional()
|
|
424
|
+
});
|
|
425
|
+
var CreateTestScenarioInputSchema = TestScenarioSchema.omit({
|
|
426
|
+
id: true,
|
|
427
|
+
createdAt: true,
|
|
428
|
+
updatedAt: true,
|
|
429
|
+
deleted: true
|
|
430
|
+
});
|
|
431
|
+
var UpdateTestScenarioInputSchema = CreateTestScenarioInputSchema.partial();
|
|
432
|
+
|
|
433
|
+
// src/suite/test-suite.ts
|
|
434
|
+
import { z as z20 } from "zod";
|
|
435
|
+
var TestSuiteSchema = TenantEntitySchema.extend({
|
|
436
|
+
/** IDs of test scenarios in this suite */
|
|
437
|
+
scenarioIds: z20.array(z20.string())
|
|
438
|
+
});
|
|
439
|
+
var CreateTestSuiteInputSchema = TestSuiteSchema.omit({
|
|
440
|
+
id: true,
|
|
441
|
+
createdAt: true,
|
|
442
|
+
updatedAt: true,
|
|
443
|
+
deleted: true
|
|
444
|
+
});
|
|
445
|
+
var UpdateTestSuiteInputSchema = CreateTestSuiteInputSchema.partial();
|
|
446
|
+
|
|
447
|
+
// src/evaluation/metrics.ts
|
|
448
|
+
import { z as z21 } from "zod";
|
|
449
|
+
var TokenUsageSchema = z21.object({
|
|
450
|
+
prompt: z21.number(),
|
|
451
|
+
completion: z21.number(),
|
|
452
|
+
total: z21.number()
|
|
453
|
+
});
|
|
454
|
+
var EvalMetricsSchema = z21.object({
|
|
455
|
+
totalAssertions: z21.number(),
|
|
456
|
+
passed: z21.number(),
|
|
457
|
+
failed: z21.number(),
|
|
458
|
+
skipped: z21.number(),
|
|
459
|
+
errors: z21.number(),
|
|
460
|
+
passRate: z21.number(),
|
|
461
|
+
avgDuration: z21.number(),
|
|
462
|
+
totalDuration: z21.number()
|
|
463
|
+
});
|
|
464
|
+
var EvalStatus = /* @__PURE__ */ ((EvalStatus2) => {
|
|
465
|
+
EvalStatus2["PENDING"] = "pending";
|
|
466
|
+
EvalStatus2["RUNNING"] = "running";
|
|
467
|
+
EvalStatus2["COMPLETED"] = "completed";
|
|
468
|
+
EvalStatus2["FAILED"] = "failed";
|
|
469
|
+
EvalStatus2["CANCELLED"] = "cancelled";
|
|
470
|
+
return EvalStatus2;
|
|
471
|
+
})(EvalStatus || {});
|
|
472
|
+
var EvalStatusSchema = z21.enum(EvalStatus);
|
|
473
|
+
var LLMStepType = /* @__PURE__ */ ((LLMStepType2) => {
|
|
474
|
+
LLMStepType2["COMPLETION"] = "completion";
|
|
475
|
+
LLMStepType2["TOOL_USE"] = "tool_use";
|
|
476
|
+
LLMStepType2["TOOL_RESULT"] = "tool_result";
|
|
477
|
+
LLMStepType2["THINKING"] = "thinking";
|
|
478
|
+
return LLMStepType2;
|
|
479
|
+
})(LLMStepType || {});
|
|
480
|
+
var LLMTraceStepSchema = z21.object({
|
|
481
|
+
id: z21.string(),
|
|
482
|
+
stepNumber: z21.number(),
|
|
483
|
+
type: z21.enum(LLMStepType),
|
|
484
|
+
model: z21.string(),
|
|
485
|
+
provider: z21.string(),
|
|
486
|
+
startedAt: z21.string(),
|
|
487
|
+
durationMs: z21.number(),
|
|
488
|
+
tokenUsage: TokenUsageSchema,
|
|
489
|
+
costUsd: z21.number(),
|
|
490
|
+
toolName: z21.string().optional(),
|
|
491
|
+
toolArguments: z21.string().optional(),
|
|
492
|
+
inputPreview: z21.string().optional(),
|
|
493
|
+
outputPreview: z21.string().optional(),
|
|
494
|
+
success: z21.boolean(),
|
|
495
|
+
error: z21.string().optional()
|
|
496
|
+
});
|
|
497
|
+
var LLMBreakdownStatsSchema = z21.object({
|
|
498
|
+
count: z21.number(),
|
|
499
|
+
durationMs: z21.number(),
|
|
500
|
+
tokens: z21.number(),
|
|
501
|
+
costUsd: z21.number()
|
|
502
|
+
});
|
|
503
|
+
var LLMTraceSummarySchema = z21.object({
|
|
504
|
+
totalSteps: z21.number(),
|
|
505
|
+
totalDurationMs: z21.number(),
|
|
506
|
+
totalTokens: TokenUsageSchema,
|
|
507
|
+
totalCostUsd: z21.number(),
|
|
508
|
+
stepTypeBreakdown: z21.record(z21.string(), LLMBreakdownStatsSchema).optional(),
|
|
509
|
+
modelBreakdown: z21.record(z21.string(), LLMBreakdownStatsSchema),
|
|
510
|
+
modelsUsed: z21.array(z21.string())
|
|
511
|
+
});
|
|
512
|
+
var LLMTraceSchema = z21.object({
|
|
513
|
+
id: z21.string(),
|
|
514
|
+
steps: z21.array(LLMTraceStepSchema),
|
|
515
|
+
summary: LLMTraceSummarySchema
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// src/evaluation/eval-result.ts
|
|
519
|
+
import { z as z22 } from "zod";
|
|
520
|
+
var AssertionResultStatus = /* @__PURE__ */ ((AssertionResultStatus2) => {
|
|
521
|
+
AssertionResultStatus2["PASSED"] = "passed";
|
|
522
|
+
AssertionResultStatus2["FAILED"] = "failed";
|
|
523
|
+
AssertionResultStatus2["SKIPPED"] = "skipped";
|
|
524
|
+
AssertionResultStatus2["ERROR"] = "error";
|
|
525
|
+
return AssertionResultStatus2;
|
|
526
|
+
})(AssertionResultStatus || {});
|
|
527
|
+
var AssertionResultSchema = z22.object({
|
|
528
|
+
id: z22.string(),
|
|
529
|
+
assertionId: z22.string(),
|
|
530
|
+
assertionType: z22.string(),
|
|
531
|
+
assertionName: z22.string(),
|
|
532
|
+
status: z22.enum(AssertionResultStatus),
|
|
533
|
+
message: z22.string().optional(),
|
|
534
|
+
expected: z22.string().optional(),
|
|
535
|
+
actual: z22.string().optional(),
|
|
536
|
+
duration: z22.number().optional(),
|
|
537
|
+
details: z22.record(z22.string(), z22.unknown()).optional(),
|
|
538
|
+
llmTraceSteps: z22.array(LLMTraceStepSchema).optional()
|
|
539
|
+
});
|
|
540
|
+
var EvalRunResultSchema = z22.object({
|
|
541
|
+
id: z22.string(),
|
|
542
|
+
targetId: z22.string(),
|
|
543
|
+
targetName: z22.string().optional(),
|
|
544
|
+
scenarioId: z22.string(),
|
|
545
|
+
scenarioName: z22.string(),
|
|
546
|
+
modelConfig: ModelConfigSchema.optional(),
|
|
547
|
+
assertionResults: z22.array(AssertionResultSchema),
|
|
548
|
+
metrics: EvalMetricsSchema.optional(),
|
|
549
|
+
passed: z22.number(),
|
|
550
|
+
failed: z22.number(),
|
|
551
|
+
passRate: z22.number(),
|
|
552
|
+
duration: z22.number(),
|
|
553
|
+
outputText: z22.string().optional(),
|
|
554
|
+
files: z22.array(ExpectedFileSchema).optional(),
|
|
555
|
+
startedAt: z22.string().optional(),
|
|
556
|
+
completedAt: z22.string().optional(),
|
|
557
|
+
llmTrace: LLMTraceSchema.optional()
|
|
558
|
+
});
|
|
559
|
+
var PromptResultSchema = z22.object({
|
|
560
|
+
text: z22.string(),
|
|
561
|
+
files: z22.array(z22.unknown()).optional(),
|
|
562
|
+
finishReason: z22.string().optional(),
|
|
563
|
+
reasoning: z22.string().optional(),
|
|
564
|
+
reasoningDetails: z22.unknown().optional(),
|
|
565
|
+
toolCalls: z22.array(z22.unknown()).optional(),
|
|
566
|
+
toolResults: z22.array(z22.unknown()).optional(),
|
|
567
|
+
warnings: z22.array(z22.unknown()).optional(),
|
|
568
|
+
sources: z22.array(z22.unknown()).optional(),
|
|
569
|
+
steps: z22.array(z22.unknown()),
|
|
570
|
+
generationTimeMs: z22.number(),
|
|
571
|
+
prompt: z22.string(),
|
|
572
|
+
systemPrompt: z22.string(),
|
|
573
|
+
usage: z22.object({
|
|
574
|
+
totalTokens: z22.number().optional(),
|
|
575
|
+
totalMicrocentsSpent: z22.number().optional()
|
|
576
|
+
})
|
|
577
|
+
});
|
|
578
|
+
var EvaluationResultSchema = z22.object({
|
|
579
|
+
id: z22.string(),
|
|
580
|
+
runId: z22.string(),
|
|
581
|
+
timestamp: z22.number(),
|
|
582
|
+
promptResult: PromptResultSchema,
|
|
583
|
+
testResults: z22.array(z22.unknown()),
|
|
584
|
+
tags: z22.array(z22.string()).optional(),
|
|
585
|
+
feedback: z22.string().optional(),
|
|
586
|
+
score: z22.number(),
|
|
587
|
+
suiteId: z22.string().optional()
|
|
588
|
+
});
|
|
589
|
+
var LeanEvaluationResultSchema = z22.object({
|
|
590
|
+
id: z22.string(),
|
|
591
|
+
runId: z22.string(),
|
|
592
|
+
timestamp: z22.number(),
|
|
593
|
+
tags: z22.array(z22.string()).optional(),
|
|
594
|
+
scenarioId: z22.string(),
|
|
595
|
+
scenarioVersion: z22.number().optional(),
|
|
596
|
+
targetId: z22.string(),
|
|
597
|
+
targetVersion: z22.number().optional(),
|
|
598
|
+
suiteId: z22.string().optional(),
|
|
599
|
+
score: z22.number(),
|
|
600
|
+
time: z22.number().optional(),
|
|
601
|
+
microcentsSpent: z22.number().optional()
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
// src/evaluation/eval-run.ts
|
|
605
|
+
import { z as z24 } from "zod";
|
|
606
|
+
|
|
607
|
+
// src/evaluation/live-trace.ts
|
|
608
|
+
import { z as z23 } from "zod";
|
|
609
|
+
var LiveTraceEventType = /* @__PURE__ */ ((LiveTraceEventType2) => {
|
|
610
|
+
LiveTraceEventType2["THINKING"] = "thinking";
|
|
611
|
+
LiveTraceEventType2["TOOL_USE"] = "tool_use";
|
|
612
|
+
LiveTraceEventType2["COMPLETION"] = "completion";
|
|
613
|
+
LiveTraceEventType2["TOOL_RESULT"] = "tool_result";
|
|
614
|
+
return LiveTraceEventType2;
|
|
615
|
+
})(LiveTraceEventType || {});
|
|
616
|
+
var LiveTraceEventSchema = z23.object({
|
|
617
|
+
/** The evaluation run ID */
|
|
618
|
+
evalRunId: z23.string(),
|
|
619
|
+
/** The scenario ID being executed */
|
|
620
|
+
scenarioId: z23.string(),
|
|
621
|
+
/** The scenario name for display */
|
|
622
|
+
scenarioName: z23.string(),
|
|
623
|
+
/** The target ID (skill, agent, etc.) */
|
|
624
|
+
targetId: z23.string(),
|
|
625
|
+
/** The target name for display */
|
|
626
|
+
targetName: z23.string(),
|
|
627
|
+
/** Step number in the current scenario execution */
|
|
628
|
+
stepNumber: z23.number(),
|
|
629
|
+
/** Type of trace event */
|
|
630
|
+
type: z23.enum(LiveTraceEventType),
|
|
631
|
+
/** Tool name if this is a tool_use event */
|
|
632
|
+
toolName: z23.string().optional(),
|
|
633
|
+
/** Tool arguments preview (truncated JSON) */
|
|
634
|
+
toolArgs: z23.string().optional(),
|
|
635
|
+
/** Output preview (truncated text) */
|
|
636
|
+
outputPreview: z23.string().optional(),
|
|
637
|
+
/** Timestamp when this event occurred */
|
|
638
|
+
timestamp: z23.string(),
|
|
639
|
+
/** Whether this is the final event for this scenario */
|
|
640
|
+
isComplete: z23.boolean()
|
|
641
|
+
});
|
|
642
|
+
var TRACE_EVENT_PREFIX = "TRACE_EVENT:";
|
|
643
|
+
function parseTraceEventLine(line) {
|
|
644
|
+
if (!line.startsWith(TRACE_EVENT_PREFIX)) {
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
try {
|
|
648
|
+
const jsonStr = line.slice(TRACE_EVENT_PREFIX.length);
|
|
649
|
+
const parsed = JSON.parse(jsonStr);
|
|
650
|
+
const result = LiveTraceEventSchema.safeParse(parsed);
|
|
651
|
+
return result.success ? result.data : null;
|
|
652
|
+
} catch {
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
function formatTraceEventLine(event) {
|
|
657
|
+
return `${TRACE_EVENT_PREFIX}${JSON.stringify(event)}`;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// src/evaluation/eval-run.ts
|
|
661
|
+
var TriggerType = /* @__PURE__ */ ((TriggerType2) => {
|
|
662
|
+
TriggerType2["RESOURCES_UPDATED"] = "RESOURCES_UPDATED";
|
|
663
|
+
TriggerType2["MCP_VERSION_RELEASE"] = "MCP_VERSION_RELEASE";
|
|
664
|
+
TriggerType2["MCP_PREVIEW_CREATED"] = "MCP_PREVIEW_CREATED";
|
|
665
|
+
TriggerType2["MANUAL"] = "MANUAL";
|
|
666
|
+
return TriggerType2;
|
|
667
|
+
})(TriggerType || {});
|
|
668
|
+
var TriggerMetadataSchema = z24.object({
|
|
669
|
+
version: z24.string().optional(),
|
|
670
|
+
resourceUpdated: z24.array(z24.string()).optional()
|
|
671
|
+
});
|
|
672
|
+
var TriggerSchema = z24.object({
|
|
673
|
+
id: z24.string(),
|
|
674
|
+
metadata: TriggerMetadataSchema.optional(),
|
|
675
|
+
type: z24.enum(TriggerType)
|
|
676
|
+
});
|
|
677
|
+
var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
|
|
678
|
+
FailureCategory2["MISSING_FILE"] = "missing_file";
|
|
679
|
+
FailureCategory2["WRONG_CONTENT"] = "wrong_content";
|
|
680
|
+
FailureCategory2["BUILD_ERROR"] = "build_error";
|
|
681
|
+
FailureCategory2["TEST_FAILURE"] = "test_failure";
|
|
682
|
+
FailureCategory2["RUNTIME_ERROR"] = "runtime_error";
|
|
683
|
+
FailureCategory2["PERFORMANCE"] = "performance";
|
|
684
|
+
return FailureCategory2;
|
|
685
|
+
})(FailureCategory || {});
|
|
686
|
+
var FailureSeverity = /* @__PURE__ */ ((FailureSeverity2) => {
|
|
687
|
+
FailureSeverity2["CRITICAL"] = "critical";
|
|
688
|
+
FailureSeverity2["HIGH"] = "high";
|
|
689
|
+
FailureSeverity2["MEDIUM"] = "medium";
|
|
690
|
+
FailureSeverity2["LOW"] = "low";
|
|
691
|
+
return FailureSeverity2;
|
|
692
|
+
})(FailureSeverity || {});
|
|
693
|
+
var DiffLineTypeSchema = z24.enum(["added", "removed", "unchanged"]);
|
|
694
|
+
var DiffLineSchema = z24.object({
|
|
695
|
+
type: DiffLineTypeSchema,
|
|
696
|
+
content: z24.string(),
|
|
697
|
+
lineNumber: z24.number()
|
|
698
|
+
});
|
|
699
|
+
var DiffContentSchema = z24.object({
|
|
700
|
+
path: z24.string(),
|
|
701
|
+
expected: z24.string(),
|
|
702
|
+
actual: z24.string(),
|
|
703
|
+
diffLines: z24.array(DiffLineSchema)
|
|
704
|
+
});
|
|
705
|
+
var CommandExecutionSchema = z24.object({
|
|
706
|
+
command: z24.string(),
|
|
707
|
+
exitCode: z24.number(),
|
|
708
|
+
output: z24.string().optional(),
|
|
709
|
+
duration: z24.number()
|
|
710
|
+
});
|
|
711
|
+
var FileModificationSchema = z24.object({
|
|
712
|
+
path: z24.string(),
|
|
713
|
+
action: z24.enum(["created", "modified", "deleted"])
|
|
714
|
+
});
|
|
715
|
+
var ApiCallSchema = z24.object({
|
|
716
|
+
endpoint: z24.string(),
|
|
717
|
+
tokensUsed: z24.number(),
|
|
718
|
+
duration: z24.number()
|
|
719
|
+
});
|
|
720
|
+
var ExecutionTraceSchema = z24.object({
|
|
721
|
+
commands: z24.array(CommandExecutionSchema),
|
|
722
|
+
filesModified: z24.array(FileModificationSchema),
|
|
723
|
+
apiCalls: z24.array(ApiCallSchema),
|
|
724
|
+
totalDuration: z24.number()
|
|
725
|
+
});
|
|
726
|
+
var FailureAnalysisSchema = z24.object({
|
|
727
|
+
category: z24.enum(FailureCategory),
|
|
728
|
+
severity: z24.enum(FailureSeverity),
|
|
729
|
+
summary: z24.string(),
|
|
730
|
+
details: z24.string(),
|
|
731
|
+
rootCause: z24.string(),
|
|
732
|
+
suggestedFix: z24.string(),
|
|
733
|
+
relatedAssertions: z24.array(z24.string()),
|
|
734
|
+
codeSnippet: z24.string().optional(),
|
|
735
|
+
similarIssues: z24.array(z24.string()).optional(),
|
|
736
|
+
patternId: z24.string().optional(),
|
|
737
|
+
// Extended fields for detailed debugging
|
|
738
|
+
diff: DiffContentSchema.optional(),
|
|
739
|
+
executionTrace: ExecutionTraceSchema.optional()
|
|
740
|
+
});
|
|
741
|
+
var EvalRunSchema = TenantEntitySchema.extend({
|
|
742
|
+
/** Agent ID for this run */
|
|
743
|
+
agentId: z24.string().optional(),
|
|
744
|
+
/** Skills group ID for this run */
|
|
745
|
+
skillsGroupId: z24.string().optional(),
|
|
746
|
+
/** Scenario IDs to run */
|
|
747
|
+
scenarioIds: z24.array(z24.string()),
|
|
748
|
+
/** Current status */
|
|
749
|
+
status: EvalStatusSchema,
|
|
750
|
+
/** Progress percentage (0-100) */
|
|
751
|
+
progress: z24.number(),
|
|
752
|
+
/** Results for each scenario/target combination */
|
|
753
|
+
results: z24.array(EvalRunResultSchema),
|
|
754
|
+
/** Aggregated metrics across all results */
|
|
755
|
+
aggregateMetrics: EvalMetricsSchema,
|
|
756
|
+
/** Failure analyses */
|
|
757
|
+
failureAnalyses: z24.array(FailureAnalysisSchema).optional(),
|
|
758
|
+
/** Aggregated LLM trace summary */
|
|
759
|
+
llmTraceSummary: LLMTraceSummarySchema.optional(),
|
|
760
|
+
/** What triggered this run */
|
|
761
|
+
trigger: TriggerSchema.optional(),
|
|
762
|
+
/** When the run started (set when evaluation is triggered) */
|
|
763
|
+
startedAt: z24.string().optional(),
|
|
764
|
+
/** When the run completed */
|
|
765
|
+
completedAt: z24.string().optional(),
|
|
766
|
+
/** Live trace events captured during execution (for playback on results page) */
|
|
767
|
+
liveTraceEvents: z24.array(LiveTraceEventSchema).optional()
|
|
768
|
+
});
|
|
769
|
+
var CreateEvalRunInputSchema = EvalRunSchema.omit({
|
|
770
|
+
id: true,
|
|
771
|
+
createdAt: true,
|
|
772
|
+
updatedAt: true,
|
|
773
|
+
status: true,
|
|
774
|
+
progress: true,
|
|
775
|
+
results: true,
|
|
776
|
+
aggregateMetrics: true,
|
|
777
|
+
startedAt: true,
|
|
778
|
+
completedAt: true
|
|
779
|
+
});
|
|
780
|
+
var EvaluationProgressSchema = z24.object({
|
|
781
|
+
runId: z24.string(),
|
|
782
|
+
targetId: z24.string(),
|
|
783
|
+
totalScenarios: z24.number(),
|
|
784
|
+
completedScenarios: z24.number(),
|
|
785
|
+
scenarioProgress: z24.array(
|
|
786
|
+
z24.object({
|
|
787
|
+
scenarioId: z24.string(),
|
|
788
|
+
currentStep: z24.string(),
|
|
789
|
+
error: z24.string().optional()
|
|
790
|
+
})
|
|
791
|
+
),
|
|
792
|
+
createdAt: z24.number()
|
|
793
|
+
});
|
|
794
|
+
var EvaluationLogSchema = z24.object({
|
|
795
|
+
runId: z24.string(),
|
|
796
|
+
scenarioId: z24.string(),
|
|
797
|
+
log: z24.object({
|
|
798
|
+
level: z24.enum(["info", "error", "debug"]),
|
|
799
|
+
message: z24.string().optional(),
|
|
800
|
+
args: z24.array(z24.any()).optional(),
|
|
801
|
+
error: z24.string().optional()
|
|
802
|
+
})
|
|
803
|
+
});
|
|
804
|
+
var LLM_TIMEOUT = 12e4;
|
|
805
|
+
|
|
806
|
+
// src/project/project.ts
|
|
807
|
+
import { z as z25 } from "zod";
|
|
808
|
+
var ProjectSchema = BaseEntitySchema.extend({
|
|
809
|
+
appId: z25.string().optional().describe("The ID of the app in Dev Center"),
|
|
810
|
+
appSecret: z25.string().optional().describe("The secret of the app in Dev Center")
|
|
811
|
+
});
|
|
812
|
+
var CreateProjectInputSchema = ProjectSchema.omit({
|
|
813
|
+
id: true,
|
|
814
|
+
createdAt: true,
|
|
815
|
+
updatedAt: true,
|
|
816
|
+
deleted: true
|
|
817
|
+
});
|
|
818
|
+
var UpdateProjectInputSchema = CreateProjectInputSchema.partial();
|
|
819
|
+
|
|
820
|
+
// src/template/template.ts
|
|
821
|
+
import { z as z26 } from "zod";
|
|
822
|
+
var TemplateSchema = TenantEntitySchema.extend({
|
|
823
|
+
/** URL to download the template from */
|
|
824
|
+
downloadUrl: z26.url()
|
|
825
|
+
});
|
|
826
|
+
var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
827
|
+
id: true,
|
|
828
|
+
createdAt: true,
|
|
829
|
+
updatedAt: true,
|
|
830
|
+
deleted: true
|
|
831
|
+
});
|
|
832
|
+
var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
|
|
833
|
+
export {
|
|
834
|
+
AVAILABLE_MODELS,
|
|
835
|
+
AVAILABLE_MODELS_MAP,
|
|
836
|
+
AgentSchema,
|
|
837
|
+
AllowedCommands,
|
|
838
|
+
ApiCallSchema,
|
|
839
|
+
AssertionResultSchema,
|
|
840
|
+
AssertionResultStatus,
|
|
841
|
+
BaseEntitySchema,
|
|
842
|
+
BaseTestSchema,
|
|
843
|
+
BuildCheckTestSchema,
|
|
844
|
+
CommandExecutionSchema,
|
|
845
|
+
CommandExecutionTestSchema,
|
|
846
|
+
CreateAgentInputSchema,
|
|
847
|
+
CreateEvalRunInputSchema,
|
|
848
|
+
CreateProjectInputSchema,
|
|
849
|
+
CreateSkillInputSchema,
|
|
850
|
+
CreateSkillsGroupInputSchema,
|
|
851
|
+
CreateTemplateInputSchema,
|
|
852
|
+
CreateTestScenarioInputSchema,
|
|
853
|
+
CreateTestSuiteInputSchema,
|
|
854
|
+
DiffContentSchema,
|
|
855
|
+
DiffLineSchema,
|
|
856
|
+
DiffLineTypeSchema,
|
|
857
|
+
EnvironmentSchema,
|
|
858
|
+
EvalMetricsSchema,
|
|
859
|
+
EvalRunResultSchema,
|
|
860
|
+
EvalRunSchema,
|
|
861
|
+
EvalStatus,
|
|
862
|
+
EvalStatusSchema,
|
|
863
|
+
EvaluationLogSchema,
|
|
864
|
+
EvaluationProgressSchema,
|
|
865
|
+
EvaluationResultSchema,
|
|
866
|
+
ExecutionTraceSchema,
|
|
867
|
+
ExpectedFileSchema,
|
|
868
|
+
FailureAnalysisSchema,
|
|
869
|
+
FailureCategory,
|
|
870
|
+
FailureSeverity,
|
|
871
|
+
FileContentCheckSchema,
|
|
872
|
+
FileContentTestSchema,
|
|
873
|
+
FileModificationSchema,
|
|
874
|
+
FilePresenceTestSchema,
|
|
875
|
+
LLMBreakdownStatsSchema,
|
|
876
|
+
LLMStepType,
|
|
877
|
+
LLMTestSchema,
|
|
878
|
+
LLMTraceSchema,
|
|
879
|
+
LLMTraceStepSchema,
|
|
880
|
+
LLMTraceSummarySchema,
|
|
881
|
+
LLM_TIMEOUT,
|
|
882
|
+
LeanEvaluationResultSchema,
|
|
883
|
+
LiveTraceEventSchema,
|
|
884
|
+
LiveTraceEventType,
|
|
885
|
+
LocalProjectConfigSchema,
|
|
886
|
+
MCPServerConfigSchema,
|
|
887
|
+
MetaSiteConfigSchema,
|
|
888
|
+
ModelConfigSchema,
|
|
889
|
+
ModelIds,
|
|
890
|
+
ModelIdsSchema,
|
|
891
|
+
ModelPricingSchema,
|
|
892
|
+
ModelSchema,
|
|
893
|
+
PlaywrightNLTestSchema,
|
|
894
|
+
ProjectSchema,
|
|
895
|
+
PromptResultSchema,
|
|
896
|
+
SiteConfigTestSchema,
|
|
897
|
+
SkillMetadataSchema,
|
|
898
|
+
SkillSchema,
|
|
899
|
+
SkillVersionSchema,
|
|
900
|
+
SkillsGroupSchema,
|
|
901
|
+
TRACE_EVENT_PREFIX,
|
|
902
|
+
TargetSchema,
|
|
903
|
+
TemplateSchema,
|
|
904
|
+
TenantEntitySchema,
|
|
905
|
+
TestImportance,
|
|
906
|
+
TestImportanceSchema,
|
|
907
|
+
TestScenarioSchema,
|
|
908
|
+
TestSchema,
|
|
909
|
+
TestSuiteSchema,
|
|
910
|
+
TestType,
|
|
911
|
+
TestTypeSchema,
|
|
912
|
+
TokenUsageSchema,
|
|
913
|
+
ToolTestSchema,
|
|
914
|
+
TriggerMetadataSchema,
|
|
915
|
+
TriggerSchema,
|
|
916
|
+
TriggerType,
|
|
917
|
+
UpdateAgentInputSchema,
|
|
918
|
+
UpdateProjectInputSchema,
|
|
919
|
+
UpdateSkillInputSchema,
|
|
920
|
+
UpdateSkillsGroupInputSchema,
|
|
921
|
+
UpdateTemplateInputSchema,
|
|
922
|
+
UpdateTestScenarioInputSchema,
|
|
923
|
+
UpdateTestSuiteInputSchema,
|
|
924
|
+
VitestTestSchema,
|
|
925
|
+
formatTraceEventLine,
|
|
926
|
+
parseTraceEventLine
|
|
927
|
+
};
|
|
928
|
+
//# sourceMappingURL=index.mjs.map
|