/** * Configuration management for Nori Profiles installer * Functional library for loading and managing disk-based configuration */ /** * Registry authentication credentials * Supports both legacy password auth and new refresh token auth */ export type RegistryAuth = { username: string; registryUrl: string; password?: string | null; refreshToken?: string | null; }; /** * Authentication credentials - supports both legacy password and new refresh token */ export type AuthCredentials = { username: string; organizationUrl: string; refreshToken?: string | null; password?: string | null; organizations?: Array | null; isAdmin?: boolean | null; }; /** * Agent-specific configuration */ export type AgentConfig = { profile?: { baseProfile: string; } | null; }; /** * Unified configuration type for Nori Profiles * Contains all persisted fields from disk plus required installDir * * Note: Installed agents are derived from the keys of the `agents` object. * Use `getInstalledAgents({ config })` to get the list of installed agents. */ export type Config = { auth?: AuthCredentials | null; sendSessionTranscript?: "enabled" | "disabled" | null; autoupdate?: "enabled" | "disabled" | null; installDir: string; registryAuths?: Array | null; /** Per-agent configuration settings. Keys indicate which agents are installed. */ agents?: Record | null; /** Installed version of Nori */ version?: string | null; /** * Runtime-only flag to skip installing built-in profiles during profile switch. * When true, the profiles loader will NOT copy built-in profiles from the package, * preserving only the user's downloaded/custom profiles. * This is NOT persisted to disk - it's only used during switch-profile operations. */ skipBuiltinProfiles?: boolean | null; }; /** * Get the path to the config file * @param args - Configuration arguments * @param args.installDir - Installation directory * * @returns The absolute path to .nori-config.json */ export declare const getConfigPath: (args: { installDir: string; }) => string; /** * Get default profile * @returns Default profile (senior-swe) */ export declare const getDefaultProfile: () => { baseProfile: string; }; /** * Check if config represents a paid installation * @param args - Configuration arguments * @param args.config - The config to check * * @returns True if the config has valid auth credentials (paid install) */ export declare const isPaidInstall: (args: { config: Config; }) => boolean; /** * Check if config uses legacy password-based authentication * @param args - Configuration arguments * @param args.config - The config to check * * @returns True if the config has password but no refreshToken (needs migration) */ export declare const isLegacyPasswordConfig: (args: { config: Config; }) => boolean; /** * Get registry authentication for a specific registry URL * Uses unified Nori auth (config.auth) to derive registry credentials * Falls back to legacy registryAuths for backwards compatibility * * @param args - Configuration arguments * @param args.config - The config to search * @param args.registryUrl - The registry URL to find auth for * * @returns The matching RegistryAuth or null if not found */ export declare const getRegistryAuth: (args: { config: Config; registryUrl: string; }) => RegistryAuth | null; /** * Get list of installed agents from config * Derives installed agents from the keys of the agents object * Returns ['claude-code'] by default for backwards compatibility with older configs * @param args - Configuration arguments * @param args.config - The config to check * * @returns Array of installed agent names */ export declare const getInstalledAgents: (args: { config: Config; }) => Array; /** * Get the profile for a specific agent * @param args - Configuration arguments * @param args.config - The config to search * @param args.agentName - The agent name to get profile for * * @returns The agent's profile or null if not found */ export declare const getAgentProfile: (args: { config: Config; agentName: string; }) => { baseProfile: string; } | null; /** * Load existing configuration from disk * Uses JSON schema validation for strict type checking. * @param args - Configuration arguments * @param args.installDir - Installation directory * * @returns The config if valid, null otherwise */ export declare const loadConfig: (args: { installDir: string; }) => Promise; /** * Save configuration to disk * @param args - Configuration arguments * @param args.username - User's username (null to skip auth) * @param args.password - User's password (deprecated, use refreshToken instead) * @param args.refreshToken - Firebase refresh token (preferred over password) * @param args.organizationUrl - Organization URL (null to skip auth) * @param args.sendSessionTranscript - Session transcript setting (null to skip) * @param args.autoupdate - Autoupdate setting (null to skip) * @param args.installDir - Installation directory * @param args.registryAuths - Array of registry authentication credentials (null to skip) * @param args.agents - Per-agent configuration settings (null to skip). Keys indicate installed agents. * @param args.version - Installed version of Nori (null to skip) * @param args.organizations - List of organizations the user has access to (null to skip) * @param args.isAdmin - Whether the user is an admin for their organization (null to skip) */ export declare const saveConfig: (args: { username: string | null; password?: string | null; refreshToken?: string | null; organizationUrl: string | null; organizations?: Array | null; isAdmin?: boolean | null; sendSessionTranscript?: "enabled" | "disabled" | null; autoupdate?: "enabled" | "disabled" | null; registryAuths?: Array | null; agents?: Record | null; version?: string | null; installDir: string; }) => Promise; /** * Validation result type */ export type ConfigValidationResult = { valid: boolean; message: string; errors?: Array | null; }; /** * Validate configuration file * @param args - Configuration arguments * @param args.installDir - Installation directory * * @returns Validation result with details */ export declare const validateConfig: (args: { installDir: string; }) => Promise; //# sourceMappingURL=config.d.ts.map