import { effectiveOffset, MCP_DEFAULTS } from '../middleware.js';
export const name = 'dataflow';
export async function handler(args, ctx) {
    const dfMode = args.mode || 'edges';
    if (dfMode === 'impact') {
        const { dataflowImpactData } = await import('../../features/dataflow.js');
        return dataflowImpactData(args.name, ctx.dbPath, {
            depth: args.depth,
            file: args.file,
            kind: args.kind,
            noTests: args.no_tests,
            limit: Math.min(args.limit ?? MCP_DEFAULTS.fn_impact ?? 100, ctx.MCP_MAX_LIMIT),
            offset: effectiveOffset(args),
        });
    }
    const { dataflowData } = await import('../../features/dataflow.js');
    return dataflowData(args.name, ctx.dbPath, {
        file: args.file,
        kind: args.kind,
        noTests: args.no_tests,
        limit: Math.min(args.limit ?? MCP_DEFAULTS.query ?? 100, ctx.MCP_MAX_LIMIT),
        offset: effectiveOffset(args),
    });
}
//# sourceMappingURL=dataflow.js.map