@wix/evalforge-types 0.55.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 +1 -0
- package/build/index.js +100 -3
- package/build/index.js.map +4 -4
- package/build/index.mjs +96 -3
- package/build/index.mjs.map +4 -4
- package/build/types/evaluation/eval-run.d.ts +6 -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/build/types/target/agent.d.ts +2 -1
- package/package.json +2 -2
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,
|
|
@@ -380,11 +384,13 @@ var AGENT_TYPE_LABELS = {
|
|
|
380
384
|
};
|
|
381
385
|
var AgentRunCommand = /* @__PURE__ */ ((AgentRunCommand2) => {
|
|
382
386
|
AgentRunCommand2["CLAUDE"] = "claude";
|
|
387
|
+
AgentRunCommand2["OPENCODE"] = "opencode";
|
|
383
388
|
return AgentRunCommand2;
|
|
384
389
|
})(AgentRunCommand || {});
|
|
385
390
|
var AVAILABLE_RUN_COMMANDS = Object.values(AgentRunCommand);
|
|
386
391
|
var RUN_COMMAND_LABELS = {
|
|
387
|
-
["claude" /* CLAUDE */]: "Claude Code"
|
|
392
|
+
["claude" /* CLAUDE */]: "Claude Code",
|
|
393
|
+
["opencode" /* OPENCODE */]: "OpenCode"
|
|
388
394
|
};
|
|
389
395
|
var AgentRunCommandSchema = import_zod6.z.nativeEnum(AgentRunCommand);
|
|
390
396
|
var AgentSchema = TargetSchema.extend({
|
|
@@ -1147,16 +1153,18 @@ var TriggerType = /* @__PURE__ */ ((TriggerType2) => {
|
|
|
1147
1153
|
TriggerType2["MCP_VERSION_RELEASE"] = "MCP_VERSION_RELEASE";
|
|
1148
1154
|
TriggerType2["MCP_PREVIEW_CREATED"] = "MCP_PREVIEW_CREATED";
|
|
1149
1155
|
TriggerType2["MANUAL"] = "MANUAL";
|
|
1156
|
+
TriggerType2["SCHEDULED"] = "SCHEDULED";
|
|
1150
1157
|
return TriggerType2;
|
|
1151
1158
|
})(TriggerType || {});
|
|
1152
1159
|
var TriggerMetadataSchema = import_zod27.z.object({
|
|
1153
1160
|
version: import_zod27.z.string().optional(),
|
|
1154
|
-
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()
|
|
1155
1163
|
});
|
|
1156
1164
|
var TriggerSchema = import_zod27.z.object({
|
|
1157
1165
|
id: import_zod27.z.string(),
|
|
1158
1166
|
metadata: TriggerMetadataSchema.optional(),
|
|
1159
|
-
type: import_zod27.z.
|
|
1167
|
+
type: import_zod27.z.nativeEnum(TriggerType)
|
|
1160
1168
|
});
|
|
1161
1169
|
var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
|
|
1162
1170
|
FailureCategory2["MISSING_FILE"] = "missing_file";
|
|
@@ -1500,6 +1508,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
|
1500
1508
|
});
|
|
1501
1509
|
var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
|
|
1502
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
|
+
|
|
1503
1596
|
// src/assertion/system-assertions.ts
|
|
1504
1597
|
var SYSTEM_ASSERTION_IDS = {
|
|
1505
1598
|
SKILL_WAS_CALLED: "system:skill_was_called",
|
|
@@ -1699,6 +1792,7 @@ function getSystemAssertion(id) {
|
|
|
1699
1792
|
CreateAgentInputSchema,
|
|
1700
1793
|
CreateCustomAssertionInputSchema,
|
|
1701
1794
|
CreateEvalRunInputSchema,
|
|
1795
|
+
CreateEvalScheduleInputSchema,
|
|
1702
1796
|
CreateMcpInputSchema,
|
|
1703
1797
|
CreatePresetInputSchema,
|
|
1704
1798
|
CreateProjectInputSchema,
|
|
@@ -1719,6 +1813,7 @@ function getSystemAssertion(id) {
|
|
|
1719
1813
|
EvalMetricsSchema,
|
|
1720
1814
|
EvalRunResultSchema,
|
|
1721
1815
|
EvalRunSchema,
|
|
1816
|
+
EvalScheduleSchema,
|
|
1722
1817
|
EvalStatus,
|
|
1723
1818
|
EvalStatusSchema,
|
|
1724
1819
|
EvaluationLogSchema,
|
|
@@ -1733,6 +1828,7 @@ function getSystemAssertion(id) {
|
|
|
1733
1828
|
FileContentTestSchema,
|
|
1734
1829
|
FileModificationSchema,
|
|
1735
1830
|
FilePresenceTestSchema,
|
|
1831
|
+
FrequencyType,
|
|
1736
1832
|
GitHubSourceSchema,
|
|
1737
1833
|
InitialVersionInputSchema,
|
|
1738
1834
|
LEGACY_MODEL_ID_MAP,
|
|
@@ -1808,6 +1904,7 @@ function getSystemAssertion(id) {
|
|
|
1808
1904
|
TriggerType,
|
|
1809
1905
|
UpdateAgentInputSchema,
|
|
1810
1906
|
UpdateCustomAssertionInputSchema,
|
|
1907
|
+
UpdateEvalScheduleInputSchema,
|
|
1811
1908
|
UpdateMcpInputSchema,
|
|
1812
1909
|
UpdatePresetInputSchema,
|
|
1813
1910
|
UpdateProjectInputSchema,
|