useragent

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonString

func DaemonString() string

DaemonString returns the User-Agent for daemon requests. Format: "ox-daemon/0.17.0 (darwin; arm64)"

func NewRequest

func NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)

NewRequest creates an HTTP request with standard ox headers (User-Agent, X-Orchestrator). Prefer this over http.NewRequestWithContext + SetHeaders to ensure headers are never forgotten.

func OrchestratorType

func OrchestratorType() string

OrchestratorType returns the detected orchestrator type (e.g. "conductor"). Returns empty string if no orchestrator is detected.

func ResetForTesting

func ResetForTesting()

ResetForTesting clears cached state. Test use only.

func SetAgentType

func SetAgentType(at string)

SetAgentType records the detected coding agent environment (e.g. "claude-code", "cursor"). Thread-safe. First write wins; subsequent calls are no-ops.

func SetAgentVersion

func SetAgentVersion(ver string)

SetAgentVersion records the coding agent version (e.g. "1.0.26"). Thread-safe. First write wins; subsequent calls are no-ops. Must be called after SetAgentType. Ignored if agent type is not set.

func SetHeaders

func SetHeaders(h http.Header)

SetHeaders sets User-Agent and X-Orchestrator headers on the request. Use this for SageOx API requests to include full telemetry context.

func SetOrchestratorType

func SetOrchestratorType(ot string)

SetOrchestratorType records the detected orchestrator (e.g. "conductor", "openclaw"). Thread-safe. First write wins; subsequent calls are no-ops.

func String

func String() string

String returns the User-Agent for CLI requests. With agent: "ox/0.17.0 (claude-code/1.0.26; darwin; arm64)" Without ver: "ox/0.17.0 (claude-code; darwin; arm64)" No agent: "ox/0.17.0 (darwin; arm64)"

Types

This section is empty.

Jump to

Keyboard shortcuts

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