@wix/evalforge-types 0.35.0 → 0.36.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 +36 -1
- package/build/index.js.map +2 -2
- package/build/index.mjs +34 -1
- package/build/index.mjs.map +2 -2
- package/build/types/assertion/assertion.d.ts +26 -0
- package/build/types/assertion/system-assertions.d.ts +1 -0
- package/build/types/scenario/assertions.d.ts +12 -0
- package/build/types/scenario/test-scenario.d.ts +9 -0
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1025,6 +1025,8 @@ __export(index_exports, {
|
|
|
1025
1025
|
TestSuiteSchema: () => TestSuiteSchema,
|
|
1026
1026
|
TestType: () => TestType,
|
|
1027
1027
|
TestTypeSchema: () => TestTypeSchema,
|
|
1028
|
+
TimeAssertionSchema: () => TimeAssertionSchema,
|
|
1029
|
+
TimeConfigSchema: () => TimeConfigSchema,
|
|
1028
1030
|
TokenUsageSchema: () => TokenUsageSchema,
|
|
1029
1031
|
ToolTestSchema: () => ToolTestSchema,
|
|
1030
1032
|
TriggerMetadataSchema: () => TriggerMetadataSchema,
|
|
@@ -1482,9 +1484,15 @@ var LlmJudgeAssertionSchema = import_zod20.z.object({
|
|
|
1482
1484
|
maxTokens: import_zod20.z.number().int().optional(),
|
|
1483
1485
|
temperature: import_zod20.z.number().min(0).max(1).optional()
|
|
1484
1486
|
});
|
|
1487
|
+
var TimeAssertionSchema = import_zod20.z.object({
|
|
1488
|
+
type: import_zod20.z.literal("time_limit"),
|
|
1489
|
+
/** Maximum allowed duration in milliseconds */
|
|
1490
|
+
maxDurationMs: import_zod20.z.number().int().positive()
|
|
1491
|
+
});
|
|
1485
1492
|
var AssertionSchema = import_zod20.z.union([
|
|
1486
1493
|
SkillWasCalledAssertionSchema,
|
|
1487
1494
|
BuildPassedAssertionSchema,
|
|
1495
|
+
TimeAssertionSchema,
|
|
1488
1496
|
LlmJudgeAssertionSchema
|
|
1489
1497
|
]);
|
|
1490
1498
|
|
|
@@ -1530,6 +1538,7 @@ var import_zod22 = require("zod");
|
|
|
1530
1538
|
var AssertionTypeSchema = import_zod22.z.enum([
|
|
1531
1539
|
"skill_was_called",
|
|
1532
1540
|
"build_passed",
|
|
1541
|
+
"time_limit",
|
|
1533
1542
|
"llm_judge"
|
|
1534
1543
|
]);
|
|
1535
1544
|
var AssertionParameterTypeSchema = import_zod22.z.enum([
|
|
@@ -1570,6 +1579,10 @@ var BuildPassedConfigSchema = import_zod22.z.strictObject({
|
|
|
1570
1579
|
/** Expected exit code (default: 0) */
|
|
1571
1580
|
expectedExitCode: import_zod22.z.number().int().optional()
|
|
1572
1581
|
});
|
|
1582
|
+
var TimeConfigSchema = import_zod22.z.strictObject({
|
|
1583
|
+
/** Maximum allowed duration in milliseconds */
|
|
1584
|
+
maxDurationMs: import_zod22.z.number().int().positive()
|
|
1585
|
+
});
|
|
1573
1586
|
var LlmJudgeConfigSchema = import_zod22.z.object({
|
|
1574
1587
|
/**
|
|
1575
1588
|
* Prompt template with placeholders:
|
|
@@ -1599,7 +1612,9 @@ var AssertionConfigSchema = import_zod22.z.union([
|
|
|
1599
1612
|
LlmJudgeConfigSchema,
|
|
1600
1613
|
// requires prompt - check first
|
|
1601
1614
|
SkillWasCalledConfigSchema,
|
|
1602
|
-
// requires
|
|
1615
|
+
// requires skillNames
|
|
1616
|
+
TimeConfigSchema,
|
|
1617
|
+
// requires maxDurationMs, uses strictObject
|
|
1603
1618
|
BuildPassedConfigSchema,
|
|
1604
1619
|
// all optional, uses strictObject to reject unknown keys
|
|
1605
1620
|
import_zod22.z.object({})
|
|
@@ -1624,6 +1639,8 @@ function validateAssertionConfig(type, config) {
|
|
|
1624
1639
|
return SkillWasCalledConfigSchema.safeParse(config).success;
|
|
1625
1640
|
case "build_passed":
|
|
1626
1641
|
return BuildPassedConfigSchema.safeParse(config).success;
|
|
1642
|
+
case "time_limit":
|
|
1643
|
+
return TimeConfigSchema.safeParse(config).success;
|
|
1627
1644
|
case "llm_judge":
|
|
1628
1645
|
return LlmJudgeConfigSchema.safeParse(config).success;
|
|
1629
1646
|
default:
|
|
@@ -2127,6 +2144,7 @@ var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
|
|
|
2127
2144
|
var SYSTEM_ASSERTION_IDS = {
|
|
2128
2145
|
SKILL_WAS_CALLED: "system:skill_was_called",
|
|
2129
2146
|
BUILD_PASSED: "system:build_passed",
|
|
2147
|
+
TIME_LIMIT: "system:time_limit",
|
|
2130
2148
|
LLM_JUDGE: "system:llm_judge"
|
|
2131
2149
|
};
|
|
2132
2150
|
function isSystemAssertionId(id) {
|
|
@@ -2183,6 +2201,21 @@ var SYSTEM_ASSERTIONS = {
|
|
|
2183
2201
|
}
|
|
2184
2202
|
]
|
|
2185
2203
|
},
|
|
2204
|
+
[SYSTEM_ASSERTION_IDS.TIME_LIMIT]: {
|
|
2205
|
+
id: SYSTEM_ASSERTION_IDS.TIME_LIMIT,
|
|
2206
|
+
name: "Time Limit",
|
|
2207
|
+
description: "Check that the scenario completed within a maximum duration",
|
|
2208
|
+
type: "time_limit",
|
|
2209
|
+
parameters: [
|
|
2210
|
+
{
|
|
2211
|
+
name: "maxDurationMs",
|
|
2212
|
+
label: "Max Duration (ms)",
|
|
2213
|
+
type: "number",
|
|
2214
|
+
required: true,
|
|
2215
|
+
defaultValue: 3e5
|
|
2216
|
+
}
|
|
2217
|
+
]
|
|
2218
|
+
},
|
|
2186
2219
|
[SYSTEM_ASSERTION_IDS.LLM_JUDGE]: {
|
|
2187
2220
|
id: SYSTEM_ASSERTION_IDS.LLM_JUDGE,
|
|
2188
2221
|
name: "LLM Judge",
|
|
@@ -2344,6 +2377,8 @@ function getSystemAssertion(id) {
|
|
|
2344
2377
|
TestSuiteSchema,
|
|
2345
2378
|
TestType,
|
|
2346
2379
|
TestTypeSchema,
|
|
2380
|
+
TimeAssertionSchema,
|
|
2381
|
+
TimeConfigSchema,
|
|
2347
2382
|
TokenUsageSchema,
|
|
2348
2383
|
ToolTestSchema,
|
|
2349
2384
|
TriggerMetadataSchema,
|