sessionactivity

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 2 Imported by: 0

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

View Source
const StaleThreshold = 60 * time.Second

StaleThreshold is how long a working/blocked session may go without a hook event before the tracker downgrades it to "unknown".

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(now time.Time, 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

func Label(state string, alive bool) string

Label maps an Evaluate result state plus tmux liveness to a user-facing status word.

func PrimaryKey

func PrimaryKey(sessionID string) string

PrimaryKey namespaces a session's primary-pane activity key. Kept for callers that index results by the same legacy key shape.

Types

type Observation

type Observation struct {
	Key       string
	SessionID string
	Enabled   bool
}

Observation is one tracker-row activity observation. SessionID drives the state.json read.

type Result

type Result struct {
	State     string
	Activity  string
	LastKind  string
	Stale     bool
	LastEvent time.Time
}

Result is the renderer-visible activity result for one observation key. State is one of working|blocked|done|idle|starting|stopped|unknown.

Jump to

Keyboard shortcuts

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