/** * File operations for installer module * * Handles copying command/hook files to runtime directories, * verifying installations, and registering hooks in settings.json. */ import type { Runtime, Location, InstallerResult } from './types.js'; /** * Command template files from old installations that are no longer part of the * current template set (relative to the runtime base path). `init` was merged * into the installer in v1.2.15, so the standalone are-init command is removed * on install (upgrade) and uninstall. */ export declare const LEGACY_COMMAND_FILES: Record, string[]>; /** * Remove leftover command templates from old installations * * Deletes files listed in LEGACY_COMMAND_FILES and prunes the per-command * directory when it becomes empty (Claude/Codex skills layout). Errors are * swallowed — legacy cleanup must never block an install or uninstall. * * @param runtime - Target runtime * @param basePath - Runtime installation base path * @param dryRun - If true, don't delete anything * @returns Absolute paths of files that were (or would be) deleted */ export declare function removeLegacyCommandFiles(runtime: Exclude, basePath: string, dryRun: boolean): string[]; /** * Options for install operations */ export interface InstallOptions { /** Overwrite existing files */ force: boolean; /** Preview mode - don't write files */ dryRun: boolean; /** Progress callback: (current, total, filePath) */ onProgress?: (current: number, total: number, file: string) => void; } /** * Install files for one or all runtimes * * If runtime is 'all', installs to all supported runtimes. * Otherwise, installs to the specified runtime only. * * @param runtime - Target runtime or 'all' * @param location - Installation location (global or local) * @param options - Install options (force, dryRun) * @returns Array of installation results (one per runtime) */ export declare function installFiles(runtime: Runtime, location: Location, options: InstallOptions): InstallerResult[]; /** * Verify that installed files exist * * @param files - Array of file paths to verify * @returns Object with success status and list of missing files */ export declare function verifyInstallation(files: string[]): { success: boolean; missing: string[]; }; /** * Register ARE hooks in settings.json * * Registers PostToolUse hooks (context loader) for Claude Code. * Merges with existing hooks, doesn't overwrite. * * @param basePath - Base installation path (e.g., ~/.claude or ~/.gemini) * @param runtime - Target runtime (claude or gemini) * @param dryRun - If true, don't write changes * @returns true if any hook was added, false if all already existed */ export declare function registerHooks(basePath: string, runtime: Exclude, dryRun: boolean): boolean; /** * Register ARE permissions in settings.json * * Adds bash command permissions for ARE commands to reduce friction. * * @param settingsPath - Path to settings.json * @param dryRun - If true, don't write changes * @returns true if permissions were added, false if already existed */ export declare function registerPermissions(settingsPath: string, dryRun: boolean): boolean; /** * Get package version from package.json * * @returns Version string or 'unknown' if can't read */ export declare function getPackageVersion(): string; /** * Write ARE-VERSION file to track installed version * * @param basePath - Base installation path * @param dryRun - If true, don't write the file */ export declare function writeVersionFile(basePath: string, dryRun: boolean): void; /** * Format installation result for display * * Generates human-readable lines showing created/skipped files. * * @param result - Installation result to format * @returns Array of formatted lines for display */ export declare function formatInstallResult(result: InstallerResult): string[]; //# sourceMappingURL=operations.d.ts.map