telemetry

package
v1.260625.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 17 Imported by: 0 modules, 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

Index

Constants

View Source
const (
	DefaultEndpoint = "https://rork.com/cf-api/asc/v1/events"
)

Variables

This section is empty.

Functions

func Emit

func Emit(commandName, version string, duration time.Duration, exitCode int)

func EnsureInstallID

func EnsureInstallID() (string, error)

func RedactedSummary

func RedactedSummary(ev Event) map[string]string

func ResetInstallID

func ResetInstallID() (string, error)

func SetEnabled

func SetEnabled(enabled bool) error

func StatePath

func StatePath() (string, error)

Types

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"`
}

func BuildEvent

func BuildEvent(commandName, version string, duration time.Duration, exitCode int) (Event, bool)

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 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

type State

type State struct {
	InstallID string `json:"install_id,omitempty"`
	Disabled  bool   `json:"disabled,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

type Status

type Status struct {
	Path      string `json:"path"`
	Enabled   bool   `json:"enabled"`
	InstallID string `json:"install_id,omitempty"`
	Reason    string `json:"reason,omitempty"`
	Endpoint  string `json:"endpoint,omitempty"`
}

func ReadStatus

func ReadStatus() (Status, error)

Jump to

Keyboard shortcuts

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