fix(tokenless): build OpenClaw plugin to dist/index.js#589
Open
kongche-jbw wants to merge 1 commit into
Open
Conversation
- add Makefile build-openclaw-plugin (npm install + tsc)
- wire it into build and install-adapter-resources
- update package.json to dist/index.js; add tsconfig
- drop spec esbuild/sed hack; use make build-openclaw-plugin
- install.sh: deploy-only, honor OPENCLAW_BIN, env -u OPENCLAW_HOME
- fix index.ts: checkToon -> checkTokenless (was undefined)
- gitignore dist/, node_modules/, package-lock.json
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.
Description
The tokenless OpenClaw plugin shipped without its compiled entrypoint:
package.jsondeclaresmain/openclaw.extensions = ./dist/index.js,but the Makefile only built Rust artifacts and copied
adapters/tokenlessverbatim, so
$SHARE_DIR/openclaw/dist/index.jsnever existed and the RPM's%buildresorted to annpx esbuild/sedfallback.This PR converges on the same boundary as
sec-core/openclaw-plugin:the Makefile compiles TS to
dist/, the spec/install steps only deliverthe compiled tree, and
install.shis deploy-only.src/tokenless/Makefile: newbuild-openclaw-plugintarget(
npm install --legacy-peer-deps --no-audit --no-fund --package-lock=falsethen
npm run build); wired intobuildand as a prerequisite ofinstall-adapter-resources, which now also stripsnode_modules/package-lock.jsonfrom the install tree and asserts$SHARE_DIR/openclaw/dist/index.jsexists.adapters/tokenless/openclaw/package.json:mainandopenclaw.extensionsnow point todist/index.js; addedscripts.buildand
devDependencies(typescript,@types/node).adapters/tokenless/openclaw/tsconfig.json(ES2022 / Node16,outDir: dist).tokenless.spec.in:%buildcallsmake build-openclaw-plugin;%installand
%filesdeclareopenclaw/dist/index.jsinstead ofopenclaw/index.js;added
BuildRequires: nodejs npm.adapters/tokenless/openclaw/scripts/install.sh: removed the ad-hoccompile path; deploys only an already-built plugin. Honors
OPENCLAW_BINfor orchestrator injection and runs the CLI underenv -u OPENCLAW_HOMEto avoid~/.openclaw/.openclaw/...nesting.If
dist/index.jsis missing, exits with a clear instruction to runmake -C src/tokenless build-openclaw-plugin.adapters/tokenless/openclaw/index.ts: one-char fix — undefinedcheckToon()->checkTokenless()(thecompress-toonsubcommand ishosted by the
tokenlessbinary; this blocked TS compilation).adapters/tokenless/openclaw/.gitignore:dist/,node_modules/,package-lock.json.scripts/build-all.shis untouched —build-allcontinues to invoke eachcomponent's own
make install, which now produces a complete tokenlessadapter on its own.
Related Issue
no-issue: internal build/packaging fix; converges tokenless OpenClaw plugin
on the sec-core build boundary
Type of Change
Scope
cosh(copilot-shell)sec-core(agent-sec-core)skill(os-skills)sight(agentsight)tokenless(tokenless)Checklist
cosh: Lint passes, type check passes, and tests passsec-core(Rust):cargo clippy -- -D warningsandcargo fmt --checkpasssec-core(Python): Ruff format and pytest passskill: Skill directory structure is valid and shell scripts pass syntax checksight:cargo clippy -- -D warningsandcargo fmt --checkpasstokenless:cargo clippy -- -D warningsandcargo fmt --checkpasspackage-lock.json/Cargo.lock)Testing
Verified locally with a staged DESTDIR:
rm -rf src/tokenless/adapters/tokenless/openclaw/{dist,node_modules,package-lock.json} make -C src/tokenless build-openclaw-plugin test -f src/tokenless/adapters/tokenless/openclaw/dist/index.js # OK TMP=$(mktemp -d) make -C src/tokenless install-adapter-resources \ DESTDIR="$TMP" INSTALL_PROFILE=user PREFIX="$HOME/.local" test -f "$TMP$HOME/.local/share/anolisa/adapters/tokenless/openclaw/dist/index.js" # OK ! test -e "$TMP$HOME/.local/share/anolisa/adapters/tokenless/openclaw/node_modules" # OK ! test -e "$TMP$HOME/.local/share/anolisa/adapters/tokenless/openclaw/package-lock.json" # OK