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.
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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}
|
package/dist/commands/observe.js
CHANGED
package/dist/commands/sleep.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -41,13 +41,13 @@ import {
|
|
|
41
41
|
SessionWatcher,
|
|
42
42
|
observeCommand,
|
|
43
43
|
registerObserveCommand
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-GZOBCUVO.js";
|
|
45
45
|
import {
|
|
46
46
|
Compressor,
|
|
47
47
|
Observer,
|
|
48
48
|
Reflector,
|
|
49
49
|
parseSessionFile
|
|
50
|
-
} from "./chunk-
|
|
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.
|
|
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",
|