@remnic/cli 9.69.31 → 9.69.32

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 +15 -6
  2. package/package.json +32 -32
package/dist/index.js CHANGED
@@ -2646,6 +2646,10 @@ async function computeConvergePlan(options = {}) {
2646
2646
  return collapseActiveFactDuplicates(plan, localManifests, peerManifests, semanticAgreementMap);
2647
2647
  }
2648
2648
  async function executeConvergeApply(options = {}) {
2649
+ const rawConcurrency = Number(process.env.REMNIC_CONVERGE_TRANSFER_CONCURRENCY ?? 8);
2650
+ if (!Number.isInteger(rawConcurrency) || rawConcurrency < 1) {
2651
+ throw new Error("converge: REMNIC_CONVERGE_TRANSFER_CONCURRENCY must be a positive integer");
2652
+ }
2649
2653
  const conflictPolicy = options.conflictPolicy ?? options.config?.converge.conflictPolicy ?? DEFAULT_CONVERGE_CONFLICT_POLICY;
2650
2654
  const plan = await computeConvergePlan({ ...options, conflictPolicy });
2651
2655
  if (plan.converged && !options.dryRun) {
@@ -2727,8 +2731,7 @@ async function executeConvergeApply(options = {}) {
2727
2731
  } catch {
2728
2732
  }
2729
2733
  }
2730
- for (const entry of plan.entries) {
2731
- if (entry.action === "identical") continue;
2734
+ const executeTransferEntry = async (entry) => {
2732
2735
  let transferType = "none";
2733
2736
  if (entry.action === "pull") {
2734
2737
  transferType = "pull";
@@ -2769,7 +2772,7 @@ async function executeConvergeApply(options = {}) {
2769
2772
  }
2770
2773
  if (!remoteFile || entry.peerSha256 && remoteFile.sha256 !== entry.peerSha256) {
2771
2774
  actualTransfers.failed += 1;
2772
- continue;
2775
+ return;
2773
2776
  }
2774
2777
  let namespaceFiles = options.localFileBuffers.get(entry.namespace);
2775
2778
  if (!namespaceFiles) {
@@ -2779,12 +2782,12 @@ async function executeConvergeApply(options = {}) {
2779
2782
  namespaceFiles.set(localPath, remoteFile.content);
2780
2783
  if (entry.action === "conflict") actualTransfers.conflictsResolved += 1;
2781
2784
  else actualTransfers.pulled += 1;
2782
- continue;
2785
+ return;
2783
2786
  }
2784
2787
  const rootDir = rootMap.get(entry.namespace);
2785
2788
  if (!rootDir) {
2786
2789
  actualTransfers.failed += 1;
2787
- continue;
2790
+ return;
2788
2791
  }
2789
2792
  const io = await createOfflineStorageIo(rootDir);
2790
2793
  const expectedLocalSha256 = entry.action === "conflict" ? entry.localSha256 : entry.baseSha256;
@@ -2902,7 +2905,7 @@ async function executeConvergeApply(options = {}) {
2902
2905
  while (chunkOffset < offset) {
2903
2906
  const skipped = await chunks.next();
2904
2907
  if (skipped.done || chunkOffset + skipped.value.length > offset) {
2905
- throw new Error(`cannot resume local file upload at offset ${offset}: ${localPath}`);
2908
+ throw new Error(`upload resume failed at ${offset}: ${localPath}`);
2906
2909
  }
2907
2910
  chunkOffset += skipped.value.length;
2908
2911
  }
@@ -3060,6 +3063,12 @@ async function executeConvergeApply(options = {}) {
3060
3063
  if (suppressed) actualTransfers.suppressed += 1;
3061
3064
  else actualTransfers.failed += 1;
3062
3065
  }
3066
+ };
3067
+ const TRANSFER_BATCH_SIZE = rawConcurrency;
3068
+ const actionable = plan.entries.filter((entry) => entry.action !== "identical");
3069
+ for (let i = 0; i < actionable.length; i += TRANSFER_BATCH_SIZE) {
3070
+ const batch = actionable.slice(i, i + TRANSFER_BATCH_SIZE);
3071
+ await Promise.all(batch.map((entry) => executeTransferEntry(entry)));
3063
3072
  }
3064
3073
  if (options.peerUrl && peerMutatedNamespaces.size > 0) {
3065
3074
  const namespaces = [...peerMutatedNamespaces].sort();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/cli",
3
- "version": "9.69.31",
3
+ "version": "9.69.32",
4
4
  "description": "CLI for Remnic memory — init, query, doctor, daemon management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,26 +26,26 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "yaml": "^2.4.2",
29
- "@remnic/server": "^9.69.31",
30
- "@remnic/core": "^9.69.31",
31
- "@remnic/plugin-pi": "^9.69.31"
29
+ "@remnic/server": "^9.69.32",
30
+ "@remnic/core": "^9.69.32",
31
+ "@remnic/plugin-pi": "^9.69.32"
32
32
  },
33
33
  "peerDependencies": {
34
- "@remnic/bench": "^9.69.31",
35
- "@remnic/plugin-openclaw": "^9.69.31",
36
- "@remnic/export-weclone": "^9.69.31",
37
- "@remnic/import-weclone": "^9.69.31",
38
- "@remnic/import-chatgpt": "^9.69.31",
39
- "@remnic/import-claude": "^9.69.31",
40
- "@remnic/import-gemini": "^9.69.31",
41
- "@remnic/import-lossless-claw": "^9.69.31",
42
- "@remnic/import-mem0": "^9.69.31",
43
- "@remnic/import-supermemory": "^9.69.31",
44
- "@remnic/import-okf": "^9.69.31",
45
- "@remnic/connector-limitless": "^9.69.31",
46
- "@remnic/connector-bee": "^9.69.31",
47
- "@remnic/connector-omi": "^9.69.31",
48
- "@remnic/capture-audio": "^9.69.31"
34
+ "@remnic/bench": "^9.69.32",
35
+ "@remnic/plugin-openclaw": "^9.69.32",
36
+ "@remnic/export-weclone": "^9.69.32",
37
+ "@remnic/import-weclone": "^9.69.32",
38
+ "@remnic/import-chatgpt": "^9.69.32",
39
+ "@remnic/import-claude": "^9.69.32",
40
+ "@remnic/import-gemini": "^9.69.32",
41
+ "@remnic/import-lossless-claw": "^9.69.32",
42
+ "@remnic/import-mem0": "^9.69.32",
43
+ "@remnic/import-supermemory": "^9.69.32",
44
+ "@remnic/import-okf": "^9.69.32",
45
+ "@remnic/connector-limitless": "^9.69.32",
46
+ "@remnic/connector-bee": "^9.69.32",
47
+ "@remnic/connector-omi": "^9.69.32",
48
+ "@remnic/capture-audio": "^9.69.32"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "@remnic/bench": {
@@ -97,19 +97,19 @@
97
97
  "devDependencies": {
98
98
  "tsup": "^8.5.1",
99
99
  "typescript": "^5.9.3",
100
- "@remnic/bench": "9.69.31",
101
- "@remnic/plugin-openclaw": "9.69.31",
102
- "@remnic/export-weclone": "9.69.31",
103
- "@remnic/import-weclone": "9.69.31",
104
- "@remnic/import-claude": "9.69.31",
105
- "@remnic/import-mem0": "9.69.31",
106
- "@remnic/import-lossless-claw": "9.69.31",
107
- "@remnic/connector-limitless": "9.69.31",
108
- "@remnic/import-chatgpt": "9.69.31",
109
- "@remnic/import-supermemory": "9.69.31",
110
- "@remnic/import-gemini": "9.69.31",
111
- "@remnic/connector-bee": "9.69.31",
112
- "@remnic/connector-omi": "9.69.31"
100
+ "@remnic/bench": "9.69.32",
101
+ "@remnic/plugin-openclaw": "9.69.32",
102
+ "@remnic/export-weclone": "9.69.32",
103
+ "@remnic/import-weclone": "9.69.32",
104
+ "@remnic/import-chatgpt": "9.69.32",
105
+ "@remnic/import-claude": "9.69.32",
106
+ "@remnic/import-gemini": "9.69.32",
107
+ "@remnic/import-supermemory": "9.69.32",
108
+ "@remnic/import-lossless-claw": "9.69.32",
109
+ "@remnic/connector-limitless": "9.69.32",
110
+ "@remnic/import-mem0": "9.69.32",
111
+ "@remnic/connector-bee": "9.69.32",
112
+ "@remnic/connector-omi": "9.69.32"
113
113
  },
114
114
  "license": "MIT",
115
115
  "repository": {