Versioned pure-functional conversation documents (agent, live, inbox, usage),
JSON delta operations, and fork policy resolution.
Summary
Functions
Accumulates turn usage metrics into the "usage" document and returns
{new_usage, ops}.
Appends text at a path inside a document and returns {new_doc, [op]}.
Applies a single JSON delta operation (replace, r, set, append_text, delete).
Applies a list of JSON delta operations to a document immutably.
Applies validated configuration updates to an "agent" document and emits
minimal ["set", [key], val] delta ops.
Returns the definition map for a built-in document kind.
Returns metadata for all built-in document kinds.
Deletes a path inside a document and returns {new_doc, [op]}.
Computes initial documents for a forked conversation at at_entry_seq.
Returns the initial value for a built-in conversation document.
Replaces a document value and emits ["replace", value].
Sets a path inside a document and returns {new_doc, [op]}.
Unwraps a stored document record map, falling back to initial/2 when nil.
Wraps a document value in a storage record map.
Types
Functions
Accumulates turn usage metrics into the "usage" document and returns
{new_usage, ops}.
Appends text at a path inside a document and returns {new_doc, [op]}.
Applies a single JSON delta operation (replace, r, set, append_text, delete).
Applies a list of JSON delta operations to a document immutably.
Applies validated configuration updates to an "agent" document and emits
minimal ["set", [key], val] delta ops.
Returns the definition map for a built-in document kind.
Returns metadata for all built-in document kinds.
@spec delete(term(), [String.t() | non_neg_integer()]) :: {term(), [op()]}
Deletes a path inside a document and returns {new_doc, [op]}.
@spec fork_docs(H.Storage.t(), pos_integer(), non_neg_integer(), keyword()) :: {:ok, %{required(String.t()) => term()}, H.Storage.t()} | {:error, term()}
Computes initial documents for a forked conversation at at_entry_seq.
"agent" uses fork: :as_of (read from storage at as_of_seq: at_entry_seq),
while "live", "inbox", and "usage" use fork: :initial.
Returns the initial value for a built-in conversation document.
Replaces a document value and emits ["replace", value].
Sets a path inside a document and returns {new_doc, [op]}.
Unwraps a stored document record map, falling back to initial/2 when nil.
Wraps a document value in a storage record map.