pub enum SessionRecord {
Show 27 variants
SessionMeta {
schema_version: u32,
seq: u64,
time: String,
session_id: String,
cwd: String,
title: String,
provider: String,
model: String,
websearch: String,
app_version: String,
config: Option<SessionConfigMeta>,
},
Context {
schema_version: u32,
seq: u64,
time: String,
sources: Vec<ContextSourceMeta>,
},
ContextLedger {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
ledger: ContextLedgerMeta,
},
ContextPin {
schema_version: u32,
seq: u64,
time: String,
item: ContextItemMeta,
reason: String,
},
ContextDrop {
schema_version: u32,
seq: u64,
time: String,
item: ContextItemMeta,
reason: String,
},
ContextRecovery {
schema_version: u32,
seq: u64,
time: String,
item: ContextItemMeta,
reason: String,
},
Compaction {
schema_version: u32,
seq: u64,
time: String,
audit: CompactionAudit,
},
CompactionReview {
schema_version: u32,
seq: u64,
time: String,
recovery_handle: String,
review: CompactionReviewResult,
},
User {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
text: String,
},
PromptMetadata {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
metadata: PromptMetadata,
},
AssistantFinished {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
text: String,
},
ReasoningFinished {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
text: String,
},
Usage {
schema_version: u32,
seq: u64,
time: String,
input_tokens: u64,
output_tokens: u64,
},
RequestAccounting {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
accounting: ProviderRequestAccounting,
},
ToolStarted {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
call_id: String,
name: String,
arguments: String,
mcp: Option<McpToolSessionMeta>,
},
ToolFinished {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
call_id: String,
status: ToolStatus,
output: Vec<String>,
artifact: Option<ArtifactMetadata>,
mcp: Option<McpToolSessionMeta>,
},
Cancelled {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
reason: String,
},
Failed {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
error: String,
},
AcpSession {
schema_version: u32,
seq: u64,
time: String,
local_session_id: String,
agent_name: String,
acp_session_id: String,
command: String,
protocol_version: String,
agent_info_name: Option<String>,
agent_info_version: Option<String>,
client_info_name: Option<String>,
client_info_version: Option<String>,
},
SessionRenamed {
schema_version: u32,
seq: u64,
time: String,
title: String,
},
FileWrite {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
op: WriteOp,
path: String,
before_hash: Option<u64>,
before_bytes: Option<usize>,
after_hash: u64,
after_bytes: usize,
status: ToolStatus,
},
McpConfigChanged {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
previous_files: Vec<SessionConfigFile>,
current_files: Vec<SessionConfigFile>,
diagnostics: Vec<String>,
},
ShellExec {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
process_id: Option<u64>,
command: String,
cwd: String,
process_status: String,
exit_code: Option<i32>,
elapsed_ms: u64,
kind: String,
},
SkillActivated {
schema_version: u32,
seq: u64,
time: String,
name: String,
path: String,
content_hash: u64,
byte_count: usize,
rendered_content_hash: u64,
rendered_byte_count: usize,
loaded_references: Vec<SkillReferenceRecord>,
},
QueuedInput {
schema_version: u32,
seq: u64,
time: String,
kind: String,
text: String,
},
AcpPermissionRequest {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
tool_call_id: String,
title: String,
options: Vec<AcpPermissionOptionRecord>,
},
AcpPermissionOutcome {
schema_version: u32,
seq: u64,
time: String,
turn_id: String,
tool_call_id: String,
outcome: String,
},
}Expand description
A single line in a session JSONL file.
Every record carries schema_version, seq (monotonic within the session),
time (ISO 8601 UTC), and a type tag. Records are never rewritten;
appends are the only mutation.
Variants§
SessionMeta
First line of a session: identity and environment.
Fields
config: Option<SessionConfigMeta>Effective config metadata: loaded config files, key origins, and
diagnostics. None when config metadata was not captured.
Context
Loaded context source metadata (AGENTS.md etc.).
ContextLedger
Content-free context working-set snapshot for one prompt turn.
ContextPin
A user pin action for a context item.
ContextDrop
A user drop action for a context item.
ContextRecovery
A user recovery action for a context item.
Compaction
A manual or automatic compaction audit record.
CompactionReview
The user’s decision on a compaction summary that required review.
Fields
review: CompactionReviewResultUser
A user-submitted prompt.
PromptMetadata
Prompt assembly metadata for one user turn.
AssistantFinished
Final replayable assistant text.
ReasoningFinished
Final replayable reasoning text.
Usage
Provider token usage increment.
RequestAccounting
Exact request-size accounting and provider usage for one request.
Fields
accounting: ProviderRequestAccountingToolStarted
A tool call started.
Fields
mcp: Option<McpToolSessionMeta>MCP metadata when this tool came from an MCP server.
ToolFinished
A tool call finished.
Fields
status: ToolStatusartifact: Option<ArtifactMetadata>Metadata and handle for bounded redacted recoverable evidence.
mcp: Option<McpToolSessionMeta>MCP metadata when this tool came from an MCP server.
Cancelled
The agent run was cancelled.
Failed
The agent run failed.
AcpSession
ACP session metadata.
Fields
SessionRenamed
Session title was renamed (latest wins).
FileWrite
A file write operation completed.
Records the operation type, target path, and before/after metadata for session audit. Only hashes and byte counts are persisted but not file content.
Fields
status: ToolStatusMcpConfigChanged
MCP configuration changed after the session was created.
Records only file paths, sources, hashes, and loader diagnostics; raw MCP server command, env, and header values are not persisted here.
ShellExec
A shell command lifecycle event.
One-shot commands produce a terminal record. Background commands
produce a running start record followed by a terminal record when
they exit, time out, or are cancelled. stdout/stderr are not stored
directly — they are captured in redacted, capped output records.
Fields
SkillActivated
A skill was explicitly opened/activated in the session.
Fields
rendered_byte_count: usizeByte count of the model-visible activation text after references are appended.
loaded_references: Vec<SkillReferenceRecord>QueuedInput
Queued input recorded for audit. Resume does not rebuild pending queues.
Fields
AcpPermissionRequest
ACP permission request metadata.
Fields
options: Vec<AcpPermissionOptionRecord>AcpPermissionOutcome
ACP permission request outcome.
Implementations§
Source§impl SessionRecord
impl SessionRecord
Sourcepub fn from_entry(
entry: &Entry,
seq: u64,
time: &str,
turn_id: &str,
) -> Option<SessionRecord>
pub fn from_entry( entry: &Entry, seq: u64, time: &str, turn_id: &str, ) -> Option<SessionRecord>
Convert a transcript Entry into a SessionRecord.
Only finalized entries are converted — streaming entries (assistant/ reasoning still streaming, tools still running) are skipped because they represent incomplete live state.
Sourcepub fn from_entry_with_artifact(
entry: &Entry,
seq: u64,
time: &str,
turn_id: &str,
artifact: Option<ArtifactMetadata>,
) -> Option<SessionRecord>
pub fn from_entry_with_artifact( entry: &Entry, seq: u64, time: &str, turn_id: &str, artifact: Option<ArtifactMetadata>, ) -> Option<SessionRecord>
Convert a transcript entry while attaching bounded artifact metadata.
Trait Implementations§
Source§impl Clone for SessionRecord
impl Clone for SessionRecord
Source§fn clone(&self) -> SessionRecord
fn clone(&self) -> SessionRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionRecord
impl Debug for SessionRecord
Source§impl<'de> Deserialize<'de> for SessionRecord
impl<'de> Deserialize<'de> for SessionRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SessionRecord
Source§impl PartialEq for SessionRecord
impl PartialEq for SessionRecord
Source§impl Serialize for SessionRecord
impl Serialize for SessionRecord
impl StructuralPartialEq for SessionRecord
Auto Trait Implementations§
impl Freeze for SessionRecord
impl RefUnwindSafe for SessionRecord
impl Send for SessionRecord
impl Sync for SessionRecord
impl Unpin for SessionRecord
impl UnsafeUnpin for SessionRecord
impl UnwindSafe for SessionRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more