build(npm): add @pulseengine/rivet distribution#166
Merged
Conversation
414b74a to
87c935a
Compare
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 7f79e35 | Previous: deeafeb | Ratio |
|---|---|---|---|
traceability_matrix/1000 |
58962 ns/iter (± 1194) |
45303 ns/iter (± 1971) |
1.30 |
query/10000 |
111090 ns/iter (± 2592) |
92088 ns/iter (± 1491) |
1.21 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
0bfab4e to
7f79e35
Compare
Adds npm distribution machinery so rivet can be installed/run via
`npx @pulseengine/rivet` and registered with Claude Code as an MCP server.
Pattern follows pulseengine/template-mcp-server:
- Root package (`npm/`) uses per-platform optionalDependencies
- index.js resolves the correct platform package for the current OS/arch
- run.js spawns the resolved binary, forwarding argv/stdio/signals
- install.js is idempotent: no-op when platform package resolved, else
downloads the archive from the GitHub Release as a fallback
- Five platform packages under `platform-packages/` (darwin-arm64,
darwin-x64, linux-arm64, linux-x64, win32-x64) — each ships a single
pre-built binary at publish time (gitignored in source)
- `release-npm.yml` triggers on `release: published`, downloads the
archives produced by `release.yml`, assembles + publishes each platform
package, then publishes the root package last so optionalDependencies
resolve on first install
Does not modify release.yml; consumes its artifacts via the release event.
Trace: skip
7f79e35 to
8b27400
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the machinery to publish
rivetas an npm package so it can be usedvia
npx @pulseengine/rivetand registered as a Claude Code MCP serverwith
claude mcp add rivet npx -y @pulseengine/rivet mcp.npm/— root package@pulseengine/rivet. Uses per-platformoptionalDependencies;index.jsresolves the current platform'spackage,
run.jsspawns the binary (stdin/stdout/stderr + signalsforwarded),
install.jsis a no-op when the platform packageresolved and falls back to downloading the archive from the GitHub
Release otherwise.
platform-packages/{darwin-arm64,darwin-x64,linux-arm64,linux-x64,win32-x64}/— five per-platform packages. Each ships exactly one pre-built binary
(gitignored in source, populated at publish time by the workflow).
.github/workflows/release-npm.yml— triggers onrelease: published(so it runs after the existing
release.ymlcreates the GitHub Releaseand uploads the archives). Downloads the archives via
gh release download, assembles each platform package, publishes allplatform packages in parallel, then publishes the root package last so
optionalDependenciesresolve on the very first install.Pattern mirrors
pulseengine/template-mcp-serverand the live
@pulseengine/timedate-mcp-serverpackage.Deviations from the template
linux-arm64. The template only shipslinux-x64;rivet'sexisting
release.ymlalready buildsaarch64-unknown-linux-gnuviacross, so we publish that too.release.yml. The template's workflowalso builds binaries — we only download the ones
release.ymlalreadyproduced, which keeps the existing release flow unchanged.
execFileSync(no shell) for archive extraction ininstall.jsinstead of
execSyncstring commands, to avoid any injection surfaceeven though inputs are hardcoded.
Apache-2.0(matches workspaceCargo.toml), notMITlike the template.
Availability check
@pulseengine/rivet— currently 404 on npmjs.org (available to claim).@pulseenginescope is already owned (@pulseengine/timedate-mcp-serveris live under maintainer
avrabe/ralf_beier@me.com).Required repo configuration — ACTION REQUIRED
The publish workflow is gated on a repository secret named
NPM_TOKEN.I checked
/repos/pulseengine/rivet/actions/secretsand it is currentlyempty — the repo admin must add an automation
NPM_TOKENbefore thefirst tag push will actually publish to npm. Until then the workflow will
start and fail at the
npm publishstep; it will not damage anything.Non-goals
release.yml.(
v*) afterrelease.ymlcreates the release andNPM_TOKENis set.Test plan
NPM_TOKENsecret (automation token from npmjs.comfor the
@pulseenginescope,publishpermission).workflow_dispatchagainst an existing tagto watch the publish steps before next release.
npm view @pulseengine/rivetshows the new version.npx @pulseengine/rivet --versionprints the same string ascargo run -p rivet-cli -- --version.claude mcp add rivet npx -y @pulseengine/rivet mcpregisterssuccessfully and
claude mcp listshows the server.confirm
optionalDependenciesresolution.