import type { AgentIdentity } from '../agents/runAgent.js'; import { ToolRegistry } from '../registry/tool/execute.js'; import type { SupervisorAgentConfig } from '../types/agent/supervisor.js'; import type { LLMProvider } from '../types/provider/index.js'; import type { DirectoryManifest } from './types.js'; export interface DeriveSupervisorInput { readonly provider: LLMProvider; /** Wins over `agent.ts`. Required when `agent.ts` names no model. */ readonly model?: string; readonly identity?: Required; /** * The lifecycle object that actually spawns delegates. * * Supplied by the host and never built here. An `AgentManager` owns * running processes, budgets and cancellation — it is a thing with a * lifetime, not a description of one, and this package's whole boundary is * that it describes and does not run. Handing back options that carry a * manager we constructed would make it a runner wearing a loader's name. */ readonly agentManager: SupervisorAgentConfig['agentManager']; readonly overrides?: Partial; } export interface SupervisorPlan { /** Ready for `new SupervisorAgent(...).run(input, config)`. */ readonly config: SupervisorAgentConfig; /** * What the host must register with its `AgentManager` before running, * one per delegate, keyed by the id the supervisor will name. * * Returned rather than registered: registration is a mutation of the * host's manager, and a function that quietly mutates an object it was * handed for reference is the kind of surprise this package exists to * avoid. The host does it, in one loop it can see. */ readonly delegates: readonly DelegatePlan[]; } export interface DelegatePlan { readonly id: string; readonly manifest: DirectoryManifest; /** The delegate's own instructions, tools and model, already assembled. */ readonly systemPrompt: string; readonly tools: ToolRegistry; readonly model: string; } /** * Turn a project that declares delegates into a supervisor configuration. * * The counterpart to `deriveTurnOptions` for the multi-agent shape, and the * same contract: it converts, it does not run. `SupervisorAgent` needs an * `agentIds` roster and a manager that can spawn them; this supplies the * roster from the directory and leaves the manager to the host. * * The delegates come back as plans rather than registered agents because * registration mutates the host's manager. Two lines in the host, and the host * can see exactly what it just gained. */ export declare function deriveSupervisorOptions(manifest: DirectoryManifest, input: DeriveSupervisorInput): SupervisorPlan; //# sourceMappingURL=derive-supervisor.d.ts.map