monitor

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package monitor provides a shared session enrichment layer that both the TUI and web dashboard consume. It eliminates data drift by centralizing the session discovery, classification, session-index loading, transcript reading, and git metadata enrichment into a single Snapshot function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadLastMeaningfulLine

func ReadLastMeaningfulLine(path string) string

ReadLastMeaningfulLine reads the tail of a transcript JSONL and extracts the last human-readable content. It looks for assistant text or user messages, skipping tool outputs, base64 data, and system events.

Types

type Session

type Session struct {
	ID             string
	PID            int
	CWD            string
	State          string // "busy", "waiting", "idle", "dead"
	Project        string
	StartedAt      time.Time
	WorkingOn      string // from session index summary
	LastLine       string // last meaningful transcript line
	TranscriptPath string
	GitBranch      string
	GitDirty       bool
	MessageCount   int // from session index
}

Session is the fully-enriched session type that both TUI and web consume. It is a flat struct (no embedding) to avoid coupling with discovery.Session.

func Snapshot

func Snapshot(sessionsDir, projectsDir string) []Session

Snapshot returns a fully-enriched session list by combining data from session files, session-index.json, transcripts, and git metadata. Both TUI and web should call this instead of doing their own enrichment.

The function is synchronous; the consumer drives the refresh cadence.

Jump to

Keyboard shortcuts

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