Documentation
¶
Overview ¶
Package convert converts Codex CLI rollouts into the Agent Session Format. docs/formats/codex.md is the mapping and lists every finding code it reports.
Index ¶
Constants ¶
const Harness = "codex"
Harness is the harness name converted sessions record.
const Source = "codex"
Source is the format name and the namespace of every extension member and custom entry this converter writes.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert converts a rollout into a session and, with an index, each sub-agent it spawned that the index holds into one of its own, at any depth: the main session first, every other after its parent's. One report covers them all; a sub-agent's findings name its file. Only the main rollout's failure fails the conversion: a sub-agent that cannot be read or converted is a finding, and its own sub-agents are converted still.
func ConvertFile ¶
func ConvertFile(path string, opts Options) (*agentimport.Result, error)
ConvertFile reads the rollout at path and converts it, with the sub-agents it spawned that the tree holding it has: the sessions tree when Codex filed it there, sessions/YYYY/MM/DD/, else its own directory (see codex.SessionsRoot). An index that cannot be built, or that left rollouts out, is reported.
func IndexFindings ¶
func IndexFindings(x *codex.Index) []agentimport.Finding
IndexFindings reports what an index left out: each rollout whose session meta could not be read and each directory that could not be walked. A sub-agent among them is not converted with its parent.
Types ¶
type Options ¶
type Options struct {
// Slim drops what the model never saw and the session format has
// no member for, rather than keeping it in namespaced members: item
// and line members the conversion does not map, harness metadata,
// rate limits, the session meta's other members. Each drop is still
// reported. Custom entries, the format's own place for records it
// does not define, are kept.
Slim bool
// Derive writes the entries the module's derivation rules infer
// from the converted path, each marked agentimport:derived: a shell
// call's published refs (docs/plans/agentimport.md).
Derive bool
// Index finds the rollouts of the threads a thread spawned, which
// are converted with it, each its own session after its parent's.
// ConvertFile indexes the tree the rollout is in when it is nil
// (codex.IndexFor); Convert converts the one rollout. A family's
// sessions are all held in the result, so a thread with hundreds of
// sub-agents holds hundreds of sessions at once.
Index *codex.Index
// Alone converts the rollout without its sub-agents, whatever Index
// holds, and ConvertFile indexes nothing.
Alone bool
}
Options tune a conversion. The zero value keeps everything.