/** * Forge Configuration Schemas * * Defines Zod schemas for validating Forge configuration files * following SPEC-FORGE-005 section 4. */ import { z } from 'zod'; /** * Authentication configuration for registry access */ export declare const RegistryAuthSchema: z.ZodObject<{ type: z.ZodEnum<["bearer", "apikey"]>; token_env: z.ZodString; }, "strip", z.ZodTypeAny, { type: "bearer" | "apikey"; token_env: string; }, { type: "bearer" | "apikey"; token_env: string; }>; export type RegistryAuth = z.infer; /** * Individual registry configuration */ export declare const RegistryConfigSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["manifest", "stockyard"]>; url: z.ZodString; enabled: z.ZodBoolean; priority: z.ZodNumber; cache_ttl: z.ZodOptional; auth: z.ZodOptional; token_env: z.ZodString; }, "strip", z.ZodTypeAny, { type: "bearer" | "apikey"; token_env: string; }, { type: "bearer" | "apikey"; token_env: string; }>>; }, "strip", z.ZodTypeAny, { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }, { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }>; export type RegistryConfig = z.infer; /** * Installation settings */ export declare const InstallConfigSchema: z.ZodObject<{ default_scope: z.ZodEnum<["global", "local"]>; verify_checksums: z.ZodBoolean; auto_install_dependencies: z.ZodBoolean; }, "strip", z.ZodTypeAny, { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; }, { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; }>; export type InstallConfig = z.infer; /** * Complete Forge configuration * File location: .fractary/config.json or ~/.fractary/config.json */ export declare const ForgeConfigSchema: z.ZodObject<{ registries: z.ZodArray; url: z.ZodString; enabled: z.ZodBoolean; priority: z.ZodNumber; cache_ttl: z.ZodOptional; auth: z.ZodOptional; token_env: z.ZodString; }, "strip", z.ZodTypeAny, { type: "bearer" | "apikey"; token_env: string; }, { type: "bearer" | "apikey"; token_env: string; }>>; }, "strip", z.ZodTypeAny, { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }, { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }>, "many">; install: z.ZodOptional; verify_checksums: z.ZodBoolean; auto_install_dependencies: z.ZodBoolean; }, "strip", z.ZodTypeAny, { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; }, { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; }>>; }, "strip", z.ZodTypeAny, { registries: { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }[]; install?: { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; } | undefined; }, { registries: { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }[]; install?: { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; } | undefined; }>; export type ForgeConfig = z.infer; /** * Default installation configuration */ export declare const DEFAULT_INSTALL_CONFIG: InstallConfig; /** * Default Fractary registry configuration */ export declare const DEFAULT_FRACTARY_REGISTRY: RegistryConfig; /** * Default Forge configuration with Fractary registry */ export declare const DEFAULT_FORGE_CONFIG: ForgeConfig; /** * Validate and parse Forge configuration * @throws ZodError if validation fails */ export declare function validateForgeConfig(data: unknown): ForgeConfig; /** * Validate and parse registry configuration * @throws ZodError if validation fails */ export declare function validateRegistryConfig(data: unknown): RegistryConfig; /** * Safe validation - returns result object instead of throwing */ export declare function safeValidateForgeConfig(data: unknown): z.SafeParseReturnType<{ registries: { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }[]; install?: { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; } | undefined; }, { registries: { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }[]; install?: { default_scope: "global" | "local"; verify_checksums: boolean; auto_install_dependencies: boolean; } | undefined; }>; /** * Safe validation - returns result object instead of throwing */ export declare function safeValidateRegistryConfig(data: unknown): z.SafeParseReturnType<{ type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }, { type: "manifest" | "stockyard"; name: string; url: string; enabled: boolean; priority: number; cache_ttl?: number | undefined; auth?: { type: "bearer" | "apikey"; token_env: string; } | undefined; }>; /** * Merge user config with defaults * User config takes precedence, missing values filled from defaults */ export declare function mergeWithDefaults(userConfig: Partial): ForgeConfig; /** * Validate that registry priorities are unique * Returns array of duplicate priorities if found */ export declare function validateUniquePriorities(config: ForgeConfig): number[]; /** * Sort registries by priority (lower number = higher priority) */ export declare function sortByPriority(registries: RegistryConfig[]): RegistryConfig[]; /** * Get enabled registries sorted by priority */ export declare function getEnabledRegistries(config: ForgeConfig): RegistryConfig[]; //# sourceMappingURL=config.d.ts.map