Skip to content

feat: distribute lumen binary via npm optional dependencies#47

Merged
aeneasr merged 3 commits intomainfrom
fix-plugin-install
Mar 16, 2026
Merged

feat: distribute lumen binary via npm optional dependencies#47
aeneasr merged 3 commits intomainfrom
fix-plugin-install

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Mar 16, 2026

Summary

  • Root cause: On first launch after a marketplace upgrade, run.sh downloaded the binary at MCP startup time, but the MCP connection timed out after 94ms before the download completed
  • Fix: Distribute the binary via npm optionalDependencies so it arrives at install time, not startup time — the same pattern used by esbuild, Biome, etc.

Changes

  • scripts/npm-publish.sh: Downloads release binaries from GitHub, verifies sha256 checksums against goreleaser's checksums.txt, and publishes @ory/lumen-<platform> packages + the @ory/lumen wrapper with optionalDependencies
  • npm/lumen.js: JS shim used as the wrapper's bin entry — resolves the installed platform package and execs the binary
  • scripts/run.sh: Probes the npm sibling package path (../lumen-<os>-<arch>/bin/lumen) before falling back to download, so npm-installed plugins find the binary with no network call at startup
  • .github/workflows/release-please.yml: Adds publish-npm job that runs after goreleaser on ubuntu-latest using NODE_AUTH_TOKEN from NPM_TOKEN secret

Test plan

  • Dry-run verified against v0.0.13: all 5 platform packages + wrapper published cleanly with correct contents and checksums
  • Add NPM_TOKEN secret to the ory/lumen repo (requires org admin)
  • Verify next release publishes @ory/lumen@<version> to npm registry

🤖 Generated with Claude Code

aeneasr and others added 2 commits March 16, 2026 23:37
Fixes a race condition where the MCP connection timed out (94ms) on first
launch after an upgrade because run.sh was downloading the binary at
startup time.

- Add scripts/npm-publish.sh: downloads release binaries from GitHub,
  verifies sha256 checksums, and publishes @ory/lumen-<platform> packages
  plus the @ory/lumen wrapper with optionalDependencies
- Add npm/lumen.js: JS shim that resolves the installed platform package
  and execs the binary (used as the wrapper's bin entry)
- Update scripts/run.sh: probe the npm sibling package path
  (../lumen-<os>-<arch>/bin/lumen) before falling back to download,
  so npm-installed plugins find the binary without any network call
- Add publish-npm CI job to release-please.yml: runs after goreleaser
  on ubuntu-latest with NODE_AUTH_TOKEN from NPM_TOKEN secret

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeneasr aeneasr enabled auto-merge (squash) March 16, 2026 22:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeneasr aeneasr merged commit 6c382af into main Mar 16, 2026
4 checks passed
aeneasr added a commit that referenced this pull request Mar 17, 2026
aeneasr added a commit that referenced this pull request Mar 17, 2026
)

* Revert "feat: distribute lumen binary via npm optional dependencies (#47)"

This reverts commit 6c382af.

* fix: add curl timeout and progress bar to binary download

Add --max-time 300, --retry 3 --retry-delay 2, and --progress-bar to
the curl invocation in run.sh. Previously, a slow or stalled download
would hang indefinitely and silently, potentially causing MCP server
startup timeouts on first install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant