@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 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
- if (!text.startsWith("---\n")) {
38843
+ const frontmatterStart = parseFrontmatterStart(text);
38844
+ if (frontmatterStart == null) {
38844
38845
  return hasInlineObsidianTag(text);
38845
38846
  }
38846
- const frontmatterEnd = findFrontmatterEnd(text, 4);
38847
- if (frontmatterEnd < 0) {
38847
+ const parsed = findFrontmatterEnd(text, frontmatterStart);
38848
+ if (!parsed) {
38848
38849
  return hasInlineObsidianTag(text);
38849
38850
  }
38850
- const frontmatter = text.slice(4, frontmatterEnd);
38851
- const lines = frontmatter.split("\n");
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(frontmatterEnd + 4));
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 -1;
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
- if (trimmed.startsWith("#")) {
38888
- continue;
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);
@@ -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
- if (!text.startsWith("---\n")) {
439
+ const frontmatterStart = parseFrontmatterStart(text);
440
+ if (frontmatterStart == null) {
440
441
  return hasInlineObsidianTag(text);
441
442
  }
442
- const frontmatterEnd = findFrontmatterEnd(text, 4);
443
- if (frontmatterEnd < 0) {
443
+ const parsed = findFrontmatterEnd(text, frontmatterStart);
444
+ if (!parsed) {
444
445
  return hasInlineObsidianTag(text);
445
446
  }
446
- const frontmatter = text.slice(4, frontmatterEnd);
447
- const lines = frontmatter.split("\n");
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(frontmatterEnd + 4));
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 -1;
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
- if (trimmed.startsWith("#")) {
487
- continue;
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);
@@ -2,7 +2,7 @@
2
2
  "id": "libravdb-memory",
3
3
  "name": "LibraVDB Memory",
4
4
  "description": "Persistent vector memory with three-tier hybrid scoring",
5
- "version": "1.4.56",
5
+ "version": "1.4.58",
6
6
  "kind": [
7
7
  "memory",
8
8
  "context-engine"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdarkicex/openclaw-memory-libravdb",
3
- "version": "1.4.56",
3
+ "version": "1.4.58",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",