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 ¶
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" CodeProjectAuthNetworkFailed = "PROJECT_AUTH_NETWORK_FAILED" CodeProjectAuthTLSFailed = "PROJECT_AUTH_TLS_FAILED" CodeAuthResponseUnsupported = "AUTH_RESPONSE_UNSUPPORTED" CodeAuthPollFailed = "AUTH_POLL_FAILED" CodeAuthVerifyNetworkFailed = "AUTH_VERIFY_NETWORK_FAILED" CodeAuthVerifyIdentityFailed = "AUTH_VERIFY_IDENTITY_FAILED" CodeSetupCancelled = "SETUP_CANCELLED" CodeSetupTimeout = "SETUP_TIMEOUT" )
const MaxLine = 16 << 10
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func AuthorizationCode ¶ added in v1.5.58
AuthorizationCode accepts only a short operator-facing device user code. It is never a token or a model-facing result.
func AuthorizationURL ¶
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"`
}
func FailureEvent ¶ added in v1.5.54
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
SanitizeFailure validates phase/code and replaces every caller-supplied display field with the canonical message and retry classification.