@wix/evalforge-types 0.85.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 +74 -51
- package/build/index.js.map +3 -3
- package/build/index.mjs +72 -51
- package/build/index.mjs.map +3 -3
- package/build/types/common/models.d.ts +3 -3
- package/build/types/evaluation/eval-result.d.ts +3 -3
- package/build/types/evaluation/eval-run.d.ts +6 -6
- package/build/types/target/agent.d.ts +9 -9
- package/build/types/template/template.d.ts +58 -14
- package/package.json +2 -2
package/build/index.mjs
CHANGED
|
@@ -143,13 +143,10 @@ function normalizeModelId(modelId) {
|
|
|
143
143
|
var nullToUndefined = (val) => val === null ? void 0 : val;
|
|
144
144
|
var ModelConfigSchema = z4.object({
|
|
145
145
|
model: AnyModelSchema,
|
|
146
|
-
temperature: z4.preprocess(
|
|
147
|
-
|
|
148
|
-
z4.number().min(0).max(1).optional()
|
|
149
|
-
),
|
|
150
|
-
maxTokens: z4.preprocess(nullToUndefined, z4.number().min(1).optional()),
|
|
146
|
+
temperature: z4.preprocess(nullToUndefined, z4.number().min(0).max(1).optional()).optional(),
|
|
147
|
+
maxTokens: z4.preprocess(nullToUndefined, z4.number().min(1).optional()).optional(),
|
|
151
148
|
/** Number of agentic turns. 0 = unlimited (agent runs until done or timeout). */
|
|
152
|
-
maxTurns: z4.preprocess(nullToUndefined, z4.number().int().min(0).optional())
|
|
149
|
+
maxTurns: z4.preprocess(nullToUndefined, z4.number().int().min(0).optional()).optional()
|
|
153
150
|
});
|
|
154
151
|
|
|
155
152
|
// src/common/rule.ts
|
|
@@ -1941,79 +1938,101 @@ var CreateProjectInputSchema = ProjectSchema.omit({
|
|
|
1941
1938
|
var UpdateProjectInputSchema = CreateProjectInputSchema.partial();
|
|
1942
1939
|
|
|
1943
1940
|
// src/template/template.ts
|
|
1941
|
+
import { z as z35 } from "zod";
|
|
1942
|
+
var SourceFileSchema = z35.object({
|
|
1943
|
+
path: z35.string().min(1),
|
|
1944
|
+
content: z35.string()
|
|
1945
|
+
});
|
|
1946
|
+
var ExtraFileSchema = z35.object({
|
|
1947
|
+
path: z35.string().min(1),
|
|
1948
|
+
content: z35.string().optional(),
|
|
1949
|
+
gitSource: GitHubSourceSchema.optional()
|
|
1950
|
+
}).refine((ef) => ef.content !== void 0 || ef.gitSource !== void 0, {
|
|
1951
|
+
message: "ExtraFile must have either content or gitSource"
|
|
1952
|
+
});
|
|
1944
1953
|
var TemplateSchema = TenantEntitySchema.extend({
|
|
1945
|
-
|
|
1946
|
-
|
|
1954
|
+
source: GitHubSourceSchema.optional(),
|
|
1955
|
+
sourceFiles: z35.array(SourceFileSchema).optional(),
|
|
1956
|
+
extraFiles: z35.array(ExtraFileSchema).optional()
|
|
1947
1957
|
});
|
|
1958
|
+
var singleSourceKind = (t) => !(t.source && t.sourceFiles?.length);
|
|
1959
|
+
var singleSourceKindError = {
|
|
1960
|
+
message: "Set source or sourceFiles, not both"
|
|
1961
|
+
};
|
|
1948
1962
|
var CreateTemplateInputSchema = TemplateSchema.omit({
|
|
1949
1963
|
id: true,
|
|
1950
1964
|
createdAt: true,
|
|
1951
1965
|
updatedAt: true,
|
|
1952
1966
|
deleted: true
|
|
1953
|
-
});
|
|
1954
|
-
var UpdateTemplateInputSchema =
|
|
1967
|
+
}).refine(singleSourceKind, singleSourceKindError);
|
|
1968
|
+
var UpdateTemplateInputSchema = TemplateSchema.omit({
|
|
1969
|
+
id: true,
|
|
1970
|
+
createdAt: true,
|
|
1971
|
+
updatedAt: true,
|
|
1972
|
+
deleted: true
|
|
1973
|
+
}).partial().refine(singleSourceKind, singleSourceKindError);
|
|
1955
1974
|
|
|
1956
1975
|
// src/agent/agent-config.ts
|
|
1957
|
-
import { z as
|
|
1958
|
-
var BaseAgentConfigSchema =
|
|
1976
|
+
import { z as z36 } from "zod";
|
|
1977
|
+
var BaseAgentConfigSchema = z36.object({
|
|
1959
1978
|
/** Model ID (Claude or OpenAI). */
|
|
1960
1979
|
model: AnyModelSchema.optional(),
|
|
1961
1980
|
/** Sampling temperature (0–1). */
|
|
1962
|
-
temperature:
|
|
1981
|
+
temperature: z36.number().min(0).max(1).optional(),
|
|
1963
1982
|
/** Max output tokens per turn. */
|
|
1964
|
-
maxTokens:
|
|
1983
|
+
maxTokens: z36.number().int().min(1).optional(),
|
|
1965
1984
|
/** Number of agentic turns. 0 = unlimited. */
|
|
1966
|
-
maxTurns:
|
|
1985
|
+
maxTurns: z36.number().int().min(0).optional(),
|
|
1967
1986
|
/** Execution timeout in milliseconds. Overrides the default maxTurns-based calculation. */
|
|
1968
|
-
maxDurationMs:
|
|
1987
|
+
maxDurationMs: z36.number().int().min(0).optional()
|
|
1969
1988
|
});
|
|
1970
|
-
var EffortLevelSchema =
|
|
1989
|
+
var EffortLevelSchema = z36.enum(["low", "medium", "high", "max"]);
|
|
1971
1990
|
var ClaudeCodeConfigSchema = BaseAgentConfigSchema.extend({
|
|
1972
1991
|
/** Extended thinking token budget. */
|
|
1973
|
-
maxThinkingTokens:
|
|
1992
|
+
maxThinkingTokens: z36.number().int().min(0).optional(),
|
|
1974
1993
|
/** Override the default allowedTools list passed to the SDK. */
|
|
1975
|
-
allowedTools:
|
|
1994
|
+
allowedTools: z36.array(z36.string()).optional(),
|
|
1976
1995
|
/** Tools to remove from the model's context entirely. */
|
|
1977
|
-
disallowedTools:
|
|
1996
|
+
disallowedTools: z36.array(z36.string()).optional(),
|
|
1978
1997
|
/** Controls thinking depth: low, medium, high, max. */
|
|
1979
1998
|
effort: EffortLevelSchema.optional(),
|
|
1980
1999
|
/** Maximum USD spend per run. Stops execution when reached. */
|
|
1981
|
-
maxBudgetUsd:
|
|
2000
|
+
maxBudgetUsd: z36.number().min(0).optional()
|
|
1982
2001
|
});
|
|
1983
|
-
var PermissionValueSchema =
|
|
1984
|
-
var OpenCodePermissionSchema =
|
|
1985
|
-
|
|
1986
|
-
|
|
2002
|
+
var PermissionValueSchema = z36.enum(["allow", "deny"]);
|
|
2003
|
+
var OpenCodePermissionSchema = z36.record(
|
|
2004
|
+
z36.string(),
|
|
2005
|
+
z36.union([PermissionValueSchema, z36.record(z36.string(), PermissionValueSchema)])
|
|
1987
2006
|
);
|
|
1988
|
-
var ThinkingVariantSchema =
|
|
2007
|
+
var ThinkingVariantSchema = z36.enum(["high", "low", "none"]);
|
|
1989
2008
|
var OpenCodeConfigSchema = BaseAgentConfigSchema.extend({
|
|
1990
2009
|
/** Permission overrides (defaults: allow-all). */
|
|
1991
2010
|
permission: OpenCodePermissionSchema.optional(),
|
|
1992
2011
|
/** Maps to `--variant` CLI flag. 'none' omits --thinking entirely. Default: 'high'. */
|
|
1993
2012
|
thinkingVariant: ThinkingVariantSchema.optional(),
|
|
1994
2013
|
/** Nucleus sampling (0–1). Alternative to temperature. */
|
|
1995
|
-
topP:
|
|
2014
|
+
topP: z36.number().min(0).max(1).optional()
|
|
1996
2015
|
}).omit({ maxTokens: true });
|
|
1997
|
-
var ReasoningEffortSchema =
|
|
2016
|
+
var ReasoningEffortSchema = z36.enum(["low", "medium", "high"]);
|
|
1998
2017
|
var SimpleAgentConfigSchema = BaseAgentConfigSchema.extend({
|
|
1999
2018
|
/** Anthropic thinking budget in tokens. Default: 10 000. */
|
|
2000
|
-
thinkingBudgetTokens:
|
|
2019
|
+
thinkingBudgetTokens: z36.number().int().min(0).optional(),
|
|
2001
2020
|
/** Nucleus sampling (0–1). Alternative to temperature. */
|
|
2002
|
-
topP:
|
|
2021
|
+
topP: z36.number().min(0).max(1).optional(),
|
|
2003
2022
|
/** Integer seed for deterministic/reproducible results (if model supports it). */
|
|
2004
|
-
seed:
|
|
2023
|
+
seed: z36.number().int().optional(),
|
|
2005
2024
|
/** Stop sequences — model stops when generating any of these strings. */
|
|
2006
|
-
stopSequences:
|
|
2025
|
+
stopSequences: z36.array(z36.string()).optional(),
|
|
2007
2026
|
/** OpenAI reasoning effort level. Default: 'high'. */
|
|
2008
2027
|
reasoningEffort: ReasoningEffortSchema.optional(),
|
|
2009
2028
|
/** Frequency penalty (−2 to 2). Reduces repetition of same tokens. */
|
|
2010
|
-
frequencyPenalty:
|
|
2029
|
+
frequencyPenalty: z36.number().min(-2).max(2).optional(),
|
|
2011
2030
|
/** Presence penalty (−2 to 2). Encourages topic diversity. */
|
|
2012
|
-
presencePenalty:
|
|
2031
|
+
presencePenalty: z36.number().min(-2).max(2).optional()
|
|
2013
2032
|
});
|
|
2014
2033
|
|
|
2015
2034
|
// src/schedule/eval-schedule.ts
|
|
2016
|
-
import { z as
|
|
2035
|
+
import { z as z37 } from "zod";
|
|
2017
2036
|
var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
|
|
2018
2037
|
FrequencyType2["DAILY"] = "daily";
|
|
2019
2038
|
FrequencyType2["WEEKDAY"] = "weekday";
|
|
@@ -2023,31 +2042,31 @@ var FrequencyType = /* @__PURE__ */ ((FrequencyType2) => {
|
|
|
2023
2042
|
})(FrequencyType || {});
|
|
2024
2043
|
var EvalScheduleSchema = TenantEntitySchema.extend({
|
|
2025
2044
|
/** Whether the schedule is active */
|
|
2026
|
-
enabled:
|
|
2045
|
+
enabled: z37.boolean(),
|
|
2027
2046
|
/** Test suite to run */
|
|
2028
|
-
suiteId:
|
|
2047
|
+
suiteId: z37.string(),
|
|
2029
2048
|
/** Preset that provides agent + entities for this schedule */
|
|
2030
|
-
presetId:
|
|
2049
|
+
presetId: z37.string(),
|
|
2031
2050
|
/** How often to run */
|
|
2032
|
-
frequencyType:
|
|
2051
|
+
frequencyType: z37.nativeEnum(FrequencyType),
|
|
2033
2052
|
/** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */
|
|
2034
|
-
timeOfDay:
|
|
2053
|
+
timeOfDay: z37.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/),
|
|
2035
2054
|
/** Day of week (0=Sun, 6=Sat) for weekly schedules */
|
|
2036
|
-
dayOfWeek:
|
|
2055
|
+
dayOfWeek: z37.number().min(0).max(6).optional(),
|
|
2037
2056
|
/** Day of month (1-31) for monthly schedules */
|
|
2038
|
-
dayOfMonth:
|
|
2057
|
+
dayOfMonth: z37.number().min(1).max(31).optional(),
|
|
2039
2058
|
/** IANA timezone (e.g., 'America/New_York') */
|
|
2040
|
-
timezone:
|
|
2059
|
+
timezone: z37.string(),
|
|
2041
2060
|
/** ID of the last eval run created by this schedule */
|
|
2042
|
-
lastRunId:
|
|
2061
|
+
lastRunId: z37.string().optional(),
|
|
2043
2062
|
/** Denormalized status of the last run */
|
|
2044
|
-
lastRunStatus:
|
|
2063
|
+
lastRunStatus: z37.string().optional(),
|
|
2045
2064
|
/** ISO timestamp of the last run */
|
|
2046
|
-
lastRunAt:
|
|
2065
|
+
lastRunAt: z37.string().optional(),
|
|
2047
2066
|
/** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */
|
|
2048
|
-
nextRunAt:
|
|
2067
|
+
nextRunAt: z37.string().optional(),
|
|
2049
2068
|
/** Per-scenario variable values forwarded to runs triggered by this schedule (scenarioId → varName → value) */
|
|
2050
|
-
variables:
|
|
2069
|
+
variables: z37.record(z37.string(), z37.record(z37.string(), z37.string())).optional()
|
|
2051
2070
|
});
|
|
2052
2071
|
function isValidTimezone(tz) {
|
|
2053
2072
|
try {
|
|
@@ -2060,14 +2079,14 @@ function isValidTimezone(tz) {
|
|
|
2060
2079
|
function validateScheduleFields(data, ctx, options) {
|
|
2061
2080
|
if (data.frequencyType === "weekly" /* WEEKLY */ && data.dayOfWeek == null) {
|
|
2062
2081
|
ctx.addIssue({
|
|
2063
|
-
code:
|
|
2082
|
+
code: z37.ZodIssueCode.custom,
|
|
2064
2083
|
message: "dayOfWeek is required for weekly schedules",
|
|
2065
2084
|
path: ["dayOfWeek"]
|
|
2066
2085
|
});
|
|
2067
2086
|
}
|
|
2068
2087
|
if (data.frequencyType === "monthly" /* MONTHLY */ && data.dayOfMonth == null) {
|
|
2069
2088
|
ctx.addIssue({
|
|
2070
|
-
code:
|
|
2089
|
+
code: z37.ZodIssueCode.custom,
|
|
2071
2090
|
message: "dayOfMonth is required for monthly schedules",
|
|
2072
2091
|
path: ["dayOfMonth"]
|
|
2073
2092
|
});
|
|
@@ -2075,7 +2094,7 @@ function validateScheduleFields(data, ctx, options) {
|
|
|
2075
2094
|
const shouldValidateTz = options.partial ? data.timezone !== void 0 : true;
|
|
2076
2095
|
if (shouldValidateTz && !isValidTimezone(data.timezone)) {
|
|
2077
2096
|
ctx.addIssue({
|
|
2078
|
-
code:
|
|
2097
|
+
code: z37.ZodIssueCode.custom,
|
|
2079
2098
|
message: "Invalid IANA timezone",
|
|
2080
2099
|
path: ["timezone"]
|
|
2081
2100
|
});
|
|
@@ -2196,6 +2215,7 @@ export {
|
|
|
2196
2215
|
EvaluationResultSchema,
|
|
2197
2216
|
ExecutionTraceSchema,
|
|
2198
2217
|
ExpectedFileSchema,
|
|
2218
|
+
ExtraFileSchema,
|
|
2199
2219
|
FileContentCheckSchema,
|
|
2200
2220
|
FileContentTestSchema,
|
|
2201
2221
|
FileModificationSchema,
|
|
@@ -2259,6 +2279,7 @@ export {
|
|
|
2259
2279
|
SkillWasCalledAssertionSchema,
|
|
2260
2280
|
SkillWasCalledConfigSchema,
|
|
2261
2281
|
SkillWithLatestVersionSchema,
|
|
2282
|
+
SourceFileSchema,
|
|
2262
2283
|
SubAgentSchema,
|
|
2263
2284
|
TRACE_EVENT_PREFIX,
|
|
2264
2285
|
TargetSchema,
|