@wix/evalforge-types 0.86.0 → 0.88.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.js +78 -46
- package/build/index.js.map +3 -3
- package/build/index.mjs +76 -46
- package/build/index.mjs.map +3 -3
- package/build/types/template/template.d.ts +58 -14
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -117,6 +117,7 @@ __export(index_exports, {
|
|
|
117
117
|
EvaluationResultSchema: () => EvaluationResultSchema,
|
|
118
118
|
ExecutionTraceSchema: () => ExecutionTraceSchema,
|
|
119
119
|
ExpectedFileSchema: () => ExpectedFileSchema,
|
|
120
|
+
ExtraFileSchema: () => ExtraFileSchema,
|
|
120
121
|
FileContentCheckSchema: () => FileContentCheckSchema,
|
|
121
122
|
FileContentTestSchema: () => FileContentTestSchema,
|
|
122
123
|
FileModificationSchema: () => FileModificationSchema,
|
|
@@ -180,6 +181,7 @@ __export(index_exports, {
|
|
|
180
181
|
SkillWasCalledAssertionSchema: () => SkillWasCalledAssertionSchema,
|
|
181
182
|
SkillWasCalledConfigSchema: () => SkillWasCalledConfigSchema,
|
|
182
183
|
SkillWithLatestVersionSchema: () => SkillWithLatestVersionSchema,
|
|
184
|
+
SourceFileSchema: () => SourceFileSchema,
|
|
183
185
|
SubAgentSchema: () => SubAgentSchema,
|
|
184
186
|
TRACE_EVENT_PREFIX: () => TRACE_EVENT_PREFIX,
|
|
185
187
|
TargetSchema: () => TargetSchema,
|
|
@@ -392,7 +394,13 @@ function normalizeModelId(modelId) {
|
|
|
392
394
|
var nullToUndefined = (val) => val === null ? void 0 : val;
|
|
393
395
|
var ModelConfigSchema = import_zod4.z.object({
|
|
394
396
|
model: AnyModelSchema,
|
|
395
|
-
|
|
397
|
+
// In Zod v4, z.preprocess() creates ZodEffects which is not recognized as optional
|
|
398
|
+
// by the object schema. Outer .optional() ensures missing keys are accepted; inner
|
|
399
|
+
// .optional() handles null→undefined conversion from the preprocessor.
|
|
400
|
+
temperature: import_zod4.z.preprocess(
|
|
401
|
+
nullToUndefined,
|
|
402
|
+
import_zod4.z.number().min(0).max(1).optional()
|
|
403
|
+
).optional(),
|
|
396
404
|
maxTokens: import_zod4.z.preprocess(nullToUndefined, import_zod4.z.number().min(1).optional()).optional(),
|
|
397
405
|
/** Number of agentic turns. 0 = unlimited (agent runs until done or timeout). */
|
|
398
406
|
maxTurns: import_zod4.z.preprocess(nullToUndefined, import_zod4.z.number().int().min(0).optional()).optional()
|
|
@@ -2187,79 +2195,101 @@ var CreateProjectInputSchema = ProjectSchema.omit({
|
|
|
2187
2195
|
var UpdateProjectInputSchema = CreateProjectInputSchema.partial();
|
|
2188
2196
|
|
|
2189
2197
|
// src/template/template.ts
|
|
2198
|
+
var import_zod35 = require("zod");
|
|
2199
|
+
var SourceFileSchema = import_zod35.z.object({
|
|
2200
|
+
path: import_zod35.z.string().min(1),
|
|
2201
|
+
content: import_zod35.z.string()
|
|
2202
|
+
});
|
|
2203
|
+
var ExtraFileSchema = import_zod35.z.object({
|
|
2204
|
+
path: import_zod35.z.string().min(1),
|
|
2205
|
+
content: import_zod35.z.string().optional(),
|
|
2206
|
+
gitSource: GitHubSourceSchema.optional()
|
|
2207
|
+
}).refine((ef) => ef.content !== void 0 || ef.gitSource !== void 0, {
|
|
2208
|
+
message: "ExtraFile must have either content or gitSource"
|
|
2209
|
+
});
|
|
2190
2210
|
var TemplateSchema = TenantEntitySchema.extend({
|
|
2191
|
-
|
|
2192
|
-
|
|
2211
|
+
source: GitHubSourceSchema.optional(),
|
|
2212
|
+
sourceFiles: import_zod35.z.array(SourceFileSchema).optional(),
|
|
2213
|
+
extraFiles: import_zod35.z.array(ExtraFileSchema).optional()
|
|
2193
2214
|
});
|
|
2215
|
+
var singleSourceKind = (t) => !(t.source && t.sourceFiles?.length);
|
|
2216
|
+
var singleSourceKindError = {
|
|
2217
|
+
message: "Set source or sourceFiles, not both"
|
|
2218
|
+
};
|
|
2194
2219
|
var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
2195
2220
|
id: true,
|
|
2196
2221
|
createdAt: true,
|
|
2197
2222
|
updatedAt: true,
|
|
2198
2223
|
deleted: true
|
|
2199
|
-
});
|
|
2200
|
-
var UpdateTemplateInputSchema =
|
|
2224
|
+
}).refine(singleSourceKind, singleSourceKindError);
|
|
2225
|
+
var UpdateTemplateInputSchema = TemplateSchema.omit({
|
|
2226
|
+
id: true,
|
|
2227
|
+
createdAt: true,
|
|
2228
|
+
updatedAt: true,
|
|
2229
|
+
deleted: true
|
|
2230
|
+
}).partial().refine(singleSourceKind, singleSourceKindError);
|
|
2201
2231
|
|
|
2202
2232
|
// src/agent/agent-config.ts
|
|
2203
|
-
var
|
|
2204
|
-
var BaseAgentConfigSchema =
|
|
2233
|
+
var import_zod36 = require("zod");
|
|
2234
|
+
var BaseAgentConfigSchema = import_zod36.z.object({
|
|
2205
2235
|
/** Model ID (Claude or OpenAI). */
|
|
2206
2236
|
model: AnyModelSchema.optional(),
|
|
2207
2237
|
/** Sampling temperature (0–1). */
|
|
2208
|
-
temperature:
|
|
2238
|
+
temperature: import_zod36.z.number().min(0).max(1).optional(),
|
|
2209
2239
|
/** Max output tokens per turn. */
|
|
2210
|
-
maxTokens:
|
|
2240
|
+
maxTokens: import_zod36.z.number().int().min(1).optional(),
|
|
2211
2241
|
/** Number of agentic turns. 0 = unlimited. */
|
|
2212
|
-
maxTurns:
|
|
2242
|
+
maxTurns: import_zod36.z.number().int().min(0).optional(),
|
|
2213
2243
|
/** Execution timeout in milliseconds. Overrides the default maxTurns-based calculation. */
|
|
2214
|
-
maxDurationMs:
|
|
2244
|
+
maxDurationMs: import_zod36.z.number().int().min(0).optional()
|
|
2215
2245
|
});
|
|
2216
|
-
var EffortLevelSchema =
|
|
2246
|
+
var EffortLevelSchema = import_zod36.z.enum(["low", "medium", "high", "max"]);
|
|
2217
2247
|
var ClaudeCodeConfigSchema = BaseAgentConfigSchema.extend({
|
|
2218
2248
|
/** Extended thinking token budget. */
|
|
2219
|
-
maxThinkingTokens:
|
|
2249
|
+
maxThinkingTokens: import_zod36.z.number().int().min(0).optional(),
|
|
2220
2250
|
/** Override the default allowedTools list passed to the SDK. */
|
|
2221
|
-
allowedTools:
|
|
2251
|
+
allowedTools: import_zod36.z.array(import_zod36.z.string()).optional(),
|
|
2222
2252
|
/** Tools to remove from the model's context entirely. */
|
|
2223
|
-
disallowedTools:
|
|
2253
|
+
disallowedTools: import_zod36.z.array(import_zod36.z.string()).optional(),
|
|
2224
2254
|
/** Controls thinking depth: low, medium, high, max. */
|
|
2225
2255
|
effort: EffortLevelSchema.optional(),
|
|
2226
2256
|
/** Maximum USD spend per run. Stops execution when reached. */
|
|
2227
|
-
maxBudgetUsd:
|
|
2257
|
+
maxBudgetUsd: import_zod36.z.number().min(0).optional()
|
|
2228
2258
|
});
|
|
2229
|
-
var PermissionValueSchema =
|
|
2230
|
-
var OpenCodePermissionSchema =
|
|
2231
|
-
|
|
2232
|
-
|
|
2259
|
+
var PermissionValueSchema = import_zod36.z.enum(["allow", "deny"]);
|
|
2260
|
+
var OpenCodePermissionSchema = import_zod36.z.record(
|
|
2261
|
+
import_zod36.z.string(),
|
|
2262
|
+
import_zod36.z.union([PermissionValueSchema, import_zod36.z.record(import_zod36.z.string(), PermissionValueSchema)])
|
|
2233
2263
|
);
|
|
2234
|
-
var ThinkingVariantSchema =
|
|
2264
|
+
var ThinkingVariantSchema = import_zod36.z.enum(["high", "low", "none"]);
|
|
2235
2265
|
var OpenCodeConfigSchema = BaseAgentConfigSchema.extend({
|
|
2236
2266
|
/** Permission overrides (defaults: allow-all). */
|
|
2237
2267
|
permission: OpenCodePermissionSchema.optional(),
|
|
2238
2268
|
/** Maps to `--variant` CLI flag. 'none' omits --thinking entirely. Default: 'high'. */
|
|
2239
2269
|
thinkingVariant: ThinkingVariantSchema.optional(),
|
|
2240
2270
|
/** Nucleus sampling (0–1). Alternative to temperature. */
|
|
2241
|
-
topP:
|
|
2271
|
+
topP: import_zod36.z.number().min(0).max(1).optional()
|
|
2242
2272
|
}).omit({ maxTokens: true });
|
|
2243
|
-
var ReasoningEffortSchema =
|
|
2273
|
+
var ReasoningEffortSchema = import_zod36.z.enum(["low", "medium", "high"]);
|
|
2244
2274
|
var SimpleAgentConfigSchema = BaseAgentConfigSchema.extend({
|
|
2245
2275
|
/** Anthropic thinking budget in tokens. Default: 10 000. */
|
|
2246
|
-
thinkingBudgetTokens:
|
|
2276
|
+
thinkingBudgetTokens: import_zod36.z.number().int().min(0).optional(),
|
|
2247
2277
|
/** Nucleus sampling (0–1). Alternative to temperature. */
|
|
2248
|
-
topP:
|
|
2278
|
+
topP: import_zod36.z.number().min(0).max(1).optional(),
|
|
2249
2279
|
/** Integer seed for deterministic/reproducible results (if model supports it). */
|
|
2250
|
-
seed:
|
|
2280
|
+
seed: import_zod36.z.number().int().optional(),
|
|
2251
2281
|
/** Stop sequences — model stops when generating any of these strings. */
|
|
2252
|
-
stopSequences:
|
|
2282
|
+
stopSequences: import_zod36.z.array(import_zod36.z.string()).optional(),
|
|
2253
2283
|
/** OpenAI reasoning effort level. Default: 'high'. */
|
|
2254
2284
|
reasoningEffort: ReasoningEffortSchema.optional(),
|
|
2255
2285
|
/** Frequency penalty (−2 to 2). Reduces repetition of same tokens. */
|
|
2256
|
-
frequencyPenalty:
|
|
2286
|
+
frequencyPenalty: import_zod36.z.number().min(-2).max(2).optional(),
|
|
2257
2287
|
/** Presence penalty (−2 to 2). Encourages topic diversity. */
|
|
2258
|
-
presencePenalty:
|
|
2288
|
+
presencePenalty: import_zod36.z.number().min(-2).max(2).optional()
|
|
2259
2289
|
});
|
|
2260
2290
|
|
|
2261
2291
|
// src/schedule/eval-schedule.ts
|
|
2262
|
-
var
|
|
2292
|
+
var import_zod37 = require("zod");
|
|
2263
2293
|
var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
|
|
2264
2294
|
FrequencyType2["DAILY"] = "daily";
|
|
2265
2295
|
FrequencyType2["WEEKDAY"] = "weekday";
|
|
@@ -2269,31 +2299,31 @@ var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
|
|
|
2269
2299
|
})(FrequencyType || {});
|
|
2270
2300
|
var EvalScheduleSchema = TenantEntitySchema.extend({
|
|
2271
2301
|
/** Whether the schedule is active */
|
|
2272
|
-
enabled:
|
|
2302
|
+
enabled: import_zod37.z.boolean(),
|
|
2273
2303
|
/** Test suite to run */
|
|
2274
|
-
suiteId:
|
|
2304
|
+
suiteId: import_zod37.z.string(),
|
|
2275
2305
|
/** Preset that provides agent + entities for this schedule */
|
|
2276
|
-
presetId:
|
|
2306
|
+
presetId: import_zod37.z.string(),
|
|
2277
2307
|
/** How often to run */
|
|
2278
|
-
frequencyType:
|
|
2308
|
+
frequencyType: import_zod37.z.nativeEnum(FrequencyType),
|
|
2279
2309
|
/** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
|
|
2280
|
-
timeOfDay:
|
|
2310
|
+
timeOfDay: import_zod37.z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
|
|
2281
2311
|
/** Day of week (0=Sun, 6=Sat) for weekly schedules */
|
|
2282
|
-
dayOfWeek:
|
|
2312
|
+
dayOfWeek: import_zod37.z.number().min(0).max(6).optional(),
|
|
2283
2313
|
/** Day of month (1-31) for monthly schedules */
|
|
2284
|
-
dayOfMonth:
|
|
2314
|
+
dayOfMonth: import_zod37.z.number().min(1).max(31).optional(),
|
|
2285
2315
|
/** IANA timezone (e.g., 'America/New_York') */
|
|
2286
|
-
timezone:
|
|
2316
|
+
timezone: import_zod37.z.string(),
|
|
2287
2317
|
/** ID of the last eval run created by this schedule */
|
|
2288
|
-
lastRunId:
|
|
2318
|
+
lastRunId: import_zod37.z.string().optional(),
|
|
2289
2319
|
/** Denormalized status of the last run */
|
|
2290
|
-
lastRunStatus:
|
|
2320
|
+
lastRunStatus: import_zod37.z.string().optional(),
|
|
2291
2321
|
/** ISO timestamp of the last run */
|
|
2292
|
-
lastRunAt:
|
|
2322
|
+
lastRunAt: import_zod37.z.string().optional(),
|
|
2293
2323
|
/** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
|
|
2294
|
-
nextRunAt:
|
|
2324
|
+
nextRunAt: import_zod37.z.string().optional(),
|
|
2295
2325
|
/** Per-scenario variable values forwarded to runs triggered by this schedule (scenarioId → varName → value) */
|
|
2296
|
-
variables:
|
|
2326
|
+
variables: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string())).optional()
|
|
2297
2327
|
});
|
|
2298
2328
|
function isValidTimezone(tz) {
|
|
2299
2329
|
try {
|
|
@@ -2306,14 +2336,14 @@ function isValidTimezone(tz) {
|
|
|
2306
2336
|
function validateScheduleFields(data, ctx, options) {
|
|
2307
2337
|
if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
|
|
2308
2338
|
ctx.addIssue({
|
|
2309
|
-
code:
|
|
2339
|
+
code: import_zod37.z.ZodIssueCode.custom,
|
|
2310
2340
|
message: "dayOfWeek is required for weekly schedules",
|
|
2311
2341
|
path: ["dayOfWeek"]
|
|
2312
2342
|
});
|
|
2313
2343
|
}
|
|
2314
2344
|
if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
|
|
2315
2345
|
ctx.addIssue({
|
|
2316
|
-
code:
|
|
2346
|
+
code: import_zod37.z.ZodIssueCode.custom,
|
|
2317
2347
|
message: "dayOfMonth is required for monthly schedules",
|
|
2318
2348
|
path: ["dayOfMonth"]
|
|
2319
2349
|
});
|
|
@@ -2321,7 +2351,7 @@ function validateScheduleFields(data, ctx, options) {
|
|
|
2321
2351
|
const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
|
|
2322
2352
|
if (shouldValidateTz && !isValidTimezone(data.timezone)) {
|
|
2323
2353
|
ctx.addIssue({
|
|
2324
|
-
code:
|
|
2354
|
+
code: import_zod37.z.ZodIssueCode.custom,
|
|
2325
2355
|
message: "Invalid IANA timezone",
|
|
2326
2356
|
path: ["timezone"]
|
|
2327
2357
|
});
|
|
@@ -2443,6 +2473,7 @@ var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefi
|
|
|
2443
2473
|
EvaluationResultSchema,
|
|
2444
2474
|
ExecutionTraceSchema,
|
|
2445
2475
|
ExpectedFileSchema,
|
|
2476
|
+
ExtraFileSchema,
|
|
2446
2477
|
FileContentCheckSchema,
|
|
2447
2478
|
FileContentTestSchema,
|
|
2448
2479
|
FileModificationSchema,
|
|
@@ -2506,6 +2537,7 @@ var UpdateEvalScheduleInputSchema = BaseCreateScheduleSchema.partial().superRefi
|
|
|
2506
2537
|
SkillWasCalledAssertionSchema,
|
|
2507
2538
|
SkillWasCalledConfigSchema,
|
|
2508
2539
|
SkillWithLatestVersionSchema,
|
|
2540
|
+
SourceFileSchema,
|
|
2509
2541
|
SubAgentSchema,
|
|
2510
2542
|
TRACE_EVENT_PREFIX,
|
|
2511
2543
|
TargetSchema,
|