@remnic/cli 1.0.6 → 1.0.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.js +56 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3735,6 +3735,10 @@ function resolveOpenclawPluginDir(cliPath) {
3735
3735
  if (cliPath) return path8.resolve(expandTilde(cliPath));
3736
3736
  return path8.join(resolveHomeDir(), ".openclaw", "extensions", REMNIC_OPENCLAW_PLUGIN_ID);
3737
3737
  }
3738
+ function resolveOpenclawLegacyPluginDir(cliPath) {
3739
+ if (cliPath) return path8.resolve(expandTilde(cliPath));
3740
+ return path8.join(resolveHomeDir(), ".openclaw", "extensions", REMNIC_OPENCLAW_LEGACY_PLUGIN_ID);
3741
+ }
3738
3742
  function formatOpenclawUpgradeStamp(now = /* @__PURE__ */ new Date()) {
3739
3743
  const yyyy = now.getFullYear().toString();
3740
3744
  const mm = String(now.getMonth() + 1).padStart(2, "0");
@@ -6562,6 +6566,7 @@ Note: The legacy '${REMNIC_OPENCLAW_LEGACY_PLUGIN_ID}' entry has been kept along
6562
6566
  async function cmdOpenclawUpgrade(opts) {
6563
6567
  const configPath = resolveOpenclawConfigPath(opts.configPath);
6564
6568
  const pluginDir = resolveOpenclawPluginDir(opts.pluginDir);
6569
+ const legacyPluginDirForBackup = opts.legacyPluginDirForBackup ? resolveOpenclawLegacyPluginDir(opts.legacyPluginDirForBackup) : void 0;
6565
6570
  const fallbackMemoryDir = path8.join(resolveHomeDir(), ".openclaw", "workspace", "memory", "local");
6566
6571
  const packageSpec = `@remnic/plugin-openclaw@${opts.version ?? "latest"}`;
6567
6572
  const existingConfig = readOpenclawConfig(configPath);
@@ -6575,14 +6580,22 @@ async function cmdOpenclawUpgrade(opts) {
6575
6580
  );
6576
6581
  const configBackupPath = path8.join(backupDir, "openclaw.json");
6577
6582
  const pluginBackupDir = path8.join(backupDir, "extensions", REMNIC_OPENCLAW_PLUGIN_ID);
6583
+ const legacyPluginBackupDir = legacyPluginDirForBackup ? path8.join(backupDir, "extensions", REMNIC_OPENCLAW_LEGACY_PLUGIN_ID) : void 0;
6578
6584
  assertDirectoryPathOrMissing(pluginDir, "OpenClaw plugin dir");
6585
+ if (legacyPluginDirForBackup) {
6586
+ assertDirectoryPathOrMissing(legacyPluginDirForBackup, "Legacy OpenClaw plugin dir");
6587
+ }
6579
6588
  console.log(`OpenClaw config: ${configPath}`);
6580
6589
  console.log(`Plugin dir: ${pluginDir}`);
6590
+ if (legacyPluginDirForBackup) {
6591
+ console.log(`Legacy dir: ${legacyPluginDirForBackup}`);
6592
+ }
6581
6593
  console.log(`Memory dir: ${preservedMemoryDir}`);
6582
6594
  console.log(`Package spec: ${packageSpec}`);
6583
6595
  console.log(`Backup dir: ${backupDir}`);
6584
6596
  const plannedActions = [
6585
6597
  `backup openclaw.json and the existing ${REMNIC_OPENCLAW_PLUGIN_ID} extension`,
6598
+ ...legacyPluginDirForBackup ? [`backup the existing ${REMNIC_OPENCLAW_LEGACY_PLUGIN_ID} extension without modifying it`] : [],
6586
6599
  `npm pack ${packageSpec} and stage a clean plugin copy before swap`,
6587
6600
  `re-run remnic openclaw install with the preserved memory dir`,
6588
6601
  opts.restartGateway ? "restart the OpenClaw gateway with launchctl kickstart" : "leave gateway restart to the operator (--no-restart)"
@@ -6615,6 +6628,13 @@ async function cmdOpenclawUpgrade(opts) {
6615
6628
  } else {
6616
6629
  backupNotes.push(` No existing plugin dir found at ${pluginDir}; a fresh install will be staged`);
6617
6630
  }
6631
+ if (legacyPluginDirForBackup && legacyPluginBackupDir) {
6632
+ if (backupPathIfPresent(legacyPluginDirForBackup, legacyPluginBackupDir)) {
6633
+ backupNotes.push(`+ Backed up legacy plugin dir to ${legacyPluginBackupDir}`);
6634
+ } else {
6635
+ backupNotes.push(` No existing legacy plugin dir found at ${legacyPluginDirForBackup}; nothing to preserve`);
6636
+ }
6637
+ }
6618
6638
  let installResult;
6619
6639
  try {
6620
6640
  installResult = installPublishedOpenclawPlugin(packageSpec, pluginDir);
@@ -6680,6 +6700,22 @@ Installed published plugin from npm pack ${packageSpec}${installResult.version ?
6680
6700
  console.log(` launchctl kickstart -k gui/$(id -u)/${OPENCLAW_GATEWAY_LABEL}`);
6681
6701
  }
6682
6702
  }
6703
+ async function cmdOpenclawMigrateEngram(opts) {
6704
+ console.log(
6705
+ `Migrating legacy ${REMNIC_OPENCLAW_LEGACY_PLUGIN_ID} installs to ${REMNIC_OPENCLAW_PLUGIN_ID}.`
6706
+ );
6707
+ console.log(
6708
+ "The legacy config entry and extension directory are preserved for rollback and custom patch reference."
6709
+ );
6710
+ await cmdOpenclawUpgrade({
6711
+ ...opts,
6712
+ legacyPluginDirForBackup: opts.legacyPluginDirForBackup ?? resolveOpenclawLegacyPluginDir()
6713
+ });
6714
+ console.log("\nMigration notes:");
6715
+ console.log(` - plugins.entries["${REMNIC_OPENCLAW_PLUGIN_ID}"] is the canonical entry.`);
6716
+ console.log(` - plugins.entries["${REMNIC_OPENCLAW_LEGACY_PLUGIN_ID}"] is retained temporarily for rollback.`);
6717
+ console.log(" - Re-apply any local source patches to the new package only after verifying the published build.");
6718
+ }
6683
6719
  async function cmdTaxonomy(rest) {
6684
6720
  initLogger();
6685
6721
  const configPath = resolveConfigPath();
@@ -7531,28 +7567,38 @@ Run 'remnic capsule <subcommand> --help' for subcommand details.`);
7531
7567
  const memoryDir = resolveRequiredValueFlag(args, "--memory-dir");
7532
7568
  const configOverride = resolveRequiredValueFlag(args, "--config");
7533
7569
  await cmdOpenclawInstall({ yes, dryRun, memoryDir, configPath: configOverride });
7534
- } else if (subAction === "upgrade") {
7570
+ } else if (subAction === "upgrade" || subAction === "migrate-engram") {
7535
7571
  const yes = args.includes("--yes") || args.includes("-y") || args.includes("--force");
7536
7572
  const dryRun = args.includes("--dry-run");
7537
7573
  const memoryDir = resolveRequiredValueFlag(args, "--memory-dir");
7538
7574
  const configOverride = resolveRequiredValueFlag(args, "--config");
7539
7575
  const version = resolveRequiredValueFlag(args, "--version");
7540
7576
  const pluginDir = resolveRequiredValueFlag(args, "--plugin-dir");
7577
+ const legacyPluginDir = resolveRequiredValueFlag(args, "--legacy-plugin-dir");
7541
7578
  const restartGateway = !args.includes("--no-restart");
7542
- await cmdOpenclawUpgrade({
7579
+ const opts = {
7543
7580
  yes,
7544
7581
  dryRun,
7545
7582
  memoryDir,
7546
7583
  configPath: configOverride,
7547
7584
  pluginDir,
7548
7585
  version,
7549
- restartGateway
7550
- });
7586
+ restartGateway,
7587
+ legacyPluginDirForBackup: legacyPluginDir
7588
+ };
7589
+ if (subAction === "migrate-engram") {
7590
+ await cmdOpenclawMigrateEngram(opts);
7591
+ } else {
7592
+ await cmdOpenclawUpgrade(opts);
7593
+ }
7551
7594
  } else {
7552
- console.log(`Usage: remnic openclaw <install|upgrade>
7595
+ console.log(`Usage: remnic openclaw <install|upgrade|migrate-engram>
7553
7596
 
7554
7597
  install Configure OpenClaw to use Remnic as the memory plugin.
7555
7598
  upgrade Backup the current setup, refresh the published npm package, and re-apply the config.
7599
+ migrate-engram
7600
+ Migrate a legacy @joshuaswarren/openclaw-engram install to
7601
+ @remnic/plugin-openclaw while backing up the legacy extension.
7556
7602
 
7557
7603
  Sets plugins.entries["${REMNIC_OPENCLAW_PLUGIN_ID}"] and plugins.slots.memory
7558
7604
  in ~/.openclaw/openclaw.json (or $OPENCLAW_CONFIG_PATH).
@@ -7564,6 +7610,8 @@ Options:
7564
7610
  --config <path> Override OpenClaw config path
7565
7611
  --version <tag> Upgrade @remnic/plugin-openclaw from a specific npm tag/version
7566
7612
  --plugin-dir <path> Override OpenClaw extension dir (~/.openclaw/extensions/openclaw-remnic)
7613
+ --legacy-plugin-dir <path>
7614
+ Override legacy extension dir backed up by migrate-engram
7567
7615
  --no-restart Skip the final launchctl kickstart after upgrade`);
7568
7616
  }
7569
7617
  break;
@@ -7586,12 +7634,15 @@ Usage:
7586
7634
  remnic config Show current config
7587
7635
  remnic openclaw install Configure OpenClaw to use Remnic memory (sets slot + entry)
7588
7636
  remnic openclaw upgrade Safe OpenClaw npm upgrade with backups and gateway restart
7637
+ remnic openclaw migrate-engram
7638
+ Migrate legacy @joshuaswarren/openclaw-engram installs with legacy extension backup
7589
7639
  --yes / -y / --force Skip prompts
7590
7640
  --dry-run Preview changes without writing
7591
7641
  --memory-dir <path> Custom memory directory
7592
7642
  --config <path> Custom OpenClaw config path
7593
7643
  --version <tag> Upgrade @remnic/plugin-openclaw from a specific npm tag/version
7594
7644
  --plugin-dir <path> Custom OpenClaw extension directory
7645
+ --legacy-plugin-dir <path> Custom legacy extension directory for migration backup
7595
7646
  --no-restart Skip the final launchctl kickstart after upgrade
7596
7647
  remnic daemon <start|stop|restart|install|uninstall|status> Manage background server
7597
7648
  remnic token <generate|list|revoke> [connector-id] Manage auth tokens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "CLI for Remnic memory — init, query, doctor, daemon management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "yaml": "^2.4.2",
28
- "@remnic/core": "^1.1.5"
28
+ "@remnic/core": "^1.1.7"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@remnic/bench": "^1.0.0",
@@ -70,9 +70,9 @@
70
70
  "@remnic/export-weclone": "1.0.1",
71
71
  "@remnic/import-weclone": "1.0.1",
72
72
  "@remnic/import-chatgpt": "0.1.0",
73
+ "@remnic/import-claude": "0.1.0",
73
74
  "@remnic/import-gemini": "0.1.0",
74
75
  "@remnic/import-lossless-claw": "0.1.1",
75
- "@remnic/import-claude": "0.1.0",
76
76
  "@remnic/import-mem0": "0.1.0"
77
77
  },
78
78
  "license": "MIT",