@inkeep/impulse-compute
v0.7.0
Published
openteammate's bundled CLI for cloud Macs (team-mac), Linux desktop sessions (linux-desktop), and Windows or Linux EC2 instances (ec2), with no runtime package dependencies.
Keywords
Readme
@inkeep/impulse-compute
openteammate's compute CLI, as one bundled bin with no runtime dependency. It has three command groups:
impulse-compute team-maclists the team's pool of cloud Macs, holds or prepares a pool Mac, starts and stops a run's macOS VM, and delivers an image-publishing runner.impulse-compute linux-desktopowns or adopts an X11 desktop session in a Linux guest (an E2B sandbox, or the machine it runs on), launches and closes apps in it, captures raw screens and exact window crops, and verifies exact crops. It is theuse-cloud-vmsskill's Linux desktop helper.impulse-compute ec2creates a Windows or Linux EC2 instance for a run (Windows Server 2025; Amazon Linux 2023 on x86_64 or arm64, or warm Ubuntu 24.04), reaches it over SSH through Session Manager, checks its status, extends its end and retires it with a release receipt.
Run it
Pin the exact version:
npx --yes --min-release-age=0 @inkeep/impulse-compute@<version> team-mac inventory --profile <agent profile> \
--ot-fleet <use-cloud-vms skill folder>/scripts/ot-fleetnpx --yes --min-release-age=0 @inkeep/impulse-compute@<version> linux-desktop crop verify --raw raw.png --crop crop.png --box 0 0 100 50--min-release-age=0 lets npm resolve the exact pin immediately after publication when the controller has a release-age floor.
impulse-compute --help lists the command groups and impulse-compute <group> --help lists a group's commands;
impulse-compute team-mac <command> --help gives a team-mac command's flags. impulse-compute --version, or -v,
prints the package's version.
team-mac
- Node 26.10.0 or later, with
process.execve, which the bundled launcher uses to start every child process. On an older Node, everyteam-maccommand, its help included, exits1with a message naming the Node it needs and the one it found;impulse-compute --versionand--helpstill work. The package declares noenginesfield, so npm does not check the version. - Also needed: the AWS CLI v2, AWS's Session Manager plugin, OpenSSH 7.3 or later, and the team credential's two AWS identities.
--ot-fleethas no default. Pass theuse-cloud-vmsskill's ownscripts/ot-fleet.--diris the run's private folder, forhold,start,prepareandstop: it holds the run's SSH key,ssh_config,known_hosts,record.json, the record's lock file.writer.sqlite, the claim files.start.sqliteand.stop.sqlite, and each step's record.publishtakes a new private directory whose parent already exists.
team-mac exit codes and output
| Exit | Meaning | stdout |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| 0 | Done | The command's JSON, below |
| 1 | A failure: an AWS call or a step on a Mac failed, a tool such as aws is not on PATH, or Node is below the floor. stderr says which, as team-mac: <step>: <message> for a step | Nothing |
| 2 | A usage error: no group, an unknown group, command or flag, a value a flag refuses (an empty one included), or no --ot-fleet. Nothing was done: no AWS call, nothing written to --dir | The group's or command's help when the parser refused the arguments; nothing for a missing or unknown group, or no --ot-fleet |
| 3 | Blocked: no Mac took the VM, a full quota, no capacity, a deadline passed, another start or stop of the VM is active, or another command is using the --dir. stderr gives the reason | {"blocked": true, "reason": …, "report": …} |
The package never exits 77: it carries everything it runs.
What each command prints on stdout when it exits 0:
inventory: the pool's report, JSON with"schema": "openteammate.team-mac/inventory@3": each Mac (hosts) with its readiness, VMs, andhold(run,deadlineEpochSeconds,expired).hold: nullwithholdInventoryError: nullmeans no hold; a non-null error means the hold could not be read. The hold's owner key is not returned.expiredStillAllocatedlists Macs past retirement that AWS still holds. stderr gets a line per Mac. It changes nothing. Consumers of inventory@2 must accept the new schema name and added hold fields. A VM whose bundle carries Lume's image marker also givesmanifestDigest, andimagenames the--imageit matches.hold: the run's record withholdrecovery details. Use an existing ready Mac with--host, and supply--run,--owner,--dir,--needand--within; no VM is created. The hold expires at the acquisition deadline plus--need. The holder'sstartuses the same run and directory. Other cooperating starts first read the host-local hold through Run Command and skip a Mac reported held by another run before writing tags or staging host preparation. Expired holds permit reuse; an unreadable hold fails without writing. The read does not reserve the Mac: a hold acquired afterward may still be followed by a retirement-tag write. Taking a hold afterstartpreserves the VM's recorded deadline without extending it.start: the run's record, JSON with"schema": "openteammate.team-mac/run@1": the Mac, the VM with its IP, and each step.vmDeadlineEpochSecondsis the UTC epoch handed to the VM's deletion worker: the acquisition deadline plus--need. It is independent of host retirement and is absent from older records. stderr gets the command that reaches the VM,ssh -F <dir>/ssh_config vm.--image cua-26-slimstarts the VM from Cua's pinned macOS 26 test image instead of the stock base, importing and verifying it on that Mac the first time; the record addsguestImage(name, pinned reference and digest, base, and whether this startpulledorreusedit) anddesktop(the guest port and the path of the VM's token on the Mac), andstartexits0only once the guest's desktop service accepts that token. If the controller’s wait for the host start script expires, it exits3. The import or boot can continue on the Mac. Runstopin the same--dir, then retrystartthere. If the service refuses it (HTTP 401),startexits1; if--withinruns out before the service has accepted it, it exits3(a reply already on its way can putreadyAta few seconds after the deadline). In both cases it first deletes the guest and its token share through the same owner-checked stepstopuses, and stderr says whether that deletion was confirmed; runstopwith the same--dirto finish the run (it removes the run key and releases a hold), or to retry the deletion. The first--imagestart on a Mac imports about 28 GiB under the Mac's host claim, so other starts and holds there wait for it. Astopissued during that import waits up to two minutes for the start: it finishes in that call when the start lets go of the Mac within the wait, and otherwise returns blocked (3); retry it afterstartexits. While a run is unfinished,startagain in its--dirkeeps the recorded image and refuses another. TheguestImage,desktop,manifestDigestandimagefields are additive, so readers that ignore unknown fields are unaffected. The released 0.2.1, which predates--image, dropsguestImageanddesktopwhen itsstoprewrites a record, so use one release of the helper for a run fromstarttostop. Itshold, run on a newer run whosestophas recorded its request but not finished, also erases that request.prepare: the Mac'shostIdandinstanceId, and each preparation phase with its steps underprepared.publish:runId,hostIdandrunner: "finished"after the runner finishes and the host hold is released.stop: the run's record, withstoppedfilled in. stderr says whether the VM was deleted, and gives the Mac'sot-retire-at, including for a hold-only stop. A guest absence receipt names the checked~/.lumestore, the observation and the attempt fingerprint. An unavailable lookup keeps the run retryable with its keys and recovery files. Restore access and runstopagain in the same directory. A same-name replacement keeps running. A completed stop exits0even when its stdout reader closes early. At that point the helper has removed both local key files. After upgrading, checkteam-mac inventorybefore retrying an unfinished stop. It also releases this run's hold; a hold-only record causes no VM operation. It records its request instopped(outcome: "stop-requested",absent: false) before it touches the VM, so astartstill running in the same--dirthat has not yet recorded the VM booted or its desktop ready does not record either. Astartthat recorded them just before the stop may still print them. A--diradmits onestartorholdand onestopat a time, through claims on<dir>/.start.sqliteand<dir>/.stop.sqlite(Node's built-innode:sqlite) that the operating system releases when the command ends: a secondstartorhold, or one issued while astopruns, exits1before changing anything; astopthat finds another command holding the stop claim returns blocked (3) at once without changing anything, so retry it after that command exits. Astart's opening record write, and ahold's first read and its later record write, hold that claim for a moment, so astopissued just then is refused the same way; otherwise astopissued while astartorholdruns goes ahead, and astartwhose attempt result would send it on to another Mac or a new one (a capacity refusal, or a Mac another run holds) ends there (exit1) when it finds the stop recorded; other attempt results keep their own exit codes (a deadline still returns3). Every command writesrecord.jsonunder a lock on<dir>/.writer.sqlite, which the operating system also releases; one that cannot take it within 30 s says what it had already done and exits1, except astartwhose desktop missed the deadline, which still returns blocked (3) with the unrecorded write in its reason. Before it asks the Mac to release a hold,stopmarks the holdreleaseRequested; astartnever inherits such a hold, and the nextstopreleases it. When astartthestopwas requested against ends without anything on the Mac, for example because the VM name was taken, astopfinishes the run (absent-already, exit0) without deleting anything on the Mac. Astopthat recorded the VM absent and then failed, or whose process ended, is finished by the nextstopfrom that record without deleting the VM again; it contacts the Mac only to release a hold still outstanding. The retirement target is 24 hours after confirmed VM absence or the end of this run’s active host hold, whichever came later. A repeatedstopreuses that target and can restore a tag that another writer lowered. The optionalhold.releasedByEpochSecondsrecords the hold’s end rounded up to a whole second. When the VM is gone but its run directory or import staging on the Mac could not be removed,stopexits1with the path, keeps the record and key, and a laterstopfinishes. A verified import whose staging cannot be removed ends thestartthere, before any clone, with the path (exit1).
linux-desktop
Node: tested on 26.12.1, on macOS and Ubuntu. The group starts no process through
process.execveand has no Node check of its own.--sandbox <id>drives that E2B sandbox and needsE2B_API_KEY; without--sandboxit drives the machine it runs on. Later commands read the guest from the session's record in--state-dir.Exit codes. Each command prints one JSON object, on stdout when it completes and on stderr when it refuses; read its
statustogether with the exit code:| Exit | Meaning | | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
0| Done | |1| Refused; orcrop verify'smismatch; or asession stopthat could not confirm that everything it set out to end has ended (statusstopping, JSON on stdout) | |1–255| A refusal caused by a guest tool's failure exits with that tool's exit code, also given asnative_exit| |2| A usage error, orcrop verify'suncheckable| |70| A defect in the helper |"guest_retirement_required": truemeans retire the guest: something the helper started there may still be running and cannot be ended safely.The full contract, its commands and how to use them on a guest are in the
use-cloud-vmsskill'sreferences/computer-use.md, "The Linux desktop helper".
ec2
Run impulse-compute ec2 --help from the installed package for the five verbs. Each takes a private run directory and an AWS profile. A fresh create records its region. Later verbs use that recorded region. Every ec2 command, including help and version, requires Node 26.10.0 or later with process.execve. An unsupported runtime exits 1 and reports the required and detected versions. Commands that write the run directory also require the built-in node:sqlite module to be enabled. Live commands need AWS CLI v2, and SSH access needs OpenSSH and the Session Manager plugin.
A new record from the packed bin names the package version and the source commit used by the build. The guest scripts resolve relative to the installed bin. EC2 helper commands and exit codes
What the package holds
| Path | Contents |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| dist/impulse-compute.mjs | The bin: #!/usr/bin/env node on line 1, the provenance line on line 2, the CLI, and the bundled packages' licence notices last |
| dist/internal/launch.js | @inkeep/impulse-owned-process's launcher, a second file because that package loads it from beside its own module: the provenance line on line 1, the launcher, the licence notices last |
| team-mac/* | The scripts the CLI runs on a Mac |
| guest/windows/*.ps1 | The Windows user-data template, retirement task reader and mover, and SSH scripts read by the EC2 helper |
| guest/linux/*.sh | The Linux user-data script, its end timer, the task reader and mover, and SSH scripts read by the EC2 helper |
Both JavaScript files are minified with Rolldown's own minifier and ship with no source maps. Neither keeps a comment
apart from its provenance line and its licence notices. The provenance line is a comment holding JSON that names the
repository, the commit, the source tree and the lockfile's sha256 the file was built from, and the bundler. Its
sources list names every folder the bin is built from, packages/compute, scripts/offload, scripts/linux-desktop and
scripts/ec2-instance, each with its tree and the sha256 of the lockfile it resolves through: the repository's root
pnpm-lock.yaml for packages/compute, a workspace member, and each other folder's own. The build refuses to run
while any of those folders or the root lockfile has uncommitted changes.
Three packages the linux-desktop group bundles through e2b publish no licence file: @bufbuild/protobuf
((Apache-2.0 AND BSD-3-Clause)), @connectrpc/connect and @connectrpc/connect-web (Apache-2.0). The notices
name each with the licence its package.json declares; swap them if needed. The build accepts a missing licence file
only for those three at those licences and for our own UNLICENSED @inkeep/impulse-* packages.
Each command group resolves Effect and @effect/platform-node from its own source root at 4.1.5. The bin passes argument strings to linux-desktop, which runs its own program and sets its exit code. The EC2 dispatcher passes arguments and the environment to runEc2Main, the same process entry used by the checkout. The helper constructs the typed CLI and supplies its Node services. Its output writer applies to EC2 invocations.
Both files import only node: builtins. The build walks each file's imports and refuses any import of something
other than a node: builtin, and any import(), require or createRequire the walk finds; the package's test runs
the packed bin under a loader that refuses bare specifiers. The loader covers the bin's own process; the build's import
walk covers the launcher. Before the walk, the build rewrites a dependency's code in three ways: a require of a
builtin becomes a node: import; a .require(...) call on an object with a non-builtin argument becomes a thrown
error, and an import() of a computed specifier a rejected promise, both saying impulse-compute loads no package at
run time. Two such call sites are in the bin today: e2b's dynamic loader, which it uses for undici (falling
back to the global fetch when the load fails) and for glob and tar (only in its template builds), and
platform's RingoJS check, inside a try.
Contributing
The package source, build and tests live under packages/compute in the private inkeep/openteammate repository.
The groups are implemented in scripts/offload (team-mac), scripts/linux-desktop (linux-desktop), and
scripts/ec2-instance (ec2).
From the repository root, run pnpm install --frozen-lockfile, then pnpm --filter @inkeep/impulse-compute build.
The builder runs a foreground frozen install in each of the three command groups’ source directories. Each install
inherits stdin, stdout and stderr. If you interrupt a build, rerun it successfully before packing.
