Expand description
Installing the provider CLI inside a container agent’s container.
The public base image carries no provider CLI, so the first start installs
it from npm into a per-agent volume. This module is the pure part: what to
install, the marker that says it is done, and the two sh scripts. The
docker exec plumbing is in ContainerManager::provision_cli.
Spec: docs/specs/SPEC_CONTAINER_AGENTS_WORK_FOR_EVERYONE_2026_10_07.md section 3.2.
Structs§
- CliInstall
- What to install for one container agent.
- Install
Limits - How long an install may run. The script limits npm itself (
script), which kills the whole process group; the host side (run) is the backstop for a script that does not return, and is followed byreap_argv.
Constants§
- CHECK_
SCRIPT 🔒 $1command,$2install dir,$3marker.- INSTALL_
SCRIPT 🔒 $1install dir,$2marker,$3command,$4seconds npm may run, the restname@version.- NPM_
INSTALL_ 🔒PATTERN - Regex (in
pkill -f/pgrep -fform) matching the install’snpm. The bracket keeps the reap script’s own command line, which contains this text, from matching itself. - REAP_
SCRIPT 🔒 $1the process pattern.
Functions§
- check_
says_ present - Whether the check script’s output means the CLI is already there.
- cli_
bin_ dir - The directory the turn wrapper appends to
PATH. - install_
failure_ detail - Why an install did not finish, in words for the pane.
- output_
tail - The last
maxcharacters ofoutput, whole lines where possible, trimmed. - reap_
argv - argv that kills any
npm installintoCONTAINER_CLI_DIRand waits for it to be gone. Printsgoneand exits 0 only once none is left. - reap_
says_ gone - Whether the reap script’s output says nothing is left running.