@wix/evalforge-types 0.56.0 → 0.57.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.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.enum(TriggerType)
967
+ type: z27.nativeEnum(TriggerType)
966
968
  });
967
969
  var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
968
970
  FailureCategory2["MISSING_FILE"] = "missing_file";
@@ -1306,6 +1308,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
1306
1308
  });
1307
1309
  var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
1308
1310
 
1311
+ // src/schedule/eval-schedule.ts
1312
+ import { z as z31 } from "zod";
1313
+ var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
1314
+ FrequencyType2["DAILY"] = "daily";
1315
+ FrequencyType2["WEEKDAY"] = "weekday";
1316
+ FrequencyType2["WEEKLY"] = "weekly";
1317
+ FrequencyType2["MONTHLY"] = "monthly";
1318
+ return FrequencyType2;
1319
+ })(FrequencyType || {});
1320
+ var EvalScheduleSchema = TenantEntitySchema.extend({
1321
+ /** Whether the schedule is active */
1322
+ enabled: z31.boolean(),
1323
+ /** Test suite to run */
1324
+ suiteId: z31.string(),
1325
+ /** Preset that provides agent + entities for this schedule */
1326
+ presetId: z31.string(),
1327
+ /** How often to run */
1328
+ frequencyType: z31.nativeEnum(FrequencyType),
1329
+ /** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
1330
+ timeOfDay: z31.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
1331
+ /** Day of week (0=Sun, 6=Sat) for weekly schedules */
1332
+ dayOfWeek: z31.number().min(0).max(6).optional(),
1333
+ /** Day of month (1-31) for monthly schedules */
1334
+ dayOfMonth: z31.number().min(1).max(31).optional(),
1335
+ /** IANA timezone (e.g., 'America/New_York') */
1336
+ timezone: z31.string(),
1337
+ /** ID of the last eval run created by this schedule */
1338
+ lastRunId: z31.string().optional(),
1339
+ /** Denormalized status of the last run */
1340
+ lastRunStatus: z31.string().optional(),
1341
+ /** ISO timestamp of the last run */
1342
+ lastRunAt: z31.string().optional(),
1343
+ /** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
1344
+ nextRunAt: z31.string().optional()
1345
+ });
1346
+ function isValidTimezone(tz) {
1347
+ try {
1348
+ Intl.DateTimeFormat(void 0, { timeZone: tz });
1349
+ return true;
1350
+ } catch {
1351
+ return false;
1352
+ }
1353
+ }
1354
+ function validateScheduleFields(data, ctx, options) {
1355
+ if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
1356
+ ctx.addIssue({
1357
+ code: z31.ZodIssueCode.custom,
1358
+ message: "dayOfWeek is required for weekly schedules",
1359
+ path: ["dayOfWeek"]
1360
+ });
1361
+ }
1362
+ if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
1363
+ ctx.addIssue({
1364
+ code: z31.ZodIssueCode.custom,
1365
+ message: "dayOfMonth is required for monthly schedules",
1366
+ path: ["dayOfMonth"]
1367
+ });
1368
+ }
1369
+ const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
1370
+ if (shouldValidateTz && !isValidTimezone(data.timezone)) {
1371
+ ctx.addIssue({
1372
+ code: z31.ZodIssueCode.custom,
1373
+ message: "Invalid IANA timezone",
1374
+ path: ["timezone"]
1375
+ });
1376
+ }
1377
+ }
1378
+ var BaseCreateScheduleSchema = EvalScheduleSchema.omit({
1379
+ id: true,
1380
+ projectId: true,
1381
+ deleted: true,
1382
+ createdAt: true,
1383
+ updatedAt: true,
1384
+ lastRunId: true,
1385
+ lastRunStatus: true,
1386
+ lastRunAt: true,
1387
+ nextRunAt: true
1388
+ });
1389
+ var CreateEvalScheduleInputSchema = BaseCreateScheduleSchema.superRefine((data, ctx) => {
1390
+ validateScheduleFields(data, ctx, { partial: false });
1391
+ });
1392
+ var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {
1393
+ validateScheduleFields(data, ctx, { partial: true });
1394
+ });
1395
+
1309
1396
  // src/assertion/system-assertions.ts
1310
1397
  var SYSTEM_ASSERTION_IDS = {
1311
1398
  SKILL_WAS_CALLED: "system:skill_was_called",
@@ -1504,6 +1591,7 @@ export {
1504
1591
  CreateAgentInputSchema,
1505
1592
  CreateCustomAssertionInputSchema,
1506
1593
  CreateEvalRunInputSchema,
1594
+ CreateEvalScheduleInputSchema,
1507
1595
  CreateMcpInputSchema,
1508
1596
  CreatePresetInputSchema,
1509
1597
  CreateProjectInputSchema,
@@ -1524,6 +1612,7 @@ export {
1524
1612
  EvalMetricsSchema,
1525
1613
  EvalRunResultSchema,
1526
1614
  EvalRunSchema,
1615
+ EvalScheduleSchema,
1527
1616
  EvalStatus,
1528
1617
  EvalStatusSchema,
1529
1618
  EvaluationLogSchema,
@@ -1538,6 +1627,7 @@ export {
1538
1627
  FileContentTestSchema,
1539
1628
  FileModificationSchema,
1540
1629
  FilePresenceTestSchema,
1630
+ FrequencyType,
1541
1631
  GitHubSourceSchema,
1542
1632
  InitialVersionInputSchema,
1543
1633
  LEGACY_MODEL_ID_MAP,
@@ -1613,6 +1703,7 @@ export {
1613
1703
  TriggerType,
1614
1704
  UpdateAgentInputSchema,
1615
1705
  UpdateCustomAssertionInputSchema,
1706
+ UpdateEvalScheduleInputSchema,
1616
1707
  UpdateMcpInputSchema,
1617
1708
  UpdatePresetInputSchema,
1618
1709
  UpdateProjectInputSchema,