wirenboard-agent-vm/npm-dist
Evgeny Boger 1d5f36c451 rename ghcr image: agent-vm → agent-vm-template + clarify it's the guest
The name `agent-vm` was overloaded: it's both the runtime tool
(Rust binary on npm) AND the OCI image the tool boots inside each
microVM. Users seeing `ghcr.io/wirenboard/agent-vm:latest` would
reasonably guess that's where the *runtime* lives, but it's
actually the guest rootfs.

Rename the ghcr package to `agent-vm-template` and add OCI labels
(`org.opencontainers.image.title` / `description`) that explicitly
say "guest template image — install the runtime via npm". The
description shows on the ghcr.io package page.

Also rename the local-registry tag (`localhost:5000/agent-vm-template:latest`)
for consistency with the dev workflow.

Touches:
- DEFAULT_IMAGE_REF and every help/doctring referencing the ghcr
  image (setup.rs, run.rs, pull.rs, image_api_version.rs,
  image_check.rs).
- images/Dockerfile — new header + OCI labels.
- images/build.sh — local registry tag.
- .github/workflows/build-image.yml — IMAGE env.
- README.md + npm-dist/README.md.
- image_check tests updated to assert the new name.

Bumps to v0.1.4 so npm + ghcr converge on the new name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:39:57 +03:00
..
agent-vm distribution: address code-review findings before v0.1.0 2026-05-25 11:43:08 +03:00
agent-vm-linux-x64 distribution: address code-review findings before v0.1.0 2026-05-25 11:43:08 +03:00
.gitignore distribution: ship via npm + ghcr.io image, drop local-build flow 2026-05-24 21:02:56 +03:00
README.md rename ghcr image: agent-vm → agent-vm-template + clarify it's the guest 2026-05-25 14:39:57 +03:00

npm-dist

Templates and tooling for distributing agent-vm via npm.

Layout

  • agent-vm/ — the user-facing main package. Tiny JS launcher (bin/agent-vm.js) that detects ${platform}-${arch} at runtime and execves the prebuilt native binary from the matching per-platform subpackage. Declares per-platform subpackages as optionalDependencies so npm installs only the right one.
  • agent-vm-linux-x64/ — per-platform subpackage. Ships the prebuilt bin/agent-vm, the patched bin/msb, and lib/libkrunfw.so.5.2.1. agent-vm finds msb and libkrunfw via current_exe()-relative paths so a user's separate microsandbox install never shadows them.
  • Future per-platform subpackages: -linux-arm64, -darwin-arm64, -darwin-x64, -win32-x64. Add to the launcher's PLATFORM_PACKAGES map and to the main package's optionalDependencies.

How releases happen

CI populates each subpackage's bin/ and lib/ with freshly cross-compiled artifacts, rewrites every package.json version field to match the release tag, and runs npm publish for each package. See .github/workflows/release-npm.yml.

The OCI image is on a separate cadence (hourly cron) — see .github/workflows/build-image.yml. Binary releases pin the default image to ghcr.io/wirenboard/agent-vm-template:latest; users override per-launch via --image or AGENT_VM_IMAGE_TAG.

Local smoke test

To verify the launcher resolves a subpackage correctly without publishing, drop a prebuilt binary into a subpackage's bin/ and npm link it:

# build the binary
cargo build --release -p agent-vm
cargo build --release --manifest-path vendor/microsandbox/Cargo.toml \
    -p microsandbox-cli --bin msb

cp target/release/agent-vm npm-dist/agent-vm-linux-x64/bin/
cp vendor/microsandbox/target/release/msb npm-dist/agent-vm-linux-x64/bin/
cp ~/.microsandbox/lib/libkrunfw.so.5.2.1 npm-dist/agent-vm-linux-x64/lib/

cd npm-dist/agent-vm-linux-x64 && npm link && cd ..
cd npm-dist/agent-vm && npm link @wirenboard/agent-vm-linux-x64 && npm link

agent-vm --help   # should exec target/release/agent-vm