Documentation
¶
Overview ¶
Package detect finds ACP agents installed on this computer, so the user picks one instead of typing a command line.
An agent is found in three steps: its executable on the search path (the login shell's PATH and the usual per-user install directories, which an app started from the desktop does not inherit), then the way it speaks ACP (a separate adapter, or its own flag or subcommand, confirmed in its help text), then its version, best effort.
Detection only runs the agents' --help and --version; nothing is installed. An agent that needs an adapter it does not have runs it through npx when npx is present, and otherwise reports the npm package to install.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookPath ¶
LookPath finds an executable named name in a PATH list, as the system would; "" when there is none.
func Vars ¶
Vars are the variables an agent runs with beyond the base environment acp.FilterEnv keeps: the search path, the shared variables and the agent's own, from the login shell, else from environ (os.Environ), and the system proxy when no proxy variable is set. An unknown id, a command the user typed, gets the shared ones. acp.FilterEnv still removes the names it always denies.
Types ¶
type Agent ¶
type Agent struct {
ID string // catalog id: claude, codex, grok, gemini, ...
Name string
Type string // acp.Config.Type
Command string // absolute path; empty when Missing is set
Args []string
Version string // the agent's own version, when it reports one
// Fetch is set when Command is npx, which downloads Package the first
// time the agent starts.
Fetch bool
// Package is the npm package of the agent's ACP adapter, when it needs one.
Package string
// Missing is set when the agent is installed but its adapter is not,
// and there is no npx to fetch it: install Package first.
Missing bool
}
Agent is one ACP agent found on this computer.
type Shell ¶
type Shell struct {
// Path is this process's PATH, then the login shell's, then the usual
// per-user install directories that exist.
Path string
// Env is the login shell's environment, or nil when it could not be read.
Env map[string]string
// Proxy is the system proxy setting as proxy variables, used when no
// proxy variable is set.
Proxy map[string]string
}
Shell is what an agent needs from the user's environment that an app started from the desktop may not have: the login shell's variables, and the search path.