Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
CodexUsage(ctx context.Context) (*model.CodexUsage, error)
ClaudeUsage(ctx context.Context) (*model.ClaudeUsage, error)
// AntigravityUsage returns the Antigravity (agy) plan quota + agy CLI
// version, read from the local agy language-server RPC.
AntigravityUsage(ctx context.Context) (*model.AntigravityUsage, error)
// KimiUsage returns the Kimi Code plan quota + kimi CLI version, read from
// the kimi usages endpoint with the local kimi CLI's OAuth credentials.
KimiUsage(ctx context.Context) (*model.KimiUsage, error)
// QoderUsage returns the QoderCN credits quota + qoderclicn CLI version,
// read from the openapi quota endpoint with the local CLI's decrypted token.
QoderUsage(ctx context.Context) (*model.QoderUsage, error)
// CursorUsage returns the Cursor plan quota + cursor-agent CLI version,
// read from cursor.com's usage-summary endpoint and the Grok Bot usage RPC
// with the cursor-agent CLI's locally stored login token.
CursorUsage(ctx context.Context) (*model.CursorUsage, error)
// CodeBuddyUsage returns the CodeBuddy CLI version plus the monthly quota
// and current-month spend from the company Token 看板 OpenAPI,
// authenticated with the TAI personal access token the user configured in
// the CodeBuddy agent's ACP env vars (CODEBUDDY_TOKEN_DASHBOARD_PAT).
// Returns a nil snapshot (no error) when the PAT is not configured: the
// quota view is opt-in, so an unconfigured agent simply has no quota view.
CodeBuddyUsage(ctx context.Context) (*model.CodeBuddyUsage, error)
// AgentVersion returns the installed CLI version of a known ACP agent,
// resolved from its serve command. Used by agents that have no quota view.
AgentVersion(ctx context.Context, command string) (string, error)
}
Service fetches current subscription / quota information for supported ACP agents. Each call fetches live data; clients own their short-lived display caches.
func NewService ¶
func NewService(settings config.SettingsService, agentCatalog *catalog.Service) Service
NewService builds the usage service. It depends on settings for effective ACP environments and on the catalog for resolving custom Agent binaries.
Click to show internal directories.
Click to hide internal directories.