import type { ScheduleTarget, ScheduleTask } from '../../../store/schedule-repo.js'; import type { ThreadRecord } from '../../../core/types/thread-types.js'; /** What scheduled-task.ts should do at fire time. Each kind maps to one runtime branch: * - fresh → createThread('scheduler') + runThreadExec (fresh scheduler session) * - continue-thread → continueThread (resumes the existing thread's slot session) * - skip → record lastSkipped, post a one-line Slack note, do not run. */ export type DispatchPlan = { kind: 'fresh'; channel: string; } | { kind: 'continue-thread'; channel: string; threadId: string; } | { kind: 'skip'; reason: string; }; export interface DispatchLookups { /** Look up a thread record by id. Null if missing. */ getThread(threadId: string): ThreadRecord | null; } export interface DispatchPlanInput { target: ScheduleTarget | undefined; fallback: ScheduleTask['fallback']; /** Channel to use when falling back to fresh — typically the schedule's own resolved channel. */ fallbackChannel: string; lookups: DispatchLookups; } export declare function planScheduledDispatch(input: DispatchPlanInput): Promise;