@xdarkicex/openclaw-memory-libravdb 1.4.37 → 1.4.38
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 +6 -2
- package/dist/index.js +16 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -282,11 +282,12 @@ async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
|
282
282
|
agentId: opts?.agent,
|
|
283
283
|
});
|
|
284
284
|
const maxResults = normalizeLimit(opts?.maxResults ?? opts?.limit);
|
|
285
|
-
const
|
|
285
|
+
const explicitMinScore = normalizeNumber(opts?.minScore);
|
|
286
|
+
const minScore = explicitMinScore ?? resolveDefaultSearchMinScore(manager.status(), cfg);
|
|
286
287
|
const results = (await manager.search({
|
|
287
288
|
query,
|
|
288
289
|
...(maxResults ? { maxResults } : {}),
|
|
289
|
-
|
|
290
|
+
minScore,
|
|
290
291
|
}));
|
|
291
292
|
if (opts?.json) {
|
|
292
293
|
console.log(JSON.stringify({ results }, null, 2));
|
|
@@ -307,6 +308,9 @@ async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
|
307
308
|
process.exitCode = 1;
|
|
308
309
|
}
|
|
309
310
|
}
|
|
311
|
+
function resolveDefaultSearchMinScore(status, cfg) {
|
|
312
|
+
return normalizeNumber(status?.gatingThreshold) ?? normalizeNumber(cfg.ingestionGateThreshold) ?? 0.35;
|
|
313
|
+
}
|
|
310
314
|
async function runFlush(runtime, opts, logger) {
|
|
311
315
|
const namespace = resolveCliNamespace(opts);
|
|
312
316
|
if (!namespace) {
|
package/dist/index.js
CHANGED
|
@@ -33360,12 +33360,13 @@ async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
|
33360
33360
|
agentId: opts?.agent
|
|
33361
33361
|
});
|
|
33362
33362
|
const maxResults = normalizeLimit(opts?.maxResults ?? opts?.limit);
|
|
33363
|
-
const
|
|
33363
|
+
const explicitMinScore = normalizeNumber2(opts?.minScore);
|
|
33364
|
+
const minScore = explicitMinScore ?? resolveDefaultSearchMinScore(manager.status(), cfg);
|
|
33364
33365
|
const results = await manager.search(
|
|
33365
33366
|
{
|
|
33366
33367
|
query,
|
|
33367
33368
|
...maxResults ? { maxResults } : {},
|
|
33368
|
-
|
|
33369
|
+
minScore
|
|
33369
33370
|
}
|
|
33370
33371
|
);
|
|
33371
33372
|
if (opts?.json) {
|
|
@@ -33386,6 +33387,9 @@ async function runSearch(runtime, cfg, queryArg, opts, logger) {
|
|
|
33386
33387
|
process.exitCode = 1;
|
|
33387
33388
|
}
|
|
33388
33389
|
}
|
|
33390
|
+
function resolveDefaultSearchMinScore(status, cfg) {
|
|
33391
|
+
return normalizeNumber2(status?.gatingThreshold) ?? normalizeNumber2(cfg.ingestionGateThreshold) ?? 0.35;
|
|
33392
|
+
}
|
|
33389
33393
|
async function runFlush(runtime, opts, logger) {
|
|
33390
33394
|
const namespace = resolveCliNamespace(opts);
|
|
33391
33395
|
if (!namespace) {
|
|
@@ -39653,6 +39657,16 @@ function register(api) {
|
|
|
39653
39657
|
await dreamPromotion.stop();
|
|
39654
39658
|
}
|
|
39655
39659
|
});
|
|
39660
|
+
api.registerRuntimeLifecycle?.({
|
|
39661
|
+
id: "libravdb-shutdown",
|
|
39662
|
+
description: "Shut down the vector service runtime on plugin disable",
|
|
39663
|
+
async cleanup(ctx) {
|
|
39664
|
+
if (ctx.reason === "disable") {
|
|
39665
|
+
logger.info?.("LibraVDB disable \u2014 shutting down runtime");
|
|
39666
|
+
await runtime.shutdown();
|
|
39667
|
+
}
|
|
39668
|
+
}
|
|
39669
|
+
});
|
|
39656
39670
|
api.on("before_reset", createBeforeResetHook(runtime, api.logger ?? console));
|
|
39657
39671
|
api.on("session_end", createSessionEndHook(runtime, api.logger ?? console));
|
|
39658
39672
|
api.on("agent_end", async (event) => {
|
package/openclaw.plugin.json
CHANGED