@remnic/cli 9.69.88 → 9.69.89
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.js +50 -15
- package/package.json +32 -32
package/dist/index.js
CHANGED
|
@@ -16214,31 +16214,66 @@ function chunkOfflineChangesetApplyBatches(changeset, namespace, maxRequestBytes
|
|
|
16214
16214
|
if (!Number.isInteger(maxRequestBytes) || maxRequestBytes < 1) {
|
|
16215
16215
|
throw new Error("offline sync apply max request bytes must be a positive integer");
|
|
16216
16216
|
}
|
|
16217
|
-
const
|
|
16218
|
-
|
|
16219
|
-
const
|
|
16217
|
+
const items = [];
|
|
16218
|
+
const itemIndexByDir = /* @__PURE__ */ new Map();
|
|
16219
|
+
for (const change of changeset.changes) {
|
|
16220
|
+
const membership = embeddingGenerationMembership2(change.path);
|
|
16221
|
+
if (!membership) {
|
|
16222
|
+
items.push({ changes: [change], shardDir: null });
|
|
16223
|
+
continue;
|
|
16224
|
+
}
|
|
16225
|
+
const existing = itemIndexByDir.get(membership.shardDir);
|
|
16226
|
+
if (existing !== void 0) {
|
|
16227
|
+
items[existing].changes.push(change);
|
|
16228
|
+
continue;
|
|
16229
|
+
}
|
|
16230
|
+
itemIndexByDir.set(membership.shardDir, items.length);
|
|
16231
|
+
items.push({ changes: [change], shardDir: membership.shardDir });
|
|
16232
|
+
}
|
|
16233
|
+
const manifestFor = (dirs) => (changeset.embeddingGenerations ?? []).filter((generation) => dirs.has(generation.shardDir));
|
|
16234
|
+
const requestBytesFor = (changes, dirs) => Buffer.byteLength(JSON.stringify({
|
|
16220
16235
|
namespace,
|
|
16221
16236
|
changeset: {
|
|
16222
16237
|
...changeset,
|
|
16223
|
-
changes
|
|
16238
|
+
changes,
|
|
16239
|
+
embeddingGenerations: manifestFor(dirs)
|
|
16224
16240
|
}
|
|
16225
16241
|
}), "utf-8");
|
|
16226
|
-
|
|
16227
|
-
|
|
16228
|
-
|
|
16229
|
-
|
|
16230
|
-
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16242
|
+
const chunks = [];
|
|
16243
|
+
let current = [];
|
|
16244
|
+
const currentDirs = /* @__PURE__ */ new Set();
|
|
16245
|
+
const flush = () => {
|
|
16246
|
+
chunks.push({ ...changeset, changes: current, embeddingGenerations: manifestFor(currentDirs) });
|
|
16247
|
+
current = [];
|
|
16248
|
+
currentDirs.clear();
|
|
16249
|
+
};
|
|
16250
|
+
for (const item of items) {
|
|
16251
|
+
if (current.length > 0) {
|
|
16252
|
+
const nextDirs = /* @__PURE__ */ new Set([...currentDirs, ...item.shardDir ? [item.shardDir] : []]);
|
|
16253
|
+
if (requestBytesFor([...current, ...item.changes], nextDirs) > maxRequestBytes) {
|
|
16254
|
+
flush();
|
|
16255
|
+
}
|
|
16256
|
+
}
|
|
16257
|
+
const singleDirs = new Set(item.shardDir ? [item.shardDir] : []);
|
|
16258
|
+
if (requestBytesFor(item.changes, singleDirs) > maxRequestBytes) {
|
|
16259
|
+
if (item.shardDir) {
|
|
16260
|
+
const generationBytes = item.changes.reduce(
|
|
16261
|
+
(total, change) => total + (change.type === "upsert" ? change.file.bytes : 0),
|
|
16262
|
+
0
|
|
16263
|
+
);
|
|
16264
|
+
throw new Error(
|
|
16265
|
+
`offline sync push aborted before any request: embedding generation ${item.shardDir} (${generationBytes} bytes of shards plus sync overhead) exceeds the apply request budget of ${maxRequestBytes} bytes and cannot be split without exposing a mixed generation. Oversized generations need the secure staged chunk transport (planned; chunks land in a private staging root and publish through the atomic generation swap), not final-path upload \u2014 retry after the index shrinks below the budget.`
|
|
16266
|
+
);
|
|
16267
|
+
}
|
|
16234
16268
|
throw new Error(
|
|
16235
|
-
`offline sync change for ${
|
|
16269
|
+
`offline sync change for ${item.changes[0].path} exceeds the apply request size budget; retry after direct-push threshold is lowered`
|
|
16236
16270
|
);
|
|
16237
16271
|
}
|
|
16238
|
-
current.push(
|
|
16272
|
+
current.push(...item.changes);
|
|
16273
|
+
if (item.shardDir) currentDirs.add(item.shardDir);
|
|
16239
16274
|
}
|
|
16240
16275
|
if (current.length > 0) {
|
|
16241
|
-
|
|
16276
|
+
flush();
|
|
16242
16277
|
}
|
|
16243
16278
|
return chunks;
|
|
16244
16279
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/cli",
|
|
3
|
-
"version": "9.69.
|
|
3
|
+
"version": "9.69.89",
|
|
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/
|
|
30
|
-
"@remnic/
|
|
31
|
-
"@remnic/
|
|
29
|
+
"@remnic/plugin-pi": "^9.69.89",
|
|
30
|
+
"@remnic/core": "^9.69.89",
|
|
31
|
+
"@remnic/server": "^9.69.89"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@remnic/bench": "^9.69.
|
|
35
|
-
"@remnic/plugin-openclaw": "^9.69.
|
|
36
|
-
"@remnic/export-weclone": "^9.69.
|
|
37
|
-
"@remnic/import-weclone": "^9.69.
|
|
38
|
-
"@remnic/import-chatgpt": "^9.69.
|
|
39
|
-
"@remnic/import-claude": "^9.69.
|
|
40
|
-
"@remnic/import-gemini": "^9.69.
|
|
41
|
-
"@remnic/import-lossless-claw": "^9.69.
|
|
42
|
-
"@remnic/import-mem0": "^9.69.
|
|
43
|
-
"@remnic/import-supermemory": "^9.69.
|
|
44
|
-
"@remnic/import-okf": "^9.69.
|
|
45
|
-
"@remnic/connector-limitless": "^9.69.
|
|
46
|
-
"@remnic/connector-bee": "^9.69.
|
|
47
|
-
"@remnic/connector-omi": "^9.69.
|
|
48
|
-
"@remnic/capture-audio": "^9.69.
|
|
34
|
+
"@remnic/bench": "^9.69.89",
|
|
35
|
+
"@remnic/plugin-openclaw": "^9.69.89",
|
|
36
|
+
"@remnic/export-weclone": "^9.69.89",
|
|
37
|
+
"@remnic/import-weclone": "^9.69.89",
|
|
38
|
+
"@remnic/import-chatgpt": "^9.69.89",
|
|
39
|
+
"@remnic/import-claude": "^9.69.89",
|
|
40
|
+
"@remnic/import-gemini": "^9.69.89",
|
|
41
|
+
"@remnic/import-lossless-claw": "^9.69.89",
|
|
42
|
+
"@remnic/import-mem0": "^9.69.89",
|
|
43
|
+
"@remnic/import-supermemory": "^9.69.89",
|
|
44
|
+
"@remnic/import-okf": "^9.69.89",
|
|
45
|
+
"@remnic/connector-limitless": "^9.69.89",
|
|
46
|
+
"@remnic/connector-bee": "^9.69.89",
|
|
47
|
+
"@remnic/connector-omi": "^9.69.89",
|
|
48
|
+
"@remnic/capture-audio": "^9.69.89"
|
|
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.
|
|
101
|
-
"@remnic/plugin-openclaw": "9.69.
|
|
102
|
-
"@remnic/export-weclone": "9.69.
|
|
103
|
-
"@remnic/import-weclone": "9.69.
|
|
104
|
-
"@remnic/import-
|
|
105
|
-
"@remnic/import-
|
|
106
|
-
"@remnic/import-
|
|
107
|
-
"@remnic/import-mem0": "9.69.
|
|
108
|
-
"@remnic/import-
|
|
109
|
-
"@remnic/import-
|
|
110
|
-
"@remnic/connector-
|
|
111
|
-
"@remnic/connector-
|
|
112
|
-
"@remnic/connector-
|
|
100
|
+
"@remnic/bench": "9.69.89",
|
|
101
|
+
"@remnic/plugin-openclaw": "9.69.89",
|
|
102
|
+
"@remnic/export-weclone": "9.69.89",
|
|
103
|
+
"@remnic/import-weclone": "9.69.89",
|
|
104
|
+
"@remnic/import-chatgpt": "9.69.89",
|
|
105
|
+
"@remnic/import-lossless-claw": "9.69.89",
|
|
106
|
+
"@remnic/import-gemini": "9.69.89",
|
|
107
|
+
"@remnic/import-mem0": "9.69.89",
|
|
108
|
+
"@remnic/import-claude": "9.69.89",
|
|
109
|
+
"@remnic/import-supermemory": "9.69.89",
|
|
110
|
+
"@remnic/connector-limitless": "9.69.89",
|
|
111
|
+
"@remnic/connector-omi": "9.69.89",
|
|
112
|
+
"@remnic/connector-bee": "9.69.89"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
115
|
"repository": {
|