codexusage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package codexusage normalizes and renders Codex account rate-limit windows independently of the provider used to obtain them.

Index

Constants

View Source
const (
	CanvasColor    = "#071522FF"
	SurfaceColor   = "#171A21FF"
	BorderColor    = "#2B3940FF"
	TextColor      = "#EAF4F2FF"
	SecondaryColor = "#9AAFB2FF"
	SignatureColor = "#2AC7B5FF"
	WarningColor   = "#F2B84BFF"
	DangerColor    = "#FF786FFF"
)

Variables

This section is empty.

Functions

func BackWindowLabel

func BackWindowLabel(duration time.Duration) string

func FrontWindowLabel

func FrontWindowLabel(duration time.Duration) string

func Scene

func Scene(snapshot Snapshot, focus Window, config PresentationConfig, signal Signal, assetPath string) protocol.Scene

func SummaryKey

func SummaryKey(duration time.Duration) string

Types

type PresentationConfig

type PresentationConfig struct {
	Label                    string
	Badge                    string
	ShowBadge                bool
	WarningRemainingPercent  int
	CriticalRemainingPercent int
}

type RawWindow

type RawWindow struct {
	UsedPercent int
	Duration    time.Duration
	ResetsAt    time.Time
}

type Signal

type Signal uint8
const (
	SignalNone Signal = iota
	SignalLow
	SignalCritical
)

func SignalFor

func SignalFor(snapshot Snapshot, config PresentationConfig) Signal

type Snapshot

type Snapshot struct {
	Windows   []Window
	UpdatedAt time.Time
}

func NormalizeWindows

func NormalizeWindows(raw []RawWindow, now time.Time) (Snapshot, error)

type Window

type Window struct {
	UsedPercent      int
	RemainingPercent int
	Duration         time.Duration
	ResetsAt         time.Time
}

func MostConstrained

func MostConstrained(snapshot Snapshot) Window

Jump to

Keyboard shortcuts

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