Documentation
¶
Index ¶
- Constants
- func Emit(commandName, version string, duration time.Duration, exitCode int)
- func EmitWithContext(commandName, version string, duration time.Duration, exitCode int, ...)
- func EnsureInstallID() (string, error)
- func RedactedSummary(ev Event) map[string]string
- func ResetInstallID() (string, error)
- func RunMaintenanceWorkerIfRequested(args []string) bool
- func SetEnabled(enabled bool) error
- func StatePath() (string, error)
- type ErrorKind
- type Event
- type EventContext
- type FailureStage
- type InvocationShape
- type InvocationSource
- type OutcomeKind
- type RuntimeContext
- type State
- type Status
Constants ¶
View Source
const (
DefaultEndpoint = "https://rork.com/cf-api/asc/v1/events"
)
Variables ¶
This section is empty.
Functions ¶
func EmitWithContext ¶ added in v1.260628.0
func EmitWithContext( commandName, version string, duration time.Duration, exitCode int, eventContext EventContext, )
func EnsureInstallID ¶
func RedactedSummary ¶
func ResetInstallID ¶
func RunMaintenanceWorkerIfRequested ¶ added in v1.260713.0
func SetEnabled ¶
Types ¶
type ErrorKind ¶ added in v1.260628.0
type ErrorKind string
const ( ErrorKindUnknownFlag ErrorKind = "unknown_flag" ErrorKindMissingRequired ErrorKind = "missing_required" ErrorKindInvalidValue ErrorKind = "invalid_value" ErrorKindBareGroup ErrorKind = "bare_group" ErrorKindAPIConflict ErrorKind = "api_conflict" ErrorKindAPI5xx ErrorKind = "api_5xx" ErrorKindOther ErrorKind = "other" )
type Event ¶
type Event struct {
EventID string `json:"event_id"`
SchemaVersion uint8 `json:"schema_version"`
ASCVersion string `json:"asc_version"`
OS string `json:"os"`
Arch string `json:"arch"`
CommandPath string `json:"command_path"`
CommandFamily string `json:"command_family"`
DurationMS uint32 `json:"duration_ms"`
DurationBucket string `json:"duration_bucket"`
ExitCode int `json:"exit_code"`
Success bool `json:"success"`
RuntimeContext RuntimeContext `json:"runtime_context"`
InvocationSource InvocationSource `json:"invocation_source"`
InstallID *string `json:"install_id"`
SessionID string `json:"session_id"`
InvocationShape InvocationShape `json:"invocation_shape"`
ErrorKind *ErrorKind `json:"error_kind"`
FailureStage *FailureStage `json:"failure_stage"`
FailureParameter *string `json:"failure_parameter"`
OutcomeKind OutcomeKind `json:"outcome_kind,omitempty"`
HTTPStatus *int `json:"http_status,omitempty"`
}
func BuildEvent ¶
func BuildEventWithContext ¶ added in v1.260628.0
func (Event) MarshalJSON ¶ added in v1.260713.0
MarshalJSON keeps queued schema-v3 records wire-compatible while ensuring nullable schema-v4 fields are present even when their value is null.
type EventContext ¶ added in v1.260628.0
type EventContext struct {
InvocationShape InvocationShape
ErrorKind ErrorKind
FailureStage FailureStage
FailureParameter string
OutcomeKind OutcomeKind
HTTPStatus int
}
type FailureStage ¶ added in v1.260628.0
type FailureStage string
const ( FailureStageParse FailureStage = "parse" FailureStageValidation FailureStage = "validation" FailureStageRequest FailureStage = "request" FailureStageExecution FailureStage = "execution" )
type InvocationShape ¶ added in v1.260628.0
type InvocationShape string
const ( InvocationShapeLeaf InvocationShape = "leaf" InvocationShapeBareGroup InvocationShape = "bare_group" InvocationShapeGroupWithFlags InvocationShape = "group_with_flags" InvocationShapeUnknownChild InvocationShape = "unknown_child" )
type InvocationSource ¶
type InvocationSource string
const ( SourceTerminal InvocationSource = "terminal" SourceClaudeCode InvocationSource = "claude_code" SourceCursorAgent InvocationSource = "cursor_agent" SourceCodexDesktop InvocationSource = "codex_desktop" SourceOpenCode InvocationSource = "opencode" SourcePi InvocationSource = "pi" SourceRorkAgent InvocationSource = "rork_agent" )
func DetectInvocationSource ¶
func DetectInvocationSource() InvocationSource
type OutcomeKind ¶ added in v1.260713.0
type OutcomeKind string
const ( OutcomeSuccess OutcomeKind = "success" OutcomeExpectedNegative OutcomeKind = "expected_negative" OutcomeUsageError OutcomeKind = "usage_error" OutcomeAuthError OutcomeKind = "auth_error" OutcomeNotFound OutcomeKind = "not_found" OutcomeConflict OutcomeKind = "conflict" OutcomeAPIClientError OutcomeKind = "api_client_error" OutcomeAPIServerError OutcomeKind = "api_server_error" OutcomeTransportError OutcomeKind = "transport_error" OutcomeCancelled OutcomeKind = "cancelled" OutcomeInternalError OutcomeKind = "internal_error" )
type RuntimeContext ¶
type RuntimeContext string
const ( RuntimeLocal RuntimeContext = "local" RuntimeEphemeral RuntimeContext = "ephemeral" RuntimeRorkSandbox RuntimeContext = "rork_sandbox" RuntimeRorkGitHubWorkflow RuntimeContext = "rork_github_workflow" RuntimeCI RuntimeContext = "ci" )
func DetectRuntimeContext ¶
func DetectRuntimeContext() RuntimeContext
Click to show internal directories.
Click to hide internal directories.