Documentation
¶
Overview ¶
Package agents is the single source of truth for the agent CLIs PANDA can delegate to. It maps each agent's registry key to its adapter script, the binary names to probe on PATH, install/update guidance (download link + install command), and the agent's credential manifest (which env vars and config files prove the agent brings its own model, and how PANDA's model config maps onto the agent's env contract). The CLI (`panda agents`), the capability-card generator (`panda detect`), the web settings API (webui/panel), the commander's availability probe, and the commander's credential probe/injection all read from here instead of each hardcoding their own table, so adding an agent (with credentials) is a single-entry change.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Known ¶
type Known struct {
// Name is the registry key (also the capability-card agent key), e.g.
// "grok_build". It is stable and used for routing.
Name string
// Adapter is the adapter script under adapters/, e.g. "grok_build.py".
Adapter string
// Binaries are the CLI binary names to probe, in preference order. The
// first one is the canonical probe binary (also the availability probe
// fallback when a card declares no install_check).
Binaries []string
// DisplayName is the human-readable label shown in the CLI/Web UI.
DisplayName string
// InstallHint is a one-line shell command to install/update the CLI.
// Empty when the agent has no public installer (self-hosted/custom CLIs).
InstallHint string
// InstallURL is the documentation or download page. Empty when unknown.
InstallURL string
// CredentialEnvVars is the probe side of the agent's credential
// manifest: env var names that prove the agent carries model
// credentials of its own (e.g. claude's ANTHROPIC_API_KEY /
// ANTHROPIC_AUTH_TOKEN). When one is set, the commander leaves the
// agent's native model alone and only forwards these vars through the
// sandbox. Empty means "unknown" — probes fall back to the union of
// common provider keys.
CredentialEnvVars []string
// CredentialFiles lists home-relative files whose presence (non-empty)
// proves the agent is logged in / configured with its own provider —
// e.g. codex stores its auth and provider sections in ~/.codex.
CredentialFiles []string
// CredentialFileFields narrows selected CredentialFiles to the JSON
// fields whose (non-empty) presence marks real credentials. A file
// listed here counts only when at least one named field is set — some
// agents keep a state file that exists long before any login (Claude
// Code writes ~/.claude.json on first run), and treating its mere
// existence as credentials would wrongly disable model injection.
CredentialFileFields map[string][]string
// ModelEnv is the injection side of the credential manifest: the env
// vars the agent CLI reads for its model endpoint. Nil means model
// injection is not safely supported for this agent (its env contract
// is ambiguous or it always brings its own key), so PANDA never
// overrides its endpoint.
ModelEnv *ModelEnvMapping
}
Known describes one agent CLI PANDA recognises. It is deliberately static data with no I/O: probes, adapter names and guidance are derived from it by the consumers that need them.
func ByAdapter ¶
ByAdapter returns the agent whose adapter script is adapter, or ok=false. Used by the commander to derive a probe binary when a card declares no install_check.
func Registry ¶
func Registry() []Known
Registry returns every known agent in deterministic (name-sorted) order. The slice is a copy, so callers may reorder or filter freely.
func (Known) PrimaryBinary ¶
PrimaryBinary returns the canonical CLI binary to probe, or "" if none.
type ModelEnvMapping ¶ added in v0.0.4
type ModelEnvMapping struct {
BaseURL string // env var carrying the provider base URL, e.g. ANTHROPIC_BASE_URL
APIKey string // env var carrying the API key, e.g. ANTHROPIC_API_KEY
Model string // env var carrying the model name, e.g. ANTHROPIC_MODEL
}
ModelEnvMapping names the env vars one agent CLI reads for its model endpoint. It is data, not code: the commander translates its model config through the mapping, so a new agent in the registry gets credential probing and (when a mapping is declared) injection without any commander change.