Skip to main content

Module local

Module local 

Source
Expand description

Local sessions across every harness.

The seven operations, in terms of this module:

opcall
listdiscover
readSession::read
writewrite()
openresume_command (caller execs it)
translateSession::read + write()
continueSession::read + write() + resume_command
deleteSession::delete

Everything here uses each harness’s default on-disk location. For custom roots, use the per-harness Stores directly.

Structs§

Session
One session found on this machine.
WriteOpts
Optional knobs for write_with.
Written
The outcome of write(): the id the target harness resumes by, and a human-readable location.

Functions§

discover
Every local session, newest first. Unreadable stores and sessions are skipped.
discover_harness
Discover one harness, surfacing remote errors when a live source is explicitly requested. Other harnesses retain the tolerant aggregate scan.
discover_scoped
The sessions a --from selection names: every local harness when from is None, else that one harness. This is the only path that reaches a live web source, and only when it is named explicitly — an omitted from never contacts either one.
discover_with
discover, reporting progress: on_store(harness, sessions_so_far) is called before each store is scanned.
fingerprints
Per-session change cursors, positionally aligned with sessions — the batched form of Store::fingerprints across every harness, for callers that cache parsed transcripts and want to know which ones to re-read. A cursor is an opaque string that changes whenever the session’s backing data does; an empty string means the backend could not establish one, and a cache should treat the session as changed.
resume_command
The command that resumes session id in harness(binary, args), for the caller to exec or spawn. Overridable per harness with TRANSCRIPT_<HARNESS>_RESUME_CMD, a template where {id} is substituted (e.g. TRANSCRIPT_CODEX_RESUME_CMD="codex resume {id}").
write
Persist a canonical transcript in target’s native, resumable format. root overrides the harness’s default on-disk root (file-backed stores only; OpenCode always goes through opencode import into the live database, so a root override for it is refused rather than silently redirected).
write_with
[write] with optional harness-specific WriteOpts::metadata.