brain-memory 0.1.0-beta.5 → 0.1.0-beta.6
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 +19 -16
- package/commands/brain/status.md +10 -11
- package/commands/brain/sync.md +126 -124
- package/package.json +2 -2
- package/prompts/claude.md +8 -3
- package/prompts/gemini.md +8 -3
- package/prompts/openai.md +8 -3
- package/src/{sync/crypto-utils.js → crypto.js} +4 -91
- package/src/export-import.js +185 -0
- package/src/git-sync.js +403 -0
- package/src/sync/oauth.js +0 -430
- package/src/sync/provider.js +0 -144
- package/src/sync/providers/dropbox.js +0 -288
- package/src/sync/providers/google-drive.js +0 -496
- package/src/sync/providers/onedrive.js +0 -308
- package/src/sync/sync-engine.js +0 -774
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ Then append the contents of the corresponding prompt file to your agent's instru
|
|
|
95
95
|
| `/brain:sunshine [target]` | Deep forensic erasure — trace and remove all references |
|
|
96
96
|
| `/brain:sleep [scope]` | Full maintenance cycle — 9 neuroscience-inspired phases |
|
|
97
97
|
| `/brain:status` | Dashboard with brain health metrics and recommendations |
|
|
98
|
-
| `/brain:sync [subcommand]` |
|
|
98
|
+
| `/brain:sync [subcommand]` | Sync memories via Git remote or export/import for portability |
|
|
99
99
|
|
|
100
100
|
## Session Lifecycle
|
|
101
101
|
|
|
@@ -358,24 +358,28 @@ Each expertise area gets an `_expertise.md` profile documenting what you know we
|
|
|
358
358
|
|
|
359
359
|
Failed recalls reset the interval to 1 day. Successful recalls extend the interval by the ease factor. This ensures you spend time on memories that need reinforcement, not ones you already know well.
|
|
360
360
|
|
|
361
|
-
###
|
|
361
|
+
### Portable Sync
|
|
362
362
|
|
|
363
|
-
`/brain:sync`
|
|
363
|
+
`/brain:sync` provides two ways to sync memories across devices — no OAuth apps, no cloud provider setup.
|
|
364
|
+
|
|
365
|
+
**Git remote** — Push/pull `.brain/` to any private Git repository. Works with GitHub, GitLab, Codeberg, or any self-hosted Git server. Uses your existing Git/SSH authentication — no additional credentials needed.
|
|
366
|
+
|
|
367
|
+
**Export/Import** — Pack the entire `.brain/` into a single encrypted file for manual transfer via USB, email, or any file-sharing service.
|
|
364
368
|
|
|
365
369
|
**Key features:**
|
|
366
370
|
- **Manual push/pull** — No background watchers, no auto-sync. You control when data moves.
|
|
367
|
-
- **
|
|
368
|
-
- **
|
|
369
|
-
- **
|
|
370
|
-
- **OAuth2 authentication** — PKCE authorization code flow with a Device Code Flow fallback for headless/SSH environments. Users register their own OAuth app with the provider and supply their client ID.
|
|
371
|
+
- **Optional encryption** — AES-256-GCM encryption with a user-provided passphrase. When enabled, all files are encrypted before committing or exporting.
|
|
372
|
+
- **Merge mode** — Import supports merge mode (only import newer files) or overwrite mode.
|
|
373
|
+
- **Zero dependencies** — Uses Node.js built-in `crypto` and the system `git` binary.
|
|
371
374
|
|
|
372
375
|
**Setup:**
|
|
373
|
-
1.
|
|
374
|
-
2. Run `/brain:sync
|
|
375
|
-
3.
|
|
376
|
-
|
|
376
|
+
1. Create a private Git repo (e.g., `gh repo create brain-data --private`)
|
|
377
|
+
2. Run `/brain:sync setup git@github.com:you/brain-data.git`
|
|
378
|
+
3. Use `/brain:sync push` and `/brain:sync pull` to keep memories in sync
|
|
379
|
+
|
|
380
|
+
For one-off transfers, use `/brain:sync export` and `/brain:sync import <path>`.
|
|
377
381
|
|
|
378
|
-
Sync state is stored locally in `.brain/.sync/` and is never
|
|
382
|
+
Sync state is stored locally in `.brain/.sync/` and is never pushed to the remote.
|
|
379
383
|
|
|
380
384
|
## File Structure
|
|
381
385
|
|
|
@@ -410,10 +414,9 @@ Sync state is stored locally in `.brain/.sync/` and is never uploaded to the clo
|
|
|
410
414
|
├── _archived/ # Decayed memories (recoverable + searchable)
|
|
411
415
|
│ ├── _meta.json
|
|
412
416
|
│ └── index.json # Searchable archive index
|
|
413
|
-
└── .sync/ #
|
|
414
|
-
├── config.json #
|
|
415
|
-
|
|
416
|
-
└── sync-state.json # Per-file revisions, cursor, conflicts
|
|
417
|
+
└── .sync/ # Sync state (local only, never pushed)
|
|
418
|
+
├── config.json # Remote URL, encryption flag
|
|
419
|
+
└── repo/ # Hidden git repo for sync
|
|
417
420
|
```
|
|
418
421
|
|
|
419
422
|
Subdirectories are created **on demand** — the agent decides placement depth based on how specific the memory is. A generic career thought lands in `professional/`, but a specific deployment incident goes to `professional/companies/acme/projects/alpha/`.
|
package/commands/brain/status.md
CHANGED
|
@@ -12,8 +12,7 @@ Also read (if they exist):
|
|
|
12
12
|
- `.brain/associations.json` — for association network stats
|
|
13
13
|
- `.brain/review-queue.json` — for review schedule info
|
|
14
14
|
- `.brain/_archived/index.json` — for archive stats
|
|
15
|
-
- `.brain/.sync/config.json` — for
|
|
16
|
-
- `.brain/.sync/sync-state.json` — for sync state and pending changes
|
|
15
|
+
- `.brain/.sync/config.json` — for git sync configuration
|
|
17
16
|
|
|
18
17
|
### 2. Compute Statistics
|
|
19
18
|
|
|
@@ -107,12 +106,13 @@ Calculate aggregate stats:
|
|
|
107
106
|
+ <title> (<path>) — <date>
|
|
108
107
|
...
|
|
109
108
|
|
|
110
|
-
##
|
|
111
|
-
|
|
112
|
-
Encryption:
|
|
113
|
-
Last
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
## Sync
|
|
110
|
+
Remote: <remote URL or "not configured">
|
|
111
|
+
Encryption: <enabled/disabled>
|
|
112
|
+
Last Push: <timestamp or "never">
|
|
113
|
+
Last Pull: <timestamp or "never">
|
|
114
|
+
Ahead: <count> commits
|
|
115
|
+
Behind: <count> commits
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
### 4. Health Check
|
|
@@ -128,6 +128,5 @@ Analyze the brain's health and provide recommendations:
|
|
|
128
128
|
- **"Needs sleep"** — Multiple flat clusters detected, OR many memories in moderate/weak tiers, OR no `_expertise.md` profiles exist despite having 10+ memories. Suggest `/brain:sleep`
|
|
129
129
|
- **"Low confidence"** — More than 30% of memories have confidence < 0.5. Suggest reviewing and validating uncertain memories.
|
|
130
130
|
- **"Review overdue"** — More than 10 memories are past their review date. Suggest `/brain:review`
|
|
131
|
-
- **"Sync available"** —
|
|
132
|
-
- **"Sync stale"** — Last
|
|
133
|
-
- **"Sync conflicts"** — Unresolved sync conflicts exist. Suggest `/brain:sync resolve`.
|
|
131
|
+
- **"Sync available"** — Git sync is not configured. Suggest `/brain:sync setup` for cross-device access.
|
|
132
|
+
- **"Sync stale"** — Last push was more than 7 days ago. Suggest `/brain:sync push`.
|
package/commands/brain/sync.md
CHANGED
|
@@ -1,87 +1,62 @@
|
|
|
1
|
-
# /brain:sync —
|
|
1
|
+
# /brain:sync — Portable Sync
|
|
2
2
|
|
|
3
|
-
You are managing
|
|
3
|
+
You are managing synchronization for the Brain Memory system. This enables manual push/pull of `.brain/` memories via any Git remote, plus encrypted single-file export/import for portable transfers.
|
|
4
4
|
|
|
5
5
|
**CRITICAL RULES:**
|
|
6
6
|
- NEVER auto-sync — always require explicit user action
|
|
7
7
|
- NEVER silently overwrite files — always show a preview first
|
|
8
|
-
- NEVER display
|
|
9
|
-
- ALWAYS show what will change before executing push/pull
|
|
8
|
+
- NEVER display passphrases or secrets in output
|
|
9
|
+
- ALWAYS show what will change before executing push/pull/import
|
|
10
10
|
|
|
11
11
|
## Subcommands
|
|
12
12
|
|
|
13
13
|
Parse the user's input to determine the subcommand:
|
|
14
|
-
- `
|
|
15
|
-
- `push` →
|
|
16
|
-
- `pull` →
|
|
17
|
-
- `status` → Show sync state
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
14
|
+
- `setup <url>` → Configure a Git remote for sync
|
|
15
|
+
- `push` → Commit and push local changes to remote
|
|
16
|
+
- `pull` → Fetch and merge remote changes to local
|
|
17
|
+
- `status` → Show sync state (ahead/behind)
|
|
18
|
+
- `export [path]` → Export .brain/ to an encrypted single file
|
|
19
|
+
- `import <path>` → Import from an export file
|
|
20
|
+
- `disconnect` → Remove sync configuration
|
|
20
21
|
|
|
21
22
|
If no subcommand is given, show available subcommands.
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
|
-
## `/brain:sync
|
|
26
|
+
## `/brain:sync setup <url>`
|
|
26
27
|
|
|
27
28
|
### Steps
|
|
28
29
|
|
|
29
30
|
1. **Check prerequisites:**
|
|
30
31
|
- Verify `.brain/` exists. If not, suggest `/brain:init` first.
|
|
32
|
+
- Verify `git` is available (`checkGitAvailable()` from `src/git-sync.js`).
|
|
31
33
|
- Check if sync is already configured (`.brain/.sync/config.json`). If so, ask if they want to reconfigure.
|
|
32
34
|
|
|
33
|
-
2. **
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- Copy the Client ID
|
|
56
|
-
- Add `http://127.0.0.1` to Authorized redirect URIs
|
|
57
|
-
|
|
58
|
-
**OneDrive:**
|
|
59
|
-
- Go to https://portal.azure.com → App registrations
|
|
60
|
-
- New registration → Personal Microsoft accounts
|
|
61
|
-
- Add redirect URI: `http://localhost` (Mobile and desktop applications)
|
|
62
|
-
- Copy Application (client) ID
|
|
63
|
-
|
|
64
|
-
4. **Ask for Client ID** from the user.
|
|
65
|
-
|
|
66
|
-
5. **Ask about encryption** (optional):
|
|
67
|
-
- "Would you like to encrypt memories before uploading? (recommended for sensitive data)"
|
|
68
|
-
- If yes, ask for a passphrase (will be needed on every push/pull and on other devices)
|
|
69
|
-
|
|
70
|
-
6. **Run OAuth flow:**
|
|
71
|
-
- Use `setupSync()` from `src/sync/sync-engine.js`
|
|
72
|
-
- This will open the browser for authorization
|
|
73
|
-
- If in SSH/headless environment, offer Device Code Flow as alternative
|
|
74
|
-
|
|
75
|
-
7. **Show result:**
|
|
76
|
-
```
|
|
77
|
-
✓ Cloud sync configured!
|
|
78
|
-
Provider: [provider]
|
|
79
|
-
Account: [email/name]
|
|
80
|
-
Encryption: [enabled/disabled]
|
|
81
|
-
Remote files: [count]
|
|
35
|
+
2. **Get remote URL** (if not provided):
|
|
36
|
+
- Ask for the Git remote URL (SSH or HTTPS).
|
|
37
|
+
- Auto-detect `gh` CLI: if available, offer to create a private repo with `gh repo create brain-data --private`.
|
|
38
|
+
- Examples:
|
|
39
|
+
- `git@github.com:user/brain-data.git`
|
|
40
|
+
- `https://github.com/user/brain-data.git`
|
|
41
|
+
- `git@gitlab.com:user/brain-data.git`
|
|
42
|
+
|
|
43
|
+
3. **Ask about encryption** (optional):
|
|
44
|
+
- "Would you like to encrypt memories before pushing? (recommended for sensitive data)"
|
|
45
|
+
- If yes, ask for a passphrase (will be needed on every push/pull and on other devices).
|
|
46
|
+
|
|
47
|
+
4. **Initialize sync:**
|
|
48
|
+
- Call `initSyncRepo()` and `configureRemote()` from `src/git-sync.js`.
|
|
49
|
+
- Write config to `.brain/.sync/config.json` via `writeSyncConfig()`.
|
|
50
|
+
|
|
51
|
+
5. **Show result:**
|
|
52
|
+
```
|
|
53
|
+
✓ Git sync configured!
|
|
54
|
+
Remote: <remote-url>
|
|
55
|
+
Branch: main
|
|
56
|
+
Encryption: <enabled/disabled>
|
|
82
57
|
|
|
83
58
|
Use /brain:sync push to upload your memories.
|
|
84
|
-
Use /brain:sync pull to download from
|
|
59
|
+
Use /brain:sync pull to download from remote.
|
|
85
60
|
```
|
|
86
61
|
|
|
87
62
|
---
|
|
@@ -90,32 +65,28 @@ If no subcommand is given, show available subcommands.
|
|
|
90
65
|
|
|
91
66
|
### Steps
|
|
92
67
|
|
|
93
|
-
1. **Check sync is configured.** If not, suggest `/brain:sync
|
|
68
|
+
1. **Check sync is configured.** If not, suggest `/brain:sync setup`.
|
|
94
69
|
|
|
95
|
-
2. **Preview changes
|
|
96
|
-
-
|
|
70
|
+
2. **Preview changes:**
|
|
71
|
+
- Call `getStatus()` from `src/git-sync.js`.
|
|
97
72
|
- Display summary:
|
|
98
73
|
```
|
|
99
74
|
📤 Push Preview:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Skip: [count] unchanged
|
|
103
|
-
⚠️ Conflicts: [count] (modified both locally and remotely)
|
|
75
|
+
Remote: <remote-url>
|
|
76
|
+
Status: <ahead> commits ahead, <behind> behind
|
|
104
77
|
```
|
|
105
|
-
- If
|
|
78
|
+
- If behind > 0, warn: "Remote has newer changes. Consider pulling first."
|
|
106
79
|
|
|
107
80
|
3. **Ask for confirmation** before proceeding.
|
|
108
81
|
|
|
109
82
|
4. **Execute push:**
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
- Show
|
|
83
|
+
- If encryption is enabled, ask for passphrase.
|
|
84
|
+
- Call `push()` from `src/git-sync.js`.
|
|
85
|
+
- Show result:
|
|
113
86
|
```
|
|
114
87
|
✓ Push complete!
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Conflicts: [count] (use /brain:sync resolve to fix)
|
|
118
|
-
Errors: [count]
|
|
88
|
+
Committed: <message>
|
|
89
|
+
Remote: <remote-url>
|
|
119
90
|
```
|
|
120
91
|
|
|
121
92
|
---
|
|
@@ -126,28 +97,23 @@ If no subcommand is given, show available subcommands.
|
|
|
126
97
|
|
|
127
98
|
1. **Check sync is configured.**
|
|
128
99
|
|
|
129
|
-
2. **Preview
|
|
130
|
-
-
|
|
131
|
-
- Display summary:
|
|
100
|
+
2. **Preview:**
|
|
101
|
+
- Call `getStatus()` to show ahead/behind count.
|
|
132
102
|
```
|
|
133
103
|
📥 Pull Preview:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
Skip: [count] unchanged
|
|
137
|
-
⚠️ Conflicts: [count]
|
|
104
|
+
Remote: <remote-url>
|
|
105
|
+
Status: <behind> new commits to pull
|
|
138
106
|
```
|
|
139
107
|
|
|
140
108
|
3. **Ask for confirmation.**
|
|
141
109
|
|
|
142
110
|
4. **Execute pull:**
|
|
143
|
-
-
|
|
144
|
-
-
|
|
111
|
+
- If encryption is enabled, ask for passphrase.
|
|
112
|
+
- Call `pull()` from `src/git-sync.js`.
|
|
113
|
+
- Show result:
|
|
145
114
|
```
|
|
146
115
|
✓ Pull complete!
|
|
147
|
-
|
|
148
|
-
Deleted: [count] files
|
|
149
|
-
Conflicts: [count]
|
|
150
|
-
Errors: [count]
|
|
116
|
+
Updated <count> files from remote.
|
|
151
117
|
```
|
|
152
118
|
|
|
153
119
|
---
|
|
@@ -156,65 +122,101 @@ If no subcommand is given, show available subcommands.
|
|
|
156
122
|
|
|
157
123
|
### Steps
|
|
158
124
|
|
|
159
|
-
1. **Read sync
|
|
125
|
+
1. **Read sync config** using `getSyncConfig()` from `src/git-sync.js`.
|
|
160
126
|
|
|
161
127
|
2. **Display dashboard:**
|
|
162
128
|
```
|
|
163
|
-
|
|
129
|
+
🔄 Sync Status
|
|
164
130
|
─────────────────────
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
Last
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Conflicts: [count]
|
|
174
|
-
[list conflict files if any]
|
|
131
|
+
Remote: <remote-url or "not configured">
|
|
132
|
+
Branch: <branch>
|
|
133
|
+
Encryption: <enabled/disabled>
|
|
134
|
+
Last Push: <timestamp or "never">
|
|
135
|
+
Last Pull: <timestamp or "never">
|
|
136
|
+
Ahead: <count> commits
|
|
137
|
+
Behind: <count> commits
|
|
175
138
|
```
|
|
176
139
|
|
|
177
140
|
---
|
|
178
141
|
|
|
179
|
-
## `/brain:sync
|
|
142
|
+
## `/brain:sync export [path]`
|
|
180
143
|
|
|
181
144
|
### Steps
|
|
182
145
|
|
|
183
|
-
1. **
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
146
|
+
1. **Determine output path:**
|
|
147
|
+
- Default: `.brain-export` in the current directory.
|
|
148
|
+
- User can specify a custom path.
|
|
149
|
+
|
|
150
|
+
2. **Ask about encryption:**
|
|
151
|
+
- "Would you like to encrypt the export? (recommended)"
|
|
152
|
+
- If yes, ask for a passphrase.
|
|
153
|
+
|
|
154
|
+
3. **Execute export:**
|
|
155
|
+
- Call `exportBrain()` from `src/export-import.js`.
|
|
156
|
+
- Show result:
|
|
157
|
+
```
|
|
158
|
+
✓ Brain exported!
|
|
159
|
+
File: <output-path>
|
|
160
|
+
Memories: <count> files packed
|
|
161
|
+
Encrypted: <yes/no>
|
|
162
|
+
Size: <file-size>
|
|
163
|
+
|
|
164
|
+
Transfer this file to another machine and run /brain:sync import <path>
|
|
165
|
+
```
|
|
187
166
|
|
|
188
167
|
---
|
|
189
168
|
|
|
190
|
-
## `/brain:sync
|
|
169
|
+
## `/brain:sync import <path>`
|
|
191
170
|
|
|
192
171
|
### Steps
|
|
193
172
|
|
|
194
|
-
1. **
|
|
173
|
+
1. **Preview the import:**
|
|
174
|
+
- Call `previewImport()` from `src/export-import.js`.
|
|
175
|
+
- Display:
|
|
176
|
+
```
|
|
177
|
+
📦 Import Preview:
|
|
178
|
+
File: <path>
|
|
179
|
+
Exported at: <date>
|
|
180
|
+
Total files: <count>
|
|
181
|
+
New: <count> (will be created)
|
|
182
|
+
Existing: <count> (will be overwritten)
|
|
183
|
+
```
|
|
195
184
|
|
|
196
|
-
2. **
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
- **keep-local**: Push your local version (overwrites remote)
|
|
200
|
-
- **keep-remote**: Pull the remote version (overwrites local)
|
|
201
|
-
- **keep-both**: Save local as `filename.local.ext`, pull remote as `filename.ext`
|
|
185
|
+
2. **Ask for import mode:**
|
|
186
|
+
- **Overwrite** (default): Replace all matching files with the imported versions.
|
|
187
|
+
- **Merge**: Only import files newer than local versions.
|
|
202
188
|
|
|
203
|
-
3. **
|
|
189
|
+
3. **If encrypted, ask for passphrase.**
|
|
204
190
|
|
|
205
|
-
4. **
|
|
191
|
+
4. **Ask for confirmation.**
|
|
192
|
+
|
|
193
|
+
5. **Execute import:**
|
|
194
|
+
- Call `importBrain()` from `src/export-import.js`.
|
|
195
|
+
- Show result:
|
|
206
196
|
```
|
|
207
|
-
✓
|
|
208
|
-
|
|
197
|
+
✓ Import complete!
|
|
198
|
+
Imported: <count> files
|
|
199
|
+
Skipped: <count> (merge mode, local was newer)
|
|
209
200
|
```
|
|
210
201
|
|
|
211
202
|
---
|
|
212
203
|
|
|
204
|
+
## `/brain:sync disconnect`
|
|
205
|
+
|
|
206
|
+
### Steps
|
|
207
|
+
|
|
208
|
+
1. **Show current config** (remote URL).
|
|
209
|
+
2. **Ask for confirmation:** "This will remove sync configuration. Your remote data will NOT be deleted."
|
|
210
|
+
3. **Remove `.brain/.sync/` directory.**
|
|
211
|
+
4. **Confirm:** "✓ Sync disconnected. Remote repository is untouched."
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
213
215
|
## Key Implementation Notes
|
|
214
216
|
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
217
|
+
- Git sync engine: `src/git-sync.js`
|
|
218
|
+
- Export/import: `src/export-import.js`
|
|
219
|
+
- Crypto utilities: `src/crypto.js`
|
|
220
|
+
- Sync config stored in `.brain/.sync/config.json` (local only)
|
|
221
|
+
- Hidden git repo at `.brain/.sync/repo/` — never interferes with the project's own git
|
|
222
|
+
- All git operations use `execFileSync` — no npm dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brain-memory",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.6",
|
|
4
4
|
"description": "A brain-inspired hierarchical memory system for AI coding agents. Deep nested file structure that mimics human memory with time-decay and strength-based recall.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"url": "git+https://github.com/onurkarali/brain.git"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
-
"test": "node --test test/index-manager.test.js test/scorer.test.js test/functional.test.js test/sunshine.test.js test/stress.test.js test/
|
|
43
|
+
"test": "node --test test/index-manager.test.js test/scorer.test.js test/functional.test.js test/sunshine.test.js test/stress.test.js test/crypto.test.js test/git-sync.test.js test/export-import.test.js test/install.test.js test/prompts.test.js",
|
|
44
44
|
"prerelease": "npm test",
|
|
45
45
|
"release:beta": "npm version prerelease --preid beta && npm publish --tag beta && npm dist-tag add brain-memory@$(node -p \"require('./package.json').version\") latest",
|
|
46
46
|
"release:patch": "npm version patch && npm publish",
|
package/prompts/claude.md
CHANGED
|
@@ -58,7 +58,7 @@ Memories store their encoding context (project, topics, task type). During recal
|
|
|
58
58
|
- `/brain:sunshine [target]` — Deep forensic erasure — trace and remove all references to a memory
|
|
59
59
|
- `/brain:sleep [scope]` — Full maintenance cycle: replay, synaptic homeostasis, knowledge propagation, semantic crystallization, reorganize, consolidate, prune, REM dreaming, and expertise detection
|
|
60
60
|
- `/brain:status` — Dashboard with brain health overview
|
|
61
|
-
- `/brain:sync [subcommand]` —
|
|
61
|
+
- `/brain:sync [subcommand]` — Sync memories via Git remote or export/import for portability
|
|
62
62
|
|
|
63
63
|
## Session Start Behavior
|
|
64
64
|
|
|
@@ -123,6 +123,11 @@ When the user asks you to "remember" something, or when context from past sessio
|
|
|
123
123
|
6. Strengthen Hebbian links between co-retrieved memories
|
|
124
124
|
7. If no active matches, search the archive (`.brain/_archived/`)
|
|
125
125
|
|
|
126
|
-
##
|
|
126
|
+
## Portable Sync
|
|
127
127
|
|
|
128
|
-
Brain memories can be synced across devices
|
|
128
|
+
Brain memories can be synced across devices in two ways:
|
|
129
|
+
|
|
130
|
+
1. **Git remote** — Push/pull `.brain/` to any private Git repository (GitHub, GitLab, Codeberg, self-hosted). Run `/brain:sync setup <url>` to configure, then use `/brain:sync push` and `/brain:sync pull`.
|
|
131
|
+
2. **Export/Import** — Pack the entire `.brain/` into a single portable file for manual transfer. Run `/brain:sync export` and `/brain:sync import <path>`.
|
|
132
|
+
|
|
133
|
+
Both methods support optional AES-256-GCM encryption. Sync is always manual — never automatic.
|
package/prompts/gemini.md
CHANGED
|
@@ -59,7 +59,7 @@ Commands are available via `/brain:` prefix:
|
|
|
59
59
|
- `/brain:sunshine [target]` — Deep forensic erasure — trace and remove all references to a memory
|
|
60
60
|
- `/brain:sleep [scope]` — Full maintenance cycle: replay, synaptic homeostasis, knowledge propagation, semantic crystallization, reorganize, consolidate, prune, REM dreaming, and expertise detection
|
|
61
61
|
- `/brain:status` — Dashboard with brain health overview
|
|
62
|
-
- `/brain:sync [subcommand]` —
|
|
62
|
+
- `/brain:sync [subcommand]` — Sync memories via Git remote or export/import for portability
|
|
63
63
|
|
|
64
64
|
## Session Start Behavior
|
|
65
65
|
|
|
@@ -124,6 +124,11 @@ When the user asks you to "remember" something, or when context from past sessio
|
|
|
124
124
|
6. Strengthen Hebbian links between co-retrieved memories
|
|
125
125
|
7. If no active matches, search the archive (`.brain/_archived/`)
|
|
126
126
|
|
|
127
|
-
##
|
|
127
|
+
## Portable Sync
|
|
128
128
|
|
|
129
|
-
Brain memories can be synced across devices
|
|
129
|
+
Brain memories can be synced across devices in two ways:
|
|
130
|
+
|
|
131
|
+
1. **Git remote** — Push/pull `.brain/` to any private Git repository (GitHub, GitLab, Codeberg, self-hosted). Run `/brain:sync setup <url>` to configure, then use `/brain:sync push` and `/brain:sync pull`.
|
|
132
|
+
2. **Export/Import** — Pack the entire `.brain/` into a single portable file for manual transfer. Run `/brain:sync export` and `/brain:sync import <path>`.
|
|
133
|
+
|
|
134
|
+
Both methods support optional AES-256-GCM encryption. Sync is always manual — never automatic.
|
package/prompts/openai.md
CHANGED
|
@@ -59,7 +59,7 @@ Brain skills are available via `/brain-` prefix:
|
|
|
59
59
|
- `/brain-sunshine [target]` — Deep forensic erasure — trace and remove all references to a memory
|
|
60
60
|
- `/brain-sleep [scope]` — Full maintenance cycle: replay, synaptic homeostasis, knowledge propagation, semantic crystallization, reorganize, consolidate, prune, REM dreaming, and expertise detection
|
|
61
61
|
- `/brain-status` — Dashboard with brain health overview
|
|
62
|
-
- `/brain-sync [subcommand]` —
|
|
62
|
+
- `/brain-sync [subcommand]` — Sync memories via Git remote or export/import for portability
|
|
63
63
|
|
|
64
64
|
## Session Start Behavior
|
|
65
65
|
|
|
@@ -124,6 +124,11 @@ When the user asks you to "remember" something, or when context from past sessio
|
|
|
124
124
|
6. Strengthen Hebbian links between co-retrieved memories
|
|
125
125
|
7. If no active matches, search the archive (`.brain/_archived/`)
|
|
126
126
|
|
|
127
|
-
##
|
|
127
|
+
## Portable Sync
|
|
128
128
|
|
|
129
|
-
Brain memories can be synced across devices
|
|
129
|
+
Brain memories can be synced across devices in two ways:
|
|
130
|
+
|
|
131
|
+
1. **Git remote** — Push/pull `.brain/` to any private Git repository (GitHub, GitLab, Codeberg, self-hosted). Run `/brain-sync setup <url>` to configure, then use `/brain-sync push` and `/brain-sync pull`.
|
|
132
|
+
2. **Export/Import** — Pack the entire `.brain/` into a single portable file for manual transfer. Run `/brain-sync export` and `/brain-sync import <path>`.
|
|
133
|
+
|
|
134
|
+
Both methods support optional AES-256-GCM encryption. Sync is always manual — never automatic.
|