environment

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package environment builds EnvironmentFingerprints from the host and adapter-provided hints. Raw probe output stays local (goal.md §8.2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(ctx context.Context, hints map[string]string) domain.EnvironmentFingerprint

Collect assembles a fingerprint. Hints use the JSON field names of domain.EnvironmentFingerprint ("runtime", "runtimeVersion", ...); a hint naming a tool with an empty version triggers a local probe.

func DetectCI

func DetectCI() bool

DetectCI reports whether this process looks like an automated runner.

func Probe

func Probe(ctx context.Context, tool string) string

Probe returns the "major.minor(.patch)" version of a known tool, or "" if the tool is missing, unknown, or times out.

func ProbeArgv added in v0.2.0

func ProbeArgv(tool string) (argv []string, ok bool)

ProbeArgv is the side-effect-free command line that prints a known tool's version -- the same allowlisted probe Probe runs -- for a caller that wants to run it as an observed command rather than as instrumentation. ok is false for a tool this package does not know how to ask.

func ProbeExecutable added in v0.1.141

func ProbeExecutable(ctx context.Context, executable, tool string, argv []string) string

ProbeExecutable returns the version of the exact executable that is about to run. It intentionally accepts only the same allowlisted, side-effect-free probes as Probe. argv is used solely to distinguish `docker compose` from the Docker engine command; arbitrary caller arguments are never executed by the probe.

Types

type BrowserContext

type BrowserContext struct {
	Family        string // chrome|edge|firefox|safari|chromium|android-webview|ios-wkwebview|electron
	Major         string // "140"
	Engine        string // chromium|gecko|webkit
	EngineVersion string // engine major, e.g. "140" or "605"
}

BrowserContext is the normalized, privacy-reduced form of a browser runtime. The full User-Agent string is parsed locally and then discarded: only these coarse fields may enter Evidence (goal — API compatibility, not fingerprinting).

func ParseUserAgent

func ParseUserAgent(ua string) BrowserContext

ParseUserAgent normalizes a User-Agent into a BrowserContext. Unrecognized agents return a zero value — an unknown context is honest, a guessed one is not.

Jump to

Keyboard shortcuts

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