Documentation
¶
Overview ¶
Package output implements the versioned JSON envelope and error taxonomy.
Contract: stdout carries exactly one JSON document per invocation when --json is set. Diagnostics go to stderr only.
Index ¶
Constants ¶
View Source
const ( ExecNone = "not_submitted" ExecUnknown = "unknown" ExecRejected = "rejected" ExecSubmitted = "submitted" )
Execution states reported for mutating commands.
View Source
const SchemaVersion = "oku.cli/v1"
SchemaVersion identifies the stdout JSON contract.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Code ¶
type Code string
Code is a stable, documented error code.
const ( CodeUsage Code = "USAGE" CodeInvalidArgument Code = "INVALID_ARGUMENT" CodeInvalidDecimal Code = "INVALID_DECIMAL" CodeNetworkMismatch Code = "NETWORK_MISMATCH" CodeNetworkUnsupported Code = "NETWORK_UNSUPPORTED" CodeAccountRequired Code = "ACCOUNT_REQUIRED" CodeProfileNotFound Code = "PROFILE_NOT_FOUND" CodeConfigError Code = "CONFIG_ERROR" CodeAuthRequired Code = "AUTH_REQUIRED" CodeKeychainLocked Code = "KEYCHAIN_LOCKED" CodeKeychainAccessDenied Code = "KEYCHAIN_ACCESS_DENIED" CodeKeychainCanceled Code = "KEYCHAIN_CANCELED" CodeSignerRejected Code = "SIGNER_REJECTED" CodeApprovalRequired Code = "APPROVAL_REQUIRED" CodePayloadMismatch Code = "PAYLOAD_MISMATCH" CodeUpstream Code = "UPSTREAM_ERROR" CodeUpstreamTimeout Code = "UPSTREAM_TIMEOUT" CodeRateLimited Code = "RATE_LIMITED" CodeNotFound Code = "NOT_FOUND" CodeOutcomeUnknown Code = "OUTCOME_UNKNOWN" CodeInsufficientGas Code = "INSUFFICIENT_GAS" CodeInsufficientBalance Code = "INSUFFICIENT_BALANCE" CodeIntentConflict Code = "INTENT_CONFLICT" CodeIntentState Code = "INTENT_STATE" CodeRejected Code = "REJECTED" CodeConflict Code = "FILE_EXISTS" CodeInternal Code = "INTERNAL" )
type Envelope ¶
type Envelope struct {
SchemaVersion string `json:"schema_version"`
RequestID string `json:"request_id"`
Command string `json:"command"`
OK bool `json:"ok"`
Data any `json:"data"`
Error *Error `json:"error"`
}
Envelope is the stdout JSON document.
type Error ¶
type Error struct {
Code Code `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
ExecutionState string `json:"execution_state,omitempty"`
Details map[string]any `json:"details,omitempty"`
// contains filtered or unexported fields
}
Error is a structured CLI error.
func (*Error) WithDetail ¶
WithDetail adds a detail field.
Click to show internal directories.
Click to hide internal directories.