/** * User-aside worktree path resolution, spawn cwd validation, optional git provision. */ /** Minimal spawn tool input for cwd extraction (avoids circular import with delegation-gate). */ export interface SpawnCwdToolInput { cwd?: string; working_directory?: string; workingDirectory?: string; isolation?: string; isolation_mode?: string; worktree_path?: string; worktreePath?: string; worktree?: string; [key: string]: unknown; } export interface AsideWorktreeCwdResult { valid: boolean; gate?: 'aside-worktree-cwd-missing' | 'aside-worktree-cwd-mismatch'; reason?: string; hint?: Record; } export interface WorktreeProvisionResult { ok: boolean; path: string; created: boolean; message: string; } export declare function normalizeWorktreePath(worktree: string, projectRoot: string): string; export declare function isAutoProvisionWorktreeEnabled(projectRoot?: string): boolean; /** Extract spawn cwd from host Task / spawn_subagent tool input. */ export declare function extractSpawnCwd(toolInput: SpawnCwdToolInput, projectRoot: string): string | null; export declare function validateAsideWorktreeCwd(worktree: string | undefined, toolInput: SpawnCwdToolInput, projectRoot: string): AsideWorktreeCwdResult; /** * Guarded `git worktree add` when auto_provision_worktree is enabled. * Creates branch with -b when it does not exist locally. */ export declare function provisionGitWorktree(opts: { projectRoot: string; worktree: string; branch: string; }): WorktreeProvisionResult;