Skip to main content

claim_key_for_tool

Function claim_key_for_tool 

Source
fn claim_key_for_tool(tool_id: &str) -> &str
Expand description

The one entry point into the catalog — dispatches by compile-time platform, then (macOS/Linux) by what’s actually detected on this machine. Returns None whenever nothing can be resolved (unknown tool id, or — macOS/Linux only — no usable package manager found); callers must treat None as “fall back to the existing link+copy- command UI,” never as an error. Normalizes which claim slot a tool_id occupies in InstallSessionRegistry.active_system_tools. "npm" shares Node’s slot on every platform (§3.5: they resolve to the exact same winget/brew/apt-family package transaction — installing Node already gets npm), so starting installs from both rows concurrently must not be allowed to both pass the claim check and race two installs of the same package (winget/msi lock errors, duplicate install prompts). Codex P2, PR #2790.