/** * Configuration management for skill directories. * * Handles loading/saving skill directory configuration from: * 1. CLI args (highest priority) * 2. SKILLS_DIR environment variable * 3. Config file (~/.skilljack/config.json) * * Supports both local directories and GitHub repository URLs. */ /** * Invocation settings that can be overridden per skill. */ export interface SkillInvocationOverrides { assistant?: boolean; user?: boolean; } /** * Configuration file schema. */ export interface SkillConfig { skillDirectories: string[]; staticMode?: boolean; skillInvocationOverrides?: Record; githubAllowedOrgs?: string[]; githubAllowedUsers?: string[]; } /** * Source of a skill directory configuration. */ export type DirectorySource = "cli" | "env" | "config"; /** * Type of skill source (local directory or GitHub repo). */ export type SourceType = "local" | "github"; /** * A skill directory with its source information. */ export interface DirectoryInfo { path: string; source: DirectorySource; type: SourceType; skillCount: number; valid: boolean; allowed: boolean; } /** * Configuration state tracking active directories and their sources. */ export interface ConfigState { /** All active directories with source info */ directories: DirectoryInfo[]; /** Which source is currently providing directories (cli > env > config) */ activeSource: DirectorySource; /** Whether directories are overridden by CLI or env (config file edits won't take effect) */ isOverridden: boolean; } /** * Get the platform-appropriate config directory path. * Returns ~/.skilljack on Unix, %USERPROFILE%\.skilljack on Windows. */ export declare function getConfigDir(): string; /** * Get the full path to the config file. */ export declare function getConfigPath(): string; /** * Load config from the config file. * Returns empty config if file doesn't exist. */ export declare function loadConfigFile(): SkillConfig; /** * Save config to the config file. */ export declare function saveConfigFile(config: SkillConfig): void; /** * Parse CLI arguments for skill directories. * Returns resolved absolute paths for local dirs, unchanged for GitHub URLs. */ export declare function parseCLIArgs(): string[]; /** * Parse SKILLS_DIR environment variable. * Returns resolved absolute paths for local dirs, unchanged for GitHub URLs. */ export declare function parseEnvVar(): string[]; /** * Get all skill directories with their source information. * Priority: CLI args > env var > config file */ export declare function getConfigState(): ConfigState; /** * Get skill directories from all sources combined. * Used for the UI to show all configured directories. */ export declare function getAllDirectoriesWithSources(): DirectoryInfo[]; /** * Add a directory or GitHub URL to the config file. * Does not affect CLI or env var configurations. */ export declare function addDirectoryToConfig(directory: string): void; /** * Remove a directory or GitHub URL from the config file. * Only removes from config file, not CLI or env var. */ export declare function removeDirectoryFromConfig(directory: string): void; /** * Get only the active skill directories (respecting priority). * This is what the server should use for skill discovery. */ export declare function getActiveDirectories(): string[]; /** * Get static mode setting from config file. */ export declare function getStaticModeFromConfig(): boolean; /** * Set static mode setting in config file. */ export declare function setStaticModeInConfig(enabled: boolean): void; /** * Get all skill invocation overrides from the config file. */ export declare function getSkillInvocationOverrides(): Record; /** * Set an invocation override for a skill. * @param skillName - The name of the skill * @param setting - Which setting to override ("assistant" or "user") * @param value - The new value for the setting */ export declare function setSkillInvocationOverride(skillName: string, setting: "assistant" | "user", value: boolean): void; /** * Clear an invocation override for a skill (revert to frontmatter default). * @param skillName - The name of the skill * @param setting - Which setting to clear (omit to clear both) */ export declare function clearSkillInvocationOverride(skillName: string, setting?: "assistant" | "user"): void; /** * Get the GitHub allowed orgs from config file. */ export declare function getGitHubAllowedOrgs(): string[]; /** * Get the GitHub allowed users from config file. */ export declare function getGitHubAllowedUsers(): string[]; /** * Add a GitHub org to the allowed list. * @param org - The org name to allow */ export declare function addGitHubAllowedOrg(org: string): void; /** * Remove a GitHub org from the allowed list. * @param org - The org name to remove */ export declare function removeGitHubAllowedOrg(org: string): void; /** * Add a GitHub user to the allowed list. * @param user - The user name to allow */ export declare function addGitHubAllowedUser(user: string): void; /** * Remove a GitHub user from the allowed list. * @param user - The user name to remove */ export declare function removeGitHubAllowedUser(user: string): void;