chore: ship compiled dist/ + relax compat to 2026.4.27#6
Merged
Conversation
Restructure the plugin for direct deployment under the OpenClaw 2026.5.x plugin loader, which requires compiled JavaScript output for installed plugins. A single build artefact now serves both old and new gateways. Build & packaging - Add tsconfig.build.json that emits to dist/ with declarations. - Add build, prepare, and prepublishOnly scripts so installing from a git URL produces dist/ automatically. - Set main to dist/index.js, types to dist/index.d.ts, and declare files so the published tarball ships only what is needed. - Add dist/ to .gitignore (CI builds and uploads it). Compatibility - Lower openclaw.compat.minGatewayVersion, openclaw.compat.pluginApi, openclaw.build.openclawVersion, openclaw.build.pluginSdkVersion, and peerDependencies.openclaw from 2026.5.24 to 2026.4.27. The provider hooks the plugin relies on (wrapStreamFn, hookAliases, resolveTransportTurnState) have been available since 2026.4.27. The requester-bridge code paths (lease, poll, results) already degrade gracefully when the gateway-side TaaS API does not expose those endpoints, so a single build supports the full range. CI - Add .github/workflows/ci.yml to typecheck, test, and build on PR and push, and to upload dist/ as a workflow artefact on main. - Add .github/workflows/release.yml to pack the tarball on tag and attach it to a GitHub Release. The npm publish step is staged but commented out until an NPM_TOKEN secret is configured. Docs - Rewrite Installation: cover the npm-install path and the from-source path (which now requires running install to trigger prepare). - Add a Compatibility table covering 2026.4.27+ behaviour and what degrades on older builds. Verification - npm run build produces dist/index.js and dist/index.d.ts. - npm test passes (9/9 including the bridge long-polling tests). Bump version to 0.5.1.
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
Restructures the plugin for direct deployment under the OpenClaw 2026.5.x plugin loader, which requires compiled JavaScript output for installed plugins. A single build artefact now serves both old and new gateways.
Why
Today's snowcrash upgrade exposed three packaging gaps:
index.tsdirectly for installed plugins ("source checkouts/dev paths" only). The previously-working v0.2.0 was loading via the older permissive loader; v0.4.0 and v0.5.0 silently failed to load on 2026.4.27 once the registry re-evaluated.minGatewayVersion: 2026.5.24was set too aggressively — it gated the plugin against the dev-environment version rather than the actual lowest gateway with the hooks the code uses.dist/shipped, so manual installs from git left consumers needing to run a build by hand.Changes
Build & packaging
tsconfig.build.json(extends the typecheck-onlytsconfig.json) emitting todist/with declarations.build,prepare, andprepublishOnlyscripts sonpm installfrom a git URL producesdist/automatically.main: dist/index.js,types: dist/index.d.ts, and declarefilesso the published tarball ships only what is needed.dist/to.gitignore— CI builds and uploads it as an artefact.Compatibility
openclaw.compat.minGatewayVersion,openclaw.compat.pluginApi,openclaw.build.openclawVersion,openclaw.build.pluginSdkVersion, andpeerDependencies.openclawfrom2026.5.24to2026.4.27.wrapStreamFn,hookAliases,resolveTransportTurnState) have been available since2026.4.27.2026.4.27through current beta.CI
.github/workflows/ci.yml: typecheck + test + build on PR and push to main; uploadsdist/as a workflow artefact on main..github/workflows/release.yml: on tagv*, packs the tarball and attaches it to a GitHub Release. Thenpm publishstep is staged but commented out until anNPM_TOKENrepo secret is configured.Docs
npm installto triggerprepare).dist/index.jsVerification
npm run build→dist/index.js+dist/index.d.tsnpm test→ 9/9 passing, including the bridge long-polling resilience tests added in feat: add requester bridge long polling resilience #5OpenClaw 2026.5.24-beta.1) earlier today; plugin loads asStatus: loaded, capabilitiescloudsigma, cloudsigma-stagingFollow-ups (not in this PR)
NPM_TOKENrepo secret + uncomment thenpm publishstepopenclaw plugins install openclaw-token-cache-optimizercleanlyopenclaw-taas-affinityto match the npm package name (deferred — would force a migration for every existing install record)