@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/README.md CHANGED
@@ -15,6 +15,7 @@ Shared TypeScript types and [Zod](https://zod.dev/) schemas for the EvalForge pl
15
15
  | `evaluation` | Eval run schemas, configs, results, and statuses |
16
16
  | `project` | Project schemas (multi-tenancy root) |
17
17
  | `template` | Project template schemas |
18
+ | `schedule` | Recurring evaluation schedule schemas (`EvalSchedule`, `FrequencyType`) |
18
19
  | `assertion` | Custom assertion definitions |
19
20
  | `agent` | Agent adapter interface |
20
21
  | `test` | Test type definitions (LLM, TOOL, BUILD_CHECK, etc.) |
package/build/index.js CHANGED
@@ -61,6 +61,7 @@ __export(index_exports, {
61
61
  CreateAgentInputSchema: () => CreateAgentInputSchema,
62
62
  CreateCustomAssertionInputSchema: () => CreateCustomAssertionInputSchema,
63
63
  CreateEvalRunInputSchema: () => CreateEvalRunInputSchema,
64
+ CreateEvalScheduleInputSchema: () => CreateEvalScheduleInputSchema,
64
65
  CreateMcpInputSchema: () => CreateMcpInputSchema,
65
66
  CreatePresetInputSchema: () => CreatePresetInputSchema,
66
67
  CreateProjectInputSchema: () => CreateProjectInputSchema,
@@ -81,6 +82,7 @@ __export(index_exports, {
81
82
  EvalMetricsSchema: () => EvalMetricsSchema,
82
83
  EvalRunResultSchema: () => EvalRunResultSchema,
83
84
  EvalRunSchema: () => EvalRunSchema,
85
+ EvalScheduleSchema: () => EvalScheduleSchema,
84
86
  EvalStatus: () => EvalStatus,
85
87
  EvalStatusSchema: () => EvalStatusSchema,
86
88
  EvaluationLogSchema: () => EvaluationLogSchema,
@@ -95,6 +97,7 @@ __export(index_exports, {
95
97
  FileContentTestSchema: () => FileContentTestSchema,
96
98
  FileModificationSchema: () => FileModificationSchema,
97
99
  FilePresenceTestSchema: () => FilePresenceTestSchema,
100
+ FrequencyType: () => FrequencyType,
98
101
  GitHubSourceSchema: () => GitHubSourceSchema,
99
102
  InitialVersionInputSchema: () => InitialVersionInputSchema,
100
103
  LEGACY_MODEL_ID_MAP: () => LEGACY_MODEL_ID_MAP,
@@ -170,6 +173,7 @@ __export(index_exports, {
170
173
  TriggerType: () => TriggerType,
171
174
  UpdateAgentInputSchema: () => UpdateAgentInputSchema,
172
175
  UpdateCustomAssertionInputSchema: () => UpdateCustomAssertionInputSchema,
176
+ UpdateEvalScheduleInputSchema: () => UpdateEvalScheduleInputSchema,
173
177
  UpdateMcpInputSchema: () => UpdateMcpInputSchema,
174
178
  UpdatePresetInputSchema: () => UpdatePresetInputSchema,
175
179
  UpdateProjectInputSchema: () => UpdateProjectInputSchema,
@@ -1149,16 +1153,18 @@ var TriggerType = /* @__PURE__ */ ((TriggerType2) => {
1149
1153
  TriggerType2["MCP_VERSION_RELEASE"] = "MCP_VERSION_RELEASE";
1150
1154
  TriggerType2["MCP_PREVIEW_CREATED"] = "MCP_PREVIEW_CREATED";
1151
1155
  TriggerType2["MANUAL"] = "MANUAL";
1156
+ TriggerType2["SCHEDULED"] = "SCHEDULED";
1152
1157
  return TriggerType2;
1153
1158
  })(TriggerType || {});
1154
1159
  var TriggerMetadataSchema = import_zod27.z.object({
1155
1160
  version: import_zod27.z.string().optional(),
1156
- resourceUpdated: import_zod27.z.array(import_zod27.z.string()).optional()
1161
+ resourceUpdated: import_zod27.z.array(import_zod27.z.string()).optional(),
1162
+ scheduleId: import_zod27.z.string().optional()
1157
1163
  });
1158
1164
  var TriggerSchema = import_zod27.z.object({
1159
1165
  id: import_zod27.z.string(),
1160
1166
  metadata: TriggerMetadataSchema.optional(),
1161
- type: import_zod27.z.enum(TriggerType)
1167
+ type: import_zod27.z.nativeEnum(TriggerType)
1162
1168
  });
1163
1169
  var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
1164
1170
  FailureCategory2["MISSING_FILE"] = "missing_file";
@@ -1502,6 +1508,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
1502
1508
  });
1503
1509
  var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
1504
1510
 
1511
+ // src/schedule/eval-schedule.ts
1512
+ var import_zod31 = require("zod");
1513
+ var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
1514
+ FrequencyType2["DAILY"] = "daily";
1515
+ FrequencyType2["WEEKDAY"] = "weekday";
1516
+ FrequencyType2["WEEKLY"] = "weekly";
1517
+ FrequencyType2["MONTHLY"] = "monthly";
1518
+ return FrequencyType2;
1519
+ })(FrequencyType || {});
1520
+ var EvalScheduleSchema = TenantEntitySchema.extend({
1521
+ /** Whether the schedule is active */
1522
+ enabled: import_zod31.z.boolean(),
1523
+ /** Test suite to run */
1524
+ suiteId: import_zod31.z.string(),
1525
+ /** Preset that provides agent + entities for this schedule */
1526
+ presetId: import_zod31.z.string(),
1527
+ /** How often to run */
1528
+ frequencyType: import_zod31.z.nativeEnum(FrequencyType),
1529
+ /** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
1530
+ timeOfDay: import_zod31.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
1531
+ /** Day of week (0=Sun, 6=Sat) for weekly schedules */
1532
+ dayOfWeek: import_zod31.z.number().min(0).max(6).optional(),
1533
+ /** Day of month (1-31) for monthly schedules */
1534
+ dayOfMonth: import_zod31.z.number().min(1).max(31).optional(),
1535
+ /** IANA timezone (e.g., 'America/New_York') */
1536
+ timezone: import_zod31.z.string(),
1537
+ /** ID of the last eval run created by this schedule */
1538
+ lastRunId: import_zod31.z.string().optional(),
1539
+ /** Denormalized status of the last run */
1540
+ lastRunStatus: import_zod31.z.string().optional(),
1541
+ /** ISO timestamp of the last run */
1542
+ lastRunAt: import_zod31.z.string().optional(),
1543
+ /** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
1544
+ nextRunAt: import_zod31.z.string().optional()
1545
+ });
1546
+ function isValidTimezone(tz) {
1547
+ try {
1548
+ Intl.DateTimeFormat(void 0, { timeZone: tz });
1549
+ return true;
1550
+ } catch {
1551
+ return false;
1552
+ }
1553
+ }
1554
+ function validateScheduleFields(data, ctx, options) {
1555
+ if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
1556
+ ctx.addIssue({
1557
+ code: import_zod31.z.ZodIssueCode.custom,
1558
+ message: "dayOfWeek is required for weekly schedules",
1559
+ path: ["dayOfWeek"]
1560
+ });
1561
+ }
1562
+ if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
1563
+ ctx.addIssue({
1564
+ code: import_zod31.z.ZodIssueCode.custom,
1565
+ message: "dayOfMonth is required for monthly schedules",
1566
+ path: ["dayOfMonth"]
1567
+ });
1568
+ }
1569
+ const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
1570
+ if (shouldValidateTz && !isValidTimezone(data.timezone)) {
1571
+ ctx.addIssue({
1572
+ code: import_zod31.z.ZodIssueCode.custom,
1573
+ message: "Invalid IANA timezone",
1574
+ path: ["timezone"]
1575
+ });
1576
+ }
1577
+ }
1578
+ var BaseCreateScheduleSchema = EvalScheduleSchema.omit({
1579
+ id: true,
1580
+ projectId: true,
1581
+ deleted: true,
1582
+ createdAt: true,
1583
+ updatedAt: true,
1584
+ lastRunId: true,
1585
+ lastRunStatus: true,
1586
+ lastRunAt: true,
1587
+ nextRunAt: true
1588
+ });
1589
+ var CreateEvalScheduleInputSchema = BaseCreateScheduleSchema.superRefine((data, ctx) => {
1590
+ validateScheduleFields(data, ctx, { partial: false });
1591
+ });
1592
+ var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {
1593
+ validateScheduleFields(data, ctx, { partial: true });
1594
+ });
1595
+
1505
1596
  // src/assertion/system-assertions.ts
1506
1597
  var SYSTEM_ASSERTION_IDS = {
1507
1598
  SKILL_WAS_CALLED: "system:skill_was_called",
@@ -1701,6 +1792,7 @@ function getSystemAssertion(id) {
1701
1792
  CreateAgentInputSchema,
1702
1793
  CreateCustomAssertionInputSchema,
1703
1794
  CreateEvalRunInputSchema,
1795
+ CreateEvalScheduleInputSchema,
1704
1796
  CreateMcpInputSchema,
1705
1797
  CreatePresetInputSchema,
1706
1798
  CreateProjectInputSchema,
@@ -1721,6 +1813,7 @@ function getSystemAssertion(id) {
1721
1813
  EvalMetricsSchema,
1722
1814
  EvalRunResultSchema,
1723
1815
  EvalRunSchema,
1816
+ EvalScheduleSchema,
1724
1817
  EvalStatus,
1725
1818
  EvalStatusSchema,
1726
1819
  EvaluationLogSchema,
@@ -1735,6 +1828,7 @@ function getSystemAssertion(id) {
1735
1828
  FileContentTestSchema,
1736
1829
  FileModificationSchema,
1737
1830
  FilePresenceTestSchema,
1831
+ FrequencyType,
1738
1832
  GitHubSourceSchema,
1739
1833
  InitialVersionInputSchema,
1740
1834
  LEGACY_MODEL_ID_MAP,
@@ -1810,6 +1904,7 @@ function getSystemAssertion(id) {
1810
1904
  TriggerType,
1811
1905
  UpdateAgentInputSchema,
1812
1906
  UpdateCustomAssertionInputSchema,
1907
+ UpdateEvalScheduleInputSchema,
1813
1908
  UpdateMcpInputSchema,
1814
1909
  UpdatePresetInputSchema,
1815
1910
  UpdateProjectInputSchema,