import type { FabricFreshnessChecker } from "./freshness.js"; import type { FabricSpeculationConfig, FabricSpeculationReplay, FabricSpeculationRuntime, FabricSpeculationServeResult, FabricSpeculationStats } from "./types.js"; /** * Turn-scoped store of pre-launched speculation promises. * * Correctness contract: a stored promise may only be served to a real call * when (1) the mutation epoch has not advanced since the speculation launched * — the epoch bumps after any real in-program invocation whose effect kind is * not "none" — and (2) the entry's freshness checker, when present, still * holds. Entries are take-once (identical duplicate calls each need their own * speculation) and are aborted + counted wasted when their execution finishes * without serving them or when the turn resets. */ export declare class FabricSpeculationStore implements FabricSpeculationRuntime { #private; constructor(config: Pick); get epoch(): number; stats(): FabricSpeculationStats & { pending: number; }; bumpEpoch(): void; static key(parentToolCallId: string, ref: string, preparedArgs: Record): string; /** * Register and start a speculative invocation. Returns false when at * capacity; the candidate is dropped silently (a miss costs nothing, the * real call executes normally later). */ launch(parentToolCallId: string, ref: string, preparedArgs: Record, execute: (signal: AbortSignal) => Promise, freshness: FabricFreshnessChecker | undefined, replay: FabricSpeculationReplay): boolean; tryServe(parentToolCallId: string, ref: string, preparedArgs: Record): Promise; /** Execution for this tool call finished: everything unserved is waste. */ onInvocationEnd(parentToolCallId: string): void; /** Turn backstop: speculation never outlives a turn. */ reset(): void; } //# sourceMappingURL=store.d.ts.map