@wix/evalforge-types 0.22.0 → 0.24.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 CHANGED
@@ -563,8 +563,8 @@ var TestSchema = import_zod18.z.discriminatedUnion("type", [
563
563
  var import_zod19 = require("zod");
564
564
  var SkillWasCalledAssertionSchema = import_zod19.z.object({
565
565
  type: import_zod19.z.literal("skill_was_called"),
566
- /** Name of the skill that must have been called (matched against trace Skill tool args) */
567
- skillName: import_zod19.z.string()
566
+ /** Names of the skills that must have been called (matched against trace Skill tool args) */
567
+ skillNames: import_zod19.z.array(import_zod19.z.string()).min(1)
568
568
  });
569
569
  var BuildPassedAssertionSchema = import_zod19.z.object({
570
570
  type: import_zod19.z.literal("build_passed"),
@@ -665,8 +665,8 @@ var ScenarioAssertionLinkSchema = import_zod21.z.object({
665
665
  ).optional()
666
666
  });
667
667
  var SkillWasCalledConfigSchema = import_zod21.z.object({
668
- /** Name of the skill that must have been called */
669
- skillName: import_zod21.z.string().min(1)
668
+ /** Names of the skills that must have been called */
669
+ skillNames: import_zod21.z.array(import_zod21.z.string().min(1)).min(1)
670
670
  });
671
671
  var BuildPassedConfigSchema = import_zod21.z.strictObject({
672
672
  /** Command to run (default: "yarn build") */
@@ -1235,12 +1235,12 @@ var SYSTEM_ASSERTIONS = {
1235
1235
  [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {
1236
1236
  id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,
1237
1237
  name: "Skill Was Called",
1238
- description: "Check if a specific skill was invoked during the agent run",
1238
+ description: "Check that one or more skills were invoked during the agent run",
1239
1239
  type: "skill_was_called",
1240
1240
  parameters: [
1241
1241
  {
1242
- name: "skillName",
1243
- label: "Skill Name",
1242
+ name: "skillNames",
1243
+ label: "Skills",
1244
1244
  type: "string",
1245
1245
  required: true
1246
1246
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/common/base-entity.ts", "../src/common/mcp.ts", "../src/common/models.ts", "../src/target/target.ts", "../src/target/agent.ts", "../src/target/skill.ts", "../src/target/skills-group.ts", "../src/target/sub-agent.ts", "../src/test/index.ts", "../src/test/base.ts", "../src/test/llm.ts", "../src/test/tool.ts", "../src/test/site-config.ts", "../src/test/command-execution.ts", "../src/test/file-presence.ts", "../src/test/file-content.ts", "../src/test/build-check.ts", "../src/test/vitest.ts", "../src/test/playwright-nl.ts", "../src/scenario/assertions.ts", "../src/scenario/environment.ts", "../src/scenario/test-scenario.ts", "../src/assertion/assertion.ts", "../src/suite/test-suite.ts", "../src/evaluation/metrics.ts", "../src/evaluation/eval-result.ts", "../src/evaluation/eval-run.ts", "../src/evaluation/live-trace.ts", "../src/project/project.ts", "../src/template/template.ts", "../src/assertion/system-assertions.ts"],
4
- "sourcesContent": ["/**\n * @wix/evalforge-types\n *\n * Unified types for the agent evaluation system.\n *\n * Entity Hierarchy:\n * - BaseEntity: id, name, description, dates\n * - TenantEntity: extends BaseEntity with projectId\n * - Target: extends TenantEntity (base for testable entities)\n * - Agent: CLI-based agent (runCommand, modelConfig)\n * - Skill: SKILL.md-based capability\n *\n * Test Types (9 total):\n * - LLM, TOOL, SITE_CONFIG, COMMAND_EXECUTION (from old system)\n * - FILE_PRESENCE, FILE_CONTENT, BUILD_CHECK, VITEST, PLAYWRIGHT_NL (new)\n */\n\n// Common - base schemas and utilities\nexport * from './common/index.js';\n\n// Target - testable entities\nexport * from './target/index.js';\n\n// Test - all test type definitions\nexport * from './test/index.js';\n\n// Scenario - test scenarios and environment\nexport * from './scenario/index.js';\n\n// Suite - test organization\nexport * from './suite/index.js';\n\n// Evaluation - runs, configs, and results\nexport * from './evaluation/index.js';\n\n// Project - multi-tenancy\nexport * from './project/index.js';\n\n// Template - project templates (global entities)\nexport * from './template/index.js';\n\n// Agent - adapter interface for agent implementations\nexport * from './agent/index.js';\n\n// Assertion - custom assertions stored in database\nexport * from './assertion/index.js';\n", "import { z } from 'zod';\n\n/**\n * Base entity schema with common fields for all entities.\n */\nexport const BaseEntitySchema = z.object({\n id: z.string(),\n name: z.string().min(1),\n description: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n deleted: z.boolean().optional()\n});\n\nexport type BaseEntity = z.infer<typeof BaseEntitySchema>;\n\n/**\n * Tenant entity schema - extends BaseEntity with projectId for multi-tenancy.\n */\nexport const TenantEntitySchema = BaseEntitySchema.extend({\n projectId: z.string()\n});\n\nexport type TenantEntity = z.infer<typeof TenantEntitySchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\n/**\n * Top-level key for the .mcp.json file written at run start.\n * Format: { [MCP_SERVERS_JSON_KEY]: { [mcpName]: config } }\n */\nexport const MCP_SERVERS_JSON_KEY = 'mcpServers';\n\n/**\n * MCP Entity schema - an MCP server definition stored per project.\n *\n * The `name` is used as the key in .mcp.json mcpServers object.\n * The `config` is stored as-is and written to mcp.json (command/args, url/headers, etc.).\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name and key in mcp.json mcpServers object */\n name: z.string().min(1),\n /** MCP server config (command/args, url/headers, etc.) - stored as-is for mcp.json */\n config: z.record(z.string(), z.unknown())\n});\n\nexport type MCPEntity = z.infer<typeof MCPEntitySchema>;\n\n/**\n * Input schema for creating a new MCP.\n */\nexport const CreateMcpInputSchema = MCPEntitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateMcpInput = z.infer<typeof CreateMcpInputSchema>;\n\n/**\n * Input schema for updating an MCP.\n */\nexport const UpdateMcpInputSchema = CreateMcpInputSchema.partial();\n\nexport type UpdateMcpInput = z.infer<typeof UpdateMcpInputSchema>;\n\n/**\n * MCP Server Configuration (legacy - for mcp.json config shape).\n * Config can be: { command, args }, { url, headers }, { type, command, args, env }, etc.\n */\nexport const MCPServerConfigSchema = z.record(z.string(), z.unknown());\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;\n", "import { z } from 'zod';\n\n/**\n * Anthropic Model IDs supported by the AI Gateway.\n * These values match the ClaudeModel enum from the Wix AI Gateway API.\n */\nexport enum ModelIds {\n CLAUDE_3_HAIKU_1_0 = 'CLAUDE_3_HAIKU_1_0',\n CLAUDE_3_OPUS_1_0 = 'CLAUDE_3_OPUS_1_0',\n CLAUDE_3_SONNET_1_0 = 'CLAUDE_3_SONNET_1_0',\n CLAUDE_3_5_SONNET_1_0 = 'CLAUDE_3_5_SONNET_1_0',\n CLAUDE_3_5_SONNET_2_0 = 'CLAUDE_3_5_SONNET_2_0',\n CLAUDE_3_7_SONNET_1_0 = 'CLAUDE_3_7_SONNET_1_0',\n CLAUDE_4_OPUS_1_0 = 'CLAUDE_4_OPUS_1_0',\n CLAUDE_4_SONNET_1_0 = 'CLAUDE_4_SONNET_1_0'\n}\n\nexport const ModelIdsSchema = z.enum(ModelIds);\n\n/**\n * Model configuration schema for specifying model parameters.\n */\nexport const ModelConfigSchema = z.object({\n model: ModelIdsSchema,\n temperature: z.number().min(0).max(1).optional(),\n maxTokens: z.number().min(1).optional()\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n\n/**\n * Model pricing schema (cost per 1M tokens).\n */\nexport const ModelPricingSchema = z.object({\n inputPer1M: z.number(),\n outputPer1M: z.number()\n});\n\nexport type ModelPricing = z.infer<typeof ModelPricingSchema>;\n\n/**\n * Model schema - complete model definition with metadata and pricing.\n */\nexport const ModelSchema = z.object({\n /** AI Gateway model ID */\n id: ModelIdsSchema,\n /** Display name */\n name: z.string(),\n /** Provider (always 'anthropic') */\n provider: z.literal('anthropic'),\n /** Provider's model identifier (e.g., \"claude-3-5-sonnet-20241022\") */\n providerModelId: z.string(),\n /** Pricing per 1M tokens */\n pricing: ModelPricingSchema\n});\n\nexport type Model = z.infer<typeof ModelSchema>;\n\n/**\n * Available models with full metadata including pricing.\n */\nexport const AVAILABLE_MODELS: Model[] = [\n {\n id: ModelIds.CLAUDE_4_SONNET_1_0,\n name: 'Claude 4 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-4-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_4_OPUS_1_0,\n name: 'Claude 4 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-4-opus',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_7_SONNET_1_0,\n name: 'Claude 3.7 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-7-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_2_0,\n name: 'Claude 3.5 Sonnet v2',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20241022',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_1_0,\n name: 'Claude 3.5 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20240620',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_OPUS_1_0,\n name: 'Claude 3 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-3-opus-20240229',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_SONNET_1_0,\n name: 'Claude 3 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-sonnet-20240229',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_HAIKU_1_0,\n name: 'Claude 3 Haiku',\n provider: 'anthropic',\n providerModelId: 'claude-3-haiku-20240307',\n pricing: { inputPer1M: 0.25, outputPer1M: 1.25 }\n }\n];\n\n/**\n * Available models as a map keyed by model ID.\n */\nexport const AVAILABLE_MODELS_MAP: Record<ModelIds, Model> = Object.fromEntries(\n AVAILABLE_MODELS.map((model) => [model.id, model])\n) as Record<ModelIds, Model>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Target schema - base for all testable entities.\n *\n * All testable entities (Agent, Skill) extend this schema.\n * This creates a unified type hierarchy for what can be evaluated.\n */\nexport const TargetSchema = TenantEntitySchema.extend({\n // Base for all testable entities\n // Specific targets add their own fields\n});\n\nexport type Target = z.infer<typeof TargetSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Agent schema - a CLI-based coding agent.\n *\n * Agents are external CLI tools that can execute coding tasks.\n * Examples: Claude Code CLI, Codex CLI, Cursor CLI.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Command to run the agent */\n runCommand: z.string(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional()\n});\n\nexport type Agent = z.infer<typeof AgentSchema>;\n\n/**\n * Input schema for creating a new Agent.\n */\nexport const CreateAgentInputSchema = AgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateAgentInput = z.infer<typeof CreateAgentInputSchema>;\n\n/**\n * Input schema for updating an Agent.\n * modelConfig can be null to explicitly clear it (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Regex for valid skill folder names (kebab-case).\n * Allows: lowercase letters, numbers, hyphens. Words separated by single hyphens.\n * Examples: my-skill, code-review, skill1\n */\nexport const SKILL_FOLDER_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * Check if a string is a valid skill folder name (kebab-case).\n * Used for validation when creating skills and when writing skills to filesystem.\n */\nexport function isValidSkillFolderName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n SKILL_FOLDER_NAME_REGEX.test(name.trim())\n );\n}\n\n/**\n * Skill metadata parsed from SKILL.md frontmatter.\n *\n * Following the agentskills.io specification:\n * - name: Skill identifier (max 64 chars, lowercase + hyphens)\n * - description: What the skill does and when to use it\n * - allowedTools: Pre-approved tools the skill may use\n * - skills: Sub-skills for composite agents\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n allowedTools: z.array(z.string()).optional(),\n skills: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * Skill version - historical snapshot of a Skill's content.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n skillId: z.string(),\n skillMd: z.string(),\n metadata: SkillMetadataSchema,\n model: ModelConfigSchema.optional(),\n systemPrompt: z.string().optional(),\n version: z.number(),\n createdAt: z.string(),\n notes: z.string().optional()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Skill schema - a coding capability defined by SKILL.md.\n *\n * Skills represent coding capabilities that can be tested.\n * Persisted shape: id, projectId, name, description, createdAt, updatedAt, deleted, skillMd.\n */\nexport const SkillSchema = TargetSchema.extend({\n /** The current SKILL.md content */\n skillMd: z.string()\n});\n\nexport type Skill = z.infer<typeof SkillSchema>;\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-skill)';\n\nconst SkillInputBaseSchema = SkillSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new Skill.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.refine(\n (data) => isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;\n\n/**\n * Input schema for updating a Skill.\n */\nexport const UpdateSkillInputSchema = SkillInputBaseSchema.partial().refine(\n (data) => data.name === undefined || isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * SkillsGroup schema - a collection of skills (replaces TargetGroup for the new model).\n *\n * Eval runs can be scoped to a skills group to run against all skills in the group.\n */\nexport const SkillsGroupSchema = TenantEntitySchema.extend({\n /** IDs of skills in this group */\n skillIds: z.array(z.string())\n});\n\nexport type SkillsGroup = z.infer<typeof SkillsGroupSchema>;\n\n/**\n * Input schema for creating a new SkillsGroup.\n */\nexport const CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateSkillsGroupInput = z.infer<\n typeof CreateSkillsGroupInputSchema\n>;\n\n/**\n * Input schema for updating a SkillsGroup.\n */\nexport const UpdateSkillsGroupInputSchema =\n CreateSkillsGroupInputSchema.partial();\n\nexport type UpdateSkillsGroupInput = z.infer<\n typeof UpdateSkillsGroupInputSchema\n>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\n\n/**\n * Sub-agent schema \u2013 a Markdown file with YAML frontmatter.\n *\n * Sub-agents are specialized AI assistants (per Claude Code docs)\n * defined in Markdown with frontmatter (name, description, tools, model, etc.).\n * The body is the system prompt.\n *\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string()\n});\n\nexport type SubAgent = z.infer<typeof SubAgentSchema>;\n\nconst SubAgentInputBaseSchema = SubAgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateSubAgentInputSchema = SubAgentInputBaseSchema;\n\nexport type CreateSubAgentInput = z.infer<typeof CreateSubAgentInputSchema>;\n\nexport const UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();\n\nexport type UpdateSubAgentInput = z.infer<typeof UpdateSubAgentInputSchema>;\n", "import { z } from 'zod';\n\n// Base exports\nexport * from './base.js';\n\n// Individual test types\nexport * from './llm.js';\nexport * from './tool.js';\nexport * from './site-config.js';\nexport * from './command-execution.js';\nexport * from './file-presence.js';\nexport * from './file-content.js';\nexport * from './build-check.js';\nexport * from './vitest.js';\nexport * from './playwright-nl.js';\n\n// Import schemas for union\nimport { LLMTestSchema, LLMTestResult } from './llm.js';\nimport { ToolTestSchema, ToolTestResult } from './tool.js';\nimport { SiteConfigTestSchema, SiteConfigTestResult } from './site-config.js';\nimport {\n CommandExecutionTestSchema,\n CommandExecutionTestResult\n} from './command-execution.js';\nimport {\n FilePresenceTestSchema,\n FilePresenceTestResult\n} from './file-presence.js';\nimport {\n FileContentTestSchema,\n FileContentTestResult\n} from './file-content.js';\nimport { BuildCheckTestSchema, BuildCheckTestResult } from './build-check.js';\nimport { VitestTestSchema, VitestTestResult } from './vitest.js';\nimport {\n PlaywrightNLTestSchema,\n PlaywrightNLTestResult\n} from './playwright-nl.js';\n\n/**\n * Unified Test schema - discriminated union of all 9 test types.\n */\nexport const TestSchema = z.discriminatedUnion('type', [\n LLMTestSchema,\n ToolTestSchema,\n SiteConfigTestSchema,\n CommandExecutionTestSchema,\n FilePresenceTestSchema,\n FileContentTestSchema,\n BuildCheckTestSchema,\n VitestTestSchema,\n PlaywrightNLTestSchema\n]);\n\nexport type Test = z.infer<typeof TestSchema>;\n\n/**\n * Union of all test result types.\n */\nexport type TestResult =\n | LLMTestResult\n | ToolTestResult\n | SiteConfigTestResult\n | CommandExecutionTestResult\n | FilePresenceTestResult\n | FileContentTestResult\n | BuildCheckTestResult\n | VitestTestResult\n | PlaywrightNLTestResult;\n", "import { z } from 'zod';\n\n/**\n * Test types - unified from old and new systems.\n */\nexport enum TestType {\n // From old system\n LLM = 'LLM',\n TOOL = 'TOOL',\n SITE_CONFIG = 'SITE_CONFIG',\n COMMAND_EXECUTION = 'COMMAND_EXECUTION',\n // From new system\n FILE_PRESENCE = 'FILE_PRESENCE',\n FILE_CONTENT = 'FILE_CONTENT',\n BUILD_CHECK = 'BUILD_CHECK',\n VITEST = 'VITEST',\n PLAYWRIGHT_NL = 'PLAYWRIGHT_NL'\n}\n\nexport const TestTypeSchema = z.enum(TestType);\n\n/**\n * Test importance levels.\n */\nexport enum TestImportance {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\nexport const TestImportanceSchema = z.enum(TestImportance);\n\n/**\n * Base test schema - common fields for all test types.\n */\nexport const BaseTestSchema = z.object({\n id: z.string(),\n type: TestTypeSchema,\n name: z.string().min(3),\n description: z.string().optional(),\n importance: TestImportanceSchema.optional()\n});\n\nexport type BaseTest = z.infer<typeof BaseTestSchema>;\n\n/**\n * Base test result interface.\n */\nexport interface BaseTestResult {\n type: TestType;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * LLM Test schema - tests that use an LLM evaluator.\n */\nexport const LLMTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.LLM),\n /** Maximum steps for the LLM to take */\n maxSteps: z.number().min(1).max(100),\n /** Prompt to send to the evaluator */\n prompt: z.string().min(1),\n /** ID of the evaluator agent to use */\n evaluatorId: z.string()\n});\n\nexport type LLMTest = z.infer<typeof LLMTestSchema>;\n\n/**\n * LLM Test result.\n */\nexport interface LLMTestResult extends BaseTestResult {\n type: TestType.LLM;\n testPrompt: string;\n testSystemPrompt?: string;\n text: string;\n scoreReasoning: string;\n score: number;\n totalMicrocentsSpent?: number;\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n totalTokens?: number;\n };\n reasoning?: string;\n reasoningDetails?: unknown;\n finishReason?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Tool Test schema - tests that verify tool usage.\n */\nexport const ToolTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.TOOL),\n /** Name of the tool that should be called */\n toolName: z.string().min(3),\n /** Expected arguments for the tool call */\n args: z.record(z.string(), z.any()),\n /** Expected content in the tool results */\n resultsContent: z.string()\n});\n\nexport type ToolTest = z.infer<typeof ToolTestSchema>;\n\n/**\n * Tool Test result.\n */\nexport interface ToolTestResult extends BaseTestResult {\n type: TestType.TOOL;\n result: boolean;\n toolUsed: boolean;\n actualArgs: Record<string, any>;\n isResultsValid: boolean;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Site Config Test schema - tests that verify site configuration via API.\n */\nexport const SiteConfigTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.SITE_CONFIG),\n /** URL to call */\n url: z.string().url(),\n /** HTTP method */\n method: z.enum(['GET', 'POST']),\n /** Request body (for POST) */\n body: z.string().optional(),\n /** Expected HTTP status code */\n expectedStatusCode: z.number().int().min(100).max(599),\n /** Expected response content */\n expectedResponse: z.string().optional(),\n /** JMESPath expression to extract from response */\n expectedResponseJMESPath: z.string().optional()\n});\n\nexport type SiteConfigTest = z.infer<typeof SiteConfigTestSchema>;\n\n/**\n * Site Config Test result.\n */\nexport interface SiteConfigTestResult extends BaseTestResult {\n type: TestType.SITE_CONFIG;\n result: boolean;\n actualStatusCode: number;\n actualResponse: unknown;\n allActualResponse: unknown;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Allowed commands for command execution tests.\n */\nexport const AllowedCommands = [\n 'yarn install --no-immutable && yarn build',\n 'npm run build',\n 'yarn typecheck'\n] as const;\n\n/**\n * Command Execution Test schema - tests that verify command execution.\n */\nexport const CommandExecutionTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.COMMAND_EXECUTION),\n /** Command to execute (must be in AllowedCommands) */\n command: z\n .string()\n .refine((value) => (AllowedCommands as readonly string[]).includes(value), {\n message: `Command must be one of: ${AllowedCommands.join(', ')}`\n }),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().default(0).optional()\n});\n\nexport type CommandExecutionTest = z.infer<typeof CommandExecutionTestSchema>;\n\n/**\n * Command Execution Test result.\n */\nexport interface CommandExecutionTestResult extends BaseTestResult {\n type: TestType.COMMAND_EXECUTION;\n stdout: string;\n stderr: string;\n exitCode: number | null;\n expectedExitCode: number;\n result: boolean;\n error?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File Presence Test schema - tests that verify file existence.\n */\nexport const FilePresenceTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_PRESENCE),\n /** Paths to check */\n paths: z.array(z.string()),\n /** Whether files should exist (true) or not exist (false) */\n shouldExist: z.boolean()\n});\n\nexport type FilePresenceTest = z.infer<typeof FilePresenceTestSchema>;\n\n/**\n * File Presence Test result.\n */\nexport interface FilePresenceTestResult extends BaseTestResult {\n type: TestType.FILE_PRESENCE;\n result: boolean;\n existingPaths: string[];\n missingPaths: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File content checks schema.\n */\nexport const FileContentCheckSchema = z.object({\n /** Strings that must be present in the file */\n contains: z.array(z.string()).optional(),\n /** Strings that must NOT be present in the file */\n notContains: z.array(z.string()).optional(),\n /** Regex pattern the content must match */\n matches: z.string().optional(),\n /** JSON path checks for structured content */\n jsonPath: z\n .array(\n z.object({\n path: z.string(),\n value: z.unknown()\n })\n )\n .optional(),\n /** Lines that should be added (for diff checking) */\n added: z.array(z.string()).optional(),\n /** Lines that should be removed (for diff checking) */\n removed: z.array(z.string()).optional()\n});\n\nexport type FileContentCheck = z.infer<typeof FileContentCheckSchema>;\n\n/**\n * File Content Test schema - tests that verify file content.\n *\n * This also covers the FILE_MODIFICATION use case from the old system\n * by supporting added/removed line checks.\n */\nexport const FileContentTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_CONTENT),\n /** Path to the file to check */\n path: z.string(),\n /** Content checks to perform */\n checks: FileContentCheckSchema\n});\n\nexport type FileContentTest = z.infer<typeof FileContentTestSchema>;\n\n/**\n * File Content Test result.\n */\nexport interface FileContentTestResult extends BaseTestResult {\n type: TestType.FILE_CONTENT;\n result: boolean;\n diff?: string;\n failedChecks?: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Build Check Test schema - tests that verify build success.\n */\nexport const BuildCheckTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.BUILD_CHECK),\n /** Build command to execute */\n command: z.string(),\n /** Whether the build should succeed */\n expectSuccess: z.boolean(),\n /** Maximum allowed warnings (optional) */\n allowedWarnings: z.number().optional(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type BuildCheckTest = z.infer<typeof BuildCheckTestSchema>;\n\n/**\n * Build Check Test result.\n */\nexport interface BuildCheckTestResult extends BaseTestResult {\n type: TestType.BUILD_CHECK;\n result: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n warningCount: number;\n duration: number;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Vitest Test schema - tests that run Vitest test files.\n */\nexport const VitestTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.VITEST),\n /** Test file content */\n testFile: z.string(),\n /** Name of the test file */\n testFileName: z.string(),\n /** Minimum pass rate required (0-100) */\n minPassRate: z.number().min(0).max(100)\n});\n\nexport type VitestTest = z.infer<typeof VitestTestSchema>;\n\n/**\n * Vitest Test result.\n */\nexport interface VitestTestResult extends BaseTestResult {\n type: TestType.VITEST;\n result: boolean;\n passRate: number;\n passed: number;\n failed: number;\n skipped: number;\n total: number;\n duration: number;\n output: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Playwright Natural Language Test schema - tests using natural language descriptions.\n */\nexport const PlaywrightNLTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.PLAYWRIGHT_NL),\n /** Natural language steps to execute */\n steps: z.array(z.string()),\n /** Expected outcome description */\n expectedOutcome: z.string(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type PlaywrightNLTest = z.infer<typeof PlaywrightNLTestSchema>;\n\n/**\n * Playwright NL Test result.\n */\nexport interface PlaywrightNLTestResult extends BaseTestResult {\n type: TestType.PLAYWRIGHT_NL;\n result: boolean;\n stepsExecuted: number;\n totalSteps: number;\n failedStep?: string;\n screenshot?: string;\n duration: number;\n}\n", "import { z } from 'zod';\n\n/**\n * Assertion: the agent must have invoked a specific skill during the run.\n * Checked by inspecting the LLM trace for a \"Skill\" tool use with the given skill.\n * Data: skillName (the skill that must have been called).\n */\nexport const SkillWasCalledAssertionSchema = z.object({\n type: z.literal('skill_was_called'),\n /** Name of the skill that must have been called (matched against trace Skill tool args) */\n skillName: z.string()\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\n/**\n * Assertion: a build command must exit with the expected code (default 0).\n * Runs the command in the scenario working directory.\n */\nexport const BuildPassedAssertionSchema = z.object({\n type: z.literal('build_passed'),\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\n/**\n * Assertion: an LLM judges the scenario output (score 0-100).\n * Prompt can use {{output}}, {{cwd}}, {{changedFiles}}, {{trace}}.\n * Passes if judge score >= minScore.\n */\nexport const LlmJudgeAssertionSchema = z.object({\n type: z.literal('llm_judge'),\n /** Prompt template; placeholders: {{output}}, {{cwd}}, {{changedFiles}}, {{trace}} */\n prompt: z.string(),\n /** Optional system prompt for the judge (default asks for JSON with score) */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku) */\n model: z.string().optional(),\n maxTokens: z.number().int().optional(),\n temperature: z.number().min(0).max(1).optional()\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\n/**\n * Union of all assertion types (per scenario).\n * Each assertion has a type and type-specific data.\n * Uses z.union (not z.discriminatedUnion) for Zod v4 compatibility when used as array element.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n BuildPassedAssertionSchema,\n LlmJudgeAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\n", "import { z } from 'zod';\n\n/**\n * Local project configuration schema.\n */\nexport const LocalProjectConfigSchema = z.object({\n /** Template ID to use for the local project */\n templateId: z.string().optional(),\n /** Files to create in the project */\n files: z\n .array(\n z.object({\n path: z.string().min(1),\n content: z.string().min(1)\n })\n )\n .optional()\n});\n\nexport type LocalProjectConfig = z.infer<typeof LocalProjectConfigSchema>;\n\n/**\n * Meta site configuration schema for API-based setup.\n */\nexport const MetaSiteConfigSchema = z.object({\n configurations: z\n .array(\n z.object({\n name: z.string().min(1),\n apiCalls: z.array(\n z.object({\n url: z.string().url(),\n method: z.enum(['POST', 'PUT']),\n body: z.string()\n })\n )\n })\n )\n .optional()\n});\n\nexport type MetaSiteConfig = z.infer<typeof MetaSiteConfigSchema>;\n\n/**\n * Environment configuration schema.\n *\n * Defines the environment setup required for running a test scenario.\n * Migrated from the old Prompt schema.\n */\nexport const EnvironmentSchema = z.object({\n /** Local project configuration */\n localProject: LocalProjectConfigSchema.optional(),\n /** Meta site configuration */\n metaSite: MetaSiteConfigSchema.optional()\n});\n\nexport type Environment = z.infer<typeof EnvironmentSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { AssertionSchema } from './assertions.js';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\n\n/**\n * Expected file schema - a file the agent is expected to create or modify.\n * Used by eval results; not persisted on test_scenarios table.\n */\nexport const ExpectedFileSchema = z.object({\n /** Relative path where the file should be created */\n path: z.string(),\n /** Optional expected content */\n content: z.string().optional()\n});\n\nexport type ExpectedFile = z.infer<typeof ExpectedFileSchema>;\n\n/**\n * TestScenario schema - defines a single test scenario.\n *\n * Persisted shape matches test_scenarios table:\n * id, project_id, name, description, trigger_prompt, template_id, created_at, updated_at, deleted.\n * Linked assertions stored in scenario_assertions junction table.\n */\nexport const TestScenarioSchema = TenantEntitySchema.extend({\n /** The prompt sent to the agent to trigger the task */\n triggerPrompt: z.string().min(10),\n /** ID of the template to use for this scenario (null = no template) */\n templateId: z.string().nullish(),\n /** Inline assertions to evaluate for this scenario (legacy) */\n assertions: z.array(AssertionSchema).optional(),\n /** IDs of saved assertions to evaluate (from assertions table) - legacy, use assertionLinks */\n assertionIds: z.array(z.string()).optional(),\n /** Linked assertions with per-scenario parameter values */\n assertionLinks: z.array(ScenarioAssertionLinkSchema).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestScenarioInput = z.infer<\n typeof CreateTestScenarioInputSchema\n>;\n\n/**\n * Input schema for updating a TestScenario.\n */\nexport const UpdateTestScenarioInputSchema =\n CreateTestScenarioInputSchema.partial();\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, user-created)\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'build_passed',\n 'llm_judge'\n]);\n\n/**\n * Parameter types supported in assertion parameters.\n */\nexport const AssertionParameterTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean'\n]);\n\nexport type AssertionParameterType = z.infer<\n typeof AssertionParameterTypeSchema\n>;\n\n/**\n * Schema for defining assertion parameters.\n * Parameters can be required or optional, with optional default values.\n */\nexport const AssertionParameterSchema = z.object({\n /** Parameter name (used as key in params object) */\n name: z.string().min(1),\n /** Display label for the parameter */\n label: z.string().min(1),\n /** Parameter type */\n type: AssertionParameterTypeSchema,\n /** Whether this parameter is required */\n required: z.boolean(),\n /** Default value (optional, used when not provided) */\n defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),\n /** If true, parameter is hidden by default behind \"Show advanced options\" */\n advanced: z.boolean().optional()\n});\n\nexport type AssertionParameter = z.infer<typeof AssertionParameterSchema>;\n\n/**\n * Schema for scenario-assertion link with parameter values.\n * Used when linking assertions to scenarios with specific parameter values.\n */\nexport const ScenarioAssertionLinkSchema = z.object({\n /** ID of the assertion (can be system assertion like 'system:skill_was_called' or custom assertion UUID) */\n assertionId: z.string(),\n /** Parameter values for this assertion in this scenario */\n params: z\n .record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.null()])\n )\n .optional()\n});\n\nexport type ScenarioAssertionLink = z.infer<typeof ScenarioAssertionLinkSchema>;\n\nexport type AssertionType = z.infer<typeof AssertionTypeSchema>;\n\n/**\n * Configuration for skill_was_called assertion type.\n */\nexport const SkillWasCalledConfigSchema = z.object({\n /** Name of the skill that must have been called */\n skillName: z.string().min(1)\n});\n\nexport type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;\n\n/**\n * Configuration for build_passed assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching LlmJudge configs).\n */\nexport const BuildPassedConfigSchema = z.strictObject({\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedConfig = z.infer<typeof BuildPassedConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\n * User-created assertions with customizable parameters.\n */\nexport const LlmJudgeConfigSchema = z.object({\n /**\n * Prompt template with placeholders:\n * - {{output}}: agent's final output\n * - {{cwd}}: working directory\n * - {{changedFiles}}: all files changed (new, modified)\n * - {{modifiedFiles}}: only existing files that were modified\n * - {{newFiles}}: only new files that were created\n * - {{trace}}: step-by-step trace of tool calls\n * - Custom parameters defined in the parameters array\n */\n prompt: z.string().min(1),\n /** Optional system prompt for the judge */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku-20241022) */\n model: z.string().optional(),\n /** Max output tokens */\n maxTokens: z.number().int().optional(),\n /** Temperature (0-1) */\n temperature: z.number().min(0).max(1).optional(),\n /** User-defined parameters for this assertion */\n parameters: z.array(AssertionParameterSchema).optional()\n});\n\nexport type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;\n\n/**\n * Union of all assertion config types.\n * Order matters: schemas with required fields first, then optional-only schemas.\n * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillName)\n * are matched before BuildPassed (all optional) or empty object.\n */\nexport const AssertionConfigSchema = z.union([\n LlmJudgeConfigSchema, // requires prompt - check first\n SkillWasCalledConfigSchema, // requires skillName\n BuildPassedConfigSchema, // all optional, uses strictObject to reject unknown keys\n z.object({}) // fallback empty config\n]);\n\nexport type AssertionConfig = z.infer<typeof AssertionConfigSchema>;\n\n/**\n * Custom Assertion entity - stored in the database.\n * Replaces inline assertions in test scenarios.\n */\nexport const CustomAssertionSchema = TenantEntitySchema.extend({\n /** The assertion type */\n type: AssertionTypeSchema,\n /** Type-specific configuration */\n config: AssertionConfigSchema\n});\n\nexport type CustomAssertion = z.infer<typeof CustomAssertionSchema>;\n\n/**\n * Input schema for creating a new CustomAssertion.\n */\nexport const CreateCustomAssertionInputSchema = CustomAssertionSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateCustomAssertionInput = z.infer<\n typeof CreateCustomAssertionInputSchema\n>;\n\n/**\n * Input schema for updating a CustomAssertion.\n */\nexport const UpdateCustomAssertionInputSchema =\n CreateCustomAssertionInputSchema.partial();\n\nexport type UpdateCustomAssertionInput = z.infer<\n typeof UpdateCustomAssertionInputSchema\n>;\n\n/**\n * Helper function to validate config based on assertion type.\n * Returns true if config is valid for the given type.\n */\nexport function validateAssertionConfig(\n type: AssertionType,\n config: unknown\n): boolean {\n switch (type) {\n case 'skill_was_called':\n return SkillWasCalledConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n\n/**\n * Get typed config for skill_was_called assertion.\n */\nexport function getSkillWasCalledConfig(\n assertion: CustomAssertion\n): SkillWasCalledConfig | null {\n if (assertion.type !== 'skill_was_called') return null;\n const result = SkillWasCalledConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for build_passed assertion.\n */\nexport function getBuildPassedConfig(\n assertion: CustomAssertion\n): BuildPassedConfig | null {\n if (assertion.type !== 'build_passed') return null;\n const result = BuildPassedConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for llm_judge assertion.\n */\nexport function getLlmJudgeConfig(\n assertion: CustomAssertion\n): LlmJudgeConfig | null {\n if (assertion.type !== 'llm_judge') return null;\n const result = LlmJudgeConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * TestSuite schema - a collection of test scenarios.\n *\n * Suites are used to organize and group related test scenarios.\n */\nexport const TestSuiteSchema = TenantEntitySchema.extend({\n /** IDs of test scenarios in this suite */\n scenarioIds: z.array(z.string())\n});\n\nexport type TestSuite = z.infer<typeof TestSuiteSchema>;\n\n/**\n * Input schema for creating a new TestSuite.\n */\nexport const CreateTestSuiteInputSchema = TestSuiteSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestSuiteInput = z.infer<typeof CreateTestSuiteInputSchema>;\n\n/**\n * Input schema for updating a TestSuite.\n */\nexport const UpdateTestSuiteInputSchema = CreateTestSuiteInputSchema.partial();\n\nexport type UpdateTestSuiteInput = z.infer<typeof UpdateTestSuiteInputSchema>;\n", "import { z } from 'zod';\n\n/**\n * Token usage schema.\n */\nexport const TokenUsageSchema = z.object({\n prompt: z.number(),\n completion: z.number(),\n total: z.number()\n});\n\nexport type TokenUsage = z.infer<typeof TokenUsageSchema>;\n\n/**\n * Evaluation metrics schema.\n */\nexport const EvalMetricsSchema = z.object({\n totalAssertions: z.number(),\n passed: z.number(),\n failed: z.number(),\n skipped: z.number(),\n errors: z.number(),\n passRate: z.number(),\n avgDuration: z.number(),\n totalDuration: z.number()\n});\n\nexport type EvalMetrics = z.infer<typeof EvalMetricsSchema>;\n\n/**\n * Evaluation status enum.\n */\nexport enum EvalStatus {\n PENDING = 'pending',\n RUNNING = 'running',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled'\n}\n\nexport const EvalStatusSchema = z.enum(EvalStatus);\n\n/**\n * LLM step type enum.\n */\nexport enum LLMStepType {\n COMPLETION = 'completion',\n TOOL_USE = 'tool_use',\n TOOL_RESULT = 'tool_result',\n THINKING = 'thinking'\n}\n\n/**\n * LLM trace step schema.\n */\nexport const LLMTraceStepSchema = z.object({\n id: z.string(),\n stepNumber: z.number(),\n type: z.enum(LLMStepType),\n model: z.string(),\n provider: z.string(),\n startedAt: z.string(),\n durationMs: z.number(),\n tokenUsage: TokenUsageSchema,\n costUsd: z.number(),\n toolName: z.string().optional(),\n toolArguments: z.string().optional(),\n inputPreview: z.string().optional(),\n outputPreview: z.string().optional(),\n success: z.boolean(),\n error: z.string().optional()\n});\n\nexport type LLMTraceStep = z.infer<typeof LLMTraceStepSchema>;\n\n/**\n * LLM breakdown stats schema.\n */\nexport const LLMBreakdownStatsSchema = z.object({\n count: z.number(),\n durationMs: z.number(),\n tokens: z.number(),\n costUsd: z.number()\n});\n\nexport type LLMBreakdownStats = z.infer<typeof LLMBreakdownStatsSchema>;\n\n/**\n * LLM trace summary schema.\n */\nexport const LLMTraceSummarySchema = z.object({\n totalSteps: z.number(),\n totalDurationMs: z.number(),\n totalTokens: TokenUsageSchema,\n totalCostUsd: z.number(),\n stepTypeBreakdown: z.record(z.string(), LLMBreakdownStatsSchema).optional(),\n modelBreakdown: z.record(z.string(), LLMBreakdownStatsSchema),\n modelsUsed: z.array(z.string())\n});\n\nexport type LLMTraceSummary = z.infer<typeof LLMTraceSummarySchema>;\n\n/**\n * LLM trace schema.\n */\nexport const LLMTraceSchema = z.object({\n id: z.string(),\n steps: z.array(LLMTraceStepSchema),\n summary: LLMTraceSummarySchema\n});\n\nexport type LLMTrace = z.infer<typeof LLMTraceSchema>;\n", "import { z } from 'zod';\nimport { TestResult } from '../test/index.js';\nimport {\n EvalMetricsSchema,\n LLMTraceSchema,\n LLMTraceStepSchema\n} from './metrics.js';\nimport { DiffContentSchema, TemplateFileSchema } from './eval-run.js';\nimport { ModelConfigSchema } from '../common/models.js';\nimport { ExpectedFileSchema } from '../scenario/test-scenario.js';\n\n/**\n * Assertion result status enum.\n * Defined locally to avoid bundling eval-assertions Node.js code in browser.\n * This is structurally identical to the one in @wix/eval-assertions.\n */\nexport enum AssertionResultStatus {\n PASSED = 'passed',\n FAILED = 'failed',\n SKIPPED = 'skipped',\n ERROR = 'error'\n}\n\n/**\n * Assertion result schema.\n */\nexport const AssertionResultSchema = z.object({\n id: z.string(),\n assertionId: z.string(),\n assertionType: z.string(),\n assertionName: z.string(),\n status: z.enum(AssertionResultStatus),\n message: z.string().optional(),\n expected: z.string().optional(),\n actual: z.string().optional(),\n duration: z.number().optional(),\n details: z.record(z.string(), z.unknown()).optional(),\n llmTraceSteps: z.array(LLMTraceStepSchema).optional()\n});\n\nexport type AssertionResult = z.infer<typeof AssertionResultSchema>;\n\n/**\n * Evaluation run result schema - result for a single scenario/target combination.\n */\nexport const EvalRunResultSchema = z.object({\n id: z.string(),\n targetId: z.string(),\n targetName: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n modelConfig: ModelConfigSchema.optional(),\n assertionResults: z.array(AssertionResultSchema),\n metrics: EvalMetricsSchema.optional(),\n passed: z.number(),\n failed: z.number(),\n passRate: z.number(),\n duration: z.number(),\n outputText: z.string().optional(),\n files: z.array(ExpectedFileSchema).optional(),\n fileDiffs: z.array(DiffContentSchema).optional(),\n /** Full template files after execution with status indicators */\n templateFiles: z.array(TemplateFileSchema).optional(),\n startedAt: z.string().optional(),\n completedAt: z.string().optional(),\n llmTrace: LLMTraceSchema.optional()\n});\n\nexport type EvalRunResult = z.infer<typeof EvalRunResultSchema>;\n\n/**\n * Prompt result schema - detailed result from prompt execution.\n */\nexport const PromptResultSchema = z.object({\n text: z.string(),\n files: z.array(z.unknown()).optional(),\n finishReason: z.string().optional(),\n reasoning: z.string().optional(),\n reasoningDetails: z.unknown().optional(),\n toolCalls: z.array(z.unknown()).optional(),\n toolResults: z.array(z.unknown()).optional(),\n warnings: z.array(z.unknown()).optional(),\n sources: z.array(z.unknown()).optional(),\n steps: z.array(z.unknown()),\n generationTimeMs: z.number(),\n prompt: z.string(),\n systemPrompt: z.string(),\n usage: z.object({\n totalTokens: z.number().optional(),\n totalMicrocentsSpent: z.number().optional()\n })\n});\n\nexport type PromptResult = z.infer<typeof PromptResultSchema>;\n\n/**\n * Full evaluation result schema - complete result for a single evaluation.\n */\nexport const EvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n promptResult: PromptResultSchema,\n testResults: z.array(z.unknown()) as z.ZodType<TestResult[]>,\n tags: z.array(z.string()).optional(),\n feedback: z.string().optional(),\n score: z.number(),\n suiteId: z.string().optional()\n});\n\nexport type EvaluationResult = z.infer<typeof EvaluationResultSchema>;\n\n/**\n * Lean evaluation result - summary for listing.\n */\nexport const LeanEvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n tags: z.array(z.string()).optional(),\n scenarioId: z.string(),\n scenarioVersion: z.number().optional(),\n targetId: z.string(),\n targetVersion: z.number().optional(),\n suiteId: z.string().optional(),\n score: z.number(),\n time: z.number().optional(),\n microcentsSpent: z.number().optional()\n});\n\nexport type LeanEvaluationResult = z.infer<typeof LeanEvaluationResultSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { EvalRunResultSchema } from './eval-result.js';\nimport {\n EvalMetricsSchema,\n EvalStatusSchema,\n LLMTraceSummarySchema\n} from './metrics.js';\nimport { LiveTraceEventSchema } from './live-trace.js';\n\n/**\n * Trigger types for evaluations.\n */\nexport enum TriggerType {\n RESOURCES_UPDATED = 'RESOURCES_UPDATED',\n MCP_VERSION_RELEASE = 'MCP_VERSION_RELEASE',\n MCP_PREVIEW_CREATED = 'MCP_PREVIEW_CREATED',\n MANUAL = 'MANUAL'\n}\n\n/**\n * Trigger metadata schema.\n */\nexport const TriggerMetadataSchema = z.object({\n version: z.string().optional(),\n resourceUpdated: z.array(z.string()).optional()\n});\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n\n/**\n * Trigger schema.\n */\nexport const TriggerSchema = z.object({\n id: z.string(),\n metadata: TriggerMetadataSchema.optional(),\n type: z.enum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\n\n/**\n * Failure category enum.\n */\nexport enum FailureCategory {\n MISSING_FILE = 'missing_file',\n WRONG_CONTENT = 'wrong_content',\n BUILD_ERROR = 'build_error',\n TEST_FAILURE = 'test_failure',\n RUNTIME_ERROR = 'runtime_error',\n PERFORMANCE = 'performance'\n}\n\n/**\n * Failure severity enum.\n */\nexport enum FailureSeverity {\n CRITICAL = 'critical',\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n/**\n * Diff line type schema.\n */\nexport const DiffLineTypeSchema = z.enum(['added', 'removed', 'unchanged']);\nexport type DiffLineType = z.infer<typeof DiffLineTypeSchema>;\n\n/**\n * Diff line schema - represents a single line in a diff.\n */\nexport const DiffLineSchema = z.object({\n type: DiffLineTypeSchema,\n content: z.string(),\n lineNumber: z.number()\n});\n\nexport type DiffLine = z.infer<typeof DiffLineSchema>;\n\n/**\n * Diff content schema - represents a file diff.\n */\nexport const DiffContentSchema = z.object({\n path: z.string(),\n expected: z.string(),\n actual: z.string(),\n diffLines: z.array(DiffLineSchema),\n renamedFrom: z.string().optional()\n});\n\nexport type DiffContent = z.infer<typeof DiffContentSchema>;\n\n/**\n * Command execution schema.\n */\nexport const CommandExecutionSchema = z.object({\n command: z.string(),\n exitCode: z.number(),\n output: z.string().optional(),\n duration: z.number()\n});\n\nexport type CommandExecution = z.infer<typeof CommandExecutionSchema>;\n\n/**\n * File modification schema.\n */\nexport const FileModificationSchema = z.object({\n path: z.string(),\n action: z.enum(['created', 'modified', 'deleted'])\n});\n\nexport type FileModification = z.infer<typeof FileModificationSchema>;\n\n/**\n * Template file status enum.\n */\nexport enum TemplateFileStatus {\n NEW = 'new',\n MODIFIED = 'modified',\n UNCHANGED = 'unchanged'\n}\n\n/**\n * Template file schema - represents a file in the template with its full content.\n */\nexport const TemplateFileSchema = z.object({\n /** Relative path within the template */\n path: z.string(),\n /** Full file content after execution */\n content: z.string(),\n /** File status (new, modified, unchanged) */\n status: z.enum(['new', 'modified', 'unchanged'])\n});\n\nexport type TemplateFile = z.infer<typeof TemplateFileSchema>;\n\n/**\n * API call schema.\n */\nexport const ApiCallSchema = z.object({\n endpoint: z.string(),\n tokensUsed: z.number(),\n duration: z.number()\n});\n\nexport type ApiCall = z.infer<typeof ApiCallSchema>;\n\n/**\n * Execution trace schema - represents detailed execution information.\n */\nexport const ExecutionTraceSchema = z.object({\n commands: z.array(CommandExecutionSchema),\n filesModified: z.array(FileModificationSchema),\n apiCalls: z.array(ApiCallSchema),\n totalDuration: z.number()\n});\n\nexport type ExecutionTrace = z.infer<typeof ExecutionTraceSchema>;\n\n/**\n * Failure analysis schema.\n */\nexport const FailureAnalysisSchema = z.object({\n category: z.enum(FailureCategory),\n severity: z.enum(FailureSeverity),\n summary: z.string(),\n details: z.string(),\n rootCause: z.string(),\n suggestedFix: z.string(),\n relatedAssertions: z.array(z.string()),\n codeSnippet: z.string().optional(),\n similarIssues: z.array(z.string()).optional(),\n patternId: z.string().optional(),\n // Extended fields for detailed debugging\n diff: DiffContentSchema.optional(),\n executionTrace: ExecutionTraceSchema.optional()\n});\n\nexport type FailureAnalysis = z.infer<typeof FailureAnalysisSchema>;\n\n/**\n * Evaluation run schema.\n *\n * Represents a complete evaluation run with configuration, results, and metrics.\n */\nexport const EvalRunSchema = TenantEntitySchema.extend({\n /** Agent ID for this run */\n agentId: z.string().optional(),\n /** Skills group ID for this run */\n skillsGroupId: z.string().optional(),\n /** Scenario IDs to run */\n scenarioIds: z.array(z.string()),\n /** Current status */\n status: EvalStatusSchema,\n /** Progress percentage (0-100) */\n progress: z.number(),\n /** Results for each scenario/target combination (lazy to break eval-result \u2194 eval-run cycle) */\n results: z.array(z.lazy(() => EvalRunResultSchema)),\n /** Aggregated metrics across all results */\n aggregateMetrics: EvalMetricsSchema,\n /** Failure analyses */\n failureAnalyses: z.array(FailureAnalysisSchema).optional(),\n /** Aggregated LLM trace summary */\n llmTraceSummary: LLMTraceSummarySchema.optional(),\n /** What triggered this run */\n trigger: TriggerSchema.optional(),\n /** When the run started (set when evaluation is triggered) */\n startedAt: z.string().optional(),\n /** When the run completed */\n completedAt: z.string().optional(),\n /** Live trace events captured during execution (for playback on results page) */\n liveTraceEvents: z.array(LiveTraceEventSchema).optional(),\n /** Remote job ID for tracking execution in Dev Machines */\n jobId: z.string().optional(),\n /** Remote job status from the Dev Machine API (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED) */\n jobStatus: z.string().optional(),\n /** Remote job error message if the job failed */\n jobError: z.string().optional(),\n /** Timestamp of the last job status check */\n jobStatusCheckedAt: z.string().optional(),\n /** MCP server IDs to enable for this run (optional) */\n mcpIds: z.array(z.string()).optional(),\n /** Sub-agent IDs to enable for this run (optional) */\n subAgentIds: z.array(z.string()).optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n */\nexport const CreateEvalRunInputSchema = EvalRunSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n status: true,\n progress: true,\n results: true,\n aggregateMetrics: true,\n startedAt: true,\n completedAt: true\n});\n\nexport type CreateEvalRunInput = z.infer<typeof CreateEvalRunInputSchema>;\n\n/**\n * Evaluation progress schema.\n */\nexport const EvaluationProgressSchema = z.object({\n runId: z.string(),\n targetId: z.string(),\n totalScenarios: z.number(),\n completedScenarios: z.number(),\n scenarioProgress: z.array(\n z.object({\n scenarioId: z.string(),\n currentStep: z.string(),\n error: z.string().optional()\n })\n ),\n createdAt: z.number()\n});\n\nexport type EvaluationProgress = z.infer<typeof EvaluationProgressSchema>;\n\n/**\n * Evaluation log schema.\n */\nexport const EvaluationLogSchema = z.object({\n runId: z.string(),\n scenarioId: z.string(),\n log: z.object({\n level: z.enum(['info', 'error', 'debug']),\n message: z.string().optional(),\n args: z.array(z.any()).optional(),\n error: z.string().optional()\n })\n});\n\nexport type EvaluationLog = z.infer<typeof EvaluationLogSchema>;\n\n/**\n * LLM timeout constant (2 minutes).\n */\nexport const LLM_TIMEOUT = 120000;\n", "import { z } from 'zod';\n\n/**\n * Live trace event type enum.\n * Maps to the step types but includes streaming states.\n */\nexport enum LiveTraceEventType {\n THINKING = 'thinking',\n TOOL_USE = 'tool_use',\n COMPLETION = 'completion',\n TOOL_RESULT = 'tool_result',\n /** Diagnostic information for debugging environment/setup issues */\n DIAGNOSTIC = 'diagnostic',\n /** Periodic progress heartbeat during long operations */\n PROGRESS = 'progress',\n /** File write operation */\n FILE_WRITE = 'file_write',\n /** File read operation */\n FILE_READ = 'file_read',\n /** System message from the SDK */\n SYSTEM = 'system',\n /** User message (tool result from file operations etc.) */\n USER = 'user'\n}\n\n/**\n * Live trace event schema.\n * Represents a single trace event emitted during agent execution.\n */\nexport const LiveTraceEventSchema = z.object({\n /** The evaluation run ID */\n evalRunId: z.string(),\n /** The scenario ID being executed */\n scenarioId: z.string(),\n /** The scenario name for display */\n scenarioName: z.string(),\n /** The target ID (skill, agent, etc.) */\n targetId: z.string(),\n /** The target name for display */\n targetName: z.string(),\n /** Step number in the current scenario execution */\n stepNumber: z.number(),\n /** Type of trace event */\n type: z.enum(LiveTraceEventType),\n /** Tool name if this is a tool_use event */\n toolName: z.string().optional(),\n /** Tool arguments preview (truncated JSON) */\n toolArgs: z.string().optional(),\n /** Output preview (truncated text) */\n outputPreview: z.string().optional(),\n /** File path for file operations */\n filePath: z.string().optional(),\n /** Elapsed time in milliseconds for progress events */\n elapsedMs: z.number().optional(),\n /** Thinking/reasoning text from Claude */\n thinking: z.string().optional(),\n /** Timestamp when this event occurred */\n timestamp: z.string(),\n /** Whether this is the final event for this scenario */\n isComplete: z.boolean()\n});\n\nexport type LiveTraceEvent = z.infer<typeof LiveTraceEventSchema>;\n\n/**\n * Prefix used in stdout to identify trace events.\n * Format: TRACE_EVENT:{json}\n */\nexport const TRACE_EVENT_PREFIX = 'TRACE_EVENT:';\n\n/**\n * Parse a line from stdout to extract a trace event if present.\n * @param line - A line from stdout\n * @returns The parsed LiveTraceEvent or null if not a trace event line\n */\nexport function parseTraceEventLine(line: string): LiveTraceEvent | null {\n if (!line.startsWith(TRACE_EVENT_PREFIX)) {\n return null;\n }\n\n try {\n const jsonStr = line.slice(TRACE_EVENT_PREFIX.length);\n const parsed = JSON.parse(jsonStr);\n const result = LiveTraceEventSchema.safeParse(parsed);\n return result.success ? result.data : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Format a trace event as a stdout line.\n * @param event - The trace event to format\n * @returns The formatted line with prefix\n */\nexport function formatTraceEventLine(event: LiveTraceEvent): string {\n return `${TRACE_EVENT_PREFIX}${JSON.stringify(event)}`;\n}\n", "import { z } from 'zod';\nimport { BaseEntitySchema } from '../common/base-entity.js';\n\n/**\n * Project schema - represents a tenant/workspace for data isolation.\n *\n * All entities belong to a project. Projects are the top-level\n * organizational unit for multi-tenancy.\n *\n * Note: Project extends BaseEntity (not TenantEntity) since\n * Project IS the tenant and doesn't need a projectId.\n */\nexport const ProjectSchema = BaseEntitySchema.extend({\n appId: z.string().optional().describe('The ID of the app in Dev Center'),\n appSecret: z\n .string()\n .optional()\n .describe('The secret of the app in Dev Center')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n */\nexport const UpdateProjectInputSchema = CreateProjectInputSchema.partial();\n\nexport type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Template schema - a project template that can be used for test environments.\n *\n * Templates are tenant-based entities scoped to a project.\n * They define how to set up a project environment for testing.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** URL to download the template from */\n downloadUrl: z.url()\n});\n\nexport type Template = z.infer<typeof TemplateSchema>;\n\n/**\n * Input schema for creating a new Template.\n */\nexport const CreateTemplateInputSchema = TemplateSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateInputSchema>;\n\n/**\n * Input schema for updating a Template.\n */\nexport const UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();\n\nexport type UpdateTemplateInput = z.infer<typeof UpdateTemplateInputSchema>;\n", "import type { AssertionParameter, AssertionType } from './assertion.js';\n\n/**\n * System assertion definition - built-in assertions available to all projects.\n * These are not stored in the database but defined in code.\n */\nexport interface SystemAssertion {\n /** Unique ID prefixed with 'system:' */\n id: string;\n /** Display name */\n name: string;\n /** Description of what the assertion checks */\n description: string;\n /** Assertion type */\n type: AssertionType;\n /** Parameters that can be configured per-scenario */\n parameters: AssertionParameter[];\n}\n\n/**\n * System assertion IDs - prefixed with 'system:' to distinguish from custom assertions.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n BUILD_PASSED: 'system:build_passed',\n LLM_JUDGE: 'system:llm_judge'\n} as const;\n\nexport type SystemAssertionId =\n (typeof SYSTEM_ASSERTION_IDS)[keyof typeof SYSTEM_ASSERTION_IDS];\n\n/**\n * Check if an assertion ID is a system assertion.\n */\nexport function isSystemAssertionId(id: string): id is SystemAssertionId {\n return id.startsWith('system:');\n}\n\n/**\n * Built-in system assertions.\n * These are available to all projects without needing to create them.\n */\nexport const SYSTEM_ASSERTIONS: Record<SystemAssertionId, SystemAssertion> = {\n [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {\n id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,\n name: 'Skill Was Called',\n description: 'Check if a specific skill was invoked during the agent run',\n type: 'skill_was_called',\n parameters: [\n {\n name: 'skillName',\n label: 'Skill Name',\n type: 'string',\n required: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.BUILD_PASSED]: {\n id: SYSTEM_ASSERTION_IDS.BUILD_PASSED,\n name: 'Build Passed',\n description: 'Run a build command and verify it exits with expected code',\n type: 'build_passed',\n parameters: [\n {\n name: 'command',\n label: 'Build Command',\n type: 'string',\n required: false,\n defaultValue: 'yarn build'\n },\n {\n name: 'expectedExitCode',\n label: 'Expected Exit Code',\n type: 'number',\n required: false,\n defaultValue: 0\n },\n {\n name: 'maxBuildTime',\n label: 'Max Build Time (ms)',\n type: 'number',\n required: false,\n advanced: true\n },\n {\n name: 'maxMemory',\n label: 'Max Memory (MB)',\n type: 'number',\n required: false,\n advanced: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.LLM_JUDGE]: {\n id: SYSTEM_ASSERTION_IDS.LLM_JUDGE,\n name: 'LLM Judge',\n description: 'LLM evaluates the output and assigns a score (0-100)',\n type: 'llm_judge',\n parameters: [\n {\n name: 'prompt',\n label: 'Judge Prompt',\n type: 'string',\n required: true,\n defaultValue: 'Verify the output meets the acceptance criteria.'\n },\n {\n name: 'systemPrompt',\n label: 'System Prompt (optional)',\n type: 'string',\n required: false,\n defaultValue:\n 'You are judging a scenario run. Use these values:\\n- {{output}}: the agent\\'s final output\\n- {{cwd}}: working directory\\n- {{changedFiles}}: list of files changed (or \"No files were changed\")\\n- {{trace}}: step-by-step trace (tool calls, completions) to check e.g. which tools were called and how many times\\n\\nJudge how well the output meets the acceptance criteria stated in the user prompt.'\n },\n {\n name: 'minScore',\n label: 'Minimum Score (0-100)',\n type: 'number',\n required: false,\n defaultValue: 70\n }\n ]\n }\n};\n\n/**\n * Get all system assertions as an array.\n */\nexport function getSystemAssertions(): SystemAssertion[] {\n return Object.values(SYSTEM_ASSERTIONS);\n}\n\n/**\n * Get a system assertion by ID.\n */\nexport function getSystemAssertion(\n id: SystemAssertionId\n): SystemAssertion | undefined {\n return SYSTEM_ASSERTIONS[id];\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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-types\n *\n * Unified types for the agent evaluation system.\n *\n * Entity Hierarchy:\n * - BaseEntity: id, name, description, dates\n * - TenantEntity: extends BaseEntity with projectId\n * - Target: extends TenantEntity (base for testable entities)\n * - Agent: CLI-based agent (runCommand, modelConfig)\n * - Skill: SKILL.md-based capability\n *\n * Test Types (9 total):\n * - LLM, TOOL, SITE_CONFIG, COMMAND_EXECUTION (from old system)\n * - FILE_PRESENCE, FILE_CONTENT, BUILD_CHECK, VITEST, PLAYWRIGHT_NL (new)\n */\n\n// Common - base schemas and utilities\nexport * from './common/index.js';\n\n// Target - testable entities\nexport * from './target/index.js';\n\n// Test - all test type definitions\nexport * from './test/index.js';\n\n// Scenario - test scenarios and environment\nexport * from './scenario/index.js';\n\n// Suite - test organization\nexport * from './suite/index.js';\n\n// Evaluation - runs, configs, and results\nexport * from './evaluation/index.js';\n\n// Project - multi-tenancy\nexport * from './project/index.js';\n\n// Template - project templates (global entities)\nexport * from './template/index.js';\n\n// Agent - adapter interface for agent implementations\nexport * from './agent/index.js';\n\n// Assertion - custom assertions stored in database\nexport * from './assertion/index.js';\n", "import { z } from 'zod';\n\n/**\n * Base entity schema with common fields for all entities.\n */\nexport const BaseEntitySchema = z.object({\n id: z.string(),\n name: z.string().min(1),\n description: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n deleted: z.boolean().optional()\n});\n\nexport type BaseEntity = z.infer<typeof BaseEntitySchema>;\n\n/**\n * Tenant entity schema - extends BaseEntity with projectId for multi-tenancy.\n */\nexport const TenantEntitySchema = BaseEntitySchema.extend({\n projectId: z.string()\n});\n\nexport type TenantEntity = z.infer<typeof TenantEntitySchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\n/**\n * Top-level key for the .mcp.json file written at run start.\n * Format: { [MCP_SERVERS_JSON_KEY]: { [mcpName]: config } }\n */\nexport const MCP_SERVERS_JSON_KEY = 'mcpServers';\n\n/**\n * MCP Entity schema - an MCP server definition stored per project.\n *\n * The `name` is used as the key in .mcp.json mcpServers object.\n * The `config` is stored as-is and written to mcp.json (command/args, url/headers, etc.).\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name and key in mcp.json mcpServers object */\n name: z.string().min(1),\n /** MCP server config (command/args, url/headers, etc.) - stored as-is for mcp.json */\n config: z.record(z.string(), z.unknown())\n});\n\nexport type MCPEntity = z.infer<typeof MCPEntitySchema>;\n\n/**\n * Input schema for creating a new MCP.\n */\nexport const CreateMcpInputSchema = MCPEntitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateMcpInput = z.infer<typeof CreateMcpInputSchema>;\n\n/**\n * Input schema for updating an MCP.\n */\nexport const UpdateMcpInputSchema = CreateMcpInputSchema.partial();\n\nexport type UpdateMcpInput = z.infer<typeof UpdateMcpInputSchema>;\n\n/**\n * MCP Server Configuration (legacy - for mcp.json config shape).\n * Config can be: { command, args }, { url, headers }, { type, command, args, env }, etc.\n */\nexport const MCPServerConfigSchema = z.record(z.string(), z.unknown());\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;\n", "import { z } from 'zod';\n\n/**\n * Anthropic Model IDs supported by the AI Gateway.\n * These values match the ClaudeModel enum from the Wix AI Gateway API.\n */\nexport enum ModelIds {\n CLAUDE_3_HAIKU_1_0 = 'CLAUDE_3_HAIKU_1_0',\n CLAUDE_3_OPUS_1_0 = 'CLAUDE_3_OPUS_1_0',\n CLAUDE_3_SONNET_1_0 = 'CLAUDE_3_SONNET_1_0',\n CLAUDE_3_5_SONNET_1_0 = 'CLAUDE_3_5_SONNET_1_0',\n CLAUDE_3_5_SONNET_2_0 = 'CLAUDE_3_5_SONNET_2_0',\n CLAUDE_3_7_SONNET_1_0 = 'CLAUDE_3_7_SONNET_1_0',\n CLAUDE_4_OPUS_1_0 = 'CLAUDE_4_OPUS_1_0',\n CLAUDE_4_SONNET_1_0 = 'CLAUDE_4_SONNET_1_0'\n}\n\nexport const ModelIdsSchema = z.enum(ModelIds);\n\n/**\n * Model configuration schema for specifying model parameters.\n */\nexport const ModelConfigSchema = z.object({\n model: ModelIdsSchema,\n temperature: z.number().min(0).max(1).optional(),\n maxTokens: z.number().min(1).optional()\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n\n/**\n * Model pricing schema (cost per 1M tokens).\n */\nexport const ModelPricingSchema = z.object({\n inputPer1M: z.number(),\n outputPer1M: z.number()\n});\n\nexport type ModelPricing = z.infer<typeof ModelPricingSchema>;\n\n/**\n * Model schema - complete model definition with metadata and pricing.\n */\nexport const ModelSchema = z.object({\n /** AI Gateway model ID */\n id: ModelIdsSchema,\n /** Display name */\n name: z.string(),\n /** Provider (always 'anthropic') */\n provider: z.literal('anthropic'),\n /** Provider's model identifier (e.g., \"claude-3-5-sonnet-20241022\") */\n providerModelId: z.string(),\n /** Pricing per 1M tokens */\n pricing: ModelPricingSchema\n});\n\nexport type Model = z.infer<typeof ModelSchema>;\n\n/**\n * Available models with full metadata including pricing.\n */\nexport const AVAILABLE_MODELS: Model[] = [\n {\n id: ModelIds.CLAUDE_4_SONNET_1_0,\n name: 'Claude 4 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-4-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_4_OPUS_1_0,\n name: 'Claude 4 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-4-opus',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_7_SONNET_1_0,\n name: 'Claude 3.7 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-7-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_2_0,\n name: 'Claude 3.5 Sonnet v2',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20241022',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_1_0,\n name: 'Claude 3.5 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20240620',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_OPUS_1_0,\n name: 'Claude 3 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-3-opus-20240229',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_SONNET_1_0,\n name: 'Claude 3 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-sonnet-20240229',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_HAIKU_1_0,\n name: 'Claude 3 Haiku',\n provider: 'anthropic',\n providerModelId: 'claude-3-haiku-20240307',\n pricing: { inputPer1M: 0.25, outputPer1M: 1.25 }\n }\n];\n\n/**\n * Available models as a map keyed by model ID.\n */\nexport const AVAILABLE_MODELS_MAP: Record<ModelIds, Model> = Object.fromEntries(\n AVAILABLE_MODELS.map((model) => [model.id, model])\n) as Record<ModelIds, Model>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Target schema - base for all testable entities.\n *\n * All testable entities (Agent, Skill) extend this schema.\n * This creates a unified type hierarchy for what can be evaluated.\n */\nexport const TargetSchema = TenantEntitySchema.extend({\n // Base for all testable entities\n // Specific targets add their own fields\n});\n\nexport type Target = z.infer<typeof TargetSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Agent schema - a CLI-based coding agent.\n *\n * Agents are external CLI tools that can execute coding tasks.\n * Examples: Claude Code CLI, Codex CLI, Cursor CLI.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Command to run the agent */\n runCommand: z.string(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional()\n});\n\nexport type Agent = z.infer<typeof AgentSchema>;\n\n/**\n * Input schema for creating a new Agent.\n */\nexport const CreateAgentInputSchema = AgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateAgentInput = z.infer<typeof CreateAgentInputSchema>;\n\n/**\n * Input schema for updating an Agent.\n * modelConfig can be null to explicitly clear it (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Regex for valid skill folder names (kebab-case).\n * Allows: lowercase letters, numbers, hyphens. Words separated by single hyphens.\n * Examples: my-skill, code-review, skill1\n */\nexport const SKILL_FOLDER_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * Check if a string is a valid skill folder name (kebab-case).\n * Used for validation when creating skills and when writing skills to filesystem.\n */\nexport function isValidSkillFolderName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n SKILL_FOLDER_NAME_REGEX.test(name.trim())\n );\n}\n\n/**\n * Skill metadata parsed from SKILL.md frontmatter.\n *\n * Following the agentskills.io specification:\n * - name: Skill identifier (max 64 chars, lowercase + hyphens)\n * - description: What the skill does and when to use it\n * - allowedTools: Pre-approved tools the skill may use\n * - skills: Sub-skills for composite agents\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n allowedTools: z.array(z.string()).optional(),\n skills: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * Skill version - historical snapshot of a Skill's content.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n skillId: z.string(),\n skillMd: z.string(),\n metadata: SkillMetadataSchema,\n model: ModelConfigSchema.optional(),\n systemPrompt: z.string().optional(),\n version: z.number(),\n createdAt: z.string(),\n notes: z.string().optional()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Skill schema - a coding capability defined by SKILL.md.\n *\n * Skills represent coding capabilities that can be tested.\n * Persisted shape: id, projectId, name, description, createdAt, updatedAt, deleted, skillMd.\n */\nexport const SkillSchema = TargetSchema.extend({\n /** The current SKILL.md content */\n skillMd: z.string()\n});\n\nexport type Skill = z.infer<typeof SkillSchema>;\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-skill)';\n\nconst SkillInputBaseSchema = SkillSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new Skill.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.refine(\n (data) => isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;\n\n/**\n * Input schema for updating a Skill.\n */\nexport const UpdateSkillInputSchema = SkillInputBaseSchema.partial().refine(\n (data) => data.name === undefined || isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * SkillsGroup schema - a collection of skills (replaces TargetGroup for the new model).\n *\n * Eval runs can be scoped to a skills group to run against all skills in the group.\n */\nexport const SkillsGroupSchema = TenantEntitySchema.extend({\n /** IDs of skills in this group */\n skillIds: z.array(z.string())\n});\n\nexport type SkillsGroup = z.infer<typeof SkillsGroupSchema>;\n\n/**\n * Input schema for creating a new SkillsGroup.\n */\nexport const CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateSkillsGroupInput = z.infer<\n typeof CreateSkillsGroupInputSchema\n>;\n\n/**\n * Input schema for updating a SkillsGroup.\n */\nexport const UpdateSkillsGroupInputSchema =\n CreateSkillsGroupInputSchema.partial();\n\nexport type UpdateSkillsGroupInput = z.infer<\n typeof UpdateSkillsGroupInputSchema\n>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\n\n/**\n * Sub-agent schema \u2013 a Markdown file with YAML frontmatter.\n *\n * Sub-agents are specialized AI assistants (per Claude Code docs)\n * defined in Markdown with frontmatter (name, description, tools, model, etc.).\n * The body is the system prompt.\n *\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string()\n});\n\nexport type SubAgent = z.infer<typeof SubAgentSchema>;\n\nconst SubAgentInputBaseSchema = SubAgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateSubAgentInputSchema = SubAgentInputBaseSchema;\n\nexport type CreateSubAgentInput = z.infer<typeof CreateSubAgentInputSchema>;\n\nexport const UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();\n\nexport type UpdateSubAgentInput = z.infer<typeof UpdateSubAgentInputSchema>;\n", "import { z } from 'zod';\n\n// Base exports\nexport * from './base.js';\n\n// Individual test types\nexport * from './llm.js';\nexport * from './tool.js';\nexport * from './site-config.js';\nexport * from './command-execution.js';\nexport * from './file-presence.js';\nexport * from './file-content.js';\nexport * from './build-check.js';\nexport * from './vitest.js';\nexport * from './playwright-nl.js';\n\n// Import schemas for union\nimport { LLMTestSchema, LLMTestResult } from './llm.js';\nimport { ToolTestSchema, ToolTestResult } from './tool.js';\nimport { SiteConfigTestSchema, SiteConfigTestResult } from './site-config.js';\nimport {\n CommandExecutionTestSchema,\n CommandExecutionTestResult\n} from './command-execution.js';\nimport {\n FilePresenceTestSchema,\n FilePresenceTestResult\n} from './file-presence.js';\nimport {\n FileContentTestSchema,\n FileContentTestResult\n} from './file-content.js';\nimport { BuildCheckTestSchema, BuildCheckTestResult } from './build-check.js';\nimport { VitestTestSchema, VitestTestResult } from './vitest.js';\nimport {\n PlaywrightNLTestSchema,\n PlaywrightNLTestResult\n} from './playwright-nl.js';\n\n/**\n * Unified Test schema - discriminated union of all 9 test types.\n */\nexport const TestSchema = z.discriminatedUnion('type', [\n LLMTestSchema,\n ToolTestSchema,\n SiteConfigTestSchema,\n CommandExecutionTestSchema,\n FilePresenceTestSchema,\n FileContentTestSchema,\n BuildCheckTestSchema,\n VitestTestSchema,\n PlaywrightNLTestSchema\n]);\n\nexport type Test = z.infer<typeof TestSchema>;\n\n/**\n * Union of all test result types.\n */\nexport type TestResult =\n | LLMTestResult\n | ToolTestResult\n | SiteConfigTestResult\n | CommandExecutionTestResult\n | FilePresenceTestResult\n | FileContentTestResult\n | BuildCheckTestResult\n | VitestTestResult\n | PlaywrightNLTestResult;\n", "import { z } from 'zod';\n\n/**\n * Test types - unified from old and new systems.\n */\nexport enum TestType {\n // From old system\n LLM = 'LLM',\n TOOL = 'TOOL',\n SITE_CONFIG = 'SITE_CONFIG',\n COMMAND_EXECUTION = 'COMMAND_EXECUTION',\n // From new system\n FILE_PRESENCE = 'FILE_PRESENCE',\n FILE_CONTENT = 'FILE_CONTENT',\n BUILD_CHECK = 'BUILD_CHECK',\n VITEST = 'VITEST',\n PLAYWRIGHT_NL = 'PLAYWRIGHT_NL'\n}\n\nexport const TestTypeSchema = z.enum(TestType);\n\n/**\n * Test importance levels.\n */\nexport enum TestImportance {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\nexport const TestImportanceSchema = z.enum(TestImportance);\n\n/**\n * Base test schema - common fields for all test types.\n */\nexport const BaseTestSchema = z.object({\n id: z.string(),\n type: TestTypeSchema,\n name: z.string().min(3),\n description: z.string().optional(),\n importance: TestImportanceSchema.optional()\n});\n\nexport type BaseTest = z.infer<typeof BaseTestSchema>;\n\n/**\n * Base test result interface.\n */\nexport interface BaseTestResult {\n type: TestType;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * LLM Test schema - tests that use an LLM evaluator.\n */\nexport const LLMTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.LLM),\n /** Maximum steps for the LLM to take */\n maxSteps: z.number().min(1).max(100),\n /** Prompt to send to the evaluator */\n prompt: z.string().min(1),\n /** ID of the evaluator agent to use */\n evaluatorId: z.string()\n});\n\nexport type LLMTest = z.infer<typeof LLMTestSchema>;\n\n/**\n * LLM Test result.\n */\nexport interface LLMTestResult extends BaseTestResult {\n type: TestType.LLM;\n testPrompt: string;\n testSystemPrompt?: string;\n text: string;\n scoreReasoning: string;\n score: number;\n totalMicrocentsSpent?: number;\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n totalTokens?: number;\n };\n reasoning?: string;\n reasoningDetails?: unknown;\n finishReason?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Tool Test schema - tests that verify tool usage.\n */\nexport const ToolTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.TOOL),\n /** Name of the tool that should be called */\n toolName: z.string().min(3),\n /** Expected arguments for the tool call */\n args: z.record(z.string(), z.any()),\n /** Expected content in the tool results */\n resultsContent: z.string()\n});\n\nexport type ToolTest = z.infer<typeof ToolTestSchema>;\n\n/**\n * Tool Test result.\n */\nexport interface ToolTestResult extends BaseTestResult {\n type: TestType.TOOL;\n result: boolean;\n toolUsed: boolean;\n actualArgs: Record<string, any>;\n isResultsValid: boolean;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Site Config Test schema - tests that verify site configuration via API.\n */\nexport const SiteConfigTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.SITE_CONFIG),\n /** URL to call */\n url: z.string().url(),\n /** HTTP method */\n method: z.enum(['GET', 'POST']),\n /** Request body (for POST) */\n body: z.string().optional(),\n /** Expected HTTP status code */\n expectedStatusCode: z.number().int().min(100).max(599),\n /** Expected response content */\n expectedResponse: z.string().optional(),\n /** JMESPath expression to extract from response */\n expectedResponseJMESPath: z.string().optional()\n});\n\nexport type SiteConfigTest = z.infer<typeof SiteConfigTestSchema>;\n\n/**\n * Site Config Test result.\n */\nexport interface SiteConfigTestResult extends BaseTestResult {\n type: TestType.SITE_CONFIG;\n result: boolean;\n actualStatusCode: number;\n actualResponse: unknown;\n allActualResponse: unknown;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Allowed commands for command execution tests.\n */\nexport const AllowedCommands = [\n 'yarn install --no-immutable && yarn build',\n 'npm run build',\n 'yarn typecheck'\n] as const;\n\n/**\n * Command Execution Test schema - tests that verify command execution.\n */\nexport const CommandExecutionTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.COMMAND_EXECUTION),\n /** Command to execute (must be in AllowedCommands) */\n command: z\n .string()\n .refine((value) => (AllowedCommands as readonly string[]).includes(value), {\n message: `Command must be one of: ${AllowedCommands.join(', ')}`\n }),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().default(0).optional()\n});\n\nexport type CommandExecutionTest = z.infer<typeof CommandExecutionTestSchema>;\n\n/**\n * Command Execution Test result.\n */\nexport interface CommandExecutionTestResult extends BaseTestResult {\n type: TestType.COMMAND_EXECUTION;\n stdout: string;\n stderr: string;\n exitCode: number | null;\n expectedExitCode: number;\n result: boolean;\n error?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File Presence Test schema - tests that verify file existence.\n */\nexport const FilePresenceTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_PRESENCE),\n /** Paths to check */\n paths: z.array(z.string()),\n /** Whether files should exist (true) or not exist (false) */\n shouldExist: z.boolean()\n});\n\nexport type FilePresenceTest = z.infer<typeof FilePresenceTestSchema>;\n\n/**\n * File Presence Test result.\n */\nexport interface FilePresenceTestResult extends BaseTestResult {\n type: TestType.FILE_PRESENCE;\n result: boolean;\n existingPaths: string[];\n missingPaths: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File content checks schema.\n */\nexport const FileContentCheckSchema = z.object({\n /** Strings that must be present in the file */\n contains: z.array(z.string()).optional(),\n /** Strings that must NOT be present in the file */\n notContains: z.array(z.string()).optional(),\n /** Regex pattern the content must match */\n matches: z.string().optional(),\n /** JSON path checks for structured content */\n jsonPath: z\n .array(\n z.object({\n path: z.string(),\n value: z.unknown()\n })\n )\n .optional(),\n /** Lines that should be added (for diff checking) */\n added: z.array(z.string()).optional(),\n /** Lines that should be removed (for diff checking) */\n removed: z.array(z.string()).optional()\n});\n\nexport type FileContentCheck = z.infer<typeof FileContentCheckSchema>;\n\n/**\n * File Content Test schema - tests that verify file content.\n *\n * This also covers the FILE_MODIFICATION use case from the old system\n * by supporting added/removed line checks.\n */\nexport const FileContentTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_CONTENT),\n /** Path to the file to check */\n path: z.string(),\n /** Content checks to perform */\n checks: FileContentCheckSchema\n});\n\nexport type FileContentTest = z.infer<typeof FileContentTestSchema>;\n\n/**\n * File Content Test result.\n */\nexport interface FileContentTestResult extends BaseTestResult {\n type: TestType.FILE_CONTENT;\n result: boolean;\n diff?: string;\n failedChecks?: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Build Check Test schema - tests that verify build success.\n */\nexport const BuildCheckTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.BUILD_CHECK),\n /** Build command to execute */\n command: z.string(),\n /** Whether the build should succeed */\n expectSuccess: z.boolean(),\n /** Maximum allowed warnings (optional) */\n allowedWarnings: z.number().optional(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type BuildCheckTest = z.infer<typeof BuildCheckTestSchema>;\n\n/**\n * Build Check Test result.\n */\nexport interface BuildCheckTestResult extends BaseTestResult {\n type: TestType.BUILD_CHECK;\n result: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n warningCount: number;\n duration: number;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Vitest Test schema - tests that run Vitest test files.\n */\nexport const VitestTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.VITEST),\n /** Test file content */\n testFile: z.string(),\n /** Name of the test file */\n testFileName: z.string(),\n /** Minimum pass rate required (0-100) */\n minPassRate: z.number().min(0).max(100)\n});\n\nexport type VitestTest = z.infer<typeof VitestTestSchema>;\n\n/**\n * Vitest Test result.\n */\nexport interface VitestTestResult extends BaseTestResult {\n type: TestType.VITEST;\n result: boolean;\n passRate: number;\n passed: number;\n failed: number;\n skipped: number;\n total: number;\n duration: number;\n output: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Playwright Natural Language Test schema - tests using natural language descriptions.\n */\nexport const PlaywrightNLTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.PLAYWRIGHT_NL),\n /** Natural language steps to execute */\n steps: z.array(z.string()),\n /** Expected outcome description */\n expectedOutcome: z.string(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type PlaywrightNLTest = z.infer<typeof PlaywrightNLTestSchema>;\n\n/**\n * Playwright NL Test result.\n */\nexport interface PlaywrightNLTestResult extends BaseTestResult {\n type: TestType.PLAYWRIGHT_NL;\n result: boolean;\n stepsExecuted: number;\n totalSteps: number;\n failedStep?: string;\n screenshot?: string;\n duration: number;\n}\n", "import { z } from 'zod';\n\n/**\n * Assertion: the agent must have invoked one or more skills during the run.\n * Checked by inspecting the LLM trace for \"Skill\" tool uses with the given skills.\n * When multiple skills are in one assertion, they are treated as a group (1 assertion).\n * Each skill in the group must have been called for the assertion to pass.\n * To check skills independently, add them as separate assertions.\n */\nexport const SkillWasCalledAssertionSchema = z.object({\n type: z.literal('skill_was_called'),\n /** Names of the skills that must have been called (matched against trace Skill tool args) */\n skillNames: z.array(z.string()).min(1)\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\n/**\n * Assertion: a build command must exit with the expected code (default 0).\n * Runs the command in the scenario working directory.\n */\nexport const BuildPassedAssertionSchema = z.object({\n type: z.literal('build_passed'),\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\n/**\n * Assertion: an LLM judges the scenario output (score 0-100).\n * Prompt can use {{output}}, {{cwd}}, {{changedFiles}}, {{trace}}.\n * Passes if judge score >= minScore.\n */\nexport const LlmJudgeAssertionSchema = z.object({\n type: z.literal('llm_judge'),\n /** Prompt template; placeholders: {{output}}, {{cwd}}, {{changedFiles}}, {{trace}} */\n prompt: z.string(),\n /** Optional system prompt for the judge (default asks for JSON with score) */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku) */\n model: z.string().optional(),\n maxTokens: z.number().int().optional(),\n temperature: z.number().min(0).max(1).optional()\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\n/**\n * Union of all assertion types (per scenario).\n * Each assertion has a type and type-specific data.\n * Uses z.union (not z.discriminatedUnion) for Zod v4 compatibility when used as array element.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n BuildPassedAssertionSchema,\n LlmJudgeAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\n", "import { z } from 'zod';\n\n/**\n * Local project configuration schema.\n */\nexport const LocalProjectConfigSchema = z.object({\n /** Template ID to use for the local project */\n templateId: z.string().optional(),\n /** Files to create in the project */\n files: z\n .array(\n z.object({\n path: z.string().min(1),\n content: z.string().min(1)\n })\n )\n .optional()\n});\n\nexport type LocalProjectConfig = z.infer<typeof LocalProjectConfigSchema>;\n\n/**\n * Meta site configuration schema for API-based setup.\n */\nexport const MetaSiteConfigSchema = z.object({\n configurations: z\n .array(\n z.object({\n name: z.string().min(1),\n apiCalls: z.array(\n z.object({\n url: z.string().url(),\n method: z.enum(['POST', 'PUT']),\n body: z.string()\n })\n )\n })\n )\n .optional()\n});\n\nexport type MetaSiteConfig = z.infer<typeof MetaSiteConfigSchema>;\n\n/**\n * Environment configuration schema.\n *\n * Defines the environment setup required for running a test scenario.\n * Migrated from the old Prompt schema.\n */\nexport const EnvironmentSchema = z.object({\n /** Local project configuration */\n localProject: LocalProjectConfigSchema.optional(),\n /** Meta site configuration */\n metaSite: MetaSiteConfigSchema.optional()\n});\n\nexport type Environment = z.infer<typeof EnvironmentSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { AssertionSchema } from './assertions.js';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\n\n/**\n * Expected file schema - a file the agent is expected to create or modify.\n * Used by eval results; not persisted on test_scenarios table.\n */\nexport const ExpectedFileSchema = z.object({\n /** Relative path where the file should be created */\n path: z.string(),\n /** Optional expected content */\n content: z.string().optional()\n});\n\nexport type ExpectedFile = z.infer<typeof ExpectedFileSchema>;\n\n/**\n * TestScenario schema - defines a single test scenario.\n *\n * Persisted shape matches test_scenarios table:\n * id, project_id, name, description, trigger_prompt, template_id, created_at, updated_at, deleted.\n * Linked assertions stored in scenario_assertions junction table.\n */\nexport const TestScenarioSchema = TenantEntitySchema.extend({\n /** The prompt sent to the agent to trigger the task */\n triggerPrompt: z.string().min(10),\n /** ID of the template to use for this scenario (null = no template) */\n templateId: z.string().nullish(),\n /** Inline assertions to evaluate for this scenario (legacy) */\n assertions: z.array(AssertionSchema).optional(),\n /** IDs of saved assertions to evaluate (from assertions table) - legacy, use assertionLinks */\n assertionIds: z.array(z.string()).optional(),\n /** Linked assertions with per-scenario parameter values */\n assertionLinks: z.array(ScenarioAssertionLinkSchema).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestScenarioInput = z.infer<\n typeof CreateTestScenarioInputSchema\n>;\n\n/**\n * Input schema for updating a TestScenario.\n */\nexport const UpdateTestScenarioInputSchema =\n CreateTestScenarioInputSchema.partial();\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, user-created)\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'build_passed',\n 'llm_judge'\n]);\n\n/**\n * Parameter types supported in assertion parameters.\n */\nexport const AssertionParameterTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean'\n]);\n\nexport type AssertionParameterType = z.infer<\n typeof AssertionParameterTypeSchema\n>;\n\n/**\n * Schema for defining assertion parameters.\n * Parameters can be required or optional, with optional default values.\n */\nexport const AssertionParameterSchema = z.object({\n /** Parameter name (used as key in params object) */\n name: z.string().min(1),\n /** Display label for the parameter */\n label: z.string().min(1),\n /** Parameter type */\n type: AssertionParameterTypeSchema,\n /** Whether this parameter is required */\n required: z.boolean(),\n /** Default value (optional, used when not provided) */\n defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),\n /** If true, parameter is hidden by default behind \"Show advanced options\" */\n advanced: z.boolean().optional()\n});\n\nexport type AssertionParameter = z.infer<typeof AssertionParameterSchema>;\n\n/**\n * Schema for scenario-assertion link with parameter values.\n * Used when linking assertions to scenarios with specific parameter values.\n */\nexport const ScenarioAssertionLinkSchema = z.object({\n /** ID of the assertion (can be system assertion like 'system:skill_was_called' or custom assertion UUID) */\n assertionId: z.string(),\n /** Parameter values for this assertion in this scenario */\n params: z\n .record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.null()])\n )\n .optional()\n});\n\nexport type ScenarioAssertionLink = z.infer<typeof ScenarioAssertionLinkSchema>;\n\nexport type AssertionType = z.infer<typeof AssertionTypeSchema>;\n\n/**\n * Configuration for skill_was_called assertion type.\n * Multiple skills in one assertion are treated as a group (1 assertion).\n * All skills in the group must have been called for the assertion to pass.\n */\nexport const SkillWasCalledConfigSchema = z.object({\n /** Names of the skills that must have been called */\n skillNames: z.array(z.string().min(1)).min(1)\n});\n\nexport type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;\n\n/**\n * Configuration for build_passed assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching LlmJudge configs).\n */\nexport const BuildPassedConfigSchema = z.strictObject({\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedConfig = z.infer<typeof BuildPassedConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\n * User-created assertions with customizable parameters.\n */\nexport const LlmJudgeConfigSchema = z.object({\n /**\n * Prompt template with placeholders:\n * - {{output}}: agent's final output\n * - {{cwd}}: working directory\n * - {{changedFiles}}: all files changed (new, modified)\n * - {{modifiedFiles}}: only existing files that were modified\n * - {{newFiles}}: only new files that were created\n * - {{trace}}: step-by-step trace of tool calls\n * - Custom parameters defined in the parameters array\n */\n prompt: z.string().min(1),\n /** Optional system prompt for the judge */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku-20241022) */\n model: z.string().optional(),\n /** Max output tokens */\n maxTokens: z.number().int().optional(),\n /** Temperature (0-1) */\n temperature: z.number().min(0).max(1).optional(),\n /** User-defined parameters for this assertion */\n parameters: z.array(AssertionParameterSchema).optional()\n});\n\nexport type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;\n\n/**\n * Union of all assertion config types.\n * Order matters: schemas with required fields first, then optional-only schemas.\n * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillNames)\n * are matched before BuildPassed (all optional) or empty object.\n */\nexport const AssertionConfigSchema = z.union([\n LlmJudgeConfigSchema, // requires prompt - check first\n SkillWasCalledConfigSchema, // requires skillName\n BuildPassedConfigSchema, // all optional, uses strictObject to reject unknown keys\n z.object({}) // fallback empty config\n]);\n\nexport type AssertionConfig = z.infer<typeof AssertionConfigSchema>;\n\n/**\n * Custom Assertion entity - stored in the database.\n * Replaces inline assertions in test scenarios.\n */\nexport const CustomAssertionSchema = TenantEntitySchema.extend({\n /** The assertion type */\n type: AssertionTypeSchema,\n /** Type-specific configuration */\n config: AssertionConfigSchema\n});\n\nexport type CustomAssertion = z.infer<typeof CustomAssertionSchema>;\n\n/**\n * Input schema for creating a new CustomAssertion.\n */\nexport const CreateCustomAssertionInputSchema = CustomAssertionSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateCustomAssertionInput = z.infer<\n typeof CreateCustomAssertionInputSchema\n>;\n\n/**\n * Input schema for updating a CustomAssertion.\n */\nexport const UpdateCustomAssertionInputSchema =\n CreateCustomAssertionInputSchema.partial();\n\nexport type UpdateCustomAssertionInput = z.infer<\n typeof UpdateCustomAssertionInputSchema\n>;\n\n/**\n * Helper function to validate config based on assertion type.\n * Returns true if config is valid for the given type.\n */\nexport function validateAssertionConfig(\n type: AssertionType,\n config: unknown\n): boolean {\n switch (type) {\n case 'skill_was_called':\n return SkillWasCalledConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n\n/**\n * Get typed config for skill_was_called assertion.\n */\nexport function getSkillWasCalledConfig(\n assertion: CustomAssertion\n): SkillWasCalledConfig | null {\n if (assertion.type !== 'skill_was_called') return null;\n const result = SkillWasCalledConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for build_passed assertion.\n */\nexport function getBuildPassedConfig(\n assertion: CustomAssertion\n): BuildPassedConfig | null {\n if (assertion.type !== 'build_passed') return null;\n const result = BuildPassedConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for llm_judge assertion.\n */\nexport function getLlmJudgeConfig(\n assertion: CustomAssertion\n): LlmJudgeConfig | null {\n if (assertion.type !== 'llm_judge') return null;\n const result = LlmJudgeConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * TestSuite schema - a collection of test scenarios.\n *\n * Suites are used to organize and group related test scenarios.\n */\nexport const TestSuiteSchema = TenantEntitySchema.extend({\n /** IDs of test scenarios in this suite */\n scenarioIds: z.array(z.string())\n});\n\nexport type TestSuite = z.infer<typeof TestSuiteSchema>;\n\n/**\n * Input schema for creating a new TestSuite.\n */\nexport const CreateTestSuiteInputSchema = TestSuiteSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestSuiteInput = z.infer<typeof CreateTestSuiteInputSchema>;\n\n/**\n * Input schema for updating a TestSuite.\n */\nexport const UpdateTestSuiteInputSchema = CreateTestSuiteInputSchema.partial();\n\nexport type UpdateTestSuiteInput = z.infer<typeof UpdateTestSuiteInputSchema>;\n", "import { z } from 'zod';\n\n/**\n * Token usage schema.\n */\nexport const TokenUsageSchema = z.object({\n prompt: z.number(),\n completion: z.number(),\n total: z.number()\n});\n\nexport type TokenUsage = z.infer<typeof TokenUsageSchema>;\n\n/**\n * Evaluation metrics schema.\n */\nexport const EvalMetricsSchema = z.object({\n totalAssertions: z.number(),\n passed: z.number(),\n failed: z.number(),\n skipped: z.number(),\n errors: z.number(),\n passRate: z.number(),\n avgDuration: z.number(),\n totalDuration: z.number()\n});\n\nexport type EvalMetrics = z.infer<typeof EvalMetricsSchema>;\n\n/**\n * Evaluation status enum.\n */\nexport enum EvalStatus {\n PENDING = 'pending',\n RUNNING = 'running',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled'\n}\n\nexport const EvalStatusSchema = z.enum(EvalStatus);\n\n/**\n * LLM step type enum.\n */\nexport enum LLMStepType {\n COMPLETION = 'completion',\n TOOL_USE = 'tool_use',\n TOOL_RESULT = 'tool_result',\n THINKING = 'thinking'\n}\n\n/**\n * LLM trace step schema.\n */\nexport const LLMTraceStepSchema = z.object({\n id: z.string(),\n stepNumber: z.number(),\n type: z.enum(LLMStepType),\n model: z.string(),\n provider: z.string(),\n startedAt: z.string(),\n durationMs: z.number(),\n tokenUsage: TokenUsageSchema,\n costUsd: z.number(),\n toolName: z.string().optional(),\n toolArguments: z.string().optional(),\n inputPreview: z.string().optional(),\n outputPreview: z.string().optional(),\n success: z.boolean(),\n error: z.string().optional()\n});\n\nexport type LLMTraceStep = z.infer<typeof LLMTraceStepSchema>;\n\n/**\n * LLM breakdown stats schema.\n */\nexport const LLMBreakdownStatsSchema = z.object({\n count: z.number(),\n durationMs: z.number(),\n tokens: z.number(),\n costUsd: z.number()\n});\n\nexport type LLMBreakdownStats = z.infer<typeof LLMBreakdownStatsSchema>;\n\n/**\n * LLM trace summary schema.\n */\nexport const LLMTraceSummarySchema = z.object({\n totalSteps: z.number(),\n totalDurationMs: z.number(),\n totalTokens: TokenUsageSchema,\n totalCostUsd: z.number(),\n stepTypeBreakdown: z.record(z.string(), LLMBreakdownStatsSchema).optional(),\n modelBreakdown: z.record(z.string(), LLMBreakdownStatsSchema),\n modelsUsed: z.array(z.string())\n});\n\nexport type LLMTraceSummary = z.infer<typeof LLMTraceSummarySchema>;\n\n/**\n * LLM trace schema.\n */\nexport const LLMTraceSchema = z.object({\n id: z.string(),\n steps: z.array(LLMTraceStepSchema),\n summary: LLMTraceSummarySchema\n});\n\nexport type LLMTrace = z.infer<typeof LLMTraceSchema>;\n", "import { z } from 'zod';\nimport { TestResult } from '../test/index.js';\nimport {\n EvalMetricsSchema,\n LLMTraceSchema,\n LLMTraceStepSchema\n} from './metrics.js';\nimport { DiffContentSchema, TemplateFileSchema } from './eval-run.js';\nimport { ModelConfigSchema } from '../common/models.js';\nimport { ExpectedFileSchema } from '../scenario/test-scenario.js';\n\n/**\n * Assertion result status enum.\n * Defined locally to avoid bundling eval-assertions Node.js code in browser.\n * This is structurally identical to the one in @wix/eval-assertions.\n */\nexport enum AssertionResultStatus {\n PASSED = 'passed',\n FAILED = 'failed',\n SKIPPED = 'skipped',\n ERROR = 'error'\n}\n\n/**\n * Assertion result schema.\n */\nexport const AssertionResultSchema = z.object({\n id: z.string(),\n assertionId: z.string(),\n assertionType: z.string(),\n assertionName: z.string(),\n status: z.enum(AssertionResultStatus),\n message: z.string().optional(),\n expected: z.string().optional(),\n actual: z.string().optional(),\n duration: z.number().optional(),\n details: z.record(z.string(), z.unknown()).optional(),\n llmTraceSteps: z.array(LLMTraceStepSchema).optional()\n});\n\nexport type AssertionResult = z.infer<typeof AssertionResultSchema>;\n\n/**\n * Evaluation run result schema - result for a single scenario/target combination.\n */\nexport const EvalRunResultSchema = z.object({\n id: z.string(),\n targetId: z.string(),\n targetName: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n modelConfig: ModelConfigSchema.optional(),\n assertionResults: z.array(AssertionResultSchema),\n metrics: EvalMetricsSchema.optional(),\n passed: z.number(),\n failed: z.number(),\n passRate: z.number(),\n duration: z.number(),\n outputText: z.string().optional(),\n files: z.array(ExpectedFileSchema).optional(),\n fileDiffs: z.array(DiffContentSchema).optional(),\n /** Full template files after execution with status indicators */\n templateFiles: z.array(TemplateFileSchema).optional(),\n startedAt: z.string().optional(),\n completedAt: z.string().optional(),\n llmTrace: LLMTraceSchema.optional()\n});\n\nexport type EvalRunResult = z.infer<typeof EvalRunResultSchema>;\n\n/**\n * Prompt result schema - detailed result from prompt execution.\n */\nexport const PromptResultSchema = z.object({\n text: z.string(),\n files: z.array(z.unknown()).optional(),\n finishReason: z.string().optional(),\n reasoning: z.string().optional(),\n reasoningDetails: z.unknown().optional(),\n toolCalls: z.array(z.unknown()).optional(),\n toolResults: z.array(z.unknown()).optional(),\n warnings: z.array(z.unknown()).optional(),\n sources: z.array(z.unknown()).optional(),\n steps: z.array(z.unknown()),\n generationTimeMs: z.number(),\n prompt: z.string(),\n systemPrompt: z.string(),\n usage: z.object({\n totalTokens: z.number().optional(),\n totalMicrocentsSpent: z.number().optional()\n })\n});\n\nexport type PromptResult = z.infer<typeof PromptResultSchema>;\n\n/**\n * Full evaluation result schema - complete result for a single evaluation.\n */\nexport const EvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n promptResult: PromptResultSchema,\n testResults: z.array(z.unknown()) as z.ZodType<TestResult[]>,\n tags: z.array(z.string()).optional(),\n feedback: z.string().optional(),\n score: z.number(),\n suiteId: z.string().optional()\n});\n\nexport type EvaluationResult = z.infer<typeof EvaluationResultSchema>;\n\n/**\n * Lean evaluation result - summary for listing.\n */\nexport const LeanEvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n tags: z.array(z.string()).optional(),\n scenarioId: z.string(),\n scenarioVersion: z.number().optional(),\n targetId: z.string(),\n targetVersion: z.number().optional(),\n suiteId: z.string().optional(),\n score: z.number(),\n time: z.number().optional(),\n microcentsSpent: z.number().optional()\n});\n\nexport type LeanEvaluationResult = z.infer<typeof LeanEvaluationResultSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { EvalRunResultSchema } from './eval-result.js';\nimport {\n EvalMetricsSchema,\n EvalStatusSchema,\n LLMTraceSummarySchema\n} from './metrics.js';\nimport { LiveTraceEventSchema } from './live-trace.js';\n\n/**\n * Trigger types for evaluations.\n */\nexport enum TriggerType {\n RESOURCES_UPDATED = 'RESOURCES_UPDATED',\n MCP_VERSION_RELEASE = 'MCP_VERSION_RELEASE',\n MCP_PREVIEW_CREATED = 'MCP_PREVIEW_CREATED',\n MANUAL = 'MANUAL'\n}\n\n/**\n * Trigger metadata schema.\n */\nexport const TriggerMetadataSchema = z.object({\n version: z.string().optional(),\n resourceUpdated: z.array(z.string()).optional()\n});\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n\n/**\n * Trigger schema.\n */\nexport const TriggerSchema = z.object({\n id: z.string(),\n metadata: TriggerMetadataSchema.optional(),\n type: z.enum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\n\n/**\n * Failure category enum.\n */\nexport enum FailureCategory {\n MISSING_FILE = 'missing_file',\n WRONG_CONTENT = 'wrong_content',\n BUILD_ERROR = 'build_error',\n TEST_FAILURE = 'test_failure',\n RUNTIME_ERROR = 'runtime_error',\n PERFORMANCE = 'performance'\n}\n\n/**\n * Failure severity enum.\n */\nexport enum FailureSeverity {\n CRITICAL = 'critical',\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n/**\n * Diff line type schema.\n */\nexport const DiffLineTypeSchema = z.enum(['added', 'removed', 'unchanged']);\nexport type DiffLineType = z.infer<typeof DiffLineTypeSchema>;\n\n/**\n * Diff line schema - represents a single line in a diff.\n */\nexport const DiffLineSchema = z.object({\n type: DiffLineTypeSchema,\n content: z.string(),\n lineNumber: z.number()\n});\n\nexport type DiffLine = z.infer<typeof DiffLineSchema>;\n\n/**\n * Diff content schema - represents a file diff.\n */\nexport const DiffContentSchema = z.object({\n path: z.string(),\n expected: z.string(),\n actual: z.string(),\n diffLines: z.array(DiffLineSchema),\n renamedFrom: z.string().optional()\n});\n\nexport type DiffContent = z.infer<typeof DiffContentSchema>;\n\n/**\n * Command execution schema.\n */\nexport const CommandExecutionSchema = z.object({\n command: z.string(),\n exitCode: z.number(),\n output: z.string().optional(),\n duration: z.number()\n});\n\nexport type CommandExecution = z.infer<typeof CommandExecutionSchema>;\n\n/**\n * File modification schema.\n */\nexport const FileModificationSchema = z.object({\n path: z.string(),\n action: z.enum(['created', 'modified', 'deleted'])\n});\n\nexport type FileModification = z.infer<typeof FileModificationSchema>;\n\n/**\n * Template file status enum.\n */\nexport enum TemplateFileStatus {\n NEW = 'new',\n MODIFIED = 'modified',\n UNCHANGED = 'unchanged'\n}\n\n/**\n * Template file schema - represents a file in the template with its full content.\n */\nexport const TemplateFileSchema = z.object({\n /** Relative path within the template */\n path: z.string(),\n /** Full file content after execution */\n content: z.string(),\n /** File status (new, modified, unchanged) */\n status: z.enum(['new', 'modified', 'unchanged'])\n});\n\nexport type TemplateFile = z.infer<typeof TemplateFileSchema>;\n\n/**\n * API call schema.\n */\nexport const ApiCallSchema = z.object({\n endpoint: z.string(),\n tokensUsed: z.number(),\n duration: z.number()\n});\n\nexport type ApiCall = z.infer<typeof ApiCallSchema>;\n\n/**\n * Execution trace schema - represents detailed execution information.\n */\nexport const ExecutionTraceSchema = z.object({\n commands: z.array(CommandExecutionSchema),\n filesModified: z.array(FileModificationSchema),\n apiCalls: z.array(ApiCallSchema),\n totalDuration: z.number()\n});\n\nexport type ExecutionTrace = z.infer<typeof ExecutionTraceSchema>;\n\n/**\n * Failure analysis schema.\n */\nexport const FailureAnalysisSchema = z.object({\n category: z.enum(FailureCategory),\n severity: z.enum(FailureSeverity),\n summary: z.string(),\n details: z.string(),\n rootCause: z.string(),\n suggestedFix: z.string(),\n relatedAssertions: z.array(z.string()),\n codeSnippet: z.string().optional(),\n similarIssues: z.array(z.string()).optional(),\n patternId: z.string().optional(),\n // Extended fields for detailed debugging\n diff: DiffContentSchema.optional(),\n executionTrace: ExecutionTraceSchema.optional()\n});\n\nexport type FailureAnalysis = z.infer<typeof FailureAnalysisSchema>;\n\n/**\n * Evaluation run schema.\n *\n * Represents a complete evaluation run with configuration, results, and metrics.\n */\nexport const EvalRunSchema = TenantEntitySchema.extend({\n /** Agent ID for this run */\n agentId: z.string().optional(),\n /** Skills group ID for this run */\n skillsGroupId: z.string().optional(),\n /** Scenario IDs to run */\n scenarioIds: z.array(z.string()),\n /** Current status */\n status: EvalStatusSchema,\n /** Progress percentage (0-100) */\n progress: z.number(),\n /** Results for each scenario/target combination (lazy to break eval-result \u2194 eval-run cycle) */\n results: z.array(z.lazy(() => EvalRunResultSchema)),\n /** Aggregated metrics across all results */\n aggregateMetrics: EvalMetricsSchema,\n /** Failure analyses */\n failureAnalyses: z.array(FailureAnalysisSchema).optional(),\n /** Aggregated LLM trace summary */\n llmTraceSummary: LLMTraceSummarySchema.optional(),\n /** What triggered this run */\n trigger: TriggerSchema.optional(),\n /** When the run started (set when evaluation is triggered) */\n startedAt: z.string().optional(),\n /** When the run completed */\n completedAt: z.string().optional(),\n /** Live trace events captured during execution (for playback on results page) */\n liveTraceEvents: z.array(LiveTraceEventSchema).optional(),\n /** Remote job ID for tracking execution in Dev Machines */\n jobId: z.string().optional(),\n /** Remote job status from the Dev Machine API (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED) */\n jobStatus: z.string().optional(),\n /** Remote job error message if the job failed */\n jobError: z.string().optional(),\n /** Timestamp of the last job status check */\n jobStatusCheckedAt: z.string().optional(),\n /** MCP server IDs to enable for this run (optional) */\n mcpIds: z.array(z.string()).optional(),\n /** Sub-agent IDs to enable for this run (optional) */\n subAgentIds: z.array(z.string()).optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n */\nexport const CreateEvalRunInputSchema = EvalRunSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n status: true,\n progress: true,\n results: true,\n aggregateMetrics: true,\n startedAt: true,\n completedAt: true\n});\n\nexport type CreateEvalRunInput = z.infer<typeof CreateEvalRunInputSchema>;\n\n/**\n * Evaluation progress schema.\n */\nexport const EvaluationProgressSchema = z.object({\n runId: z.string(),\n targetId: z.string(),\n totalScenarios: z.number(),\n completedScenarios: z.number(),\n scenarioProgress: z.array(\n z.object({\n scenarioId: z.string(),\n currentStep: z.string(),\n error: z.string().optional()\n })\n ),\n createdAt: z.number()\n});\n\nexport type EvaluationProgress = z.infer<typeof EvaluationProgressSchema>;\n\n/**\n * Evaluation log schema.\n */\nexport const EvaluationLogSchema = z.object({\n runId: z.string(),\n scenarioId: z.string(),\n log: z.object({\n level: z.enum(['info', 'error', 'debug']),\n message: z.string().optional(),\n args: z.array(z.any()).optional(),\n error: z.string().optional()\n })\n});\n\nexport type EvaluationLog = z.infer<typeof EvaluationLogSchema>;\n\n/**\n * LLM timeout constant (2 minutes).\n */\nexport const LLM_TIMEOUT = 120000;\n", "import { z } from 'zod';\n\n/**\n * Live trace event type enum.\n * Maps to the step types but includes streaming states.\n */\nexport enum LiveTraceEventType {\n THINKING = 'thinking',\n TOOL_USE = 'tool_use',\n COMPLETION = 'completion',\n TOOL_RESULT = 'tool_result',\n /** Diagnostic information for debugging environment/setup issues */\n DIAGNOSTIC = 'diagnostic',\n /** Periodic progress heartbeat during long operations */\n PROGRESS = 'progress',\n /** File write operation */\n FILE_WRITE = 'file_write',\n /** File read operation */\n FILE_READ = 'file_read',\n /** System message from the SDK */\n SYSTEM = 'system',\n /** User message (tool result from file operations etc.) */\n USER = 'user'\n}\n\n/**\n * Live trace event schema.\n * Represents a single trace event emitted during agent execution.\n */\nexport const LiveTraceEventSchema = z.object({\n /** The evaluation run ID */\n evalRunId: z.string(),\n /** The scenario ID being executed */\n scenarioId: z.string(),\n /** The scenario name for display */\n scenarioName: z.string(),\n /** The target ID (skill, agent, etc.) */\n targetId: z.string(),\n /** The target name for display */\n targetName: z.string(),\n /** Step number in the current scenario execution */\n stepNumber: z.number(),\n /** Type of trace event */\n type: z.enum(LiveTraceEventType),\n /** Tool name if this is a tool_use event */\n toolName: z.string().optional(),\n /** Tool arguments preview (truncated JSON) */\n toolArgs: z.string().optional(),\n /** Output preview (truncated text) */\n outputPreview: z.string().optional(),\n /** File path for file operations */\n filePath: z.string().optional(),\n /** Elapsed time in milliseconds for progress events */\n elapsedMs: z.number().optional(),\n /** Thinking/reasoning text from Claude */\n thinking: z.string().optional(),\n /** Timestamp when this event occurred */\n timestamp: z.string(),\n /** Whether this is the final event for this scenario */\n isComplete: z.boolean()\n});\n\nexport type LiveTraceEvent = z.infer<typeof LiveTraceEventSchema>;\n\n/**\n * Prefix used in stdout to identify trace events.\n * Format: TRACE_EVENT:{json}\n */\nexport const TRACE_EVENT_PREFIX = 'TRACE_EVENT:';\n\n/**\n * Parse a line from stdout to extract a trace event if present.\n * @param line - A line from stdout\n * @returns The parsed LiveTraceEvent or null if not a trace event line\n */\nexport function parseTraceEventLine(line: string): LiveTraceEvent | null {\n if (!line.startsWith(TRACE_EVENT_PREFIX)) {\n return null;\n }\n\n try {\n const jsonStr = line.slice(TRACE_EVENT_PREFIX.length);\n const parsed = JSON.parse(jsonStr);\n const result = LiveTraceEventSchema.safeParse(parsed);\n return result.success ? result.data : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Format a trace event as a stdout line.\n * @param event - The trace event to format\n * @returns The formatted line with prefix\n */\nexport function formatTraceEventLine(event: LiveTraceEvent): string {\n return `${TRACE_EVENT_PREFIX}${JSON.stringify(event)}`;\n}\n", "import { z } from 'zod';\nimport { BaseEntitySchema } from '../common/base-entity.js';\n\n/**\n * Project schema - represents a tenant/workspace for data isolation.\n *\n * All entities belong to a project. Projects are the top-level\n * organizational unit for multi-tenancy.\n *\n * Note: Project extends BaseEntity (not TenantEntity) since\n * Project IS the tenant and doesn't need a projectId.\n */\nexport const ProjectSchema = BaseEntitySchema.extend({\n appId: z.string().optional().describe('The ID of the app in Dev Center'),\n appSecret: z\n .string()\n .optional()\n .describe('The secret of the app in Dev Center')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n */\nexport const UpdateProjectInputSchema = CreateProjectInputSchema.partial();\n\nexport type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Template schema - a project template that can be used for test environments.\n *\n * Templates are tenant-based entities scoped to a project.\n * They define how to set up a project environment for testing.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** URL to download the template from */\n downloadUrl: z.url()\n});\n\nexport type Template = z.infer<typeof TemplateSchema>;\n\n/**\n * Input schema for creating a new Template.\n */\nexport const CreateTemplateInputSchema = TemplateSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateInputSchema>;\n\n/**\n * Input schema for updating a Template.\n */\nexport const UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();\n\nexport type UpdateTemplateInput = z.infer<typeof UpdateTemplateInputSchema>;\n", "import type { AssertionParameter, AssertionType } from './assertion.js';\n\n/**\n * System assertion definition - built-in assertions available to all projects.\n * These are not stored in the database but defined in code.\n */\nexport interface SystemAssertion {\n /** Unique ID prefixed with 'system:' */\n id: string;\n /** Display name */\n name: string;\n /** Description of what the assertion checks */\n description: string;\n /** Assertion type */\n type: AssertionType;\n /** Parameters that can be configured per-scenario */\n parameters: AssertionParameter[];\n}\n\n/**\n * System assertion IDs - prefixed with 'system:' to distinguish from custom assertions.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n BUILD_PASSED: 'system:build_passed',\n LLM_JUDGE: 'system:llm_judge'\n} as const;\n\nexport type SystemAssertionId =\n (typeof SYSTEM_ASSERTION_IDS)[keyof typeof SYSTEM_ASSERTION_IDS];\n\n/**\n * Check if an assertion ID is a system assertion.\n */\nexport function isSystemAssertionId(id: string): id is SystemAssertionId {\n return id.startsWith('system:');\n}\n\n/**\n * Built-in system assertions.\n * These are available to all projects without needing to create them.\n */\nexport const SYSTEM_ASSERTIONS: Record<SystemAssertionId, SystemAssertion> = {\n [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {\n id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,\n name: 'Skill Was Called',\n description:\n 'Check that one or more skills were invoked during the agent run',\n type: 'skill_was_called',\n parameters: [\n {\n name: 'skillNames',\n label: 'Skills',\n type: 'string',\n required: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.BUILD_PASSED]: {\n id: SYSTEM_ASSERTION_IDS.BUILD_PASSED,\n name: 'Build Passed',\n description: 'Run a build command and verify it exits with expected code',\n type: 'build_passed',\n parameters: [\n {\n name: 'command',\n label: 'Build Command',\n type: 'string',\n required: false,\n defaultValue: 'yarn build'\n },\n {\n name: 'expectedExitCode',\n label: 'Expected Exit Code',\n type: 'number',\n required: false,\n defaultValue: 0\n },\n {\n name: 'maxBuildTime',\n label: 'Max Build Time (ms)',\n type: 'number',\n required: false,\n advanced: true\n },\n {\n name: 'maxMemory',\n label: 'Max Memory (MB)',\n type: 'number',\n required: false,\n advanced: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.LLM_JUDGE]: {\n id: SYSTEM_ASSERTION_IDS.LLM_JUDGE,\n name: 'LLM Judge',\n description: 'LLM evaluates the output and assigns a score (0-100)',\n type: 'llm_judge',\n parameters: [\n {\n name: 'prompt',\n label: 'Judge Prompt',\n type: 'string',\n required: true,\n defaultValue: 'Verify the output meets the acceptance criteria.'\n },\n {\n name: 'systemPrompt',\n label: 'System Prompt (optional)',\n type: 'string',\n required: false,\n defaultValue:\n 'You are judging a scenario run. Use these values:\\n- {{output}}: the agent\\'s final output\\n- {{cwd}}: working directory\\n- {{changedFiles}}: list of files changed (or \"No files were changed\")\\n- {{trace}}: step-by-step trace (tool calls, completions) to check e.g. which tools were called and how many times\\n\\nJudge how well the output meets the acceptance criteria stated in the user prompt.'\n },\n {\n name: 'minScore',\n label: 'Minimum Score (0-100)',\n type: 'number',\n required: false,\n defaultValue: 70\n }\n ]\n }\n};\n\n/**\n * Get all system assertions as an array.\n */\nexport function getSystemAssertions(): SystemAssertion[] {\n return Object.values(SYSTEM_ASSERTIONS);\n}\n\n/**\n * Get a system assertion by ID.\n */\nexport function getSystemAssertion(\n id: SystemAssertionId\n): SystemAssertion | undefined {\n return SYSTEM_ASSERTIONS[id];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAKX,IAAM,mBAAmB,aAAE,OAAO;AAAA,EAC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AA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EACA,CAAC,qBAAqB,SAAS,GAAG;AAAA,IAChC,IAAI,qBAAqB;AAAA,IACzB,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM;AAAA,IACN,YAAY;AAAA,MACV;AAAA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,cAAc;AAAA,MAChB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,cACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACJ;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,cAAc;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AACF;AAKO,SAAS,sBAAyC;AACvD,SAAO,OAAO,OAAO,iBAAiB;AACxC;AAKO,SAAS,mBACd,IAC6B;AAC7B,SAAO,kBAAkB,EAAE;AAC7B;",
6
6
  "names": ["import_zod", "import_zod", "ModelIds", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "TestType", "TestImportance", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "import_zod", "EvalStatus", "LLMStepType", "import_zod", "import_zod", "import_zod", "LiveTraceEventType", "TriggerType", "FailureCategory", "FailureSeverity", "TemplateFileStatus", "AssertionResultStatus", "import_zod", "import_zod"]
7
7
  }
package/build/index.mjs CHANGED
@@ -410,8 +410,8 @@ var TestSchema = z18.discriminatedUnion("type", [
410
410
  import { z as z19 } from "zod";
411
411
  var SkillWasCalledAssertionSchema = z19.object({
412
412
  type: z19.literal("skill_was_called"),
413
- /** Name of the skill that must have been called (matched against trace Skill tool args) */
414
- skillName: z19.string()
413
+ /** Names of the skills that must have been called (matched against trace Skill tool args) */
414
+ skillNames: z19.array(z19.string()).min(1)
415
415
  });
416
416
  var BuildPassedAssertionSchema = z19.object({
417
417
  type: z19.literal("build_passed"),
@@ -512,8 +512,8 @@ var ScenarioAssertionLinkSchema = z21.object({
512
512
  ).optional()
513
513
  });
514
514
  var SkillWasCalledConfigSchema = z21.object({
515
- /** Name of the skill that must have been called */
516
- skillName: z21.string().min(1)
515
+ /** Names of the skills that must have been called */
516
+ skillNames: z21.array(z21.string().min(1)).min(1)
517
517
  });
518
518
  var BuildPassedConfigSchema = z21.strictObject({
519
519
  /** Command to run (default: "yarn build") */
@@ -1082,12 +1082,12 @@ var SYSTEM_ASSERTIONS = {
1082
1082
  [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {
1083
1083
  id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,
1084
1084
  name: "Skill Was Called",
1085
- description: "Check if a specific skill was invoked during the agent run",
1085
+ description: "Check that one or more skills were invoked during the agent run",
1086
1086
  type: "skill_was_called",
1087
1087
  parameters: [
1088
1088
  {
1089
- name: "skillName",
1090
- label: "Skill Name",
1089
+ name: "skillNames",
1090
+ label: "Skills",
1091
1091
  type: "string",
1092
1092
  required: true
1093
1093
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/common/base-entity.ts", "../src/common/mcp.ts", "../src/common/models.ts", "../src/target/target.ts", "../src/target/agent.ts", "../src/target/skill.ts", "../src/target/skills-group.ts", "../src/target/sub-agent.ts", "../src/test/index.ts", "../src/test/base.ts", "../src/test/llm.ts", "../src/test/tool.ts", "../src/test/site-config.ts", "../src/test/command-execution.ts", "../src/test/file-presence.ts", "../src/test/file-content.ts", "../src/test/build-check.ts", "../src/test/vitest.ts", "../src/test/playwright-nl.ts", "../src/scenario/assertions.ts", "../src/scenario/environment.ts", "../src/scenario/test-scenario.ts", "../src/assertion/assertion.ts", "../src/suite/test-suite.ts", "../src/evaluation/metrics.ts", "../src/evaluation/eval-result.ts", "../src/evaluation/eval-run.ts", "../src/evaluation/live-trace.ts", "../src/project/project.ts", "../src/template/template.ts", "../src/assertion/system-assertions.ts"],
4
- "sourcesContent": ["import { z } from 'zod';\n\n/**\n * Base entity schema with common fields for all entities.\n */\nexport const BaseEntitySchema = z.object({\n id: z.string(),\n name: z.string().min(1),\n description: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n deleted: z.boolean().optional()\n});\n\nexport type BaseEntity = z.infer<typeof BaseEntitySchema>;\n\n/**\n * Tenant entity schema - extends BaseEntity with projectId for multi-tenancy.\n */\nexport const TenantEntitySchema = BaseEntitySchema.extend({\n projectId: z.string()\n});\n\nexport type TenantEntity = z.infer<typeof TenantEntitySchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\n/**\n * Top-level key for the .mcp.json file written at run start.\n * Format: { [MCP_SERVERS_JSON_KEY]: { [mcpName]: config } }\n */\nexport const MCP_SERVERS_JSON_KEY = 'mcpServers';\n\n/**\n * MCP Entity schema - an MCP server definition stored per project.\n *\n * The `name` is used as the key in .mcp.json mcpServers object.\n * The `config` is stored as-is and written to mcp.json (command/args, url/headers, etc.).\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name and key in mcp.json mcpServers object */\n name: z.string().min(1),\n /** MCP server config (command/args, url/headers, etc.) - stored as-is for mcp.json */\n config: z.record(z.string(), z.unknown())\n});\n\nexport type MCPEntity = z.infer<typeof MCPEntitySchema>;\n\n/**\n * Input schema for creating a new MCP.\n */\nexport const CreateMcpInputSchema = MCPEntitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateMcpInput = z.infer<typeof CreateMcpInputSchema>;\n\n/**\n * Input schema for updating an MCP.\n */\nexport const UpdateMcpInputSchema = CreateMcpInputSchema.partial();\n\nexport type UpdateMcpInput = z.infer<typeof UpdateMcpInputSchema>;\n\n/**\n * MCP Server Configuration (legacy - for mcp.json config shape).\n * Config can be: { command, args }, { url, headers }, { type, command, args, env }, etc.\n */\nexport const MCPServerConfigSchema = z.record(z.string(), z.unknown());\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;\n", "import { z } from 'zod';\n\n/**\n * Anthropic Model IDs supported by the AI Gateway.\n * These values match the ClaudeModel enum from the Wix AI Gateway API.\n */\nexport enum ModelIds {\n CLAUDE_3_HAIKU_1_0 = 'CLAUDE_3_HAIKU_1_0',\n CLAUDE_3_OPUS_1_0 = 'CLAUDE_3_OPUS_1_0',\n CLAUDE_3_SONNET_1_0 = 'CLAUDE_3_SONNET_1_0',\n CLAUDE_3_5_SONNET_1_0 = 'CLAUDE_3_5_SONNET_1_0',\n CLAUDE_3_5_SONNET_2_0 = 'CLAUDE_3_5_SONNET_2_0',\n CLAUDE_3_7_SONNET_1_0 = 'CLAUDE_3_7_SONNET_1_0',\n CLAUDE_4_OPUS_1_0 = 'CLAUDE_4_OPUS_1_0',\n CLAUDE_4_SONNET_1_0 = 'CLAUDE_4_SONNET_1_0'\n}\n\nexport const ModelIdsSchema = z.enum(ModelIds);\n\n/**\n * Model configuration schema for specifying model parameters.\n */\nexport const ModelConfigSchema = z.object({\n model: ModelIdsSchema,\n temperature: z.number().min(0).max(1).optional(),\n maxTokens: z.number().min(1).optional()\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n\n/**\n * Model pricing schema (cost per 1M tokens).\n */\nexport const ModelPricingSchema = z.object({\n inputPer1M: z.number(),\n outputPer1M: z.number()\n});\n\nexport type ModelPricing = z.infer<typeof ModelPricingSchema>;\n\n/**\n * Model schema - complete model definition with metadata and pricing.\n */\nexport const ModelSchema = z.object({\n /** AI Gateway model ID */\n id: ModelIdsSchema,\n /** Display name */\n name: z.string(),\n /** Provider (always 'anthropic') */\n provider: z.literal('anthropic'),\n /** Provider's model identifier (e.g., \"claude-3-5-sonnet-20241022\") */\n providerModelId: z.string(),\n /** Pricing per 1M tokens */\n pricing: ModelPricingSchema\n});\n\nexport type Model = z.infer<typeof ModelSchema>;\n\n/**\n * Available models with full metadata including pricing.\n */\nexport const AVAILABLE_MODELS: Model[] = [\n {\n id: ModelIds.CLAUDE_4_SONNET_1_0,\n name: 'Claude 4 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-4-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_4_OPUS_1_0,\n name: 'Claude 4 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-4-opus',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_7_SONNET_1_0,\n name: 'Claude 3.7 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-7-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_2_0,\n name: 'Claude 3.5 Sonnet v2',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20241022',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_1_0,\n name: 'Claude 3.5 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20240620',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_OPUS_1_0,\n name: 'Claude 3 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-3-opus-20240229',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_SONNET_1_0,\n name: 'Claude 3 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-sonnet-20240229',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_HAIKU_1_0,\n name: 'Claude 3 Haiku',\n provider: 'anthropic',\n providerModelId: 'claude-3-haiku-20240307',\n pricing: { inputPer1M: 0.25, outputPer1M: 1.25 }\n }\n];\n\n/**\n * Available models as a map keyed by model ID.\n */\nexport const AVAILABLE_MODELS_MAP: Record<ModelIds, Model> = Object.fromEntries(\n AVAILABLE_MODELS.map((model) => [model.id, model])\n) as Record<ModelIds, Model>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Target schema - base for all testable entities.\n *\n * All testable entities (Agent, Skill) extend this schema.\n * This creates a unified type hierarchy for what can be evaluated.\n */\nexport const TargetSchema = TenantEntitySchema.extend({\n // Base for all testable entities\n // Specific targets add their own fields\n});\n\nexport type Target = z.infer<typeof TargetSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Agent schema - a CLI-based coding agent.\n *\n * Agents are external CLI tools that can execute coding tasks.\n * Examples: Claude Code CLI, Codex CLI, Cursor CLI.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Command to run the agent */\n runCommand: z.string(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional()\n});\n\nexport type Agent = z.infer<typeof AgentSchema>;\n\n/**\n * Input schema for creating a new Agent.\n */\nexport const CreateAgentInputSchema = AgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateAgentInput = z.infer<typeof CreateAgentInputSchema>;\n\n/**\n * Input schema for updating an Agent.\n * modelConfig can be null to explicitly clear it (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Regex for valid skill folder names (kebab-case).\n * Allows: lowercase letters, numbers, hyphens. Words separated by single hyphens.\n * Examples: my-skill, code-review, skill1\n */\nexport const SKILL_FOLDER_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * Check if a string is a valid skill folder name (kebab-case).\n * Used for validation when creating skills and when writing skills to filesystem.\n */\nexport function isValidSkillFolderName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n SKILL_FOLDER_NAME_REGEX.test(name.trim())\n );\n}\n\n/**\n * Skill metadata parsed from SKILL.md frontmatter.\n *\n * Following the agentskills.io specification:\n * - name: Skill identifier (max 64 chars, lowercase + hyphens)\n * - description: What the skill does and when to use it\n * - allowedTools: Pre-approved tools the skill may use\n * - skills: Sub-skills for composite agents\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n allowedTools: z.array(z.string()).optional(),\n skills: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * Skill version - historical snapshot of a Skill's content.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n skillId: z.string(),\n skillMd: z.string(),\n metadata: SkillMetadataSchema,\n model: ModelConfigSchema.optional(),\n systemPrompt: z.string().optional(),\n version: z.number(),\n createdAt: z.string(),\n notes: z.string().optional()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Skill schema - a coding capability defined by SKILL.md.\n *\n * Skills represent coding capabilities that can be tested.\n * Persisted shape: id, projectId, name, description, createdAt, updatedAt, deleted, skillMd.\n */\nexport const SkillSchema = TargetSchema.extend({\n /** The current SKILL.md content */\n skillMd: z.string()\n});\n\nexport type Skill = z.infer<typeof SkillSchema>;\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-skill)';\n\nconst SkillInputBaseSchema = SkillSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new Skill.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.refine(\n (data) => isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;\n\n/**\n * Input schema for updating a Skill.\n */\nexport const UpdateSkillInputSchema = SkillInputBaseSchema.partial().refine(\n (data) => data.name === undefined || isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * SkillsGroup schema - a collection of skills (replaces TargetGroup for the new model).\n *\n * Eval runs can be scoped to a skills group to run against all skills in the group.\n */\nexport const SkillsGroupSchema = TenantEntitySchema.extend({\n /** IDs of skills in this group */\n skillIds: z.array(z.string())\n});\n\nexport type SkillsGroup = z.infer<typeof SkillsGroupSchema>;\n\n/**\n * Input schema for creating a new SkillsGroup.\n */\nexport const CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateSkillsGroupInput = z.infer<\n typeof CreateSkillsGroupInputSchema\n>;\n\n/**\n * Input schema for updating a SkillsGroup.\n */\nexport const UpdateSkillsGroupInputSchema =\n CreateSkillsGroupInputSchema.partial();\n\nexport type UpdateSkillsGroupInput = z.infer<\n typeof UpdateSkillsGroupInputSchema\n>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\n\n/**\n * Sub-agent schema \u2013 a Markdown file with YAML frontmatter.\n *\n * Sub-agents are specialized AI assistants (per Claude Code docs)\n * defined in Markdown with frontmatter (name, description, tools, model, etc.).\n * The body is the system prompt.\n *\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string()\n});\n\nexport type SubAgent = z.infer<typeof SubAgentSchema>;\n\nconst SubAgentInputBaseSchema = SubAgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateSubAgentInputSchema = SubAgentInputBaseSchema;\n\nexport type CreateSubAgentInput = z.infer<typeof CreateSubAgentInputSchema>;\n\nexport const UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();\n\nexport type UpdateSubAgentInput = z.infer<typeof UpdateSubAgentInputSchema>;\n", "import { z } from 'zod';\n\n// Base exports\nexport * from './base.js';\n\n// Individual test types\nexport * from './llm.js';\nexport * from './tool.js';\nexport * from './site-config.js';\nexport * from './command-execution.js';\nexport * from './file-presence.js';\nexport * from './file-content.js';\nexport * from './build-check.js';\nexport * from './vitest.js';\nexport * from './playwright-nl.js';\n\n// Import schemas for union\nimport { LLMTestSchema, LLMTestResult } from './llm.js';\nimport { ToolTestSchema, ToolTestResult } from './tool.js';\nimport { SiteConfigTestSchema, SiteConfigTestResult } from './site-config.js';\nimport {\n CommandExecutionTestSchema,\n CommandExecutionTestResult\n} from './command-execution.js';\nimport {\n FilePresenceTestSchema,\n FilePresenceTestResult\n} from './file-presence.js';\nimport {\n FileContentTestSchema,\n FileContentTestResult\n} from './file-content.js';\nimport { BuildCheckTestSchema, BuildCheckTestResult } from './build-check.js';\nimport { VitestTestSchema, VitestTestResult } from './vitest.js';\nimport {\n PlaywrightNLTestSchema,\n PlaywrightNLTestResult\n} from './playwright-nl.js';\n\n/**\n * Unified Test schema - discriminated union of all 9 test types.\n */\nexport const TestSchema = z.discriminatedUnion('type', [\n LLMTestSchema,\n ToolTestSchema,\n SiteConfigTestSchema,\n CommandExecutionTestSchema,\n FilePresenceTestSchema,\n FileContentTestSchema,\n BuildCheckTestSchema,\n VitestTestSchema,\n PlaywrightNLTestSchema\n]);\n\nexport type Test = z.infer<typeof TestSchema>;\n\n/**\n * Union of all test result types.\n */\nexport type TestResult =\n | LLMTestResult\n | ToolTestResult\n | SiteConfigTestResult\n | CommandExecutionTestResult\n | FilePresenceTestResult\n | FileContentTestResult\n | BuildCheckTestResult\n | VitestTestResult\n | PlaywrightNLTestResult;\n", "import { z } from 'zod';\n\n/**\n * Test types - unified from old and new systems.\n */\nexport enum TestType {\n // From old system\n LLM = 'LLM',\n TOOL = 'TOOL',\n SITE_CONFIG = 'SITE_CONFIG',\n COMMAND_EXECUTION = 'COMMAND_EXECUTION',\n // From new system\n FILE_PRESENCE = 'FILE_PRESENCE',\n FILE_CONTENT = 'FILE_CONTENT',\n BUILD_CHECK = 'BUILD_CHECK',\n VITEST = 'VITEST',\n PLAYWRIGHT_NL = 'PLAYWRIGHT_NL'\n}\n\nexport const TestTypeSchema = z.enum(TestType);\n\n/**\n * Test importance levels.\n */\nexport enum TestImportance {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\nexport const TestImportanceSchema = z.enum(TestImportance);\n\n/**\n * Base test schema - common fields for all test types.\n */\nexport const BaseTestSchema = z.object({\n id: z.string(),\n type: TestTypeSchema,\n name: z.string().min(3),\n description: z.string().optional(),\n importance: TestImportanceSchema.optional()\n});\n\nexport type BaseTest = z.infer<typeof BaseTestSchema>;\n\n/**\n * Base test result interface.\n */\nexport interface BaseTestResult {\n type: TestType;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * LLM Test schema - tests that use an LLM evaluator.\n */\nexport const LLMTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.LLM),\n /** Maximum steps for the LLM to take */\n maxSteps: z.number().min(1).max(100),\n /** Prompt to send to the evaluator */\n prompt: z.string().min(1),\n /** ID of the evaluator agent to use */\n evaluatorId: z.string()\n});\n\nexport type LLMTest = z.infer<typeof LLMTestSchema>;\n\n/**\n * LLM Test result.\n */\nexport interface LLMTestResult extends BaseTestResult {\n type: TestType.LLM;\n testPrompt: string;\n testSystemPrompt?: string;\n text: string;\n scoreReasoning: string;\n score: number;\n totalMicrocentsSpent?: number;\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n totalTokens?: number;\n };\n reasoning?: string;\n reasoningDetails?: unknown;\n finishReason?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Tool Test schema - tests that verify tool usage.\n */\nexport const ToolTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.TOOL),\n /** Name of the tool that should be called */\n toolName: z.string().min(3),\n /** Expected arguments for the tool call */\n args: z.record(z.string(), z.any()),\n /** Expected content in the tool results */\n resultsContent: z.string()\n});\n\nexport type ToolTest = z.infer<typeof ToolTestSchema>;\n\n/**\n * Tool Test result.\n */\nexport interface ToolTestResult extends BaseTestResult {\n type: TestType.TOOL;\n result: boolean;\n toolUsed: boolean;\n actualArgs: Record<string, any>;\n isResultsValid: boolean;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Site Config Test schema - tests that verify site configuration via API.\n */\nexport const SiteConfigTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.SITE_CONFIG),\n /** URL to call */\n url: z.string().url(),\n /** HTTP method */\n method: z.enum(['GET', 'POST']),\n /** Request body (for POST) */\n body: z.string().optional(),\n /** Expected HTTP status code */\n expectedStatusCode: z.number().int().min(100).max(599),\n /** Expected response content */\n expectedResponse: z.string().optional(),\n /** JMESPath expression to extract from response */\n expectedResponseJMESPath: z.string().optional()\n});\n\nexport type SiteConfigTest = z.infer<typeof SiteConfigTestSchema>;\n\n/**\n * Site Config Test result.\n */\nexport interface SiteConfigTestResult extends BaseTestResult {\n type: TestType.SITE_CONFIG;\n result: boolean;\n actualStatusCode: number;\n actualResponse: unknown;\n allActualResponse: unknown;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Allowed commands for command execution tests.\n */\nexport const AllowedCommands = [\n 'yarn install --no-immutable && yarn build',\n 'npm run build',\n 'yarn typecheck'\n] as const;\n\n/**\n * Command Execution Test schema - tests that verify command execution.\n */\nexport const CommandExecutionTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.COMMAND_EXECUTION),\n /** Command to execute (must be in AllowedCommands) */\n command: z\n .string()\n .refine((value) => (AllowedCommands as readonly string[]).includes(value), {\n message: `Command must be one of: ${AllowedCommands.join(', ')}`\n }),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().default(0).optional()\n});\n\nexport type CommandExecutionTest = z.infer<typeof CommandExecutionTestSchema>;\n\n/**\n * Command Execution Test result.\n */\nexport interface CommandExecutionTestResult extends BaseTestResult {\n type: TestType.COMMAND_EXECUTION;\n stdout: string;\n stderr: string;\n exitCode: number | null;\n expectedExitCode: number;\n result: boolean;\n error?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File Presence Test schema - tests that verify file existence.\n */\nexport const FilePresenceTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_PRESENCE),\n /** Paths to check */\n paths: z.array(z.string()),\n /** Whether files should exist (true) or not exist (false) */\n shouldExist: z.boolean()\n});\n\nexport type FilePresenceTest = z.infer<typeof FilePresenceTestSchema>;\n\n/**\n * File Presence Test result.\n */\nexport interface FilePresenceTestResult extends BaseTestResult {\n type: TestType.FILE_PRESENCE;\n result: boolean;\n existingPaths: string[];\n missingPaths: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File content checks schema.\n */\nexport const FileContentCheckSchema = z.object({\n /** Strings that must be present in the file */\n contains: z.array(z.string()).optional(),\n /** Strings that must NOT be present in the file */\n notContains: z.array(z.string()).optional(),\n /** Regex pattern the content must match */\n matches: z.string().optional(),\n /** JSON path checks for structured content */\n jsonPath: z\n .array(\n z.object({\n path: z.string(),\n value: z.unknown()\n })\n )\n .optional(),\n /** Lines that should be added (for diff checking) */\n added: z.array(z.string()).optional(),\n /** Lines that should be removed (for diff checking) */\n removed: z.array(z.string()).optional()\n});\n\nexport type FileContentCheck = z.infer<typeof FileContentCheckSchema>;\n\n/**\n * File Content Test schema - tests that verify file content.\n *\n * This also covers the FILE_MODIFICATION use case from the old system\n * by supporting added/removed line checks.\n */\nexport const FileContentTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_CONTENT),\n /** Path to the file to check */\n path: z.string(),\n /** Content checks to perform */\n checks: FileContentCheckSchema\n});\n\nexport type FileContentTest = z.infer<typeof FileContentTestSchema>;\n\n/**\n * File Content Test result.\n */\nexport interface FileContentTestResult extends BaseTestResult {\n type: TestType.FILE_CONTENT;\n result: boolean;\n diff?: string;\n failedChecks?: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Build Check Test schema - tests that verify build success.\n */\nexport const BuildCheckTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.BUILD_CHECK),\n /** Build command to execute */\n command: z.string(),\n /** Whether the build should succeed */\n expectSuccess: z.boolean(),\n /** Maximum allowed warnings (optional) */\n allowedWarnings: z.number().optional(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type BuildCheckTest = z.infer<typeof BuildCheckTestSchema>;\n\n/**\n * Build Check Test result.\n */\nexport interface BuildCheckTestResult extends BaseTestResult {\n type: TestType.BUILD_CHECK;\n result: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n warningCount: number;\n duration: number;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Vitest Test schema - tests that run Vitest test files.\n */\nexport const VitestTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.VITEST),\n /** Test file content */\n testFile: z.string(),\n /** Name of the test file */\n testFileName: z.string(),\n /** Minimum pass rate required (0-100) */\n minPassRate: z.number().min(0).max(100)\n});\n\nexport type VitestTest = z.infer<typeof VitestTestSchema>;\n\n/**\n * Vitest Test result.\n */\nexport interface VitestTestResult extends BaseTestResult {\n type: TestType.VITEST;\n result: boolean;\n passRate: number;\n passed: number;\n failed: number;\n skipped: number;\n total: number;\n duration: number;\n output: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Playwright Natural Language Test schema - tests using natural language descriptions.\n */\nexport const PlaywrightNLTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.PLAYWRIGHT_NL),\n /** Natural language steps to execute */\n steps: z.array(z.string()),\n /** Expected outcome description */\n expectedOutcome: z.string(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type PlaywrightNLTest = z.infer<typeof PlaywrightNLTestSchema>;\n\n/**\n * Playwright NL Test result.\n */\nexport interface PlaywrightNLTestResult extends BaseTestResult {\n type: TestType.PLAYWRIGHT_NL;\n result: boolean;\n stepsExecuted: number;\n totalSteps: number;\n failedStep?: string;\n screenshot?: string;\n duration: number;\n}\n", "import { z } from 'zod';\n\n/**\n * Assertion: the agent must have invoked a specific skill during the run.\n * Checked by inspecting the LLM trace for a \"Skill\" tool use with the given skill.\n * Data: skillName (the skill that must have been called).\n */\nexport const SkillWasCalledAssertionSchema = z.object({\n type: z.literal('skill_was_called'),\n /** Name of the skill that must have been called (matched against trace Skill tool args) */\n skillName: z.string()\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\n/**\n * Assertion: a build command must exit with the expected code (default 0).\n * Runs the command in the scenario working directory.\n */\nexport const BuildPassedAssertionSchema = z.object({\n type: z.literal('build_passed'),\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\n/**\n * Assertion: an LLM judges the scenario output (score 0-100).\n * Prompt can use {{output}}, {{cwd}}, {{changedFiles}}, {{trace}}.\n * Passes if judge score >= minScore.\n */\nexport const LlmJudgeAssertionSchema = z.object({\n type: z.literal('llm_judge'),\n /** Prompt template; placeholders: {{output}}, {{cwd}}, {{changedFiles}}, {{trace}} */\n prompt: z.string(),\n /** Optional system prompt for the judge (default asks for JSON with score) */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku) */\n model: z.string().optional(),\n maxTokens: z.number().int().optional(),\n temperature: z.number().min(0).max(1).optional()\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\n/**\n * Union of all assertion types (per scenario).\n * Each assertion has a type and type-specific data.\n * Uses z.union (not z.discriminatedUnion) for Zod v4 compatibility when used as array element.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n BuildPassedAssertionSchema,\n LlmJudgeAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\n", "import { z } from 'zod';\n\n/**\n * Local project configuration schema.\n */\nexport const LocalProjectConfigSchema = z.object({\n /** Template ID to use for the local project */\n templateId: z.string().optional(),\n /** Files to create in the project */\n files: z\n .array(\n z.object({\n path: z.string().min(1),\n content: z.string().min(1)\n })\n )\n .optional()\n});\n\nexport type LocalProjectConfig = z.infer<typeof LocalProjectConfigSchema>;\n\n/**\n * Meta site configuration schema for API-based setup.\n */\nexport const MetaSiteConfigSchema = z.object({\n configurations: z\n .array(\n z.object({\n name: z.string().min(1),\n apiCalls: z.array(\n z.object({\n url: z.string().url(),\n method: z.enum(['POST', 'PUT']),\n body: z.string()\n })\n )\n })\n )\n .optional()\n});\n\nexport type MetaSiteConfig = z.infer<typeof MetaSiteConfigSchema>;\n\n/**\n * Environment configuration schema.\n *\n * Defines the environment setup required for running a test scenario.\n * Migrated from the old Prompt schema.\n */\nexport const EnvironmentSchema = z.object({\n /** Local project configuration */\n localProject: LocalProjectConfigSchema.optional(),\n /** Meta site configuration */\n metaSite: MetaSiteConfigSchema.optional()\n});\n\nexport type Environment = z.infer<typeof EnvironmentSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { AssertionSchema } from './assertions.js';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\n\n/**\n * Expected file schema - a file the agent is expected to create or modify.\n * Used by eval results; not persisted on test_scenarios table.\n */\nexport const ExpectedFileSchema = z.object({\n /** Relative path where the file should be created */\n path: z.string(),\n /** Optional expected content */\n content: z.string().optional()\n});\n\nexport type ExpectedFile = z.infer<typeof ExpectedFileSchema>;\n\n/**\n * TestScenario schema - defines a single test scenario.\n *\n * Persisted shape matches test_scenarios table:\n * id, project_id, name, description, trigger_prompt, template_id, created_at, updated_at, deleted.\n * Linked assertions stored in scenario_assertions junction table.\n */\nexport const TestScenarioSchema = TenantEntitySchema.extend({\n /** The prompt sent to the agent to trigger the task */\n triggerPrompt: z.string().min(10),\n /** ID of the template to use for this scenario (null = no template) */\n templateId: z.string().nullish(),\n /** Inline assertions to evaluate for this scenario (legacy) */\n assertions: z.array(AssertionSchema).optional(),\n /** IDs of saved assertions to evaluate (from assertions table) - legacy, use assertionLinks */\n assertionIds: z.array(z.string()).optional(),\n /** Linked assertions with per-scenario parameter values */\n assertionLinks: z.array(ScenarioAssertionLinkSchema).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestScenarioInput = z.infer<\n typeof CreateTestScenarioInputSchema\n>;\n\n/**\n * Input schema for updating a TestScenario.\n */\nexport const UpdateTestScenarioInputSchema =\n CreateTestScenarioInputSchema.partial();\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, user-created)\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'build_passed',\n 'llm_judge'\n]);\n\n/**\n * Parameter types supported in assertion parameters.\n */\nexport const AssertionParameterTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean'\n]);\n\nexport type AssertionParameterType = z.infer<\n typeof AssertionParameterTypeSchema\n>;\n\n/**\n * Schema for defining assertion parameters.\n * Parameters can be required or optional, with optional default values.\n */\nexport const AssertionParameterSchema = z.object({\n /** Parameter name (used as key in params object) */\n name: z.string().min(1),\n /** Display label for the parameter */\n label: z.string().min(1),\n /** Parameter type */\n type: AssertionParameterTypeSchema,\n /** Whether this parameter is required */\n required: z.boolean(),\n /** Default value (optional, used when not provided) */\n defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),\n /** If true, parameter is hidden by default behind \"Show advanced options\" */\n advanced: z.boolean().optional()\n});\n\nexport type AssertionParameter = z.infer<typeof AssertionParameterSchema>;\n\n/**\n * Schema for scenario-assertion link with parameter values.\n * Used when linking assertions to scenarios with specific parameter values.\n */\nexport const ScenarioAssertionLinkSchema = z.object({\n /** ID of the assertion (can be system assertion like 'system:skill_was_called' or custom assertion UUID) */\n assertionId: z.string(),\n /** Parameter values for this assertion in this scenario */\n params: z\n .record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.null()])\n )\n .optional()\n});\n\nexport type ScenarioAssertionLink = z.infer<typeof ScenarioAssertionLinkSchema>;\n\nexport type AssertionType = z.infer<typeof AssertionTypeSchema>;\n\n/**\n * Configuration for skill_was_called assertion type.\n */\nexport const SkillWasCalledConfigSchema = z.object({\n /** Name of the skill that must have been called */\n skillName: z.string().min(1)\n});\n\nexport type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;\n\n/**\n * Configuration for build_passed assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching LlmJudge configs).\n */\nexport const BuildPassedConfigSchema = z.strictObject({\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedConfig = z.infer<typeof BuildPassedConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\n * User-created assertions with customizable parameters.\n */\nexport const LlmJudgeConfigSchema = z.object({\n /**\n * Prompt template with placeholders:\n * - {{output}}: agent's final output\n * - {{cwd}}: working directory\n * - {{changedFiles}}: all files changed (new, modified)\n * - {{modifiedFiles}}: only existing files that were modified\n * - {{newFiles}}: only new files that were created\n * - {{trace}}: step-by-step trace of tool calls\n * - Custom parameters defined in the parameters array\n */\n prompt: z.string().min(1),\n /** Optional system prompt for the judge */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku-20241022) */\n model: z.string().optional(),\n /** Max output tokens */\n maxTokens: z.number().int().optional(),\n /** Temperature (0-1) */\n temperature: z.number().min(0).max(1).optional(),\n /** User-defined parameters for this assertion */\n parameters: z.array(AssertionParameterSchema).optional()\n});\n\nexport type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;\n\n/**\n * Union of all assertion config types.\n * Order matters: schemas with required fields first, then optional-only schemas.\n * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillName)\n * are matched before BuildPassed (all optional) or empty object.\n */\nexport const AssertionConfigSchema = z.union([\n LlmJudgeConfigSchema, // requires prompt - check first\n SkillWasCalledConfigSchema, // requires skillName\n BuildPassedConfigSchema, // all optional, uses strictObject to reject unknown keys\n z.object({}) // fallback empty config\n]);\n\nexport type AssertionConfig = z.infer<typeof AssertionConfigSchema>;\n\n/**\n * Custom Assertion entity - stored in the database.\n * Replaces inline assertions in test scenarios.\n */\nexport const CustomAssertionSchema = TenantEntitySchema.extend({\n /** The assertion type */\n type: AssertionTypeSchema,\n /** Type-specific configuration */\n config: AssertionConfigSchema\n});\n\nexport type CustomAssertion = z.infer<typeof CustomAssertionSchema>;\n\n/**\n * Input schema for creating a new CustomAssertion.\n */\nexport const CreateCustomAssertionInputSchema = CustomAssertionSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateCustomAssertionInput = z.infer<\n typeof CreateCustomAssertionInputSchema\n>;\n\n/**\n * Input schema for updating a CustomAssertion.\n */\nexport const UpdateCustomAssertionInputSchema =\n CreateCustomAssertionInputSchema.partial();\n\nexport type UpdateCustomAssertionInput = z.infer<\n typeof UpdateCustomAssertionInputSchema\n>;\n\n/**\n * Helper function to validate config based on assertion type.\n * Returns true if config is valid for the given type.\n */\nexport function validateAssertionConfig(\n type: AssertionType,\n config: unknown\n): boolean {\n switch (type) {\n case 'skill_was_called':\n return SkillWasCalledConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n\n/**\n * Get typed config for skill_was_called assertion.\n */\nexport function getSkillWasCalledConfig(\n assertion: CustomAssertion\n): SkillWasCalledConfig | null {\n if (assertion.type !== 'skill_was_called') return null;\n const result = SkillWasCalledConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for build_passed assertion.\n */\nexport function getBuildPassedConfig(\n assertion: CustomAssertion\n): BuildPassedConfig | null {\n if (assertion.type !== 'build_passed') return null;\n const result = BuildPassedConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for llm_judge assertion.\n */\nexport function getLlmJudgeConfig(\n assertion: CustomAssertion\n): LlmJudgeConfig | null {\n if (assertion.type !== 'llm_judge') return null;\n const result = LlmJudgeConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * TestSuite schema - a collection of test scenarios.\n *\n * Suites are used to organize and group related test scenarios.\n */\nexport const TestSuiteSchema = TenantEntitySchema.extend({\n /** IDs of test scenarios in this suite */\n scenarioIds: z.array(z.string())\n});\n\nexport type TestSuite = z.infer<typeof TestSuiteSchema>;\n\n/**\n * Input schema for creating a new TestSuite.\n */\nexport const CreateTestSuiteInputSchema = TestSuiteSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestSuiteInput = z.infer<typeof CreateTestSuiteInputSchema>;\n\n/**\n * Input schema for updating a TestSuite.\n */\nexport const UpdateTestSuiteInputSchema = CreateTestSuiteInputSchema.partial();\n\nexport type UpdateTestSuiteInput = z.infer<typeof UpdateTestSuiteInputSchema>;\n", "import { z } from 'zod';\n\n/**\n * Token usage schema.\n */\nexport const TokenUsageSchema = z.object({\n prompt: z.number(),\n completion: z.number(),\n total: z.number()\n});\n\nexport type TokenUsage = z.infer<typeof TokenUsageSchema>;\n\n/**\n * Evaluation metrics schema.\n */\nexport const EvalMetricsSchema = z.object({\n totalAssertions: z.number(),\n passed: z.number(),\n failed: z.number(),\n skipped: z.number(),\n errors: z.number(),\n passRate: z.number(),\n avgDuration: z.number(),\n totalDuration: z.number()\n});\n\nexport type EvalMetrics = z.infer<typeof EvalMetricsSchema>;\n\n/**\n * Evaluation status enum.\n */\nexport enum EvalStatus {\n PENDING = 'pending',\n RUNNING = 'running',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled'\n}\n\nexport const EvalStatusSchema = z.enum(EvalStatus);\n\n/**\n * LLM step type enum.\n */\nexport enum LLMStepType {\n COMPLETION = 'completion',\n TOOL_USE = 'tool_use',\n TOOL_RESULT = 'tool_result',\n THINKING = 'thinking'\n}\n\n/**\n * LLM trace step schema.\n */\nexport const LLMTraceStepSchema = z.object({\n id: z.string(),\n stepNumber: z.number(),\n type: z.enum(LLMStepType),\n model: z.string(),\n provider: z.string(),\n startedAt: z.string(),\n durationMs: z.number(),\n tokenUsage: TokenUsageSchema,\n costUsd: z.number(),\n toolName: z.string().optional(),\n toolArguments: z.string().optional(),\n inputPreview: z.string().optional(),\n outputPreview: z.string().optional(),\n success: z.boolean(),\n error: z.string().optional()\n});\n\nexport type LLMTraceStep = z.infer<typeof LLMTraceStepSchema>;\n\n/**\n * LLM breakdown stats schema.\n */\nexport const LLMBreakdownStatsSchema = z.object({\n count: z.number(),\n durationMs: z.number(),\n tokens: z.number(),\n costUsd: z.number()\n});\n\nexport type LLMBreakdownStats = z.infer<typeof LLMBreakdownStatsSchema>;\n\n/**\n * LLM trace summary schema.\n */\nexport const LLMTraceSummarySchema = z.object({\n totalSteps: z.number(),\n totalDurationMs: z.number(),\n totalTokens: TokenUsageSchema,\n totalCostUsd: z.number(),\n stepTypeBreakdown: z.record(z.string(), LLMBreakdownStatsSchema).optional(),\n modelBreakdown: z.record(z.string(), LLMBreakdownStatsSchema),\n modelsUsed: z.array(z.string())\n});\n\nexport type LLMTraceSummary = z.infer<typeof LLMTraceSummarySchema>;\n\n/**\n * LLM trace schema.\n */\nexport const LLMTraceSchema = z.object({\n id: z.string(),\n steps: z.array(LLMTraceStepSchema),\n summary: LLMTraceSummarySchema\n});\n\nexport type LLMTrace = z.infer<typeof LLMTraceSchema>;\n", "import { z } from 'zod';\nimport { TestResult } from '../test/index.js';\nimport {\n EvalMetricsSchema,\n LLMTraceSchema,\n LLMTraceStepSchema\n} from './metrics.js';\nimport { DiffContentSchema, TemplateFileSchema } from './eval-run.js';\nimport { ModelConfigSchema } from '../common/models.js';\nimport { ExpectedFileSchema } from '../scenario/test-scenario.js';\n\n/**\n * Assertion result status enum.\n * Defined locally to avoid bundling eval-assertions Node.js code in browser.\n * This is structurally identical to the one in @wix/eval-assertions.\n */\nexport enum AssertionResultStatus {\n PASSED = 'passed',\n FAILED = 'failed',\n SKIPPED = 'skipped',\n ERROR = 'error'\n}\n\n/**\n * Assertion result schema.\n */\nexport const AssertionResultSchema = z.object({\n id: z.string(),\n assertionId: z.string(),\n assertionType: z.string(),\n assertionName: z.string(),\n status: z.enum(AssertionResultStatus),\n message: z.string().optional(),\n expected: z.string().optional(),\n actual: z.string().optional(),\n duration: z.number().optional(),\n details: z.record(z.string(), z.unknown()).optional(),\n llmTraceSteps: z.array(LLMTraceStepSchema).optional()\n});\n\nexport type AssertionResult = z.infer<typeof AssertionResultSchema>;\n\n/**\n * Evaluation run result schema - result for a single scenario/target combination.\n */\nexport const EvalRunResultSchema = z.object({\n id: z.string(),\n targetId: z.string(),\n targetName: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n modelConfig: ModelConfigSchema.optional(),\n assertionResults: z.array(AssertionResultSchema),\n metrics: EvalMetricsSchema.optional(),\n passed: z.number(),\n failed: z.number(),\n passRate: z.number(),\n duration: z.number(),\n outputText: z.string().optional(),\n files: z.array(ExpectedFileSchema).optional(),\n fileDiffs: z.array(DiffContentSchema).optional(),\n /** Full template files after execution with status indicators */\n templateFiles: z.array(TemplateFileSchema).optional(),\n startedAt: z.string().optional(),\n completedAt: z.string().optional(),\n llmTrace: LLMTraceSchema.optional()\n});\n\nexport type EvalRunResult = z.infer<typeof EvalRunResultSchema>;\n\n/**\n * Prompt result schema - detailed result from prompt execution.\n */\nexport const PromptResultSchema = z.object({\n text: z.string(),\n files: z.array(z.unknown()).optional(),\n finishReason: z.string().optional(),\n reasoning: z.string().optional(),\n reasoningDetails: z.unknown().optional(),\n toolCalls: z.array(z.unknown()).optional(),\n toolResults: z.array(z.unknown()).optional(),\n warnings: z.array(z.unknown()).optional(),\n sources: z.array(z.unknown()).optional(),\n steps: z.array(z.unknown()),\n generationTimeMs: z.number(),\n prompt: z.string(),\n systemPrompt: z.string(),\n usage: z.object({\n totalTokens: z.number().optional(),\n totalMicrocentsSpent: z.number().optional()\n })\n});\n\nexport type PromptResult = z.infer<typeof PromptResultSchema>;\n\n/**\n * Full evaluation result schema - complete result for a single evaluation.\n */\nexport const EvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n promptResult: PromptResultSchema,\n testResults: z.array(z.unknown()) as z.ZodType<TestResult[]>,\n tags: z.array(z.string()).optional(),\n feedback: z.string().optional(),\n score: z.number(),\n suiteId: z.string().optional()\n});\n\nexport type EvaluationResult = z.infer<typeof EvaluationResultSchema>;\n\n/**\n * Lean evaluation result - summary for listing.\n */\nexport const LeanEvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n tags: z.array(z.string()).optional(),\n scenarioId: z.string(),\n scenarioVersion: z.number().optional(),\n targetId: z.string(),\n targetVersion: z.number().optional(),\n suiteId: z.string().optional(),\n score: z.number(),\n time: z.number().optional(),\n microcentsSpent: z.number().optional()\n});\n\nexport type LeanEvaluationResult = z.infer<typeof LeanEvaluationResultSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { EvalRunResultSchema } from './eval-result.js';\nimport {\n EvalMetricsSchema,\n EvalStatusSchema,\n LLMTraceSummarySchema\n} from './metrics.js';\nimport { LiveTraceEventSchema } from './live-trace.js';\n\n/**\n * Trigger types for evaluations.\n */\nexport enum TriggerType {\n RESOURCES_UPDATED = 'RESOURCES_UPDATED',\n MCP_VERSION_RELEASE = 'MCP_VERSION_RELEASE',\n MCP_PREVIEW_CREATED = 'MCP_PREVIEW_CREATED',\n MANUAL = 'MANUAL'\n}\n\n/**\n * Trigger metadata schema.\n */\nexport const TriggerMetadataSchema = z.object({\n version: z.string().optional(),\n resourceUpdated: z.array(z.string()).optional()\n});\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n\n/**\n * Trigger schema.\n */\nexport const TriggerSchema = z.object({\n id: z.string(),\n metadata: TriggerMetadataSchema.optional(),\n type: z.enum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\n\n/**\n * Failure category enum.\n */\nexport enum FailureCategory {\n MISSING_FILE = 'missing_file',\n WRONG_CONTENT = 'wrong_content',\n BUILD_ERROR = 'build_error',\n TEST_FAILURE = 'test_failure',\n RUNTIME_ERROR = 'runtime_error',\n PERFORMANCE = 'performance'\n}\n\n/**\n * Failure severity enum.\n */\nexport enum FailureSeverity {\n CRITICAL = 'critical',\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n/**\n * Diff line type schema.\n */\nexport const DiffLineTypeSchema = z.enum(['added', 'removed', 'unchanged']);\nexport type DiffLineType = z.infer<typeof DiffLineTypeSchema>;\n\n/**\n * Diff line schema - represents a single line in a diff.\n */\nexport const DiffLineSchema = z.object({\n type: DiffLineTypeSchema,\n content: z.string(),\n lineNumber: z.number()\n});\n\nexport type DiffLine = z.infer<typeof DiffLineSchema>;\n\n/**\n * Diff content schema - represents a file diff.\n */\nexport const DiffContentSchema = z.object({\n path: z.string(),\n expected: z.string(),\n actual: z.string(),\n diffLines: z.array(DiffLineSchema),\n renamedFrom: z.string().optional()\n});\n\nexport type DiffContent = z.infer<typeof DiffContentSchema>;\n\n/**\n * Command execution schema.\n */\nexport const CommandExecutionSchema = z.object({\n command: z.string(),\n exitCode: z.number(),\n output: z.string().optional(),\n duration: z.number()\n});\n\nexport type CommandExecution = z.infer<typeof CommandExecutionSchema>;\n\n/**\n * File modification schema.\n */\nexport const FileModificationSchema = z.object({\n path: z.string(),\n action: z.enum(['created', 'modified', 'deleted'])\n});\n\nexport type FileModification = z.infer<typeof FileModificationSchema>;\n\n/**\n * Template file status enum.\n */\nexport enum TemplateFileStatus {\n NEW = 'new',\n MODIFIED = 'modified',\n UNCHANGED = 'unchanged'\n}\n\n/**\n * Template file schema - represents a file in the template with its full content.\n */\nexport const TemplateFileSchema = z.object({\n /** Relative path within the template */\n path: z.string(),\n /** Full file content after execution */\n content: z.string(),\n /** File status (new, modified, unchanged) */\n status: z.enum(['new', 'modified', 'unchanged'])\n});\n\nexport type TemplateFile = z.infer<typeof TemplateFileSchema>;\n\n/**\n * API call schema.\n */\nexport const ApiCallSchema = z.object({\n endpoint: z.string(),\n tokensUsed: z.number(),\n duration: z.number()\n});\n\nexport type ApiCall = z.infer<typeof ApiCallSchema>;\n\n/**\n * Execution trace schema - represents detailed execution information.\n */\nexport const ExecutionTraceSchema = z.object({\n commands: z.array(CommandExecutionSchema),\n filesModified: z.array(FileModificationSchema),\n apiCalls: z.array(ApiCallSchema),\n totalDuration: z.number()\n});\n\nexport type ExecutionTrace = z.infer<typeof ExecutionTraceSchema>;\n\n/**\n * Failure analysis schema.\n */\nexport const FailureAnalysisSchema = z.object({\n category: z.enum(FailureCategory),\n severity: z.enum(FailureSeverity),\n summary: z.string(),\n details: z.string(),\n rootCause: z.string(),\n suggestedFix: z.string(),\n relatedAssertions: z.array(z.string()),\n codeSnippet: z.string().optional(),\n similarIssues: z.array(z.string()).optional(),\n patternId: z.string().optional(),\n // Extended fields for detailed debugging\n diff: DiffContentSchema.optional(),\n executionTrace: ExecutionTraceSchema.optional()\n});\n\nexport type FailureAnalysis = z.infer<typeof FailureAnalysisSchema>;\n\n/**\n * Evaluation run schema.\n *\n * Represents a complete evaluation run with configuration, results, and metrics.\n */\nexport const EvalRunSchema = TenantEntitySchema.extend({\n /** Agent ID for this run */\n agentId: z.string().optional(),\n /** Skills group ID for this run */\n skillsGroupId: z.string().optional(),\n /** Scenario IDs to run */\n scenarioIds: z.array(z.string()),\n /** Current status */\n status: EvalStatusSchema,\n /** Progress percentage (0-100) */\n progress: z.number(),\n /** Results for each scenario/target combination (lazy to break eval-result \u2194 eval-run cycle) */\n results: z.array(z.lazy(() => EvalRunResultSchema)),\n /** Aggregated metrics across all results */\n aggregateMetrics: EvalMetricsSchema,\n /** Failure analyses */\n failureAnalyses: z.array(FailureAnalysisSchema).optional(),\n /** Aggregated LLM trace summary */\n llmTraceSummary: LLMTraceSummarySchema.optional(),\n /** What triggered this run */\n trigger: TriggerSchema.optional(),\n /** When the run started (set when evaluation is triggered) */\n startedAt: z.string().optional(),\n /** When the run completed */\n completedAt: z.string().optional(),\n /** Live trace events captured during execution (for playback on results page) */\n liveTraceEvents: z.array(LiveTraceEventSchema).optional(),\n /** Remote job ID for tracking execution in Dev Machines */\n jobId: z.string().optional(),\n /** Remote job status from the Dev Machine API (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED) */\n jobStatus: z.string().optional(),\n /** Remote job error message if the job failed */\n jobError: z.string().optional(),\n /** Timestamp of the last job status check */\n jobStatusCheckedAt: z.string().optional(),\n /** MCP server IDs to enable for this run (optional) */\n mcpIds: z.array(z.string()).optional(),\n /** Sub-agent IDs to enable for this run (optional) */\n subAgentIds: z.array(z.string()).optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n */\nexport const CreateEvalRunInputSchema = EvalRunSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n status: true,\n progress: true,\n results: true,\n aggregateMetrics: true,\n startedAt: true,\n completedAt: true\n});\n\nexport type CreateEvalRunInput = z.infer<typeof CreateEvalRunInputSchema>;\n\n/**\n * Evaluation progress schema.\n */\nexport const EvaluationProgressSchema = z.object({\n runId: z.string(),\n targetId: z.string(),\n totalScenarios: z.number(),\n completedScenarios: z.number(),\n scenarioProgress: z.array(\n z.object({\n scenarioId: z.string(),\n currentStep: z.string(),\n error: z.string().optional()\n })\n ),\n createdAt: z.number()\n});\n\nexport type EvaluationProgress = z.infer<typeof EvaluationProgressSchema>;\n\n/**\n * Evaluation log schema.\n */\nexport const EvaluationLogSchema = z.object({\n runId: z.string(),\n scenarioId: z.string(),\n log: z.object({\n level: z.enum(['info', 'error', 'debug']),\n message: z.string().optional(),\n args: z.array(z.any()).optional(),\n error: z.string().optional()\n })\n});\n\nexport type EvaluationLog = z.infer<typeof EvaluationLogSchema>;\n\n/**\n * LLM timeout constant (2 minutes).\n */\nexport const LLM_TIMEOUT = 120000;\n", "import { z } from 'zod';\n\n/**\n * Live trace event type enum.\n * Maps to the step types but includes streaming states.\n */\nexport enum LiveTraceEventType {\n THINKING = 'thinking',\n TOOL_USE = 'tool_use',\n COMPLETION = 'completion',\n TOOL_RESULT = 'tool_result',\n /** Diagnostic information for debugging environment/setup issues */\n DIAGNOSTIC = 'diagnostic',\n /** Periodic progress heartbeat during long operations */\n PROGRESS = 'progress',\n /** File write operation */\n FILE_WRITE = 'file_write',\n /** File read operation */\n FILE_READ = 'file_read',\n /** System message from the SDK */\n SYSTEM = 'system',\n /** User message (tool result from file operations etc.) */\n USER = 'user'\n}\n\n/**\n * Live trace event schema.\n * Represents a single trace event emitted during agent execution.\n */\nexport const LiveTraceEventSchema = z.object({\n /** The evaluation run ID */\n evalRunId: z.string(),\n /** The scenario ID being executed */\n scenarioId: z.string(),\n /** The scenario name for display */\n scenarioName: z.string(),\n /** The target ID (skill, agent, etc.) */\n targetId: z.string(),\n /** The target name for display */\n targetName: z.string(),\n /** Step number in the current scenario execution */\n stepNumber: z.number(),\n /** Type of trace event */\n type: z.enum(LiveTraceEventType),\n /** Tool name if this is a tool_use event */\n toolName: z.string().optional(),\n /** Tool arguments preview (truncated JSON) */\n toolArgs: z.string().optional(),\n /** Output preview (truncated text) */\n outputPreview: z.string().optional(),\n /** File path for file operations */\n filePath: z.string().optional(),\n /** Elapsed time in milliseconds for progress events */\n elapsedMs: z.number().optional(),\n /** Thinking/reasoning text from Claude */\n thinking: z.string().optional(),\n /** Timestamp when this event occurred */\n timestamp: z.string(),\n /** Whether this is the final event for this scenario */\n isComplete: z.boolean()\n});\n\nexport type LiveTraceEvent = z.infer<typeof LiveTraceEventSchema>;\n\n/**\n * Prefix used in stdout to identify trace events.\n * Format: TRACE_EVENT:{json}\n */\nexport const TRACE_EVENT_PREFIX = 'TRACE_EVENT:';\n\n/**\n * Parse a line from stdout to extract a trace event if present.\n * @param line - A line from stdout\n * @returns The parsed LiveTraceEvent or null if not a trace event line\n */\nexport function parseTraceEventLine(line: string): LiveTraceEvent | null {\n if (!line.startsWith(TRACE_EVENT_PREFIX)) {\n return null;\n }\n\n try {\n const jsonStr = line.slice(TRACE_EVENT_PREFIX.length);\n const parsed = JSON.parse(jsonStr);\n const result = LiveTraceEventSchema.safeParse(parsed);\n return result.success ? result.data : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Format a trace event as a stdout line.\n * @param event - The trace event to format\n * @returns The formatted line with prefix\n */\nexport function formatTraceEventLine(event: LiveTraceEvent): string {\n return `${TRACE_EVENT_PREFIX}${JSON.stringify(event)}`;\n}\n", "import { z } from 'zod';\nimport { BaseEntitySchema } from '../common/base-entity.js';\n\n/**\n * Project schema - represents a tenant/workspace for data isolation.\n *\n * All entities belong to a project. Projects are the top-level\n * organizational unit for multi-tenancy.\n *\n * Note: Project extends BaseEntity (not TenantEntity) since\n * Project IS the tenant and doesn't need a projectId.\n */\nexport const ProjectSchema = BaseEntitySchema.extend({\n appId: z.string().optional().describe('The ID of the app in Dev Center'),\n appSecret: z\n .string()\n .optional()\n .describe('The secret of the app in Dev Center')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n */\nexport const UpdateProjectInputSchema = CreateProjectInputSchema.partial();\n\nexport type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Template schema - a project template that can be used for test environments.\n *\n * Templates are tenant-based entities scoped to a project.\n * They define how to set up a project environment for testing.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** URL to download the template from */\n downloadUrl: z.url()\n});\n\nexport type Template = z.infer<typeof TemplateSchema>;\n\n/**\n * Input schema for creating a new Template.\n */\nexport const CreateTemplateInputSchema = TemplateSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateInputSchema>;\n\n/**\n * Input schema for updating a Template.\n */\nexport const UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();\n\nexport type UpdateTemplateInput = z.infer<typeof UpdateTemplateInputSchema>;\n", "import type { AssertionParameter, AssertionType } from './assertion.js';\n\n/**\n * System assertion definition - built-in assertions available to all projects.\n * These are not stored in the database but defined in code.\n */\nexport interface SystemAssertion {\n /** Unique ID prefixed with 'system:' */\n id: string;\n /** Display name */\n name: string;\n /** Description of what the assertion checks */\n description: string;\n /** Assertion type */\n type: AssertionType;\n /** Parameters that can be configured per-scenario */\n parameters: AssertionParameter[];\n}\n\n/**\n * System assertion IDs - prefixed with 'system:' to distinguish from custom assertions.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n BUILD_PASSED: 'system:build_passed',\n LLM_JUDGE: 'system:llm_judge'\n} as const;\n\nexport type SystemAssertionId =\n (typeof SYSTEM_ASSERTION_IDS)[keyof typeof SYSTEM_ASSERTION_IDS];\n\n/**\n * Check if an assertion ID is a system assertion.\n */\nexport function isSystemAssertionId(id: string): id is SystemAssertionId {\n return id.startsWith('system:');\n}\n\n/**\n * Built-in system assertions.\n * These are available to all projects without needing to create them.\n */\nexport const SYSTEM_ASSERTIONS: Record<SystemAssertionId, SystemAssertion> = {\n [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {\n id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,\n name: 'Skill Was Called',\n description: 'Check if a specific skill was invoked during the agent run',\n type: 'skill_was_called',\n parameters: [\n {\n name: 'skillName',\n label: 'Skill Name',\n type: 'string',\n required: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.BUILD_PASSED]: {\n id: SYSTEM_ASSERTION_IDS.BUILD_PASSED,\n name: 'Build Passed',\n description: 'Run a build command and verify it exits with expected code',\n type: 'build_passed',\n parameters: [\n {\n name: 'command',\n label: 'Build Command',\n type: 'string',\n required: false,\n defaultValue: 'yarn build'\n },\n {\n name: 'expectedExitCode',\n label: 'Expected Exit Code',\n type: 'number',\n required: false,\n defaultValue: 0\n },\n {\n name: 'maxBuildTime',\n label: 'Max Build Time (ms)',\n type: 'number',\n required: false,\n advanced: true\n },\n {\n name: 'maxMemory',\n label: 'Max Memory (MB)',\n type: 'number',\n required: false,\n advanced: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.LLM_JUDGE]: {\n id: SYSTEM_ASSERTION_IDS.LLM_JUDGE,\n name: 'LLM Judge',\n description: 'LLM evaluates the output and assigns a score (0-100)',\n type: 'llm_judge',\n parameters: [\n {\n name: 'prompt',\n label: 'Judge Prompt',\n type: 'string',\n required: true,\n defaultValue: 'Verify the output meets the acceptance criteria.'\n },\n {\n name: 'systemPrompt',\n label: 'System Prompt (optional)',\n type: 'string',\n required: false,\n defaultValue:\n 'You are judging a scenario run. Use these values:\\n- {{output}}: the agent\\'s final output\\n- {{cwd}}: working directory\\n- {{changedFiles}}: list of files changed (or \"No files were changed\")\\n- {{trace}}: step-by-step trace (tool calls, completions) to check e.g. which tools were called and how many times\\n\\nJudge how well the output meets the acceptance criteria stated in the user prompt.'\n },\n {\n name: 'minScore',\n label: 'Minimum Score (0-100)',\n type: 'number',\n required: false,\n defaultValue: 70\n }\n ]\n }\n};\n\n/**\n * Get all system assertions as an array.\n */\nexport function getSystemAssertions(): SystemAssertion[] {\n return Object.values(SYSTEM_ASSERTIONS);\n}\n\n/**\n * Get a system assertion by ID.\n */\nexport function getSystemAssertion(\n id: SystemAssertionId\n): SystemAssertion | undefined {\n return SYSTEM_ASSERTIONS[id];\n}\n"],
5
- "mappings": ";AAAA,SAAS,SAAS;AAKX,IAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,aAAa,EAAE,OAAO;AAAA,EACtB,WA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B;",
4
+ "sourcesContent": ["import { z } from 'zod';\n\n/**\n * Base entity schema with common fields for all entities.\n */\nexport const BaseEntitySchema = z.object({\n id: z.string(),\n name: z.string().min(1),\n description: z.string(),\n createdAt: z.string(),\n updatedAt: z.string(),\n deleted: z.boolean().optional()\n});\n\nexport type BaseEntity = z.infer<typeof BaseEntitySchema>;\n\n/**\n * Tenant entity schema - extends BaseEntity with projectId for multi-tenancy.\n */\nexport const TenantEntitySchema = BaseEntitySchema.extend({\n projectId: z.string()\n});\n\nexport type TenantEntity = z.infer<typeof TenantEntitySchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\n/**\n * Top-level key for the .mcp.json file written at run start.\n * Format: { [MCP_SERVERS_JSON_KEY]: { [mcpName]: config } }\n */\nexport const MCP_SERVERS_JSON_KEY = 'mcpServers';\n\n/**\n * MCP Entity schema - an MCP server definition stored per project.\n *\n * The `name` is used as the key in .mcp.json mcpServers object.\n * The `config` is stored as-is and written to mcp.json (command/args, url/headers, etc.).\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name and key in mcp.json mcpServers object */\n name: z.string().min(1),\n /** MCP server config (command/args, url/headers, etc.) - stored as-is for mcp.json */\n config: z.record(z.string(), z.unknown())\n});\n\nexport type MCPEntity = z.infer<typeof MCPEntitySchema>;\n\n/**\n * Input schema for creating a new MCP.\n */\nexport const CreateMcpInputSchema = MCPEntitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateMcpInput = z.infer<typeof CreateMcpInputSchema>;\n\n/**\n * Input schema for updating an MCP.\n */\nexport const UpdateMcpInputSchema = CreateMcpInputSchema.partial();\n\nexport type UpdateMcpInput = z.infer<typeof UpdateMcpInputSchema>;\n\n/**\n * MCP Server Configuration (legacy - for mcp.json config shape).\n * Config can be: { command, args }, { url, headers }, { type, command, args, env }, etc.\n */\nexport const MCPServerConfigSchema = z.record(z.string(), z.unknown());\n\nexport type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;\n", "import { z } from 'zod';\n\n/**\n * Anthropic Model IDs supported by the AI Gateway.\n * These values match the ClaudeModel enum from the Wix AI Gateway API.\n */\nexport enum ModelIds {\n CLAUDE_3_HAIKU_1_0 = 'CLAUDE_3_HAIKU_1_0',\n CLAUDE_3_OPUS_1_0 = 'CLAUDE_3_OPUS_1_0',\n CLAUDE_3_SONNET_1_0 = 'CLAUDE_3_SONNET_1_0',\n CLAUDE_3_5_SONNET_1_0 = 'CLAUDE_3_5_SONNET_1_0',\n CLAUDE_3_5_SONNET_2_0 = 'CLAUDE_3_5_SONNET_2_0',\n CLAUDE_3_7_SONNET_1_0 = 'CLAUDE_3_7_SONNET_1_0',\n CLAUDE_4_OPUS_1_0 = 'CLAUDE_4_OPUS_1_0',\n CLAUDE_4_SONNET_1_0 = 'CLAUDE_4_SONNET_1_0'\n}\n\nexport const ModelIdsSchema = z.enum(ModelIds);\n\n/**\n * Model configuration schema for specifying model parameters.\n */\nexport const ModelConfigSchema = z.object({\n model: ModelIdsSchema,\n temperature: z.number().min(0).max(1).optional(),\n maxTokens: z.number().min(1).optional()\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n\n/**\n * Model pricing schema (cost per 1M tokens).\n */\nexport const ModelPricingSchema = z.object({\n inputPer1M: z.number(),\n outputPer1M: z.number()\n});\n\nexport type ModelPricing = z.infer<typeof ModelPricingSchema>;\n\n/**\n * Model schema - complete model definition with metadata and pricing.\n */\nexport const ModelSchema = z.object({\n /** AI Gateway model ID */\n id: ModelIdsSchema,\n /** Display name */\n name: z.string(),\n /** Provider (always 'anthropic') */\n provider: z.literal('anthropic'),\n /** Provider's model identifier (e.g., \"claude-3-5-sonnet-20241022\") */\n providerModelId: z.string(),\n /** Pricing per 1M tokens */\n pricing: ModelPricingSchema\n});\n\nexport type Model = z.infer<typeof ModelSchema>;\n\n/**\n * Available models with full metadata including pricing.\n */\nexport const AVAILABLE_MODELS: Model[] = [\n {\n id: ModelIds.CLAUDE_4_SONNET_1_0,\n name: 'Claude 4 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-4-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_4_OPUS_1_0,\n name: 'Claude 4 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-4-opus',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_7_SONNET_1_0,\n name: 'Claude 3.7 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-7-sonnet',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_2_0,\n name: 'Claude 3.5 Sonnet v2',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20241022',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_5_SONNET_1_0,\n name: 'Claude 3.5 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-5-sonnet-20240620',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_OPUS_1_0,\n name: 'Claude 3 Opus',\n provider: 'anthropic',\n providerModelId: 'claude-3-opus-20240229',\n pricing: { inputPer1M: 15, outputPer1M: 75 }\n },\n {\n id: ModelIds.CLAUDE_3_SONNET_1_0,\n name: 'Claude 3 Sonnet',\n provider: 'anthropic',\n providerModelId: 'claude-3-sonnet-20240229',\n pricing: { inputPer1M: 3, outputPer1M: 15 }\n },\n {\n id: ModelIds.CLAUDE_3_HAIKU_1_0,\n name: 'Claude 3 Haiku',\n provider: 'anthropic',\n providerModelId: 'claude-3-haiku-20240307',\n pricing: { inputPer1M: 0.25, outputPer1M: 1.25 }\n }\n];\n\n/**\n * Available models as a map keyed by model ID.\n */\nexport const AVAILABLE_MODELS_MAP: Record<ModelIds, Model> = Object.fromEntries(\n AVAILABLE_MODELS.map((model) => [model.id, model])\n) as Record<ModelIds, Model>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Target schema - base for all testable entities.\n *\n * All testable entities (Agent, Skill) extend this schema.\n * This creates a unified type hierarchy for what can be evaluated.\n */\nexport const TargetSchema = TenantEntitySchema.extend({\n // Base for all testable entities\n // Specific targets add their own fields\n});\n\nexport type Target = z.infer<typeof TargetSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Agent schema - a CLI-based coding agent.\n *\n * Agents are external CLI tools that can execute coding tasks.\n * Examples: Claude Code CLI, Codex CLI, Cursor CLI.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Command to run the agent */\n runCommand: z.string(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional()\n});\n\nexport type Agent = z.infer<typeof AgentSchema>;\n\n/**\n * Input schema for creating a new Agent.\n */\nexport const CreateAgentInputSchema = AgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateAgentInput = z.infer<typeof CreateAgentInputSchema>;\n\n/**\n * Input schema for updating an Agent.\n * modelConfig can be null to explicitly clear it (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { ModelConfigSchema } from '../common/models.js';\n\n/**\n * Regex for valid skill folder names (kebab-case).\n * Allows: lowercase letters, numbers, hyphens. Words separated by single hyphens.\n * Examples: my-skill, code-review, skill1\n */\nexport const SKILL_FOLDER_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * Check if a string is a valid skill folder name (kebab-case).\n * Used for validation when creating skills and when writing skills to filesystem.\n */\nexport function isValidSkillFolderName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n SKILL_FOLDER_NAME_REGEX.test(name.trim())\n );\n}\n\n/**\n * Skill metadata parsed from SKILL.md frontmatter.\n *\n * Following the agentskills.io specification:\n * - name: Skill identifier (max 64 chars, lowercase + hyphens)\n * - description: What the skill does and when to use it\n * - allowedTools: Pre-approved tools the skill may use\n * - skills: Sub-skills for composite agents\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n allowedTools: z.array(z.string()).optional(),\n skills: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * Skill version - historical snapshot of a Skill's content.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n skillId: z.string(),\n skillMd: z.string(),\n metadata: SkillMetadataSchema,\n model: ModelConfigSchema.optional(),\n systemPrompt: z.string().optional(),\n version: z.number(),\n createdAt: z.string(),\n notes: z.string().optional()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Skill schema - a coding capability defined by SKILL.md.\n *\n * Skills represent coding capabilities that can be tested.\n * Persisted shape: id, projectId, name, description, createdAt, updatedAt, deleted, skillMd.\n */\nexport const SkillSchema = TargetSchema.extend({\n /** The current SKILL.md content */\n skillMd: z.string()\n});\n\nexport type Skill = z.infer<typeof SkillSchema>;\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-skill)';\n\nconst SkillInputBaseSchema = SkillSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new Skill.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.refine(\n (data) => isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;\n\n/**\n * Input schema for updating a Skill.\n */\nexport const UpdateSkillInputSchema = SkillInputBaseSchema.partial().refine(\n (data) => data.name === undefined || isValidSkillFolderName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n);\n\nexport type UpdateSkillInput = z.infer<typeof UpdateSkillInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * SkillsGroup schema - a collection of skills (replaces TargetGroup for the new model).\n *\n * Eval runs can be scoped to a skills group to run against all skills in the group.\n */\nexport const SkillsGroupSchema = TenantEntitySchema.extend({\n /** IDs of skills in this group */\n skillIds: z.array(z.string())\n});\n\nexport type SkillsGroup = z.infer<typeof SkillsGroupSchema>;\n\n/**\n * Input schema for creating a new SkillsGroup.\n */\nexport const CreateSkillsGroupInputSchema = SkillsGroupSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateSkillsGroupInput = z.infer<\n typeof CreateSkillsGroupInputSchema\n>;\n\n/**\n * Input schema for updating a SkillsGroup.\n */\nexport const UpdateSkillsGroupInputSchema =\n CreateSkillsGroupInputSchema.partial();\n\nexport type UpdateSkillsGroupInput = z.infer<\n typeof UpdateSkillsGroupInputSchema\n>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\n\n/**\n * Sub-agent schema \u2013 a Markdown file with YAML frontmatter.\n *\n * Sub-agents are specialized AI assistants (per Claude Code docs)\n * defined in Markdown with frontmatter (name, description, tools, model, etc.).\n * The body is the system prompt.\n *\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string()\n});\n\nexport type SubAgent = z.infer<typeof SubAgentSchema>;\n\nconst SubAgentInputBaseSchema = SubAgentSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateSubAgentInputSchema = SubAgentInputBaseSchema;\n\nexport type CreateSubAgentInput = z.infer<typeof CreateSubAgentInputSchema>;\n\nexport const UpdateSubAgentInputSchema = SubAgentInputBaseSchema.partial();\n\nexport type UpdateSubAgentInput = z.infer<typeof UpdateSubAgentInputSchema>;\n", "import { z } from 'zod';\n\n// Base exports\nexport * from './base.js';\n\n// Individual test types\nexport * from './llm.js';\nexport * from './tool.js';\nexport * from './site-config.js';\nexport * from './command-execution.js';\nexport * from './file-presence.js';\nexport * from './file-content.js';\nexport * from './build-check.js';\nexport * from './vitest.js';\nexport * from './playwright-nl.js';\n\n// Import schemas for union\nimport { LLMTestSchema, LLMTestResult } from './llm.js';\nimport { ToolTestSchema, ToolTestResult } from './tool.js';\nimport { SiteConfigTestSchema, SiteConfigTestResult } from './site-config.js';\nimport {\n CommandExecutionTestSchema,\n CommandExecutionTestResult\n} from './command-execution.js';\nimport {\n FilePresenceTestSchema,\n FilePresenceTestResult\n} from './file-presence.js';\nimport {\n FileContentTestSchema,\n FileContentTestResult\n} from './file-content.js';\nimport { BuildCheckTestSchema, BuildCheckTestResult } from './build-check.js';\nimport { VitestTestSchema, VitestTestResult } from './vitest.js';\nimport {\n PlaywrightNLTestSchema,\n PlaywrightNLTestResult\n} from './playwright-nl.js';\n\n/**\n * Unified Test schema - discriminated union of all 9 test types.\n */\nexport const TestSchema = z.discriminatedUnion('type', [\n LLMTestSchema,\n ToolTestSchema,\n SiteConfigTestSchema,\n CommandExecutionTestSchema,\n FilePresenceTestSchema,\n FileContentTestSchema,\n BuildCheckTestSchema,\n VitestTestSchema,\n PlaywrightNLTestSchema\n]);\n\nexport type Test = z.infer<typeof TestSchema>;\n\n/**\n * Union of all test result types.\n */\nexport type TestResult =\n | LLMTestResult\n | ToolTestResult\n | SiteConfigTestResult\n | CommandExecutionTestResult\n | FilePresenceTestResult\n | FileContentTestResult\n | BuildCheckTestResult\n | VitestTestResult\n | PlaywrightNLTestResult;\n", "import { z } from 'zod';\n\n/**\n * Test types - unified from old and new systems.\n */\nexport enum TestType {\n // From old system\n LLM = 'LLM',\n TOOL = 'TOOL',\n SITE_CONFIG = 'SITE_CONFIG',\n COMMAND_EXECUTION = 'COMMAND_EXECUTION',\n // From new system\n FILE_PRESENCE = 'FILE_PRESENCE',\n FILE_CONTENT = 'FILE_CONTENT',\n BUILD_CHECK = 'BUILD_CHECK',\n VITEST = 'VITEST',\n PLAYWRIGHT_NL = 'PLAYWRIGHT_NL'\n}\n\nexport const TestTypeSchema = z.enum(TestType);\n\n/**\n * Test importance levels.\n */\nexport enum TestImportance {\n LOW = 'low',\n MEDIUM = 'medium',\n HIGH = 'high',\n CRITICAL = 'critical'\n}\n\nexport const TestImportanceSchema = z.enum(TestImportance);\n\n/**\n * Base test schema - common fields for all test types.\n */\nexport const BaseTestSchema = z.object({\n id: z.string(),\n type: TestTypeSchema,\n name: z.string().min(3),\n description: z.string().optional(),\n importance: TestImportanceSchema.optional()\n});\n\nexport type BaseTest = z.infer<typeof BaseTestSchema>;\n\n/**\n * Base test result interface.\n */\nexport interface BaseTestResult {\n type: TestType;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * LLM Test schema - tests that use an LLM evaluator.\n */\nexport const LLMTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.LLM),\n /** Maximum steps for the LLM to take */\n maxSteps: z.number().min(1).max(100),\n /** Prompt to send to the evaluator */\n prompt: z.string().min(1),\n /** ID of the evaluator agent to use */\n evaluatorId: z.string()\n});\n\nexport type LLMTest = z.infer<typeof LLMTestSchema>;\n\n/**\n * LLM Test result.\n */\nexport interface LLMTestResult extends BaseTestResult {\n type: TestType.LLM;\n testPrompt: string;\n testSystemPrompt?: string;\n text: string;\n scoreReasoning: string;\n score: number;\n totalMicrocentsSpent?: number;\n usage?: {\n promptTokens?: number;\n completionTokens?: number;\n totalTokens?: number;\n };\n reasoning?: string;\n reasoningDetails?: unknown;\n finishReason?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Tool Test schema - tests that verify tool usage.\n */\nexport const ToolTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.TOOL),\n /** Name of the tool that should be called */\n toolName: z.string().min(3),\n /** Expected arguments for the tool call */\n args: z.record(z.string(), z.any()),\n /** Expected content in the tool results */\n resultsContent: z.string()\n});\n\nexport type ToolTest = z.infer<typeof ToolTestSchema>;\n\n/**\n * Tool Test result.\n */\nexport interface ToolTestResult extends BaseTestResult {\n type: TestType.TOOL;\n result: boolean;\n toolUsed: boolean;\n actualArgs: Record<string, any>;\n isResultsValid: boolean;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Site Config Test schema - tests that verify site configuration via API.\n */\nexport const SiteConfigTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.SITE_CONFIG),\n /** URL to call */\n url: z.string().url(),\n /** HTTP method */\n method: z.enum(['GET', 'POST']),\n /** Request body (for POST) */\n body: z.string().optional(),\n /** Expected HTTP status code */\n expectedStatusCode: z.number().int().min(100).max(599),\n /** Expected response content */\n expectedResponse: z.string().optional(),\n /** JMESPath expression to extract from response */\n expectedResponseJMESPath: z.string().optional()\n});\n\nexport type SiteConfigTest = z.infer<typeof SiteConfigTestSchema>;\n\n/**\n * Site Config Test result.\n */\nexport interface SiteConfigTestResult extends BaseTestResult {\n type: TestType.SITE_CONFIG;\n result: boolean;\n actualStatusCode: number;\n actualResponse: unknown;\n allActualResponse: unknown;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Allowed commands for command execution tests.\n */\nexport const AllowedCommands = [\n 'yarn install --no-immutable && yarn build',\n 'npm run build',\n 'yarn typecheck'\n] as const;\n\n/**\n * Command Execution Test schema - tests that verify command execution.\n */\nexport const CommandExecutionTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.COMMAND_EXECUTION),\n /** Command to execute (must be in AllowedCommands) */\n command: z\n .string()\n .refine((value) => (AllowedCommands as readonly string[]).includes(value), {\n message: `Command must be one of: ${AllowedCommands.join(', ')}`\n }),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().default(0).optional()\n});\n\nexport type CommandExecutionTest = z.infer<typeof CommandExecutionTestSchema>;\n\n/**\n * Command Execution Test result.\n */\nexport interface CommandExecutionTestResult extends BaseTestResult {\n type: TestType.COMMAND_EXECUTION;\n stdout: string;\n stderr: string;\n exitCode: number | null;\n expectedExitCode: number;\n result: boolean;\n error?: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File Presence Test schema - tests that verify file existence.\n */\nexport const FilePresenceTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_PRESENCE),\n /** Paths to check */\n paths: z.array(z.string()),\n /** Whether files should exist (true) or not exist (false) */\n shouldExist: z.boolean()\n});\n\nexport type FilePresenceTest = z.infer<typeof FilePresenceTestSchema>;\n\n/**\n * File Presence Test result.\n */\nexport interface FilePresenceTestResult extends BaseTestResult {\n type: TestType.FILE_PRESENCE;\n result: boolean;\n existingPaths: string[];\n missingPaths: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * File content checks schema.\n */\nexport const FileContentCheckSchema = z.object({\n /** Strings that must be present in the file */\n contains: z.array(z.string()).optional(),\n /** Strings that must NOT be present in the file */\n notContains: z.array(z.string()).optional(),\n /** Regex pattern the content must match */\n matches: z.string().optional(),\n /** JSON path checks for structured content */\n jsonPath: z\n .array(\n z.object({\n path: z.string(),\n value: z.unknown()\n })\n )\n .optional(),\n /** Lines that should be added (for diff checking) */\n added: z.array(z.string()).optional(),\n /** Lines that should be removed (for diff checking) */\n removed: z.array(z.string()).optional()\n});\n\nexport type FileContentCheck = z.infer<typeof FileContentCheckSchema>;\n\n/**\n * File Content Test schema - tests that verify file content.\n *\n * This also covers the FILE_MODIFICATION use case from the old system\n * by supporting added/removed line checks.\n */\nexport const FileContentTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.FILE_CONTENT),\n /** Path to the file to check */\n path: z.string(),\n /** Content checks to perform */\n checks: FileContentCheckSchema\n});\n\nexport type FileContentTest = z.infer<typeof FileContentTestSchema>;\n\n/**\n * File Content Test result.\n */\nexport interface FileContentTestResult extends BaseTestResult {\n type: TestType.FILE_CONTENT;\n result: boolean;\n diff?: string;\n failedChecks?: string[];\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Build Check Test schema - tests that verify build success.\n */\nexport const BuildCheckTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.BUILD_CHECK),\n /** Build command to execute */\n command: z.string(),\n /** Whether the build should succeed */\n expectSuccess: z.boolean(),\n /** Maximum allowed warnings (optional) */\n allowedWarnings: z.number().optional(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type BuildCheckTest = z.infer<typeof BuildCheckTestSchema>;\n\n/**\n * Build Check Test result.\n */\nexport interface BuildCheckTestResult extends BaseTestResult {\n type: TestType.BUILD_CHECK;\n result: boolean;\n exitCode: number;\n stdout: string;\n stderr: string;\n warningCount: number;\n duration: number;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Vitest Test schema - tests that run Vitest test files.\n */\nexport const VitestTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.VITEST),\n /** Test file content */\n testFile: z.string(),\n /** Name of the test file */\n testFileName: z.string(),\n /** Minimum pass rate required (0-100) */\n minPassRate: z.number().min(0).max(100)\n});\n\nexport type VitestTest = z.infer<typeof VitestTestSchema>;\n\n/**\n * Vitest Test result.\n */\nexport interface VitestTestResult extends BaseTestResult {\n type: TestType.VITEST;\n result: boolean;\n passRate: number;\n passed: number;\n failed: number;\n skipped: number;\n total: number;\n duration: number;\n output: string;\n}\n", "import { z } from 'zod';\nimport { BaseTestSchema, BaseTestResult, TestType } from './base.js';\n\n/**\n * Playwright Natural Language Test schema - tests using natural language descriptions.\n */\nexport const PlaywrightNLTestSchema = BaseTestSchema.extend({\n type: z.literal(TestType.PLAYWRIGHT_NL),\n /** Natural language steps to execute */\n steps: z.array(z.string()),\n /** Expected outcome description */\n expectedOutcome: z.string(),\n /** Timeout in milliseconds */\n timeout: z.number().optional()\n});\n\nexport type PlaywrightNLTest = z.infer<typeof PlaywrightNLTestSchema>;\n\n/**\n * Playwright NL Test result.\n */\nexport interface PlaywrightNLTestResult extends BaseTestResult {\n type: TestType.PLAYWRIGHT_NL;\n result: boolean;\n stepsExecuted: number;\n totalSteps: number;\n failedStep?: string;\n screenshot?: string;\n duration: number;\n}\n", "import { z } from 'zod';\n\n/**\n * Assertion: the agent must have invoked one or more skills during the run.\n * Checked by inspecting the LLM trace for \"Skill\" tool uses with the given skills.\n * When multiple skills are in one assertion, they are treated as a group (1 assertion).\n * Each skill in the group must have been called for the assertion to pass.\n * To check skills independently, add them as separate assertions.\n */\nexport const SkillWasCalledAssertionSchema = z.object({\n type: z.literal('skill_was_called'),\n /** Names of the skills that must have been called (matched against trace Skill tool args) */\n skillNames: z.array(z.string()).min(1)\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\n/**\n * Assertion: a build command must exit with the expected code (default 0).\n * Runs the command in the scenario working directory.\n */\nexport const BuildPassedAssertionSchema = z.object({\n type: z.literal('build_passed'),\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\n/**\n * Assertion: an LLM judges the scenario output (score 0-100).\n * Prompt can use {{output}}, {{cwd}}, {{changedFiles}}, {{trace}}.\n * Passes if judge score >= minScore.\n */\nexport const LlmJudgeAssertionSchema = z.object({\n type: z.literal('llm_judge'),\n /** Prompt template; placeholders: {{output}}, {{cwd}}, {{changedFiles}}, {{trace}} */\n prompt: z.string(),\n /** Optional system prompt for the judge (default asks for JSON with score) */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku) */\n model: z.string().optional(),\n maxTokens: z.number().int().optional(),\n temperature: z.number().min(0).max(1).optional()\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\n/**\n * Union of all assertion types (per scenario).\n * Each assertion has a type and type-specific data.\n * Uses z.union (not z.discriminatedUnion) for Zod v4 compatibility when used as array element.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n BuildPassedAssertionSchema,\n LlmJudgeAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\n", "import { z } from 'zod';\n\n/**\n * Local project configuration schema.\n */\nexport const LocalProjectConfigSchema = z.object({\n /** Template ID to use for the local project */\n templateId: z.string().optional(),\n /** Files to create in the project */\n files: z\n .array(\n z.object({\n path: z.string().min(1),\n content: z.string().min(1)\n })\n )\n .optional()\n});\n\nexport type LocalProjectConfig = z.infer<typeof LocalProjectConfigSchema>;\n\n/**\n * Meta site configuration schema for API-based setup.\n */\nexport const MetaSiteConfigSchema = z.object({\n configurations: z\n .array(\n z.object({\n name: z.string().min(1),\n apiCalls: z.array(\n z.object({\n url: z.string().url(),\n method: z.enum(['POST', 'PUT']),\n body: z.string()\n })\n )\n })\n )\n .optional()\n});\n\nexport type MetaSiteConfig = z.infer<typeof MetaSiteConfigSchema>;\n\n/**\n * Environment configuration schema.\n *\n * Defines the environment setup required for running a test scenario.\n * Migrated from the old Prompt schema.\n */\nexport const EnvironmentSchema = z.object({\n /** Local project configuration */\n localProject: LocalProjectConfigSchema.optional(),\n /** Meta site configuration */\n metaSite: MetaSiteConfigSchema.optional()\n});\n\nexport type Environment = z.infer<typeof EnvironmentSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { AssertionSchema } from './assertions.js';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\n\n/**\n * Expected file schema - a file the agent is expected to create or modify.\n * Used by eval results; not persisted on test_scenarios table.\n */\nexport const ExpectedFileSchema = z.object({\n /** Relative path where the file should be created */\n path: z.string(),\n /** Optional expected content */\n content: z.string().optional()\n});\n\nexport type ExpectedFile = z.infer<typeof ExpectedFileSchema>;\n\n/**\n * TestScenario schema - defines a single test scenario.\n *\n * Persisted shape matches test_scenarios table:\n * id, project_id, name, description, trigger_prompt, template_id, created_at, updated_at, deleted.\n * Linked assertions stored in scenario_assertions junction table.\n */\nexport const TestScenarioSchema = TenantEntitySchema.extend({\n /** The prompt sent to the agent to trigger the task */\n triggerPrompt: z.string().min(10),\n /** ID of the template to use for this scenario (null = no template) */\n templateId: z.string().nullish(),\n /** Inline assertions to evaluate for this scenario (legacy) */\n assertions: z.array(AssertionSchema).optional(),\n /** IDs of saved assertions to evaluate (from assertions table) - legacy, use assertionLinks */\n assertionIds: z.array(z.string()).optional(),\n /** Linked assertions with per-scenario parameter values */\n assertionLinks: z.array(ScenarioAssertionLinkSchema).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestScenarioInput = z.infer<\n typeof CreateTestScenarioInputSchema\n>;\n\n/**\n * Input schema for updating a TestScenario.\n */\nexport const UpdateTestScenarioInputSchema =\n CreateTestScenarioInputSchema.partial();\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, user-created)\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'build_passed',\n 'llm_judge'\n]);\n\n/**\n * Parameter types supported in assertion parameters.\n */\nexport const AssertionParameterTypeSchema = z.enum([\n 'string',\n 'number',\n 'boolean'\n]);\n\nexport type AssertionParameterType = z.infer<\n typeof AssertionParameterTypeSchema\n>;\n\n/**\n * Schema for defining assertion parameters.\n * Parameters can be required or optional, with optional default values.\n */\nexport const AssertionParameterSchema = z.object({\n /** Parameter name (used as key in params object) */\n name: z.string().min(1),\n /** Display label for the parameter */\n label: z.string().min(1),\n /** Parameter type */\n type: AssertionParameterTypeSchema,\n /** Whether this parameter is required */\n required: z.boolean(),\n /** Default value (optional, used when not provided) */\n defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(),\n /** If true, parameter is hidden by default behind \"Show advanced options\" */\n advanced: z.boolean().optional()\n});\n\nexport type AssertionParameter = z.infer<typeof AssertionParameterSchema>;\n\n/**\n * Schema for scenario-assertion link with parameter values.\n * Used when linking assertions to scenarios with specific parameter values.\n */\nexport const ScenarioAssertionLinkSchema = z.object({\n /** ID of the assertion (can be system assertion like 'system:skill_was_called' or custom assertion UUID) */\n assertionId: z.string(),\n /** Parameter values for this assertion in this scenario */\n params: z\n .record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.null()])\n )\n .optional()\n});\n\nexport type ScenarioAssertionLink = z.infer<typeof ScenarioAssertionLinkSchema>;\n\nexport type AssertionType = z.infer<typeof AssertionTypeSchema>;\n\n/**\n * Configuration for skill_was_called assertion type.\n * Multiple skills in one assertion are treated as a group (1 assertion).\n * All skills in the group must have been called for the assertion to pass.\n */\nexport const SkillWasCalledConfigSchema = z.object({\n /** Names of the skills that must have been called */\n skillNames: z.array(z.string().min(1)).min(1)\n});\n\nexport type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;\n\n/**\n * Configuration for build_passed assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching LlmJudge configs).\n */\nexport const BuildPassedConfigSchema = z.strictObject({\n /** Command to run (default: \"yarn build\") */\n command: z.string().optional(),\n /** Expected exit code (default: 0) */\n expectedExitCode: z.number().int().optional()\n});\n\nexport type BuildPassedConfig = z.infer<typeof BuildPassedConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\n * User-created assertions with customizable parameters.\n */\nexport const LlmJudgeConfigSchema = z.object({\n /**\n * Prompt template with placeholders:\n * - {{output}}: agent's final output\n * - {{cwd}}: working directory\n * - {{changedFiles}}: all files changed (new, modified)\n * - {{modifiedFiles}}: only existing files that were modified\n * - {{newFiles}}: only new files that were created\n * - {{trace}}: step-by-step trace of tool calls\n * - Custom parameters defined in the parameters array\n */\n prompt: z.string().min(1),\n /** Optional system prompt for the judge */\n systemPrompt: z.string().optional(),\n /** Minimum score to pass (0-100, default 70) */\n minScore: z.number().int().min(0).max(100).optional(),\n /** Model for the judge (e.g. claude-3-5-haiku-20241022) */\n model: z.string().optional(),\n /** Max output tokens */\n maxTokens: z.number().int().optional(),\n /** Temperature (0-1) */\n temperature: z.number().min(0).max(1).optional(),\n /** User-defined parameters for this assertion */\n parameters: z.array(AssertionParameterSchema).optional()\n});\n\nexport type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;\n\n/**\n * Union of all assertion config types.\n * Order matters: schemas with required fields first, then optional-only schemas.\n * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillNames)\n * are matched before BuildPassed (all optional) or empty object.\n */\nexport const AssertionConfigSchema = z.union([\n LlmJudgeConfigSchema, // requires prompt - check first\n SkillWasCalledConfigSchema, // requires skillName\n BuildPassedConfigSchema, // all optional, uses strictObject to reject unknown keys\n z.object({}) // fallback empty config\n]);\n\nexport type AssertionConfig = z.infer<typeof AssertionConfigSchema>;\n\n/**\n * Custom Assertion entity - stored in the database.\n * Replaces inline assertions in test scenarios.\n */\nexport const CustomAssertionSchema = TenantEntitySchema.extend({\n /** The assertion type */\n type: AssertionTypeSchema,\n /** Type-specific configuration */\n config: AssertionConfigSchema\n});\n\nexport type CustomAssertion = z.infer<typeof CustomAssertionSchema>;\n\n/**\n * Input schema for creating a new CustomAssertion.\n */\nexport const CreateCustomAssertionInputSchema = CustomAssertionSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateCustomAssertionInput = z.infer<\n typeof CreateCustomAssertionInputSchema\n>;\n\n/**\n * Input schema for updating a CustomAssertion.\n */\nexport const UpdateCustomAssertionInputSchema =\n CreateCustomAssertionInputSchema.partial();\n\nexport type UpdateCustomAssertionInput = z.infer<\n typeof UpdateCustomAssertionInputSchema\n>;\n\n/**\n * Helper function to validate config based on assertion type.\n * Returns true if config is valid for the given type.\n */\nexport function validateAssertionConfig(\n type: AssertionType,\n config: unknown\n): boolean {\n switch (type) {\n case 'skill_was_called':\n return SkillWasCalledConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n\n/**\n * Get typed config for skill_was_called assertion.\n */\nexport function getSkillWasCalledConfig(\n assertion: CustomAssertion\n): SkillWasCalledConfig | null {\n if (assertion.type !== 'skill_was_called') return null;\n const result = SkillWasCalledConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for build_passed assertion.\n */\nexport function getBuildPassedConfig(\n assertion: CustomAssertion\n): BuildPassedConfig | null {\n if (assertion.type !== 'build_passed') return null;\n const result = BuildPassedConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n\n/**\n * Get typed config for llm_judge assertion.\n */\nexport function getLlmJudgeConfig(\n assertion: CustomAssertion\n): LlmJudgeConfig | null {\n if (assertion.type !== 'llm_judge') return null;\n const result = LlmJudgeConfigSchema.safeParse(assertion.config);\n return result.success ? result.data : null;\n}\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * TestSuite schema - a collection of test scenarios.\n *\n * Suites are used to organize and group related test scenarios.\n */\nexport const TestSuiteSchema = TenantEntitySchema.extend({\n /** IDs of test scenarios in this suite */\n scenarioIds: z.array(z.string())\n});\n\nexport type TestSuite = z.infer<typeof TestSuiteSchema>;\n\n/**\n * Input schema for creating a new TestSuite.\n */\nexport const CreateTestSuiteInputSchema = TestSuiteSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTestSuiteInput = z.infer<typeof CreateTestSuiteInputSchema>;\n\n/**\n * Input schema for updating a TestSuite.\n */\nexport const UpdateTestSuiteInputSchema = CreateTestSuiteInputSchema.partial();\n\nexport type UpdateTestSuiteInput = z.infer<typeof UpdateTestSuiteInputSchema>;\n", "import { z } from 'zod';\n\n/**\n * Token usage schema.\n */\nexport const TokenUsageSchema = z.object({\n prompt: z.number(),\n completion: z.number(),\n total: z.number()\n});\n\nexport type TokenUsage = z.infer<typeof TokenUsageSchema>;\n\n/**\n * Evaluation metrics schema.\n */\nexport const EvalMetricsSchema = z.object({\n totalAssertions: z.number(),\n passed: z.number(),\n failed: z.number(),\n skipped: z.number(),\n errors: z.number(),\n passRate: z.number(),\n avgDuration: z.number(),\n totalDuration: z.number()\n});\n\nexport type EvalMetrics = z.infer<typeof EvalMetricsSchema>;\n\n/**\n * Evaluation status enum.\n */\nexport enum EvalStatus {\n PENDING = 'pending',\n RUNNING = 'running',\n COMPLETED = 'completed',\n FAILED = 'failed',\n CANCELLED = 'cancelled'\n}\n\nexport const EvalStatusSchema = z.enum(EvalStatus);\n\n/**\n * LLM step type enum.\n */\nexport enum LLMStepType {\n COMPLETION = 'completion',\n TOOL_USE = 'tool_use',\n TOOL_RESULT = 'tool_result',\n THINKING = 'thinking'\n}\n\n/**\n * LLM trace step schema.\n */\nexport const LLMTraceStepSchema = z.object({\n id: z.string(),\n stepNumber: z.number(),\n type: z.enum(LLMStepType),\n model: z.string(),\n provider: z.string(),\n startedAt: z.string(),\n durationMs: z.number(),\n tokenUsage: TokenUsageSchema,\n costUsd: z.number(),\n toolName: z.string().optional(),\n toolArguments: z.string().optional(),\n inputPreview: z.string().optional(),\n outputPreview: z.string().optional(),\n success: z.boolean(),\n error: z.string().optional()\n});\n\nexport type LLMTraceStep = z.infer<typeof LLMTraceStepSchema>;\n\n/**\n * LLM breakdown stats schema.\n */\nexport const LLMBreakdownStatsSchema = z.object({\n count: z.number(),\n durationMs: z.number(),\n tokens: z.number(),\n costUsd: z.number()\n});\n\nexport type LLMBreakdownStats = z.infer<typeof LLMBreakdownStatsSchema>;\n\n/**\n * LLM trace summary schema.\n */\nexport const LLMTraceSummarySchema = z.object({\n totalSteps: z.number(),\n totalDurationMs: z.number(),\n totalTokens: TokenUsageSchema,\n totalCostUsd: z.number(),\n stepTypeBreakdown: z.record(z.string(), LLMBreakdownStatsSchema).optional(),\n modelBreakdown: z.record(z.string(), LLMBreakdownStatsSchema),\n modelsUsed: z.array(z.string())\n});\n\nexport type LLMTraceSummary = z.infer<typeof LLMTraceSummarySchema>;\n\n/**\n * LLM trace schema.\n */\nexport const LLMTraceSchema = z.object({\n id: z.string(),\n steps: z.array(LLMTraceStepSchema),\n summary: LLMTraceSummarySchema\n});\n\nexport type LLMTrace = z.infer<typeof LLMTraceSchema>;\n", "import { z } from 'zod';\nimport { TestResult } from '../test/index.js';\nimport {\n EvalMetricsSchema,\n LLMTraceSchema,\n LLMTraceStepSchema\n} from './metrics.js';\nimport { DiffContentSchema, TemplateFileSchema } from './eval-run.js';\nimport { ModelConfigSchema } from '../common/models.js';\nimport { ExpectedFileSchema } from '../scenario/test-scenario.js';\n\n/**\n * Assertion result status enum.\n * Defined locally to avoid bundling eval-assertions Node.js code in browser.\n * This is structurally identical to the one in @wix/eval-assertions.\n */\nexport enum AssertionResultStatus {\n PASSED = 'passed',\n FAILED = 'failed',\n SKIPPED = 'skipped',\n ERROR = 'error'\n}\n\n/**\n * Assertion result schema.\n */\nexport const AssertionResultSchema = z.object({\n id: z.string(),\n assertionId: z.string(),\n assertionType: z.string(),\n assertionName: z.string(),\n status: z.enum(AssertionResultStatus),\n message: z.string().optional(),\n expected: z.string().optional(),\n actual: z.string().optional(),\n duration: z.number().optional(),\n details: z.record(z.string(), z.unknown()).optional(),\n llmTraceSteps: z.array(LLMTraceStepSchema).optional()\n});\n\nexport type AssertionResult = z.infer<typeof AssertionResultSchema>;\n\n/**\n * Evaluation run result schema - result for a single scenario/target combination.\n */\nexport const EvalRunResultSchema = z.object({\n id: z.string(),\n targetId: z.string(),\n targetName: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n modelConfig: ModelConfigSchema.optional(),\n assertionResults: z.array(AssertionResultSchema),\n metrics: EvalMetricsSchema.optional(),\n passed: z.number(),\n failed: z.number(),\n passRate: z.number(),\n duration: z.number(),\n outputText: z.string().optional(),\n files: z.array(ExpectedFileSchema).optional(),\n fileDiffs: z.array(DiffContentSchema).optional(),\n /** Full template files after execution with status indicators */\n templateFiles: z.array(TemplateFileSchema).optional(),\n startedAt: z.string().optional(),\n completedAt: z.string().optional(),\n llmTrace: LLMTraceSchema.optional()\n});\n\nexport type EvalRunResult = z.infer<typeof EvalRunResultSchema>;\n\n/**\n * Prompt result schema - detailed result from prompt execution.\n */\nexport const PromptResultSchema = z.object({\n text: z.string(),\n files: z.array(z.unknown()).optional(),\n finishReason: z.string().optional(),\n reasoning: z.string().optional(),\n reasoningDetails: z.unknown().optional(),\n toolCalls: z.array(z.unknown()).optional(),\n toolResults: z.array(z.unknown()).optional(),\n warnings: z.array(z.unknown()).optional(),\n sources: z.array(z.unknown()).optional(),\n steps: z.array(z.unknown()),\n generationTimeMs: z.number(),\n prompt: z.string(),\n systemPrompt: z.string(),\n usage: z.object({\n totalTokens: z.number().optional(),\n totalMicrocentsSpent: z.number().optional()\n })\n});\n\nexport type PromptResult = z.infer<typeof PromptResultSchema>;\n\n/**\n * Full evaluation result schema - complete result for a single evaluation.\n */\nexport const EvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n promptResult: PromptResultSchema,\n testResults: z.array(z.unknown()) as z.ZodType<TestResult[]>,\n tags: z.array(z.string()).optional(),\n feedback: z.string().optional(),\n score: z.number(),\n suiteId: z.string().optional()\n});\n\nexport type EvaluationResult = z.infer<typeof EvaluationResultSchema>;\n\n/**\n * Lean evaluation result - summary for listing.\n */\nexport const LeanEvaluationResultSchema = z.object({\n id: z.string(),\n runId: z.string(),\n timestamp: z.number(),\n tags: z.array(z.string()).optional(),\n scenarioId: z.string(),\n scenarioVersion: z.number().optional(),\n targetId: z.string(),\n targetVersion: z.number().optional(),\n suiteId: z.string().optional(),\n score: z.number(),\n time: z.number().optional(),\n microcentsSpent: z.number().optional()\n});\n\nexport type LeanEvaluationResult = z.infer<typeof LeanEvaluationResultSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { EvalRunResultSchema } from './eval-result.js';\nimport {\n EvalMetricsSchema,\n EvalStatusSchema,\n LLMTraceSummarySchema\n} from './metrics.js';\nimport { LiveTraceEventSchema } from './live-trace.js';\n\n/**\n * Trigger types for evaluations.\n */\nexport enum TriggerType {\n RESOURCES_UPDATED = 'RESOURCES_UPDATED',\n MCP_VERSION_RELEASE = 'MCP_VERSION_RELEASE',\n MCP_PREVIEW_CREATED = 'MCP_PREVIEW_CREATED',\n MANUAL = 'MANUAL'\n}\n\n/**\n * Trigger metadata schema.\n */\nexport const TriggerMetadataSchema = z.object({\n version: z.string().optional(),\n resourceUpdated: z.array(z.string()).optional()\n});\n\nexport type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;\n\n/**\n * Trigger schema.\n */\nexport const TriggerSchema = z.object({\n id: z.string(),\n metadata: TriggerMetadataSchema.optional(),\n type: z.enum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\n\n/**\n * Failure category enum.\n */\nexport enum FailureCategory {\n MISSING_FILE = 'missing_file',\n WRONG_CONTENT = 'wrong_content',\n BUILD_ERROR = 'build_error',\n TEST_FAILURE = 'test_failure',\n RUNTIME_ERROR = 'runtime_error',\n PERFORMANCE = 'performance'\n}\n\n/**\n * Failure severity enum.\n */\nexport enum FailureSeverity {\n CRITICAL = 'critical',\n HIGH = 'high',\n MEDIUM = 'medium',\n LOW = 'low'\n}\n\n/**\n * Diff line type schema.\n */\nexport const DiffLineTypeSchema = z.enum(['added', 'removed', 'unchanged']);\nexport type DiffLineType = z.infer<typeof DiffLineTypeSchema>;\n\n/**\n * Diff line schema - represents a single line in a diff.\n */\nexport const DiffLineSchema = z.object({\n type: DiffLineTypeSchema,\n content: z.string(),\n lineNumber: z.number()\n});\n\nexport type DiffLine = z.infer<typeof DiffLineSchema>;\n\n/**\n * Diff content schema - represents a file diff.\n */\nexport const DiffContentSchema = z.object({\n path: z.string(),\n expected: z.string(),\n actual: z.string(),\n diffLines: z.array(DiffLineSchema),\n renamedFrom: z.string().optional()\n});\n\nexport type DiffContent = z.infer<typeof DiffContentSchema>;\n\n/**\n * Command execution schema.\n */\nexport const CommandExecutionSchema = z.object({\n command: z.string(),\n exitCode: z.number(),\n output: z.string().optional(),\n duration: z.number()\n});\n\nexport type CommandExecution = z.infer<typeof CommandExecutionSchema>;\n\n/**\n * File modification schema.\n */\nexport const FileModificationSchema = z.object({\n path: z.string(),\n action: z.enum(['created', 'modified', 'deleted'])\n});\n\nexport type FileModification = z.infer<typeof FileModificationSchema>;\n\n/**\n * Template file status enum.\n */\nexport enum TemplateFileStatus {\n NEW = 'new',\n MODIFIED = 'modified',\n UNCHANGED = 'unchanged'\n}\n\n/**\n * Template file schema - represents a file in the template with its full content.\n */\nexport const TemplateFileSchema = z.object({\n /** Relative path within the template */\n path: z.string(),\n /** Full file content after execution */\n content: z.string(),\n /** File status (new, modified, unchanged) */\n status: z.enum(['new', 'modified', 'unchanged'])\n});\n\nexport type TemplateFile = z.infer<typeof TemplateFileSchema>;\n\n/**\n * API call schema.\n */\nexport const ApiCallSchema = z.object({\n endpoint: z.string(),\n tokensUsed: z.number(),\n duration: z.number()\n});\n\nexport type ApiCall = z.infer<typeof ApiCallSchema>;\n\n/**\n * Execution trace schema - represents detailed execution information.\n */\nexport const ExecutionTraceSchema = z.object({\n commands: z.array(CommandExecutionSchema),\n filesModified: z.array(FileModificationSchema),\n apiCalls: z.array(ApiCallSchema),\n totalDuration: z.number()\n});\n\nexport type ExecutionTrace = z.infer<typeof ExecutionTraceSchema>;\n\n/**\n * Failure analysis schema.\n */\nexport const FailureAnalysisSchema = z.object({\n category: z.enum(FailureCategory),\n severity: z.enum(FailureSeverity),\n summary: z.string(),\n details: z.string(),\n rootCause: z.string(),\n suggestedFix: z.string(),\n relatedAssertions: z.array(z.string()),\n codeSnippet: z.string().optional(),\n similarIssues: z.array(z.string()).optional(),\n patternId: z.string().optional(),\n // Extended fields for detailed debugging\n diff: DiffContentSchema.optional(),\n executionTrace: ExecutionTraceSchema.optional()\n});\n\nexport type FailureAnalysis = z.infer<typeof FailureAnalysisSchema>;\n\n/**\n * Evaluation run schema.\n *\n * Represents a complete evaluation run with configuration, results, and metrics.\n */\nexport const EvalRunSchema = TenantEntitySchema.extend({\n /** Agent ID for this run */\n agentId: z.string().optional(),\n /** Skills group ID for this run */\n skillsGroupId: z.string().optional(),\n /** Scenario IDs to run */\n scenarioIds: z.array(z.string()),\n /** Current status */\n status: EvalStatusSchema,\n /** Progress percentage (0-100) */\n progress: z.number(),\n /** Results for each scenario/target combination (lazy to break eval-result \u2194 eval-run cycle) */\n results: z.array(z.lazy(() => EvalRunResultSchema)),\n /** Aggregated metrics across all results */\n aggregateMetrics: EvalMetricsSchema,\n /** Failure analyses */\n failureAnalyses: z.array(FailureAnalysisSchema).optional(),\n /** Aggregated LLM trace summary */\n llmTraceSummary: LLMTraceSummarySchema.optional(),\n /** What triggered this run */\n trigger: TriggerSchema.optional(),\n /** When the run started (set when evaluation is triggered) */\n startedAt: z.string().optional(),\n /** When the run completed */\n completedAt: z.string().optional(),\n /** Live trace events captured during execution (for playback on results page) */\n liveTraceEvents: z.array(LiveTraceEventSchema).optional(),\n /** Remote job ID for tracking execution in Dev Machines */\n jobId: z.string().optional(),\n /** Remote job status from the Dev Machine API (PENDING, RUNNING, COMPLETED, FAILED, CANCELLED) */\n jobStatus: z.string().optional(),\n /** Remote job error message if the job failed */\n jobError: z.string().optional(),\n /** Timestamp of the last job status check */\n jobStatusCheckedAt: z.string().optional(),\n /** MCP server IDs to enable for this run (optional) */\n mcpIds: z.array(z.string()).optional(),\n /** Sub-agent IDs to enable for this run (optional) */\n subAgentIds: z.array(z.string()).optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n */\nexport const CreateEvalRunInputSchema = EvalRunSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n status: true,\n progress: true,\n results: true,\n aggregateMetrics: true,\n startedAt: true,\n completedAt: true\n});\n\nexport type CreateEvalRunInput = z.infer<typeof CreateEvalRunInputSchema>;\n\n/**\n * Evaluation progress schema.\n */\nexport const EvaluationProgressSchema = z.object({\n runId: z.string(),\n targetId: z.string(),\n totalScenarios: z.number(),\n completedScenarios: z.number(),\n scenarioProgress: z.array(\n z.object({\n scenarioId: z.string(),\n currentStep: z.string(),\n error: z.string().optional()\n })\n ),\n createdAt: z.number()\n});\n\nexport type EvaluationProgress = z.infer<typeof EvaluationProgressSchema>;\n\n/**\n * Evaluation log schema.\n */\nexport const EvaluationLogSchema = z.object({\n runId: z.string(),\n scenarioId: z.string(),\n log: z.object({\n level: z.enum(['info', 'error', 'debug']),\n message: z.string().optional(),\n args: z.array(z.any()).optional(),\n error: z.string().optional()\n })\n});\n\nexport type EvaluationLog = z.infer<typeof EvaluationLogSchema>;\n\n/**\n * LLM timeout constant (2 minutes).\n */\nexport const LLM_TIMEOUT = 120000;\n", "import { z } from 'zod';\n\n/**\n * Live trace event type enum.\n * Maps to the step types but includes streaming states.\n */\nexport enum LiveTraceEventType {\n THINKING = 'thinking',\n TOOL_USE = 'tool_use',\n COMPLETION = 'completion',\n TOOL_RESULT = 'tool_result',\n /** Diagnostic information for debugging environment/setup issues */\n DIAGNOSTIC = 'diagnostic',\n /** Periodic progress heartbeat during long operations */\n PROGRESS = 'progress',\n /** File write operation */\n FILE_WRITE = 'file_write',\n /** File read operation */\n FILE_READ = 'file_read',\n /** System message from the SDK */\n SYSTEM = 'system',\n /** User message (tool result from file operations etc.) */\n USER = 'user'\n}\n\n/**\n * Live trace event schema.\n * Represents a single trace event emitted during agent execution.\n */\nexport const LiveTraceEventSchema = z.object({\n /** The evaluation run ID */\n evalRunId: z.string(),\n /** The scenario ID being executed */\n scenarioId: z.string(),\n /** The scenario name for display */\n scenarioName: z.string(),\n /** The target ID (skill, agent, etc.) */\n targetId: z.string(),\n /** The target name for display */\n targetName: z.string(),\n /** Step number in the current scenario execution */\n stepNumber: z.number(),\n /** Type of trace event */\n type: z.enum(LiveTraceEventType),\n /** Tool name if this is a tool_use event */\n toolName: z.string().optional(),\n /** Tool arguments preview (truncated JSON) */\n toolArgs: z.string().optional(),\n /** Output preview (truncated text) */\n outputPreview: z.string().optional(),\n /** File path for file operations */\n filePath: z.string().optional(),\n /** Elapsed time in milliseconds for progress events */\n elapsedMs: z.number().optional(),\n /** Thinking/reasoning text from Claude */\n thinking: z.string().optional(),\n /** Timestamp when this event occurred */\n timestamp: z.string(),\n /** Whether this is the final event for this scenario */\n isComplete: z.boolean()\n});\n\nexport type LiveTraceEvent = z.infer<typeof LiveTraceEventSchema>;\n\n/**\n * Prefix used in stdout to identify trace events.\n * Format: TRACE_EVENT:{json}\n */\nexport const TRACE_EVENT_PREFIX = 'TRACE_EVENT:';\n\n/**\n * Parse a line from stdout to extract a trace event if present.\n * @param line - A line from stdout\n * @returns The parsed LiveTraceEvent or null if not a trace event line\n */\nexport function parseTraceEventLine(line: string): LiveTraceEvent | null {\n if (!line.startsWith(TRACE_EVENT_PREFIX)) {\n return null;\n }\n\n try {\n const jsonStr = line.slice(TRACE_EVENT_PREFIX.length);\n const parsed = JSON.parse(jsonStr);\n const result = LiveTraceEventSchema.safeParse(parsed);\n return result.success ? result.data : null;\n } catch {\n return null;\n }\n}\n\n/**\n * Format a trace event as a stdout line.\n * @param event - The trace event to format\n * @returns The formatted line with prefix\n */\nexport function formatTraceEventLine(event: LiveTraceEvent): string {\n return `${TRACE_EVENT_PREFIX}${JSON.stringify(event)}`;\n}\n", "import { z } from 'zod';\nimport { BaseEntitySchema } from '../common/base-entity.js';\n\n/**\n * Project schema - represents a tenant/workspace for data isolation.\n *\n * All entities belong to a project. Projects are the top-level\n * organizational unit for multi-tenancy.\n *\n * Note: Project extends BaseEntity (not TenantEntity) since\n * Project IS the tenant and doesn't need a projectId.\n */\nexport const ProjectSchema = BaseEntitySchema.extend({\n appId: z.string().optional().describe('The ID of the app in Dev Center'),\n appSecret: z\n .string()\n .optional()\n .describe('The secret of the app in Dev Center')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n */\nexport const UpdateProjectInputSchema = CreateProjectInputSchema.partial();\n\nexport type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Template schema - a project template that can be used for test environments.\n *\n * Templates are tenant-based entities scoped to a project.\n * They define how to set up a project environment for testing.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** URL to download the template from */\n downloadUrl: z.url()\n});\n\nexport type Template = z.infer<typeof TemplateSchema>;\n\n/**\n * Input schema for creating a new Template.\n */\nexport const CreateTemplateInputSchema = TemplateSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateTemplateInput = z.infer<typeof CreateTemplateInputSchema>;\n\n/**\n * Input schema for updating a Template.\n */\nexport const UpdateTemplateInputSchema = CreateTemplateInputSchema.partial();\n\nexport type UpdateTemplateInput = z.infer<typeof UpdateTemplateInputSchema>;\n", "import type { AssertionParameter, AssertionType } from './assertion.js';\n\n/**\n * System assertion definition - built-in assertions available to all projects.\n * These are not stored in the database but defined in code.\n */\nexport interface SystemAssertion {\n /** Unique ID prefixed with 'system:' */\n id: string;\n /** Display name */\n name: string;\n /** Description of what the assertion checks */\n description: string;\n /** Assertion type */\n type: AssertionType;\n /** Parameters that can be configured per-scenario */\n parameters: AssertionParameter[];\n}\n\n/**\n * System assertion IDs - prefixed with 'system:' to distinguish from custom assertions.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n BUILD_PASSED: 'system:build_passed',\n LLM_JUDGE: 'system:llm_judge'\n} as const;\n\nexport type SystemAssertionId =\n (typeof SYSTEM_ASSERTION_IDS)[keyof typeof SYSTEM_ASSERTION_IDS];\n\n/**\n * Check if an assertion ID is a system assertion.\n */\nexport function isSystemAssertionId(id: string): id is SystemAssertionId {\n return id.startsWith('system:');\n}\n\n/**\n * Built-in system assertions.\n * These are available to all projects without needing to create them.\n */\nexport const SYSTEM_ASSERTIONS: Record<SystemAssertionId, SystemAssertion> = {\n [SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED]: {\n id: SYSTEM_ASSERTION_IDS.SKILL_WAS_CALLED,\n name: 'Skill Was Called',\n description:\n 'Check that one or more skills were invoked during the agent run',\n type: 'skill_was_called',\n parameters: [\n {\n name: 'skillNames',\n label: 'Skills',\n type: 'string',\n required: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.BUILD_PASSED]: {\n id: SYSTEM_ASSERTION_IDS.BUILD_PASSED,\n name: 'Build Passed',\n description: 'Run a build command and verify it exits with expected code',\n type: 'build_passed',\n parameters: [\n {\n name: 'command',\n label: 'Build Command',\n type: 'string',\n required: false,\n defaultValue: 'yarn build'\n },\n {\n name: 'expectedExitCode',\n label: 'Expected Exit Code',\n type: 'number',\n required: false,\n defaultValue: 0\n },\n {\n name: 'maxBuildTime',\n label: 'Max Build Time (ms)',\n type: 'number',\n required: false,\n advanced: true\n },\n {\n name: 'maxMemory',\n label: 'Max Memory (MB)',\n type: 'number',\n required: false,\n advanced: true\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.LLM_JUDGE]: {\n id: SYSTEM_ASSERTION_IDS.LLM_JUDGE,\n name: 'LLM Judge',\n description: 'LLM evaluates the output and assigns a score (0-100)',\n type: 'llm_judge',\n parameters: [\n {\n name: 'prompt',\n label: 'Judge Prompt',\n type: 'string',\n required: true,\n defaultValue: 'Verify the output meets the acceptance criteria.'\n },\n {\n name: 'systemPrompt',\n label: 'System Prompt (optional)',\n type: 'string',\n required: false,\n defaultValue:\n 'You are judging a scenario run. Use these values:\\n- {{output}}: the agent\\'s final output\\n- {{cwd}}: working directory\\n- {{changedFiles}}: list of files changed (or \"No files were changed\")\\n- {{trace}}: step-by-step trace (tool calls, completions) to check e.g. which tools were called and how many times\\n\\nJudge how well the output meets the acceptance criteria stated in the user prompt.'\n },\n {\n name: 'minScore',\n label: 'Minimum Score (0-100)',\n type: 'number',\n required: false,\n defaultValue: 70\n }\n ]\n }\n};\n\n/**\n * Get all system assertions as an array.\n */\nexport function getSystemAssertions(): SystemAssertion[] {\n return Object.values(SYSTEM_ASSERTIONS);\n}\n\n/**\n * Get a system assertion by ID.\n */\nexport function getSystemAssertion(\n id: SystemAssertionId\n): SystemAssertion | undefined {\n return SYSTEM_ASSERTIONS[id];\n}\n"],
5
+ "mappings": ";AAAA,SAAS,SAAS;AAKX,IAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,aAAa,EAAE,OAAO;AAAA,EACtB,WAAW,EAAE,OAAO;AAAA,EACpB,WAAW,EAAE,OAAO;AAAA,EACpB,SAAS,EAAE,QAAQ,EAAE,SAAS;AAChC,CAAC;AAOM,IAAM,qBAAqB,iBAAiB,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"z", "z", "z", "z", "TestType", "TestImportance", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "z", "EvalStatus", "LLMStepType", "z", "z", "z", "LiveTraceEventType", "TriggerType", "z", "FailureCategory", "FailureSeverity", "TemplateFileStatus", "AssertionResultStatus", "z", "z", "z", "z", "z"]
7
7
  }
@@ -2,6 +2,8 @@ import type { Skill } from '../target/skill.js';
2
2
  import type { TestScenario } from '../scenario/test-scenario.js';
3
3
  import type { ModelConfig } from '../common/models.js';
4
4
  import type { LLMTrace } from '../evaluation/metrics.js';
5
+ import type { MCPEntity } from '../common/mcp.js';
6
+ import type { SubAgent } from '../target/sub-agent.js';
5
7
  /**
6
8
  * Trace context for live streaming of agent execution.
7
9
  * This is agent-agnostic and can be used by any adapter implementation.
@@ -50,6 +52,10 @@ export interface AgentExecutionContext {
50
52
  aiGatewayHeaders?: Record<string, string>;
51
53
  /** Trace context for live streaming (optional) */
52
54
  traceContext?: TraceContext;
55
+ /** MCPs to load (when present, .mcp.json is written and mcp__* allowed) */
56
+ mcps?: MCPEntity[];
57
+ /** Sub-agents to load (when present, written to .claude/agents/*.md) */
58
+ subAgents?: SubAgent[];
53
59
  }
54
60
  /**
55
61
  * Token usage statistics from agent execution.
@@ -48,9 +48,11 @@ export type ScenarioAssertionLink = z.infer<typeof ScenarioAssertionLinkSchema>;
48
48
  export type AssertionType = z.infer<typeof AssertionTypeSchema>;
49
49
  /**
50
50
  * Configuration for skill_was_called assertion type.
51
+ * Multiple skills in one assertion are treated as a group (1 assertion).
52
+ * All skills in the group must have been called for the assertion to pass.
51
53
  */
52
54
  export declare const SkillWasCalledConfigSchema: z.ZodObject<{
53
- skillName: z.ZodString;
55
+ skillNames: z.ZodArray<z.ZodString>;
54
56
  }, z.core.$strip>;
55
57
  export type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;
56
58
  /**
@@ -92,7 +94,7 @@ export type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;
92
94
  /**
93
95
  * Union of all assertion config types.
94
96
  * Order matters: schemas with required fields first, then optional-only schemas.
95
- * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillName)
97
+ * This ensures LlmJudge (requires prompt) and SkillWasCalled (requires skillNames)
96
98
  * are matched before BuildPassed (all optional) or empty object.
97
99
  */
98
100
  export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -115,7 +117,7 @@ export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
115
117
  advanced: z.ZodOptional<z.ZodBoolean>;
116
118
  }, z.core.$strip>>>;
117
119
  }, z.core.$strip>, z.ZodObject<{
118
- skillName: z.ZodString;
120
+ skillNames: z.ZodArray<z.ZodString>;
119
121
  }, z.core.$strip>, z.ZodObject<{
120
122
  /** Command to run (default: "yarn build") */
121
123
  command: z.ZodOptional<z.ZodString>;
@@ -160,7 +162,7 @@ export declare const CustomAssertionSchema: z.ZodObject<{
160
162
  advanced: z.ZodOptional<z.ZodBoolean>;
161
163
  }, z.core.$strip>>>;
162
164
  }, z.core.$strip>, z.ZodObject<{
163
- skillName: z.ZodString;
165
+ skillNames: z.ZodArray<z.ZodString>;
164
166
  }, z.core.$strip>, z.ZodObject<{
165
167
  /** Command to run (default: "yarn build") */
166
168
  command: z.ZodOptional<z.ZodString>;
@@ -201,7 +203,7 @@ export declare const CreateCustomAssertionInputSchema: z.ZodObject<{
201
203
  advanced: z.ZodOptional<z.ZodBoolean>;
202
204
  }, z.core.$strip>>>;
203
205
  }, z.core.$strip>, z.ZodObject<{
204
- skillName: z.ZodString;
206
+ skillNames: z.ZodArray<z.ZodString>;
205
207
  }, z.core.$strip>, z.ZodObject<{
206
208
  /** Command to run (default: "yarn build") */
207
209
  command: z.ZodOptional<z.ZodString>;
@@ -242,7 +244,7 @@ export declare const UpdateCustomAssertionInputSchema: z.ZodObject<{
242
244
  advanced: z.ZodOptional<z.ZodBoolean>;
243
245
  }, z.core.$strip>>>;
244
246
  }, z.core.$strip>, z.ZodObject<{
245
- skillName: z.ZodString;
247
+ skillNames: z.ZodArray<z.ZodString>;
246
248
  }, z.core.$strip>, z.ZodObject<{
247
249
  /** Command to run (default: "yarn build") */
248
250
  command: z.ZodOptional<z.ZodString>;
@@ -1,12 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * Assertion: the agent must have invoked a specific skill during the run.
4
- * Checked by inspecting the LLM trace for a "Skill" tool use with the given skill.
5
- * Data: skillName (the skill that must have been called).
3
+ * Assertion: the agent must have invoked one or more skills during the run.
4
+ * Checked by inspecting the LLM trace for "Skill" tool uses with the given skills.
5
+ * When multiple skills are in one assertion, they are treated as a group (1 assertion).
6
+ * Each skill in the group must have been called for the assertion to pass.
7
+ * To check skills independently, add them as separate assertions.
6
8
  */
7
9
  export declare const SkillWasCalledAssertionSchema: z.ZodObject<{
8
10
  type: z.ZodLiteral<"skill_was_called">;
9
- skillName: z.ZodString;
11
+ skillNames: z.ZodArray<z.ZodString>;
10
12
  }, z.core.$strip>;
11
13
  export type SkillWasCalledAssertion = z.infer<typeof SkillWasCalledAssertionSchema>;
12
14
  /**
@@ -41,7 +43,7 @@ export type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;
41
43
  */
42
44
  export declare const AssertionSchema: z.ZodUnion<readonly [z.ZodObject<{
43
45
  type: z.ZodLiteral<"skill_was_called">;
44
- skillName: z.ZodString;
46
+ skillNames: z.ZodArray<z.ZodString>;
45
47
  }, z.core.$strip>, z.ZodObject<{
46
48
  type: z.ZodLiteral<"build_passed">;
47
49
  command: z.ZodOptional<z.ZodString>;
@@ -27,7 +27,7 @@ export declare const TestScenarioSchema: z.ZodObject<{
27
27
  templateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
28
  assertions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
29
29
  type: z.ZodLiteral<"skill_was_called">;
30
- skillName: z.ZodString;
30
+ skillNames: z.ZodArray<z.ZodString>;
31
31
  }, z.core.$strip>, z.ZodObject<{
32
32
  type: z.ZodLiteral<"build_passed">;
33
33
  command: z.ZodOptional<z.ZodString>;
@@ -59,7 +59,7 @@ export declare const CreateTestScenarioInputSchema: z.ZodObject<{
59
59
  triggerPrompt: z.ZodString;
60
60
  assertions: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
61
61
  type: z.ZodLiteral<"skill_was_called">;
62
- skillName: z.ZodString;
62
+ skillNames: z.ZodArray<z.ZodString>;
63
63
  }, z.core.$strip>, z.ZodObject<{
64
64
  type: z.ZodLiteral<"build_passed">;
65
65
  command: z.ZodOptional<z.ZodString>;
@@ -91,7 +91,7 @@ export declare const UpdateTestScenarioInputSchema: z.ZodObject<{
91
91
  triggerPrompt: z.ZodOptional<z.ZodString>;
92
92
  assertions: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
93
93
  type: z.ZodLiteral<"skill_was_called">;
94
- skillName: z.ZodString;
94
+ skillNames: z.ZodArray<z.ZodString>;
95
95
  }, z.core.$strip>, z.ZodObject<{
96
96
  type: z.ZodLiteral<"build_passed">;
97
97
  command: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-types",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Unified types for EvalForge agent evaluation system",
5
5
  "files": [
6
6
  "build"
@@ -46,5 +46,5 @@
46
46
  "artifactId": "evalforge-types"
47
47
  }
48
48
  },
49
- "falconPackageHash": "f67ac21e3b7c27217415021b6e6eae018d6deee731e94ae02891b4c3"
49
+ "falconPackageHash": "9767bb13c3873bf4f58025a518a83034601aec920b88ba970594a061"
50
50
  }