@xdarkicex/openclaw-memory-libravdb 1.4.64 → 1.4.66
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/cli.js +7 -1
- package/dist/context-engine.js +6 -0
- package/dist/index.js +13 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,6 +6,7 @@ import { resolveIdentity } from "./identity.js";
|
|
|
6
6
|
import { formatError } from "./format-error.js";
|
|
7
7
|
import { promoteDreamDiaryFile } from "./dream-promotion.js";
|
|
8
8
|
import { buildMemoryRuntimeBridge } from "./memory-runtime.js";
|
|
9
|
+
const INDEX_REBUILD_TIMEOUT_MS = 5 * 60 * 1000;
|
|
9
10
|
export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
10
11
|
if (!api.registerCli) {
|
|
11
12
|
return;
|
|
@@ -244,7 +245,7 @@ function formatDeepStatusTableRows(deep) {
|
|
|
244
245
|
}
|
|
245
246
|
return rows;
|
|
246
247
|
}
|
|
247
|
-
async function runIndex(runtime,
|
|
248
|
+
async function runIndex(runtime, cfg, opts, logger, params = {}) {
|
|
248
249
|
if (!opts?.force) {
|
|
249
250
|
logger.error("LibraVDB index rebuild requires --force. This re-embeds all stored documents with the current model and may be slow.");
|
|
250
251
|
process.exitCode = 1;
|
|
@@ -260,6 +261,8 @@ async function runIndex(runtime, _cfg, opts, logger, params = {}) {
|
|
|
260
261
|
const result = await rpc.call("rebuild_index", {
|
|
261
262
|
namespace: namespace ?? "",
|
|
262
263
|
...(collections?.length ? { collections } : {}),
|
|
264
|
+
}, {
|
|
265
|
+
timeoutMs: resolveIndexRebuildTimeoutMs(cfg),
|
|
263
266
|
});
|
|
264
267
|
if (!params.quiet) {
|
|
265
268
|
console.log(`Collections processed: ${result.collectionsProcessed ?? 0}`);
|
|
@@ -281,6 +284,9 @@ async function runIndex(runtime, _cfg, opts, logger, params = {}) {
|
|
|
281
284
|
process.exitCode = 1;
|
|
282
285
|
}
|
|
283
286
|
}
|
|
287
|
+
function resolveIndexRebuildTimeoutMs(cfg) {
|
|
288
|
+
return Math.max(INDEX_REBUILD_TIMEOUT_MS, cfg.rpcTimeoutMs ?? 0);
|
|
289
|
+
}
|
|
284
290
|
async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
285
291
|
const query = opts?.query?.trim() || queryArg?.trim();
|
|
286
292
|
if (!query) {
|
package/dist/context-engine.js
CHANGED
|
@@ -108,6 +108,12 @@ function selectAfterTurnMessages(messages, prePromptMessageCount, logger) {
|
|
|
108
108
|
}
|
|
109
109
|
const start = Math.floor(prePromptMessageCount);
|
|
110
110
|
if (start >= messages.length) {
|
|
111
|
+
if (messages.length > 0) {
|
|
112
|
+
logger?.warn?.(`LibraVDB afterTurn prePromptMessageCount consumed all messages; ` +
|
|
113
|
+
`forwarding latest message for compatibility ` +
|
|
114
|
+
`prePromptMessageCount=${prePromptMessageCount} start=${start} totalMessages=${messages.length}`);
|
|
115
|
+
return messages.slice(-1);
|
|
116
|
+
}
|
|
111
117
|
logger?.warn?.(`LibraVDB afterTurn prePromptMessageCount produced zero forwarded messages ` +
|
|
112
118
|
`prePromptMessageCount=${prePromptMessageCount} start=${start} totalMessages=${messages.length}`);
|
|
113
119
|
return [];
|
package/dist/index.js
CHANGED
|
@@ -33185,6 +33185,7 @@ function normalizeNumber(value) {
|
|
|
33185
33185
|
}
|
|
33186
33186
|
|
|
33187
33187
|
// src/cli.ts
|
|
33188
|
+
var INDEX_REBUILD_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
33188
33189
|
function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
33189
33190
|
if (!api.registerCli) {
|
|
33190
33191
|
return;
|
|
@@ -33397,7 +33398,7 @@ function formatDeepStatusTableRows(deep) {
|
|
|
33397
33398
|
}
|
|
33398
33399
|
return rows;
|
|
33399
33400
|
}
|
|
33400
|
-
async function runIndex(runtime,
|
|
33401
|
+
async function runIndex(runtime, cfg, opts, logger, params = {}) {
|
|
33401
33402
|
if (!opts?.force) {
|
|
33402
33403
|
logger.error("LibraVDB index rebuild requires --force. This re-embeds all stored documents with the current model and may be slow.");
|
|
33403
33404
|
process.exitCode = 1;
|
|
@@ -33410,6 +33411,8 @@ async function runIndex(runtime, _cfg, opts, logger, params = {}) {
|
|
|
33410
33411
|
const result = await rpc.call("rebuild_index", {
|
|
33411
33412
|
namespace: namespace ?? "",
|
|
33412
33413
|
...collections?.length ? { collections } : {}
|
|
33414
|
+
}, {
|
|
33415
|
+
timeoutMs: resolveIndexRebuildTimeoutMs(cfg)
|
|
33413
33416
|
});
|
|
33414
33417
|
if (!params.quiet) {
|
|
33415
33418
|
console.log(`Collections processed: ${result.collectionsProcessed ?? 0}`);
|
|
@@ -33430,6 +33433,9 @@ async function runIndex(runtime, _cfg, opts, logger, params = {}) {
|
|
|
33430
33433
|
process.exitCode = 1;
|
|
33431
33434
|
}
|
|
33432
33435
|
}
|
|
33436
|
+
function resolveIndexRebuildTimeoutMs(cfg) {
|
|
33437
|
+
return Math.max(INDEX_REBUILD_TIMEOUT_MS, cfg.rpcTimeoutMs ?? 0);
|
|
33438
|
+
}
|
|
33433
33439
|
async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
33434
33440
|
const query = opts?.query?.trim() || queryArg?.trim();
|
|
33435
33441
|
if (!query) {
|
|
@@ -33761,6 +33767,12 @@ function selectAfterTurnMessages(messages, prePromptMessageCount, logger) {
|
|
|
33761
33767
|
}
|
|
33762
33768
|
const start = Math.floor(prePromptMessageCount);
|
|
33763
33769
|
if (start >= messages.length) {
|
|
33770
|
+
if (messages.length > 0) {
|
|
33771
|
+
logger?.warn?.(
|
|
33772
|
+
`LibraVDB afterTurn prePromptMessageCount consumed all messages; forwarding latest message for compatibility prePromptMessageCount=${prePromptMessageCount} start=${start} totalMessages=${messages.length}`
|
|
33773
|
+
);
|
|
33774
|
+
return messages.slice(-1);
|
|
33775
|
+
}
|
|
33764
33776
|
logger?.warn?.(
|
|
33765
33777
|
`LibraVDB afterTurn prePromptMessageCount produced zero forwarded messages prePromptMessageCount=${prePromptMessageCount} start=${start} totalMessages=${messages.length}`
|
|
33766
33778
|
);
|
package/openclaw.plugin.json
CHANGED