import { parsePropertyRef } from "../refs.js";
export function normalizeToolConfig(tool) {
    if (typeof tool === 'string') {
        return {
            name: parsePropertyRef(tool)?.propertyName ?? tool,
            ref: tool
        };
    }
    const name = 'name' in tool ? tool.name : (parsePropertyRef(tool.ref)?.propertyName ?? tool.ref);
    return {
        name,
        ...tool
    };
}
