status

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package status reads and writes live agent session status files.

Status files are JSON documents stored under ~/.ttal/status/ with a team-prefixed filename ({team}-{agent}.json). Each file captures context usage percentage, model ID, session ID, and a timestamp so that the manager plane and CLI commands can display current agent health at a glance.

Plane: shared

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusDir

func StatusDir() string

StatusDir returns the consolidated status directory (~/.ttal/status/).

func WriteAgent

func WriteAgent(team string, s AgentStatus) error

WriteAgent atomically writes an agent's status file with team prefix.

Types

type AgentStatus

type AgentStatus struct {
	Agent               string    `json:"agent"`
	ContextUsedPct      float64   `json:"context_used_pct"`
	ContextRemainingPct float64   `json:"context_remaining_pct"`
	ModelID             string    `json:"model_id"`
	ModelName           string    `json:"model_name"`
	SessionID           string    `json:"session_id"`
	CCVersion           string    `json:"cc_version"`
	UpdatedAt           time.Time `json:"updated_at"`
}

AgentStatus represents the live state of an agent's CC session.

func ReadAgent

func ReadAgent(team, name string) (*AgentStatus, error)

ReadAgent reads the status file for a single agent in the given team. Returns nil if no status file exists (agent not running or no data yet).

func ReadAll

func ReadAll(team string) ([]AgentStatus, error)

ReadAll reads status files for all agents in the given team.

func (*AgentStatus) IsStale

func (s *AgentStatus) IsStale(threshold time.Duration) bool

IsStale returns true if the status hasn't been updated in the given duration.

Jump to

Keyboard shortcuts

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