Skip to main content

Module discovery

Module discovery 

Source
Expand description

Agent auto-discovery — scan $PATH for known CLI agents and probe their versions in parallel, so the registry can populate itself without user configuration.

Discovery is data-only: it produces a DiscoveredBinary list. Turning those into [AgentDelegate] instances happens in the registry layer, which can also merge user overrides on top.

Structs§

AgentFingerprint
A static description of one known agent family. The discovery pass tries each binary_names entry on $PATH; the first hit is probed and the result becomes a DiscoveredBinary.
DelegateDiscovery
Top-level discovery coordinator. Holds the fingerprint table and probe budget; one instance can be reused across SIGHUP refreshes.
DiscoveredBinary
Outcome of discovery for one fingerprinted agent.
InvocationTemplate
How a discovered agent should be wired into a runnable delegate.
PathScanner
Walks directories (usually from $PATH) looking for executable files by name. Caches the directory list so repeated lookups during a single discovery pass don’t re-read the env var.

Enums§

DiscoveryStatus
Why a candidate binary isn’t usable.

Constants§

DEFAULT_PROBE_TIMEOUT
Per-binary version probe deadline. 3s gives Node-based CLIs (gemini-cli, qwen-code, opencode) enough time to cold-start and print –version; faster CLIs still return well under the cap.

Functions§

default_fingerprints
Built-in fingerprints shipped with Brain. Extend this list when a new CLI agent becomes common enough to warrant zero-config wiring.