fix: make node-llama-cpp optional for npm installs
This commit is contained in:
@@ -82,6 +82,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### 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.
|
- 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.
|
- 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.
|
- 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.
|
||||||
|
|||||||
@@ -419,6 +419,11 @@
|
|||||||
"@napi-rs/canvas": "^0.1.89",
|
"@napi-rs/canvas": "^0.1.89",
|
||||||
"node-llama-cpp": "3.16.2"
|
"node-llama-cpp": "3.16.2"
|
||||||
},
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"node-llama-cpp": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.16.0"
|
"node": ">=22.16.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ type PackageJson = {
|
|||||||
license?: string;
|
license?: string;
|
||||||
repository?: { url?: string } | string;
|
repository?: { url?: string } | string;
|
||||||
bin?: Record<string, string>;
|
bin?: Record<string, string>;
|
||||||
|
peerDependencies?: Record<string, string>;
|
||||||
|
peerDependenciesMeta?: Record<string, { optional?: boolean }>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ParsedReleaseVersion = {
|
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 ?? ""}".`,
|
`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;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,22 @@ describe("collectReleasePackageMetadataErrors", () => {
|
|||||||
license: "MIT",
|
license: "MIT",
|
||||||
repository: { url: "git+https://github.com/openclaw/openclaw.git" },
|
repository: { url: "git+https://github.com/openclaw/openclaw.git" },
|
||||||
bin: { openclaw: "openclaw.mjs" },
|
bin: { openclaw: "openclaw.mjs" },
|
||||||
|
peerDependencies: { "node-llama-cpp": "3.16.2" },
|
||||||
|
peerDependenciesMeta: { "node-llama-cpp": { optional: true } },
|
||||||
}),
|
}),
|
||||||
).toEqual([]);
|
).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.');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user