file

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements store.Store using JSONL files with atomic rename for concurrency safety.

func New

func New(baseDir string, adapter string) (*Store, error)

New creates a new file-based store rooted at baseDir.

func (*Store) BaseDir

func (s *Store) BaseDir() string

BaseDir returns the base directory of the store.

func (*Store) Close

func (s *Store) Close() error

Close is a no-op for file store.

func (*Store) Drain

func (s *Store) Drain(sessionID string, maxLines int) ([]store.LogMessage, error)

Drain atomically reads and consumes pending messages for a session. Returns at most maxLines messages. Any remaining messages are written back to the pending file so they are not lost.

func (*Store) Status

func (s *Store) Status() (map[string]int, error)

Status returns pending message counts per session. It scans baseDir/<session>/<adapter>/pending.jsonl for the store's adapter.

func (*Store) Write

func (s *Store) Write(sessionID string, msg store.LogMessage) error

Write appends a log message to pending JSONL files for all registered adapters. This fans out the message so every adapter (e.g., Claude Code, Codex) that has registered for this session can independently drain its own copy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL