@xdarkicex/openclaw-memory-libravdb 1.4.45 → 1.4.47
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 +1 -6
- package/dist/dream-promotion.js +1 -6
- package/dist/format-error.d.ts +9 -0
- package/dist/format-error.js +14 -0
- package/dist/index.js +1041 -907
- package/dist/ingest-queue.d.ts +39 -0
- package/dist/ingest-queue.js +123 -0
- package/dist/lifecycle-hooks.js +1 -6
- package/dist/markdown-ingest.js +15 -15
- package/dist/plugin-runtime.js +1 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { stdin, stdout } from "node:process";
|
|
|
3
3
|
import { MEMORY_CLI_DESCRIPTOR, isMemorySlotSelected } from "./cli-descriptors.js";
|
|
4
4
|
import { resolveDurableNamespace } from "./memory-scopes.js";
|
|
5
5
|
import { resolveIdentity } from "./identity.js";
|
|
6
|
+
import { formatError } from "./format-error.js";
|
|
6
7
|
import { promoteDreamDiaryFile } from "./dream-promotion.js";
|
|
7
8
|
import { buildMemoryRuntimeBridge } from "./memory-runtime.js";
|
|
8
9
|
export function registerMemoryCli(api, runtime, cfg, logger = console) {
|
|
@@ -429,12 +430,6 @@ async function confirm(prompt) {
|
|
|
429
430
|
rl.close();
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
|
-
function formatError(error) {
|
|
433
|
-
if (error instanceof Error && error.message.trim()) {
|
|
434
|
-
return error.message;
|
|
435
|
-
}
|
|
436
|
-
return String(error);
|
|
437
|
-
}
|
|
438
433
|
function normalizeCliLimit(limit, optionName) {
|
|
439
434
|
if (limit === undefined)
|
|
440
435
|
return undefined;
|
package/dist/dream-promotion.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import fsp from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { getHashBackendName, hashBytes } from "./markdown-hash.js";
|
|
5
|
+
import { formatError } from "./format-error.js";
|
|
5
6
|
const DEFAULT_DEBOUNCE_MS = 150;
|
|
6
7
|
const DEFAULT_MIN_SCORE = 0.6;
|
|
7
8
|
const DEFAULT_MIN_RECALL_COUNT = 2;
|
|
@@ -354,10 +355,4 @@ function createRealFsApi() {
|
|
|
354
355
|
watch: (dir, onChange) => fs.watch(dir, onChange),
|
|
355
356
|
};
|
|
356
357
|
}
|
|
357
|
-
function formatError(error) {
|
|
358
|
-
if (error instanceof Error) {
|
|
359
|
-
return error.message;
|
|
360
|
-
}
|
|
361
|
-
return String(error);
|
|
362
|
-
}
|
|
363
358
|
const textDecoder = new TextDecoder();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format an unknown thrown value as a human-readable string.
|
|
3
|
+
*
|
|
4
|
+
* If the value is an Error with a non-blank message, returns the trimmed
|
|
5
|
+
* message. Otherwise falls back to `String(error)`, which produces
|
|
6
|
+
* `"Error"` for `new Error("")` and preserves the original string for
|
|
7
|
+
* non-Error throws.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatError(error: unknown): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format an unknown thrown value as a human-readable string.
|
|
3
|
+
*
|
|
4
|
+
* If the value is an Error with a non-blank message, returns the trimmed
|
|
5
|
+
* message. Otherwise falls back to `String(error)`, which produces
|
|
6
|
+
* `"Error"` for `new Error("")` and preserves the original string for
|
|
7
|
+
* non-Error throws.
|
|
8
|
+
*/
|
|
9
|
+
export function formatError(error) {
|
|
10
|
+
if (error instanceof Error && error.message.trim()) {
|
|
11
|
+
return error.message.trim();
|
|
12
|
+
}
|
|
13
|
+
return String(error);
|
|
14
|
+
}
|