@xdarkicex/openclaw-memory-libravdb 1.4.47 → 1.4.49
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 +6 -2
- package/dist/ingest-queue.js +9 -3
- package/dist/sidecar.js +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38262,12 +38262,12 @@ var IngestQueue = class {
|
|
|
38262
38262
|
});
|
|
38263
38263
|
}
|
|
38264
38264
|
for (let i = 0; i < chunks.length; i++) {
|
|
38265
|
-
const
|
|
38265
|
+
const isFirst = i === 0;
|
|
38266
38266
|
const chunkParams = {
|
|
38267
38267
|
...baseParams,
|
|
38268
38268
|
sourceDoc,
|
|
38269
38269
|
text: chunks[i].text,
|
|
38270
|
-
mode:
|
|
38270
|
+
mode: isFirst ? IngestMode.REPLACE : IngestMode.APPEND
|
|
38271
38271
|
};
|
|
38272
38272
|
await this.ingestWithRetry(chunkParams);
|
|
38273
38273
|
}
|
|
@@ -38292,6 +38292,9 @@ var IngestQueue = class {
|
|
|
38292
38292
|
}
|
|
38293
38293
|
};
|
|
38294
38294
|
function splitIntoChunks(text, maxTokens) {
|
|
38295
|
+
if (!(maxTokens > 0)) {
|
|
38296
|
+
return [{ text, ordinal: 0 }];
|
|
38297
|
+
}
|
|
38295
38298
|
const maxChars = maxTokens * 4;
|
|
38296
38299
|
if (text.length <= maxChars) {
|
|
38297
38300
|
return [{ text, ordinal: 0 }];
|
|
@@ -39427,6 +39430,7 @@ var SidecarSupervisor = class {
|
|
|
39427
39430
|
async start() {
|
|
39428
39431
|
const endpoint = await this.runtime.resolveEndpoint(this.cfg);
|
|
39429
39432
|
const socket = await this.connectEndpointWithRetry(endpoint);
|
|
39433
|
+
this.retries = 0;
|
|
39430
39434
|
this.reconnectScheduled = false;
|
|
39431
39435
|
if (this.socket instanceof SupervisorSocket) {
|
|
39432
39436
|
this.socket.bind(socket);
|
package/dist/ingest-queue.js
CHANGED
|
@@ -34,14 +34,15 @@ export class IngestQueue {
|
|
|
34
34
|
mode: IngestMode.REPLACE,
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
// Multiple chunks:
|
|
37
|
+
// Multiple chunks: clear the source once, then append the remaining chunks.
|
|
38
|
+
// Sending REPLACE last deletes the earlier chunks from the same source_doc.
|
|
38
39
|
for (let i = 0; i < chunks.length; i++) {
|
|
39
|
-
const
|
|
40
|
+
const isFirst = i === 0;
|
|
40
41
|
const chunkParams = {
|
|
41
42
|
...baseParams,
|
|
42
43
|
sourceDoc,
|
|
43
44
|
text: chunks[i].text,
|
|
44
|
-
mode:
|
|
45
|
+
mode: isFirst ? IngestMode.REPLACE : IngestMode.APPEND,
|
|
45
46
|
};
|
|
46
47
|
await this.ingestWithRetry(chunkParams);
|
|
47
48
|
}
|
|
@@ -55,6 +56,11 @@ export class IngestQueue {
|
|
|
55
56
|
}
|
|
56
57
|
function splitIntoChunks(text, maxTokens) {
|
|
57
58
|
// Approximate: 4 chars per token for typical English text
|
|
59
|
+
// Guard: zero/negative budget would make maxChars <= 0, causing an infinite
|
|
60
|
+
// loop because the offset never advances past an empty slice.
|
|
61
|
+
if (!(maxTokens > 0)) {
|
|
62
|
+
return [{ text, ordinal: 0 }];
|
|
63
|
+
}
|
|
58
64
|
const maxChars = maxTokens * 4;
|
|
59
65
|
if (text.length <= maxChars) {
|
|
60
66
|
return [{ text, ordinal: 0 }];
|
package/dist/sidecar.js
CHANGED
|
@@ -207,6 +207,7 @@ class SidecarSupervisor {
|
|
|
207
207
|
async start() {
|
|
208
208
|
const endpoint = await this.runtime.resolveEndpoint(this.cfg);
|
|
209
209
|
const socket = await this.connectEndpointWithRetry(endpoint);
|
|
210
|
+
this.retries = 0;
|
|
210
211
|
this.reconnectScheduled = false;
|
|
211
212
|
if (this.socket instanceof SupervisorSocket) {
|
|
212
213
|
this.socket.bind(socket);
|
package/openclaw.plugin.json
CHANGED