agent

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	PID            int
	SessionID      string
	Name           string // project name, derived from WorkingDir
	ProviderName   string // "claude", "codex", "gemini"
	SessionFile    string // path to conversation log
	Model          string // e.g. "claude-opus-4-6[1m]"
	PermissionMode string
	WorkingDir     string
	Source         SourceType
	StartTime      time.Time
	Status         Status
	TMuxSession    string
	MemoryMB       uint64
	GitBranch      string
	TokensIn       int64
	TokensOut      int64
	EstCostUSD     float64
	TeamName       string
	TaskID         string
	TaskSubject    string
	LastActivity   time.Time
	GroupCount     int           // number of processes grouped into this entry (0 or 1 = single)
	GroupPIDs      []int         // PIDs of grouped processes (for drill-down)
	LastAction     string        // most recent tool call, e.g. "Ed main.go", "Sh go test"
	ParentPID      int           // process tree parent (0 = top-level)
	Subagent       subagent.Info // from OTEL correlation
}

Agent represents a running AI coding agent session.

func (Agent) AgeTime added in v0.3.0

func (a Agent) AgeTime() time.Time

AgeTime returns the effective time used for age calculation: StartTime if available, otherwise LastActivity. Returns the zero time if neither is set.

func (Agent) FormatAge

func (a Agent) FormatAge() string

FormatAge returns a human-friendly age string based on StartTime or LastActivity.

func (Agent) FormatCost

func (a Agent) FormatCost() string

FormatCost returns the estimated cost formatted as a dollar amount.

Examples:

0.82  -> "$0.82"
12.5  -> "$12.50"
0     -> "$0.00"

func (Agent) FormatMemory

func (a Agent) FormatMemory() string

FormatMemory returns a human-friendly memory string.

Examples:

405  -> "405M"
1400 -> "1.4G"
0    -> "0M"

func (Agent) Icon

func (a Agent) Icon() string

Icon returns the status icon for this agent.

func (Agent) IsSubagent added in v0.5.0

func (a Agent) IsSubagent() bool

IsSubagent returns true if this agent is nested under another agent.

func (Agent) ShortDir

func (a Agent) ShortDir() string

ShortDir returns the parent directory name — the directory containing the project. This disambiguates agents with the same project name in different locations. The full path is available in the preview pane.

Examples:

"/Users/me/go/src/github.com/zanetworker/aimux" -> "zanetworker"
"/Users/me/projects/myapp"                          -> "projects"
"/tmp/test"                                         -> "tmp"

func (Agent) ShortModel

func (a Agent) ShortModel() string

ShortModel returns a human-friendly shortened model name.

Examples:

"claude-opus-4-6[1m]"           -> "opus-4.6"
"claude-sonnet-4-5@20250929"    -> "sonnet-4.5"
"claude-haiku-3-5"              -> "haiku-3.5"

func (Agent) ShortProject

func (a Agent) ShortProject() string

ShortProject returns the last path segment of WorkingDir.

type SourceType

type SourceType int

SourceType represents how an agent was launched.

const (
	SourceCLI    SourceType = iota // launched from CLI
	SourceVSCode                   // launched from VS Code extension
	SourceSDK                      // launched from SDK
)

func (SourceType) String

func (s SourceType) String() string

type Status

type Status int

Status represents the current state of an agent.

const (
	StatusActive            Status = iota // actively processing
	StatusIdle                            // idle, waiting for input
	StatusWaitingPermission               // blocked on permission prompt
	StatusUnknown                         // status could not be determined
)

func (Status) Icon

func (s Status) Icon() string

Icon returns a single-character icon representing the status.

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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