@xdarkicex/openclaw-memory-libravdb 1.6.13 → 1.6.14
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/dream-promotion.js +18 -4
- package/dist/index.js +17 -4
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/dream-promotion.js
CHANGED
|
@@ -30,6 +30,7 @@ export function createDreamPromotionHandle(cfg, getClient, logger = console, fsA
|
|
|
30
30
|
const state = {
|
|
31
31
|
watching: false,
|
|
32
32
|
dirty: false,
|
|
33
|
+
scanning: false,
|
|
33
34
|
timer: null,
|
|
34
35
|
watcher: null,
|
|
35
36
|
};
|
|
@@ -62,6 +63,10 @@ export function createDreamPromotionHandle(cfg, getClient, logger = console, fsA
|
|
|
62
63
|
if (!state.watching) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
66
|
+
if (state.scanning) {
|
|
67
|
+
state.dirty = true;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
65
70
|
if (state.timer) {
|
|
66
71
|
state.dirty = true;
|
|
67
72
|
return;
|
|
@@ -77,6 +82,19 @@ export function createDreamPromotionHandle(cfg, getClient, logger = console, fsA
|
|
|
77
82
|
if (!state.watching) {
|
|
78
83
|
return;
|
|
79
84
|
}
|
|
85
|
+
state.scanning = true;
|
|
86
|
+
try {
|
|
87
|
+
await performScan();
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
state.scanning = false;
|
|
91
|
+
}
|
|
92
|
+
if (state.dirty) {
|
|
93
|
+
state.dirty = false;
|
|
94
|
+
await refreshDiary();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function performScan() {
|
|
80
98
|
await ensureWatcher();
|
|
81
99
|
const stat = await safeStat(diaryPath);
|
|
82
100
|
if (!stat) {
|
|
@@ -137,10 +155,6 @@ export function createDreamPromotionHandle(cfg, getClient, logger = console, fsA
|
|
|
137
155
|
mtimeMs: stat.mtimeMs,
|
|
138
156
|
fileHash,
|
|
139
157
|
};
|
|
140
|
-
if (state.dirty) {
|
|
141
|
-
state.dirty = false;
|
|
142
|
-
await refreshDiary();
|
|
143
|
-
}
|
|
144
158
|
}
|
|
145
159
|
async function safeStat(filePath) {
|
|
146
160
|
try {
|
package/dist/index.js
CHANGED
|
@@ -25355,6 +25355,7 @@ function createDreamPromotionHandle(cfg, getClient, logger = console, fsApi = cr
|
|
|
25355
25355
|
const state = {
|
|
25356
25356
|
watching: false,
|
|
25357
25357
|
dirty: false,
|
|
25358
|
+
scanning: false,
|
|
25358
25359
|
timer: null,
|
|
25359
25360
|
watcher: null
|
|
25360
25361
|
};
|
|
@@ -25387,6 +25388,10 @@ function createDreamPromotionHandle(cfg, getClient, logger = console, fsApi = cr
|
|
|
25387
25388
|
if (!state.watching) {
|
|
25388
25389
|
return;
|
|
25389
25390
|
}
|
|
25391
|
+
if (state.scanning) {
|
|
25392
|
+
state.dirty = true;
|
|
25393
|
+
return;
|
|
25394
|
+
}
|
|
25390
25395
|
if (state.timer) {
|
|
25391
25396
|
state.dirty = true;
|
|
25392
25397
|
return;
|
|
@@ -25402,6 +25407,18 @@ function createDreamPromotionHandle(cfg, getClient, logger = console, fsApi = cr
|
|
|
25402
25407
|
if (!state.watching) {
|
|
25403
25408
|
return;
|
|
25404
25409
|
}
|
|
25410
|
+
state.scanning = true;
|
|
25411
|
+
try {
|
|
25412
|
+
await performScan();
|
|
25413
|
+
} finally {
|
|
25414
|
+
state.scanning = false;
|
|
25415
|
+
}
|
|
25416
|
+
if (state.dirty) {
|
|
25417
|
+
state.dirty = false;
|
|
25418
|
+
await refreshDiary();
|
|
25419
|
+
}
|
|
25420
|
+
}
|
|
25421
|
+
async function performScan() {
|
|
25405
25422
|
await ensureWatcher();
|
|
25406
25423
|
const stat = await safeStat(diaryPath);
|
|
25407
25424
|
if (!stat) {
|
|
@@ -25462,10 +25479,6 @@ function createDreamPromotionHandle(cfg, getClient, logger = console, fsApi = cr
|
|
|
25462
25479
|
mtimeMs: stat.mtimeMs,
|
|
25463
25480
|
fileHash
|
|
25464
25481
|
};
|
|
25465
|
-
if (state.dirty) {
|
|
25466
|
-
state.dirty = false;
|
|
25467
|
-
await refreshDiary();
|
|
25468
|
-
}
|
|
25469
25482
|
}
|
|
25470
25483
|
async function safeStat(filePath) {
|
|
25471
25484
|
try {
|
package/openclaw.plugin.json
CHANGED