import { type CreateWorkItemInput, type WorkItem } from './store.js'; /** * Caller-supplied create idempotency (ICI-733). * * `(source, source_ref)` already dedupes machine mints, but the server picks * that pair and the trigger paths do not set it usefully — a cron that fires * twice, or a connector that retries after a timeout it never saw resolve, * makes a second Todo for the same intent. An explicit key lets the CALLER say * "this is the same create as before". * * The receipt stores a fingerprint of the create alongside the Todo it made, * mirroring `work_item_edit_receipts`. Replaying the same key with a materially * different payload is a caller bug, not a replay: answering it with the first * Todo would silently drop the second create, so it raises instead. */ export declare class WorkItemCreateIdempotencyConflictError extends Error { readonly workItemId: string; constructor(workItemId: string); } export interface IdempotentCreateResult { item: WorkItem; /** True when the key had already been used and this create wrote nothing. */ replayed: boolean; } /** * Create a Todo at most once per key. A repeat with the same payload returns * the Todo the first call made, having written nothing — no second row, no * second `created` event, and no burned ID, because the receipt is checked * before the allocator is ever reached. */ export declare function createWorkItemIdempotent(input: CreateWorkItemInput, idempotencyKey: string, labels?: readonly string[]): IdempotentCreateResult; //# sourceMappingURL=create-idempotency.d.ts.map