import set from 'lodash/fp/set.js';
export const TOOL_SCHEMA_PATH = ['mcp', 'tools'];
export function getMcpToolMap(projectSchema) {
    return projectSchema.mcp?.tools;
}
export function getMcpTools(projectSchema) {
    const toolMap = getMcpToolMap(projectSchema);
    return toolMap && Object.values(toolMap);
}
export function getMcpToolNames(projectSchema) {
    return Object.keys(getMcpToolMap(projectSchema) ?? {});
}
export function getMcpTool(projectSchema, toolName) {
    return getMcpToolMap(projectSchema)?.[toolName];
}
export function setMcpToolMap(projectSchema, tools) {
    return set(TOOL_SCHEMA_PATH, tools, projectSchema);
}
export function setMcpTool(projectSchema, tool) {
    return set([...TOOL_SCHEMA_PATH, tool.name], tool, projectSchema);
}
