Documentation
¶
Index ¶
- Constants
- func FindByPrefix(prefix string) (string, error)
- func NewID() (string, error)
- func Path(id string) string
- type Entry
- type State
- type Writer
- func (w *Writer) AppendEntry(role, content string, at time.Time)
- func (w *Writer) AppendInput(text string)
- func (w *Writer) AppendMessage(msg json.RawMessage)
- func (w *Writer) AppendReset()
- func (w *Writer) Arm()
- func (w *Writer) Armed() bool
- func (w *Writer) Close(mode string) error
- func (w *Writer) Created() bool
- func (w *Writer) Flush() error
- func (w *Writer) Path() string
Constants ¶
const ( Ext = ".jsonl" // Schema version written into new logs Version = 1 )
Variables ¶
This section is empty.
Functions ¶
func FindByPrefix ¶
Resolves a full or prefix session ID to a log path, or an error if missing/ambiguous
Types ¶
type State ¶
type State struct {
ID string
Version int
ProjectPath string
CreatedAt time.Time
UpdatedAt time.Time
Model string
Mode string
// Rendered transcript, in display order
Entries []Entry
// What the user typed, in submission order
InputHistory []string
// Agent conversation, one raw JSON message each
Messages []json.RawMessage
// Whether the log ended with a clean shutdown
Complete bool
}
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Appends a session's records to its log, buffering until armed
func (*Writer) AppendEntry ¶
Queues a transcript line; zero time means now
func (*Writer) AppendMessage ¶
func (w *Writer) AppendMessage(msg json.RawMessage)
Queues an agent message, untimed since it is collected at flush
func (*Writer) AppendReset ¶
func (w *Writer) AppendReset()
Queues a marker that discards earlier agent messages