/**
 * Phased wrapper for the write tool.
 *
 * Delegates entirely to the existing `createWriteTool` implementation and adds
 * the PhasedTool metadata required by the phased executor.
 */
import { asPhasedTool } from '../../runtime/tools/adapter.js';
import { createWriteTool } from './index.js';
// ---------------------------------------------------------------------------
// Factory
// ---------------------------------------------------------------------------
/**
 * Create a phased write tool.
 *
 * Category  : `write` — routes to the mutating-filesystem concurrency pool.
 * Cancellable: `false` — write operations are not safe to interrupt mid-flight;
 *   a partial write leaves files in an inconsistent state.
 *
 * @param deps - Optional dependency overrides (shared cache instances, undo manager).
 * @returns A PhasedTool that delegates execution to `createWriteTool`.
 */
export function createPhasedWriteTool(projectRoot, deps = {}) {
    const inner = createWriteTool({ ...deps, projectRoot });
    return asPhasedTool(inner, { category: 'write', cancellable: false });
}
