import type { TaskEntity, TaskMutationEvidence, TaskMutationType } from "./types.js";
import type { TaskStore } from "./persistence/store.js";
import type { WishlistConversionDecomposition } from "./wishlist/wishlist-types.js";
/** Task id pattern `T` + digits (create-task, convert-wishlist validation). */
export declare const TASK_ID_RE: RegExp;
/** Numeric ordering for `T###` ids (falls back to lexicographic). */
export declare function compareTaskIdNumeric(a: string, b: string): number;
/** Next monotonic `T` id from the full task set (includes archived — ids are not reused). */
export declare function allocateNextTaskId(allTasks: TaskEntity[]): string;
/** Idempotent replay for server-allocated ids: locate prior `create-task` row by clientMutationId. */
export declare function findIdempotentAllocatedCreate(store: TaskStore, mutationType: TaskMutationType, clientMutationId: string): {
    taskId: string;
    payloadDigest?: string;
} | null;
export declare const SAFE_METADATA_PATH_RE: RegExp;
export declare function isRecordLike(value: unknown): value is Record<string, unknown>;
export declare function readMetadataPath(metadata: Record<string, unknown> | undefined, path: string): unknown;
export declare function stableStringify(value: unknown): string;
export declare function digestPayload(value: unknown): string;
export declare function readIdempotencyValue(args: Record<string, unknown>): string | undefined;
export declare function findIdempotentMutation(store: TaskStore, mutationType: TaskMutationType, taskId: string, clientMutationId: string): {
    payloadDigest?: string;
} | null;
export declare function nowIso(): string;
export declare function mutationEvidence(mutationType: TaskMutationType, taskId: string, actor?: string, details?: Record<string, unknown>): TaskMutationEvidence;
export declare function parseConversionDecomposition(raw: unknown): {
    ok: true;
    value: WishlistConversionDecomposition;
} | {
    ok: false;
    message: string;
};
export declare function buildTaskFromConversionPayload(row: Record<string, unknown>, timestamp: string): {
    ok: true;
    task: TaskEntity;
} | {
    ok: false;
    message: string;
};
/** Optional optimistic concurrency token from mutating command JSON (`expectedPlanningGeneration`). */
export declare function readOptionalExpectedPlanningGeneration(args: Record<string, unknown>): number | undefined;
export declare function planningConcurrencySaveOpts(args: Record<string, unknown>): {
    expectedPlanningGeneration: number;
} | undefined;
