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