Versions in this module Expand all Collapse all v0 v0.12.3 Aug 10, 2026 Changes in this version + var ErrAccessDenied = errors.New("provider authorization denied") + var ErrAccountNotFound = errors.New("provider auth account not found") + var ErrAuthorizationPending = errors.New("provider authorization pending") + var ErrFlowExpired = errors.New("provider auth flow expired") + var ErrFlowNotFound = errors.New("provider auth flow not found") + var ErrInvalidBinding = errors.New("invalid provider auth binding") + var ErrNoCopilotSubscription = errors.New("GitHub account has no Copilot subscription") + var ErrRequiresReauth = errors.New("provider auth account requires reauthentication") + var ErrUnsupportedGHES = errors.New("GitHub Enterprise Server is not supported") + var ErrUnsupportedMethod = errors.New("unsupported provider auth method") + type Account struct + AuthenticatedAt time.Time + ID string + Login string + RequiresReauth bool + type Binding struct + AccountID string + Method Method + type Credential struct + AccountID string + BaseURL string + Headers map[string]string + Protocol Protocol + Token string + type Endpoints struct + CodexDevicePoll string + CodexDeviceStart string + CodexRuntime string + CodexToken string + CodexVerification string + CopilotDeviceStart string + CopilotOAuthToken string + CopilotRuntime string + CopilotToken string + CopilotUsage string + CopilotUser string + XAIDiscovery string + XAIRuntime string + type Flow struct + Account *Account + Error string + ExpiresAt time.Time + ID string + IntervalSeconds int + Method Method + State FlowState + UserCode string + VerificationURI string + VerificationURIComplete string + type FlowState string + const FlowStateAuthorized + const FlowStateDenied + const FlowStateExpired + const FlowStatePending + type Manager struct + func Default(configDir string) (*Manager, error) + func NewManager(options Options) (*Manager, error) + func (manager *Manager) Cancel(method Method, flowID string) error + func (manager *Manager) Credential(ctx context.Context, binding Binding) (Credential, error) + func (manager *Manager) Logout(_ context.Context, method Method) error + func (manager *Manager) Models(ctx context.Context, binding Binding) ([]Model, error) + func (manager *Manager) Poll(ctx context.Context, method Method, flowID string) (Flow, error) + func (manager *Manager) Remove(_ context.Context, method Method, accountID string) error + func (manager *Manager) SetDefault(_ context.Context, method Method, accountID string) error + func (manager *Manager) Start(ctx context.Context, method Method) (Flow, error) + func (manager *Manager) Status(_ context.Context, method Method) (Status, error) + func (manager *Manager) ValidateBinding(_ context.Context, binding Binding) error + type Method string + const MethodCodexOAuth + const MethodGitHubCopilot + const MethodXAIOAuth + type Model struct + ID string + Kind ModelKind + Name string + Protocol Protocol + Vendor string + type ModelKind string + const ModelKindChat + const ModelKindImage + const ModelKindVideo + type Options struct + AllowInsecureTestEndpoints bool + ConfigDir string + Endpoints Endpoints + HTTPClient *http.Client + Now func() time.Time + Rand io.Reader + type Protocol string + const ProtocolChatCompletions + const ProtocolResponses + type Service interface + Cancel func(Method, string) error + Credential func(context.Context, Binding) (Credential, error) + Logout func(context.Context, Method) error + Models func(context.Context, Binding) ([]Model, error) + Poll func(context.Context, Method, string) (Flow, error) + Remove func(context.Context, Method, string) error + SetDefault func(context.Context, Method, string) error + Start func(context.Context, Method) (Flow, error) + Status func(context.Context, Method) (Status, error) + ValidateBinding func(context.Context, Binding) error + type Status struct + Accounts []Account + Authenticated bool + DefaultAccountID string + Method Method