@lark-apaas/openclaw-scripts-diagnose-cli 0.1.5-alpha.6 → 0.1.5-alpha.7

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.
Files changed (2) hide show
  1. package/dist/index.cjs +17 -2
  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.5-alpha.6";
56
+ return "0.1.5-alpha.7";
57
57
  }
58
58
  //#endregion
59
59
  //#region src/rule-engine/base.ts
@@ -2955,6 +2955,7 @@ async function installExtension(tag, ossFileMap, opts = {}) {
2955
2955
  else console.error(`[install-extension] skipConfigUpdate=true — not touching openclaw.json`);
2956
2956
  console.error(`[install-extension] done ${targets.length}/${targets.length} in ${Date.now() - t0}ms`);
2957
2957
  }
2958
+ const MEM0_PLUGIN_NAME = "openclaw-mem0-plugin";
2958
2959
  /**
2959
2960
  * Merge each installed extension's installMetadata into openclaw.json's
2960
2961
  * plugins.installs[<pkg.name>]. Atomic write via tmp + rename.
@@ -2962,6 +2963,11 @@ async function installExtension(tag, ossFileMap, opts = {}) {
2962
2963
  * - No openclaw.json → log + return (not an error; some install contexts don't have it yet)
2963
2964
  * - Extension without installMetadata in manifest → skip that entry (log)
2964
2965
  * - Existing plugins.installs entries for other extensions left untouched
2966
+ *
2967
+ * Special-case for mem0: when openclaw-mem0-plugin is among the installed
2968
+ * targets, also append it to plugins.allow (idempotent) and seed
2969
+ * plugins.entries.openclaw-mem0-plugin = { enabled: false } when the key
2970
+ * is absent. Existing values are preserved (user toggles survive).
2965
2971
  */
2966
2972
  function updatePluginInstalls(configPath, installedPkgs) {
2967
2973
  if (!node_fs.default.existsSync(configPath)) {
@@ -2981,6 +2987,15 @@ function updatePluginInstalls(configPath, installedPkgs) {
2981
2987
  installs[pkg.name] = pkg.installMetadata;
2982
2988
  updated++;
2983
2989
  } else skipped++;
2990
+ if (installedPkgs.some((p) => p.name === MEM0_PLUGIN_NAME)) {
2991
+ const allowRaw = plugins.allow;
2992
+ const allow = Array.isArray(allowRaw) ? allowRaw : [];
2993
+ if (!allow.filter((e) => typeof e === "string").includes(MEM0_PLUGIN_NAME)) allow.push(MEM0_PLUGIN_NAME);
2994
+ plugins.allow = allow;
2995
+ if (!plugins.entries || typeof plugins.entries !== "object" || Array.isArray(plugins.entries)) plugins.entries = {};
2996
+ const entries = plugins.entries;
2997
+ if (!(MEM0_PLUGIN_NAME in entries)) entries[MEM0_PLUGIN_NAME] = { enabled: false };
2998
+ }
2984
2999
  const tmpPath = configPath + ".installs-tmp";
2985
3000
  node_fs.default.writeFileSync(tmpPath, JSON.stringify(config, null, 2), "utf-8");
2986
3001
  moveSafe(tmpPath, configPath);
@@ -4257,7 +4272,7 @@ async function reportCliRun(opts) {
4257
4272
  //#region src/help.ts
4258
4273
  const BIN = "mclaw-diagnose";
4259
4274
  function versionBanner() {
4260
- return `v0.1.5-alpha.6`;
4275
+ return `v0.1.5-alpha.7`;
4261
4276
  }
4262
4277
  const COMMANDS = [
4263
4278
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/openclaw-scripts-diagnose-cli",
3
- "version": "0.1.5-alpha.6",
3
+ "version": "0.1.5-alpha.7",
4
4
  "description": "CLI for OpenClaw config diagnose and repair with JSON5 support",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {