Documentation
¶
Overview ¶
Package sessionactivity resolves per-session tracker activity from the authoritative hook-driven state.json. The legacy FNV snippet-hash detector is gone; State, Activity, and LastKind come from PaneState now.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Evaluate ¶
func Evaluate(observations []Observation) map[string]Result
Evaluate resolves authoritative state for each observation by reading the per-session state.json. Missing/unreadable state files resolve to State="unknown".
func Label ¶ added in v0.2.1
Label maps an Evaluate result state plus tmux liveness to a user-facing status word.
func PrimaryKey ¶
PrimaryKey namespaces a session's primary-pane activity key. Kept for callers that index results by the same legacy key shape.
Types ¶
type Observation ¶
Observation is one tracker-row activity observation. SessionID drives the state.json read.
type Result ¶
type Result struct {
State string
Activity string
LastKind string
LastEvent time.Time
WorkingSince time.Time
}
Result is the renderer-visible activity result for one observation key. State is one of working|blocked|done|idle|starting|stopped|unknown. WorkingSince is non-zero only while State == "working" and timestamps the moment the session entered the working state.
func FromState ¶ added in v0.3.21
func FromState(ss *state.SessionState) Result
FromState resolves the primary-pane activity from an already-loaded SessionState, applying the same normalization as the per-session read.