/** * Configuration management for Nori Skillsets installer * Functional library for loading and managing disk-based configuration */ import type { AuthCredentials, RegistryAuth } from "../api/authCredentials.js"; /** * Unified configuration type for Nori Skillsets * Contains all persisted fields from disk plus required installDir */ export type Config = { auth?: AuthCredentials | null; sendSessionTranscript?: "enabled" | "disabled" | null; autoupdate?: "enabled" | "disabled" | null; installDir: string; /** Default agents for CLI operations (set via `nori-skillsets config`) */ defaultAgents?: Array | null; /** The currently active skillset, shared across all agents */ activeSkillset?: string | null; /** * Runtime-only: when false, loaders must not persist `activeSkillset` to * disk (transient `--install-dir` switch). Never written to `.nori-config.json`. */ persistActiveSkillset?: boolean | null; /** Organization ID for transcript uploads (e.g., "myorg" -> https://myorg.noriskillsets.dev) */ transcriptDestination?: string | null; /** Whether to delete transcript files after successful upload */ garbageCollectTranscripts?: "enabled" | "disabled" | null; /** Whether to prompt to re-download skillsets from registry on switch */ redownloadOnSwitch?: "enabled" | "disabled" | null; /** Whether Claude Code skillset apply configures the Nori status line */ claudeCodeStatusLine?: "enabled" | "disabled" | null; /** Default org that a bare (non-namespaced) package name downloads from / uploads to */ defaultOrg?: string | null; }; /** * Get the path to the config file * Always returns ~/.nori-config.json * * @returns The absolute path to the config file */ export declare const getConfigPath: () => string; /** * 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 * * @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 the currently active skillset from config * @param args - Configuration arguments * @param args.config - The config to read * * @returns The active skillset name or null if not set */ export declare const getActiveSkillset: (args: { config: Config; }) => string | null; export declare const setGlobalAgentOverride: (agent: string | null) => void; export declare const resetGlobalAgentOverride: () => void; /** * Get all default agent names for CLI operations * Resolution order: explicit agentOverride > global agent override > config.defaultAgents > ["claude-code"] * * The global agent override is set once by the CLI preAction hook from the --agent flag, * so individual commands do not need to thread it through manually. * * @param args - Configuration arguments * @param args.config - The config to read defaultAgents from * @param args.agentOverride - Explicit agent name override: a string takes precedence over global, * null suppresses the global override entirely, undefined falls through to global * * @returns Array of resolved agent names */ export declare const getDefaultAgents: (args: { config?: Config | null; agentOverride?: string | null; }) => Array; /** * Load existing configuration from disk * Uses JSON schema validation for strict type checking. * Always reads from ~/.nori-config.json. * * @returns The config if valid, null otherwise */ export declare const loadConfig: () => Promise; export declare const updateConfig: (updates: Partial) => Promise; /** * Validation result type */ export type ConfigValidationResult = { valid: boolean; message: string; errors?: Array | null; }; /** * Validate configuration file * Always validates ~/.nori-config.json * * @returns Validation result with details */ export declare const validateConfig: () => Promise; //# sourceMappingURL=config.d.ts.map