Documentation
¶
Overview ¶
Package environment builds EnvironmentFingerprints from the host and adapter-provided hints. Raw probe output stays local (goal.md §8.2).
Index ¶
- func Collect(ctx context.Context, hints map[string]string) domain.EnvironmentFingerprint
- func DetectCI() bool
- func Probe(ctx context.Context, tool string) string
- func ProbeArgv(tool string) (argv []string, ok bool)
- func ProbeExecutable(ctx context.Context, executable, tool string, argv []string) string
- type BrowserContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collect ¶
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 ¶
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
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
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.