@xdarkicex/openclaw-memory-libravdb 1.4.56 → 1.4.58
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 +25 -13
- package/dist/markdown-ingest.js +21 -13
- package/dist/sidecar.js +4 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38840,22 +38840,32 @@ function matchesGlob(value, pattern) {
|
|
|
38840
38840
|
return new RegExp(`^${escaped}$`).test(value);
|
|
38841
38841
|
}
|
|
38842
38842
|
function looksLikeObsidianNote(filePath, text) {
|
|
38843
|
-
|
|
38843
|
+
const frontmatterStart = parseFrontmatterStart(text);
|
|
38844
|
+
if (frontmatterStart == null) {
|
|
38844
38845
|
return hasInlineObsidianTag(text);
|
|
38845
38846
|
}
|
|
38846
|
-
const
|
|
38847
|
-
if (
|
|
38847
|
+
const parsed = findFrontmatterEnd(text, frontmatterStart);
|
|
38848
|
+
if (!parsed) {
|
|
38848
38849
|
return hasInlineObsidianTag(text);
|
|
38849
38850
|
}
|
|
38850
|
-
const frontmatter = text.slice(
|
|
38851
|
-
const lines = frontmatter.split(
|
|
38851
|
+
const frontmatter = text.slice(frontmatterStart, parsed.position);
|
|
38852
|
+
const lines = frontmatter.split(/\r?\n/);
|
|
38852
38853
|
for (const line of lines) {
|
|
38853
38854
|
const trimmed = line.trimStart();
|
|
38854
38855
|
if (trimmed.startsWith("tags:") || trimmed.startsWith("tag:") || trimmed.startsWith("openclaw:") || trimmed.startsWith("memory:")) {
|
|
38855
38856
|
return true;
|
|
38856
38857
|
}
|
|
38857
38858
|
}
|
|
38858
|
-
return hasInlineObsidianTag(text.slice(
|
|
38859
|
+
return hasInlineObsidianTag(text.slice(parsed.bodyOffset));
|
|
38860
|
+
}
|
|
38861
|
+
function parseFrontmatterStart(text) {
|
|
38862
|
+
if (text.startsWith("---\n")) {
|
|
38863
|
+
return 4;
|
|
38864
|
+
}
|
|
38865
|
+
if (text.startsWith("---\r\n")) {
|
|
38866
|
+
return 5;
|
|
38867
|
+
}
|
|
38868
|
+
return null;
|
|
38859
38869
|
}
|
|
38860
38870
|
function findFrontmatterEnd(text, offset) {
|
|
38861
38871
|
for (let i = offset; i < text.length - 3; i++) {
|
|
@@ -38864,13 +38874,13 @@ function findFrontmatterEnd(text, offset) {
|
|
|
38864
38874
|
}
|
|
38865
38875
|
const next = text.charCodeAt(i + 3);
|
|
38866
38876
|
if (next === 10) {
|
|
38867
|
-
return i;
|
|
38877
|
+
return { position: i, bodyOffset: i + 4 };
|
|
38868
38878
|
}
|
|
38869
38879
|
if (next === 13 && text.charCodeAt(i + 4) === 10) {
|
|
38870
|
-
return i;
|
|
38880
|
+
return { position: i, bodyOffset: i + 5 };
|
|
38871
38881
|
}
|
|
38872
38882
|
}
|
|
38873
|
-
return
|
|
38883
|
+
return null;
|
|
38874
38884
|
}
|
|
38875
38885
|
function hasInlineObsidianTag(text) {
|
|
38876
38886
|
let inFence = false;
|
|
@@ -38884,10 +38894,8 @@ function hasInlineObsidianTag(text) {
|
|
|
38884
38894
|
if (inFence) {
|
|
38885
38895
|
continue;
|
|
38886
38896
|
}
|
|
38887
|
-
|
|
38888
|
-
|
|
38889
|
-
}
|
|
38890
|
-
if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(line)) {
|
|
38897
|
+
const searchable = trimmed.replace(/^#{1,6}\s+/, "");
|
|
38898
|
+
if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(searchable)) {
|
|
38891
38899
|
return true;
|
|
38892
38900
|
}
|
|
38893
38901
|
}
|
|
@@ -39551,6 +39559,10 @@ var SidecarSupervisor = class {
|
|
|
39551
39559
|
this.retries += 1;
|
|
39552
39560
|
this.reconnectScheduled = true;
|
|
39553
39561
|
this.runtime.scheduleRestart(backoffMs, () => {
|
|
39562
|
+
if (this.shuttingDown) {
|
|
39563
|
+
this.reconnectScheduled = false;
|
|
39564
|
+
return;
|
|
39565
|
+
}
|
|
39554
39566
|
void this.start().catch((error) => {
|
|
39555
39567
|
this.reconnectScheduled = false;
|
|
39556
39568
|
const message = error instanceof Error ? error.message : String(error);
|
package/dist/markdown-ingest.js
CHANGED
|
@@ -436,15 +436,16 @@ function matchesGlob(value, pattern) {
|
|
|
436
436
|
return new RegExp(`^${escaped}$`).test(value);
|
|
437
437
|
}
|
|
438
438
|
function looksLikeObsidianNote(filePath, text) {
|
|
439
|
-
|
|
439
|
+
const frontmatterStart = parseFrontmatterStart(text);
|
|
440
|
+
if (frontmatterStart == null) {
|
|
440
441
|
return hasInlineObsidianTag(text);
|
|
441
442
|
}
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
443
|
+
const parsed = findFrontmatterEnd(text, frontmatterStart);
|
|
444
|
+
if (!parsed) {
|
|
444
445
|
return hasInlineObsidianTag(text);
|
|
445
446
|
}
|
|
446
|
-
const frontmatter = text.slice(
|
|
447
|
-
const lines = frontmatter.split(
|
|
447
|
+
const frontmatter = text.slice(frontmatterStart, parsed.position);
|
|
448
|
+
const lines = frontmatter.split(/\r?\n/);
|
|
448
449
|
for (const line of lines) {
|
|
449
450
|
const trimmed = line.trimStart();
|
|
450
451
|
if (trimmed.startsWith("tags:") ||
|
|
@@ -454,7 +455,16 @@ function looksLikeObsidianNote(filePath, text) {
|
|
|
454
455
|
return true;
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
|
-
return hasInlineObsidianTag(text.slice(
|
|
458
|
+
return hasInlineObsidianTag(text.slice(parsed.bodyOffset));
|
|
459
|
+
}
|
|
460
|
+
function parseFrontmatterStart(text) {
|
|
461
|
+
if (text.startsWith("---\n")) {
|
|
462
|
+
return 4;
|
|
463
|
+
}
|
|
464
|
+
if (text.startsWith("---\r\n")) {
|
|
465
|
+
return 5;
|
|
466
|
+
}
|
|
467
|
+
return null;
|
|
458
468
|
}
|
|
459
469
|
function findFrontmatterEnd(text, offset) {
|
|
460
470
|
for (let i = offset; i < text.length - 3; i++) {
|
|
@@ -463,13 +473,13 @@ function findFrontmatterEnd(text, offset) {
|
|
|
463
473
|
}
|
|
464
474
|
const next = text.charCodeAt(i + 3);
|
|
465
475
|
if (next === 10) {
|
|
466
|
-
return i;
|
|
476
|
+
return { position: i, bodyOffset: i + 4 };
|
|
467
477
|
}
|
|
468
478
|
if (next === 13 && text.charCodeAt(i + 4) === 10) {
|
|
469
|
-
return i;
|
|
479
|
+
return { position: i, bodyOffset: i + 5 };
|
|
470
480
|
}
|
|
471
481
|
}
|
|
472
|
-
return
|
|
482
|
+
return null;
|
|
473
483
|
}
|
|
474
484
|
function hasInlineObsidianTag(text) {
|
|
475
485
|
let inFence = false;
|
|
@@ -483,10 +493,8 @@ function hasInlineObsidianTag(text) {
|
|
|
483
493
|
if (inFence) {
|
|
484
494
|
continue;
|
|
485
495
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(line)) {
|
|
496
|
+
const searchable = trimmed.replace(/^#{1,6}\s+/, "");
|
|
497
|
+
if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(searchable)) {
|
|
490
498
|
return true;
|
|
491
499
|
}
|
|
492
500
|
}
|
package/dist/sidecar.js
CHANGED
|
@@ -285,6 +285,10 @@ class SidecarSupervisor {
|
|
|
285
285
|
this.retries += 1;
|
|
286
286
|
this.reconnectScheduled = true;
|
|
287
287
|
this.runtime.scheduleRestart(backoffMs, () => {
|
|
288
|
+
if (this.shuttingDown) {
|
|
289
|
+
this.reconnectScheduled = false;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
288
292
|
void this.start().catch((error) => {
|
|
289
293
|
this.reconnectScheduled = false;
|
|
290
294
|
const message = error instanceof Error ? error.message : String(error);
|
package/openclaw.plugin.json
CHANGED