import type { PlatformAdapter } from '../platform/index.js'; import type { ThreadRecord, RunThreadOptions } from '../core/types/thread-types.js'; import { type ResumeEntry } from '../domain/costs/resume-registry.js'; import { agentRunner } from './agent-runner.js'; /** Auto-resume is on by default; disable with CORTEX_AUTO_RESUME=0 (or "false"). */ export declare function isAutoResumeEnabled(): boolean; /** The continuation prompt injected into a resumed session/thread. Self-contained — the * prior turn's content is already in the resumed session/thread history. */ export declare function buildResumeReminder(): string; export interface ResumeDeps { takeAll: () => ResumeEntry[]; route: (ctx: Parameters[0]) => Promise; resumeThread: (threadId: string, opts: RunThreadOptions) => Promise; buildResumeOptions: (thread: ThreadRecord) => RunThreadOptions | null; getThread: (threadId: string) => ThreadRecord | null; channelBusy: (channel: string) => boolean; /** True if a DIRECT (interactive) session is live on the channel — i.e. an execution with no * threadId. Only direct sessions force a channel to serialize (a Slack conversation cannot * interleave two assistant turns). Threads are channel-parallel-safe, so a rate-limited thread * only needs to avoid a live direct session, not other threads. */ directSessionBusy: (channel: string) => boolean; now: () => number; delay: (ms: number) => Promise; } /** Drain the resume registry and re-enter each interrupted target. Called by the * rate-limit-throttle onResume hook when the window resets. Never throws. */ export declare function dispatchPendingResumes(adapter: PlatformAdapter, overrides?: Partial): Promise;