pub enum SessionFormat {
ClaudeCode,
Codex,
OpenCode,
Pi,
Grok,
Gemini,
Goose,
}Expand description
An on-disk session format supercode can both read and write.
Like an image editor that opens and exports several file formats, supercode
keeps one canonical in-memory model (Session) and converts to/from each
supported format on the edges.
This is a write-target / codec selector: a caller’s request, passed to
Session::load_str, Session::to_jsonl, and Session::save,
choosing which on-disk dialect to parse or emit. It answers “what format
should I read/write?” — as opposed to SessionSource, which records the
provenance fact of what actually produced a loaded file. The two enums are
intentionally kept separate (provenance fact vs. serialization choice) and
should not be unified, even though their variants currently match
one-to-one.
Variants§
ClaudeCode
Claude Code transcript JSONL.
Codex
Codex rollout JSONL.
OpenCode
OpenCode export-document / envelope JSONL (wave B; see
SessionSource::OpenCode).
Pi
Pi session JSONL (see SessionSource::Pi).
Grok
Grok chat_history.jsonl transcript.
Gemini
Gemini CLI session JSONL.
Goose
Goose native session-export JSON.
Implementations§
Source§impl SessionFormat
impl SessionFormat
Sourcepub fn source(self) -> SessionSource
pub fn source(self) -> SessionSource
The SessionSource a file of this format reports.
This is the deliberate one-way bridge between the two concepts: a file
saved in this format will, when reloaded, report this provenance (see
crates/harness/tests/session_saving.rs), making the relationship
discoverable from the method itself.
Trait Implementations§
Source§impl Clone for SessionFormat
impl Clone for SessionFormat
Source§fn clone(&self) -> SessionFormat
fn clone(&self) -> SessionFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more