/** * lex.yaml Zod Schema v0.1 * * Defines the schema for repo-local AI workflow configuration. * See ADR-0008 for specification details. * * @module lex-yaml/schema */ import { z } from "zod"; /** * Provider configuration - logical provider/model identifier. * Executors map `id` to concrete API + model. */ export declare const ProviderSchema: z.ZodObject<{ id: z.ZodDefault; max_tokens: z.ZodOptional; }, z.core.$strip>; export type Provider = z.infer; /** * Command definition - named shell command the workflow may invoke. */ export declare const CommandSchema: z.ZodObject<{ name: z.ZodString; cmd: z.ZodString; }, z.core.$strip>; export type Command = z.infer; /** * Tools configuration - capability allowlist. * Names what the agent may use, not how capabilities are provided. */ export declare const ToolsSchema: z.ZodObject<{ servers: z.ZodDefault>; commands: z.ZodDefault>>; }, z.core.$strip>; export type Tools = z.infer; /** * Policy configuration - access control for the workflow. * Executors enforce policy at tool invocation time. */ export declare const PolicySchema: z.ZodObject<{ lexmap: z.ZodOptional>; allowed_paths: z.ZodDefault>; denied_paths: z.ZodDefault>; }, z.core.$strip>; export type Policy = z.infer; /** * Limits configuration - advisory runtime constraints. * Agents should treat as budget guidance; executors may or may not enforce strictly. */ export declare const LimitsSchema: z.ZodObject<{ max_edits: z.ZodOptional; max_files: z.ZodOptional; timeout_seconds: z.ZodOptional; }, z.core.$strip>; export type Limits = z.infer; /** * Check definition - command the executor runs after workflow completes. * Checks are not agent-invoked; exit code 0 = pass. */ export declare const CheckSchema: z.ZodObject<{ id: z.ZodString; description: z.ZodOptional; cmd: z.ZodString; type: z.ZodOptional; required: z.ZodDefault; }, z.core.$strip>; export type Check = z.infer; /** * Inputs configuration - workflow parameter contract. * Required inputs must be provided at invocation; agents should not hallucinate them. */ export declare const InputsSchema: z.ZodObject<{ required: z.ZodDefault>; optional: z.ZodDefault>; }, z.core.$strip>; export type Inputs = z.infer; /** * Workflow definition - a named AI workflow with its constraints. */ export declare const WorkflowSchema: z.ZodObject<{ description: z.ZodOptional; inputs: z.ZodOptional>; optional: z.ZodDefault>; }, z.core.$strip>>; provider: z.ZodOptional; max_tokens: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional>; commands: z.ZodDefault>>; }, z.core.$strip>>; policy: z.ZodOptional>; allowed_paths: z.ZodDefault>; denied_paths: z.ZodDefault>; }, z.core.$strip>>; limits: z.ZodOptional; max_files: z.ZodOptional; timeout_seconds: z.ZodOptional; }, z.core.$strip>>; checks: z.ZodOptional; cmd: z.ZodString; type: z.ZodOptional; required: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; export type Workflow = z.infer; /** * Defaults configuration - shared settings inherited by all workflows. */ export declare const DefaultsSchema: z.ZodObject<{ provider: z.ZodOptional; max_tokens: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional>; commands: z.ZodDefault>>; }, z.core.$strip>>; policy: z.ZodOptional>; allowed_paths: z.ZodDefault>; denied_paths: z.ZodDefault>; }, z.core.$strip>>; limits: z.ZodOptional; max_files: z.ZodOptional; timeout_seconds: z.ZodOptional; }, z.core.$strip>>; checks: z.ZodOptional; cmd: z.ZodString; type: z.ZodOptional; required: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; export type Defaults = z.infer; /** * lex.yaml top-level schema v0.1 */ export declare const LexYamlSchema: z.ZodObject<{ version: z.ZodUnion, z.ZodLiteral<0.1>]>; defaults: z.ZodOptional; max_tokens: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional>; commands: z.ZodDefault>>; }, z.core.$strip>>; policy: z.ZodOptional>; allowed_paths: z.ZodDefault>; denied_paths: z.ZodDefault>; }, z.core.$strip>>; limits: z.ZodOptional; max_files: z.ZodOptional; timeout_seconds: z.ZodOptional; }, z.core.$strip>>; checks: z.ZodOptional; cmd: z.ZodString; type: z.ZodOptional; required: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>>; workflows: z.ZodRecord; inputs: z.ZodOptional>; optional: z.ZodDefault>; }, z.core.$strip>>; provider: z.ZodOptional; max_tokens: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional>; commands: z.ZodDefault>>; }, z.core.$strip>>; policy: z.ZodOptional>; allowed_paths: z.ZodDefault>; denied_paths: z.ZodDefault>; }, z.core.$strip>>; limits: z.ZodOptional; max_files: z.ZodOptional; timeout_seconds: z.ZodOptional; }, z.core.$strip>>; checks: z.ZodOptional; cmd: z.ZodString; type: z.ZodOptional; required: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>>; includes: z.ZodOptional>; }, z.core.$strip>; export type LexYamlConfig = z.infer; /** * Parse and validate a lex.yaml config object. * @param data - Raw parsed YAML object * @returns Validated and typed config * @throws ZodError if validation fails */ export declare function parseLexYaml(data: unknown): LexYamlConfig; /** * Safely validate a lex.yaml config object. * @param data - Raw parsed YAML object * @returns Result object with success/error */ export declare function validateLexYaml(data: unknown): z.ZodSafeParseResult<{ version: "0.1" | 0.1; workflows: Record; defaults?: { provider?: { id: string; max_tokens?: number | undefined; } | undefined; tools?: { servers: string[]; commands: { name: string; cmd: string; }[]; } | undefined; policy?: { allowed_paths: string[]; denied_paths: string[]; lexmap?: string | boolean | undefined; } | undefined; limits?: { max_edits?: number | undefined; max_files?: number | undefined; timeout_seconds?: number | undefined; } | undefined; checks?: { id: string; cmd: string; required: boolean; description?: string | undefined; type?: string | undefined; }[] | undefined; } | undefined; includes?: string[] | undefined; }>; /** * Check if data is a valid lex.yaml config. * @param data - Raw parsed YAML object * @returns true if valid */ export declare function isValidLexYaml(data: unknown): data is LexYamlConfig;