@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 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";
@@ -1187,7 +1193,9 @@ var DiffContentSchema = import_zod27.z.object({
1187
1193
  expected: import_zod27.z.string(),
1188
1194
  actual: import_zod27.z.string(),
1189
1195
  diffLines: import_zod27.z.array(DiffLineSchema),
1190
- renamedFrom: import_zod27.z.string().optional()
1196
+ renamedFrom: import_zod27.z.string().optional(),
1197
+ /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */
1198
+ isInfrastructure: import_zod27.z.boolean().optional()
1191
1199
  });
1192
1200
  var CommandExecutionSchema = import_zod27.z.object({
1193
1201
  command: import_zod27.z.string(),
@@ -1211,7 +1219,9 @@ var TemplateFileSchema = import_zod27.z.object({
1211
1219
  /** Full file content after execution */
1212
1220
  content: import_zod27.z.string(),
1213
1221
  /** File status (new, modified, unchanged) */
1214
- status: import_zod27.z.enum(["new", "modified", "unchanged"])
1222
+ status: import_zod27.z.enum(["new", "modified", "unchanged"]),
1223
+ /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */
1224
+ isInfrastructure: import_zod27.z.boolean().optional()
1215
1225
  });
1216
1226
  var ApiCallSchema = import_zod27.z.object({
1217
1227
  endpoint: import_zod27.z.string(),
@@ -1502,6 +1512,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
1502
1512
  });
1503
1513
  var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
1504
1514
 
1515
+ // src/schedule/eval-schedule.ts
1516
+ var import_zod31 = require("zod");
1517
+ var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
1518
+ FrequencyType2["DAILY"] = "daily";
1519
+ FrequencyType2["WEEKDAY"] = "weekday";
1520
+ FrequencyType2["WEEKLY"] = "weekly";
1521
+ FrequencyType2["MONTHLY"] = "monthly";
1522
+ return FrequencyType2;
1523
+ })(FrequencyType || {});
1524
+ var EvalScheduleSchema = TenantEntitySchema.extend({
1525
+ /** Whether the schedule is active */
1526
+ enabled: import_zod31.z.boolean(),
1527
+ /** Test suite to run */
1528
+ suiteId: import_zod31.z.string(),
1529
+ /** Preset that provides agent + entities for this schedule */
1530
+ presetId: import_zod31.z.string(),
1531
+ /** How often to run */
1532
+ frequencyType: import_zod31.z.nativeEnum(FrequencyType),
1533
+ /** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
1534
+ timeOfDay: import_zod31.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
1535
+ /** Day of week (0=Sun, 6=Sat) for weekly schedules */
1536
+ dayOfWeek: import_zod31.z.number().min(0).max(6).optional(),
1537
+ /** Day of month (1-31) for monthly schedules */
1538
+ dayOfMonth: import_zod31.z.number().min(1).max(31).optional(),
1539
+ /** IANA timezone (e.g., 'America/New_York') */
1540
+ timezone: import_zod31.z.string(),
1541
+ /** ID of the last eval run created by this schedule */
1542
+ lastRunId: import_zod31.z.string().optional(),
1543
+ /** Denormalized status of the last run */
1544
+ lastRunStatus: import_zod31.z.string().optional(),
1545
+ /** ISO timestamp of the last run */
1546
+ lastRunAt: import_zod31.z.string().optional(),
1547
+ /** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
1548
+ nextRunAt: import_zod31.z.string().optional()
1549
+ });
1550
+ function isValidTimezone(tz) {
1551
+ try {
1552
+ Intl.DateTimeFormat(void 0, { timeZone: tz });
1553
+ return true;
1554
+ } catch {
1555
+ return false;
1556
+ }
1557
+ }
1558
+ function validateScheduleFields(data, ctx, options) {
1559
+ if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
1560
+ ctx.addIssue({
1561
+ code: import_zod31.z.ZodIssueCode.custom,
1562
+ message: "dayOfWeek is required for weekly schedules",
1563
+ path: ["dayOfWeek"]
1564
+ });
1565
+ }
1566
+ if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
1567
+ ctx.addIssue({
1568
+ code: import_zod31.z.ZodIssueCode.custom,
1569
+ message: "dayOfMonth is required for monthly schedules",
1570
+ path: ["dayOfMonth"]
1571
+ });
1572
+ }
1573
+ const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
1574
+ if (shouldValidateTz && !isValidTimezone(data.timezone)) {
1575
+ ctx.addIssue({
1576
+ code: import_zod31.z.ZodIssueCode.custom,
1577
+ message: "Invalid IANA timezone",
1578
+ path: ["timezone"]
1579
+ });
1580
+ }
1581
+ }
1582
+ var BaseCreateScheduleSchema = EvalScheduleSchema.omit({
1583
+ id: true,
1584
+ projectId: true,
1585
+ deleted: true,
1586
+ createdAt: true,
1587
+ updatedAt: true,
1588
+ lastRunId: true,
1589
+ lastRunStatus: true,
1590
+ lastRunAt: true,
1591
+ nextRunAt: true
1592
+ });
1593
+ var CreateEvalScheduleInputSchema = BaseCreateScheduleSchema.superRefine((data, ctx) => {
1594
+ validateScheduleFields(data, ctx, { partial: false });
1595
+ });
1596
+ var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {
1597
+ validateScheduleFields(data, ctx, { partial: true });
1598
+ });
1599
+
1505
1600
  // src/assertion/system-assertions.ts
1506
1601
  var SYSTEM_ASSERTION_IDS = {
1507
1602
  SKILL_WAS_CALLED: "system:skill_was_called",
@@ -1701,6 +1796,7 @@ function getSystemAssertion(id) {
1701
1796
  CreateAgentInputSchema,
1702
1797
  CreateCustomAssertionInputSchema,
1703
1798
  CreateEvalRunInputSchema,
1799
+ CreateEvalScheduleInputSchema,
1704
1800
  CreateMcpInputSchema,
1705
1801
  CreatePresetInputSchema,
1706
1802
  CreateProjectInputSchema,
@@ -1721,6 +1817,7 @@ function getSystemAssertion(id) {
1721
1817
  EvalMetricsSchema,
1722
1818
  EvalRunResultSchema,
1723
1819
  EvalRunSchema,
1820
+ EvalScheduleSchema,
1724
1821
  EvalStatus,
1725
1822
  EvalStatusSchema,
1726
1823
  EvaluationLogSchema,
@@ -1735,6 +1832,7 @@ function getSystemAssertion(id) {
1735
1832
  FileContentTestSchema,
1736
1833
  FileModificationSchema,
1737
1834
  FilePresenceTestSchema,
1835
+ FrequencyType,
1738
1836
  GitHubSourceSchema,
1739
1837
  InitialVersionInputSchema,
1740
1838
  LEGACY_MODEL_ID_MAP,
@@ -1810,6 +1908,7 @@ function getSystemAssertion(id) {
1810
1908
  TriggerType,
1811
1909
  UpdateAgentInputSchema,
1812
1910
  UpdateCustomAssertionInputSchema,
1911
+ UpdateEvalScheduleInputSchema,
1813
1912
  UpdateMcpInputSchema,
1814
1913
  UpdatePresetInputSchema,
1815
1914
  UpdateProjectInputSchema,