/**
 * Rules file management -- reading, writing, and syncing agent instructions.
 *
 * The canonical rules file (AGENTS.md) gets synced
 * into each agent's config directory under their native name (CLAUDE.md,
 * GEMINI.md, etc.). This module handles reading, managing includes, and
 * refreshing rules files across version homes.
 */
import type { AgentId } from '../types.js';
export type InstructionsScope = 'user' | 'project';
export interface InstalledInstructions {
    agentId: AgentId;
    scope: InstructionsScope;
    path: string;
    exists: boolean;
}
export interface DiscoveredInstructions {
    agentId: AgentId;
    sourcePath: string;
    filename: string;
}
/**
 * Central rules filename constant.
 * All agents map to this file in ~/.agents/rules/, renamed per-agent when synced.
 */
export declare const CENTRAL_RULES_FILENAME = "AGENTS.md";
/**
 * Get the canonical central rules filename for an agent's instructionsFile.
 * Central storage uses AGENTS.md, which gets renamed per-agent when syncing:
 *   - Claude: AGENTS.md → CLAUDE.md
 *   - Gemini: AGENTS.md → GEMINI.md
 *   - Cursor: AGENTS.md → .cursorrules
 *   - Codex/OpenCode: AGENTS.md → AGENTS.md (no rename)
 */
export declare function getCentralRulesFileName(agentId: AgentId): string;
export declare function getInstructionsPath(agentId: AgentId, scope: InstructionsScope, cwd?: string): string;
export declare function instructionsExists(agentId: AgentId, scope?: InstructionsScope, cwd?: string): boolean;
export declare function discoverInstructionsFromRepo(repoPath: string): DiscoveredInstructions[];
export declare function resolveInstructionsSource(repoPath: string, agentId: AgentId): string | null;
export declare function discoverRuleFilesFromRepo(repoPath: string): string[];
export declare function installInstructions(sourcePath: string, agentId: AgentId, method?: 'symlink' | 'copy'): {
    path: string;
    method: 'symlink' | 'copy';
    error?: string;
};
export declare function uninstallInstructions(agentId: AgentId): boolean;
export declare function instructionsContentMatches(agentId: AgentId, sourcePath: string, scope?: InstructionsScope, cwd?: string): boolean;
export declare function listInstalledInstructionsWithScope(agentId: AgentId, cwd?: string, options?: {
    home?: string;
}): InstalledInstructions[];
export declare function getInstructionsContent(agentId: AgentId, scope?: InstructionsScope, cwd?: string): string | null;
/**
 * Install rules files from repo rules/ to central ~/.agents/rules/ directory.
 * Nested presets/ and rules/ fragments are preserved so @imports keep working.
 */
export declare function installInstructionsCentrally(repoPath: string, filesToInstall?: string[]): {
    installed: string[];
    errors: string[];
};
/**
 * List top-level rules files from user and system dirs (user wins on collision).
 */
export declare function listCentralRules(): string[];
