/** * Dispatcher support helpers extracted from `SheetsEffectDispatcher.ts`. * * Pure mechanical move: the priority/route-key/validation classification * helpers, the `PreparedDispatchError` class, and the pending-effect to * provider-effect conversion predicates. All behavior, comments, and export * visibility are unchanged; `SheetsEffectDispatcher.ts` re-exports the * symbols that were exported from there before the extraction. */ import type { PendingEffect, Presence } from "@hikoutei/ikisaki"; import { type SyncProjectionEffect } from "../../../contracts/sheets/syncSheets.js"; /** * Dispatch-priority classes for ready projection effects. * * The worker runs ready effects in ascending declared priority across both * dispatch buckets, so System_State converges ahead of unrelated work within * the bounded soak convergence deadline. Only the dispatch sequence changes: * claim windows, leases, fencing, per-target predecessor ordering, the * limiter, and bounded fairness are untouched, and unready predecessors are * never forced. */ export declare const SYNC_DISPATCH_PRIORITIES: { /** New System_State entity rows appended through the fast path first. */ readonly SYSTEM_STATE_FAST_APPEND: 0; /** System_State update/delete/tombstone followers through the CAS path. */ readonly SYSTEM_STATE_REGULAR: 1; /** New Sync_Conflicts resolution rows appended through the fast path. */ readonly SYNC_CONFLICTS_FAST_APPEND: 2; /** User_Input and every other regular effect (repairs, deletes, resolves). */ readonly OTHER_REGULAR: 3; }; /** * Declares the dispatch-priority class of one pending effect. * * No-throw contract like the other classification predicates: a malformed * payload degrades to the neutral `OTHER_REGULAR` priority instead of * aborting the pass. */ export declare function sheetsDispatchPriorityFor(effect: PendingEffect): number; /** * Legacy spreadsheet-scope route label, kept for direct multi-tab callers and * tests that pass an explicit routeKey into the dispatcher (the worker groups * production effects through `sheetsRouteKeyFor`, which now distinguishes * physical routes instead of this constant). */ export declare const SHEETS_SPREADSHEET_ROUTE_KEY = "spreadsheet-scope"; /** * Worker-visible route identity for one pending effect. * * No-throw contract: a malformed payload degrades to an effect-specific * invalid key (the worker's own payload validation then fails it through the * invalid-payload path) instead of aborting route grouping. */ export declare function sheetsRouteKeyFor(effect: PendingEffect): string; /** Validates the opaque payload of one pending effect for the worker. */ export declare function sheetsPayloadValidationError(effect: PendingEffect): Presence; /** * Entity-side fast-append shape check, retained for dispatch-priority * classification only. Effect creation stamps the opaque `dispatchClass` * label instead (see `classifyDispatchClass` in `ProjectionEffectFactory`); * the protocol worker routes on that label and never calls this function. */ export declare function isFastAppendEffect(effect: SyncProjectionEffect): boolean; /** Classified, safe error for an invalid or foreign prepared-apply token. */ export declare class PreparedDispatchError extends Error { constructor(message: string); } /** Validates and converts one durable outbox row into a provider effect. */ export declare function toProviderEffect(effect: PendingEffect): SyncProjectionEffect; export declare function safeProviderErrorMessage(error: unknown): string; //# sourceMappingURL=dispatcherSupport.d.ts.map