feat(publish): add the darwin-arm64 runtime package
Summary
Phase 2 of "package flows so it's frictionless." relayflowd-path.ts's attach-or-spawn resolution has always been able to find a @relayflows/runtime-<platform>-<arch> optional dependency (kernel/DAEMON-LIFECYCLE.md §3.1 step 3), but nothing published one for macOS — packages/runtime-linux-x64 was the only platform. A separate, pre-existing gap turned up while wiring this: nothing declared any runtime package as an actual dependency of the installed relayflows CLI, on any platform. npm install -g relayflows never fetched a relayflowd binary regardless of OS; it only ever worked from inside a source checkout with the kernel already built locally.
packages/runtime-darwin-arm64: mirrorsruntime-linux-x64(os/cpu-gatedpackage.json,relayflowd+ bun-compiledflowsinbin/).packages/relayflows/package.jsonnow declares both runtime packages asoptionalDependencies, pinned in lockstep with@relayflows/sdk. npm installs only the one matchingos/cpuand silently skips the rest.scripts/pack-release.mjsgeneralized from aruntime-linux-x64special case to anyruntime-<platform>-<arch>package. Its execution smoke test only runs when the host actually matches — packing/asserting a foreign-platform tarball (e.g. re-verifyingruntime-darwin-arm64's tarball from the linuxpublish-packagesjob) checks shape only, since a foreign binary can't be executed there..github/workflows/publish.yml: newbuild-darwin-arm64job on amacos-14runner (nativeaarch64-apple-darwin, no cross-compile needed). It independently re-derives the samenew_versionby runningversion-packages.mjsagainst the same commit and the same workflow inputs as the linuxbuildjob —npm version <bump>is deterministic, so neither job depends on the other's output and they run in parallel.publish-packagesdownloads both build artifacts and publishes all five packages.
Test plan
-
node --test scripts/publish.test.mjs— including new coverage for the generalized runtime-package packing and the foreign-host skip path - Verified end to end, for real, on this machine (darwin-arm64): built the actual
relayflowdrelease binary and the bun-compiledflowsexecutable, ranpack-release.mjs runtime-darwin-arm64against them, which packs, unpacks, and executesrelayflowd --helpandflows check testdata/hello-deterministic.flow.yaml— real Mach-O binaries, real output -
relayflowd-path.ts's existing resolution tests (relayflowd-path.test.ts,daemon-lifecycle.test.ts) pass unmodified - The
build-darwin-arm64CI job itself is new and unexercised by any prior run — this PR's own checks will be its first real run on amacos-14GitHub Actions runner
Not in scope
darwin-x64 (Intel) and Windows still fall through to relayflowd-path.ts's source-checkout/PATH resolution steps — no runtime package for either yet.
🤖 Generated with Claude Code
https://claude.ai/code/session_013Y8uLRUXqKSZsqeeUMNaS2
Summary by cubic
Adds a prebuilt darwin-arm64 runtime package and fixes relayflows never shipping a runtime binary: npm install -g relayflows previously only worked from a source checkout, on any OS. Linux and darwin-arm64 runtime packages are now os/cpu-gated optionalDependencies of relayflows, and the publish workflow builds the macOS runtime on native Apple Silicon in parallel with the Linux job.
pack-release.mjsnow handles anyruntime-<platform>-<arch>package, executing a real smoke only on a matching host; foreign-host repacks assert shape only.- Both runtime packages advance in lockstep with
@relayflows/sdk, and the lockfile records both platform variants sonpm cielsewhere resolves its own. - The relayflows build step now installs the packed surface tarball alongside the SDK, since the SDK's transitive surface dependency would otherwise resolve from the registry and fail before anything is published.
- Intel Macs and Windows still fall through to
relayflowd-path.tssource-checkout/PATHresolution until their runtime packages exist.