Read-only session-wide entry tree builder for live, cold native, and imported archived sessions.
Projects raw session entries into bounded, single-line sanitized summary nodes
with explicit parent_id links and per-conversation leaf_entry_id pointers
without ever leaking raw base64 payloads or unbounded tool outputs.
Summary
Functions
Builds {conversations_wire, nodes_wire, truncated?} from an imported
H.Archive (conversations map %{cid => %{parent: nil | {pcid, at}, head: id | nil}},
entries_index map %{id => {cid, parent_id, offset, size}}, and decoded
selected entries in ascending ID order).
Builds {conversations_wire, nodes_wire, truncated?} from a native
conversations map (%{cid => %{id, parent, owner, entry_ids}}) and a list
of entries (in any order).
Maximum number of entry nodes included in a single tree response.
Selects up to max_nodes latest IDs from an ascending list of IDs, returning
{selected_ids_asc, truncated?}.
Functions
Builds {conversations_wire, nodes_wire, truncated?} from an imported
H.Archive (conversations map %{cid => %{parent: nil | {pcid, at}, head: id | nil}},
entries_index map %{id => {cid, parent_id, offset, size}}, and decoded
selected entries in ascending ID order).
Builds {conversations_wire, nodes_wire, truncated?} from a native
conversations map (%{cid => %{id, parent, owner, entry_ids}}) and a list
of entries (in any order).
@spec max_nodes() :: pos_integer()
Maximum number of entry nodes included in a single tree response.
@spec take_latest([term()], pos_integer()) :: {[term()], boolean()}
Selects up to max_nodes latest IDs from an ascending list of IDs, returning
{selected_ids_asc, truncated?}.