@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/build/index.mjs
CHANGED
|
@@ -184,11 +184,13 @@ var AGENT_TYPE_LABELS = {
|
|
|
184
184
|
};
|
|
185
185
|
var AgentRunCommand = /* @__PURE__ */ ((AgentRunCommand2) => {
|
|
186
186
|
AgentRunCommand2["CLAUDE"] = "claude";
|
|
187
|
+
AgentRunCommand2["OPENCODE"] = "opencode";
|
|
187
188
|
return AgentRunCommand2;
|
|
188
189
|
})(AgentRunCommand || {});
|
|
189
190
|
var AVAILABLE_RUN_COMMANDS = Object.values(AgentRunCommand);
|
|
190
191
|
var RUN_COMMAND_LABELS = {
|
|
191
|
-
["claude" /* CLAUDE */]: "Claude Code"
|
|
192
|
+
["claude" /* CLAUDE */]: "Claude Code",
|
|
193
|
+
["opencode" /* OPENCODE */]: "OpenCode"
|
|
192
194
|
};
|
|
193
195
|
var AgentRunCommandSchema = z6.nativeEnum(AgentRunCommand);
|
|
194
196
|
var AgentSchema = TargetSchema.extend({
|
|
@@ -951,16 +953,18 @@ var TriggerType = /* @__PURE__ */ ((TriggerType2) => {
|
|
|
951
953
|
TriggerType2["MCP_VERSION_RELEASE"] = "MCP_VERSION_RELEASE";
|
|
952
954
|
TriggerType2["MCP_PREVIEW_CREATED"] = "MCP_PREVIEW_CREATED";
|
|
953
955
|
TriggerType2["MANUAL"] = "MANUAL";
|
|
956
|
+
TriggerType2["SCHEDULED"] = "SCHEDULED";
|
|
954
957
|
return TriggerType2;
|
|
955
958
|
})(TriggerType || {});
|
|
956
959
|
var TriggerMetadataSchema = z27.object({
|
|
957
960
|
version: z27.string().optional(),
|
|
958
|
-
resourceUpdated: z27.array(z27.string()).optional()
|
|
961
|
+
resourceUpdated: z27.array(z27.string()).optional(),
|
|
962
|
+
scheduleId: z27.string().optional()
|
|
959
963
|
});
|
|
960
964
|
var TriggerSchema = z27.object({
|
|
961
965
|
id: z27.string(),
|
|
962
966
|
metadata: TriggerMetadataSchema.optional(),
|
|
963
|
-
type: z27.
|
|
967
|
+
type: z27.nativeEnum(TriggerType)
|
|
964
968
|
});
|
|
965
969
|
var FailureCategory = /* @__PURE__ */ ((FailureCategory2) => {
|
|
966
970
|
FailureCategory2["MISSING_FILE"] = "missing_file";
|
|
@@ -1304,6 +1308,91 @@ var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
|
1304
1308
|
});
|
|
1305
1309
|
var UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();
|
|
1306
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
|
+
|
|
1307
1396
|
// src/assertion/system-assertions.ts
|
|
1308
1397
|
var SYSTEM_ASSERTION_IDS = {
|
|
1309
1398
|
SKILL_WAS_CALLED: "system:skill_was_called",
|
|
@@ -1502,6 +1591,7 @@ export {
|
|
|
1502
1591
|
CreateAgentInputSchema,
|
|
1503
1592
|
CreateCustomAssertionInputSchema,
|
|
1504
1593
|
CreateEvalRunInputSchema,
|
|
1594
|
+
CreateEvalScheduleInputSchema,
|
|
1505
1595
|
CreateMcpInputSchema,
|
|
1506
1596
|
CreatePresetInputSchema,
|
|
1507
1597
|
CreateProjectInputSchema,
|
|
@@ -1522,6 +1612,7 @@ export {
|
|
|
1522
1612
|
EvalMetricsSchema,
|
|
1523
1613
|
EvalRunResultSchema,
|
|
1524
1614
|
EvalRunSchema,
|
|
1615
|
+
EvalScheduleSchema,
|
|
1525
1616
|
EvalStatus,
|
|
1526
1617
|
EvalStatusSchema,
|
|
1527
1618
|
EvaluationLogSchema,
|
|
@@ -1536,6 +1627,7 @@ export {
|
|
|
1536
1627
|
FileContentTestSchema,
|
|
1537
1628
|
FileModificationSchema,
|
|
1538
1629
|
FilePresenceTestSchema,
|
|
1630
|
+
FrequencyType,
|
|
1539
1631
|
GitHubSourceSchema,
|
|
1540
1632
|
InitialVersionInputSchema,
|
|
1541
1633
|
LEGACY_MODEL_ID_MAP,
|
|
@@ -1611,6 +1703,7 @@ export {
|
|
|
1611
1703
|
TriggerType,
|
|
1612
1704
|
UpdateAgentInputSchema,
|
|
1613
1705
|
UpdateCustomAssertionInputSchema,
|
|
1706
|
+
UpdateEvalScheduleInputSchema,
|
|
1614
1707
|
UpdateMcpInputSchema,
|
|
1615
1708
|
UpdatePresetInputSchema,
|
|
1616
1709
|
UpdateProjectInputSchema,
|