session

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package session records what each agent session is currently doing.

This is scratch state, stored per working tree and never committed: it changes every few minutes and would swamp the history of a repository whose whole point is readable diffs. The consequence, stated plainly, is that a teammate on their own clone cannot see your session — there is no sync channel for it, by design.

Index

Constants

View Source
const StaleAfter = 20 * time.Minute

StaleAfter is how long a session may go without a checkpoint before the board dims it. Sessions are never deleted automatically: a crashed session's last known focus is useful information, not garbage.

Variables

This section is empty.

Functions

func DefaultID

func DefaultID() string

DefaultID prefers an identifier supplied by the harness, falling back to something stable for the shell so repeated calls update one record rather than littering the directory.

func Path

func Path(s *ticket.Store, id string) string

Path is where a session's state lives.

func Remove

func Remove(s *ticket.Store, id string) error

Remove deletes a session record.

func Save

func Save(s *ticket.Store, sess Session) error

Save writes a session record.

Types

type Session

type Session struct {
	ID        string `json:"id"`
	TicketID  string `json:"ticket_id,omitempty"`
	Focus     string `json:"focus"`
	Reasoning string `json:"reasoning,omitempty"`
	Model     string `json:"model,omitempty"`
	Host      string `json:"host,omitempty"`
	PID       int    `json:"pid,omitempty"`
	UpdatedAt string `json:"updated_at"`
}

Session is one agent session's current focus.

func Load

func Load(s *ticket.Store) ([]Session, error)

Load reads every session file for this working tree.

func Read

func Read(s *ticket.Store, id string) Session

Read loads one session, returning a zero value when absent.

func (Session) Age

func (s Session) Age() time.Duration

Age is how long since the last checkpoint.

func (Session) Stale

func (s Session) Stale() bool

Stale reports whether a session has gone quiet.

Jump to

Keyboard shortcuts

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