export const mcpListToolsDependencyDeclarations = [
    {
        dependencyId: "runtime.execEngine.mcp.listTools",
        kind: "service",
        required: true,
        description: "Runtime-owned MCP tools/list support; baseTool owns validation and result normalization.",
    },
    {
        dependencyId: "runtime.governancePlane.mcpApproval",
        kind: "permission",
        required: true,
        description: "dryRun:false requires explicit guard approval before querying the runtime MCP client.",
    },
];
export function createHostExecutorMcpListToolsProvider(executor) {
    const listTools = executor?.mcp?.listTools;
    if (listTools === undefined)
        return undefined;
    return async (request, context) => {
        const result = await listTools({ ...request, context });
        if (!result.ok)
            throw new Error(result.error.message);
        return result.output;
    };
}
