@trlc/super-memory 1.3.9 → 1.3.10
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/README.md +22 -1
- package/dist/index.js +10 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,12 +31,33 @@ super-memory status
|
|
|
31
31
|
|
|
32
32
|
## Commands
|
|
33
33
|
|
|
34
|
+
### Sync with Smart Tracking
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
super-memory sync
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Bidirectional sync with intelligent duplicate prevention:**
|
|
41
|
+
- ✅ **Upload**: New local memories → Cloud (skips already synced)
|
|
42
|
+
- ✅ **Download**: New cloud memories → Local
|
|
43
|
+
- ✅ **Smart tracking**: Adds `<!-- synced: timestamp -->` markers to local files
|
|
44
|
+
- ✅ **No duplicates**: Already synced memories are automatically skipped
|
|
45
|
+
|
|
46
|
+
**How it works:**
|
|
47
|
+
1. First sync: Uploads all local memories → marks with `\u003c!-- synced: ... --\u003e`
|
|
48
|
+
2. Save new memories: Added to local file (no marker)
|
|
49
|
+
3. Next sync: Uploads only NEW memories → skips marked ones
|
|
50
|
+
|
|
51
|
+
**Pro tip:** Set up a cron job to run `sync` automatically every few hours.
|
|
52
|
+
|
|
53
|
+
### Command Reference
|
|
54
|
+
|
|
34
55
|
| Command | Description |
|
|
35
56
|
|---------|-------------|
|
|
36
57
|
| `init` | Initialize with license key |
|
|
37
58
|
| `save` | Save a memory (local + encrypted cloud) |
|
|
38
59
|
| `search` | Search memories semantically |
|
|
39
|
-
| `sync` |
|
|
60
|
+
| `sync` | Bidirectional sync (smart tracking, no duplicates) |
|
|
40
61
|
| `status` | Show license, local/cloud stats, sync status |
|
|
41
62
|
| `index-update` | Update MEMORY_INDEX.md + auto-curate |
|
|
42
63
|
| `curate` | Auto-curate memories to MEMORY.md |
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { homedir } from 'os';
|
|
|
22
22
|
import { join } from 'path';
|
|
23
23
|
import readline from 'readline';
|
|
24
24
|
const CONVEX_URL = 'https://clear-lemming-473.convex.cloud';
|
|
25
|
-
const VERSION = '1.3.
|
|
25
|
+
const VERSION = '1.3.10';
|
|
26
26
|
// Paths
|
|
27
27
|
const getBaseDir = () => join(homedir(), '.openclaw', 'workspace');
|
|
28
28
|
const getMemoryDir = () => join(getBaseDir(), 'memory');
|
|
@@ -727,7 +727,11 @@ function getLocalStats() {
|
|
|
727
727
|
const memoryDir = getMemoryDir();
|
|
728
728
|
if (!existsSync(memoryDir))
|
|
729
729
|
return stats;
|
|
730
|
-
|
|
730
|
+
// Only count daily log files (YYYY-MM-DD.md format), not index files
|
|
731
|
+
const files = readdirSync(memoryDir).filter(f => {
|
|
732
|
+
// Match YYYY-MM-DD.md pattern only
|
|
733
|
+
return /^\d{4}-\d{2}-\d{2}\.md$/.test(f);
|
|
734
|
+
});
|
|
731
735
|
for (const file of files) {
|
|
732
736
|
const content = readFileSync(join(memoryDir, file), 'utf-8');
|
|
733
737
|
const lines = content.split('\n');
|
|
@@ -759,7 +763,10 @@ function getLocalMemoriesForSync() {
|
|
|
759
763
|
const memoryDir = getMemoryDir();
|
|
760
764
|
if (!existsSync(memoryDir))
|
|
761
765
|
return memories;
|
|
762
|
-
|
|
766
|
+
// Only sync daily log files (YYYY-MM-DD.md format), not index or other files
|
|
767
|
+
const files = readdirSync(memoryDir).filter(f => {
|
|
768
|
+
return /^\d{4}-\d{2}-\d{2}\.md$/.test(f);
|
|
769
|
+
});
|
|
763
770
|
for (const file of files) {
|
|
764
771
|
const filePath = join(memoryDir, file);
|
|
765
772
|
const content = readFileSync(filePath, 'utf-8');
|