/** * The stateful conductor: consumes the durable inbox, judges each batch in * ONE long-lived session, and delegates by COMMITTING work orders only - it * never awaits a worker from its model turn. * * Lane: the session key 'conductor:main' leads with a segment absent from * SOURCE_GLOBAL_LANES, so runs land on session:conductor:main - fully * separate from the global operator lane where Stage-2 workers serialize * (worker-run.ts documents the deadlock seal). The lane is derived from the * session key's FIRST segment, not options.source (agent-loop.ts * resolveGlobalLaneForSession) - tests pin this axis. * * Trust boundary: batch lines are connector-channel text - attacker-authored * by definition, and this session's buffer is long-lived. Every batch enters * the prompt through wrapUntrustedContent (the spec's standing "wrapping * remains the first line"), under an owner-authored framing instruction. */ import type { ConductorInbox } from './conductor-inbox.js'; import { type ConductorSession } from './conductor-session.js'; import type { AgentContext } from '../agent/types.js'; import type { Envelope } from '../envelope/types.js'; interface RunnerLike { run(prompt: string, options?: { sessionKey?: string; source?: string; channelId?: string; resumeSession?: boolean; freshSession?: boolean; agentContext?: AgentContext; envelope?: Envelope; causeEventIds?: readonly string[]; }): Promise<{ response: string; }>; } export declare class Conductor { private readonly deps; private readonly leaseMs; private readonly maxBatchesPerTick; constructor(deps: { inbox: ConductorInbox; session: ConductorSession; runner: RunnerLike; reground: () => string; /** * Per-run scoped authority, mirroring the report lane: without an * agentContext the executor's permission checks take their documented * "no context - allow all" branch, and without an envelope every * model_tool call dies 'envelope_missing' while the run still resolves * and acks (review F2). Both are REQUIRED wiring in start.ts; optional * here only so unit tests can run the loop without the full boot. */ agentContext?: AgentContext; issueEnvelope?: () => Promise; log?: (line: string) => void; leaseMs?: number; /** Burst backpressure budget: batches processed per tick before yielding. */ maxBatchesPerTick?: number; }); tick(): Promise<'idle' | 'processed' | 'failed'>; /** * A growing inbox must be loud - silence is how backlogs hide. Runs on the * failure path too: a batch stuck in retries (attempts 1-4) is exactly when * the backlog grows unattended (review). */ private logDepth; } export {}; //# sourceMappingURL=conductor.d.ts.map