@wix/evalforge-types 0.60.0 → 0.62.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.
@@ -7,6 +7,9 @@ import { z } from 'zod';
7
7
  * - time_limit: Checks that scenario completed within a duration threshold (deterministic, system-level)
8
8
  * - cost: Checks that scenario LLM cost stays within a USD threshold (deterministic, system-level)
9
9
  * - llm_judge: LLM evaluates output with a prompt (LLM-based, system-level)
10
+ * - api_call: Makes an HTTP request and validates response with JSON subset matching (deterministic, system-level)
11
+ *
12
+ * Any assertion can be negated by setting `negate: true` to invert the pass/fail logic.
10
13
  */
11
14
  export declare const AssertionTypeSchema: z.ZodEnum<{
12
15
  skill_was_called: "skill_was_called";
@@ -15,6 +18,7 @@ export declare const AssertionTypeSchema: z.ZodEnum<{
15
18
  time_limit: "time_limit";
16
19
  cost: "cost";
17
20
  llm_judge: "llm_judge";
21
+ api_call: "api_call";
18
22
  }>;
19
23
  /**
20
24
  * Parameter types supported in assertion parameters.
@@ -72,12 +76,13 @@ export declare const CostConfigSchema: z.ZodObject<{
72
76
  export type CostConfig = z.infer<typeof CostConfigSchema>;
73
77
  /** Configuration for tool_called_with_param assertion type.
74
78
  * Uses strictObject to reject objects with unknown keys.
79
+ * When expectedParams is omitted, the assertion checks only that the tool was called (or not, if negated).
75
80
  */
76
81
  export declare const ToolCalledWithParamConfigSchema: z.ZodObject<{
77
82
  /** Name of the tool that must have been called */
78
83
  toolName: z.ZodString;
79
- /** JSON string of key-value pairs for expected parameters (substring match) */
80
- expectedParams: z.ZodString;
84
+ /** JSON string of key-value pairs for expected parameters (substring match). Optional — when omitted, only checks tool presence. */
85
+ expectedParams: z.ZodOptional<z.ZodString>;
81
86
  /** If true, the matching tool call must also have succeeded (step.success === true) */
82
87
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
83
88
  }, z.core.$strict>;
@@ -124,26 +129,54 @@ export declare const LlmJudgeConfigSchema: z.ZodObject<{
124
129
  }, z.core.$strip>>>;
125
130
  }, z.core.$strip>;
126
131
  export type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;
132
+ /**
133
+ * Configuration for api_call assertion type.
134
+ * Makes an HTTP request after scenario execution and validates the response
135
+ * contains the expected data using JSON subset matching.
136
+ * Uses strictObject to reject objects with unknown keys.
137
+ */
138
+ export declare const ApiCallConfigSchema: z.ZodObject<{
139
+ /** URL to call */
140
+ url: z.ZodString;
141
+ /** HTTP method (default GET) */
142
+ method: z.ZodOptional<z.ZodEnum<{
143
+ GET: "GET";
144
+ POST: "POST";
145
+ }>>;
146
+ /** Request body (JSON string, for POST requests) */
147
+ requestBody: z.ZodOptional<z.ZodString>;
148
+ /** Expected JSON response to validate against (subset match — extra fields in actual are OK) */
149
+ expectedResponse: z.ZodString;
150
+ /** Request headers as JSON string of key-value pairs */
151
+ requestHeaders: z.ZodOptional<z.ZodString>;
152
+ /** Request timeout in milliseconds (default 30000) */
153
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
154
+ }, z.core.$strict>;
155
+ export type ApiCallConfig = z.infer<typeof ApiCallConfigSchema>;
127
156
  export declare const SkillWasCalledAssertionSchema: z.ZodObject<{
128
157
  skillNames: z.ZodArray<z.ZodString>;
158
+ negate: z.ZodOptional<z.ZodBoolean>;
129
159
  type: z.ZodLiteral<"skill_was_called">;
130
160
  }, z.core.$strip>;
131
161
  export type SkillWasCalledAssertion = z.infer<typeof SkillWasCalledAssertionSchema>;
132
162
  export declare const ToolCalledWithParamAssertionSchema: z.ZodObject<{
133
163
  toolName: z.ZodString;
134
- expectedParams: z.ZodString;
164
+ expectedParams: z.ZodOptional<z.ZodString>;
135
165
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
166
+ negate: z.ZodOptional<z.ZodBoolean>;
136
167
  type: z.ZodLiteral<"tool_called_with_param">;
137
168
  }, z.core.$strict>;
138
169
  export type ToolCalledWithParamAssertion = z.infer<typeof ToolCalledWithParamAssertionSchema>;
139
170
  export declare const BuildPassedAssertionSchema: z.ZodObject<{
140
171
  command: z.ZodOptional<z.ZodString>;
141
172
  expectedExitCode: z.ZodOptional<z.ZodNumber>;
173
+ negate: z.ZodOptional<z.ZodBoolean>;
142
174
  type: z.ZodLiteral<"build_passed">;
143
175
  }, z.core.$strict>;
144
176
  export type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;
145
177
  export declare const CostAssertionSchema: z.ZodObject<{
146
178
  maxCostUsd: z.ZodNumber;
179
+ negate: z.ZodOptional<z.ZodBoolean>;
147
180
  type: z.ZodLiteral<"cost">;
148
181
  }, z.core.$strict>;
149
182
  export type CostAssertion = z.infer<typeof CostAssertionSchema>;
@@ -165,11 +198,27 @@ export declare const LlmJudgeAssertionSchema: z.ZodObject<{
165
198
  defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
166
199
  advanced: z.ZodOptional<z.ZodBoolean>;
167
200
  }, z.core.$strip>>>;
201
+ negate: z.ZodOptional<z.ZodBoolean>;
168
202
  type: z.ZodLiteral<"llm_judge">;
169
203
  }, z.core.$strip>;
170
204
  export type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;
205
+ export declare const ApiCallAssertionSchema: z.ZodObject<{
206
+ url: z.ZodString;
207
+ method: z.ZodOptional<z.ZodEnum<{
208
+ GET: "GET";
209
+ POST: "POST";
210
+ }>>;
211
+ requestBody: z.ZodOptional<z.ZodString>;
212
+ expectedResponse: z.ZodString;
213
+ requestHeaders: z.ZodOptional<z.ZodString>;
214
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
215
+ negate: z.ZodOptional<z.ZodBoolean>;
216
+ type: z.ZodLiteral<"api_call">;
217
+ }, z.core.$strict>;
218
+ export type ApiCallAssertion = z.infer<typeof ApiCallAssertionSchema>;
171
219
  export declare const TimeAssertionSchema: z.ZodObject<{
172
220
  maxDurationMs: z.ZodNumber;
221
+ negate: z.ZodOptional<z.ZodBoolean>;
173
222
  type: z.ZodLiteral<"time_limit">;
174
223
  }, z.core.$strict>;
175
224
  export type TimeAssertion = z.infer<typeof TimeAssertionSchema>;
@@ -179,21 +228,26 @@ export type TimeAssertion = z.infer<typeof TimeAssertionSchema>;
179
228
  */
180
229
  export declare const AssertionSchema: z.ZodUnion<readonly [z.ZodObject<{
181
230
  skillNames: z.ZodArray<z.ZodString>;
231
+ negate: z.ZodOptional<z.ZodBoolean>;
182
232
  type: z.ZodLiteral<"skill_was_called">;
183
233
  }, z.core.$strip>, z.ZodObject<{
184
234
  toolName: z.ZodString;
185
- expectedParams: z.ZodString;
235
+ expectedParams: z.ZodOptional<z.ZodString>;
186
236
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
237
+ negate: z.ZodOptional<z.ZodBoolean>;
187
238
  type: z.ZodLiteral<"tool_called_with_param">;
188
239
  }, z.core.$strict>, z.ZodObject<{
189
240
  command: z.ZodOptional<z.ZodString>;
190
241
  expectedExitCode: z.ZodOptional<z.ZodNumber>;
242
+ negate: z.ZodOptional<z.ZodBoolean>;
191
243
  type: z.ZodLiteral<"build_passed">;
192
244
  }, z.core.$strict>, z.ZodObject<{
193
245
  maxDurationMs: z.ZodNumber;
246
+ negate: z.ZodOptional<z.ZodBoolean>;
194
247
  type: z.ZodLiteral<"time_limit">;
195
248
  }, z.core.$strict>, z.ZodObject<{
196
249
  maxCostUsd: z.ZodNumber;
250
+ negate: z.ZodOptional<z.ZodBoolean>;
197
251
  type: z.ZodLiteral<"cost">;
198
252
  }, z.core.$strict>, z.ZodObject<{
199
253
  prompt: z.ZodString;
@@ -213,8 +267,21 @@ export declare const AssertionSchema: z.ZodUnion<readonly [z.ZodObject<{
213
267
  defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
214
268
  advanced: z.ZodOptional<z.ZodBoolean>;
215
269
  }, z.core.$strip>>>;
270
+ negate: z.ZodOptional<z.ZodBoolean>;
216
271
  type: z.ZodLiteral<"llm_judge">;
217
- }, z.core.$strip>]>;
272
+ }, z.core.$strip>, z.ZodObject<{
273
+ url: z.ZodString;
274
+ method: z.ZodOptional<z.ZodEnum<{
275
+ GET: "GET";
276
+ POST: "POST";
277
+ }>>;
278
+ requestBody: z.ZodOptional<z.ZodString>;
279
+ expectedResponse: z.ZodString;
280
+ requestHeaders: z.ZodOptional<z.ZodString>;
281
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
282
+ negate: z.ZodOptional<z.ZodBoolean>;
283
+ type: z.ZodLiteral<"api_call">;
284
+ }, z.core.$strict>]>;
218
285
  export type Assertion = z.infer<typeof AssertionSchema>;
219
286
  /**
220
287
  * Union of all assertion config types.
@@ -245,10 +312,26 @@ export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
245
312
  }, z.core.$strip>, z.ZodObject<{
246
313
  /** Name of the tool that must have been called */
247
314
  toolName: z.ZodString;
248
- /** JSON string of key-value pairs for expected parameters (substring match) */
249
- expectedParams: z.ZodString;
315
+ /** JSON string of key-value pairs for expected parameters (substring match). Optional — when omitted, only checks tool presence. */
316
+ expectedParams: z.ZodOptional<z.ZodString>;
250
317
  /** If true, the matching tool call must also have succeeded (step.success === true) */
251
318
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ /** URL to call */
321
+ url: z.ZodString;
322
+ /** HTTP method (default GET) */
323
+ method: z.ZodOptional<z.ZodEnum<{
324
+ GET: "GET";
325
+ POST: "POST";
326
+ }>>;
327
+ /** Request body (JSON string, for POST requests) */
328
+ requestBody: z.ZodOptional<z.ZodString>;
329
+ /** Expected JSON response to validate against (subset match — extra fields in actual are OK) */
330
+ expectedResponse: z.ZodString;
331
+ /** Request headers as JSON string of key-value pairs */
332
+ requestHeaders: z.ZodOptional<z.ZodString>;
333
+ /** Request timeout in milliseconds (default 30000) */
334
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
252
335
  }, z.core.$strict>, z.ZodObject<{
253
336
  /** Maximum allowed duration in milliseconds */
254
337
  maxDurationMs: z.ZodNumber;
@@ -25,6 +25,7 @@ export declare const SYSTEM_ASSERTION_IDS: {
25
25
  readonly TIME_LIMIT: "system:time_limit";
26
26
  readonly COST: "system:cost";
27
27
  readonly LLM_JUDGE: "system:llm_judge";
28
+ readonly API_CALL: "system:api_call";
28
29
  };
29
30
  export type SystemAssertionId = (typeof SYSTEM_ASSERTION_IDS)[keyof typeof SYSTEM_ASSERTION_IDS];
30
31
  /**
@@ -27,21 +27,26 @@ export declare const TestScenarioSchema: z.ZodObject<{
27
27
  templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
28
  assertions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
29
29
  skillNames: z.ZodArray<z.ZodString>;
30
+ negate: z.ZodOptional<z.ZodBoolean>;
30
31
  type: z.ZodLiteral<"skill_was_called">;
31
32
  }, z.core.$strip>, z.ZodObject<{
32
33
  toolName: z.ZodString;
33
- expectedParams: z.ZodString;
34
+ expectedParams: z.ZodOptional<z.ZodString>;
34
35
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
36
+ negate: z.ZodOptional<z.ZodBoolean>;
35
37
  type: z.ZodLiteral<"tool_called_with_param">;
36
38
  }, z.core.$strict>, z.ZodObject<{
37
39
  command: z.ZodOptional<z.ZodString>;
38
40
  expectedExitCode: z.ZodOptional<z.ZodNumber>;
41
+ negate: z.ZodOptional<z.ZodBoolean>;
39
42
  type: z.ZodLiteral<"build_passed">;
40
43
  }, z.core.$strict>, z.ZodObject<{
41
44
  maxDurationMs: z.ZodNumber;
45
+ negate: z.ZodOptional<z.ZodBoolean>;
42
46
  type: z.ZodLiteral<"time_limit">;
43
47
  }, z.core.$strict>, z.ZodObject<{
44
48
  maxCostUsd: z.ZodNumber;
49
+ negate: z.ZodOptional<z.ZodBoolean>;
45
50
  type: z.ZodLiteral<"cost">;
46
51
  }, z.core.$strict>, z.ZodObject<{
47
52
  prompt: z.ZodString;
@@ -61,8 +66,21 @@ export declare const TestScenarioSchema: z.ZodObject<{
61
66
  defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
62
67
  advanced: z.ZodOptional<z.ZodBoolean>;
63
68
  }, z.core.$strip>>>;
69
+ negate: z.ZodOptional<z.ZodBoolean>;
64
70
  type: z.ZodLiteral<"llm_judge">;
65
- }, z.core.$strip>]>>>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ url: z.ZodString;
73
+ method: z.ZodOptional<z.ZodEnum<{
74
+ GET: "GET";
75
+ POST: "POST";
76
+ }>>;
77
+ requestBody: z.ZodOptional<z.ZodString>;
78
+ expectedResponse: z.ZodString;
79
+ requestHeaders: z.ZodOptional<z.ZodString>;
80
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
81
+ negate: z.ZodOptional<z.ZodBoolean>;
82
+ type: z.ZodLiteral<"api_call">;
83
+ }, z.core.$strict>]>>>;
66
84
  assertionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
85
  assertionLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
68
86
  assertionId: z.ZodString;
@@ -82,21 +100,26 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
82
100
  triggerPrompt: z.ZodString;
83
101
  assertions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
84
102
  skillNames: z.ZodArray<z.ZodString>;
103
+ negate: z.ZodOptional<z.ZodBoolean>;
85
104
  type: z.ZodLiteral<"skill_was_called">;
86
105
  }, z.core.$strip>, z.ZodObject<{
87
106
  toolName: z.ZodString;
88
- expectedParams: z.ZodString;
107
+ expectedParams: z.ZodOptional<z.ZodString>;
89
108
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
109
+ negate: z.ZodOptional<z.ZodBoolean>;
90
110
  type: z.ZodLiteral<"tool_called_with_param">;
91
111
  }, z.core.$strict>, z.ZodObject<{
92
112
  command: z.ZodOptional<z.ZodString>;
93
113
  expectedExitCode: z.ZodOptional<z.ZodNumber>;
114
+ negate: z.ZodOptional<z.ZodBoolean>;
94
115
  type: z.ZodLiteral<"build_passed">;
95
116
  }, z.core.$strict>, z.ZodObject<{
96
117
  maxDurationMs: z.ZodNumber;
118
+ negate: z.ZodOptional<z.ZodBoolean>;
97
119
  type: z.ZodLiteral<"time_limit">;
98
120
  }, z.core.$strict>, z.ZodObject<{
99
121
  maxCostUsd: z.ZodNumber;
122
+ negate: z.ZodOptional<z.ZodBoolean>;
100
123
  type: z.ZodLiteral<"cost">;
101
124
  }, z.core.$strict>, z.ZodObject<{
102
125
  prompt: z.ZodString;
@@ -116,8 +139,21 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
116
139
  defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
117
140
  advanced: z.ZodOptional<z.ZodBoolean>;
118
141
  }, z.core.$strip>>>;
142
+ negate: z.ZodOptional<z.ZodBoolean>;
119
143
  type: z.ZodLiteral<"llm_judge">;
120
- }, z.core.$strip>]>>>;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ url: z.ZodString;
146
+ method: z.ZodOptional<z.ZodEnum<{
147
+ GET: "GET";
148
+ POST: "POST";
149
+ }>>;
150
+ requestBody: z.ZodOptional<z.ZodString>;
151
+ expectedResponse: z.ZodString;
152
+ requestHeaders: z.ZodOptional<z.ZodString>;
153
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
154
+ negate: z.ZodOptional<z.ZodBoolean>;
155
+ type: z.ZodLiteral<"api_call">;
156
+ }, z.core.$strict>]>>>;
121
157
  assertionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
158
  assertionLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
159
  assertionId: z.ZodString;
@@ -137,21 +173,26 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
137
173
  triggerPrompt: z.ZodOptional<z.ZodString>;
138
174
  assertions: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
139
175
  skillNames: z.ZodArray<z.ZodString>;
176
+ negate: z.ZodOptional<z.ZodBoolean>;
140
177
  type: z.ZodLiteral<"skill_was_called">;
141
178
  }, z.core.$strip>, z.ZodObject<{
142
179
  toolName: z.ZodString;
143
- expectedParams: z.ZodString;
180
+ expectedParams: z.ZodOptional<z.ZodString>;
144
181
  requireSuccess: z.ZodOptional<z.ZodBoolean>;
182
+ negate: z.ZodOptional<z.ZodBoolean>;
145
183
  type: z.ZodLiteral<"tool_called_with_param">;
146
184
  }, z.core.$strict>, z.ZodObject<{
147
185
  command: z.ZodOptional<z.ZodString>;
148
186
  expectedExitCode: z.ZodOptional<z.ZodNumber>;
187
+ negate: z.ZodOptional<z.ZodBoolean>;
149
188
  type: z.ZodLiteral<"build_passed">;
150
189
  }, z.core.$strict>, z.ZodObject<{
151
190
  maxDurationMs: z.ZodNumber;
191
+ negate: z.ZodOptional<z.ZodBoolean>;
152
192
  type: z.ZodLiteral<"time_limit">;
153
193
  }, z.core.$strict>, z.ZodObject<{
154
194
  maxCostUsd: z.ZodNumber;
195
+ negate: z.ZodOptional<z.ZodBoolean>;
155
196
  type: z.ZodLiteral<"cost">;
156
197
  }, z.core.$strict>, z.ZodObject<{
157
198
  prompt: z.ZodString;
@@ -171,8 +212,21 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
171
212
  defaultValue: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
172
213
  advanced: z.ZodOptional<z.ZodBoolean>;
173
214
  }, z.core.$strip>>>;
215
+ negate: z.ZodOptional<z.ZodBoolean>;
174
216
  type: z.ZodLiteral<"llm_judge">;
175
- }, z.core.$strip>]>>>>;
217
+ }, z.core.$strip>, z.ZodObject<{
218
+ url: z.ZodString;
219
+ method: z.ZodOptional<z.ZodEnum<{
220
+ GET: "GET";
221
+ POST: "POST";
222
+ }>>;
223
+ requestBody: z.ZodOptional<z.ZodString>;
224
+ expectedResponse: z.ZodString;
225
+ requestHeaders: z.ZodOptional<z.ZodString>;
226
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
227
+ negate: z.ZodOptional<z.ZodBoolean>;
228
+ type: z.ZodLiteral<"api_call">;
229
+ }, z.core.$strict>]>>>>;
176
230
  assertionIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
177
231
  assertionLinks: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
178
232
  assertionId: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-types",
3
- "version": "0.60.0",
3
+ "version": "0.62.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": "f5906c2fb77b34a5faf6bead27516ae314576b92df11ade8fa2580bd"
49
+ "falconPackageHash": "940ab3ce9b65fa090b0b5759049e93a2c0d6517bbe81a37d3f388678"
50
50
  }