import { type ChildAbortedListener } from './abort-graph.js'; import type { OutputEvent } from './types/session-types.js'; import type { AbortOrigin, TraceSink } from './trace/index.js'; import { type ReadScopeInputs } from './subagent-read-scope.js'; import { type SubagentHandle } from './subagent/handle.js'; import type { SubagentStatus, SubagentResult, SubagentTrace } from './subagent/result.js'; import { CompletedCache } from './subagent/completed-cache.js'; export type { SubagentStatus, SubagentResult, SubagentTrace, SubagentHandle }; import { SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS, SUBAGENT_DRAIN_TIMEOUT_MS, resolveSubagentIdleTimeoutMs } from './subagent/constants.js'; import type { ForkParent, ForkSubagentOptions, SubagentManagerOptions } from './subagent/fork-types.js'; export { DENY_ELICITATION, SUBAGENT_DEFAULT_MAX_TOOL_USE_ITERATIONS, SUBAGENT_DEFAULT_TIMEOUT_MS, SUBAGENT_BACKGROUND_TIMEOUT_MS, resolveSubagentTimeoutMs, } from './subagent/constants.js'; export { SUBAGENT_DEFAULT_IDLE_TIMEOUT_MS, SUBAGENT_DRAIN_TIMEOUT_MS, resolveSubagentIdleTimeoutMs, }; export type { ForkParent, ForkSubagentOptions, SubagentManagerOptions }; export declare class SubagentManager { private readonly active; readonly completed: CompletedCache; private readonly parentCanUseTool; private readonly hookRegistry; private readonly progressSink; private readonly parentApiKey; private readonly parentBaseUrl; private readonly parentProvider; private readonly parentModel; private parentCwd; private readonly parentReadRoots; private readonly worktreeMainRootCache; private parentTraceWriter; private readonly parentSurface; private readonly parentAbortSignal; private readonly workspaceStore; private readonly sessionLabel; private readonly abortGraph; private readonly rootId; private rootController; private counter; private onSubagentSucceededCb; private outputEventSink; constructor(options?: SubagentManagerOptions); list(): Array>; get(id: string): SubagentHandle | undefined; onChildAborted(listener: ChildAbortedListener): () => void; setOnSubagentSucceeded(cb: (usage: import('./subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void): void; setOutputEventSink(sink: (event: OutputEvent) => void): void; setCwd(cwd: string): void; setTraceWriter(writer: TraceSink | undefined): void; getReadScopeInputs(): ReadScopeInputs; private resolveMainRootForCwd; abortAll(reason?: unknown, origin?: AbortOrigin): void; forkSubagent(options: ForkSubagentOptions): Promise>; kill(id: string): Promise; killAll(): Promise; abortAllAndDrain(reason?: unknown, origin?: AbortOrigin, timeoutMs?: number, rearm?: boolean): Promise<{ drained: number; timedOut: boolean; }>; private rearmRoot; teardownAll(): Promise; }