/** Wire protocol version, bumped on breaking changes to the on-the-wire message * shapes so client and server can detect a mismatch. Currently `1`. */ declare const PROTOCOL_VERSION: 1; type EntityId = string; type AppId = string; type MutationId = string; /** Monotonic per app DO. Treat as an OPAQUE PER-STREAM WATERMARK: only compare * txIds from the same app stream; never do arithmetic on them. */ type TxId = number; /** Names an entity's home graph (cell). Today every app is exactly one graph, so * refs omit it; it exists so cross-cell references stay expressible later. */ type GraphId = string; type ValueType = "string" | "number" | "boolean" | "date" | "json" | "ref"; type Scalar = string | number | boolean | null; type Json = Scalar | Json[] | { [key: string]: Json; }; type Value = Scalar | Json; /** Resolve an entity by a unique attribute instead of by id. */ interface Lookup { ns: string; attr: string; value: Scalar; /** Home graph of the entity. Absent = local. Non-local refs are rejected * with `cross_graph_unsupported` until cross-cell resolution exists. */ graph?: GraphId; } /** A graph-qualified direct reference — an entity living in another cell. */ interface GlobalEntityRef { graph: GraphId; id: EntityId; } type EntityRef = EntityId | Lookup | GlobalEntityRef; type Op = { t: "update"; ns: string; id: EntityRef; attrs: Record; } /** Atomically add `by` to one numeric attribute (missing attr starts at 0). * The entity itself must already exist. */ | { t: "increment"; ns: string; id: EntityRef; attr: string; by: number; } | { t: "merge"; ns: string; id: EntityRef; attrs: Record; } | { t: "delete"; ns: string; id: EntityRef; } /** Remove the named scalar/json attributes from a row (the absence-of-triple * state). The scalar sibling of `unlink`: `update` sets, `retract` unsets. * A no-op for attributes already absent; retracting a required attribute * fails the transaction's final-state schema check. */ | { t: "retract"; ns: string; id: EntityRef; attrs: string[]; } | { t: "link"; ns: string; id: EntityRef; label: string; target: EntityRef; } | { t: "unlink"; ns: string; id: EntityRef; label: string; target: EntityRef; }; interface ErrShape { code: string; message: string; detail?: Json; } export { type AppId as A, type EntityId as E, type Json as J, type Lookup as L, type MutationId as M, type Op as O, PROTOCOL_VERSION as P, type Scalar as S, type TxId as T, type ValueType as V, type EntityRef as a, type ErrShape as b, type Value as c };