/** * Adaptive planning: one batched triage that decides which units earn a * per-unit todo pass, instead of paying for a todo request on every unit. The * provider call is injected so this orchestration stays deterministic and * unit-testable, and so a failed batch degrades to the original "plan it" * behavior rather than silently skipping planning. */ import type { DirectPlanClassificationItem } from "../prompts/direct-plan-classification.ts"; import { type ConversionUnit } from "./types.ts"; /** * Units per classification request. Large enough that a handful of calls covers * thousands of units, small enough that one request stays bounded and the model * keeps track of every index. Each unit contributes a length-capped excerpt. */ export declare const PLAN_CLASSIFICATION_BATCH_SIZE = 40; /** Exact number of classification requests a batch of this size will issue. */ export declare function planClassificationRequestCount(eligibleUnitCount: number): number; export interface AdaptivePlanningResult { /** Units the classifier (or a failed-batch fallback) says should be planned. */ needsPlanning: Set; /** Classification requests actually attempted; one per batch. */ classificationRequests: number; /** Human-readable reasons a batch fell back to planning everything in it. */ fallbacks: string[]; } /** * Batch `units` and ask `classifyBatch` which of each batch's 1-based indices * need planning. Indices the classifier returns become planned units; a batch * whose classifier throws is planned in full so quality never silently drops. * `units` should already be the todo-eligible set — callers gate on kind first. */ export declare function classifyUnitsNeedingPlanning(units: readonly ConversionUnit[], classifyBatch: (items: readonly DirectPlanClassificationItem[]) => Promise>): Promise; //# sourceMappingURL=adaptive-planning.d.ts.map