import { RepoConfig as BaseRepoConfig } from '../common/yaml-config.js'; /** * Worktree configuration options (SDK runtime representation) * * Maps from config.yaml's repo.worktree section into SDK-friendly fields. */ export interface WorktreeConfig { /** Base directory for worktrees (relative to project root or absolute) */ defaultLocation: string; /** Path pattern template for work-item worktrees (e.g., "work-id-{work-id}") */ pathPattern: string; } /** * Extended repository configuration with worktree support */ export interface RepoConfigExtended extends Omit { worktree?: WorktreeConfig; } /** * Get default worktree configuration * * Uses .claude/worktrees as the base location (inside the project) * and work-id-{work-id} as the naming pattern for work-item worktrees. * * @returns Default worktree configuration */ export declare function getDefaultWorktreeConfig(): WorktreeConfig; /** * Load repository configuration with worktree support * * Loads from `.fractary/config.yaml` and returns the repo section * with worktree configuration. Falls back to defaults if not configured. * * @param cwd Working directory to start searching for config (default: process.cwd()) * @returns Repository configuration with worktree settings * * @example * ```typescript * const config = await loadRepoConfig('/path/to/project'); * const worktreePath = config.worktree.defaultLocation; * ``` */ export declare function loadRepoConfig(cwd?: string): Promise; /** * Save repository configuration with worktree support * * Saves to `.fractary/config.yaml`, merging with existing configuration. * * @param cwd Working directory to save config to * @param config Repository configuration to save * * @example * ```typescript * await saveRepoConfig('/path/to/project', { * active_handler: 'github', * handlers: {}, * worktree: { * defaultLocation: '.claude/worktrees', * pathPattern: 'work-id-{work-id}', * } * }); * ``` */ export declare function saveRepoConfig(cwd: string, config: RepoConfigExtended): Promise; /** * Expand tilde (~) in paths to home directory * * @param filePath Path that may contain tilde prefix * @returns Expanded absolute path * * @example * ```typescript * expandTilde('~/worktrees') // Returns '/Users/username/worktrees' * expandTilde('/absolute/path') // Returns '/absolute/path' * ``` */ export declare function expandTilde(filePath: string): string; /** * Apply a path pattern template with substitutions * * Replaces placeholders in the pattern: * - {organization} → organization name * - {project} → project name * - {work-id} → work item ID * * @param pattern Path pattern template * @param substitutions Values to substitute * @returns Path with substitutions applied * * @example * ```typescript * applyPathPattern('{organization}-{project}-{work-id}', { * organization: 'fractary', * project: 'core', * 'work-id': '258' * }); * // Returns 'fractary-core-258' * ``` */ export declare function applyPathPattern(pattern: string, substitutions: Record): string; /** * Validate that a path pattern contains all required placeholders * * @param pattern Path pattern to validate * @param requiredPlaceholders Required placeholder names * @returns Array of missing placeholder names (empty if valid) * * @example * ```typescript * validatePathPattern('{organization}-{project}', ['organization', 'project', 'work-id']); * // Returns ['work-id'] * ``` */ export declare function validatePathPattern(pattern: string, requiredPlaceholders: string[]): string[]; //# sourceMappingURL=config.d.ts.map