Expand description
The background task an install.start runs: take the install lock, reuse or
clear what another instance left, run npm install (or a release download),
publish every line of its output as install_chunk events, and end with one
done event. Every way out releases the session and the provider.
install_handlers.rs owns the RPC handlers and the lookups; this file owns the
run, one step per function, in the order the run takes them.
StructsΒ§
- Install
Job π - What
install.startasked for, as the registry resolved it. - Install
Run π - What one install session publishes to, and releases when it ends.
ConstantsΒ§
- INSTALL_
LOG_ πTAIL_ LINES - How many lines of npm output a failed install logs.
FunctionsΒ§
- acquire_
install_ πlock - The shared dir is written by every AgentMux instance on this
machine: serialize on its install lock. Waiting for another instanceβs
install must stay cancellable, so poll the lock and race
install.cancelinstead of blocking in it: a blocking wait would ignore cancel, keep the provider claimed, and could later report success for a cancelled session (#3927). The error is the message of thedoneevent. - conclude_
npm_ πexit - npm ended on its own: publish the one
doneevent for how. - npm_
install_ πargs - The arguments of the one
npm installrun: the pinned package plus any companions (pi-acpβspi) in one run, one dir, one completion marker, then the isolation flags. - push_
tail π - remove_
partial_ πinstall - Wipe the partial install of a cancelled run so a retry doesnβt inherit a half-written package-lock.json. Best-effort β logging only on failure.
- reuse_
or_ πclear - Reuse only a FINISHED install (completion marker, not just a shim npm may
have written early); clear a failed or interrupted one.
Ok(true): there is a finished install to reuse. - run_
download_ πinstall - An
install.startfor a provider that is a release download: fetch the pinned file, check its hash, unpack, publish. Output lines go to the session;install.cancelstops the transfer and removes the partial dir. - run_
install π - spawn_
install_ πtask - Run an
install.startin the background. - spawn_
npm π
Type AliasesΒ§
- Output
Tail π