agent

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package agent holds the provider-neutral data types that describe a coding agent's local footprint in a repo: its sessions, usage rollup, the files it touched, and content-search hits. Both the claude and codex readers produce these, so the TUI renders either the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepoUsage

type RepoUsage struct {
	Name     string
	Path     string
	Sessions int
	Turns    int
	Tokens   int
	Last     time.Time
}

RepoUsage is one repo's agent footprint.

type Session

type Session struct {
	ID        string
	Modified  time.Time
	Model     string
	Assistant int    // count of assistant turns
	Title     string // the session's title, or a fallback derived from the first prompt
	Tokens    int    // total tokens across the session
}

Session is a single agent session/transcript.

func (Session) DisplayTitle

func (s Session) DisplayTitle() string

DisplayTitle is a human label for the session: its title, else a short id.

type SessionHit

type SessionHit struct {
	RepoName string
	RepoPath string
	ID       string
	Title    string
	Snippet  string // cleaned text around the first match
	Modified time.Time
}

SessionHit is a session whose content matched a search query.

func (SessionHit) DisplayTitle

func (h SessionHit) DisplayTitle() string

DisplayTitle is a human label for the hit: its title, else a short session id.

type Target

type Target struct {
	Name string
	Path string
}

Target identifies a repo for aggregation.

type TouchedFile

type TouchedFile struct {
	Path   string // relative to the repo root
	Reads  int
	Writes int
	Last   time.Time
}

TouchedFile is one file an agent read or edited inside a repo, with how many times and when it was last touched.

func (TouchedFile) Touches

func (t TouchedFile) Touches() int

Touches is the total number of read/edit operations against the file.

func (TouchedFile) Wrote

func (t TouchedFile) Wrote() bool

Wrote reports whether the agent edited (not just read) the file.

type Usage

type Usage struct {
	TotalSessions int
	TotalTurns    int
	TotalTokens   int
	ReposUsed     int
	Models        map[string]int // pretty model -> assistant turns
	Repos         []RepoUsage    // sorted by turns desc
	Last          time.Time
}

Usage is the global agent rollup across repos.

Jump to

Keyboard shortcuts

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