Skip to main content

Module tool_store

Module tool_store 

Source
Expand description

Tool store: ensures CLI tools (jq, rg, etc.) are available to agent subprocesses. Reads a bundled catalog JSON, checks system/bundled/managed install paths, and can download + verify tools on demand.

Structs§

PlatformSpec
ToolCatalog
ToolSpec
ToolStatusEntry

Enums§

ToolStatus
UserToolsPrecedence
Where the user tools dir goes relative to the existing PATH. The bundled dir always goes first: it is app-owned and version-locked, and a stale system copy shadowing it is the exit-130 trap (RETRO_BASHWRAP_STALE_BUNDLE_2026_06_13.md).

Functions§

bashwrap_path
The agentmux-bashwrap agents’ Bash commands run through: the bundled copy, else the user tools dir’s (where task dev puts it), in the order tools_path puts them on PATH. An absolute path, so a stale copy elsewhere on PATH can never be the one that runs (RETRO_BASHWRAP_STALE_BUNDLE_2026_06_13.md).
bundled_tools_dir
Returns the bundled tools bin dir: <exe_dir>/tools/bin/.
compose_tools_path
existing with the given tool dirs added (bundled first, user per user_precedence). None when neither dir is given, so the caller can leave PATH untouched.
current_platform
Returns the platform key for the current compile target.
get_tool_statuses
Get the install status of every tool in the catalog.
install_tool
Download, verify, and install a single tool by ID into the user-managed store (~/.agentmux/tools/bin/).
load_catalog
Load and parse the embedded catalog.
prepend_agent_tools_path
Puts the tool dirs ahead of the PATH in env_vars (else the process’s own) for an agent’s process: the bundled dir, then the user dir, so the build-slot shims in the user dir (agentmux_common::build_slot) and the app’s own tools beat anything on the system PATH. Every agent spawn calls this: a spawn that skips it never reaches the shims.
probe_version
Run cmd --version-arg and extract the first version-looking token. Returns Some(version_string) on success, None if the command fails or the output contains no recognisable version token.
tools_path
compose_tools_path over the tool dirs that exist on this machine.
user_tools_dir
Returns ~/.agentmux/tools/bin/.