diff --git a/CHANGELOG.md b/CHANGELOG.md index d2d289d6e57..36e16ce91c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Windows/install: stop auto-installing `node-llama-cpp` during normal npm CLI installs so `openclaw@latest` no longer fails on Windows while building optional local-embedding dependencies. - Agents/text sanitization: strip leaked model control tokens (`<|...|>` and full-width `<|...|>` variants) from user-facing assistant text, preventing GLM-5 and DeepSeek internal delimiters from reaching end users. (#42173) Thanks @imwyvern. - iOS/gateway foreground recovery: reconnect immediately on foreground return after stale background sockets are torn down, so the app no longer stays disconnected until a later wake path happens. (#41384) Thanks @mbelinky. - Gateway/Control UI: keep dashboard auth tokens in session-scoped browser storage so same-tab refreshes preserve remote token auth without restoring long-lived localStorage token persistence, while scoping tokens to the selected gateway URL and fragment-only bootstrap flow. (#40892) thanks @velvet-shark. diff --git a/package.json b/package.json index b27e8247b5c..22f60579ef8 100644 --- a/package.json +++ b/package.json @@ -419,6 +419,11 @@ "@napi-rs/canvas": "^0.1.89", "node-llama-cpp": "3.16.2" }, + "peerDependenciesMeta": { + "node-llama-cpp": { + "optional": true + } + }, "engines": { "node": ">=22.16.0" }, diff --git a/scripts/openclaw-npm-release-check.ts b/scripts/openclaw-npm-release-check.ts index 267558a0d0d..fcd2dc8e7e1 100644 --- a/scripts/openclaw-npm-release-check.ts +++ b/scripts/openclaw-npm-release-check.ts @@ -11,6 +11,8 @@ type PackageJson = { license?: string; repository?: { url?: string } | string; bin?: Record; + peerDependencies?: Record; + peerDependenciesMeta?: Record; }; export type ParsedReleaseVersion = { @@ -140,6 +142,16 @@ export function collectReleasePackageMetadataErrors(pkg: PackageJson): string[] `package.json bin.openclaw must be "openclaw.mjs"; found "${pkg.bin?.openclaw ?? ""}".`, ); } + if (pkg.peerDependencies?.["node-llama-cpp"] !== "3.16.2") { + errors.push( + `package.json peerDependencies["node-llama-cpp"] must be "3.16.2"; found "${ + pkg.peerDependencies?.["node-llama-cpp"] ?? "" + }".`, + ); + } + if (pkg.peerDependenciesMeta?.["node-llama-cpp"]?.optional !== true) { + errors.push('package.json peerDependenciesMeta["node-llama-cpp"].optional must be true.'); + } return errors; } diff --git a/test/openclaw-npm-release-check.test.ts b/test/openclaw-npm-release-check.test.ts index 50f4cb7a5ab..66cf7d9b5cf 100644 --- a/test/openclaw-npm-release-check.test.ts +++ b/test/openclaw-npm-release-check.test.ts @@ -86,7 +86,22 @@ describe("collectReleasePackageMetadataErrors", () => { license: "MIT", repository: { url: "git+https://github.com/openclaw/openclaw.git" }, bin: { openclaw: "openclaw.mjs" }, + peerDependencies: { "node-llama-cpp": "3.16.2" }, + peerDependenciesMeta: { "node-llama-cpp": { optional: true } }, }), ).toEqual([]); }); + + it("requires node-llama-cpp to stay an optional peer", () => { + expect( + collectReleasePackageMetadataErrors({ + name: "openclaw", + description: "Multi-channel AI gateway with extensible messaging integrations", + license: "MIT", + repository: { url: "git+https://github.com/openclaw/openclaw.git" }, + bin: { openclaw: "openclaw.mjs" }, + peerDependencies: { "node-llama-cpp": "3.16.2" }, + }), + ).toContain('package.json peerDependenciesMeta["node-llama-cpp"].optional must be true.'); + }); });