tracker

package
v0.3.49 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionTypeForManifest

func SessionTypeForManifest(m state.Manifest) string

SessionTypeForManifest normalizes persisted manifest metadata into the tracker session-type vocabulary.

func StableSessionOrderKey

func StableSessionOrderKey(manifest state.Manifest) string

StableSessionOrderKey returns the newest-first sort key used by tracker rows.

Types

type CurrentSessionDetail

type CurrentSessionDetail struct {
	Title       string
	SessionType string
}

CurrentSessionDetail carries the current session metadata needed by the tracker header.

type SessionFetcher

type SessionFetcher func(current SessionInfo) (TrackerSnapshot, error)

SessionFetcher loads all session data for the tracker.

func NewLiveSessionFetcher

func NewLiveSessionFetcher(tmuxClient *tmux.Client, store *state.Store) SessionFetcher

NewLiveSessionFetcher creates a SessionFetcher backed by shared services. The repo-resolution cache and repo-color store are created once and captured by the returned closure so they persist across refresh ticks (a session's cwd does not change repos within a run, and repo colors only change on a C).

type SessionInfo

type SessionInfo struct {
	ID          string
	Title       string
	Cwd         string
	SessionType string
	Manifest    state.Manifest
	Registry    *agent.Registry
}

SessionInfo holds resolved session metadata.

type SessionRow

type SessionRow struct {
	ID           string
	Title        string
	Cwd          string
	PrimaryAgent string
	Status       string // "active" or "stopped"
	SessionType  string // "master", "worker", or "standalone"
	ParentID     string
	WorkerCount  int
	DisplayColor string // effective (last-write-wins) gutter color
	Snippet      string

	// Repo grouping. RepoIdentity is the canonical parent-repo key (shared by
	// all worktrees of a repo); "" means the cwd is not in a git repo and the
	// row lands in the trailing ungrouped section. RepoColor is the repo's own
	// persisted color (drives the section header), independent of any session
	// override folded into DisplayColor.
	RepoIdentity string
	RepoName     string
	RepoColor    string
	State        string // working|blocked|done|idle|starting|stopped|unknown
	LastKind     string // last hook event kind (drives streaming-prose suffix)
	WorkingSince time.Time
	IsCurrent    bool
}

SessionRow is the display-ready session data for the tracker.

State / LastKind come from the per-session state.json that hooks write.

func GroupRowsByRepo

func GroupRowsByRepo(rows []SessionRow) []SessionRow

GroupRowsByRepo regroups already-tree-ordered rows into repo sections: alphabetical by repo name with the ungrouped section (cwd not in a repo) last, while preserving each section's existing within-section order. A master and its nested workers move together as one unit, so a tree is never split across sections; the unit's section is the top-level row's repo, and that repo is propagated onto its workers so they group and recolor under their master.

func ManifestToSessionRow

func ManifestToSessionRow(id string, m state.Manifest, alive bool) SessionRow

ManifestToSessionRow converts manifest data plus liveness into a tracker row.

func OrderSessionRows

func OrderSessionRows(rows []SessionRow) []SessionRow

OrderSessionRows nests workers after their masters while preserving the newest-first order inside each level.

type TrackerSnapshot

type TrackerSnapshot struct {
	Sessions   []SessionRow
	Current    CurrentSessionDetail
	ObservedAt time.Time
}

TrackerSnapshot is the full rendered data set for one refresh tick.

Jump to

Keyboard shortcuts

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