Skip to main content

Crate hotl_types

Crate hotl_types 

Source
Expand description

L1 — canonical conversation types.

Pure data + serde. No tokio, no I/O. Forward-compat serde is policy: #[serde(other)] Unknown on persisted enums, format_version in the session header, optional fields default + skip-when-none.

Assistant content is kept as verbatim provider blocks (serde_json::Value) rather than re-typed structs: signed thinking blocks must echo back to the provider byte-faithfully or replay breaks (review A11), and unknown future block types survive a round-trip losslessly. Typed views are provided for the engine (assistant_text, assistant_tool_uses).

Structs§

Entry
One appended log record. parent_id forms a chain (a tree from M3); M0 logs are strictly linear.
SessionHeader
TokenUsage
Normalized usage; fields absent from a provider response default to zero.
ToolResultItem
ToolUse
A tool invocation extracted from assistant blocks.

Enums§

EntryPayload
Item
One conversation item. Internally tagged so #[serde(other)] can absorb item kinds this binary doesn’t know yet (payload dropped, no crash).
StopReason
Why a sample stopped. Other absorbs stop reasons newer than this binary.
SyntheticReason
Structural provenance on every injected user item (grok 04): no consumer ever parses message text to learn where it came from.

Constants§

FORMAT_VERSION
Bumped only on breaking changes to the persisted entry format.

Functions§

assistant_text
Concatenated text of the assistant’s text blocks.
assistant_tool_uses
Tool-use blocks in source order.
new_ulid
normalize_session_name
A session display name: trimmed, non-empty, at most 64 chars. The one validator every entry point (CLI, ACP, TUI) funnels through.