import { loadSeedConfig } from "./config/index.js";
import { createManagers } from "./create-managers.js";
import { createSeedTools } from "./create-tools.js";
import { createPluginInterface } from "./plugin-interface.js";
import { startLabMeetingSupervisor } from "./features/lab-meeting/supervisor.js";
export function createSeedAgentPlugin() {
    const server = async (input, options) => {
        const loaded = await loadSeedConfig(input.directory, normalizeOptions(options));
        const ctx = {
            input,
            config: loaded.config,
            modelBySession: new Map(),
            commandStateBySession: new Map(),
        };
        const managers = createManagers({ input, config: loaded.config });
        const tools = createSeedTools(input, loaded.config);
        startLabMeetingSupervisor(input.directory, loaded.config, { delivery_context: input });
        return createPluginInterface({ ctx, managers, tools });
    };
    return {
        id: "seed-agent",
        server,
    };
}
function normalizeOptions(options) {
    if (!options || typeof options !== "object")
        return undefined;
    return options;
}
const pluginModule = createSeedAgentPlugin();
export default pluginModule;
//# sourceMappingURL=index.js.map