import type { DispatchInput, DispatchTask, MaterializedResultRef } from "../types.ts"; import type { DispatchManagerConfig } from "../config.ts"; export type { TaskLifecycleDeps } from "./lifecycle-shared.ts"; import type { TaskLifecycleDeps } from "./lifecycle-shared.ts"; /** * Bridge interface for methods accessed by DispatchManager via `(this.lifecycle as any)`. */ export interface LifecycleBridge { handleTaskCompleted(taskId: string): Promise; handleTaskError(taskId: string, error: string): void; handleTaskTimeout(taskId: string, reason: string): void; materializeResult(taskId: string): Promise; materializeAndNotify(taskId: string): Promise; computeDepth(parentSessionId: string): number; setDirectory(directory: string): void; /** Replace the role-scoped config maps read by effectiveConfigFor at runtime (hot-reload). */ setDispatchConfigs(roleConfigs: ReadonlyMap, subagentRoleKey: Map): void; } /** Thin facade that delegates to focused sub-modules. */ export declare class TaskLifecycleManager implements LifecycleBridge { private d; constructor(deps: TaskLifecycleDeps); launch(input: DispatchInput, parentContext: { sessionID: string; agent: string; directory: string; }): Promise; executeSync(input: DispatchInput, parentContext: { sessionID: string; agent: string; directory: string; }): Promise; reopenForContinuation(taskId: string, input: DispatchInput, parentContext: { sessionID: string; agent: string; directory: string; }): Promise; cancelTask(taskId: string): Promise; getResult(taskId: string): Promise<{ kind: "ok" | "expired" | "not_found" | "fetch_error"; text: string; resultText: string; hadFence: boolean; totalChars: number; error?: string; }>; getInflightCount(parentSessionId: string): number; computeDepth(parentSessionId: string): number; evaluateAndComplete(taskId: string, trigger: "idle-debounce" | "watchdog-reconcile" | "global-sweep" | "error-event" | "deleted-event", errorDetail?: string): Promise; handleSessionIdle(sessionId: string): Promise; handleSessionStatus(sessionId: string, statusType: string): Promise; handleMessageUpdated(sessionId: string): void; handleSessionError(sessionId: string, error: unknown): Promise; handleSessionDeleted(sessionId: string): Promise; handleTaskCompleted(taskId: string): Promise; handleTaskError(taskId: string, error: string): void; handleTaskTimeout(taskId: string, reason: string): void; materializeResult(taskId: string): Promise; materializeAndNotify(taskId: string): Promise; leaveRunning(taskId: string): void; setDirectory(directory: string): void; setDispatchConfigs(roleConfigs: ReadonlyMap, subagentRoleKey: Map): void; } //# sourceMappingURL=task-lifecycle.d.ts.map