Help us shape the future of Go! Take the 2026 Go Developer Survey

recap

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package recap contains the server-backed data types and static renderer behind `trace recap`.

Index

Constants

View Source
const (
	DefaultWidth = 78
	AgentAll     = "all"
)

Variables

This section is empty.

Functions

func RenderStaticRecap

func RenderStaticRecap(resp *MeRecapResponse, opts RenderOptions) string

RenderStaticRecap renders the server-backed static recap view.

Types

type AgentAggregate

type AgentAggregate struct {
	Sessions         int          `json:"sessions"`
	Checkpoints      int          `json:"checkpoints"`
	Tokens           int          `json:"tokens"`
	TranscriptTokens int          `json:"transcriptTokens"`
	FilesChanged     int          `json:"filesChanged"`
	Labels           []LabelCount `json:"labels"`
	Skills           []SkillCount `json:"skills"`
	MCPServers       []McpCount   `json:"mcpServers"`
	ToolMix          ToolMix      `json:"toolMix"`
}

type AgentEntry

type AgentEntry struct {
	AgentID      string          `json:"agentId"`
	AgentLabel   string          `json:"agentLabel"`
	Me           AgentAggregate  `json:"me"`
	Contributors *AgentAggregate `json:"contributors"`
}

type AnalysisStatus

type AnalysisStatus struct {
	Complete int `json:"complete"`
	Pending  int `json:"pending"`
	Failed   int `json:"failed"`
}

type ContribSummary

type ContribSummary struct {
	DistinctUsers    int `json:"distinctUsers"`
	TotalTokens      int `json:"totalTokens"`
	TotalCheckpoints int `json:"totalCheckpoints"`
}

type DailyCount

type DailyCount struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

type LabelCount

type LabelCount struct {
	Label string `json:"label"`
	Count int    `json:"count"`
}

type McpCount

type McpCount struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

type MeRecapResponse

type MeRecapResponse struct {
	Timeframe    string                `json:"timeframe"`
	Repo         *string               `json:"repo"`
	Since        string                `json:"since"`
	Until        string                `json:"until"`
	Agents       map[string]AgentEntry `json:"agents"`
	Summary      Summary               `json:"summary"`
	Contributors *ContribSummary       `json:"contributors"`
	Daily        []DailyCount          `json:"daily"`
	UpdatedAt    string                `json:"updated_at"`
}

MeRecapResponse mirrors GET /api/v1/me/recap.

func FetchMeRecap

func FetchMeRecap(
	ctx context.Context,
	client *api.Client,
	since, until time.Time,
	repo string,
	limit int,
) (*MeRecapResponse, error)

FetchMeRecap fetches one server-backed recap window.

type RangeKey

type RangeKey string

RangeKey names the static recap windows supported by `trace recap`.

const (
	RangeDay   RangeKey = "day"
	RangeWeek  RangeKey = "week"
	RangeMonth RangeKey = "month"
	Range90d   RangeKey = "90d"
)

func (RangeKey) Bounds

func (r RangeKey) Bounds(now time.Time) (time.Time, time.Time)

Bounds returns a half-open [start, end) window in the user's local time.

func (RangeKey) Title

func (r RangeKey) Title() string

Title returns the panel title for a range.

type RenderOptions

type RenderOptions struct {
	Range RangeKey
	View  ViewMode
	Agent string
	Width int
	Color bool
}

type SkillCount

type SkillCount struct {
	Skill string `json:"skill"`
	Count int    `json:"count"`
}

type Summary

type Summary struct {
	Me         SummaryTotals  `json:"me"`
	Team       *SummaryTotals `json:"team"`
	RepoCount  int            `json:"repoCount"`
	ActiveDays int            `json:"activeDays"`
	Analysis   AnalysisStatus `json:"analysis"`
}

Summary contains top-level counts intended for CLI rendering.

type SummaryTotals

type SummaryTotals struct {
	Sessions    int `json:"sessions"`
	Checkpoints int `json:"checkpoints"`
	Tokens      int `json:"tokens"`
}

type ToolMix

type ToolMix struct {
	Shell   int `json:"shell"`
	FileOps int `json:"fileOps"`
	Search  int `json:"search"`
	MCP     int `json:"mcp"`
	Agent   int `json:"agent"`
	Other   int `json:"other"`
}

type ViewMode

type ViewMode string

ViewMode selects which columns render in the static agents panel.

const (
	ViewYou  ViewMode = "you"
	ViewTeam ViewMode = "team"
	ViewBoth ViewMode = "both"
)

func (ViewMode) Valid

func (m ViewMode) Valid() bool

Valid reports whether the mode is one of the supported static modes.

Jump to

Keyboard shortcuts

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