@wix/evalforge-types 0.71.0 → 0.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/index.js +715 -620
- package/build/index.js.map +4 -4
- package/build/index.mjs +707 -619
- package/build/index.mjs.map +4 -4
- package/build/types/agent/adapter.d.ts +3 -1
- package/build/types/assertion/assertion.d.ts +26 -6
- package/build/types/assertion/build-passed-command.d.ts +25 -0
- package/build/types/assertion/index.d.ts +1 -0
- package/build/types/scenario/test-scenario.d.ts +64 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SkillWithLatestVersion } from '../target/skill.js';
|
|
2
|
-
import type { TestScenario } from '../scenario/test-scenario.js';
|
|
2
|
+
import type { TestScenario, TriggerPromptImage } from '../scenario/test-scenario.js';
|
|
3
3
|
import type { ModelConfig } from '../common/models.js';
|
|
4
4
|
import type { LLMTrace } from '../evaluation/metrics.js';
|
|
5
5
|
import type { ConversationMessage } from '../evaluation/conversation.js';
|
|
@@ -68,6 +68,8 @@ export interface AgentExecutionContext {
|
|
|
68
68
|
* - string: custom system prompt text
|
|
69
69
|
*/
|
|
70
70
|
systemPrompt?: string | null;
|
|
71
|
+
/** Base64-encoded images attached to the trigger prompt (from scenario.triggerPromptImages) */
|
|
72
|
+
triggerPromptImages?: TriggerPromptImage[];
|
|
71
73
|
}
|
|
72
74
|
/**
|
|
73
75
|
* Token usage statistics from agent execution.
|
|
@@ -91,8 +91,13 @@ export declare const ToolCalledWithParamConfigSchema: z.ZodObject<{
|
|
|
91
91
|
* Uses strictObject to reject objects with unknown keys (prevents matching LlmJudge configs).
|
|
92
92
|
*/
|
|
93
93
|
export declare const BuildPassedConfigSchema: z.ZodObject<{
|
|
94
|
-
/**
|
|
95
|
-
command: z.ZodOptional<z.
|
|
94
|
+
/** Allowlisted command only (default at runtime: "yarn build") */
|
|
95
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
"npm run build": "npm run build";
|
|
97
|
+
"yarn build": "yarn build";
|
|
98
|
+
"pnpm run build": "pnpm run build";
|
|
99
|
+
"pnpm build": "pnpm build";
|
|
100
|
+
}>>;
|
|
96
101
|
/** Expected exit code (default: 0) */
|
|
97
102
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
98
103
|
}, z.core.$strict>;
|
|
@@ -168,7 +173,12 @@ export declare const ToolCalledWithParamAssertionSchema: z.ZodObject<{
|
|
|
168
173
|
}, z.core.$strict>;
|
|
169
174
|
export type ToolCalledWithParamAssertion = z.infer<typeof ToolCalledWithParamAssertionSchema>;
|
|
170
175
|
export declare const BuildPassedAssertionSchema: z.ZodObject<{
|
|
171
|
-
command: z.ZodOptional<z.
|
|
176
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
"npm run build": "npm run build";
|
|
178
|
+
"yarn build": "yarn build";
|
|
179
|
+
"pnpm run build": "pnpm run build";
|
|
180
|
+
"pnpm build": "pnpm build";
|
|
181
|
+
}>>;
|
|
172
182
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
173
183
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
174
184
|
type: z.ZodLiteral<"build_passed">;
|
|
@@ -237,7 +247,12 @@ export declare const AssertionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
237
247
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
238
248
|
type: z.ZodLiteral<"tool_called_with_param">;
|
|
239
249
|
}, z.core.$strict>, z.ZodObject<{
|
|
240
|
-
command: z.ZodOptional<z.
|
|
250
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
251
|
+
"npm run build": "npm run build";
|
|
252
|
+
"yarn build": "yarn build";
|
|
253
|
+
"pnpm run build": "pnpm run build";
|
|
254
|
+
"pnpm build": "pnpm build";
|
|
255
|
+
}>>;
|
|
241
256
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
242
257
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
243
258
|
type: z.ZodLiteral<"build_passed">;
|
|
@@ -339,8 +354,13 @@ export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
339
354
|
/** Maximum allowed cost in USD */
|
|
340
355
|
maxCostUsd: z.ZodNumber;
|
|
341
356
|
}, z.core.$strict>, z.ZodObject<{
|
|
342
|
-
/**
|
|
343
|
-
command: z.ZodOptional<z.
|
|
357
|
+
/** Allowlisted command only (default at runtime: "yarn build") */
|
|
358
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
"npm run build": "npm run build";
|
|
360
|
+
"yarn build": "yarn build";
|
|
361
|
+
"pnpm run build": "pnpm run build";
|
|
362
|
+
"pnpm build": "pnpm build";
|
|
363
|
+
}>>;
|
|
344
364
|
/** Expected exit code (default: 0) */
|
|
345
365
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
346
366
|
}, z.core.$strict>, z.ZodObject<{}, z.core.$strip>]>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Allowlisted shell-free build commands for `build_passed` assertions (VELO-9590).
|
|
4
|
+
* Each entry maps to a fixed argv array for execFile — no user-controlled shell.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ALLOWED_BUILD_COMMANDS: readonly ["yarn build", "npm run build", "pnpm run build", "pnpm build"];
|
|
7
|
+
export type AllowedBuildCommandString = (typeof ALLOWED_BUILD_COMMANDS)[number];
|
|
8
|
+
/** Default when `command` is omitted (matches historical behavior). */
|
|
9
|
+
export declare const DEFAULT_BUILD_PASSED_COMMAND: AllowedBuildCommandString;
|
|
10
|
+
/**
|
|
11
|
+
* True if the string (after trim) is an allowlisted build command.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isAllowedBuildCommandString(command: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve an allowlisted command string to argv for `execFile` / `execFileSync`.
|
|
16
|
+
* Returns null if the command is not allowlisted.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseBuildCommandToArgv(command: string): readonly [string, ...string[]] | null;
|
|
19
|
+
/** Zod schema for an optional/required allowlisted build command string. */
|
|
20
|
+
export declare const BuildPassedCommandStringSchema: z.ZodEnum<{
|
|
21
|
+
"npm run build": "npm run build";
|
|
22
|
+
"yarn build": "yarn build";
|
|
23
|
+
"pnpm run build": "pnpm run build";
|
|
24
|
+
"pnpm build": "pnpm build";
|
|
25
|
+
}>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const TriggerPromptImageSchema: z.ZodObject<{
|
|
3
|
+
base64: z.ZodString;
|
|
4
|
+
mediaType: z.ZodEnum<{
|
|
5
|
+
"image/jpeg": "image/jpeg";
|
|
6
|
+
"image/png": "image/png";
|
|
7
|
+
"image/gif": "image/gif";
|
|
8
|
+
"image/webp": "image/webp";
|
|
9
|
+
}>;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type TriggerPromptImage = z.infer<typeof TriggerPromptImageSchema>;
|
|
2
13
|
/**
|
|
3
14
|
* Expected file schema - a file the agent is expected to create or modify.
|
|
4
15
|
* Used by eval results; not persisted on test_scenarios table.
|
|
@@ -14,6 +25,7 @@ export type ExpectedFile = z.infer<typeof ExpectedFileSchema>;
|
|
|
14
25
|
* Persisted shape matches test_scenarios table:
|
|
15
26
|
* id, project_id, name, description, trigger_prompt, template_id, created_at, updated_at, deleted.
|
|
16
27
|
* Linked assertions stored in scenario_assertions junction table.
|
|
28
|
+
* Trigger prompt images stored as JSON in trigger_prompt_images column.
|
|
17
29
|
*/
|
|
18
30
|
export declare const TestScenarioSchema: z.ZodObject<{
|
|
19
31
|
id: z.ZodString;
|
|
@@ -36,7 +48,12 @@ export declare const TestScenarioSchema: z.ZodObject<{
|
|
|
36
48
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
37
49
|
type: z.ZodLiteral<"tool_called_with_param">;
|
|
38
50
|
}, z.core.$strict>, z.ZodObject<{
|
|
39
|
-
command: z.ZodOptional<z.
|
|
51
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
"npm run build": "npm run build";
|
|
53
|
+
"yarn build": "yarn build";
|
|
54
|
+
"pnpm run build": "pnpm run build";
|
|
55
|
+
"pnpm build": "pnpm build";
|
|
56
|
+
}>>;
|
|
40
57
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
41
58
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
42
59
|
type: z.ZodLiteral<"build_passed">;
|
|
@@ -87,8 +104,22 @@ export declare const TestScenarioSchema: z.ZodObject<{
|
|
|
87
104
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
88
105
|
}, z.core.$strip>>>;
|
|
89
106
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
triggerPromptImages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
108
|
+
base64: z.ZodString;
|
|
109
|
+
mediaType: z.ZodEnum<{
|
|
110
|
+
"image/jpeg": "image/jpeg";
|
|
111
|
+
"image/png": "image/png";
|
|
112
|
+
"image/gif": "image/gif";
|
|
113
|
+
"image/webp": "image/webp";
|
|
114
|
+
}>;
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
}, z.core.$strip>>>;
|
|
90
117
|
}, z.core.$strip>;
|
|
91
118
|
export type TestScenario = z.infer<typeof TestScenarioSchema>;
|
|
119
|
+
export declare function validateBuildPassedParamsInAssertionLinks(links: {
|
|
120
|
+
assertionId: string;
|
|
121
|
+
params?: Record<string, unknown>;
|
|
122
|
+
}[] | undefined, ctx: z.RefinementCtx): void;
|
|
92
123
|
/**
|
|
93
124
|
* Input schema for creating a new TestScenario.
|
|
94
125
|
*/
|
|
@@ -109,7 +140,12 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
|
|
|
109
140
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
110
141
|
type: z.ZodLiteral<"tool_called_with_param">;
|
|
111
142
|
}, z.core.$strict>, z.ZodObject<{
|
|
112
|
-
command: z.ZodOptional<z.
|
|
143
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
"npm run build": "npm run build";
|
|
145
|
+
"yarn build": "yarn build";
|
|
146
|
+
"pnpm run build": "pnpm run build";
|
|
147
|
+
"pnpm build": "pnpm build";
|
|
148
|
+
}>>;
|
|
113
149
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
114
150
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
115
151
|
type: z.ZodLiteral<"build_passed">;
|
|
@@ -160,6 +196,16 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
|
|
|
160
196
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
161
197
|
}, z.core.$strip>>>;
|
|
162
198
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
199
|
+
triggerPromptImages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
200
|
+
base64: z.ZodString;
|
|
201
|
+
mediaType: z.ZodEnum<{
|
|
202
|
+
"image/jpeg": "image/jpeg";
|
|
203
|
+
"image/png": "image/png";
|
|
204
|
+
"image/gif": "image/gif";
|
|
205
|
+
"image/webp": "image/webp";
|
|
206
|
+
}>;
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
}, z.core.$strip>>>;
|
|
163
209
|
}, z.core.$strip>;
|
|
164
210
|
export type CreateTestScenarioInput = z.infer<typeof CreateTestScenarioInputSchema>;
|
|
165
211
|
/**
|
|
@@ -182,7 +228,12 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
|
|
|
182
228
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
183
229
|
type: z.ZodLiteral<"tool_called_with_param">;
|
|
184
230
|
}, z.core.$strict>, z.ZodObject<{
|
|
185
|
-
command: z.ZodOptional<z.
|
|
231
|
+
command: z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
"npm run build": "npm run build";
|
|
233
|
+
"yarn build": "yarn build";
|
|
234
|
+
"pnpm run build": "pnpm run build";
|
|
235
|
+
"pnpm build": "pnpm build";
|
|
236
|
+
}>>;
|
|
186
237
|
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
187
238
|
negate: z.ZodOptional<z.ZodBoolean>;
|
|
188
239
|
type: z.ZodLiteral<"build_passed">;
|
|
@@ -233,5 +284,15 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
|
|
|
233
284
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
234
285
|
}, z.core.$strip>>>>;
|
|
235
286
|
tags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
287
|
+
triggerPromptImages: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
288
|
+
base64: z.ZodString;
|
|
289
|
+
mediaType: z.ZodEnum<{
|
|
290
|
+
"image/jpeg": "image/jpeg";
|
|
291
|
+
"image/png": "image/png";
|
|
292
|
+
"image/gif": "image/gif";
|
|
293
|
+
"image/webp": "image/webp";
|
|
294
|
+
}>;
|
|
295
|
+
name: z.ZodString;
|
|
296
|
+
}, z.core.$strip>>>>;
|
|
236
297
|
}, z.core.$strip>;
|
|
237
298
|
export type UpdateTestScenarioInput = z.infer<typeof UpdateTestScenarioInputSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/evalforge-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "Unified types for EvalForge agent evaluation system",
|
|
5
5
|
"files": [
|
|
6
6
|
"build"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"artifactId": "evalforge-types"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"falconPackageHash": "
|
|
49
|
+
"falconPackageHash": "57d4595d9fef78d3f6582ec6ae8a9e8a2bc9018bc791f63167ab7d64"
|
|
50
50
|
}
|