@wix/evalforge-types 0.47.0 → 0.49.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 CHANGED
@@ -9,7 +9,7 @@ Shared TypeScript types and [Zod](https://zod.dev/) schemas for the EvalForge pl
9
9
  | Module | Description |
10
10
  |--------|-------------|
11
11
  | `common` | Base entity schemas (`BaseEntity`, `TenantEntity`), `Rule`, shared utilities |
12
- | `target` | Testable entities — `Agent`, `Skill`, `SkillVersion`, `SkillsGroup`, `Mcp`, `SubAgent` |
12
+ | `target` | Testable entities — `Agent`, `Skill`, `SkillVersion`, `Preset`, `Mcp`, `SubAgent` |
13
13
  | `scenario` | Test scenario definitions and environment configuration |
14
14
  | `suite` | Test suite organization |
15
15
  | `evaluation` | Eval run schemas, configs, results, and statuses |
package/build/index.js CHANGED
@@ -59,11 +59,11 @@ __export(index_exports, {
59
59
  CreateCustomAssertionInputSchema: () => CreateCustomAssertionInputSchema,
60
60
  CreateEvalRunInputSchema: () => CreateEvalRunInputSchema,
61
61
  CreateMcpInputSchema: () => CreateMcpInputSchema,
62
+ CreatePresetInputSchema: () => CreatePresetInputSchema,
62
63
  CreateProjectInputSchema: () => CreateProjectInputSchema,
63
64
  CreateRuleInputSchema: () => CreateRuleInputSchema,
64
65
  CreateSkillInputSchema: () => CreateSkillInputSchema,
65
66
  CreateSkillVersionInputSchema: () => CreateSkillVersionInputSchema,
66
- CreateSkillsGroupInputSchema: () => CreateSkillsGroupInputSchema,
67
67
  CreateSubAgentInputSchema: () => CreateSubAgentInputSchema,
68
68
  CreateTemplateInputSchema: () => CreateTemplateInputSchema,
69
69
  CreateTestScenarioInputSchema: () => CreateTestScenarioInputSchema,
@@ -115,6 +115,7 @@ __export(index_exports, {
115
115
  OpenAIModel: () => Model,
116
116
  OpenAIModelSchema: () => OpenAIModelSchema,
117
117
  PlaywrightNLTestSchema: () => PlaywrightNLTestSchema,
118
+ PresetSchema: () => PresetSchema,
118
119
  ProjectSchema: () => ProjectSchema,
119
120
  PromptResultSchema: () => PromptResultSchema,
120
121
  RUN_COMMAND_LABELS: () => RUN_COMMAND_LABELS,
@@ -135,7 +136,6 @@ __export(index_exports, {
135
136
  SkillWasCalledAssertionSchema: () => SkillWasCalledAssertionSchema,
136
137
  SkillWasCalledConfigSchema: () => SkillWasCalledConfigSchema,
137
138
  SkillWithLatestVersionSchema: () => SkillWithLatestVersionSchema,
138
- SkillsGroupSchema: () => SkillsGroupSchema,
139
139
  SubAgentSchema: () => SubAgentSchema,
140
140
  TRACE_EVENT_PREFIX: () => TRACE_EVENT_PREFIX,
141
141
  TargetSchema: () => TargetSchema,
@@ -166,10 +166,10 @@ __export(index_exports, {
166
166
  UpdateAgentInputSchema: () => UpdateAgentInputSchema,
167
167
  UpdateCustomAssertionInputSchema: () => UpdateCustomAssertionInputSchema,
168
168
  UpdateMcpInputSchema: () => UpdateMcpInputSchema,
169
+ UpdatePresetInputSchema: () => UpdatePresetInputSchema,
169
170
  UpdateProjectInputSchema: () => UpdateProjectInputSchema,
170
171
  UpdateRuleInputSchema: () => UpdateRuleInputSchema,
171
172
  UpdateSkillInputSchema: () => UpdateSkillInputSchema,
172
- UpdateSkillsGroupInputSchema: () => UpdateSkillsGroupInputSchema,
173
173
  UpdateSubAgentInputSchema: () => UpdateSubAgentInputSchema,
174
174
  UpdateTemplateInputSchema: () => UpdateTemplateInputSchema,
175
175
  UpdateTestScenarioInputSchema: () => UpdateTestScenarioInputSchema,
@@ -1326,34 +1326,51 @@ var SkillWithLatestVersionSchema = SkillSchema.extend({
1326
1326
  latestVersion: SkillVersionSchema.optional()
1327
1327
  });
1328
1328
 
1329
- // src/target/skills-group.ts
1329
+ // src/target/sub-agent.ts
1330
1330
  var import_zod8 = require("zod");
1331
- var SkillsGroupSchema = TenantEntitySchema.extend({
1332
- /** IDs of skills in this group */
1333
- skillIds: import_zod8.z.array(import_zod8.z.string())
1331
+ var SubAgentSchema = TargetSchema.extend({
1332
+ /** The full sub-agent markdown content (YAML frontmatter + body) */
1333
+ subAgentMd: import_zod8.z.string()
1334
1334
  });
1335
- var CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({
1335
+ var SubAgentInputBaseSchema = SubAgentSchema.omit({
1336
1336
  id: true,
1337
1337
  createdAt: true,
1338
1338
  updatedAt: true,
1339
1339
  deleted: true
1340
1340
  });
1341
- var UpdateSkillsGroupInputSchema = CreateSkillsGroupInputSchema.partial();
1341
+ var CreateSubAgentInputSchema = SubAgentInputBaseSchema;
1342
+ var UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();
1342
1343
 
1343
- // src/target/sub-agent.ts
1344
+ // src/target/preset.ts
1344
1345
  var import_zod9 = require("zod");
1345
- var SubAgentSchema = TargetSchema.extend({
1346
- /** The full sub-agent markdown content (YAML frontmatter + body) */
1347
- subAgentMd: import_zod9.z.string()
1348
- });
1349
- var SubAgentInputBaseSchema = SubAgentSchema.omit({
1346
+ var PresetSchema = TenantEntitySchema.extend({
1347
+ /** Agent ID for this preset */
1348
+ agentId: import_zod9.z.string(),
1349
+ /** Skill IDs included in this preset */
1350
+ skillIds: import_zod9.z.array(import_zod9.z.string()).default([]),
1351
+ /** Optional map of skillId → skillVersionId for version pinning */
1352
+ skillVersions: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.string()).optional(),
1353
+ /** MCP server IDs included in this preset */
1354
+ mcpIds: import_zod9.z.array(import_zod9.z.string()).default([]),
1355
+ /** Sub-agent IDs included in this preset */
1356
+ subAgentIds: import_zod9.z.array(import_zod9.z.string()).default([]),
1357
+ /** Rule IDs included in this preset */
1358
+ ruleIds: import_zod9.z.array(import_zod9.z.string()).default([])
1359
+ });
1360
+ var atLeastOneEntity = (data) => (data.skillIds?.length ?? 0) > 0 || (data.mcpIds?.length ?? 0) > 0 || (data.subAgentIds?.length ?? 0) > 0 || (data.ruleIds?.length ?? 0) > 0;
1361
+ var AT_LEAST_ONE_ENTITY_MESSAGE = "At least one of skillIds, mcpIds, subAgentIds, or ruleIds must be non-empty";
1362
+ var CreatePresetInputSchema = PresetSchema.omit({
1350
1363
  id: true,
1351
1364
  createdAt: true,
1352
1365
  updatedAt: true,
1353
1366
  deleted: true
1354
- });
1355
- var CreateSubAgentInputSchema = SubAgentInputBaseSchema;
1356
- var UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();
1367
+ }).refine(atLeastOneEntity, { message: AT_LEAST_ONE_ENTITY_MESSAGE });
1368
+ var UpdatePresetInputSchema = PresetSchema.omit({
1369
+ id: true,
1370
+ createdAt: true,
1371
+ updatedAt: true,
1372
+ deleted: true
1373
+ }).partial();
1357
1374
 
1358
1375
  // src/test/index.ts
1359
1376
  var import_zod20 = require("zod");
@@ -1791,7 +1808,9 @@ var TestScenarioSchema = TenantEntitySchema.extend({
1791
1808
  /** IDs of saved assertions to evaluate (from assertions table) - legacy, use assertionLinks */
1792
1809
  assertionIds: import_zod24.z.array(import_zod24.z.string()).optional(),
1793
1810
  /** Linked assertions with per-scenario parameter values */
1794
- assertionLinks: import_zod24.z.array(ScenarioAssertionLinkSchema).optional()
1811
+ assertionLinks: import_zod24.z.array(ScenarioAssertionLinkSchema).optional(),
1812
+ /** Tags for categorisation and filtering */
1813
+ tags: import_zod24.z.array(import_zod24.z.string()).optional()
1795
1814
  });
1796
1815
  var CreateTestScenarioInputSchema = TestScenarioSchema.omit({
1797
1816
  id: true,
@@ -2056,11 +2075,13 @@ var FailureAnalysisSchema = import_zod28.z.object({
2056
2075
  var EvalRunSchema = TenantEntitySchema.extend({
2057
2076
  /** Agent ID for this run */
2058
2077
  agentId: import_zod28.z.string().optional(),
2059
- /** Skills group ID for this run */
2060
- skillsGroupId: import_zod28.z.string().optional(),
2078
+ /** Preset ID that originated this run (optional) */
2079
+ presetId: import_zod28.z.string().optional(),
2080
+ /** Skill IDs for this run */
2081
+ skillIds: import_zod28.z.array(import_zod28.z.string()).optional(),
2061
2082
  /** Map of skillId to skillVersionId for this run */
2062
2083
  skillVersions: import_zod28.z.record(import_zod28.z.string(), import_zod28.z.string()).optional(),
2063
- /** Scenario IDs to run */
2084
+ /** Scenario IDs to run (always present — resolved server-side from tags when needed) */
2064
2085
  scenarioIds: import_zod28.z.array(import_zod28.z.string()),
2065
2086
  /** Current status */
2066
2087
  status: EvalStatusSchema,
@@ -2095,7 +2116,9 @@ var EvalRunSchema = TenantEntitySchema.extend({
2095
2116
  /** Sub-agent IDs to enable for this run (optional) */
2096
2117
  subAgentIds: import_zod28.z.array(import_zod28.z.string()).optional(),
2097
2118
  /** Rule IDs to enable for this run (optional) */
2098
- ruleIds: import_zod28.z.array(import_zod28.z.string()).optional()
2119
+ ruleIds: import_zod28.z.array(import_zod28.z.string()).optional(),
2120
+ /** Tags used to select scenarios for this run (for traceability) */
2121
+ tags: import_zod28.z.array(import_zod28.z.string()).optional()
2099
2122
  });
2100
2123
  var CreateEvalRunInputSchema = EvalRunSchema.omit({
2101
2124
  id: true,
@@ -2106,8 +2129,15 @@ var CreateEvalRunInputSchema = EvalRunSchema.omit({
2106
2129
  results: true,
2107
2130
  aggregateMetrics: true,
2108
2131
  startedAt: true,
2109
- completedAt: true
2110
- });
2132
+ completedAt: true,
2133
+ scenarioIds: true
2134
+ }).extend({
2135
+ /** Optional on input — backend resolves from tags when not provided */
2136
+ scenarioIds: import_zod28.z.array(import_zod28.z.string()).optional()
2137
+ }).refine(
2138
+ (data) => data.scenarioIds && data.scenarioIds.length > 0 || data.tags && data.tags.length > 0,
2139
+ { message: "Either scenarioIds or tags must be provided" }
2140
+ );
2111
2141
  var EvaluationProgressSchema = import_zod28.z.object({
2112
2142
  runId: import_zod28.z.string(),
2113
2143
  targetId: import_zod28.z.string(),
@@ -2281,7 +2311,8 @@ var ProjectSchema = BaseEntitySchema.extend({
2281
2311
  appId: import_zod31.z.string().optional().describe("The ID of the app in Dev Center"),
2282
2312
  appSecret: import_zod31.z.string().optional().describe("The secret of the app in Dev Center"),
2283
2313
  useWixAuth: import_zod31.z.boolean().optional().describe("Enable Wix CLI/MCP auth for evaluations"),
2284
- useBase44Auth: import_zod31.z.boolean().optional().describe("Enable Base44 auth for evaluations")
2314
+ useBase44Auth: import_zod31.z.boolean().optional().describe("Enable Base44 auth for evaluations"),
2315
+ scenarioTags: import_zod31.z.array(import_zod31.z.string()).optional().describe("Project-level tag vocabulary for scenarios")
2285
2316
  });
2286
2317
  var CreateProjectInputSchema = ProjectSchema.omit({
2287
2318
  id: true,
@@ -2493,11 +2524,11 @@ function getSystemAssertion(id) {
2493
2524
  CreateCustomAssertionInputSchema,
2494
2525
  CreateEvalRunInputSchema,
2495
2526
  CreateMcpInputSchema,
2527
+ CreatePresetInputSchema,
2496
2528
  CreateProjectInputSchema,
2497
2529
  CreateRuleInputSchema,
2498
2530
  CreateSkillInputSchema,
2499
2531
  CreateSkillVersionInputSchema,
2500
- CreateSkillsGroupInputSchema,
2501
2532
  CreateSubAgentInputSchema,
2502
2533
  CreateTemplateInputSchema,
2503
2534
  CreateTestScenarioInputSchema,
@@ -2549,6 +2580,7 @@ function getSystemAssertion(id) {
2549
2580
  OpenAIModel,
2550
2581
  OpenAIModelSchema,
2551
2582
  PlaywrightNLTestSchema,
2583
+ PresetSchema,
2552
2584
  ProjectSchema,
2553
2585
  PromptResultSchema,
2554
2586
  RUN_COMMAND_LABELS,
@@ -2569,7 +2601,6 @@ function getSystemAssertion(id) {
2569
2601
  SkillWasCalledAssertionSchema,
2570
2602
  SkillWasCalledConfigSchema,
2571
2603
  SkillWithLatestVersionSchema,
2572
- SkillsGroupSchema,
2573
2604
  SubAgentSchema,
2574
2605
  TRACE_EVENT_PREFIX,
2575
2606
  TargetSchema,
@@ -2600,10 +2631,10 @@ function getSystemAssertion(id) {
2600
2631
  UpdateAgentInputSchema,
2601
2632
  UpdateCustomAssertionInputSchema,
2602
2633
  UpdateMcpInputSchema,
2634
+ UpdatePresetInputSchema,
2603
2635
  UpdateProjectInputSchema,
2604
2636
  UpdateRuleInputSchema,
2605
2637
  UpdateSkillInputSchema,
2606
- UpdateSkillsGroupInputSchema,
2607
2638
  UpdateSubAgentInputSchema,
2608
2639
  UpdateTemplateInputSchema,
2609
2640
  UpdateTestScenarioInputSchema,