Skip to content

AddOperation

Add operation accepted by client.commit.apply. Use this shape to create new shapes, things, assertions, or collections in a single commit.

https://docs.warmhub.ai/writes/operations/#add-operations

optional operation?: "add"

Operation discriminator. Defaults to add when omitted.


optional kind?: "shape" | "thing" | "assertion" | "collection"

Optional kind override: shape, thing, assertion, or collection. When omitted, kind is inferred from name segmentation (1-seg → thing, 2-seg Shape/name → thing, 3+ segments → assertion).


optional name?: string

Target name. Use Shape/localName for things and assertions; use the plain shape name for shapes.


optional about?: string | CollectionAbout

Assertion target wref or inline collection descriptor. Presence of about makes the add an assertion unless kind overrides it.


optional data?: unknown

Shape-validated data payload for shape, thing, or assertion adds.


optional type?: CollectionTag

Collection type. Used only for collection adds.


optional members?: string[]

Collection member wrefs. Used only for collection adds.


optional skipExisting?: boolean

When true, an existing target returns noop instead of failing with ALREADY_EXISTS. Use for caller-side idempotency on retried writes.