/** * skaile.yaml v2 extensions + skaile.lock.yaml reader/writer. * * The v2 workspace format extends the existing v1 skaile.yaml with: * - `version: 2` marker * - `library:` section (default pin policy, instance refs with aliases) * - `presets_applied:` section (applied Preset references with timestamps) * * The lock file (`skaile.lock.yaml`) is new in v2 and records resolved * assignment state (pinned versions, SHA256 hashes, requires graph). * * @docLink packages/library/api-reference#workspace-config */ import * as z from "zod"; /** * Zod schema for the `PinPolicy` type. * * @docLink packages/library/api-reference#workspace-config */ export declare const PinPolicySchema: z.ZodEnum<{ exact: "exact"; "minor-track": "minor-track"; latest: "latest"; }>; /** * Zod schema for a single instance reference entry within `library.instances`. * * Each entry holds the instance UUID and an optional human-readable alias. * * @docLink packages/library/api-reference#workspace-config */ export declare const LibraryInstanceRefSchema: z.ZodObject<{ id: z.ZodString; alias: z.ZodOptional; }, z.core.$strip>; /** * Zod schema for the `library:` section of skaile.yaml v2. * * Defaults: `pin_policy = "minor-track"`, `instances = []`. * * @docLink packages/library/api-reference#workspace-config */ export declare const LibrarySectionSchema: z.ZodObject<{ pin_policy: z.ZodDefault>; instances: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; /** * Zod schema for a single applied-preset entry in the `presets_applied:` section. * * @docLink packages/library/api-reference#workspace-config */ export declare const PresetAppliedSchema: z.ZodObject<{ ref: z.ZodString; applied_at: z.ZodString; items: z.ZodDefault>>; }, z.core.$strip>; /** * Zod schema for the full skaile.yaml v2 workspace config document. * * @docLink packages/library/api-reference#workspace-config */ export declare const WorkspaceConfigV2Schema: z.ZodObject<{ version: z.ZodLiteral<2>; library: z.ZodOptional>; instances: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>>; presets_applied: z.ZodOptional>>; }, z.core.$strip>>>; }, z.core.$strip>; /** * Zod schema for a single resolved-assignment entry in skaile.lock.yaml. * * @docLink packages/library/api-reference#lock-file */ export declare const LockAssignmentSchema: z.ZodObject<{ assignment_id: z.ZodString; instance_id: z.ZodString; def_ref: z.ZodString; resolved_version: z.ZodString; resolved_sha256: z.ZodOptional; pin_policy: z.ZodEnum<{ exact: "exact"; "minor-track": "minor-track"; latest: "latest"; }>; }, z.core.$strip>; /** * Zod schema for a single directed edge in the asset requires graph. * * @docLink packages/library/api-reference#lock-file */ export declare const RequiresEdgeSchema: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodOptional; }, z.core.$strip>; /** * Zod schema for a single expanded-preset entry tracking which instance IDs * a preset application produced. * * @docLink packages/library/api-reference#lock-file */ export declare const PresetExpandedSchema: z.ZodObject<{ preset_ref: z.ZodString; instance_ids: z.ZodArray; }, z.core.$strip>; /** * Zod schema for the complete skaile.lock.yaml document. * * @docLink packages/library/api-reference#lock-file */ export declare const LockFileSchema: z.ZodObject<{ version: z.ZodLiteral<2>; generated_at: z.ZodString; assignments: z.ZodDefault; pin_policy: z.ZodEnum<{ exact: "exact"; "minor-track": "minor-track"; latest: "latest"; }>; }, z.core.$strip>>>; requires_graph: z.ZodDefault; }, z.core.$strip>>>; presets_expanded: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; /** * TypeScript type for the `library:` section of skaile.yaml v2. * * @docLink packages/library/api-reference#workspace-config */ export type LibrarySection = z.infer; /** * A single instance UUID reference with optional alias in `library.instances`. * * @docLink packages/library/api-reference#workspace-config */ export type LibraryInstanceRef = z.infer; /** * Record of a previously applied preset in the `presets_applied:` section. * * @docLink packages/library/api-reference#workspace-config */ export type PresetApplied = z.infer; /** * The parsed v2 workspace config (skaile.yaml `version: 2` document). * * @docLink packages/library/api-reference#workspace-config */ export type WorkspaceConfigV2 = z.infer; /** * A single resolved-assignment record from skaile.lock.yaml. * * @docLink packages/library/api-reference#lock-file */ export type LockAssignment = z.infer; /** * The parsed skaile.lock.yaml document. * * @docLink packages/library/api-reference#lock-file */ export type LockFile = z.infer; /** * Extract the v2-specific sections from a parsed skaile.yaml object. * Returns null if the object is v1 (no `version: 2` marker). * * @docLink packages/library/api-reference#workspace-config */ export declare function parseWorkspaceV2(raw: Record): WorkspaceConfigV2 | null; /** * Read the v2 sections from a skaile.yaml file on disk. * Returns null if the file doesn't exist or is v1. * * @docLink packages/library/api-reference#workspace-config */ export declare function loadWorkspaceV2(dir: string, filename?: string): WorkspaceConfigV2 | null; /** * Write v2 sections into an existing skaile.yaml, preserving other content. * Creates a minimal v2 file if none exists. * * @docLink packages/library/api-reference#workspace-config */ export declare function saveWorkspaceV2(dir: string, v2: Partial>, filename?: string): void; /** * Load and validate a skaile.lock.yaml file. * Returns null if the file doesn't exist. * * Back-compat: read legacy `subscriptions:` lock key written before the * 2026-06-08 assignment rename. Normalises to `assignments:` before parse. * * @docLink packages/library/api-reference#lock-file */ export declare function loadLockFile(dir: string): LockFile | null; /** * Write a skaile.lock.yaml file. Overwrites any existing lock file. * * @docLink packages/library/api-reference#lock-file */ export declare function saveLockFile(dir: string, lock: LockFile): void; /** * Create an empty lock file structure. * * @docLink packages/library/api-reference#lock-file */ export declare function createEmptyLockFile(): LockFile; /** * Detect the workspace config version from a skaile.yaml file. * Returns 1 for v1 (no version field), 2 for v2, null if no file. * * @docLink packages/library/api-reference#workspace-config */ export declare function detectWorkspaceVersion(dir: string, filename?: string): 1 | 2 | null; //# sourceMappingURL=workspace-config.d.ts.map