@ademu/adc-bin
v0.2.4
Published
The adc daemon binary for your platform, delivered as npm optional dependencies — resolveAdcBinaryPath() finds the installed one.
Readme
@ademu/adc-bin
The adc daemon binary for your platform, delivered the way esbuild delivers its binary: this
meta package declares one optional dependency per published platform
(@ademu/adc-darwin-arm64, @ademu/adc-linux-x64, @ademu/adc-linux-arm64), npm installs the
one whose os/cpu match your host and skips the rest, and resolveAdcBinaryPath() tells you
where it landed. No postinstall, no download at install time — the host that motivated this is
the OpenClaw plugin, which installs plugins with npm install --omit=dev --ignore-scripts, so
binaries must arrive as packages or not at all.
Zero runtime dependencies (node stdlib only), ESM, strict TypeScript, engines.node >= 20.
Install
npm i @ademu/adc-bin @ademu/adc-controlUsage
import { resolveAdcBinaryPath } from '@ademu/adc-bin';
import { ensureDaemon } from '@ademu/adc-control';
const binaryPath = resolveAdcBinaryPath(); // e.g. …/node_modules/@ademu/adc-darwin-arm64/bin/adc
const { spawned, socketPath } = await ensureDaemon({ binaryPath });Two typed errors: UnsupportedPlatformError (.platform, .arch) when this host has no
published package (Windows, Intel macOS — see below), and PlatformPackageMissingError
(.packageName) when the host is supported but its optional package was not installed
(--no-optional / --omit=optional, or a lockfile generated on another platform with optional
dependencies pruned). Anything else from module resolution propagates untouched.
What gets installed
| host (process.platform-process.arch) | package | binary |
| --- | --- | --- |
| darwin-arm64 | @ademu/adc-darwin-arm64 | bin/adc for aarch64-apple-darwin |
| linux-x64 | @ademu/adc-linux-x64 | bin/adc for x86_64-unknown-linux-musl (static) |
| linux-arm64 | @ademu/adc-linux-arm64 | bin/adc for aarch64-unknown-linux-musl (static) |
Every @ademu/[email protected] pins @ademu/adc-<platform>@X.Y.Z exactly, and X.Y.Z is the adc
release version — pinning the meta package pins the daemon. The platform packages declare
bin: { adc: "bin/adc" }, but npm only links node_modules/.bin/adc when a platform package is a
DIRECT dependency of your project; when it arrives transitively through @ademu/adc-bin (the
normal case) there is no .bin link — resolveAdcBinaryPath() is the supported way to find the
binary (verified on the published 0.2.3 packages).
Verification (build-time)
Each platform package's bin/adc is the unmodified adc member of the GitHub release asset
adc-X.Y.Z-<target>.tar.gz. The generator that produces these packages (dev/build-npm-binaries.sh)
verifies the release's SHA256SUMS against its minisign signature (SHA256SUMS.minisig, key id
CEE35089367D2654; the public key is committed at dev/release-signing.pub in the AdemuMLS
repository) and every tarball against SHA256SUMS before it writes a single file — it refuses to
repackage a release it cannot authenticate. Each package records two digests in package.json:
ademu.sha256 (the release tarball) and ademu.binary_sha256 (the shipped bin/adc), so
shasum -a 256 node_modules/@ademu/adc-<platform>/bin/adc checks that the installed file is the one
the package was generated from. Be precise about what that is: it is build-time verification by
the publisher. Chaining the installed binary to the signed release independently needs the release
assets and the public key, which are not reachable while the repository is private.
Not published: Windows, Intel macOS
resolveAdcBinaryPath() throws UnsupportedPlatformError on win32-* and darwin-x64 — the same
hosts install.sh refuses. When a Windows build ships (roadmap Phase 5, @ademu/adc-win32-x64),
this package's optionalDependencies grow and the platform table gains a row; consumers change
nothing.
Developing
This directory is a member of the adc/clients npm workspace (npm ci && npm test at the
workspace root). The committed package.json is deliberately "private": true with version
0.0.0-dev and no optionalDependencies: the publishable manifest is derived at release time
by dev/build-npm-binaries.sh, which stamps the adc release version and the three exact
optional-dependency pins into a copy. Committing those pins would make every npm ci in the
workspace download three daemon binaries from the registry — and fail outright before the first
publish. The platform table lives in src/platforms.ts and must stay identical to the generator's
TARGETS table (test/platform-table.test.mjs enforces it).
