import type { ParallelSafetyResult } from '../types/index.js';
export declare function getRepoRoot(cwd: string): string | null;
export declare function detectCurrentWorktreeId(cwd: string): string | null;
export declare function getActiveWorktreeIds(projectPath: string): string[];
export declare function generateSafeAgentNames(numAgents: number, activeIds: string[], currentId: string | null): string[];
export declare function checkParallelSafety(cwd: string, projectPath: string, numAgents?: number): ParallelSafetyResult;
export declare const PARALLEL_WORKTREE_SAFETY_RULE = "# parallel-worktree-safety\n\n## Problem\nWhen Claude Code runs inside a worktree (.claude/worktrees/agent-XXXX) and launches subagents\nwith `isolation: \"worktree\"`, a silent collision can occur if the new agent receives an ID whose\nprefix matches the parent session's worktree. The result: the agent writes into the parent\nsession's worktree instead of a new one, and the work is lost when the worktree is cleaned up.\n\n## Solution\nBefore launching parallel agents, call `check_parallel_safety` to:\n1. Detect if you're inside a worktree\n2. Get a list of safe agent names that won't collide\n3. Use those names as the `name:` parameter in Agent tool calls\n\n## Rules\n- NEVER use `isolation: \"worktree\"` when already inside a worktree\n- ALWAYS pass explicit `name:` to Agent tool calls when running parallel sessions\n- USE `check_parallel_safety` at session start if launching 3+ parallel agents\n- IF in a worktree, use manual branch strategy instead of isolation:worktree\n";
//# sourceMappingURL=parallel-safety-engine.d.ts.map