clawmem 0.3.2 → 0.3.4
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/AGENTS.md +2 -1
- package/CLAUDE.md +2 -1
- package/README.md +1 -0
- package/SKILL.md +2 -1
- package/package.json +1 -1
- package/src/clawmem.ts +79 -0
package/AGENTS.md
CHANGED
|
@@ -663,8 +663,9 @@ echo "user query" | clawmem surface --context --stdin
|
|
|
663
663
|
echo "session-id" | clawmem surface --bootstrap --stdin
|
|
664
664
|
```
|
|
665
665
|
|
|
666
|
-
**
|
|
666
|
+
**Browse and analysis:**
|
|
667
667
|
```bash
|
|
668
|
+
clawmem list [-n N] [-c col] # Browse recent documents (--json for machine output)
|
|
668
669
|
clawmem reflect [N] # Cross-session reflection (last N days, default 14)
|
|
669
670
|
# Shows recurring themes, antipatterns, co-activation clusters
|
|
670
671
|
clawmem consolidate [--dry-run] # Find and archive duplicate low-confidence documents
|
package/CLAUDE.md
CHANGED
|
@@ -663,8 +663,9 @@ echo "user query" | clawmem surface --context --stdin
|
|
|
663
663
|
echo "session-id" | clawmem surface --bootstrap --stdin
|
|
664
664
|
```
|
|
665
665
|
|
|
666
|
-
**
|
|
666
|
+
**Browse and analysis:**
|
|
667
667
|
```bash
|
|
668
|
+
clawmem list [-n N] [-c col] # Browse recent documents (--json for machine output)
|
|
668
669
|
clawmem reflect [N] # Cross-session reflection (last N days, default 14)
|
|
669
670
|
# Shows recurring themes, antipatterns, co-activation clusters
|
|
670
671
|
clawmem consolidate [--dry-run] # Find and archive duplicate low-confidence documents
|
package/README.md
CHANGED
|
@@ -615,6 +615,7 @@ clawmem profile Show user profile
|
|
|
615
615
|
clawmem profile rebuild Force profile rebuild
|
|
616
616
|
clawmem update-context Regenerate per-folder CLAUDE.md
|
|
617
617
|
|
|
618
|
+
clawmem list [-n/--limit N] [-c col] [--json] Browse recent documents
|
|
618
619
|
clawmem budget [--session ID] Token utilization
|
|
619
620
|
clawmem log [--last N] Session history
|
|
620
621
|
clawmem hook <name> Manual hook trigger
|
package/SKILL.md
CHANGED
|
@@ -684,9 +684,10 @@ clawmem reindex --enrich # Full A-MEM pipeline on ALL docs (entity extrac
|
|
|
684
684
|
# Without --enrich, reindex only refreshes metadata for changed docs.
|
|
685
685
|
```
|
|
686
686
|
|
|
687
|
-
### Analysis
|
|
687
|
+
### Browse and Analysis
|
|
688
688
|
|
|
689
689
|
```bash
|
|
690
|
+
clawmem list [-n N] [-c col] # Browse recent documents (--json for machine output)
|
|
690
691
|
clawmem reflect [N] # Cross-session reflection (last N days, default 14)
|
|
691
692
|
# Recurring themes, antipatterns, co-activation clusters
|
|
692
693
|
clawmem consolidate [--dry-run] # Find and archive duplicate low-confidence documents
|
package/package.json
CHANGED
package/src/clawmem.ts
CHANGED
|
@@ -461,6 +461,81 @@ async function cmdStatus() {
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
+
async function cmdList(args: string[]) {
|
|
465
|
+
const { values } = parseArgs({
|
|
466
|
+
args,
|
|
467
|
+
options: {
|
|
468
|
+
num: { type: "string", short: "n", default: "10" },
|
|
469
|
+
limit: { type: "string" }, // alias for --num (matches issue request)
|
|
470
|
+
collection: { type: "string", short: "c" },
|
|
471
|
+
json: { type: "boolean", default: false },
|
|
472
|
+
},
|
|
473
|
+
allowPositionals: false,
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
const limit = parseInt(values.limit || values.num!, 10);
|
|
477
|
+
if (isNaN(limit) || limit < 1) die("--num must be a positive integer");
|
|
478
|
+
|
|
479
|
+
const s = getStore();
|
|
480
|
+
const col = values.collection || null;
|
|
481
|
+
|
|
482
|
+
const rows = s.db.prepare(`
|
|
483
|
+
SELECT
|
|
484
|
+
substr(hash, 1, 6) AS docid,
|
|
485
|
+
title,
|
|
486
|
+
collection,
|
|
487
|
+
path,
|
|
488
|
+
content_type,
|
|
489
|
+
modified_at,
|
|
490
|
+
confidence,
|
|
491
|
+
access_count
|
|
492
|
+
FROM documents
|
|
493
|
+
WHERE active = 1
|
|
494
|
+
AND invalidated_at IS NULL
|
|
495
|
+
AND (? IS NULL OR collection = ?)
|
|
496
|
+
ORDER BY COALESCE(modified_at, created_at) DESC, id DESC
|
|
497
|
+
LIMIT ?
|
|
498
|
+
`).all(col, col, limit) as {
|
|
499
|
+
docid: string;
|
|
500
|
+
title: string | null;
|
|
501
|
+
collection: string;
|
|
502
|
+
path: string;
|
|
503
|
+
content_type: string | null;
|
|
504
|
+
modified_at: string | null;
|
|
505
|
+
confidence: number | null;
|
|
506
|
+
access_count: number | null;
|
|
507
|
+
}[];
|
|
508
|
+
|
|
509
|
+
if (rows.length === 0) {
|
|
510
|
+
console.log(col ? `No documents in collection "${col}".` : "No documents in vault.");
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (values.json) {
|
|
515
|
+
console.log(JSON.stringify(rows.map(r => ({
|
|
516
|
+
docid: r.docid,
|
|
517
|
+
title: r.title || null,
|
|
518
|
+
collection: r.collection,
|
|
519
|
+
path: r.path,
|
|
520
|
+
contentType: r.content_type || "note",
|
|
521
|
+
modifiedAt: r.modified_at || null,
|
|
522
|
+
confidence: r.confidence ?? 1.0,
|
|
523
|
+
accessCount: r.access_count ?? 0,
|
|
524
|
+
})), null, 2));
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
console.log(`${c.bold}Recent documents${col ? ` (${col})` : ""}:${c.reset}\n`);
|
|
529
|
+
for (const r of rows) {
|
|
530
|
+
const date = r.modified_at?.slice(0, 10) || "-";
|
|
531
|
+
const type = r.content_type || "note";
|
|
532
|
+
const raw = r.title || r.path;
|
|
533
|
+
const title = raw.length > 60 ? raw.slice(0, 57) + "..." : raw;
|
|
534
|
+
console.log(` ${c.dim}${r.docid}${c.reset} ${date} ${c.dim}[${type}]${c.reset} ${r.collection} ${title}`);
|
|
535
|
+
}
|
|
536
|
+
console.log(`\n${rows.length} document${rows.length !== 1 ? "s" : ""} shown.`);
|
|
537
|
+
}
|
|
538
|
+
|
|
464
539
|
async function cmdSearch(args: string[]) {
|
|
465
540
|
const { values, positionals } = parseArgs({
|
|
466
541
|
args,
|
|
@@ -1626,6 +1701,9 @@ async function main() {
|
|
|
1626
1701
|
case "status":
|
|
1627
1702
|
await cmdStatus();
|
|
1628
1703
|
break;
|
|
1704
|
+
case "list":
|
|
1705
|
+
await cmdList(subArgs);
|
|
1706
|
+
break;
|
|
1629
1707
|
case "search":
|
|
1630
1708
|
await cmdSearch(subArgs);
|
|
1631
1709
|
break;
|
|
@@ -2222,6 +2300,7 @@ ${c.bold}Search:${c.reset}
|
|
|
2222
2300
|
clawmem query <query> [-n N] Hybrid + rerank (best)
|
|
2223
2301
|
|
|
2224
2302
|
${c.bold}Memory:${c.reset}
|
|
2303
|
+
clawmem list [-n/--limit N] [-c col] Browse recent documents (--json for machine output)
|
|
2225
2304
|
clawmem budget [--session ID] Token utilization
|
|
2226
2305
|
clawmem log [--last N] Session history
|
|
2227
2306
|
clawmem profile Show user profile
|