sessionactivity

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: 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

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

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
	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.

Jump to

Keyboard shortcuts

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