@wix/evalforge-types 0.75.0 → 0.77.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/common/base-entity.ts", "../src/common/github-source.ts", "../src/common/mcp.ts", "../src/common/models.ts", "../src/common/rule.ts", "../src/common/tool-names.ts", "../src/target/target.ts", "../src/target/agent.ts", "../src/target/skill.ts", "../src/target/sub-agent.ts", "../src/target/preset.ts", "../src/target/capability.ts", "../src/target/capability-converters.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/environment.ts", "../src/scenario/test-scenario.ts", "../src/assertion/assertion.ts", "../src/assertion/build-passed-command.ts", "../src/assertion/system-assertions.ts", "../src/scenario/batch-import.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/evaluation/conversation.ts", "../src/evaluation/eval-run-folder.ts", "../src/project/project.ts", "../src/template/template.ts", "../src/schedule/eval-schedule.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';\n\n/**\n * GitHub source reference for a file or directory in a GitHub repository.\n * Used by skills and templates (directory) and sub-agents (single file)\n * to point to content that can be fetched via the GitHub API.\n */\nexport const GitHubSourceSchema = z.object({\n /** GitHub org or user, e.g. \"wix\" */\n owner: z.string().min(1),\n /** Repository name, e.g. \"skills\" */\n repo: z.string().min(1),\n /** Path within the repo (file or directory), e.g. \"skills/my-skill\" or \"agents/reviewer.md\" */\n path: z.string().min(1),\n /** Git ref (branch, tag, or SHA), e.g. \"master\" or \"v1.2.0\" */\n ref: z.string().min(1)\n});\n\nexport type GitHubSource = z.infer<typeof GitHubSourceSchema>;\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 * `name` is a display label for the entity (does NOT need to match the server\n * key inside `config`).\n *\n * `config` is a keyed `.mcp.json` entry, e.g.:\n * ```json\n * { \"wix-mcp\": { \"type\": \"http\", \"url\": \"\u2026\", \"headers\": { \u2026 } } }\n * ```\n * At evaluation time every MCP's config is spread into the `mcpServers` object\n * of the generated `.mcp.json` file.\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name for the MCP entity (independent of the server key in config) */\n name: z.string().min(1),\n /** Keyed MCP server config \u2014 top-level key is the server name, value is its config */\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 * Curated model sets \u2014 only models suitable for code generation.\n * Uses official/canonical model IDs (not internal gateway enums).\n * Update these explicitly when new models become available.\n */\nexport const ClaudeModel = {\n CLAUDE_4_SONNET_1_0: 'claude-sonnet-4',\n CLAUDE_4_OPUS_1_0: 'claude-opus-4',\n CLAUDE_4_5_SONNET_1_0: 'claude-sonnet-4-5',\n CLAUDE_4_5_HAIKU_1_0: 'claude-haiku-4-5',\n CLAUDE_4_5_OPUS_1_0: 'claude-opus-4-5',\n CLAUDE_4_6_SONNET_1_0: 'claude-sonnet-4-6',\n CLAUDE_4_6_OPUS_1_0: 'claude-opus-4-6'\n} as const;\nexport type ClaudeModel = (typeof ClaudeModel)[keyof typeof ClaudeModel];\n\nexport const OpenAIModel = {\n GPT_4O_MINI_2024_07_18: 'gpt-4o-mini',\n GPT_4O_2024_11_20: 'gpt-4o',\n O1_2024_12_17: 'o1',\n O3_MINI_2025_01_31: 'o3-mini',\n GPT_4_1_2025_04_14: 'gpt-4.1',\n GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini',\n GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano',\n O3_2025_04_16: 'o3',\n O4_MINI_2025_04_16: 'o4-mini',\n GPT_5_2025_08_07: 'gpt-5',\n GPT_5_MINI_2025_08_07: 'gpt-5-mini',\n GPT_5_NANO_2025_08_07: 'gpt-5-nano'\n} as const;\nexport type OpenAIModel = (typeof OpenAIModel)[keyof typeof OpenAIModel];\n\nexport const AVAILABLE_CLAUDE_MODEL_IDS: ClaudeModel[] =\n Object.values(ClaudeModel);\n\nconst PREFERRED_JUDGE_MODEL = ClaudeModel.CLAUDE_4_5_HAIKU_1_0;\n\nexport const DEFAULT_JUDGE_MODEL: string = AVAILABLE_CLAUDE_MODEL_IDS.includes(\n PREFERRED_JUDGE_MODEL\n)\n ? PREFERRED_JUDGE_MODEL\n : AVAILABLE_CLAUDE_MODEL_IDS[0];\n\nexport const ClaudeModelSchema = z.enum(\n AVAILABLE_CLAUDE_MODEL_IDS as [string, ...string[]]\n);\n\nexport const AVAILABLE_OPENAI_MODEL_IDS: OpenAIModel[] =\n Object.values(OpenAIModel);\n\n/**\n * Models that support the OpenAI Responses API via the Wix AI Gateway.\n * Must match the CHAT_MODEL_TO_RESPONSES_MODEL mapping in the proxy.\n * These models use openai.responses() and support reasoningSummary.\n */\nexport const OPENAI_RESPONSES_MODEL_IDS: ReadonlySet<string> = new Set([\n OpenAIModel.GPT_5_2025_08_07,\n OpenAIModel.GPT_5_MINI_2025_08_07,\n OpenAIModel.GPT_5_NANO_2025_08_07\n]);\n\nexport const OpenAIModelSchema = z.enum(\n AVAILABLE_OPENAI_MODEL_IDS as [string, ...string[]]\n);\n\nexport const ALL_AVAILABLE_MODEL_IDS: string[] = [\n ...AVAILABLE_CLAUDE_MODEL_IDS,\n ...AVAILABLE_OPENAI_MODEL_IDS\n];\n\nexport const AnyModelSchema = z.enum(\n ALL_AVAILABLE_MODEL_IDS as [string, ...string[]]\n);\n\n/**\n * Maps legacy Wix AI Gateway enum strings to official model IDs.\n * Used for backward compatibility with stored data (DB, eval traces).\n */\nexport const LEGACY_MODEL_ID_MAP: Record<string, string> = {\n // Claude\n CLAUDE_4_SONNET_1_0: ClaudeModel.CLAUDE_4_SONNET_1_0,\n CLAUDE_4_OPUS_1_0: ClaudeModel.CLAUDE_4_OPUS_1_0,\n CLAUDE_4_5_SONNET_1_0: ClaudeModel.CLAUDE_4_5_SONNET_1_0,\n CLAUDE_4_5_HAIKU_1_0: ClaudeModel.CLAUDE_4_5_HAIKU_1_0,\n CLAUDE_4_5_OPUS_1_0: ClaudeModel.CLAUDE_4_5_OPUS_1_0,\n CLAUDE_4_6_SONNET_1_0: ClaudeModel.CLAUDE_4_6_SONNET_1_0,\n CLAUDE_4_6_OPUS_1_0: ClaudeModel.CLAUDE_4_6_OPUS_1_0,\n // OpenAI\n GPT_4O_MINI_2024_07_18: OpenAIModel.GPT_4O_MINI_2024_07_18,\n GPT_4O_2024_11_20: OpenAIModel.GPT_4O_2024_11_20,\n O1_2024_12_17: OpenAIModel.O1_2024_12_17,\n O3_MINI_2025_01_31: OpenAIModel.O3_MINI_2025_01_31,\n GPT_4_1_2025_04_14: OpenAIModel.GPT_4_1_2025_04_14,\n GPT_4_1_MINI_2025_04_14: OpenAIModel.GPT_4_1_MINI_2025_04_14,\n GPT_4_1_NANO_2025_04_14: OpenAIModel.GPT_4_1_NANO_2025_04_14,\n O3_2025_04_16: OpenAIModel.O3_2025_04_16,\n O4_MINI_2025_04_16: OpenAIModel.O4_MINI_2025_04_16,\n GPT_5_2025_08_07: OpenAIModel.GPT_5_2025_08_07,\n GPT_5_MINI_2025_08_07: OpenAIModel.GPT_5_MINI_2025_08_07,\n GPT_5_NANO_2025_08_07: OpenAIModel.GPT_5_NANO_2025_08_07\n};\n\n/**\n * Normalize a model ID: translates legacy gateway enum strings to\n * official model IDs. Returns the input unchanged if already canonical.\n */\nexport function normalizeModelId(modelId: string): string {\n return LEGACY_MODEL_ID_MAP[modelId] ?? modelId;\n}\n\n/**\n * Model configuration schema for specifying model parameters.\n * Accepts any model from Claude or OpenAI providers.\n */\nconst nullToUndefined = (val: unknown) => (val === null ? undefined : val);\n\nexport const ModelConfigSchema = z.object({\n model: AnyModelSchema,\n temperature: z.preprocess(\n nullToUndefined,\n z.number().min(0).max(1).optional()\n ),\n maxTokens: z.preprocess(nullToUndefined, z.number().min(1).optional()),\n maxTurns: z.preprocess(nullToUndefined, z.number().int().min(1).optional())\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\nexport const RuleTypeSchema = z.enum(['claude-md', 'agents-md', 'cursor-rule']);\nexport type RuleType = z.infer<typeof RuleTypeSchema>;\n\nexport const RuleSchema = TenantEntitySchema.extend({\n ruleType: RuleTypeSchema,\n content: z.string()\n});\n\nexport type Rule = z.infer<typeof RuleSchema>;\n\nconst RuleInputBaseSchema = RuleSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateRuleInputSchema = RuleInputBaseSchema;\nexport type CreateRuleInput = z.infer<typeof CreateRuleInputSchema>;\n\nexport const UpdateRuleInputSchema = RuleInputBaseSchema.partial();\nexport type UpdateRuleInput = z.infer<typeof UpdateRuleInputSchema>;\n", "// Convenience subset for autocomplete in the UI; users can still enter any custom tool name.\nexport const AVAILABLE_TOOL_NAMES = [\n 'Bash',\n 'Edit',\n 'Glob',\n 'Grep',\n 'Read',\n 'Skill',\n 'Write'\n] as const;\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 * Default behavioral instructions appended to the Claude Code system prompt\n * during evaluation runs. These ensure the agent executes autonomously without\n * waiting for human confirmation.\n */\nexport const DEFAULT_EVALUATOR_SYSTEM_PROMPT = `IMPORTANT: This is an automated evaluation run. Follow these guidelines:\n1. Execute the requested changes immediately without asking for confirmation.\n2. Do NOT ask \"would you like me to proceed?\" or similar questions.\n3. Do NOT use the Task tool to delegate simple operations - do them directly yourself.\n4. Keep your approach simple and direct - avoid excessive planning.\n5. Make targeted edits using Read and Edit tools rather than exploring the entire codebase.\n6. If you encounter an error, fix it directly rather than starting over.\n7. Your project root is the current working directory. Always create and modify source code files relative to the project root, NOT inside .claude/skills/ directories.\n8. Before finishing, run the project's package manager install command (e.g. \\`npm install\\`, \\`yarn install\\`, or \\`pnpm install\\` depending on the lockfile present) to ensure all dependencies are installed and the project is ready to build.`;\n\n/**\n * Agent type discriminator.\n * - CLI: External CLI tool (e.g. Claude Code, Codex)\n * - SDK: In-process SDK agent (e.g. Simple Agent via AI SDK)\n */\nexport const AgentType = {\n CLI: 'cli',\n SDK: 'sdk'\n} as const;\n\nexport type AgentTypeValue = (typeof AgentType)[keyof typeof AgentType];\n\nexport const AgentTypeSchema = z.enum([AgentType.CLI, AgentType.SDK]);\n\n/** Labels for agent types in UI dropdowns. */\nexport const AGENT_TYPE_LABELS: Record<AgentTypeValue, string> = {\n [AgentType.CLI]: 'CLI Agent',\n [AgentType.SDK]: 'Simple Agent'\n};\n\n/**\n * Supported agent CLI commands.\n *\n * Each value corresponds to a registered AgentAdapter in the evaluator.\n * When adding a new CLI agent adapter, add its command here first.\n */\nexport enum AgentRunCommand {\n CLAUDE = 'claude',\n OPENCODE = 'opencode'\n}\n\n/** All available run commands for use in dropdowns and validation. */\nexport const AVAILABLE_RUN_COMMANDS: AgentRunCommand[] =\n Object.values(AgentRunCommand);\n\n/** Labels for display in UI dropdowns. */\nexport const RUN_COMMAND_LABELS: Record<AgentRunCommand, string> = {\n [AgentRunCommand.CLAUDE]: 'Claude Code',\n [AgentRunCommand.OPENCODE]: 'OpenCode'\n};\n\nexport const AgentRunCommandSchema = z.nativeEnum(AgentRunCommand);\n\n/**\n * Agent schema.\n *\n * Agents can be CLI-based (external process) or SDK-based (in-process).\n * CLI agents use runCommand to select the adapter; SDK agents use their adapter ID.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Agent type: 'cli' for external CLI tools, 'sdk' for in-process SDK agents */\n agentType: AgentTypeSchema.default(AgentType.CLI),\n /** Command to run the agent (required for CLI agents, absent for SDK agents) */\n runCommand: AgentRunCommandSchema.optional(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional(),\n systemPrompt: z\n .string()\n .nullish()\n .describe(\n 'Override for eval runs. undefined=default instructions, null=raw agent, string=append to claude_code preset. See https://docs.anthropic.com/en/docs/claude-code/sdk/modifying-system-prompts'\n )\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 and systemPrompt can be null to explicitly clear (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable(),\n systemPrompt: z.string().optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { GitHubSourceSchema } from '../common/github-source.js';\n\nexport { GitHubSourceSchema };\nexport type { GitHubSource } from '../common/github-source.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 * Regex for valid semver strings (major.minor.patch).\n * Examples: 1.0.0, 2.3.1, 10.20.30\n */\nexport const SEMVER_REGEX = /^\\d+\\.\\d+\\.\\d+$/;\n\n/**\n * Origin of a skill version - how the version was created.\n * - manual: Created through the UI\n * - pr: Created from a pull request (via CI/CD API)\n * - master: Synced from the main branch (via CI/CD API)\n */\nexport const SkillVersionOriginSchema = z.enum(['manual', 'pr', 'master']);\nexport type SkillVersionOrigin = z.infer<typeof SkillVersionOriginSchema>;\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 * - license: License name or file reference (optional)\n * - compatibility: Environment requirements, max 500 chars (optional)\n * - allowedTools: Pre-approved tools the skill may use (space-delimited, experimental)\n * - metadata: Arbitrary key-value pairs for additional properties\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n license: z.string().optional(),\n compatibility: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n allowedTools: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * A single file within a skill directory snapshot.\n */\nexport const SkillFileSchema = z.object({\n /** Relative path within the skill directory, e.g. \"SKILL.md\" or \"references/API_SPEC.md\" */\n path: z.string().min(1),\n /** File content (UTF-8 text) */\n content: z.string()\n});\n\nexport type SkillFile = z.infer<typeof SkillFileSchema>;\n\n/**\n * Skill version - immutable snapshot of a Skill's content.\n *\n * New versions store a `files` array (snapshot of the skill directory from GitHub)\n * and a `source` reference (where the snapshot came from).\n *\n * Versions are immutable - editing creates a new version.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n skillId: z.string(),\n /** Semver string (e.g. \"1.2.0\") or Falcon fingerprint */\n version: z.string(),\n /** How this version was created */\n origin: SkillVersionOriginSchema,\n /** Where this snapshot was taken from */\n source: GitHubSourceSchema.optional(),\n /** Frozen snapshot of all files in the skill directory */\n files: z.array(SkillFileSchema).optional(),\n /** Optional notes about this version (changelog, reason for change) */\n notes: z.string().optional(),\n createdAt: z.string()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Input schema for creating a new SkillVersion.\n *\n * For source-based creation: provide `source` (or omit to use the Skill's source).\n * The backend fetches the folder and stores the snapshot as `files`.\n * For inline creation: provide `files` with the SKILL.md content.\n *\n * `version` is required -- the caller must always provide an explicit version string.\n */\nexport const CreateSkillVersionInputSchema = z.object({\n /** GitHub source to snapshot from. If not provided, uses the Skill's source. */\n source: GitHubSourceSchema.optional(),\n /** Version string for this snapshot (e.g. \"1.0.0\", \"1.0.3\"). */\n version: z.string().min(1),\n notes: z.string().optional(),\n /** Origin of this version. Defaults to 'manual' in backend. */\n origin: SkillVersionOriginSchema.optional(),\n /** Pre-edited files to store directly (bypasses GitHub fetch when provided) */\n files: z.array(SkillFileSchema).optional()\n});\n\nexport type CreateSkillVersionInput = z.infer<\n typeof CreateSkillVersionInputSchema\n>;\n\n/**\n * Skill schema - a lightweight container for a coding capability.\n *\n * Skills are containers identified by a kebab-case name.\n * All content (files, notes, etc.) lives in SkillVersion.\n * The `source` field points to the GitHub directory for live fetching.\n * Persisted shape: id, projectId, name, source, createdAt, updatedAt, deleted.\n *\n * Note: `description` is inherited from BaseEntity. It's not stored in the DB\n * for skills (content lives in SkillVersion), but is kept on the type to\n * satisfy the TenantEntity constraint. The repository always returns \"\".\n */\nexport const SkillSchema = TargetSchema.extend({\n /** GitHub source reference for live content fetching */\n source: GitHubSourceSchema.optional()\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 description: true,\n source: true\n}).extend({\n /** Optional - not stored on Skill; content description lives in SkillVersion */\n description: z.string().optional(),\n /** GitHub source reference for live content fetching */\n source: GitHubSourceSchema.optional()\n});\n\n/**\n * Inline initial version data provided when creating a skill atomically.\n * When present on a POST /skills request, the backend creates the skill\n * and its first version in a single request with rollback on failure.\n */\nexport const InitialVersionInputSchema = z.object({\n files: z.array(SkillFileSchema).optional(),\n notes: z.string().optional(),\n source: GitHubSourceSchema.optional(),\n version: z.string().optional(),\n origin: SkillVersionOriginSchema.optional()\n});\n\nexport type InitialVersionInput = z.infer<typeof InitialVersionInputSchema>;\n\n/**\n * Input schema for creating a new Skill.\n * Only `name` and `projectId` are required. `description` is ignored (lives in SkillVersion).\n * Pass `initialVersion` to atomically create the skill and its first version.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.extend({\n initialVersion: InitialVersionInputSchema.optional()\n}).refine((data) => isValidSkillFolderName(data.name), {\n message: KEBAB_CASE_MESSAGE,\n 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\n/**\n * Skill with its latest version - used when displaying skills in the UI\n * and in the evaluator to access skill content.\n */\nexport const SkillWithLatestVersionSchema = SkillSchema.extend({\n latestVersion: SkillVersionSchema.optional()\n});\n\nexport type SkillWithLatestVersion = z.infer<\n typeof SkillWithLatestVersionSchema\n>;\n\n/**\n * Input for bulk-importing skills from a parent directory in GitHub.\n * The source path should point to a directory containing skill subdirectories.\n */\nexport const BulkImportSkillsInputSchema = z.object({\n source: GitHubSourceSchema\n});\nexport type BulkImportSkillsInput = z.infer<typeof BulkImportSkillsInputSchema>;\n\n/**\n * Per-skill result from a bulk import operation.\n */\nexport const BulkImportResultItemSchema = z.object({\n name: z.string(),\n status: z.enum(['created', 'skipped', 'failed']),\n skillId: z.string().optional(),\n reason: z.string().optional()\n});\nexport type BulkImportResultItem = z.infer<typeof BulkImportResultItemSchema>;\n\n/**\n * Full response from a bulk import operation.\n */\nexport const BulkImportResultSchema = z.object({\n created: z.number(),\n skipped: z.number(),\n failed: z.number(),\n items: z.array(BulkImportResultItemSchema)\n});\nexport type BulkImportResult = z.infer<typeof BulkImportResultSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { GitHubSourceSchema } from '../common/github-source.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 * Content can be provided inline via `subAgentMd` or sourced from GitHub\n * via `source`. When `source` is set, the evaluator live-fetches the .md\n * file at run time (template pattern).\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string(),\n /** GitHub source reference for live content fetching (single .md file) */\n source: GitHubSourceSchema.optional()\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';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Preset schema - a reusable evaluation configuration that bundles\n * an agent with skills, MCPs, sub-agents, and rules.\n *\n * Users create presets once, then trigger eval runs by selecting a test suite.\n * At least one of skillIds, mcpIds, subAgentIds, or ruleIds must be non-empty.\n */\nexport const PresetSchema = TenantEntitySchema.extend({\n /** Agent ID for this preset */\n agentId: z.string(),\n /** Skill IDs included in this preset */\n skillIds: z.array(z.string()).default([]),\n /** Optional map of skillId \u2192 skillVersionId for version pinning */\n skillVersions: z.record(z.string(), z.string()).optional(),\n /** MCP server IDs included in this preset */\n mcpIds: z.array(z.string()).default([]),\n /** Sub-agent IDs included in this preset */\n subAgentIds: z.array(z.string()).default([]),\n /** Rule IDs included in this preset */\n ruleIds: z.array(z.string()).default([]),\n /** Unified capability IDs (replaces skill/mcp/subAgent/ruleIds) */\n capabilityIds: z.array(z.string()).optional(),\n /** Map of capabilityId to capabilityVersionId for version pinning */\n capabilityVersions: z.record(z.string(), z.string()).optional()\n});\n\nexport type Preset = z.infer<typeof PresetSchema>;\n\nconst atLeastOneEntity = (data: {\n skillIds?: string[];\n mcpIds?: string[];\n subAgentIds?: string[];\n ruleIds?: string[];\n capabilityIds?: string[];\n}) =>\n (data.capabilityIds?.length ?? 0) > 0 ||\n (data.skillIds?.length ?? 0) > 0 ||\n (data.mcpIds?.length ?? 0) > 0 ||\n (data.subAgentIds?.length ?? 0) > 0 ||\n (data.ruleIds?.length ?? 0) > 0;\n\nconst AT_LEAST_ONE_ENTITY_MESSAGE =\n 'At least one of capabilityIds, skillIds, mcpIds, subAgentIds, or ruleIds must be non-empty';\n\n/**\n * Input schema for creating a new Preset.\n */\nexport const CreatePresetInputSchema = PresetSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).refine(atLeastOneEntity, { message: AT_LEAST_ONE_ENTITY_MESSAGE });\n\nexport type CreatePresetInput = z.infer<typeof CreatePresetInputSchema>;\n\n/**\n * Input schema for updating a Preset.\n */\nexport const UpdatePresetInputSchema = PresetSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).partial();\n\nexport type UpdatePresetInput = z.infer<typeof UpdatePresetInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { GitHubSourceSchema } from '../common/github-source.js';\n\nexport { GitHubSourceSchema };\nexport type { GitHubSource } from '../common/github-source.js';\n\n/**\n * Capability type discriminator (AIP 7015 pattern).\n *\n * Determines the shape of `content` in CapabilityVersion and\n * the filesystem behavior at evaluation time.\n */\nexport const CapabilityTypeSchema = z.enum([\n 'SKILL',\n 'SUB_AGENT',\n 'RULE',\n 'MCP'\n]);\nexport type CapabilityType = z.infer<typeof CapabilityTypeSchema>;\n\n/**\n * Regex for valid capability names (kebab-case).\n * All capability types enforce filesystem-safe names at storage time.\n */\nexport const CAPABILITY_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\nexport function isValidCapabilityName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n CAPABILITY_NAME_REGEX.test(name)\n );\n}\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-capability)';\n\n// ---------------------------------------------------------------------------\n// Version content types (discriminated by parent capability's capabilityType)\n//\n// Content is stored as opaque JSON in the DB. The capabilityType on the parent\n// entity determines which shape applies. We define typed interfaces for each\n// variant, but the Zod parse schema accepts any JSON object \u2014 the type safety\n// comes from the capabilityType discriminator, not from parsing content keys.\n// ---------------------------------------------------------------------------\n\n/** Skill version content: multi-file directory snapshot */\nexport interface SkillContent {\n files?: Array<{ path: string; content: string }>;\n}\n\n/** Sub-agent version content: single markdown file with YAML frontmatter */\nexport interface SubAgentContent {\n subAgentMd: string;\n}\n\n/** Rule version content: rule type + markdown content */\nexport interface RuleContent {\n ruleType: 'claude-md' | 'agents-md' | 'cursor-rule';\n content: string;\n}\n\n/** MCP version content: keyed server config for .mcp.json */\nexport interface McpContent {\n config: Record<string, unknown>;\n}\n\n/** Union of all version content shapes */\nexport type CapabilityContent =\n | SkillContent\n | SubAgentContent\n | RuleContent\n | McpContent;\n\n/**\n * Zod schema for content \u2014 accepts any JSON object.\n * Type safety is enforced by the parent's capabilityType, not by parsing.\n */\nexport const CapabilityContentSchema = z.record(z.string(), z.unknown());\n\n// ---------------------------------------------------------------------------\n// Version origin (reuse from skills \u2014 same semantics for all types)\n// ---------------------------------------------------------------------------\n\nexport const CapabilityVersionOriginSchema = z.enum(['manual', 'pr', 'master']);\nexport type CapabilityVersionOrigin = z.infer<\n typeof CapabilityVersionOriginSchema\n>;\n\n// ---------------------------------------------------------------------------\n// Entity schemas\n// ---------------------------------------------------------------------------\n\n/**\n * Capability schema \u2014 lightweight container for any building-block type.\n *\n * Content lives in CapabilityVersion (immutable snapshots).\n * `capabilityType` is the AIP 7015 discriminator.\n * `source` is the optional GitHub reference for live fetching.\n */\nexport const CapabilitySchema = TenantEntitySchema.extend({\n capabilityType: CapabilityTypeSchema,\n source: GitHubSourceSchema.optional()\n});\n\nexport type Capability = z.infer<typeof CapabilitySchema>;\n\n/**\n * Capability version \u2014 immutable content snapshot.\n *\n * `content` shape is determined by the parent capability's `capabilityType`.\n */\nexport const CapabilityVersionSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n capabilityId: z.string(),\n version: z.string(),\n origin: CapabilityVersionOriginSchema,\n source: GitHubSourceSchema.optional(),\n content: CapabilityContentSchema.optional(),\n notes: z.string().optional(),\n createdAt: z.string()\n});\n\n// Override Zod-inferred content (Record<string, unknown>) with the strict union.\n// The schema accepts any JSON object at parse time; type safety is provided\n// by discriminating on the parent capability's capabilityType.\nexport type CapabilityVersion = Omit<\n z.infer<typeof CapabilityVersionSchema>,\n 'content'\n> & {\n content?: CapabilityContent;\n};\n\n/**\n * Capability enriched with its latest version \u2014 used in UI and evaluator.\n */\nexport const CapabilityWithLatestVersionSchema = CapabilitySchema.extend({\n latestVersion: CapabilityVersionSchema.optional()\n});\n\nexport type CapabilityWithLatestVersion = Omit<\n z.infer<typeof CapabilityWithLatestVersionSchema>,\n 'latestVersion'\n> & {\n latestVersion?: CapabilityVersion;\n};\n\n// ---------------------------------------------------------------------------\n// Input schemas\n// ---------------------------------------------------------------------------\n\nconst CapabilityInputBaseSchema = CapabilitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true,\n description: true,\n source: true\n}).extend({\n description: z.string().optional(),\n source: GitHubSourceSchema.optional()\n});\n\n/**\n * Inline initial version data for atomic capability + version creation.\n */\nexport const InitialCapabilityVersionInputSchema = z.object({\n content: CapabilityContentSchema.optional(),\n notes: z.string().optional(),\n source: GitHubSourceSchema.optional(),\n version: z.string().optional(),\n origin: CapabilityVersionOriginSchema.optional()\n});\n\nexport type InitialCapabilityVersionInput = z.infer<\n typeof InitialCapabilityVersionInputSchema\n>;\n\n/**\n * Input schema for creating a new Capability.\n */\nexport const CreateCapabilityInputSchema = CapabilityInputBaseSchema.extend({\n initialVersion: InitialCapabilityVersionInputSchema.optional()\n}).refine((data) => isValidCapabilityName(data.name), {\n message: KEBAB_CASE_MESSAGE,\n path: ['name']\n});\n\nexport type CreateCapabilityInput = z.infer<typeof CreateCapabilityInputSchema>;\n\n/**\n * Input schema for updating a Capability.\n */\nexport const UpdateCapabilityInputSchema = CapabilityInputBaseSchema.omit({\n capabilityType: true\n})\n .partial()\n .refine(\n (data) => data.name === undefined || isValidCapabilityName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n );\n\nexport type UpdateCapabilityInput = z.infer<typeof UpdateCapabilityInputSchema>;\n\n/**\n * Input schema for creating a new CapabilityVersion.\n */\nexport const CreateCapabilityVersionInputSchema = z.object({\n source: GitHubSourceSchema.optional(),\n version: z.string().min(1),\n notes: z.string().optional(),\n origin: CapabilityVersionOriginSchema.optional(),\n content: CapabilityContentSchema.optional()\n});\n\nexport type CreateCapabilityVersionInput = Omit<\n z.infer<typeof CreateCapabilityVersionInputSchema>,\n 'content'\n> & {\n content?: CapabilityContent;\n};\n", "/**\n * Pure conversion functions: Capability \u2192 legacy entity types.\n *\n * These functions live in eval-types so both the backend bridge service\n * and the evaluator can use them without duplicating logic.\n */\nimport type { Skill } from './skill.js';\nimport type { SkillVersion } from './skill.js';\nimport type { SkillWithLatestVersion } from './skill.js';\nimport type { SubAgent } from './sub-agent.js';\nimport type { Rule } from '../common/rule.js';\nimport type { MCPEntity } from '../common/mcp.js';\nimport type {\n Capability,\n CapabilityVersion,\n CapabilityWithLatestVersion,\n SkillContent,\n SubAgentContent,\n RuleContent,\n McpContent\n} from './capability.js';\n\n// ---------------------------------------------------------------------------\n// Capability \u2192 old entity conversion (backward-compat reads)\n// ---------------------------------------------------------------------------\n\nexport function capabilityToSkill(cap: Capability): Skill {\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n source: cap.source,\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityVersionToSkillVersion(\n cv: CapabilityVersion\n): SkillVersion {\n // Content is discriminated by parent capability_type; caller ensures type is SKILL\n const content = cv.content as SkillContent | undefined;\n return {\n id: cv.id,\n projectId: cv.projectId,\n skillId: cv.capabilityId,\n version: cv.version,\n origin: cv.origin,\n source: cv.source,\n files: content?.files,\n notes: cv.notes,\n createdAt: cv.createdAt\n };\n}\n\nexport function capabilityToSkillWithLatestVersion(\n cap: CapabilityWithLatestVersion\n): SkillWithLatestVersion {\n const skill = capabilityToSkill(cap);\n const latestVersion = cap.latestVersion\n ? capabilityVersionToSkillVersion(cap.latestVersion)\n : undefined;\n return { ...skill, latestVersion };\n}\n\nexport function capabilityToSubAgent(\n cap: CapabilityWithLatestVersion\n): SubAgent {\n // Content is discriminated by parent capability_type; caller ensures type is SUB_AGENT\n const content = cap.latestVersion?.content as SubAgentContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n subAgentMd: content?.subAgentMd ?? '',\n source: cap.source,\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityToRule(cap: CapabilityWithLatestVersion): Rule {\n // Content is discriminated by parent capability_type; caller ensures type is RULE\n const content = cap.latestVersion?.content as RuleContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n ruleType: content?.ruleType ?? 'claude-md',\n content: content?.content ?? '',\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityToMcp(cap: CapabilityWithLatestVersion): MCPEntity {\n // Content is discriminated by parent capability_type; caller ensures type is MCP\n const content = cap.latestVersion?.content as McpContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n config: content?.config ?? {},\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\n// ---------------------------------------------------------------------------\n// Helpers for grouping capabilities by type\n// ---------------------------------------------------------------------------\n\nexport function groupCapabilitiesByType(\n capabilities: CapabilityWithLatestVersion[]\n): {\n skills: SkillWithLatestVersion[];\n subAgents: SubAgent[];\n rules: Rule[];\n mcps: MCPEntity[];\n} {\n const skills: SkillWithLatestVersion[] = [];\n const subAgents: SubAgent[] = [];\n const rules: Rule[] = [];\n const mcps: MCPEntity[] = [];\n\n for (const cap of capabilities) {\n switch (cap.capabilityType) {\n case 'SKILL':\n skills.push(capabilityToSkillWithLatestVersion(cap));\n break;\n case 'SUB_AGENT':\n subAgents.push(capabilityToSubAgent(cap));\n break;\n case 'RULE':\n rules.push(capabilityToRule(cap));\n break;\n case 'MCP':\n mcps.push(capabilityToMcp(cap));\n break;\n }\n }\n\n return { skills, subAgents, rules, mcps };\n}\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 verdict: string;\n judgeReasoning: 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 * 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 {\n AssertionSchema,\n ScenarioAssertionLinkSchema\n} from '../assertion/assertion.js';\nimport { SYSTEM_ASSERTION_IDS } from '../assertion/system-assertions.js';\nimport { isAllowedBuildCommandString } from '../assertion/build-passed-command.js';\n\n/**\n * Trigger prompt image - a base64-encoded image attached to a scenario's trigger prompt.\n */\n/** Max base64 string length for a 2 MB image: 4 * ceil(bytes / 3). */\nconst MAX_IMAGE_BASE64_LENGTH = 4 * Math.ceil((2 * 1024 * 1024) / 3);\n\nexport const TriggerPromptImageSchema = z.object({\n /** Base64-encoded image data (no data URL prefix) */\n base64: z\n .string()\n .max(MAX_IMAGE_BASE64_LENGTH, 'Image exceeds 2 MB size limit'),\n /** MIME type of the image */\n mediaType: z.enum(['image/jpeg', 'image/png', 'image/gif', 'image/webp']),\n /** Original filename of the image */\n name: z.string()\n});\n\nexport type TriggerPromptImage = z.infer<typeof TriggerPromptImageSchema>;\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 * Trigger prompt images stored as JSON in trigger_prompt_images column.\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 /** Tags for categorisation and filtering */\n tags: z.array(z.string()).optional(),\n /** Base64-encoded images attached to the trigger prompt (max 3) */\n triggerPromptImages: z.array(TriggerPromptImageSchema).max(3).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\nexport function validateBuildPassedParamsInAssertionLinks(\n links:\n | { assertionId: string; params?: Record<string, unknown> }[]\n | undefined,\n ctx: z.RefinementCtx\n): void {\n if (!links) return;\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n if (link.assertionId !== SYSTEM_ASSERTION_IDS.BUILD_PASSED) continue;\n const cmd = link.params?.command;\n if (cmd === undefined || cmd === null) continue;\n if (typeof cmd !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'build_passed command must be a string',\n path: ['assertionLinks', i, 'params', 'command']\n });\n continue;\n }\n if (!isAllowedBuildCommandString(cmd)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'Invalid build_passed command. Allowed: yarn build, npm run build, pnpm run build, pnpm build',\n path: ['assertionLinks', i, 'params', 'command']\n });\n }\n }\n}\n\nconst TestScenarioCreateBaseSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema =\n TestScenarioCreateBaseSchema.superRefine((data, ctx) => {\n validateBuildPassedParamsInAssertionLinks(data.assertionLinks, ctx);\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 TestScenarioCreateBaseSchema.partial().superRefine((data, ctx) => {\n if (data.assertionLinks !== undefined) {\n validateBuildPassedParamsInAssertionLinks(data.assertionLinks, ctx);\n }\n });\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { BuildPassedCommandStringSchema } from './build-passed-command.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - tool_called_with_param: Checks if a tool was called with expected parameters (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - time_limit: Checks that scenario completed within a duration threshold (deterministic, system-level)\n * - cost: Checks that scenario LLM cost stays within a USD threshold (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, system-level)\n * - api_call: Makes an HTTP request and validates response with JSON subset matching (deterministic, system-level)\n *\n * Any assertion can be negated by setting `negate: true` to invert the pass/fail logic.\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'tool_called_with_param',\n 'build_passed',\n 'time_limit',\n 'cost',\n 'llm_judge',\n 'api_call'\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 system assertion (e.g., 'system:skill_was_called') */\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 cost assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching other configs).\n */\nexport const CostConfigSchema = z.strictObject({\n /** Maximum allowed cost in USD */\n maxCostUsd: z.number().positive()\n});\n\nexport type CostConfig = z.infer<typeof CostConfigSchema>;\n\n/** Configuration for tool_called_with_param assertion type.\n * Uses strictObject to reject objects with unknown keys.\n * When expectedParams is omitted, the assertion checks only that the tool was called (or not, if negated).\n */\nexport const ToolCalledWithParamConfigSchema = z.strictObject({\n /** Name of the tool that must have been called */\n toolName: z.string().min(1),\n /** JSON string of key-value pairs for expected parameters (substring match). Optional \u2014 when omitted, only checks tool presence. */\n expectedParams: z.string().min(1).optional(),\n /** If true, the matching tool call must also have succeeded (step.success === true) */\n requireSuccess: z.boolean().optional()\n});\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 /** Allowlisted command only (default at runtime: \"yarn build\") */\n command: BuildPassedCommandStringSchema.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 time assertion type.\n * Uses strictObject to reject objects with unknown keys.\n */\nexport const TimeConfigSchema = z.strictObject({\n /** Maximum allowed duration in milliseconds */\n maxDurationMs: z.number().int().positive()\n});\n\nexport type TimeConfig = z.infer<typeof TimeConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\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 /** Minimum score to pass (0-10, default 7) */\n minScore: z.number().int().min(0).max(10).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 * Configuration for api_call assertion type.\n * Makes an HTTP request after scenario execution and validates the response\n * contains the expected data using JSON subset matching.\n * Uses strictObject to reject objects with unknown keys.\n */\nexport const ApiCallConfigSchema = z.strictObject({\n /** URL to call */\n url: z.string().min(1),\n /** HTTP method (default GET) */\n method: z.enum(['GET', 'POST']).optional(),\n /** Request body (JSON string, for POST requests) */\n requestBody: z.string().optional(),\n /** Expected JSON response to validate against (subset match \u2014 extra fields in actual are OK) */\n expectedResponse: z.string().min(1),\n /** Request headers as JSON string of key-value pairs */\n requestHeaders: z.string().optional(),\n /** Request timeout in milliseconds (default 30000) */\n timeoutMs: z.number().int().positive().optional()\n});\n\nexport type ApiCallConfig = z.infer<typeof ApiCallConfigSchema>;\n\n/** Shared fields for all assertion types. */\nconst AssertionBaseFields = {\n /** When true, the assertion's pass/fail logic is inverted (NOT operator). */\n negate: z.boolean().optional()\n};\n\nexport const SkillWasCalledAssertionSchema = SkillWasCalledConfigSchema.extend({\n type: z.literal('skill_was_called'),\n ...AssertionBaseFields\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\nexport const ToolCalledWithParamAssertionSchema =\n ToolCalledWithParamConfigSchema.extend({\n type: z.literal('tool_called_with_param'),\n ...AssertionBaseFields\n });\n\nexport type ToolCalledWithParamAssertion = z.infer<\n typeof ToolCalledWithParamAssertionSchema\n>;\n\nexport const BuildPassedAssertionSchema = BuildPassedConfigSchema.extend({\n type: z.literal('build_passed'),\n ...AssertionBaseFields\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\nexport const CostAssertionSchema = CostConfigSchema.extend({\n type: z.literal('cost'),\n ...AssertionBaseFields\n});\n\nexport type CostAssertion = z.infer<typeof CostAssertionSchema>;\n\nexport const LlmJudgeAssertionSchema = LlmJudgeConfigSchema.extend({\n type: z.literal('llm_judge'),\n ...AssertionBaseFields\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\nexport const ApiCallAssertionSchema = ApiCallConfigSchema.extend({\n type: z.literal('api_call'),\n ...AssertionBaseFields\n});\n\nexport type ApiCallAssertion = z.infer<typeof ApiCallAssertionSchema>;\n\nexport const TimeAssertionSchema = TimeConfigSchema.extend({\n type: z.literal('time_limit'),\n ...AssertionBaseFields\n});\n\nexport type TimeAssertion = z.infer<typeof TimeAssertionSchema>;\n\n/**\n * Union of all inline assertion types.\n * Each assertion has a type literal and type-specific data.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n ToolCalledWithParamAssertionSchema,\n BuildPassedAssertionSchema,\n TimeAssertionSchema,\n CostAssertionSchema,\n LlmJudgeAssertionSchema,\n ApiCallAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\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 skillNames\n ToolCalledWithParamConfigSchema, // requires toolName, uses strictObject\n ApiCallConfigSchema, // requires url + expectedResponse, uses strictObject\n TimeConfigSchema, // requires maxDurationMs, uses strictObject\n CostConfigSchema, // requires maxCostUsd, uses strictObject\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 * 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 'cost':\n return CostConfigSchema.safeParse(config).success;\n case 'tool_called_with_param':\n return ToolCalledWithParamConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'time_limit':\n return TimeConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n case 'api_call':\n return ApiCallConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n", "import { z } from 'zod';\n\n/**\n * Allowlisted shell-free build commands for `build_passed` assertions (VELO-9590).\n * Each entry maps to a fixed argv array for execFile \u2014 no user-controlled shell.\n */\nexport const ALLOWED_BUILD_COMMANDS = [\n 'yarn build',\n 'npm run build',\n 'pnpm run build',\n 'pnpm build'\n] as const;\n\nexport type AllowedBuildCommandString = (typeof ALLOWED_BUILD_COMMANDS)[number];\n\n/** Default when `command` is omitted (matches historical behavior). */\nexport const DEFAULT_BUILD_PASSED_COMMAND: AllowedBuildCommandString =\n 'yarn build';\n\nconst BUILD_COMMAND_ARGV: Record<\n AllowedBuildCommandString,\n readonly [string, ...string[]]\n> = {\n 'yarn build': ['yarn', 'build'],\n 'npm run build': ['npm', 'run', 'build'],\n 'pnpm run build': ['pnpm', 'run', 'build'],\n 'pnpm build': ['pnpm', 'build']\n};\n\n/**\n * True if the string (after trim) is an allowlisted build command.\n */\nexport function isAllowedBuildCommandString(command: string): boolean {\n const trimmed = command.trim();\n return (ALLOWED_BUILD_COMMANDS as readonly string[]).includes(trimmed);\n}\n\n/**\n * Resolve an allowlisted command string to argv for `execFile` / `execFileSync`.\n * Returns null if the command is not allowlisted.\n */\nexport function parseBuildCommandToArgv(\n command: string\n): readonly [string, ...string[]] | null {\n const trimmed = command.trim() as AllowedBuildCommandString;\n if (!(trimmed in BUILD_COMMAND_ARGV)) {\n return null;\n }\n return BUILD_COMMAND_ARGV[trimmed];\n}\n\nconst enumTuple = ALLOWED_BUILD_COMMANDS as unknown as [\n AllowedBuildCommandString,\n ...AllowedBuildCommandString[]\n];\n\n/** Zod schema for an optional/required allowlisted build command string. */\nexport const BuildPassedCommandStringSchema = z.enum(enumTuple);\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:'.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n TOOL_CALLED_WITH_PARAM: 'system:tool_called_with_param',\n BUILD_PASSED: 'system:build_passed',\n TIME_LIMIT: 'system:time_limit',\n COST: 'system:cost',\n LLM_JUDGE: 'system:llm_judge',\n API_CALL: 'system:api_call'\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 name: 'negate',\n label: 'Negate (NOT operator)',\n type: 'boolean',\n required: false,\n defaultValue: false\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.TOOL_CALLED_WITH_PARAM]: {\n id: SYSTEM_ASSERTION_IDS.TOOL_CALLED_WITH_PARAM,\n name: 'Tool Called With Param',\n description:\n 'Check that a tool was called with expected parameters (tool name is substring matched)',\n type: 'tool_called_with_param',\n parameters: [\n {\n name: 'toolName',\n label: 'Tool Name',\n type: 'string',\n required: true\n },\n {\n name: 'expectedParams',\n label: 'Expected Parameters (JSON, substring match)',\n type: 'string',\n required: false\n },\n {\n name: 'requireSuccess',\n label: 'Require Successful Call',\n type: 'boolean',\n required: false,\n defaultValue: false,\n advanced: true\n },\n {\n name: 'negate',\n label: 'Negate (NOT operator)',\n type: 'boolean',\n required: false,\n defaultValue: false\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.TIME_LIMIT]: {\n id: SYSTEM_ASSERTION_IDS.TIME_LIMIT,\n name: 'Time Limit',\n description: 'Check that the scenario completed within a maximum duration',\n type: 'time_limit',\n parameters: [\n {\n name: 'maxDurationMs',\n label: 'Max Duration (ms)',\n type: 'number',\n required: true,\n defaultValue: 300000\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.COST]: {\n id: SYSTEM_ASSERTION_IDS.COST,\n name: 'Cost',\n description:\n 'Check that the scenario LLM execution cost stays within a USD threshold',\n type: 'cost',\n parameters: [\n {\n name: 'maxCostUsd',\n label: 'Max Cost (USD)',\n type: 'number',\n required: true,\n defaultValue: 1.0\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-10)',\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: 'minScore',\n label: 'Minimum Score (0-10)',\n type: 'number',\n required: false,\n defaultValue: 7\n },\n {\n name: 'model',\n label: 'Model',\n type: 'string',\n required: false\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.API_CALL]: {\n id: SYSTEM_ASSERTION_IDS.API_CALL,\n name: 'API Call',\n description:\n 'Call an API endpoint and verify the response contains expected data',\n type: 'api_call',\n parameters: [\n {\n name: 'url',\n label: 'URL',\n type: 'string',\n required: true\n },\n {\n name: 'method',\n label: 'HTTP Method',\n type: 'string',\n required: false,\n defaultValue: 'GET'\n },\n {\n name: 'requestBody',\n label: 'Request Body (JSON)',\n type: 'string',\n required: false\n },\n {\n name: 'expectedResponse',\n label: 'Expected Response (JSON)',\n type: 'string',\n required: true\n },\n {\n name: 'requestHeaders',\n label: 'Headers (JSON)',\n type: 'string',\n required: false,\n advanced: true\n },\n {\n name: 'timeoutMs',\n label: 'Timeout (ms)',\n type: 'number',\n required: false,\n defaultValue: 30000,\n advanced: true\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", "import { z } from 'zod';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\nimport { validateBuildPassedParamsInAssertionLinks } from './test-scenario.js';\n\nconst UUID_REGEX =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Assertion link in batch import JSON \u2014 accepts two forms:\n * - String: bare assertion reference (\"system:build_passed\" or \"Check widget count\")\n * - Object: { assertionId, params? } for assertions needing parameters\n */\nexport const BatchAssertionLinkSchema = z.union([\n z.string().min(1),\n ScenarioAssertionLinkSchema\n]);\n\nexport type BatchAssertionLink = z.infer<typeof BatchAssertionLinkSchema>;\n\n/**\n * Single scenario entry in the batch import payload.\n * name and triggerPrompt are required; everything else is optional.\n */\nexport const BatchScenarioEntrySchema = z\n .object({\n name: z.string().min(1, 'name: Required'),\n description: z.string().optional().default(''),\n triggerPrompt: z\n .string()\n .min(10, 'triggerPrompt: Must be at least 10 characters'),\n templateId: z.string().nullish(),\n tags: z.array(z.string()).optional(),\n assertionLinks: z.array(BatchAssertionLinkSchema).optional()\n })\n .superRefine((data, ctx) => {\n if (!data.assertionLinks) return;\n const objectLinks = data.assertionLinks.filter(\n (link): link is z.infer<typeof ScenarioAssertionLinkSchema> =>\n typeof link !== 'string'\n );\n if (objectLinks.length > 0) {\n validateBuildPassedParamsInAssertionLinks(objectLinks, ctx);\n }\n });\n\nexport type BatchScenarioEntry = z.infer<typeof BatchScenarioEntrySchema>;\n\n/**\n * Top-level wrapper for the batch import JSON payload.\n * Contains a `scenarios` array (1\u2013100 entries).\n */\nexport const BatchImportPayloadSchema = z.object({\n scenarios: z\n .array(BatchScenarioEntrySchema)\n .min(1, 'scenarios array must contain at least one entry')\n .max(100, 'Maximum 100 scenarios per upload')\n});\n\nexport type BatchImportPayload = z.infer<typeof BatchImportPayloadSchema>;\n\nexport const BATCH_IMPORT_LIMITS = {\n MAX_SCENARIOS: 100,\n MAX_PAYLOAD_BYTES: 1_048_576 // 1 MB\n} as const;\n\n/**\n * Classify a string assertion reference:\n * - \"system:*\" \u2192 system assertion ID\n * - UUID format \u2192 custom assertion ID\n * - otherwise \u2192 assertion name (needs resolution)\n */\nexport function classifyAssertionRef(ref: string): {\n type: 'system' | 'uuid' | 'name';\n value: string;\n} {\n if (ref.startsWith('system:')) {\n return { type: 'system', value: ref };\n }\n if (UUID_REGEX.test(ref)) {\n return { type: 'uuid', value: ref };\n }\n return { type: 'name', value: ref };\n}\n\n/**\n * Normalize a batch assertion link (string or object) into a standard\n * ScenarioAssertionLink. String refs are classified and returned as\n * { assertionId } \u2014 actual resolution (name\u2192UUID) is done by the backend.\n */\nexport function normalizeBatchAssertionLink(\n link: BatchAssertionLink\n): z.infer<typeof ScenarioAssertionLinkSchema> {\n if (typeof link === 'string') {\n return { assertionId: link };\n }\n return link;\n}\n\n/** Per-scenario result returned by the batch endpoint. */\nexport const BatchResultItemSchema = z.object({\n index: z.number(),\n name: z.string(),\n status: z.enum(['valid', 'invalid']),\n id: z.string().nullable().optional(),\n errors: z.array(z.string()).optional()\n});\n\nexport type BatchResultItem = z.infer<typeof BatchResultItemSchema>;\n\n/** Summary section of the batch response. */\nexport const BatchSummarySchema = z.object({\n total: z.number(),\n valid: z.number(),\n invalid: z.number(),\n created: z.number()\n});\n\nexport type BatchSummary = z.infer<typeof BatchSummarySchema>;\n\n/** Full response from the batch import endpoint. */\nexport const BatchImportResponseSchema = z.object({\n summary: BatchSummarySchema,\n results: z.array(BatchResultItemSchema)\n});\n\nexport type BatchImportResponse = z.infer<typeof BatchImportResponseSchema>;\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 turnIndex: z.number().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 totalTurns: z.number().optional(),\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';\nimport { ConversationMessageSchema } from './conversation.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 /** SkillVersion ID used for this evaluation (for version tracking) */\n skillVersionId: z.string().optional(),\n /** SkillVersion semver string (e.g., \"1.0.0\", \"1.2.3\") for display */\n skillVersion: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n /** Snapshot of the trigger prompt used during the run (prevents stale display after edits) */\n triggerPrompt: z.string().optional(),\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 /** Full conversation messages (only present in transit; stripped before DB storage) */\n conversation: z.array(ConversationMessageSchema).optional(),\n /** 0-based iteration index when a scenario is run multiple times within a single eval run */\n iterationIndex: z.number().int().min(0).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';\nimport { AgentRunCommandSchema, AgentTypeSchema } from '../target/agent.js';\nimport { ModelConfigSchema } from '../common/models.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 SCHEDULED = 'SCHEDULED'\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 scheduleId: 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.nativeEnum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\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 /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */\n isInfrastructure: z.boolean().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 /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */\n isInfrastructure: z.boolean().optional()\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 * A single finding from the LLM-generated run analysis.\n */\nexport const RunAnalysisFindingSchema = z.object({\n category: z.enum([\n 'failure_pattern',\n 'cost_waste',\n 'flakiness',\n 'inefficiency',\n 'positive'\n ]),\n severity: z.enum(['high', 'medium', 'low']),\n description: z.string(),\n affectedScenarios: z.array(z.string()),\n recommendation: z.string().optional()\n});\n\nexport type RunAnalysisFinding = z.infer<typeof RunAnalysisFindingSchema>;\n\n/**\n * LLM-generated analysis of a completed eval run.\n */\nexport const RunAnalysisSchema = z.object({\n generatedAt: z.string(),\n summary: z.string(),\n findings: z.array(RunAnalysisFindingSchema)\n});\n\nexport type RunAnalysis = z.infer<typeof RunAnalysisSchema>;\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 /** Preset ID that originated this run (optional) */\n presetId: z.string().optional(),\n /** Skill IDs for this run */\n skillIds: z.array(z.string()).optional(),\n /** Map of skillId to skillVersionId for this run */\n skillVersions: z.record(z.string(), z.string()).optional(),\n /** Scenario IDs to run (always present \u2014 resolved server-side from tags when needed) */\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 /** 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 /** Rule IDs to enable for this run (optional) */\n ruleIds: z.array(z.string()).optional(),\n /** Unified capability IDs (replaces skill/mcp/subAgent/ruleIds) */\n capabilityIds: z.array(z.string()).optional(),\n /** Map of capabilityId to capabilityVersionId for version pinning */\n capabilityVersions: z.record(z.string(), z.string()).optional(),\n /** Tags used to select scenarios for this run (for traceability) */\n tags: z.array(z.string()).optional(),\n /** How many times each scenario is executed within this eval run. Default: 1. Max: 20. */\n runsPerScenario: z.number().int().min(1).max(20).optional(),\n /** Snapshot of agent configuration captured at run creation time */\n agentSnapshot: z\n .object({\n name: z.string().optional(),\n agentType: AgentTypeSchema.optional(),\n runCommand: AgentRunCommandSchema.optional(),\n systemPrompt: z.string().nullable().optional(),\n modelConfig: ModelConfigSchema.optional()\n })\n .optional(),\n /** UUID linking all runs in a comparison group */\n comparisonGroupId: z.string().optional(),\n /** Human-readable label for this variant (e.g., \"MCP: Wix Stores\") */\n comparisonLabel: z.string().optional(),\n /** LLM-generated analysis of the completed run */\n runAnalysis: RunAnalysisSchema.optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n *\n * Either `scenarioIds` or `tags` (or both) must be provided.\n * When `tags` are provided without `scenarioIds`, the backend resolves\n * matching scenarios server-side and populates `scenarioIds` on the entity.\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 scenarioIds: true,\n agentSnapshot: true\n})\n .extend({\n /** Optional on input \u2014 backend resolves from tags when not provided */\n scenarioIds: z.array(z.string()).optional()\n })\n .refine(\n (data) =>\n (data.scenarioIds && data.scenarioIds.length > 0) ||\n (data.tags && data.tags.length > 0),\n { message: 'Either scenarioIds or tags must be provided' }\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';\n\n/**\n * Individual content blocks within a conversation message.\n */\nexport const TextBlockSchema = z.object({\n type: z.literal('text'),\n text: z.string()\n});\n\nexport const ThinkingBlockSchema = z.object({\n type: z.literal('thinking'),\n thinking: z.string()\n});\n\nexport const ToolUseBlockSchema = z.object({\n type: z.literal('tool_use'),\n toolName: z.string(),\n toolId: z.string(),\n input: z.unknown()\n});\n\nexport const ToolResultBlockSchema = z.object({\n type: z.literal('tool_result'),\n toolUseId: z.string(),\n content: z.string(),\n isError: z.boolean().optional()\n});\n\nexport const ConversationBlockSchema = z.discriminatedUnion('type', [\n TextBlockSchema,\n ThinkingBlockSchema,\n ToolUseBlockSchema,\n ToolResultBlockSchema\n]);\n\nexport type ConversationBlock = z.infer<typeof ConversationBlockSchema>;\n\n/**\n * A single message in the conversation (assistant, user, or system).\n */\nexport const ConversationMessageRoles = [\n 'assistant',\n 'user',\n 'system'\n] as const;\n\nexport const ConversationMessageSchema = z.object({\n role: z.enum(ConversationMessageRoles),\n content: z.array(ConversationBlockSchema),\n timestamp: z.string()\n});\n\nexport type ConversationMessage = z.infer<typeof ConversationMessageSchema>;\n\n/**\n * Full conversation stored per scenario result.\n */\nexport const ScenarioConversationSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n evalRunId: z.string(),\n resultId: z.string(),\n messages: z.array(ConversationMessageSchema),\n createdAt: z.string()\n});\n\nexport type ScenarioConversation = z.infer<typeof ScenarioConversationSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * EvalRunFolder schema - a folder for organizing eval runs.\n * Runs can belong to multiple folders (many-to-many).\n */\nexport const EvalRunFolderSchema = TenantEntitySchema.extend({});\n\nexport type EvalRunFolder = z.infer<typeof EvalRunFolderSchema>;\n\n/**\n * Input schema for creating a new EvalRunFolder.\n */\nexport const CreateEvalRunFolderInputSchema = EvalRunFolderSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateEvalRunFolderInput = z.infer<\n typeof CreateEvalRunFolderInputSchema\n>;\n\n/**\n * Input schema for updating an EvalRunFolder.\n */\nexport const UpdateEvalRunFolderInputSchema = EvalRunFolderSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).partial();\n\nexport type UpdateEvalRunFolderInput = z.infer<\n typeof UpdateEvalRunFolderInputSchema\n>;\n\n/**\n * Folder membership - links an eval run to a folder.\n */\nexport const EvalRunFolderMembershipSchema = z.object({\n folderId: z.string(),\n evalRunId: z.string(),\n projectId: z.string(),\n createdAt: z.string()\n});\n\nexport type EvalRunFolderMembership = z.infer<\n typeof EvalRunFolderMembershipSchema\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 scenarioTags: z\n .array(z.string())\n .optional()\n .describe('Project-level tag vocabulary for scenarios'),\n /** Per-project Wix auth token (write-only \u2014 never returned in GET responses). null = clear. */\n wixAuthToken: z\n .string()\n .nullable()\n .optional()\n .describe('Wix auth token for CLI/MCP authentication (encrypted at rest)'),\n /** Per-project Base44 auth file content (write-only \u2014 never returned in GET responses). null = clear. */\n base44AuthFile: z\n .string()\n .nullable()\n .optional()\n .describe('Base64-encoded Base44 auth file content (encrypted at rest)'),\n /** Resolved at runtime from the encrypted Wix auth token */\n wixAuthEmail: z\n .string()\n .optional()\n .describe('Email associated with the Wix auth token (resolved at runtime)'),\n /** Resolved at runtime from the encrypted Base44 auth file */\n base44AuthEmail: z\n .string()\n .optional()\n .describe('Email from the Base44 auth file (resolved at runtime)')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n * Omits read-only / runtime-resolved fields.\n * Requires appId for proper app-credential scoping and tenancy isolation.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true,\n wixAuthEmail: true,\n base44AuthEmail: true\n}).extend({\n appId: z\n .string()\n .describe(\n 'Required: The ID of the app in Dev Center for credential scoping'\n )\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n * AppId is mutable \u2014 allows project reassignment to different apps if needed.\n * Requires current app credentials to change (enforced by appAuthProjectGuard).\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';\nimport { GitHubSourceSchema } from '../common/github-source.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 * The `source` field points to a GitHub directory that is fetched via the GitHub API.\n * It is optional to support the transition from the legacy `downloadUrl` field.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** GitHub source reference for fetching template files */\n source: GitHubSourceSchema.optional()\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 { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Frequency types for scheduled evaluation runs.\n */\nexport enum FrequencyType {\n DAILY = 'daily',\n WEEKDAY = 'weekday',\n WEEKLY = 'weekly',\n MONTHLY = 'monthly'\n}\n\n/**\n * Evaluation schedule schema.\n *\n * Represents a recurring schedule that automatically triggers evaluation runs.\n * Stores suiteId + presetId; the preset bundles agent + skills + MCPs +\n * sub-agents + rules. Suite scenarios are resolved at trigger time so\n * changes to the suite auto-propagate to future runs.\n */\nexport const EvalScheduleSchema = TenantEntitySchema.extend({\n /** Whether the schedule is active */\n enabled: z.boolean(),\n /** Test suite to run */\n suiteId: z.string(),\n /** Preset that provides agent + entities for this schedule */\n presetId: z.string(),\n /** How often to run */\n frequencyType: z.nativeEnum(FrequencyType),\n /** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */\n timeOfDay: z.string().regex(/^([01]\\d|2[0-3]):[0-5]\\d$/),\n /** Day of week (0=Sun, 6=Sat) for weekly schedules */\n dayOfWeek: z.number().min(0).max(6).optional(),\n /** Day of month (1-31) for monthly schedules */\n dayOfMonth: z.number().min(1).max(31).optional(),\n /** IANA timezone (e.g., 'America/New_York') */\n timezone: z.string(),\n /** ID of the last eval run created by this schedule */\n lastRunId: z.string().optional(),\n /** Denormalized status of the last run */\n lastRunStatus: z.string().optional(),\n /** ISO timestamp of the last run */\n lastRunAt: z.string().optional(),\n /** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */\n nextRunAt: z.string().optional()\n});\n\nexport type EvalSchedule = z.infer<typeof EvalScheduleSchema>;\n\nfunction isValidTimezone(tz: string): boolean {\n try {\n Intl.DateTimeFormat(undefined, { timeZone: tz });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction validateScheduleFields(\n data: {\n frequencyType?: FrequencyType;\n dayOfWeek?: number;\n dayOfMonth?: number;\n timezone?: string;\n },\n ctx: z.RefinementCtx,\n options: { partial: boolean }\n) {\n if (data.frequencyType === FrequencyType.WEEKLY && data.dayOfWeek == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'dayOfWeek is required for weekly schedules',\n path: ['dayOfWeek']\n });\n }\n if (data.frequencyType === FrequencyType.MONTHLY && data.dayOfMonth == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'dayOfMonth is required for monthly schedules',\n path: ['dayOfMonth']\n });\n }\n const shouldValidateTz = options.partial ? data.timezone !== undefined : true;\n if (shouldValidateTz && !isValidTimezone(data.timezone!)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Invalid IANA timezone',\n path: ['timezone']\n });\n }\n}\n\nconst BaseCreateScheduleSchema = EvalScheduleSchema.omit({\n id: true,\n projectId: true,\n deleted: true,\n createdAt: true,\n updatedAt: true,\n lastRunId: true,\n lastRunStatus: true,\n lastRunAt: true,\n nextRunAt: true\n});\n\n/**\n * Input schema for creating a new schedule.\n * Validates that dayOfWeek is present for WEEKLY, dayOfMonth for MONTHLY,\n * and timezone is a valid IANA timezone.\n */\nexport const CreateEvalScheduleInputSchema =\n BaseCreateScheduleSchema.superRefine((data, ctx) => {\n validateScheduleFields(data, ctx, { partial: false });\n });\n\nexport type CreateEvalScheduleInput = z.infer<\n typeof CreateEvalScheduleInputSchema\n>;\n\n/**\n * Input schema for updating an existing schedule.\n * Partial -- conditional field validation is deferred to the repository\n * which merges with the existing entity.\n */\nexport const UpdateEvalScheduleInputSchema =\n BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {\n validateScheduleFields(data, ctx, { partial: true });\n });\n\nexport type UpdateEvalScheduleInput = z.infer<\n typeof UpdateEvalScheduleInputSchema\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,OAAO;AAAA,EACxD,WAAW,EAAE,OAAO;AACtB,CAAC;;;ACrBD,SAAS,KAAAA,UAAS;AAOX,IAAM,qBAAqBA,GAAE,OAAO;AAAA;AAAA,EAEzC,OAAOA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAEvB,MAAMA,GAAE,OA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a,MAAM;AACzE,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB,CAAC;AAAA,EACH;AACA,MAAI,KAAK,kBAAkB,2BAAyB,KAAK,cAAc,MAAM;AAC3E,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,YAAY;AAAA,IACrB,CAAC;AAAA,EACH;AACA,QAAM,mBAAmB,QAAQ,UAAU,KAAK,aAAa,SAAY;AACzE,MAAI,oBAAoB,CAAC,gBAAgB,KAAK,QAAS,GAAG;AACxD,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,UAAU;AAAA,IACnB,CAAC;AAAA,EACH;AACF;AAEA,IAAM,2BAA2B,mBAAmB,KAAK;AAAA,EACvD,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAOM,IAAM,gCACX,yBAAyB,YAAY,CAAC,MAAM,QAAQ;AAClD,yBAAuB,MAAM,KAAK,EAAE,SAAS,MAAM,CAAC;AACtD,CAAC;AAWI,IAAM,gCACX,yBAAyB,QAAQ,EAAE,YAAY,CAAC,MAAM,QAAQ;AAC5D,yBAAuB,MAAM,KAAK,EAAE,SAAS,KAAK,CAAC;AACrD,CAAC;",
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';\n\n/**\n * GitHub source reference for a file or directory in a GitHub repository.\n * Used by skills and templates (directory) and sub-agents (single file)\n * to point to content that can be fetched via the GitHub API.\n */\nexport const GitHubSourceSchema = z.object({\n /** GitHub org or user, e.g. \"wix\" */\n owner: z.string().min(1),\n /** Repository name, e.g. \"skills\" */\n repo: z.string().min(1),\n /** Path within the repo (file or directory), e.g. \"skills/my-skill\" or \"agents/reviewer.md\" */\n path: z.string().min(1),\n /** Git ref (branch, tag, or SHA), e.g. \"master\" or \"v1.2.0\" */\n ref: z.string().min(1)\n});\n\nexport type GitHubSource = z.infer<typeof GitHubSourceSchema>;\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 * `name` is a display label for the entity (does NOT need to match the server\n * key inside `config`).\n *\n * `config` is a keyed `.mcp.json` entry, e.g.:\n * ```json\n * { \"wix-mcp\": { \"type\": \"http\", \"url\": \"\u2026\", \"headers\": { \u2026 } } }\n * ```\n * At evaluation time every MCP's config is spread into the `mcpServers` object\n * of the generated `.mcp.json` file.\n */\nexport const MCPEntitySchema = TenantEntitySchema.extend({\n /** Display name for the MCP entity (independent of the server key in config) */\n name: z.string().min(1),\n /** Keyed MCP server config \u2014 top-level key is the server name, value is its config */\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 * Curated model sets \u2014 only models suitable for code generation.\n * Uses official/canonical model IDs (not internal gateway enums).\n * Update these explicitly when new models become available.\n */\nexport const ClaudeModel = {\n CLAUDE_4_SONNET_1_0: 'claude-sonnet-4',\n CLAUDE_4_OPUS_1_0: 'claude-opus-4',\n CLAUDE_4_5_SONNET_1_0: 'claude-sonnet-4-5',\n CLAUDE_4_5_HAIKU_1_0: 'claude-haiku-4-5',\n CLAUDE_4_5_OPUS_1_0: 'claude-opus-4-5',\n CLAUDE_4_6_SONNET_1_0: 'claude-sonnet-4-6',\n CLAUDE_4_6_OPUS_1_0: 'claude-opus-4-6'\n} as const;\nexport type ClaudeModel = (typeof ClaudeModel)[keyof typeof ClaudeModel];\n\nexport const OpenAIModel = {\n GPT_4O_MINI_2024_07_18: 'gpt-4o-mini',\n GPT_4O_2024_11_20: 'gpt-4o',\n O1_2024_12_17: 'o1',\n O3_MINI_2025_01_31: 'o3-mini',\n GPT_4_1_2025_04_14: 'gpt-4.1',\n GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini',\n GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano',\n O3_2025_04_16: 'o3',\n O4_MINI_2025_04_16: 'o4-mini',\n GPT_5_2025_08_07: 'gpt-5',\n GPT_5_MINI_2025_08_07: 'gpt-5-mini',\n GPT_5_NANO_2025_08_07: 'gpt-5-nano'\n} as const;\nexport type OpenAIModel = (typeof OpenAIModel)[keyof typeof OpenAIModel];\n\nexport const AVAILABLE_CLAUDE_MODEL_IDS: ClaudeModel[] =\n Object.values(ClaudeModel);\n\nconst PREFERRED_JUDGE_MODEL = ClaudeModel.CLAUDE_4_5_HAIKU_1_0;\n\nexport const DEFAULT_JUDGE_MODEL: string = AVAILABLE_CLAUDE_MODEL_IDS.includes(\n PREFERRED_JUDGE_MODEL\n)\n ? PREFERRED_JUDGE_MODEL\n : AVAILABLE_CLAUDE_MODEL_IDS[0];\n\nexport const ClaudeModelSchema = z.enum(\n AVAILABLE_CLAUDE_MODEL_IDS as [string, ...string[]]\n);\n\nexport const AVAILABLE_OPENAI_MODEL_IDS: OpenAIModel[] =\n Object.values(OpenAIModel);\n\n/**\n * Models that support the OpenAI Responses API via the Wix AI Gateway.\n * Must match the CHAT_MODEL_TO_RESPONSES_MODEL mapping in the proxy.\n * These models use openai.responses() and support reasoningSummary.\n */\nexport const OPENAI_RESPONSES_MODEL_IDS: ReadonlySet<string> = new Set([\n OpenAIModel.GPT_5_2025_08_07,\n OpenAIModel.GPT_5_MINI_2025_08_07,\n OpenAIModel.GPT_5_NANO_2025_08_07\n]);\n\nexport const OpenAIModelSchema = z.enum(\n AVAILABLE_OPENAI_MODEL_IDS as [string, ...string[]]\n);\n\nexport const ALL_AVAILABLE_MODEL_IDS: string[] = [\n ...AVAILABLE_CLAUDE_MODEL_IDS,\n ...AVAILABLE_OPENAI_MODEL_IDS\n];\n\nexport const AnyModelSchema = z.enum(\n ALL_AVAILABLE_MODEL_IDS as [string, ...string[]]\n);\n\n/**\n * Maps legacy Wix AI Gateway enum strings to official model IDs.\n * Used for backward compatibility with stored data (DB, eval traces).\n */\nexport const LEGACY_MODEL_ID_MAP: Record<string, string> = {\n // Claude\n CLAUDE_4_SONNET_1_0: ClaudeModel.CLAUDE_4_SONNET_1_0,\n CLAUDE_4_OPUS_1_0: ClaudeModel.CLAUDE_4_OPUS_1_0,\n CLAUDE_4_5_SONNET_1_0: ClaudeModel.CLAUDE_4_5_SONNET_1_0,\n CLAUDE_4_5_HAIKU_1_0: ClaudeModel.CLAUDE_4_5_HAIKU_1_0,\n CLAUDE_4_5_OPUS_1_0: ClaudeModel.CLAUDE_4_5_OPUS_1_0,\n CLAUDE_4_6_SONNET_1_0: ClaudeModel.CLAUDE_4_6_SONNET_1_0,\n CLAUDE_4_6_OPUS_1_0: ClaudeModel.CLAUDE_4_6_OPUS_1_0,\n // OpenAI\n GPT_4O_MINI_2024_07_18: OpenAIModel.GPT_4O_MINI_2024_07_18,\n GPT_4O_2024_11_20: OpenAIModel.GPT_4O_2024_11_20,\n O1_2024_12_17: OpenAIModel.O1_2024_12_17,\n O3_MINI_2025_01_31: OpenAIModel.O3_MINI_2025_01_31,\n GPT_4_1_2025_04_14: OpenAIModel.GPT_4_1_2025_04_14,\n GPT_4_1_MINI_2025_04_14: OpenAIModel.GPT_4_1_MINI_2025_04_14,\n GPT_4_1_NANO_2025_04_14: OpenAIModel.GPT_4_1_NANO_2025_04_14,\n O3_2025_04_16: OpenAIModel.O3_2025_04_16,\n O4_MINI_2025_04_16: OpenAIModel.O4_MINI_2025_04_16,\n GPT_5_2025_08_07: OpenAIModel.GPT_5_2025_08_07,\n GPT_5_MINI_2025_08_07: OpenAIModel.GPT_5_MINI_2025_08_07,\n GPT_5_NANO_2025_08_07: OpenAIModel.GPT_5_NANO_2025_08_07\n};\n\n/**\n * Normalize a model ID: translates legacy gateway enum strings to\n * official model IDs. Returns the input unchanged if already canonical.\n */\nexport function normalizeModelId(modelId: string): string {\n return LEGACY_MODEL_ID_MAP[modelId] ?? modelId;\n}\n\n/**\n * Model configuration schema for specifying model parameters.\n * Accepts any model from Claude or OpenAI providers.\n */\nconst nullToUndefined = (val: unknown) => (val === null ? undefined : val);\n\nexport const ModelConfigSchema = z.object({\n model: AnyModelSchema,\n temperature: z.preprocess(\n nullToUndefined,\n z.number().min(0).max(1).optional()\n ),\n maxTokens: z.preprocess(nullToUndefined, z.number().min(1).optional()),\n maxTurns: z.preprocess(nullToUndefined, z.number().int().min(1).optional())\n});\n\nexport type ModelConfig = z.infer<typeof ModelConfigSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from './base-entity.js';\n\nexport const RuleTypeSchema = z.enum(['claude-md', 'agents-md', 'cursor-rule']);\nexport type RuleType = z.infer<typeof RuleTypeSchema>;\n\nexport const RuleSchema = TenantEntitySchema.extend({\n ruleType: RuleTypeSchema,\n content: z.string()\n});\n\nexport type Rule = z.infer<typeof RuleSchema>;\n\nconst RuleInputBaseSchema = RuleSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport const CreateRuleInputSchema = RuleInputBaseSchema;\nexport type CreateRuleInput = z.infer<typeof CreateRuleInputSchema>;\n\nexport const UpdateRuleInputSchema = RuleInputBaseSchema.partial();\nexport type UpdateRuleInput = z.infer<typeof UpdateRuleInputSchema>;\n", "// Convenience subset for autocomplete in the UI; users can still enter any custom tool name.\nexport const AVAILABLE_TOOL_NAMES = [\n 'Bash',\n 'Edit',\n 'Glob',\n 'Grep',\n 'Read',\n 'Skill',\n 'Write'\n] as const;\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 * Default behavioral instructions appended to the Claude Code system prompt\n * during evaluation runs. These ensure the agent executes autonomously without\n * waiting for human confirmation.\n */\nexport const DEFAULT_EVALUATOR_SYSTEM_PROMPT = `IMPORTANT: This is an automated evaluation run. Follow these guidelines:\n1. Execute the requested changes immediately without asking for confirmation.\n2. Do NOT ask \"would you like me to proceed?\" or similar questions.\n3. Do NOT use the Task tool to delegate simple operations - do them directly yourself.\n4. Keep your approach simple and direct - avoid excessive planning.\n5. Make targeted edits using Read and Edit tools rather than exploring the entire codebase.\n6. If you encounter an error, fix it directly rather than starting over.\n7. Your project root is the current working directory. Always create and modify source code files relative to the project root, NOT inside .claude/skills/ directories.\n8. Before finishing, run the project's package manager install command (e.g. \\`npm install\\`, \\`yarn install\\`, or \\`pnpm install\\` depending on the lockfile present) to ensure all dependencies are installed and the project is ready to build.`;\n\n/**\n * Agent type discriminator.\n * - CLI: External CLI tool (e.g. Claude Code, Codex)\n * - SDK: In-process SDK agent (e.g. Simple Agent via AI SDK)\n */\nexport const AgentType = {\n CLI: 'cli',\n SDK: 'sdk'\n} as const;\n\nexport type AgentTypeValue = (typeof AgentType)[keyof typeof AgentType];\n\nexport const AgentTypeSchema = z.enum([AgentType.CLI, AgentType.SDK]);\n\n/** Labels for agent types in UI dropdowns. */\nexport const AGENT_TYPE_LABELS: Record<AgentTypeValue, string> = {\n [AgentType.CLI]: 'CLI Agent',\n [AgentType.SDK]: 'Simple Agent'\n};\n\n/**\n * Supported agent CLI commands.\n *\n * Each value corresponds to a registered AgentAdapter in the evaluator.\n * When adding a new CLI agent adapter, add its command here first.\n */\nexport enum AgentRunCommand {\n CLAUDE = 'claude',\n OPENCODE = 'opencode'\n}\n\n/** All available run commands for use in dropdowns and validation. */\nexport const AVAILABLE_RUN_COMMANDS: AgentRunCommand[] =\n Object.values(AgentRunCommand);\n\n/** Labels for display in UI dropdowns. */\nexport const RUN_COMMAND_LABELS: Record<AgentRunCommand, string> = {\n [AgentRunCommand.CLAUDE]: 'Claude Code',\n [AgentRunCommand.OPENCODE]: 'OpenCode'\n};\n\nexport const AgentRunCommandSchema = z.nativeEnum(AgentRunCommand);\n\n/**\n * Agent schema.\n *\n * Agents can be CLI-based (external process) or SDK-based (in-process).\n * CLI agents use runCommand to select the adapter; SDK agents use their adapter ID.\n */\nexport const AgentSchema = TargetSchema.extend({\n /** Agent type: 'cli' for external CLI tools, 'sdk' for in-process SDK agents */\n agentType: AgentTypeSchema.default(AgentType.CLI),\n /** Command to run the agent (required for CLI agents, absent for SDK agents) */\n runCommand: AgentRunCommandSchema.optional(),\n /** Optional model configuration override */\n modelConfig: ModelConfigSchema.optional(),\n systemPrompt: z\n .string()\n .nullish()\n .describe(\n 'Override for eval runs. undefined=default instructions, null=raw agent, string=append to claude_code preset. See https://docs.anthropic.com/en/docs/claude-code/sdk/modifying-system-prompts'\n )\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 and systemPrompt can be null to explicitly clear (vs undefined = keep existing).\n */\nexport const UpdateAgentInputSchema = CreateAgentInputSchema.partial().extend({\n modelConfig: ModelConfigSchema.optional().nullable(),\n systemPrompt: z.string().optional().nullable()\n});\n\nexport type UpdateAgentInput = z.infer<typeof UpdateAgentInputSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { GitHubSourceSchema } from '../common/github-source.js';\n\nexport { GitHubSourceSchema };\nexport type { GitHubSource } from '../common/github-source.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 * Regex for valid semver strings (major.minor.patch).\n * Examples: 1.0.0, 2.3.1, 10.20.30\n */\nexport const SEMVER_REGEX = /^\\d+\\.\\d+\\.\\d+$/;\n\n/**\n * Origin of a skill version - how the version was created.\n * - manual: Created through the UI\n * - pr: Created from a pull request (via CI/CD API)\n * - master: Synced from the main branch (via CI/CD API)\n */\nexport const SkillVersionOriginSchema = z.enum(['manual', 'pr', 'master']);\nexport type SkillVersionOrigin = z.infer<typeof SkillVersionOriginSchema>;\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 * - license: License name or file reference (optional)\n * - compatibility: Environment requirements, max 500 chars (optional)\n * - allowedTools: Pre-approved tools the skill may use (space-delimited, experimental)\n * - metadata: Arbitrary key-value pairs for additional properties\n */\nexport const SkillMetadataSchema = z.object({\n name: z.string(),\n description: z.string(),\n license: z.string().optional(),\n compatibility: z.string().optional(),\n metadata: z.record(z.string(), z.string()).optional(),\n allowedTools: z.array(z.string()).optional()\n});\n\nexport type SkillMetadata = z.infer<typeof SkillMetadataSchema>;\n\n/**\n * A single file within a skill directory snapshot.\n */\nexport const SkillFileSchema = z.object({\n /** Relative path within the skill directory, e.g. \"SKILL.md\" or \"references/API_SPEC.md\" */\n path: z.string().min(1),\n /** File content (UTF-8 text) */\n content: z.string()\n});\n\nexport type SkillFile = z.infer<typeof SkillFileSchema>;\n\n/**\n * Skill version - immutable snapshot of a Skill's content.\n *\n * New versions store a `files` array (snapshot of the skill directory from GitHub)\n * and a `source` reference (where the snapshot came from).\n *\n * Versions are immutable - editing creates a new version.\n */\nexport const SkillVersionSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n skillId: z.string(),\n /** Semver string (e.g. \"1.2.0\") or Falcon fingerprint */\n version: z.string(),\n /** How this version was created */\n origin: SkillVersionOriginSchema,\n /** Where this snapshot was taken from */\n source: GitHubSourceSchema.optional(),\n /** Frozen snapshot of all files in the skill directory */\n files: z.array(SkillFileSchema).optional(),\n /** Optional notes about this version (changelog, reason for change) */\n notes: z.string().optional(),\n createdAt: z.string()\n});\n\nexport type SkillVersion = z.infer<typeof SkillVersionSchema>;\n\n/**\n * Input schema for creating a new SkillVersion.\n *\n * For source-based creation: provide `source` (or omit to use the Skill's source).\n * The backend fetches the folder and stores the snapshot as `files`.\n * For inline creation: provide `files` with the SKILL.md content.\n *\n * `version` is required -- the caller must always provide an explicit version string.\n */\nexport const CreateSkillVersionInputSchema = z.object({\n /** GitHub source to snapshot from. If not provided, uses the Skill's source. */\n source: GitHubSourceSchema.optional(),\n /** Version string for this snapshot (e.g. \"1.0.0\", \"1.0.3\"). */\n version: z.string().min(1),\n notes: z.string().optional(),\n /** Origin of this version. Defaults to 'manual' in backend. */\n origin: SkillVersionOriginSchema.optional(),\n /** Pre-edited files to store directly (bypasses GitHub fetch when provided) */\n files: z.array(SkillFileSchema).optional()\n});\n\nexport type CreateSkillVersionInput = z.infer<\n typeof CreateSkillVersionInputSchema\n>;\n\n/**\n * Skill schema - a lightweight container for a coding capability.\n *\n * Skills are containers identified by a kebab-case name.\n * All content (files, notes, etc.) lives in SkillVersion.\n * The `source` field points to the GitHub directory for live fetching.\n * Persisted shape: id, projectId, name, source, createdAt, updatedAt, deleted.\n *\n * Note: `description` is inherited from BaseEntity. It's not stored in the DB\n * for skills (content lives in SkillVersion), but is kept on the type to\n * satisfy the TenantEntity constraint. The repository always returns \"\".\n */\nexport const SkillSchema = TargetSchema.extend({\n /** GitHub source reference for live content fetching */\n source: GitHubSourceSchema.optional()\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 description: true,\n source: true\n}).extend({\n /** Optional - not stored on Skill; content description lives in SkillVersion */\n description: z.string().optional(),\n /** GitHub source reference for live content fetching */\n source: GitHubSourceSchema.optional()\n});\n\n/**\n * Inline initial version data provided when creating a skill atomically.\n * When present on a POST /skills request, the backend creates the skill\n * and its first version in a single request with rollback on failure.\n */\nexport const InitialVersionInputSchema = z.object({\n files: z.array(SkillFileSchema).optional(),\n notes: z.string().optional(),\n source: GitHubSourceSchema.optional(),\n version: z.string().optional(),\n origin: SkillVersionOriginSchema.optional()\n});\n\nexport type InitialVersionInput = z.infer<typeof InitialVersionInputSchema>;\n\n/**\n * Input schema for creating a new Skill.\n * Only `name` and `projectId` are required. `description` is ignored (lives in SkillVersion).\n * Pass `initialVersion` to atomically create the skill and its first version.\n */\nexport const CreateSkillInputSchema = SkillInputBaseSchema.extend({\n initialVersion: InitialVersionInputSchema.optional()\n}).refine((data) => isValidSkillFolderName(data.name), {\n message: KEBAB_CASE_MESSAGE,\n 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\n/**\n * Skill with its latest version - used when displaying skills in the UI\n * and in the evaluator to access skill content.\n */\nexport const SkillWithLatestVersionSchema = SkillSchema.extend({\n latestVersion: SkillVersionSchema.optional()\n});\n\nexport type SkillWithLatestVersion = z.infer<\n typeof SkillWithLatestVersionSchema\n>;\n\n/**\n * Input for bulk-importing skills from a parent directory in GitHub.\n * The source path should point to a directory containing skill subdirectories.\n */\nexport const BulkImportSkillsInputSchema = z.object({\n source: GitHubSourceSchema\n});\nexport type BulkImportSkillsInput = z.infer<typeof BulkImportSkillsInputSchema>;\n\n/**\n * Per-skill result from a bulk import operation.\n */\nexport const BulkImportResultItemSchema = z.object({\n name: z.string(),\n status: z.enum(['created', 'skipped', 'failed']),\n skillId: z.string().optional(),\n reason: z.string().optional()\n});\nexport type BulkImportResultItem = z.infer<typeof BulkImportResultItemSchema>;\n\n/**\n * Full response from a bulk import operation.\n */\nexport const BulkImportResultSchema = z.object({\n created: z.number(),\n skipped: z.number(),\n failed: z.number(),\n items: z.array(BulkImportResultItemSchema)\n});\nexport type BulkImportResult = z.infer<typeof BulkImportResultSchema>;\n", "import { z } from 'zod';\nimport { TargetSchema } from './target.js';\nimport { GitHubSourceSchema } from '../common/github-source.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 * Content can be provided inline via `subAgentMd` or sourced from GitHub\n * via `source`. When `source` is set, the evaluator live-fetches the .md\n * file at run time (template pattern).\n */\nexport const SubAgentSchema = TargetSchema.extend({\n /** The full sub-agent markdown content (YAML frontmatter + body) */\n subAgentMd: z.string(),\n /** GitHub source reference for live content fetching (single .md file) */\n source: GitHubSourceSchema.optional()\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';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Preset schema - a reusable evaluation configuration that bundles\n * an agent with skills, MCPs, sub-agents, and rules.\n *\n * Users create presets once, then trigger eval runs by selecting a test suite.\n * At least one of skillIds, mcpIds, subAgentIds, or ruleIds must be non-empty.\n */\nexport const PresetSchema = TenantEntitySchema.extend({\n /** Agent ID for this preset */\n agentId: z.string(),\n /** Unified capability IDs */\n capabilityIds: z.array(z.string()).optional(),\n /** Map of capabilityId to capabilityVersionId for version pinning */\n capabilityVersions: z.record(z.string(), z.string()).optional()\n});\n\nexport type Preset = z.infer<typeof PresetSchema>;\n\nconst hasCapabilities = (data: { capabilityIds?: string[] }) =>\n (data.capabilityIds?.length ?? 0) > 0;\n\nconst CAPABILITY_IDS_REQUIRED_MESSAGE = 'capabilityIds must be non-empty';\n\n/**\n * Input schema for creating a new Preset.\n */\nexport const CreatePresetInputSchema = PresetSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).refine(hasCapabilities, { message: CAPABILITY_IDS_REQUIRED_MESSAGE });\n\nexport type CreatePresetInput = z.infer<typeof CreatePresetInputSchema>;\n\n/**\n * Input schema for updating a Preset.\n */\nexport const UpdatePresetInputSchema = PresetSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).partial();\n\nexport type UpdatePresetInput = z.infer<typeof UpdatePresetInputSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\nimport { GitHubSourceSchema } from '../common/github-source.js';\n\nexport { GitHubSourceSchema };\nexport type { GitHubSource } from '../common/github-source.js';\n\n/**\n * Capability type discriminator (AIP 7015 pattern).\n *\n * Determines the shape of `content` in CapabilityVersion and\n * the filesystem behavior at evaluation time.\n */\nexport const CapabilityTypeSchema = z.enum([\n 'SKILL',\n 'SUB_AGENT',\n 'RULE',\n 'MCP'\n]);\nexport type CapabilityType = z.infer<typeof CapabilityTypeSchema>;\n\n/**\n * Regex for valid capability names (kebab-case).\n * All capability types enforce filesystem-safe names at storage time.\n */\nexport const CAPABILITY_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\nexport function isValidCapabilityName(name: string): boolean {\n return (\n typeof name === 'string' &&\n name.length > 0 &&\n CAPABILITY_NAME_REGEX.test(name)\n );\n}\n\nconst KEBAB_CASE_MESSAGE =\n 'Name must be in kebab-case (lowercase letters, numbers, hyphens only, e.g. my-capability)';\n\n// ---------------------------------------------------------------------------\n// Version content types (discriminated by parent capability's capabilityType)\n//\n// Content is stored as opaque JSON in the DB. The capabilityType on the parent\n// entity determines which shape applies. We define typed interfaces for each\n// variant, but the Zod parse schema accepts any JSON object \u2014 the type safety\n// comes from the capabilityType discriminator, not from parsing content keys.\n// ---------------------------------------------------------------------------\n\n/** Skill version content: multi-file directory snapshot */\nexport interface SkillContent {\n files?: Array<{ path: string; content: string }>;\n}\n\n/** Sub-agent version content: single markdown file with YAML frontmatter */\nexport interface SubAgentContent {\n subAgentMd: string;\n}\n\n/** Rule version content: rule type + markdown content */\nexport interface RuleContent {\n ruleType: 'claude-md' | 'agents-md' | 'cursor-rule';\n content: string;\n}\n\n/** MCP version content: keyed server config for .mcp.json */\nexport interface McpContent {\n config: Record<string, unknown>;\n}\n\n/** Union of all version content shapes */\nexport type CapabilityContent =\n | SkillContent\n | SubAgentContent\n | RuleContent\n | McpContent;\n\n/**\n * Zod schema for content \u2014 accepts any JSON object.\n * Type safety is enforced by the parent's capabilityType, not by parsing.\n */\nexport const CapabilityContentSchema = z.record(z.string(), z.unknown());\n\n// ---------------------------------------------------------------------------\n// Version origin (reuse from skills \u2014 same semantics for all types)\n// ---------------------------------------------------------------------------\n\nexport const CapabilityVersionOriginSchema = z.enum(['manual', 'pr', 'master']);\nexport type CapabilityVersionOrigin = z.infer<\n typeof CapabilityVersionOriginSchema\n>;\n\n// ---------------------------------------------------------------------------\n// Entity schemas\n// ---------------------------------------------------------------------------\n\n/**\n * Capability schema \u2014 lightweight container for any building-block type.\n *\n * Content lives in CapabilityVersion (immutable snapshots).\n * `capabilityType` is the AIP 7015 discriminator.\n * `source` is the optional GitHub reference for live fetching.\n */\nexport const CapabilitySchema = TenantEntitySchema.extend({\n capabilityType: CapabilityTypeSchema,\n source: GitHubSourceSchema.optional()\n});\n\nexport type Capability = z.infer<typeof CapabilitySchema>;\n\n/**\n * Capability version \u2014 immutable content snapshot.\n *\n * `content` shape is determined by the parent capability's `capabilityType`.\n */\nexport const CapabilityVersionSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n capabilityId: z.string(),\n version: z.string(),\n origin: CapabilityVersionOriginSchema,\n source: GitHubSourceSchema.optional(),\n content: CapabilityContentSchema.optional(),\n notes: z.string().optional(),\n createdAt: z.string()\n});\n\n// Override Zod-inferred content (Record<string, unknown>) with the strict union.\n// The schema accepts any JSON object at parse time; type safety is provided\n// by discriminating on the parent capability's capabilityType.\nexport type CapabilityVersion = Omit<\n z.infer<typeof CapabilityVersionSchema>,\n 'content'\n> & {\n content?: CapabilityContent;\n};\n\n/**\n * Capability enriched with its latest version \u2014 used in UI and evaluator.\n */\nexport const CapabilityWithLatestVersionSchema = CapabilitySchema.extend({\n latestVersion: CapabilityVersionSchema.optional()\n});\n\nexport type CapabilityWithLatestVersion = Omit<\n z.infer<typeof CapabilityWithLatestVersionSchema>,\n 'latestVersion'\n> & {\n latestVersion?: CapabilityVersion;\n};\n\n// ---------------------------------------------------------------------------\n// Input schemas\n// ---------------------------------------------------------------------------\n\nconst CapabilityInputBaseSchema = CapabilitySchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true,\n description: true,\n source: true\n}).extend({\n description: z.string().optional(),\n source: GitHubSourceSchema.optional()\n});\n\n/**\n * Inline initial version data for atomic capability + version creation.\n */\nexport const InitialCapabilityVersionInputSchema = z.object({\n content: CapabilityContentSchema.optional(),\n notes: z.string().optional(),\n source: GitHubSourceSchema.optional(),\n version: z.string().optional(),\n origin: CapabilityVersionOriginSchema.optional()\n});\n\nexport type InitialCapabilityVersionInput = z.infer<\n typeof InitialCapabilityVersionInputSchema\n>;\n\n/**\n * Input schema for creating a new Capability.\n */\nexport const CreateCapabilityInputSchema = CapabilityInputBaseSchema.extend({\n initialVersion: InitialCapabilityVersionInputSchema.optional()\n}).refine((data) => isValidCapabilityName(data.name), {\n message: KEBAB_CASE_MESSAGE,\n path: ['name']\n});\n\nexport type CreateCapabilityInput = z.infer<typeof CreateCapabilityInputSchema>;\n\n/**\n * Input schema for updating a Capability.\n */\nexport const UpdateCapabilityInputSchema = CapabilityInputBaseSchema.omit({\n capabilityType: true\n})\n .partial()\n .refine(\n (data) => data.name === undefined || isValidCapabilityName(data.name),\n { message: KEBAB_CASE_MESSAGE, path: ['name'] }\n );\n\nexport type UpdateCapabilityInput = z.infer<typeof UpdateCapabilityInputSchema>;\n\n/**\n * Input schema for creating a new CapabilityVersion.\n */\nexport const CreateCapabilityVersionInputSchema = z.object({\n source: GitHubSourceSchema.optional(),\n version: z.string().min(1),\n notes: z.string().optional(),\n origin: CapabilityVersionOriginSchema.optional(),\n content: CapabilityContentSchema.optional()\n});\n\nexport type CreateCapabilityVersionInput = Omit<\n z.infer<typeof CreateCapabilityVersionInputSchema>,\n 'content'\n> & {\n content?: CapabilityContent;\n};\n", "/**\n * Pure conversion functions: Capability \u2192 legacy entity types.\n *\n * These functions live in eval-types so both the backend bridge service\n * and the evaluator can use them without duplicating logic.\n */\nimport type { Skill } from './skill.js';\nimport type { SkillVersion } from './skill.js';\nimport type { SkillWithLatestVersion } from './skill.js';\nimport type { SubAgent } from './sub-agent.js';\nimport type { Rule } from '../common/rule.js';\nimport type { MCPEntity } from '../common/mcp.js';\nimport type {\n Capability,\n CapabilityVersion,\n CapabilityWithLatestVersion,\n SkillContent,\n SubAgentContent,\n RuleContent,\n McpContent\n} from './capability.js';\n\n// ---------------------------------------------------------------------------\n// Capability \u2192 old entity conversion (backward-compat reads)\n// ---------------------------------------------------------------------------\n\nexport function capabilityToSkill(cap: Capability): Skill {\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n source: cap.source,\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityVersionToSkillVersion(\n cv: CapabilityVersion\n): SkillVersion {\n // Content is discriminated by parent capability_type; caller ensures type is SKILL\n const content = cv.content as SkillContent | undefined;\n return {\n id: cv.id,\n projectId: cv.projectId,\n skillId: cv.capabilityId,\n version: cv.version,\n origin: cv.origin,\n source: cv.source,\n files: content?.files,\n notes: cv.notes,\n createdAt: cv.createdAt\n };\n}\n\nexport function capabilityToSkillWithLatestVersion(\n cap: CapabilityWithLatestVersion\n): SkillWithLatestVersion {\n const skill = capabilityToSkill(cap);\n const latestVersion = cap.latestVersion\n ? capabilityVersionToSkillVersion(cap.latestVersion)\n : undefined;\n return { ...skill, latestVersion };\n}\n\nexport function capabilityToSubAgent(\n cap: CapabilityWithLatestVersion\n): SubAgent {\n // Content is discriminated by parent capability_type; caller ensures type is SUB_AGENT\n const content = cap.latestVersion?.content as SubAgentContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n subAgentMd: content?.subAgentMd ?? '',\n source: cap.source,\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityToRule(cap: CapabilityWithLatestVersion): Rule {\n // Content is discriminated by parent capability_type; caller ensures type is RULE\n const content = cap.latestVersion?.content as RuleContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n ruleType: content?.ruleType ?? 'claude-md',\n content: content?.content ?? '',\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\nexport function capabilityToMcp(cap: CapabilityWithLatestVersion): MCPEntity {\n // Content is discriminated by parent capability_type; caller ensures type is MCP\n const content = cap.latestVersion?.content as McpContent | undefined;\n return {\n id: cap.id,\n projectId: cap.projectId,\n name: cap.name,\n description: cap.description,\n config: content?.config ?? {},\n createdAt: cap.createdAt,\n updatedAt: cap.updatedAt,\n deleted: cap.deleted\n };\n}\n\n// ---------------------------------------------------------------------------\n// Helpers for grouping capabilities by type\n// ---------------------------------------------------------------------------\n\nexport function groupCapabilitiesByType(\n capabilities: CapabilityWithLatestVersion[]\n): {\n skills: SkillWithLatestVersion[];\n subAgents: SubAgent[];\n rules: Rule[];\n mcps: MCPEntity[];\n} {\n const skills: SkillWithLatestVersion[] = [];\n const subAgents: SubAgent[] = [];\n const rules: Rule[] = [];\n const mcps: MCPEntity[] = [];\n\n for (const cap of capabilities) {\n switch (cap.capabilityType) {\n case 'SKILL':\n skills.push(capabilityToSkillWithLatestVersion(cap));\n break;\n case 'SUB_AGENT':\n subAgents.push(capabilityToSubAgent(cap));\n break;\n case 'RULE':\n rules.push(capabilityToRule(cap));\n break;\n case 'MCP':\n mcps.push(capabilityToMcp(cap));\n break;\n }\n }\n\n return { skills, subAgents, rules, mcps };\n}\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 verdict: string;\n judgeReasoning: 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 * 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 {\n AssertionSchema,\n ScenarioAssertionLinkSchema\n} from '../assertion/assertion.js';\nimport { SYSTEM_ASSERTION_IDS } from '../assertion/system-assertions.js';\nimport { isAllowedBuildCommandString } from '../assertion/build-passed-command.js';\n\n/**\n * Trigger prompt image - a base64-encoded image attached to a scenario's trigger prompt.\n */\n/** Max base64 string length for a 2 MB image: 4 * ceil(bytes / 3). */\nconst MAX_IMAGE_BASE64_LENGTH = 4 * Math.ceil((2 * 1024 * 1024) / 3);\n\nexport const TriggerPromptImageSchema = z.object({\n /** Base64-encoded image data (no data URL prefix) */\n base64: z\n .string()\n .max(MAX_IMAGE_BASE64_LENGTH, 'Image exceeds 2 MB size limit'),\n /** MIME type of the image */\n mediaType: z.enum(['image/jpeg', 'image/png', 'image/gif', 'image/webp']),\n /** Original filename of the image */\n name: z.string()\n});\n\nexport type TriggerPromptImage = z.infer<typeof TriggerPromptImageSchema>;\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 * Trigger prompt images stored as JSON in trigger_prompt_images column.\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 /** Tags for categorisation and filtering */\n tags: z.array(z.string()).optional(),\n /** Base64-encoded images attached to the trigger prompt (max 3) */\n triggerPromptImages: z.array(TriggerPromptImageSchema).max(3).optional()\n});\n\nexport type TestScenario = z.infer<typeof TestScenarioSchema>;\n\nexport function validateBuildPassedParamsInAssertionLinks(\n links:\n | { assertionId: string; params?: Record<string, unknown> }[]\n | undefined,\n ctx: z.RefinementCtx\n): void {\n if (!links) return;\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n if (link.assertionId !== SYSTEM_ASSERTION_IDS.BUILD_PASSED) continue;\n const cmd = link.params?.command;\n if (cmd === undefined || cmd === null) continue;\n if (typeof cmd !== 'string') {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'build_passed command must be a string',\n path: ['assertionLinks', i, 'params', 'command']\n });\n continue;\n }\n if (!isAllowedBuildCommandString(cmd)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'Invalid build_passed command. Allowed: yarn build, npm run build, pnpm run build, pnpm build',\n path: ['assertionLinks', i, 'params', 'command']\n });\n }\n }\n}\n\nconst TestScenarioCreateBaseSchema = TestScenarioSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\n/**\n * Input schema for creating a new TestScenario.\n */\nexport const CreateTestScenarioInputSchema =\n TestScenarioCreateBaseSchema.superRefine((data, ctx) => {\n validateBuildPassedParamsInAssertionLinks(data.assertionLinks, ctx);\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 TestScenarioCreateBaseSchema.partial().superRefine((data, ctx) => {\n if (data.assertionLinks !== undefined) {\n validateBuildPassedParamsInAssertionLinks(data.assertionLinks, ctx);\n }\n });\n\nexport type UpdateTestScenarioInput = z.infer<\n typeof UpdateTestScenarioInputSchema\n>;\n", "import { z } from 'zod';\nimport { BuildPassedCommandStringSchema } from './build-passed-command.js';\n\n/**\n * Assertion types:\n * - skill_was_called: Checks if a specific skill was invoked (deterministic, system-level)\n * - tool_called_with_param: Checks if a tool was called with expected parameters (deterministic, system-level)\n * - build_passed: Runs a command and checks exit code (deterministic, system-level)\n * - time_limit: Checks that scenario completed within a duration threshold (deterministic, system-level)\n * - cost: Checks that scenario LLM cost stays within a USD threshold (deterministic, system-level)\n * - llm_judge: LLM evaluates output with a prompt (LLM-based, system-level)\n * - api_call: Makes an HTTP request and validates response with JSON subset matching (deterministic, system-level)\n *\n * Any assertion can be negated by setting `negate: true` to invert the pass/fail logic.\n */\nexport const AssertionTypeSchema = z.enum([\n 'skill_was_called',\n 'tool_called_with_param',\n 'build_passed',\n 'time_limit',\n 'cost',\n 'llm_judge',\n 'api_call'\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 system assertion (e.g., 'system:skill_was_called') */\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 cost assertion type.\n * Uses strictObject to reject objects with unknown keys (prevents matching other configs).\n */\nexport const CostConfigSchema = z.strictObject({\n /** Maximum allowed cost in USD */\n maxCostUsd: z.number().positive()\n});\n\nexport type CostConfig = z.infer<typeof CostConfigSchema>;\n\n/** Configuration for tool_called_with_param assertion type.\n * Uses strictObject to reject objects with unknown keys.\n * When expectedParams is omitted, the assertion checks only that the tool was called (or not, if negated).\n */\nexport const ToolCalledWithParamConfigSchema = z.strictObject({\n /** Name of the tool that must have been called */\n toolName: z.string().min(1),\n /** JSON string of key-value pairs for expected parameters (substring match). Optional \u2014 when omitted, only checks tool presence. */\n expectedParams: z.string().min(1).optional(),\n /** If true, the matching tool call must also have succeeded (step.success === true) */\n requireSuccess: z.boolean().optional()\n});\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 /** Allowlisted command only (default at runtime: \"yarn build\") */\n command: BuildPassedCommandStringSchema.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 time assertion type.\n * Uses strictObject to reject objects with unknown keys.\n */\nexport const TimeConfigSchema = z.strictObject({\n /** Maximum allowed duration in milliseconds */\n maxDurationMs: z.number().int().positive()\n});\n\nexport type TimeConfig = z.infer<typeof TimeConfigSchema>;\n\n/**\n * Configuration for llm_judge assertion type.\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 /** Minimum score to pass (0-10, default 7) */\n minScore: z.number().int().min(0).max(10).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 * Configuration for api_call assertion type.\n * Makes an HTTP request after scenario execution and validates the response\n * contains the expected data using JSON subset matching.\n * Uses strictObject to reject objects with unknown keys.\n */\nexport const ApiCallConfigSchema = z.strictObject({\n /** URL to call */\n url: z.string().min(1),\n /** HTTP method (default GET) */\n method: z.enum(['GET', 'POST']).optional(),\n /** Request body (JSON string, for POST requests) */\n requestBody: z.string().optional(),\n /** Expected JSON response to validate against (subset match \u2014 extra fields in actual are OK) */\n expectedResponse: z.string().min(1),\n /** Request headers as JSON string of key-value pairs */\n requestHeaders: z.string().optional(),\n /** Request timeout in milliseconds (default 30000) */\n timeoutMs: z.number().int().positive().optional()\n});\n\nexport type ApiCallConfig = z.infer<typeof ApiCallConfigSchema>;\n\n/** Shared fields for all assertion types. */\nconst AssertionBaseFields = {\n /** When true, the assertion's pass/fail logic is inverted (NOT operator). */\n negate: z.boolean().optional()\n};\n\nexport const SkillWasCalledAssertionSchema = SkillWasCalledConfigSchema.extend({\n type: z.literal('skill_was_called'),\n ...AssertionBaseFields\n});\n\nexport type SkillWasCalledAssertion = z.infer<\n typeof SkillWasCalledAssertionSchema\n>;\n\nexport const ToolCalledWithParamAssertionSchema =\n ToolCalledWithParamConfigSchema.extend({\n type: z.literal('tool_called_with_param'),\n ...AssertionBaseFields\n });\n\nexport type ToolCalledWithParamAssertion = z.infer<\n typeof ToolCalledWithParamAssertionSchema\n>;\n\nexport const BuildPassedAssertionSchema = BuildPassedConfigSchema.extend({\n type: z.literal('build_passed'),\n ...AssertionBaseFields\n});\n\nexport type BuildPassedAssertion = z.infer<typeof BuildPassedAssertionSchema>;\n\nexport const CostAssertionSchema = CostConfigSchema.extend({\n type: z.literal('cost'),\n ...AssertionBaseFields\n});\n\nexport type CostAssertion = z.infer<typeof CostAssertionSchema>;\n\nexport const LlmJudgeAssertionSchema = LlmJudgeConfigSchema.extend({\n type: z.literal('llm_judge'),\n ...AssertionBaseFields\n});\n\nexport type LlmJudgeAssertion = z.infer<typeof LlmJudgeAssertionSchema>;\n\nexport const ApiCallAssertionSchema = ApiCallConfigSchema.extend({\n type: z.literal('api_call'),\n ...AssertionBaseFields\n});\n\nexport type ApiCallAssertion = z.infer<typeof ApiCallAssertionSchema>;\n\nexport const TimeAssertionSchema = TimeConfigSchema.extend({\n type: z.literal('time_limit'),\n ...AssertionBaseFields\n});\n\nexport type TimeAssertion = z.infer<typeof TimeAssertionSchema>;\n\n/**\n * Union of all inline assertion types.\n * Each assertion has a type literal and type-specific data.\n */\nexport const AssertionSchema = z.union([\n SkillWasCalledAssertionSchema,\n ToolCalledWithParamAssertionSchema,\n BuildPassedAssertionSchema,\n TimeAssertionSchema,\n CostAssertionSchema,\n LlmJudgeAssertionSchema,\n ApiCallAssertionSchema\n]);\n\nexport type Assertion = z.infer<typeof AssertionSchema>;\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 skillNames\n ToolCalledWithParamConfigSchema, // requires toolName, uses strictObject\n ApiCallConfigSchema, // requires url + expectedResponse, uses strictObject\n TimeConfigSchema, // requires maxDurationMs, uses strictObject\n CostConfigSchema, // requires maxCostUsd, uses strictObject\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 * 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 'cost':\n return CostConfigSchema.safeParse(config).success;\n case 'tool_called_with_param':\n return ToolCalledWithParamConfigSchema.safeParse(config).success;\n case 'build_passed':\n return BuildPassedConfigSchema.safeParse(config).success;\n case 'time_limit':\n return TimeConfigSchema.safeParse(config).success;\n case 'llm_judge':\n return LlmJudgeConfigSchema.safeParse(config).success;\n case 'api_call':\n return ApiCallConfigSchema.safeParse(config).success;\n default:\n return false;\n }\n}\n", "import { z } from 'zod';\n\n/**\n * Allowlisted shell-free build commands for `build_passed` assertions (VELO-9590).\n * Each entry maps to a fixed argv array for execFile \u2014 no user-controlled shell.\n */\nexport const ALLOWED_BUILD_COMMANDS = [\n 'yarn build',\n 'npm run build',\n 'pnpm run build',\n 'pnpm build'\n] as const;\n\nexport type AllowedBuildCommandString = (typeof ALLOWED_BUILD_COMMANDS)[number];\n\n/** Default when `command` is omitted (matches historical behavior). */\nexport const DEFAULT_BUILD_PASSED_COMMAND: AllowedBuildCommandString =\n 'yarn build';\n\nconst BUILD_COMMAND_ARGV: Record<\n AllowedBuildCommandString,\n readonly [string, ...string[]]\n> = {\n 'yarn build': ['yarn', 'build'],\n 'npm run build': ['npm', 'run', 'build'],\n 'pnpm run build': ['pnpm', 'run', 'build'],\n 'pnpm build': ['pnpm', 'build']\n};\n\n/**\n * True if the string (after trim) is an allowlisted build command.\n */\nexport function isAllowedBuildCommandString(command: string): boolean {\n const trimmed = command.trim();\n return (ALLOWED_BUILD_COMMANDS as readonly string[]).includes(trimmed);\n}\n\n/**\n * Resolve an allowlisted command string to argv for `execFile` / `execFileSync`.\n * Returns null if the command is not allowlisted.\n */\nexport function parseBuildCommandToArgv(\n command: string\n): readonly [string, ...string[]] | null {\n const trimmed = command.trim() as AllowedBuildCommandString;\n if (!(trimmed in BUILD_COMMAND_ARGV)) {\n return null;\n }\n return BUILD_COMMAND_ARGV[trimmed];\n}\n\nconst enumTuple = ALLOWED_BUILD_COMMANDS as unknown as [\n AllowedBuildCommandString,\n ...AllowedBuildCommandString[]\n];\n\n/** Zod schema for an optional/required allowlisted build command string. */\nexport const BuildPassedCommandStringSchema = z.enum(enumTuple);\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:'.\n */\nexport const SYSTEM_ASSERTION_IDS = {\n SKILL_WAS_CALLED: 'system:skill_was_called',\n TOOL_CALLED_WITH_PARAM: 'system:tool_called_with_param',\n BUILD_PASSED: 'system:build_passed',\n TIME_LIMIT: 'system:time_limit',\n COST: 'system:cost',\n LLM_JUDGE: 'system:llm_judge',\n API_CALL: 'system:api_call'\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 name: 'negate',\n label: 'Negate (NOT operator)',\n type: 'boolean',\n required: false,\n defaultValue: false\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.TOOL_CALLED_WITH_PARAM]: {\n id: SYSTEM_ASSERTION_IDS.TOOL_CALLED_WITH_PARAM,\n name: 'Tool Called With Param',\n description:\n 'Check that a tool was called with expected parameters (tool name is substring matched)',\n type: 'tool_called_with_param',\n parameters: [\n {\n name: 'toolName',\n label: 'Tool Name',\n type: 'string',\n required: true\n },\n {\n name: 'expectedParams',\n label: 'Expected Parameters (JSON, substring match)',\n type: 'string',\n required: false\n },\n {\n name: 'requireSuccess',\n label: 'Require Successful Call',\n type: 'boolean',\n required: false,\n defaultValue: false,\n advanced: true\n },\n {\n name: 'negate',\n label: 'Negate (NOT operator)',\n type: 'boolean',\n required: false,\n defaultValue: false\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.TIME_LIMIT]: {\n id: SYSTEM_ASSERTION_IDS.TIME_LIMIT,\n name: 'Time Limit',\n description: 'Check that the scenario completed within a maximum duration',\n type: 'time_limit',\n parameters: [\n {\n name: 'maxDurationMs',\n label: 'Max Duration (ms)',\n type: 'number',\n required: true,\n defaultValue: 300000\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.COST]: {\n id: SYSTEM_ASSERTION_IDS.COST,\n name: 'Cost',\n description:\n 'Check that the scenario LLM execution cost stays within a USD threshold',\n type: 'cost',\n parameters: [\n {\n name: 'maxCostUsd',\n label: 'Max Cost (USD)',\n type: 'number',\n required: true,\n defaultValue: 1.0\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-10)',\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: 'minScore',\n label: 'Minimum Score (0-10)',\n type: 'number',\n required: false,\n defaultValue: 7\n },\n {\n name: 'model',\n label: 'Model',\n type: 'string',\n required: false\n }\n ]\n },\n [SYSTEM_ASSERTION_IDS.API_CALL]: {\n id: SYSTEM_ASSERTION_IDS.API_CALL,\n name: 'API Call',\n description:\n 'Call an API endpoint and verify the response contains expected data',\n type: 'api_call',\n parameters: [\n {\n name: 'url',\n label: 'URL',\n type: 'string',\n required: true\n },\n {\n name: 'method',\n label: 'HTTP Method',\n type: 'string',\n required: false,\n defaultValue: 'GET'\n },\n {\n name: 'requestBody',\n label: 'Request Body (JSON)',\n type: 'string',\n required: false\n },\n {\n name: 'expectedResponse',\n label: 'Expected Response (JSON)',\n type: 'string',\n required: true\n },\n {\n name: 'requestHeaders',\n label: 'Headers (JSON)',\n type: 'string',\n required: false,\n advanced: true\n },\n {\n name: 'timeoutMs',\n label: 'Timeout (ms)',\n type: 'number',\n required: false,\n defaultValue: 30000,\n advanced: true\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", "import { z } from 'zod';\nimport { ScenarioAssertionLinkSchema } from '../assertion/assertion.js';\nimport { validateBuildPassedParamsInAssertionLinks } from './test-scenario.js';\n\nconst UUID_REGEX =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\n/**\n * Assertion link in batch import JSON \u2014 accepts two forms:\n * - String: bare assertion reference (\"system:build_passed\" or \"Check widget count\")\n * - Object: { assertionId, params? } for assertions needing parameters\n */\nexport const BatchAssertionLinkSchema = z.union([\n z.string().min(1),\n ScenarioAssertionLinkSchema\n]);\n\nexport type BatchAssertionLink = z.infer<typeof BatchAssertionLinkSchema>;\n\n/**\n * Single scenario entry in the batch import payload.\n * name and triggerPrompt are required; everything else is optional.\n */\nexport const BatchScenarioEntrySchema = z\n .object({\n name: z.string().min(1, 'name: Required'),\n description: z.string().optional().default(''),\n triggerPrompt: z\n .string()\n .min(10, 'triggerPrompt: Must be at least 10 characters'),\n templateId: z.string().nullish(),\n tags: z.array(z.string()).optional(),\n assertionLinks: z.array(BatchAssertionLinkSchema).optional()\n })\n .superRefine((data, ctx) => {\n if (!data.assertionLinks) return;\n const objectLinks = data.assertionLinks.filter(\n (link): link is z.infer<typeof ScenarioAssertionLinkSchema> =>\n typeof link !== 'string'\n );\n if (objectLinks.length > 0) {\n validateBuildPassedParamsInAssertionLinks(objectLinks, ctx);\n }\n });\n\nexport type BatchScenarioEntry = z.infer<typeof BatchScenarioEntrySchema>;\n\n/**\n * Top-level wrapper for the batch import JSON payload.\n * Contains a `scenarios` array (1\u2013100 entries).\n */\nexport const BatchImportPayloadSchema = z.object({\n scenarios: z\n .array(BatchScenarioEntrySchema)\n .min(1, 'scenarios array must contain at least one entry')\n .max(100, 'Maximum 100 scenarios per upload')\n});\n\nexport type BatchImportPayload = z.infer<typeof BatchImportPayloadSchema>;\n\nexport const BATCH_IMPORT_LIMITS = {\n MAX_SCENARIOS: 100,\n MAX_PAYLOAD_BYTES: 1_048_576 // 1 MB\n} as const;\n\n/**\n * Classify a string assertion reference:\n * - \"system:*\" \u2192 system assertion ID\n * - UUID format \u2192 custom assertion ID\n * - otherwise \u2192 assertion name (needs resolution)\n */\nexport function classifyAssertionRef(ref: string): {\n type: 'system' | 'uuid' | 'name';\n value: string;\n} {\n if (ref.startsWith('system:')) {\n return { type: 'system', value: ref };\n }\n if (UUID_REGEX.test(ref)) {\n return { type: 'uuid', value: ref };\n }\n return { type: 'name', value: ref };\n}\n\n/**\n * Normalize a batch assertion link (string or object) into a standard\n * ScenarioAssertionLink. String refs are classified and returned as\n * { assertionId } \u2014 actual resolution (name\u2192UUID) is done by the backend.\n */\nexport function normalizeBatchAssertionLink(\n link: BatchAssertionLink\n): z.infer<typeof ScenarioAssertionLinkSchema> {\n if (typeof link === 'string') {\n return { assertionId: link };\n }\n return link;\n}\n\n/** Per-scenario result returned by the batch endpoint. */\nexport const BatchResultItemSchema = z.object({\n index: z.number(),\n name: z.string(),\n status: z.enum(['valid', 'invalid']),\n id: z.string().nullable().optional(),\n errors: z.array(z.string()).optional()\n});\n\nexport type BatchResultItem = z.infer<typeof BatchResultItemSchema>;\n\n/** Summary section of the batch response. */\nexport const BatchSummarySchema = z.object({\n total: z.number(),\n valid: z.number(),\n invalid: z.number(),\n created: z.number()\n});\n\nexport type BatchSummary = z.infer<typeof BatchSummarySchema>;\n\n/** Full response from the batch import endpoint. */\nexport const BatchImportResponseSchema = z.object({\n summary: BatchSummarySchema,\n results: z.array(BatchResultItemSchema)\n});\n\nexport type BatchImportResponse = z.infer<typeof BatchImportResponseSchema>;\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 turnIndex: z.number().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 totalTurns: z.number().optional(),\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';\nimport { ConversationMessageSchema } from './conversation.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 /** SkillVersion ID used for this evaluation (for version tracking) */\n skillVersionId: z.string().optional(),\n /** SkillVersion semver string (e.g., \"1.0.0\", \"1.2.3\") for display */\n skillVersion: z.string().optional(),\n scenarioId: z.string(),\n scenarioName: z.string(),\n /** Snapshot of the trigger prompt used during the run (prevents stale display after edits) */\n triggerPrompt: z.string().optional(),\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 /** Full conversation messages (only present in transit; stripped before DB storage) */\n conversation: z.array(ConversationMessageSchema).optional(),\n /** 0-based iteration index when a scenario is run multiple times within a single eval run */\n iterationIndex: z.number().int().min(0).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';\nimport { AgentRunCommandSchema, AgentTypeSchema } from '../target/agent.js';\nimport { ModelConfigSchema } from '../common/models.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 SCHEDULED = 'SCHEDULED'\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 scheduleId: 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.nativeEnum(TriggerType)\n});\n\nexport type Trigger = z.infer<typeof TriggerSchema>;\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 /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */\n isInfrastructure: z.boolean().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 /** Whether this file is an infrastructure/config file (e.g. .claude/settings.json, .mcp.json) */\n isInfrastructure: z.boolean().optional()\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 * A single finding from the LLM-generated run analysis.\n */\nexport const RunAnalysisFindingSchema = z.object({\n category: z.enum([\n 'failure_pattern',\n 'cost_waste',\n 'flakiness',\n 'inefficiency',\n 'positive'\n ]),\n severity: z.enum(['high', 'medium', 'low']),\n description: z.string(),\n affectedScenarios: z.array(z.string()),\n recommendation: z.string().optional()\n});\n\nexport type RunAnalysisFinding = z.infer<typeof RunAnalysisFindingSchema>;\n\n/**\n * LLM-generated analysis of a completed eval run.\n */\nexport const RunAnalysisSchema = z.object({\n generatedAt: z.string(),\n summary: z.string(),\n findings: z.array(RunAnalysisFindingSchema)\n});\n\nexport type RunAnalysis = z.infer<typeof RunAnalysisSchema>;\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 /** Preset ID that originated this run (optional) */\n presetId: z.string().optional(),\n /** Scenario IDs to run (always present \u2014 resolved server-side from tags when needed) */\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 /** 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 /** Unified capability IDs */\n capabilityIds: z.array(z.string()).optional(),\n /** Map of capabilityId to capabilityVersionId for version pinning */\n capabilityVersions: z.record(z.string(), z.string()).optional(),\n /** Tags used to select scenarios for this run (for traceability) */\n tags: z.array(z.string()).optional(),\n /** How many times each scenario is executed within this eval run. Default: 1. Max: 20. */\n runsPerScenario: z.number().int().min(1).max(20).optional(),\n /** Snapshot of agent configuration captured at run creation time */\n agentSnapshot: z\n .object({\n name: z.string().optional(),\n agentType: AgentTypeSchema.optional(),\n runCommand: AgentRunCommandSchema.optional(),\n systemPrompt: z.string().nullable().optional(),\n modelConfig: ModelConfigSchema.optional()\n })\n .optional(),\n /** UUID linking all runs in a comparison group */\n comparisonGroupId: z.string().optional(),\n /** Human-readable label for this variant (e.g., \"MCP: Wix Stores\") */\n comparisonLabel: z.string().optional(),\n /** LLM-generated analysis of the completed run */\n runAnalysis: RunAnalysisSchema.optional()\n});\n\nexport type EvalRun = z.infer<typeof EvalRunSchema>;\n\n/**\n * Input schema for creating a new EvalRun.\n *\n * Either `scenarioIds` or `tags` (or both) must be provided.\n * When `tags` are provided without `scenarioIds`, the backend resolves\n * matching scenarios server-side and populates `scenarioIds` on the entity.\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 scenarioIds: true,\n agentSnapshot: true\n})\n .extend({\n /** Optional on input \u2014 backend resolves from tags when not provided */\n scenarioIds: z.array(z.string()).optional()\n })\n .refine(\n (data) =>\n (data.scenarioIds && data.scenarioIds.length > 0) ||\n (data.tags && data.tags.length > 0),\n { message: 'Either scenarioIds or tags must be provided' }\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';\n\n/**\n * Individual content blocks within a conversation message.\n */\nexport const TextBlockSchema = z.object({\n type: z.literal('text'),\n text: z.string()\n});\n\nexport const ThinkingBlockSchema = z.object({\n type: z.literal('thinking'),\n thinking: z.string()\n});\n\nexport const ToolUseBlockSchema = z.object({\n type: z.literal('tool_use'),\n toolName: z.string(),\n toolId: z.string(),\n input: z.unknown()\n});\n\nexport const ToolResultBlockSchema = z.object({\n type: z.literal('tool_result'),\n toolUseId: z.string(),\n content: z.string(),\n isError: z.boolean().optional()\n});\n\nexport const ConversationBlockSchema = z.discriminatedUnion('type', [\n TextBlockSchema,\n ThinkingBlockSchema,\n ToolUseBlockSchema,\n ToolResultBlockSchema\n]);\n\nexport type ConversationBlock = z.infer<typeof ConversationBlockSchema>;\n\n/**\n * A single message in the conversation (assistant, user, or system).\n */\nexport const ConversationMessageRoles = [\n 'assistant',\n 'user',\n 'system'\n] as const;\n\nexport const ConversationMessageSchema = z.object({\n role: z.enum(ConversationMessageRoles),\n content: z.array(ConversationBlockSchema),\n timestamp: z.string()\n});\n\nexport type ConversationMessage = z.infer<typeof ConversationMessageSchema>;\n\n/**\n * Full conversation stored per scenario result.\n */\nexport const ScenarioConversationSchema = z.object({\n id: z.string(),\n projectId: z.string(),\n evalRunId: z.string(),\n resultId: z.string(),\n messages: z.array(ConversationMessageSchema),\n createdAt: z.string()\n});\n\nexport type ScenarioConversation = z.infer<typeof ScenarioConversationSchema>;\n\n/**\n * Response shape for the GET conversation endpoint.\n * isPartial is true when the conversation was reconstructed from trace events\n * rather than saved from a completed run.\n */\nexport const ConversationResponseSchema = z.object({\n messages: z.array(ConversationMessageSchema),\n isPartial: z.boolean()\n});\n\nexport type ConversationResponse = z.infer<typeof ConversationResponseSchema>;\n", "import { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * EvalRunFolder schema - a folder for organizing eval runs.\n * Runs can belong to multiple folders (many-to-many).\n */\nexport const EvalRunFolderSchema = TenantEntitySchema.extend({});\n\nexport type EvalRunFolder = z.infer<typeof EvalRunFolderSchema>;\n\n/**\n * Input schema for creating a new EvalRunFolder.\n */\nexport const CreateEvalRunFolderInputSchema = EvalRunFolderSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n});\n\nexport type CreateEvalRunFolderInput = z.infer<\n typeof CreateEvalRunFolderInputSchema\n>;\n\n/**\n * Input schema for updating an EvalRunFolder.\n */\nexport const UpdateEvalRunFolderInputSchema = EvalRunFolderSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true\n}).partial();\n\nexport type UpdateEvalRunFolderInput = z.infer<\n typeof UpdateEvalRunFolderInputSchema\n>;\n\n/**\n * Folder membership - links an eval run to a folder.\n */\nexport const EvalRunFolderMembershipSchema = z.object({\n folderId: z.string(),\n evalRunId: z.string(),\n projectId: z.string(),\n createdAt: z.string()\n});\n\nexport type EvalRunFolderMembership = z.infer<\n typeof EvalRunFolderMembershipSchema\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 scenarioTags: z\n .array(z.string())\n .optional()\n .describe('Project-level tag vocabulary for scenarios'),\n /** Per-project Wix auth token (write-only \u2014 never returned in GET responses). null = clear. */\n wixAuthToken: z\n .string()\n .nullable()\n .optional()\n .describe('Wix auth token for CLI/MCP authentication (encrypted at rest)'),\n /** Per-project Base44 auth file content (write-only \u2014 never returned in GET responses). null = clear. */\n base44AuthFile: z\n .string()\n .nullable()\n .optional()\n .describe('Base64-encoded Base44 auth file content (encrypted at rest)'),\n /** Resolved at runtime from the encrypted Wix auth token */\n wixAuthEmail: z\n .string()\n .optional()\n .describe('Email associated with the Wix auth token (resolved at runtime)'),\n /** Resolved at runtime from the encrypted Base44 auth file */\n base44AuthEmail: z\n .string()\n .optional()\n .describe('Email from the Base44 auth file (resolved at runtime)')\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\n\n/**\n * Input schema for creating a new Project.\n * Omits read-only / runtime-resolved fields.\n * Requires appId for proper app-credential scoping and tenancy isolation.\n */\nexport const CreateProjectInputSchema = ProjectSchema.omit({\n id: true,\n createdAt: true,\n updatedAt: true,\n deleted: true,\n wixAuthEmail: true,\n base44AuthEmail: true\n}).extend({\n appId: z\n .string()\n .describe(\n 'Required: The ID of the app in Dev Center for credential scoping'\n )\n});\n\nexport type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;\n\n/**\n * Input schema for updating a Project.\n * AppId is mutable \u2014 allows project reassignment to different apps if needed.\n * Requires current app credentials to change (enforced by appAuthProjectGuard).\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';\nimport { GitHubSourceSchema } from '../common/github-source.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 * The `source` field points to a GitHub directory that is fetched via the GitHub API.\n * It is optional to support the transition from the legacy `downloadUrl` field.\n */\nexport const TemplateSchema = TenantEntitySchema.extend({\n /** GitHub source reference for fetching template files */\n source: GitHubSourceSchema.optional()\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 { z } from 'zod';\nimport { TenantEntitySchema } from '../common/base-entity.js';\n\n/**\n * Frequency types for scheduled evaluation runs.\n */\nexport enum FrequencyType {\n DAILY = 'daily',\n WEEKDAY = 'weekday',\n WEEKLY = 'weekly',\n MONTHLY = 'monthly'\n}\n\n/**\n * Evaluation schedule schema.\n *\n * Represents a recurring schedule that automatically triggers evaluation runs.\n * Stores suiteId + presetId; the preset bundles agent + skills + MCPs +\n * sub-agents + rules. Suite scenarios are resolved at trigger time so\n * changes to the suite auto-propagate to future runs.\n */\nexport const EvalScheduleSchema = TenantEntitySchema.extend({\n /** Whether the schedule is active */\n enabled: z.boolean(),\n /** Test suite to run */\n suiteId: z.string(),\n /** Preset that provides agent + entities for this schedule */\n presetId: z.string(),\n /** How often to run */\n frequencyType: z.nativeEnum(FrequencyType),\n /** Time of day in 24h format (HH:MM), hours 00-23, minutes 00-59 */\n timeOfDay: z.string().regex(/^([01]\\d|2[0-3]):[0-5]\\d$/),\n /** Day of week (0=Sun, 6=Sat) for weekly schedules */\n dayOfWeek: z.number().min(0).max(6).optional(),\n /** Day of month (1-31) for monthly schedules */\n dayOfMonth: z.number().min(1).max(31).optional(),\n /** IANA timezone (e.g., 'America/New_York') */\n timezone: z.string(),\n /** ID of the last eval run created by this schedule */\n lastRunId: z.string().optional(),\n /** Denormalized status of the last run */\n lastRunStatus: z.string().optional(),\n /** ISO timestamp of the last run */\n lastRunAt: z.string().optional(),\n /** Next scheduled run time in UTC (pre-computed for efficient querying, set by backend) */\n nextRunAt: z.string().optional()\n});\n\nexport type EvalSchedule = z.infer<typeof EvalScheduleSchema>;\n\nfunction isValidTimezone(tz: string): boolean {\n try {\n Intl.DateTimeFormat(undefined, { timeZone: tz });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction validateScheduleFields(\n data: {\n frequencyType?: FrequencyType;\n dayOfWeek?: number;\n dayOfMonth?: number;\n timezone?: string;\n },\n ctx: z.RefinementCtx,\n options: { partial: boolean }\n) {\n if (data.frequencyType === FrequencyType.WEEKLY && data.dayOfWeek == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'dayOfWeek is required for weekly schedules',\n path: ['dayOfWeek']\n });\n }\n if (data.frequencyType === FrequencyType.MONTHLY && data.dayOfMonth == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'dayOfMonth is required for monthly schedules',\n path: ['dayOfMonth']\n });\n }\n const shouldValidateTz = options.partial ? data.timezone !== undefined : true;\n if (shouldValidateTz && !isValidTimezone(data.timezone!)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Invalid IANA timezone',\n path: ['timezone']\n });\n }\n}\n\nconst BaseCreateScheduleSchema = EvalScheduleSchema.omit({\n id: true,\n projectId: true,\n deleted: true,\n createdAt: true,\n updatedAt: true,\n lastRunId: true,\n lastRunStatus: true,\n lastRunAt: true,\n nextRunAt: true\n});\n\n/**\n * Input schema for creating a new schedule.\n * Validates that dayOfWeek is present for WEEKLY, dayOfMonth for MONTHLY,\n * and timezone is a valid IANA timezone.\n */\nexport const CreateEvalScheduleInputSchema =\n BaseCreateScheduleSchema.superRefine((data, ctx) => {\n validateScheduleFields(data, ctx, { partial: false });\n });\n\nexport type CreateEvalScheduleInput = z.infer<\n typeof CreateEvalScheduleInputSchema\n>;\n\n/**\n * Input schema for updating an existing schedule.\n * Partial -- conditional field validation is deferred to the repository\n * which merges with the existing entity.\n */\nexport const UpdateEvalScheduleInputSchema =\n BaseCreateScheduleSchema.partial().superRefine((data, ctx) => {\n validateScheduleFields(data, ctx, { partial: true });\n });\n\nexport type UpdateEvalScheduleInput = z.infer<\n typeof UpdateEvalScheduleInputSchema\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,OAAO;AAAA,EACxD,WAAW,EAAE,OAAO;AACtB,CAAC;;;ACrBD,SAAS,KAAAA,UAAS;AAOX,IAAM,qBAAqBA,GAAE,OAAO;AAAA;AAAA,EAEzC,OAAOA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAEvB,MAAMA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAEtB,MAAMA,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAEtB,KAAKA,GAAE,OAAO,EAAE,IAAI,CAAC;AACvB,CAAC;;;AChBD,SAAS,KAAAC,UAAS;AAOX,IAAM,uBAAuB;AAe7B,IAAM,kBAAkB,mBAAmB,OAAO;AAAA;AAAA,EAEvD,MAAMC,GAAE,OAAO,EAAE,IAAI,CAAC;AAAA;AAAA,EAEtB,QAAQA,GAAE,OAAOA,GAAE,OAAO,GAAGA,GAAE,QAAQ,CAAC;AAC1C,CAAC;AAOM,IAAM,uBAAuB,gBAAgB,KAAK;AAAA,EACvD,IAAI;AAAA,EACJ,WAAW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AM;AACzE,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB,CAAC;AAAA,EACH;AACA,MAAI,KAAK,kBAAkB,2BAAyB,KAAK,cAAc,MAAM;AAC3E,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,YAAY;AAAA,IACrB,CAAC;AAAA,EACH;AACA,QAAM,mBAAmB,QAAQ,UAAU,KAAK,aAAa,SAAY;AACzE,MAAI,oBAAoB,CAAC,gBAAgB,KAAK,QAAS,GAAG;AACxD,QAAI,SAAS;AAAA,MACX,MAAMA,IAAE,aAAa;AAAA,MACrB,SAAS;AAAA,MACT,MAAM,CAAC,UAAU;AAAA,IACnB,CAAC;AAAA,EACH;AACF;AAEA,IAAM,2BAA2B,mBAAmB,KAAK;AAAA,EACvD,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,eAAe;AAAA,EACf,WAAW;AAAA,EACX,WAAW;AACb,CAAC;AAOM,IAAM,gCACX,yBAAyB,YAAY,CAAC,MAAM,QAAQ;AAClD,yBAAuB,MAAM,KAAK,EAAE,SAAS,MAAM,CAAC;AACtD,CAAC;AAWI,IAAM,gCACX,yBAAyB,QAAQ,EAAE,YAAY,CAAC,MAAM,QAAQ;AAC5D,yBAAuB,MAAM,KAAK,EAAE,SAAS,KAAK,CAAC;AACrD,CAAC;",
6
6
  "names": ["z", "z", "z", "z", "z", "z", "z", "z", "AgentRunCommand", "z", "z", "z", "z", "z", "z", "z", "z", "KEBAB_CASE_MESSAGE", "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", "z", "z", "EvalStatus", "LLMStepType", "z", "z", "z", "LiveTraceEventType", "TriggerType", "z", "TemplateFileStatus", "z", "AssertionResultStatus", "z", "z", "z", "z", "z", "z", "FrequencyType", "z"]
7
7
  }