Expand description
OpenCode: a single SQLite database (~/.local/share/opencode/opencode.db)
holding session, message, and part rows.
The native Body is OpenCode’s own export shape —
{info, messages: [{info, parts}]} — the format opencode export emits and
opencode import consumes. OpenCodeStore reads the DB read-only and
assembles that shape; save hands it to opencode import. The codec and
native types are pure JSON and compile without the opencode feature;
only the store pulls in rusqlite.
A part of type tool splits into a Block::ToolUse on an assistant
message and a Block::ToolResult on the following user message, matching
the Anthropic shape. Synthetic text parts and internal bookkeeping
(step-start/finish, snapshot, patch, …) are dropped from the conversation
but preserved in the native body.
Structs§
- Export
OpenCode’s export document: a session header plus its messages.- Message
Record - One message and its parts, as
opencode exportemits them. - Open
Code - The
OpenCodeharness marker. - Open
Code Store - Reads and writes
OpenCodesessions in aSQLitedatabase. ARefis a session id, since every session shares the one database file.