@lark-apaas/openclaw-scripts-diagnose-cli 0.1.4 → 0.1.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -53,7 +53,7 @@ let json_diff = require("json-diff");
|
|
|
53
53
|
* it terse and parseable.
|
|
54
54
|
*/
|
|
55
55
|
function getVersion() {
|
|
56
|
-
return "0.1.
|
|
56
|
+
return "0.1.5-alpha.1";
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/rule-engine/base.ts
|
|
@@ -2995,6 +2995,7 @@ async function installExtension(tag, ossFileMap, opts = {}) {
|
|
|
2995
2995
|
else console.error(`[install-extension] skipConfigUpdate=true — not touching openclaw.json`);
|
|
2996
2996
|
console.error(`[install-extension] done ${targets.length}/${targets.length} in ${Date.now() - t0}ms`);
|
|
2997
2997
|
}
|
|
2998
|
+
const MEM0_PLUGIN_NAME = "openclaw-mem0-plugin";
|
|
2998
2999
|
/**
|
|
2999
3000
|
* Merge each installed extension's installMetadata into openclaw.json's
|
|
3000
3001
|
* plugins.installs[<pkg.name>]. Atomic write via tmp + rename.
|
|
@@ -3002,6 +3003,11 @@ async function installExtension(tag, ossFileMap, opts = {}) {
|
|
|
3002
3003
|
* - No openclaw.json → log + return (not an error; some install contexts don't have it yet)
|
|
3003
3004
|
* - Extension without installMetadata in manifest → skip that entry (log)
|
|
3004
3005
|
* - Existing plugins.installs entries for other extensions left untouched
|
|
3006
|
+
*
|
|
3007
|
+
* Special-case for mem0: when openclaw-mem0-plugin is among the installed
|
|
3008
|
+
* targets, also append it to plugins.allow (idempotent) and seed
|
|
3009
|
+
* plugins.entries.openclaw-mem0-plugin = { enabled: false } when the key
|
|
3010
|
+
* is absent. Existing values are preserved (user toggles survive).
|
|
3005
3011
|
*/
|
|
3006
3012
|
function updatePluginInstalls(configPath, installedPkgs) {
|
|
3007
3013
|
if (!node_fs.default.existsSync(configPath)) {
|
|
@@ -3021,6 +3027,15 @@ function updatePluginInstalls(configPath, installedPkgs) {
|
|
|
3021
3027
|
installs[pkg.name] = pkg.installMetadata;
|
|
3022
3028
|
updated++;
|
|
3023
3029
|
} else skipped++;
|
|
3030
|
+
if (installedPkgs.some((p) => p.name === MEM0_PLUGIN_NAME)) {
|
|
3031
|
+
const allowRaw = plugins.allow;
|
|
3032
|
+
const allow = Array.isArray(allowRaw) ? allowRaw : [];
|
|
3033
|
+
if (!allow.filter((e) => typeof e === "string").includes(MEM0_PLUGIN_NAME)) allow.push(MEM0_PLUGIN_NAME);
|
|
3034
|
+
plugins.allow = allow;
|
|
3035
|
+
if (!plugins.entries || typeof plugins.entries !== "object" || Array.isArray(plugins.entries)) plugins.entries = {};
|
|
3036
|
+
const entries = plugins.entries;
|
|
3037
|
+
if (!(MEM0_PLUGIN_NAME in entries)) entries[MEM0_PLUGIN_NAME] = { enabled: false };
|
|
3038
|
+
}
|
|
3024
3039
|
const tmpPath = configPath + ".installs-tmp";
|
|
3025
3040
|
node_fs.default.writeFileSync(tmpPath, JSON.stringify(config, null, 2), "utf-8");
|
|
3026
3041
|
moveSafe(tmpPath, configPath);
|
|
@@ -4297,7 +4312,7 @@ async function reportCliRun(opts) {
|
|
|
4297
4312
|
//#region src/help.ts
|
|
4298
4313
|
const BIN = "mclaw-diagnose";
|
|
4299
4314
|
function versionBanner() {
|
|
4300
|
-
return `v0.1.
|
|
4315
|
+
return `v0.1.5-alpha.1`;
|
|
4301
4316
|
}
|
|
4302
4317
|
const COMMANDS = [
|
|
4303
4318
|
{
|