/** * Policy Schema Validation using Zod * * Provides strict schema validation for lexmap.policy.json files. * Used by `lex policy check` command to validate policy syntax. */ import { z } from "zod"; /** * Zod schema for a single policy module */ export declare const PolicyModuleSchema: z.ZodObject<{ description: z.ZodOptional; owns_paths: z.ZodOptional>; owns_namespaces: z.ZodOptional>; exposes: z.ZodOptional>; coords: z.ZodOptional>; allowed_callers: z.ZodOptional>; forbidden_callers: z.ZodOptional>; feature_flags: z.ZodOptional>; requires_permissions: z.ZodOptional>; kill_patterns: z.ZodOptional>; notes: z.ZodOptional; match: z.ZodOptional>; }, z.core.$strip>; /** * Zod schema for global kill patterns */ export declare const GlobalKillPatternSchema: z.ZodUnion, z.ZodString]>; /** * Zod schema for the complete policy file */ export declare const PolicySchema: z.ZodObject<{ schemaVersion: z.ZodOptional; modules: z.ZodRecord; owns_paths: z.ZodOptional>; owns_namespaces: z.ZodOptional>; exposes: z.ZodOptional>; coords: z.ZodOptional>; allowed_callers: z.ZodOptional>; forbidden_callers: z.ZodOptional>; feature_flags: z.ZodOptional>; requires_permissions: z.ZodOptional>; kill_patterns: z.ZodOptional>; notes: z.ZodOptional; match: z.ZodOptional>; }, z.core.$strip>>; global_kill_patterns: z.ZodOptional, z.ZodString]>>>; }, z.core.$strip>; export type PolicyModuleSchemaType = z.infer; export type PolicySchemaType = z.infer; /** * Validation result interface */ export interface PolicyValidationResult { valid: boolean; moduleCount: number; errors: PolicyValidationError[]; warnings: PolicyValidationWarning[]; } /** * Validation error interface */ export interface PolicyValidationError { path: string; message: string; code: string; } /** * Validation warning interface */ export interface PolicyValidationWarning { path: string; message: string; code: string; } /** * Validate a policy object against the schema * * @param policy - The policy object to validate * @returns Validation result with errors and warnings */ export declare function validatePolicySchema(policy: unknown): PolicyValidationResult;