@wix/evalforge-types 0.56.0 → 0.58.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 -0
- package/build/index.js +103 -4
- package/build/index.js.map +4 -4
- package/build/index.mjs +99 -4
- package/build/index.mjs.map +4 -4
- package/build/types/agent/adapter.d.ts +10 -0
- package/build/types/evaluation/eval-result.d.ts +2 -0
- package/build/types/evaluation/eval-run.d.ts +13 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/schedule/eval-schedule.d.ts +76 -0
- package/build/types/schedule/index.d.ts +1 -0
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -953,16 +953,18 @@ var TriggerType = /* @__PURE__ */ ((TriggerType2) => {
|
|
|
953
953
|
TriggerType2["MCP_VERSION_RELEASE"] = "MCP_VERSION_RELEASE";
|
|
954
954
|
TriggerType2["MCP_PREVIEW_CREATED"] = "MCP_PREVIEW_CREATED";
|
|
955
955
|
TriggerType2["MANUAL"] = "MANUAL";
|
|
956
|
+
TriggerType2["SCHEDULED"] = "SCHEDULED";
|
|
956
957
|
return TriggerType2;
|
|
957
958
|
})(TriggerType || {});
|
|
958
959
|
var TriggerMetadataSchema = z27.object({
|
|
959
960
|
version: z27.string().optional(),
|
|
960
|
-
resourceUpdated: z27.array(z27.string()).optional()
|
|
961
|
+
resourceUpdated: z27.array(z27.string()).optional(),
|
|
962
|
+
scheduleId: z27.string().optional()
|
|
961
963
|
});
|
|
962
964
|
var TriggerSchema = z27.object({
|
|
963
965
|
id: z27.string(),
|
|
964
966
|
metadata: TriggerMetadataSchema.optional(),
|
|
965
|
-
type: z27.
|
|
967
|
+
type: z27.nativeEnum(TriggerType)
|
|
966
968
|
});
|
|
967
969
|
var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
|
|
968
970
|
FailureCategory2["MISSING_FILE"] = "missing_file";
|
|
@@ -991,7 +993,9 @@ var DiffContentSchema = z27.object({
|
|
|
991
993
|
expected: z27.string(),
|
|
992
994
|
actual: z27.string(),
|
|
993
995
|
diffLines: z27.array(DiffLineSchema),
|
|
994
|
-
renamedFrom: z27.string().optional()
|
|
996
|
+
renamedFrom: z27.string().optional(),
|
|
997
|
+
/** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */
|
|
998
|
+
isInfrastructure: z27.boolean().optional()
|
|
995
999
|
});
|
|
996
1000
|
var CommandExecutionSchema = z27.object({
|
|
997
1001
|
command: z27.string(),
|
|
@@ -1015,7 +1019,9 @@ var TemplateFileSchema = z27.object({
|
|
|
1015
1019
|
/** Full file content after execution */
|
|
1016
1020
|
content: z27.string(),
|
|
1017
1021
|
/** File status (new, modified, unchanged) */
|
|
1018
|
-
status: z27.enum(["new", "modified", "unchanged"])
|
|
1022
|
+
status: z27.enum(["new", "modified", "unchanged"]),
|
|
1023
|
+
/** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */
|
|
1024
|
+
isInfrastructure: z27.boolean().optional()
|
|
1019
1025
|
});
|
|
1020
1026
|
var ApiCallSchema = z27.object({
|
|
1021
1027
|
endpoint: z27.string(),
|
|
@@ -1306,6 +1312,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
|
1306
1312
|
});
|
|
1307
1313
|
var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
|
|
1308
1314
|
|
|
1315
|
+
// src/schedule/eval-schedule.ts
|
|
1316
|
+
import { z as z31 } from "zod";
|
|
1317
|
+
var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
|
|
1318
|
+
FrequencyType2["DAILY"] = "daily";
|
|
1319
|
+
FrequencyType2["WEEKDAY"] = "weekday";
|
|
1320
|
+
FrequencyType2["WEEKLY"] = "weekly";
|
|
1321
|
+
FrequencyType2["MONTHLY"] = "monthly";
|
|
1322
|
+
return FrequencyType2;
|
|
1323
|
+
})(FrequencyType || {});
|
|
1324
|
+
var EvalScheduleSchema = TenantEntitySchema.extend({
|
|
1325
|
+
/** Whether the schedule is active */
|
|
1326
|
+
enabled: z31.boolean(),
|
|
1327
|
+
/** Test suite to run */
|
|
1328
|
+
suiteId: z31.string(),
|
|
1329
|
+
/** Preset that provides agent + entities for this schedule */
|
|
1330
|
+
presetId: z31.string(),
|
|
1331
|
+
/** How often to run */
|
|
1332
|
+
frequencyType: z31.nativeEnum(FrequencyType),
|
|
1333
|
+
/** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
|
|
1334
|
+
timeOfDay: z31.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
|
|
1335
|
+
/** Day of week (0=Sun, 6=Sat) for weekly schedules */
|
|
1336
|
+
dayOfWeek: z31.number().min(0).max(6).optional(),
|
|
1337
|
+
/** Day of month (1-31) for monthly schedules */
|
|
1338
|
+
dayOfMonth: z31.number().min(1).max(31).optional(),
|
|
1339
|
+
/** IANA timezone (e.g., 'America/New_York') */
|
|
1340
|
+
timezone: z31.string(),
|
|
1341
|
+
/** ID of the last eval run created by this schedule */
|
|
1342
|
+
lastRunId: z31.string().optional(),
|
|
1343
|
+
/** Denormalized status of the last run */
|
|
1344
|
+
lastRunStatus: z31.string().optional(),
|
|
1345
|
+
/** ISO timestamp of the last run */
|
|
1346
|
+
lastRunAt: z31.string().optional(),
|
|
1347
|
+
/** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
|
|
1348
|
+
nextRunAt: z31.string().optional()
|
|
1349
|
+
});
|
|
1350
|
+
function isValidTimezone(tz) {
|
|
1351
|
+
try {
|
|
1352
|
+
Intl.DateTimeFormat(void 0, { timeZone: tz });
|
|
1353
|
+
return true;
|
|
1354
|
+
} catch {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
function validateScheduleFields(data, ctx, options) {
|
|
1359
|
+
if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
|
|
1360
|
+
ctx.addIssue({
|
|
1361
|
+
code: z31.ZodIssueCode.custom,
|
|
1362
|
+
message: "dayOfWeek is required for weekly schedules",
|
|
1363
|
+
path: ["dayOfWeek"]
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
|
|
1367
|
+
ctx.addIssue({
|
|
1368
|
+
code: z31.ZodIssueCode.custom,
|
|
1369
|
+
message: "dayOfMonth is required for monthly schedules",
|
|
1370
|
+
path: ["dayOfMonth"]
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
|
|
1374
|
+
if (shouldValidateTz && !isValidTimezone(data.timezone)) {
|
|
1375
|
+
ctx.addIssue({
|
|
1376
|
+
code: z31.ZodIssueCode.custom,
|
|
1377
|
+
message: "Invalid IANA timezone",
|
|
1378
|
+
path: ["timezone"]
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
var BaseCreateScheduleSchema = EvalScheduleSchema.omit({
|
|
1383
|
+
id: true,
|
|
1384
|
+
projectId: true,
|
|
1385
|
+
deleted: true,
|
|
1386
|
+
createdAt: true,
|
|
1387
|
+
updatedAt: true,
|
|
1388
|
+
lastRunId: true,
|
|
1389
|
+
lastRunStatus: true,
|
|
1390
|
+
lastRunAt: true,
|
|
1391
|
+
nextRunAt: true
|
|
1392
|
+
});
|
|
1393
|
+
var CreateEvalScheduleInputSchema = BaseCreateScheduleSchema.superRefine((data, ctx) => {
|
|
1394
|
+
validateScheduleFields(data, ctx, { partial: false });
|
|
1395
|
+
});
|
|
1396
|
+
var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {
|
|
1397
|
+
validateScheduleFields(data, ctx, { partial: true });
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1309
1400
|
// src/assertion/system-assertions.ts
|
|
1310
1401
|
var SYSTEM_ASSERTION_IDS = {
|
|
1311
1402
|
SKILL_WAS_CALLED: "system:skill_was_called",
|
|
@@ -1504,6 +1595,7 @@ export {
|
|
|
1504
1595
|
CreateAgentInputSchema,
|
|
1505
1596
|
CreateCustomAssertionInputSchema,
|
|
1506
1597
|
CreateEvalRunInputSchema,
|
|
1598
|
+
CreateEvalScheduleInputSchema,
|
|
1507
1599
|
CreateMcpInputSchema,
|
|
1508
1600
|
CreatePresetInputSchema,
|
|
1509
1601
|
CreateProjectInputSchema,
|
|
@@ -1524,6 +1616,7 @@ export {
|
|
|
1524
1616
|
EvalMetricsSchema,
|
|
1525
1617
|
EvalRunResultSchema,
|
|
1526
1618
|
EvalRunSchema,
|
|
1619
|
+
EvalScheduleSchema,
|
|
1527
1620
|
EvalStatus,
|
|
1528
1621
|
EvalStatusSchema,
|
|
1529
1622
|
EvaluationLogSchema,
|
|
@@ -1538,6 +1631,7 @@ export {
|
|
|
1538
1631
|
FileContentTestSchema,
|
|
1539
1632
|
FileModificationSchema,
|
|
1540
1633
|
FilePresenceTestSchema,
|
|
1634
|
+
FrequencyType,
|
|
1541
1635
|
GitHubSourceSchema,
|
|
1542
1636
|
InitialVersionInputSchema,
|
|
1543
1637
|
LEGACY_MODEL_ID_MAP,
|
|
@@ -1613,6 +1707,7 @@ export {
|
|
|
1613
1707
|
TriggerType,
|
|
1614
1708
|
UpdateAgentInputSchema,
|
|
1615
1709
|
UpdateCustomAssertionInputSchema,
|
|
1710
|
+
UpdateEvalScheduleInputSchema,
|
|
1616
1711
|
UpdateMcpInputSchema,
|
|
1617
1712
|
UpdatePresetInputSchema,
|
|
1618
1713
|
UpdateProjectInputSchema,
|