import { Router } from 'express';
import { getPrimeContextJson } from '../prime.js';
export function createAgentLoadRouter(getProjectDir) {
    const router = Router();
    router.get('/', (_req, res) => {
        res.json({ agents: [], summary: null, cachedAt: new Date().toISOString(), totalAcrossAllAgents: 0 });
    });
    router.get('/:agent', (req, res) => {
        const projectDir = getProjectDir();
        const agent = req.params.agent;
        const output = getPrimeContextJson(agent, projectDir, 'FULL');
        if (!output) {
            return res.json({ agent, context: null });
        }
        res.json({ agent, context: output });
    });
    return router;
}
//# sourceMappingURL=agent-load.js.map