types

package
v0.0.0-...-d0a5301 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextUsage

type ContextUsage struct {
	InputTokens              float64 `json:"input_tokens"`
	OutputTokens             float64 `json:"output_tokens"`
	CacheCreationInputTokens float64 `json:"cache_creation_input_tokens"`
	CacheReadInputTokens     float64 `json:"cache_read_input_tokens"`
}

ContextUsage wraps the context usage which can be a number or a JSON object.

func (*ContextUsage) UnmarshalJSON

func (c *ContextUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling for ContextUsage, which can be either a plain number or a JSON object.

type ContextWindowInfo

type ContextWindowInfo struct {
	ContextWindowSize   *float64      `json:"context_window_size,omitempty"`
	TotalInputTokens    *float64      `json:"total_input_tokens,omitempty"`
	TotalOutputTokens   *float64      `json:"total_output_tokens,omitempty"`
	CurrentUsage        *ContextUsage `json:"current_usage,omitempty"`
	UsedPercentage      *float64      `json:"used_percentage,omitempty"`
	RemainingPercentage *float64      `json:"remaining_percentage,omitempty"`
}

type CostInfo

type CostInfo struct {
	TotalCostUSD       *float64 `json:"total_cost_usd,omitempty"`
	TotalDurationMS    *float64 `json:"total_duration_ms,omitempty"`
	TotalAPIDurationMS *float64 `json:"total_api_duration_ms,omitempty"`
	TotalLinesAdded    *float64 `json:"total_lines_added,omitempty"`
	TotalLinesRemoved  *float64 `json:"total_lines_removed,omitempty"`
}

type EffortInfo

type EffortInfo struct {
	Level string `json:"level"`
}

type GeneralConfig

type GeneralConfig struct {
	ColorLevel  int    `toml:"color_level" json:"color_level"`
	GitCacheTTL int    `toml:"git_cache_ttl" json:"git_cache_ttl"`
	Separator   string `toml:"separator" json:"separator"`
	Padding     string `toml:"padding" json:"padding"`
	Minimalist  bool   `toml:"minimalist" json:"minimalist"`
}

GeneralConfig defines general statusline behavior.

type ModelInfo

type ModelInfo struct {
	ID          string `json:"id"`
	DisplayName string `json:"display_name"`
}

ModelInfo wraps the model string or object representation.

func (*ModelInfo) UnmarshalJSON

func (m *ModelInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling for ModelInfo, which can be either a plain string or a JSON object.

type OutputStyleInfo

type OutputStyleInfo struct {
	Name string `json:"name"`
}

type PowerlineConfig

type PowerlineConfig struct {
	Enabled   bool   `toml:"enabled" json:"enabled"`
	Theme     string `toml:"theme" json:"theme"`
	Separator string `toml:"separator" json:"separator"`
	StartCaps string `toml:"start_caps" json:"start_caps"`
	EndCaps   string `toml:"end_caps" json:"end_caps"`
}

PowerlineConfig defines Powerline styling and separator options.

type QuotaInfo

type QuotaInfo struct {
	RemainingFraction *float64 `json:"remaining_fraction,omitempty"`
	ResetTime         string   `json:"reset_time,omitempty"`
	ResetInSeconds    *float64 `json:"reset_in_seconds,omitempty"`
}

type RateLimitPeriod

type RateLimitPeriod struct {
	UsedPercentage *float64 `json:"used_percentage,omitempty"`
	ResetsAt       *float64 `json:"resets_at,omitempty"`
}

type RateLimitsInfo

type RateLimitsInfo struct {
	FiveHour       *RateLimitPeriod `json:"five_hour,omitempty"`
	SevenDay       *RateLimitPeriod `json:"seven_day,omitempty"`
	SevenDaySonnet *RateLimitPeriod `json:"seven_day_sonnet,omitempty"`
	SevenDayOpus   *RateLimitPeriod `json:"seven_day_opus,omitempty"`
}

type RenderContext

type RenderContext struct {
	Data               StatusJSON
	TerminalWidth      *int
	IsPreview          bool
	Minimalist         bool
	GitCacheTTLSeconds int
}

RenderContext holds telemetry data and system metrics needed during render pass.

func (RenderContext) GetCwd

func (r RenderContext) GetCwd() string

func (RenderContext) GetWorkspaceCurrentDir

func (r RenderContext) GetWorkspaceCurrentDir() string

func (RenderContext) GetWorkspaceProjectDir

func (r RenderContext) GetWorkspaceProjectDir() string

type SandboxInfo

type SandboxInfo struct {
	Enabled *bool `json:"enabled,omitempty"`
}

type Settings

type Settings struct {
	Lines     [][]WidgetItem  `toml:"lines" json:"lines"`
	Powerline PowerlineConfig `toml:"powerline" json:"powerline"`
	General   GeneralConfig   `toml:"general" json:"general"`
}

Settings represents the complete agystatusline TOML configuration.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the modern default configuration.

type StatusJSON

type StatusJSON struct {
	HookEventName  string               `json:"hook_event_name"`
	SessionID      string               `json:"session_id"`
	TranscriptPath string               `json:"transcript_path"`
	CWD            string               `json:"cwd"`
	Model          ModelInfo            `json:"model"`
	Workspace      *WorkspaceInfo       `json:"workspace,omitempty"`
	Version        string               `json:"version"`
	OutputStyle    *OutputStyleInfo     `json:"output_style,omitempty"`
	Effort         *EffortInfo          `json:"effort,omitempty"`
	Cost           *CostInfo            `json:"cost,omitempty"`
	ContextWindow  *ContextWindowInfo   `json:"context_window,omitempty"`
	Vim            *VimInfo             `json:"vim,omitempty"`
	Worktree       *WorktreeInfo        `json:"worktree,omitempty"`
	RateLimits     *RateLimitsInfo      `json:"rate_limits,omitempty"`
	Quota          map[string]QuotaInfo `json:"quota,omitempty"`
	Sandbox        *SandboxInfo         `json:"sandbox,omitempty"`
	TerminalWidth  *int                 `json:"terminal_width,omitempty"`
	AgentState     string               `json:"agent_state,omitempty"`
	ArtifactCount  *int                 `json:"artifact_count,omitempty"`
	Subagents      any                  `json:"subagents,omitempty"`
	TaskCount      *int                 `json:"task_count,omitempty"`
	VCS            *VCSInfo             `json:"vcs,omitempty"`
}

StatusJSON defines the schema for telemetry input streamed on stdin.

type VCSInfo

type VCSInfo struct {
	Type   string `json:"type,omitempty"`
	Branch string `json:"branch,omitempty"`
	Dirty  *bool  `json:"dirty,omitempty"`
}

type VimInfo

type VimInfo struct {
	Mode string `json:"mode"`
}

type WidgetItem

type WidgetItem struct {
	Type   string `toml:"type" json:"type"`
	Key    string `toml:"key,omitempty" json:"key,omitempty"`
	Text   string `toml:"text,omitempty" json:"text,omitempty"`
	Symbol string `toml:"symbol,omitempty" json:"symbol,omitempty"`
	Color  string `toml:"color,omitempty" json:"color,omitempty"`
	Raw    bool   `toml:"raw,omitempty" json:"raw,omitempty"`
}

WidgetItem configures a single widget in the statusline. It supports plain string representations ("model"), shorthand strings ("quota:gemini-5h", "custom-text:PROD", "git-branch: "), and inline tables.

func (WidgetItem) MarshalTOML

func (w WidgetItem) MarshalTOML() (any, error)

MarshalTOML implements custom TOML marshaling for WidgetItem.

func (*WidgetItem) UnmarshalTOML

func (w *WidgetItem) UnmarshalTOML(data any) error

UnmarshalTOML implements custom TOML unmarshaling for WidgetItem.

func (*WidgetItem) UnmarshalText

func (w *WidgetItem) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler for WidgetItem, allowing go-toml/v2 and standard encoders to parse string representations.

type WorkspaceInfo

type WorkspaceInfo struct {
	CurrentDir string `json:"current_dir"`
	ProjectDir string `json:"project_dir"`
}

type WorktreeInfo

type WorktreeInfo struct {
	Name           string `json:"name"`
	Path           string `json:"path"`
	Branch         string `json:"branch"`
	OriginalCwd    string `json:"original_cwd"`
	OriginalBranch string `json:"original_branch"`
}

Jump to

Keyboard shortcuts

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