import type { ExecutionRecord } from '../executions/registry.js'; interface OccupancyGpuInfo { index: number; occupied: boolean; processes: { pid: string; name: string; memoryMB: number; }[]; } interface GpuOccupancyResult { gpus: OccupancyGpuInfo[]; freeIndices: number[]; allOccupied: boolean; error?: string; } interface DispatchMatch { source: string; taskId: string | null; machine: string | null; } interface SelectAndClaimResult { task: any; prompt: string; template: string | null; } interface DispatchOutcome { success: boolean; skipped: boolean; } interface FilterDeps { findActiveDispatchMatch?: (task: any, scheduleTaskId: string) => DispatchMatch | null; checkRealGpuOccupancy?: (machine: string) => Promise; isTemplateRateLimited?: (templateName: string, dispatchProfile: string | null) => boolean; /** Scheduler-resolved dispatch profile — used only to resolve `__active__` template slots. */ profileName?: string | null; } declare function isValidDispatchPrompt(value: unknown): boolean; declare function filterLockedProjects(tasks: any[]): any[]; declare function checkRealGpuOccupancy(machine: string): Promise; declare function selectTask(tasks: any[] | null): any | null; declare function findActiveDispatchMatch(task: any, scheduleTaskId: string): DispatchMatch | null; /** True when the task's template cannot run: ANY of its agents' profiles is fully * rate-limited (a known-blocked later agent would fail the thread mid-pipeline and * unclaim the task, discarding earlier agents' work). Empty resolution (unknown * template / no concrete profiles) falls back to checking the dispatch profile. */ declare function isTemplateRateLimited(templateName: string, dispatchProfile: string | null, check?: (profile: string | null) => boolean): boolean; declare function filterDispatchableTasks(tasks: any[] | null, scheduleTaskId: string, gpuBusyCounts?: Map, deps?: FilterDeps): Promise; declare function computeNextInterval(outcome: DispatchOutcome): number; declare function hasRunningExecutionForSchedule(records: Pick[], scheduleTaskId: string): boolean; declare function updateScheduleInterval(scheduler: any, scheduleTaskId: string, newIntervalMs: number): Promise; declare function selectAndClaimTask({ scheduleTaskId, dryRun, profileName }: { scheduleTaskId: string; dryRun?: boolean; profileName?: string | null; }): Promise; export { selectAndClaimTask, hasRunningExecutionForSchedule, computeNextInterval, updateScheduleInterval, isValidDispatchPrompt, isTemplateRateLimited, selectTask, filterLockedProjects, filterDispatchableTasks, findActiveDispatchMatch, checkRealGpuOccupancy, };