import type { EventBus } from '../../events/index.js'; import type { PlatformAdapter } from '../../platform/index.js'; import type { Scheduler } from './scheduler.js'; export type JobRunner = (payload: unknown) => Promise; /** Interactive callbacks factory for plan_written / ask_user_question events. */ export type InteractiveCallbacksFactory = (channel: string, sessionId: string | null) => { onToolUse: ((name: string, input: any) => void); onPlanWritten: ((event: { path: string; content: string; toolUseId: string; }) => void); onAskUserQuestion: ((event: { toolUseId: string; questions: Array<{ question: string; options?: string[]; multi?: boolean; }>; }) => void); }; export declare const ctx: { adapter: PlatformAdapter | null; schedulerRef: Scheduler | null; bus: EventBus | null; buildInteractiveCallbacks: InteractiveCallbacksFactory | null; /** DR-0014 ยง8: injected by app.ts (โ†’ orchestration/thread-callback.reconcileWaitingTasks) * so the dispatch path can close the suspension race window for manager threads * without a domain โ†’ orchestration import. */ onThreadSuspended: ((threadId: string) => Promise) | null; }; export declare function register(key: string, runner: JobRunner): void; export declare function dispatch(key: string, payload: unknown): boolean; /** Exposed for testing โ€” returns a copy of registered keys */ export declare function registeredKeys(): string[];