@wix/evalforge-types 0.61.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,7 @@ 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)
10
11
  *
11
12
  * Any assertion can be negated by setting `negate: true` to invert the pass/fail logic.
12
13
  */
@@ -17,6 +18,7 @@ export declare const AssertionTypeSchema: z.ZodEnum<{
17
18
  time_limit: "time_limit";
18
19
  cost: "cost";
19
20
  llm_judge: "llm_judge";
21
+ api_call: "api_call";
20
22
  }>;
21
23
  /**
22
24
  * Parameter types supported in assertion parameters.
@@ -127,6 +129,30 @@ export declare const LlmJudgeConfigSchema: z.ZodObject<{
127
129
  }, z.core.$strip>>>;
128
130
  }, z.core.$strip>;
129
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>;
130
156
  export declare const SkillWasCalledAssertionSchema: z.ZodObject<{
131
157
  skillNames: z.ZodArray<z.ZodString>;
132
158
  negate: z.ZodOptional<z.ZodBoolean>;
@@ -176,6 +202,20 @@ export declare const LlmJudgeAssertionSchema: z.ZodObject<{
176
202
  type: z.ZodLiteral<"llm_judge">;
177
203
  }, z.core.$strip>;
178
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>;
179
219
  export declare const TimeAssertionSchema: z.ZodObject<{
180
220
  maxDurationMs: z.ZodNumber;
181
221
  negate: z.ZodOptional<z.ZodBoolean>;
@@ -229,7 +269,19 @@ export declare const AssertionSchema: z.ZodUnion<readonly [z.ZodObject<{
229
269
  }, z.core.$strip>>>;
230
270
  negate: z.ZodOptional<z.ZodBoolean>;
231
271
  type: z.ZodLiteral<"llm_judge">;
232
- }, 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>]>;
233
285
  export type Assertion = z.infer<typeof AssertionSchema>;
234
286
  /**
235
287
  * Union of all assertion config types.
@@ -264,6 +316,22 @@ export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
264
316
  expectedParams: z.ZodOptional<z.ZodString>;
265
317
  /** If true, the matching tool call must also have succeeded (step.success === true) */
266
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>;
267
335
  }, z.core.$strict>, z.ZodObject<{
268
336
  /** Maximum allowed duration in milliseconds */
269
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
  /**
@@ -68,7 +68,19 @@ export declare const TestScenarioSchema: z.ZodObject<{
68
68
  }, z.core.$strip>>>;
69
69
  negate: z.ZodOptional<z.ZodBoolean>;
70
70
  type: z.ZodLiteral<"llm_judge">;
71
- }, 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>]>>>;
72
84
  assertionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
85
  assertionLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
74
86
  assertionId: z.ZodString;
@@ -129,7 +141,19 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
129
141
  }, z.core.$strip>>>;
130
142
  negate: z.ZodOptional<z.ZodBoolean>;
131
143
  type: z.ZodLiteral<"llm_judge">;
132
- }, 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>]>>>;
133
157
  assertionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
134
158
  assertionLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
159
  assertionId: z.ZodString;
@@ -190,7 +214,19 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
190
214
  }, z.core.$strip>>>;
191
215
  negate: z.ZodOptional<z.ZodBoolean>;
192
216
  type: z.ZodLiteral<"llm_judge">;
193
- }, 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>]>>>>;
194
230
  assertionIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
195
231
  assertionLinks: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
196
232
  assertionId: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-types",
3
- "version": "0.61.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": "1829a0f485cce6f1adaf0ec93b47528012e55ab746b19e3533f5b605"
49
+ "falconPackageHash": "940ab3ce9b65fa090b0b5759049e93a2c0d6517bbe81a37d3f388678"
50
50
  }