/**
 * Wraps a base Tool in a PhasedTool by merging the phased metadata.
 * Use this in `createPhasedExecTool` / `createPhasedReadTool` factories
 * to avoid duplicating the underlying tool's `definition` and `execute`.
 *
 * @param tool     - The existing Tool implementation to wrap.
 * @param options  - Phased execution metadata to attach.
 * @returns A PhasedTool that delegates execution to the original tool.
 */
export function asPhasedTool(tool, options) {
    return {
        definition: tool.definition,
        execute: tool.execute.bind(tool),
        category: options.category,
        cancellable: options.cancellable,
        skipPhases: options.skipPhases,
        phaseTimeouts: options.phaseTimeouts,
    };
}
