import type { ContractPayload, ContractShape, HandoffTrigger, SupplyDefinition } from './types.js'; /** * The producer-side builder for a handoff valve. Type parameters narrow as the * chain progresses: `.from()` fixes the source row type, `.contract()` fixes * the payload type, and `.guard()` / `.project()` / `.idempotentBy()` are then * checked against them. `.to()` is terminal — it registers the valve. */ export interface SupplyBuilder { /** The source entity and the state transition (or push) that fires the crossing. */ from(source: string, trigger: HandoffTrigger): SupplyBuilder; /** The payload schema — `.project()` must produce exactly this shape. */ contract(shape: TShape): SupplyBuilder>; /** A guard predicate; the payload may not cross unless it holds. */ guard(predicate: (row: TSource) => boolean): SupplyBuilder; /** Projects the source row to the contract payload — a snapshot taken at crossing time. */ project(projection: (row: TSource) => TPayload): SupplyBuilder; /** Names a post-condition that holds across the crossing (checked via the valve graph). */ invariant(name: string): SupplyBuilder; /** The source field carrying the trace/correlation id propagated across the crossing. */ lineage(field: string): SupplyBuilder; /** Derives the idempotency key for a crossing from the source row. */ idempotentBy(key: (row: TSource) => string): SupplyBuilder; /** Run the crossing as a durable retried job rather than in the caller's transaction. */ durable(retry?: 'backoff' | 'fixed'): SupplyBuilder; /** The consumer silo. Terminal — registers the valve and returns its definition. */ to(consumer: string): SupplyDefinition; } /** * Declare a handoff valve. `name` identifies the valve; `producer` is the silo * the data crosses *from*. Chain the anatomy and finish with `.to(consumer)`. */ export declare function supply(name: string, producer: string): SupplyBuilder; //# sourceMappingURL=supply.d.ts.map