setup

package
v1.5.139 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 6 Imported by: 1 module, 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 setup defines the small operator-only setup event stream. It is not an MCP extension and intentionally has no token, executable or browser socket.

Index

Constants

View Source
const (
	PhasePrepareStore            = "prepare_store"
	PhaseConfigureApplication    = "configure_application"
	PhaseStartAuthorization      = "start_authorization"
	PhaseWaitForAuthorization    = "wait_for_authorization"
	PhaseVerifyAuthorization     = "verify_authorization"
	PhaseComplete                = "complete"
	CodePrepareStoreFailed       = "PREPARE_STORE_FAILED"
	CodeAppConfigFailed          = "APP_CONFIG_FAILED"
	CodeAuthStartFailed          = "AUTH_START_FAILED"
	CodeProjectCLIUnavailable    = "PROJECT_CLI_UNAVAILABLE"
	CodeProjectAuthNetworkFailed = "PROJECT_AUTH_NETWORK_FAILED"
	CodeProjectAuthTLSFailed     = "PROJECT_AUTH_TLS_FAILED"
	CodeAuthResponseUnsupported  = "AUTH_RESPONSE_UNSUPPORTED"
	CodeProjectResponseInvalid   = "PROJECT_AUTH_RESPONSE_INVALID"
	CodeProjectDeviceMissing     = "PROJECT_AUTH_DEVICE_MISSING"
	CodeProjectClientMissing     = "PROJECT_AUTH_CLIENT_MISSING"
	CodeProjectExpiryInvalid     = "PROJECT_AUTH_EXPIRY_INVALID"
	CodeProjectURLMissing        = "PROJECT_AUTH_URL_MISSING"
	CodeProjectUserCodeInvalid   = "PROJECT_AUTH_USER_CODE_INVALID"
	CodeProjectIntervalInvalid   = "PROJECT_AUTH_INTERVAL_INVALID"
	CodeAuthPollFailed           = "AUTH_POLL_FAILED"
	CodeAuthScopesIncomplete     = "AUTH_SCOPES_INCOMPLETE"
	CodeAuthVerifyNetworkFailed  = "AUTH_VERIFY_NETWORK_FAILED"
	CodeAuthVerifyIdentityFailed = "AUTH_VERIFY_IDENTITY_FAILED"
	CodeSetupCancelled           = "SETUP_CANCELLED"
	CodeSetupTimeout             = "SETUP_TIMEOUT"
)
View Source
const MaxLine = 16 << 10
View Source
const Version = 1

Variables

This section is empty.

Functions

func AuthorizationCode added in v1.5.58

func AuthorizationCode(code string) bool

AuthorizationCode accepts only a short operator-facing device user code. It is never a token or a model-facing result.

func AuthorizationURL

func AuthorizationURL(raw string, origins []string) error

AuthorizationURL requires a reviewed exact HTTPS origin. URL text, including a verification code, is only for the operator UI, never a model tool result.

Types

type Event

type Event struct {
	Version         int       `json:"v"`
	Type            string    `json:"type"`
	Service         string    `json:"service,omitempty"`
	Message         string    `json:"message,omitempty"`
	VerificationURL string    `json:"verification_url,omitempty"`
	UserCode        string    `json:"user_code,omitempty"`
	ExpiresAt       time.Time `json:"expires_at,omitempty"`
	Authenticated   bool      `json:"authenticated,omitempty"`
	Phase           string    `json:"phase,omitempty"`
	Code            string    `json:"code,omitempty"`
	Retryable       bool      `json:"retryable,omitempty"`
	MissingScopes   []string  `json:"missing_scopes,omitempty"`
}

func FailureEvent added in v1.5.54

func FailureEvent(phase, code string) (Event, error)

FailureEvent returns one fixed, display-safe failure. The helper and host share this closed vocabulary so neither raw CLI stderr nor authorization values can become operator UI text.

func SanitizeFailure added in v1.5.54

func SanitizeFailure(event Event) (Event, error)

SanitizeFailure validates phase/code and replaces every caller-supplied display field with the canonical message and retry classification.

Jump to

Keyboard shortcuts

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