import { appendPrompt } from "./prompt-builder.js";
import { createDirectorPermissions } from "./permissions.js";
import { labRepresentativePrompt } from "./lab-representative.js";
const definitions = {
    "lab-representative": {
        name: "lab-representative",
        displayName: "Lab-Representative",
        description: "Lab-Representative: professor-facing SEED Lab representative and primary task owner. Use for /seed goals and dynamic research-lab orchestration.",
        mode: "primary",
        prompt: labRepresentativePrompt,
        permission: {},
        color: "primary",
        steps: 80,
    },
};
export function createSeedAgents(config) {
    const disabled = new Set(config.disabled_agents.map((name) => name.toLowerCase()));
    const availableNames = Object.keys(definitions);
    const orderedNames = [...config.agent_order, ...availableNames.filter((name) => !config.agent_order.includes(name))];
    const result = {};
    for (const name of orderedNames) {
        const definition = definitions[name];
        if (!definition)
            continue;
        const override = config.agents[name];
        if (disabled.has(name.toLowerCase()) || override?.disabled)
            continue;
        const profileName = override?.model_profile;
        const profile = profileName ? config.model_profiles[profileName] : undefined;
        const model = override?.model ?? profile?.model;
        const variant = override?.model ? override.variant : profile?.variant;
        result[name] = {
            description: definition.description,
            mode: definition.mode,
            prompt: appendPrompt(definition.prompt, override),
            permission: { ...createDirectorPermissions(config), ...definition.permission },
            color: definition.color,
            steps: definition.steps,
            ...(model ? { model } : {}),
            ...(variant ? { variant } : {}),
            ...(typeof override?.temperature === "number" ? { temperature: override.temperature } : {}),
            options: {
                seed_role: definition.name,
                model_profile: override?.model_profile,
            },
        };
    }
    return result;
}
export const seedAgentNames = Object.keys(definitions);
//# sourceMappingURL=builtin-agents.js.map