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