import { Task, TaskAction, TaskDocument, TaskMutationParams, TaskStatus, UpsertItemOutcome } from "../../models/task.mjs"; //#region src/services/reducer/index.d.ts /** Bounds the work one call can do, and with it the size of one committed write. */ export declare const MAX_UPSERT_ITEMS = 100; /** * A ref must start with a letter, which makes it structurally unconfusable with * a stringified id. That is why resolving a dependency token is just a `typeof` * check with no coercion heuristics. */ export declare const REF_PATTERN: RegExp; /** * Reducer outcome. Closed tagged union: adding an action requires extending * this union and the response formatter, which the compiler enforces. * * `upsert` carries one outcome per request item. It is returned even when every * item failed — `error` is reserved for whole-call faults — so the tool layer * still has the per-item messages to report. */ export type Op = { kind: 'upsert'; items: UpsertItemOutcome[]; applied: number; failed: number; } | { kind: 'delete'; id: number; subject: string; } | { kind: 'list'; statusFilter?: TaskStatus; includeDeleted: boolean; } | { kind: 'get'; task: Task; } | { kind: 'clear'; count: number; } | { kind: 'error'; message: string; }; export interface ApplyResult { document: TaskDocument; op: Op; } /** Actions the reducer owns. `assign`/`cancel` are handled by the delegation manager. */ export type ReducerAction = Exclude; /** * Does this op represent state that must reach disk? * * The exhaustive switch is the point: a future `Op` variant cannot be added * without declaring its persistence intent, so nothing silently starts or stops * bumping `rev`. */ export declare function isCommittingOp(op: Op): boolean; /** Joined per-item failures, for the thrown error when an upsert applied nothing. */ export declare function formatUpsertFailure(op: Extract): string; /** The single item's outcome, for callers that only ever send a batch of one. */ export declare function singleItemOutcome(op: Op): UpsertItemOutcome | undefined; /** * Pure reducer: (document, action, params) -> (document, op). * * All validation is in-line: structural guards plus state-aware checks * (transition legality, dangling or deleted blockedBy, self-block, cycles, * in-flight delegations). The caller owns persistence and formatting. */ export declare function applyTaskMutation(document: TaskDocument, action: ReducerAction, params: TaskMutationParams, now?: string, maxTasks?: number): ApplyResult; //#endregion //# sourceMappingURL=index.d.mts.map