clawvault 1.11.1 → 1.11.2

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Observer,
3
3
  parseSessionFile
4
- } from "./chunk-FPEH4FVM.js";
4
+ } from "./chunk-KOF3HYSL.js";
5
5
 
6
6
  // src/commands/observe.ts
7
7
  import * as fs2 from "fs";
@@ -550,10 +550,57 @@ var Router = class {
550
550
  normalizeForDedup(content) {
551
551
  return content.replace(/^\d{2}:\d{2}\s+/, "").replace(/\[\[[^\]]*\]\]/g, (m) => m.replace(/\[\[|\]\]/g, "")).replace(/\s+/g, " ").trim().toLowerCase();
552
552
  }
553
- appendToCategory(category, item) {
553
+ /**
554
+ * Extract entity slug from observation content for people/projects routing.
555
+ * Returns null if no entity can be identified.
556
+ */
557
+ extractEntitySlug(content, category) {
558
+ if (category !== "people" && category !== "projects") return null;
559
+ if (category === "people") {
560
+ const patterns = [
561
+ /(?:talked to|met with|spoke with|chatted with|discussed with|emailed|called|messaged)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
562
+ /([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)\s+(?:said|asked|told|mentioned|from|at)\b/,
563
+ /\b(?:client|partner|colleague|contact)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/i
564
+ ];
565
+ for (const pattern of patterns) {
566
+ const match = content.match(pattern);
567
+ if (match?.[1]) return this.toSlug(match[1]);
568
+ }
569
+ }
570
+ if (category === "projects") {
571
+ const patterns = [
572
+ /(?:deployed|shipped|launched|released|built|created|working on)\s+([A-Z][a-zA-Z0-9-]+)/,
573
+ /"([^"]+)"\s+(?:project|repo|service)/i
574
+ ];
575
+ for (const pattern of patterns) {
576
+ const match = content.match(pattern);
577
+ if (match?.[1]) return this.toSlug(match[1]);
578
+ }
579
+ }
580
+ return null;
581
+ }
582
+ toSlug(name) {
583
+ return name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
584
+ }
585
+ /**
586
+ * Resolve the file path for a routed item.
587
+ * For people/projects: entity-slug subfolder with date file (e.g., people/pedro/2026-02-12.md)
588
+ * For other categories: category/date.md
589
+ */
590
+ resolveFilePath(category, item) {
591
+ const entitySlug = this.extractEntitySlug(item.content, category);
592
+ if (entitySlug) {
593
+ const entityDir = path.join(this.vaultPath, category, entitySlug);
594
+ fs.mkdirSync(entityDir, { recursive: true });
595
+ return path.join(entityDir, `${item.date}.md`);
596
+ }
554
597
  const categoryDir = path.join(this.vaultPath, category);
555
598
  fs.mkdirSync(categoryDir, { recursive: true });
556
- const filePath = path.join(categoryDir, `${item.date}.md`);
599
+ return path.join(categoryDir, `${item.date}.md`);
600
+ }
601
+ appendToCategory(category, item) {
602
+ const filePath = this.resolveFilePath(category, item);
603
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
557
604
  const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, "utf-8").trim() : "";
558
605
  const normalizedNew = this.normalizeForDedup(item.content);
559
606
  const existingLines = existing.split(/\r?\n/);
@@ -572,7 +619,9 @@ var Router = class {
572
619
  }
573
620
  const linkedContent = this.addWikiLinks(item.content);
574
621
  const entry = `- ${item.priority} ${linkedContent}`;
575
- const header = existing ? "" : `# ${category} \u2014 ${item.date}
622
+ const entitySlug = this.extractEntitySlug(item.content, category);
623
+ const headerLabel = entitySlug ? `${category}/${entitySlug}` : category;
624
+ const header = existing ? "" : `# ${headerLabel} \u2014 ${item.date}
576
625
  `;
577
626
  const newContent = existing ? `${existing}
578
627
  ${entry}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  observeCommand,
3
3
  registerObserveCommand
4
- } from "../chunk-G3YZEFKU.js";
5
- import "../chunk-FPEH4FVM.js";
4
+ } from "../chunk-GZOBCUVO.js";
5
+ import "../chunk-KOF3HYSL.js";
6
6
  export {
7
7
  observeCommand,
8
8
  registerObserveCommand
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  Observer,
9
9
  parseSessionFile
10
- } from "../chunk-FPEH4FVM.js";
10
+ } from "../chunk-KOF3HYSL.js";
11
11
  import {
12
12
  clearDirtyFlag
13
13
  } from "../chunk-MZZJLQNQ.js";
package/dist/index.js CHANGED
@@ -41,13 +41,13 @@ import {
41
41
  SessionWatcher,
42
42
  observeCommand,
43
43
  registerObserveCommand
44
- } from "./chunk-G3YZEFKU.js";
44
+ } from "./chunk-GZOBCUVO.js";
45
45
  import {
46
46
  Compressor,
47
47
  Observer,
48
48
  Reflector,
49
49
  parseSessionFile
50
- } from "./chunk-FPEH4FVM.js";
50
+ } from "./chunk-KOF3HYSL.js";
51
51
 
52
52
  // src/index.ts
53
53
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawvault",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "ClawVault™ - 🐘 An elephant never forgets. Structured memory for OpenClaw agents. Context death resilience, Obsidian-compatible markdown, local semantic search.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",