history

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(taskName string, ev Event) error

func AppendLocked

func AppendLocked(taskName string, ev Event) error

AppendLocked appends an event to history.jsonl. The caller must hold the task lock.

func NewRunID

func NewRunID() (string, error)

func WriteAll

func WriteAll(taskName string, events []Event) error

func WriteAllLocked added in v0.2.0

func WriteAllLocked(taskName string, events []Event) error

WriteAllLocked rewrites history.jsonl atomically. The caller must hold the task lock.

Types

type Event

type Event struct {
	TS      time.Time       `json:"ts"`
	Type    string          `json:"type"`
	Role    string          `json:"role,omitempty"`
	Content string          `json:"content,omitempty"`
	Data    json.RawMessage `json:"data,omitempty"`
}

func Read

func Read(taskName string, opts ReadOptions) ([]Event, error)

type ReadOptions

type ReadOptions struct {
	Since          time.Time
	MessagesOnly   bool
	EventsOnly     bool
	MaxEvents      int
	IncludeInvalid bool
}

type TailInfo

type TailInfo struct {
	LastTS                 time.Time
	TaskStatus             task.TaskStatus
	Stage                  string
	LastMergedCommit       string
	LastMergedMethod       string
	LastMergedBaseCommit   string
	LastMergedBranchHead   string
	LastMergedLinesAdded   int
	LastMergedLinesRemoved int
	LastMergedFrozenError  string
	LastClosedLinesAdded   int
	LastClosedLinesRemoved int
	LastClosedFrozenError  string
	BaseBranch             string
	BaseCommit             string

	LastRunDurationMS int
	LastRunToolCalls  int
	LastRunOutcome    string

	RunningSince time.Time
	RunningRunID string
}

func Tail

func Tail(taskName string) (TailInfo, error)

func TailPath

func TailPath(path string) (TailInfo, error)

Jump to

Keyboard shortcuts

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