digital-brain 0.1.3 → 1.0.3

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.
Files changed (48) hide show
  1. package/README.md +38 -7
  2. package/bin/digital-brain.js +275 -38
  3. package/docs/AUTOMATIONS.md +13 -4
  4. package/docs/INTEGRATIONS.md +72 -0
  5. package/docs/PRIVACY.md +3 -1
  6. package/docs/SETUP.md +78 -0
  7. package/examples/sample-vault/{04 People/Interpreted Relationships/Close Friend.md → 06 AI Memory/Generated Relationship Drafts/Close Friend (WhatsApp).md } +4 -3
  8. package/examples/sample-vault/{04 People/Interpreted Relationships/Mom.md → 06 AI Memory/Generated Relationship Drafts/Mom (WhatsApp).md } +4 -3
  9. package/examples/sample-vault/{08 Sources/WhatsApp/Analysis/Interpreted/Project Team.md → 06 AI Memory/Generated Relationship Drafts/Project Team (WhatsApp).md } +4 -3
  10. package/examples/sample-vault/06 AI Memory/Interpreted Relationship Memory.md +3 -3
  11. package/examples/sample-vault/06 AI Memory/Person Context Index.md +26 -0
  12. package/examples/sample-vault/06 AI Memory/Person Reply Context.md +26 -0
  13. package/examples/sample-vault/08 Sources/{WhatsApp/Analysis/Interpreted/Close Friend.md → Analysis/Interpreted/Close Friend (WhatsApp).md } +4 -3
  14. package/examples/sample-vault/08 Sources/{WhatsApp/Analysis/Interpreted/Mom.md → Analysis/Interpreted/Mom (WhatsApp).md } +4 -3
  15. package/examples/sample-vault/{04 People/Interpreted Relationships/Project Team.md → 08 Sources/Analysis/Interpreted/Project Team (WhatsApp).md } +4 -3
  16. package/examples/sample-vault/08 Sources/Analysis/Relationship Map.md +38 -0
  17. package/examples/sample-vault/08 Sources/Analysis/interpreted_relationship_models.json +175 -0
  18. package/examples/sample-vault/08 Sources/Analysis/person_identity_map.json +78 -0
  19. package/examples/sample-vault/08 Sources/Analysis/relationship_profiles.json +122 -0
  20. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/Interpreted/Close Friend (WhatsApp).md +44 -0
  21. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/Interpreted/Mom (WhatsApp).md +45 -0
  22. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/Interpreted/Project Team (WhatsApp).md +45 -0
  23. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/Relationship Map.md +9 -3
  24. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/interpreted_relationship_models.json +18 -0
  25. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/person_identity_map.json +78 -0
  26. package/examples/sample-vault/08 Sources/WhatsApp/Analysis/relationship_profiles.json +18 -0
  27. package/examples/sample-vault/08 Sources/WhatsApp/Raw/2026-01-01.jsonl +6 -6
  28. package/lib/fs.js +33 -0
  29. package/package.json +2 -1
  30. package/scripts/digital_brain_imessage_sync.py +175 -0
  31. package/scripts/digital_brain_linkedin_export_import.py +214 -0
  32. package/scripts/digital_brain_relationship_extractor.py +189 -12
  33. package/scripts/digital_brain_relationship_interpreter.py +104 -15
  34. package/scripts/digital_brain_slack_export_import.py +181 -0
  35. package/scripts/digital_brain_whatsapp_mac_sync.py +37 -8
  36. package/templates/vault/00 Home/How AI Should Use This Vault.md +1 -1
  37. package/templates/vault/00 Home/Start Here.md +2 -1
  38. package/templates/vault/04 People/Relationship Overrides.md +2 -1
  39. package/templates/vault/06 AI Memory/Generated Relationship Drafts/README.md +5 -0
  40. package/templates/vault/06 AI Memory/Interpreted Relationship Memory.md +1 -2
  41. package/templates/vault/06 AI Memory/Person Context Index.md +4 -0
  42. package/templates/vault/06 AI Memory/Person Reply Context.md +4 -0
  43. package/templates/vault/08 Sources/README.md +5 -0
  44. package/templates/vault/08 Sources/WhatsApp/Outbound/README.md +2 -2
  45. package/templates/vault/AGENTS.md +5 -1
  46. package/templates/vault/CLAUDE.md +3 -0
  47. package/templates/vault/GEMINI.md +4 -0
  48. package/whatsapp-web/send.mjs +32 -5
@@ -0,0 +1,122 @@
1
+ [
2
+ {
3
+ "chatName": "Mom",
4
+ "sourceSystem": "WhatsApp",
5
+ "displayName": "Mom (WhatsApp)",
6
+ "identityName": "Mom",
7
+ "canonicalPersonKey": "person::mom",
8
+ "identityConfidence": "medium",
9
+ "identityEvidence": "WhatsApp direct chat identity",
10
+ "messageCount": 2,
11
+ "inbound": 1,
12
+ "outbound": 1,
13
+ "outboundShare": 0.5,
14
+ "firstSeen": "2026-01-01",
15
+ "lastSeen": "2026-01-01",
16
+ "isGroup": false,
17
+ "sentimentScore": 0.159,
18
+ "warmthScore": 0.5,
19
+ "frictionScore": 0.0,
20
+ "operationalScore": 1.5,
21
+ "questionCount": 0,
22
+ "relationshipGuess": "warm personal relationship",
23
+ "tags": [
24
+ "direct-chat",
25
+ "light",
26
+ "warm",
27
+ "logistics-heavy"
28
+ ],
29
+ "typingStyle": {
30
+ "sampleSize": 1,
31
+ "avgChars": 24.0,
32
+ "avgWords": 4.0,
33
+ "lowercaseShare": 0.0,
34
+ "uppercaseShare": 0.0,
35
+ "questionShare": 0.0,
36
+ "exclamationShare": 0.0,
37
+ "emojiShare": 0.0,
38
+ "slang": [],
39
+ "signature": "very short"
40
+ }
41
+ },
42
+ {
43
+ "chatName": "Project Team",
44
+ "sourceSystem": "WhatsApp",
45
+ "displayName": "Project Team (WhatsApp)",
46
+ "identityName": "Project Team",
47
+ "canonicalPersonKey": "group::whatsapp::project team",
48
+ "identityConfidence": "medium",
49
+ "identityEvidence": "group chat kept source-specific",
50
+ "messageCount": 2,
51
+ "inbound": 1,
52
+ "outbound": 1,
53
+ "outboundShare": 0.5,
54
+ "firstSeen": "2026-01-01",
55
+ "lastSeen": "2026-01-01",
56
+ "isGroup": true,
57
+ "sentimentScore": 0,
58
+ "warmthScore": 0.0,
59
+ "frictionScore": 0.0,
60
+ "operationalScore": 3.0,
61
+ "questionCount": 1,
62
+ "relationshipGuess": "group, likely social or mixed context",
63
+ "tags": [
64
+ "group-chat",
65
+ "light",
66
+ "logistics-heavy",
67
+ "question-heavy"
68
+ ],
69
+ "typingStyle": {
70
+ "sampleSize": 1,
71
+ "avgChars": 33.0,
72
+ "avgWords": 6.0,
73
+ "lowercaseShare": 0.0,
74
+ "uppercaseShare": 0.0,
75
+ "questionShare": 0.0,
76
+ "exclamationShare": 0.0,
77
+ "emojiShare": 0.0,
78
+ "slang": [],
79
+ "signature": "short"
80
+ }
81
+ },
82
+ {
83
+ "chatName": "Close Friend",
84
+ "sourceSystem": "WhatsApp",
85
+ "displayName": "Close Friend (WhatsApp)",
86
+ "identityName": "Close Friend",
87
+ "canonicalPersonKey": "person::close friend",
88
+ "identityConfidence": "medium",
89
+ "identityEvidence": "WhatsApp direct chat identity",
90
+ "messageCount": 2,
91
+ "inbound": 1,
92
+ "outbound": 1,
93
+ "outboundShare": 0.5,
94
+ "firstSeen": "2026-01-01",
95
+ "lastSeen": "2026-01-01",
96
+ "isGroup": false,
97
+ "sentimentScore": 0.159,
98
+ "warmthScore": 1.0,
99
+ "frictionScore": 0.0,
100
+ "operationalScore": 0.5,
101
+ "questionCount": 0,
102
+ "relationshipGuess": "warm personal relationship",
103
+ "tags": [
104
+ "direct-chat",
105
+ "light",
106
+ "warm",
107
+ "logistics-heavy"
108
+ ],
109
+ "typingStyle": {
110
+ "sampleSize": 1,
111
+ "avgChars": 30.0,
112
+ "avgWords": 5.0,
113
+ "lowercaseShare": 0.0,
114
+ "uppercaseShare": 0.0,
115
+ "questionShare": 0.0,
116
+ "exclamationShare": 0.0,
117
+ "emojiShare": 0.0,
118
+ "slang": [],
119
+ "signature": "short"
120
+ }
121
+ }
122
+ ]
@@ -0,0 +1,44 @@
1
+ # Close Friend (WhatsApp)
2
+
3
+ Generated: 2026-06-09T23:15:09.589124+00:00
4
+ Source: WhatsApp
5
+ Role: operational contact
6
+ Role confidence: low
7
+ Closeness: medium
8
+ Conversation difficulty: low
9
+ Typing style: short
10
+
11
+ Generated draft, not truth. These are private working notes. Edit them where wrong.
12
+
13
+ ## Role / Relationship Label
14
+ - operational contact (low confidence).
15
+ - Reason: logistics-heavy communication.
16
+
17
+ ## Closeness And Importance
18
+ - Closeness: medium.
19
+ - Reciprocity: balanced.
20
+ - Conversation difficulty: low.
21
+
22
+ ## Communication Pattern
23
+ - Messages: 2 (1 inbound, 1 outbound).
24
+ - Tags: direct-chat, light, warm, logistics-heavy.
25
+
26
+ ## Typing Style To Match
27
+ - Signature: short.
28
+ - Average length: 5.0 words / 30.0 chars.
29
+ - Lowercase share: 0.0.
30
+ - Question share: 0.0.
31
+ - Exclamation share: 0.0.
32
+ - Emoji share: 0.0.
33
+ - Slang: none detected.
34
+
35
+ ## How To Continue This Relationship
36
+ - Keep tone neutral until the user labels this relationship.
37
+ - Track open loops, plans, dates, and commitments.
38
+
39
+ ## Reply Guidance
40
+ - Keep replies very short unless context demands detail.
41
+ - Match style without exaggerating or parodying the person.
42
+
43
+ ## What Not To Assume
44
+ - Do not expose private summaries unless asked.
@@ -0,0 +1,45 @@
1
+ # Mom (WhatsApp)
2
+
3
+ Generated: 2026-06-09T23:15:09.587707+00:00
4
+ Source: WhatsApp
5
+ Role: mother
6
+ Role confidence: high
7
+ Closeness: medium
8
+ Conversation difficulty: low
9
+ Typing style: very short
10
+
11
+ Generated draft, not truth. These are private working notes. Edit them where wrong.
12
+
13
+ ## Role / Relationship Label
14
+ - mother (high confidence).
15
+ - Reason: manual override.
16
+
17
+ ## Closeness And Importance
18
+ - Closeness: medium.
19
+ - Reciprocity: balanced.
20
+ - Conversation difficulty: low.
21
+
22
+ ## Communication Pattern
23
+ - Messages: 2 (1 inbound, 1 outbound).
24
+ - Tags: direct-chat, light, warm, logistics-heavy.
25
+
26
+ ## Typing Style To Match
27
+ - Signature: very short.
28
+ - Average length: 4.0 words / 24.0 chars.
29
+ - Lowercase share: 0.0.
30
+ - Question share: 0.0.
31
+ - Exclamation share: 0.0.
32
+ - Emoji share: 0.0.
33
+ - Slang: none detected.
34
+
35
+ ## How To Continue This Relationship
36
+ - Use warmer language than a work chat.
37
+ - Do not make the interaction purely transactional.
38
+ - Track open loops, plans, dates, and commitments.
39
+
40
+ ## Reply Guidance
41
+ - Keep replies very short unless context demands detail.
42
+ - Match style without exaggerating or parodying the person.
43
+
44
+ ## What Not To Assume
45
+ - Do not expose private summaries unless asked.
@@ -0,0 +1,45 @@
1
+ # Project Team (WhatsApp)
2
+
3
+ Generated: 2026-06-09T23:15:09.588601+00:00
4
+ Source: WhatsApp
5
+ Role: work collaborator
6
+ Role confidence: medium
7
+ Closeness: low/unclear
8
+ Conversation difficulty: practical/low-emotional
9
+ Typing style: short
10
+
11
+ Generated draft, not truth. These are private working notes. Edit them where wrong.
12
+
13
+ ## Role / Relationship Label
14
+ - work collaborator (medium confidence).
15
+ - Reason: matched chat name.
16
+
17
+ ## Closeness And Importance
18
+ - Closeness: low/unclear.
19
+ - Reciprocity: balanced.
20
+ - Conversation difficulty: practical/low-emotional.
21
+
22
+ ## Communication Pattern
23
+ - Messages: 2 (1 inbound, 1 outbound).
24
+ - Tags: group-chat, light, logistics-heavy, question-heavy.
25
+
26
+ ## Typing Style To Match
27
+ - Signature: short.
28
+ - Average length: 6.0 words / 33.0 chars.
29
+ - Lowercase share: 0.0.
30
+ - Question share: 0.0.
31
+ - Exclamation share: 0.0.
32
+ - Emoji share: 0.0.
33
+ - Slang: none detected.
34
+
35
+ ## How To Continue This Relationship
36
+ - Lead with context, next steps, and clear asks.
37
+ - Keep emotional interpretation light.
38
+ - Track open loops, plans, dates, and commitments.
39
+
40
+ ## Reply Guidance
41
+ - Use concise replies with one clear point.
42
+ - Match style without exaggerating or parodying the person.
43
+
44
+ ## What Not To Assume
45
+ - Do not expose private summaries unless asked.
@@ -4,8 +4,10 @@ Window: last 365 days
4
4
 
5
5
  Generated signals. Treat as editable working notes.
6
6
 
7
- ## Mom
7
+ ## Mom (WhatsApp)
8
8
 
9
+ - Source: WhatsApp
10
+ - Canonical person: Mom (person::mom)
9
11
  - Guess: warm personal relationship
10
12
  - Messages: 2 (1 inbound, 1 outbound)
11
13
  - Dates: 2026-01-01 to 2026-01-01
@@ -13,8 +15,10 @@ Generated signals. Treat as editable working notes.
13
15
  - Tags: direct-chat, light, warm, logistics-heavy
14
16
  - Typing style: very short; avg 4.0 words; lowercase 0.0; emoji 0.0; slang none
15
17
 
16
- ## Project Team
18
+ ## Project Team (WhatsApp)
17
19
 
20
+ - Source: WhatsApp
21
+ - Canonical person: Project Team (group::whatsapp::project team)
18
22
  - Guess: group, likely social or mixed context
19
23
  - Messages: 2 (1 inbound, 1 outbound)
20
24
  - Dates: 2026-01-01 to 2026-01-01
@@ -22,8 +26,10 @@ Generated signals. Treat as editable working notes.
22
26
  - Tags: group-chat, light, logistics-heavy, question-heavy
23
27
  - Typing style: short; avg 6.0 words; lowercase 0.0; emoji 0.0; slang none
24
28
 
25
- ## Close Friend
29
+ ## Close Friend (WhatsApp)
26
30
 
31
+ - Source: WhatsApp
32
+ - Canonical person: Close Friend (person::close friend)
27
33
  - Guess: warm personal relationship
28
34
  - Messages: 2 (1 inbound, 1 outbound)
29
35
  - Dates: 2026-01-01 to 2026-01-01
@@ -1,6 +1,12 @@
1
1
  [
2
2
  {
3
3
  "chatName": "Mom",
4
+ "sourceSystem": "WhatsApp",
5
+ "displayName": "Mom (WhatsApp)",
6
+ "identityName": "Mom",
7
+ "canonicalPersonKey": "person::mom",
8
+ "identityConfidence": "medium",
9
+ "identityEvidence": "WhatsApp direct chat identity",
4
10
  "messageCount": 2,
5
11
  "inbound": 1,
6
12
  "outbound": 1,
@@ -53,6 +59,12 @@
53
59
  },
54
60
  {
55
61
  "chatName": "Project Team",
62
+ "sourceSystem": "WhatsApp",
63
+ "displayName": "Project Team (WhatsApp)",
64
+ "identityName": "Project Team",
65
+ "canonicalPersonKey": "group::whatsapp::project team",
66
+ "identityConfidence": "medium",
67
+ "identityEvidence": "group chat kept source-specific",
56
68
  "messageCount": 2,
57
69
  "inbound": 1,
58
70
  "outbound": 1,
@@ -105,6 +117,12 @@
105
117
  },
106
118
  {
107
119
  "chatName": "Close Friend",
120
+ "sourceSystem": "WhatsApp",
121
+ "displayName": "Close Friend (WhatsApp)",
122
+ "identityName": "Close Friend",
123
+ "canonicalPersonKey": "person::close friend",
124
+ "identityConfidence": "medium",
125
+ "identityEvidence": "WhatsApp direct chat identity",
108
126
  "messageCount": 2,
109
127
  "inbound": 1,
110
128
  "outbound": 1,
@@ -0,0 +1,78 @@
1
+ [
2
+ {
3
+ "canonicalPersonKey": "person::mom",
4
+ "displayName": "Mom",
5
+ "aliases": [
6
+ "Mom"
7
+ ],
8
+ "sources": [
9
+ "WhatsApp"
10
+ ],
11
+ "sourceProfiles": [
12
+ {
13
+ "sourceSystem": "WhatsApp",
14
+ "chatName": "Mom",
15
+ "displayName": "Mom (WhatsApp)",
16
+ "messageCount": 2,
17
+ "firstSeen": "2026-01-01",
18
+ "lastSeen": "2026-01-01",
19
+ "relationshipGuess": "warm personal relationship",
20
+ "typingStyle": {
21
+ "sampleSize": 1,
22
+ "avgChars": 24.0,
23
+ "avgWords": 4.0,
24
+ "lowercaseShare": 0.0,
25
+ "uppercaseShare": 0.0,
26
+ "questionShare": 0.0,
27
+ "exclamationShare": 0.0,
28
+ "emojiShare": 0.0,
29
+ "slang": [],
30
+ "signature": "very short"
31
+ },
32
+ "identityConfidence": "medium",
33
+ "identityEvidence": "WhatsApp direct chat identity"
34
+ }
35
+ ],
36
+ "totalMessages": 2,
37
+ "firstSeen": "2026-01-01",
38
+ "lastSeen": "2026-01-01"
39
+ },
40
+ {
41
+ "canonicalPersonKey": "person::close friend",
42
+ "displayName": "Close Friend",
43
+ "aliases": [
44
+ "Close Friend"
45
+ ],
46
+ "sources": [
47
+ "WhatsApp"
48
+ ],
49
+ "sourceProfiles": [
50
+ {
51
+ "sourceSystem": "WhatsApp",
52
+ "chatName": "Close Friend",
53
+ "displayName": "Close Friend (WhatsApp)",
54
+ "messageCount": 2,
55
+ "firstSeen": "2026-01-01",
56
+ "lastSeen": "2026-01-01",
57
+ "relationshipGuess": "warm personal relationship",
58
+ "typingStyle": {
59
+ "sampleSize": 1,
60
+ "avgChars": 30.0,
61
+ "avgWords": 5.0,
62
+ "lowercaseShare": 0.0,
63
+ "uppercaseShare": 0.0,
64
+ "questionShare": 0.0,
65
+ "exclamationShare": 0.0,
66
+ "emojiShare": 0.0,
67
+ "slang": [],
68
+ "signature": "short"
69
+ },
70
+ "identityConfidence": "medium",
71
+ "identityEvidence": "WhatsApp direct chat identity"
72
+ }
73
+ ],
74
+ "totalMessages": 2,
75
+ "firstSeen": "2026-01-01",
76
+ "lastSeen": "2026-01-01"
77
+ }
78
+ ]
@@ -1,6 +1,12 @@
1
1
  [
2
2
  {
3
3
  "chatName": "Mom",
4
+ "sourceSystem": "WhatsApp",
5
+ "displayName": "Mom (WhatsApp)",
6
+ "identityName": "Mom",
7
+ "canonicalPersonKey": "person::mom",
8
+ "identityConfidence": "medium",
9
+ "identityEvidence": "WhatsApp direct chat identity",
4
10
  "messageCount": 2,
5
11
  "inbound": 1,
6
12
  "outbound": 1,
@@ -35,6 +41,12 @@
35
41
  },
36
42
  {
37
43
  "chatName": "Project Team",
44
+ "sourceSystem": "WhatsApp",
45
+ "displayName": "Project Team (WhatsApp)",
46
+ "identityName": "Project Team",
47
+ "canonicalPersonKey": "group::whatsapp::project team",
48
+ "identityConfidence": "medium",
49
+ "identityEvidence": "group chat kept source-specific",
38
50
  "messageCount": 2,
39
51
  "inbound": 1,
40
52
  "outbound": 1,
@@ -69,6 +81,12 @@
69
81
  },
70
82
  {
71
83
  "chatName": "Close Friend",
84
+ "sourceSystem": "WhatsApp",
85
+ "displayName": "Close Friend (WhatsApp)",
86
+ "identityName": "Close Friend",
87
+ "canonicalPersonKey": "person::close friend",
88
+ "identityConfidence": "medium",
89
+ "identityEvidence": "WhatsApp direct chat identity",
72
90
  "messageCount": 2,
73
91
  "inbound": 1,
74
92
  "outbound": 1,
@@ -1,6 +1,6 @@
1
- {"id":"sample-1","source":"sample","timestamp":"2026-01-01T10:00:00+00:00","chatName":"Mom","isGroup":false,"fromMe":false,"author":"Mom","body":"Good morning, call me when you wake up"}
2
- {"id":"sample-2","source":"sample","timestamp":"2026-01-01T10:05:00+00:00","chatName":"Mom","isGroup":false,"fromMe":true,"author":"Me","body":"Morning, will call in 10"}
3
- {"id":"sample-3","source":"sample","timestamp":"2026-01-01T11:00:00+00:00","chatName":"Project Team","isGroup":true,"fromMe":false,"author":"Alex","body":"Can you send the deck before the client meeting?"}
4
- {"id":"sample-4","source":"sample","timestamp":"2026-01-01T11:03:00+00:00","chatName":"Project Team","isGroup":true,"fromMe":true,"author":"Me","body":"Yes, sending the updated deck now"}
5
- {"id":"sample-5","source":"sample","timestamp":"2026-01-01T20:00:00+00:00","chatName":"Close Friend","isGroup":false,"fromMe":false,"author":"Friend","body":"That was fun haha, let's plan another trip"}
6
- {"id":"sample-6","source":"sample","timestamp":"2026-01-01T20:02:00+00:00","chatName":"Close Friend","isGroup":false,"fromMe":true,"author":"Me","body":"Yes absolutely, that was great"}
1
+ {"id":"sample-1","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T10:00:00+00:00","chatName":"Mom","isGroup":false,"fromMe":false,"author":"Mom","body":"Good morning, call me when you wake up"}
2
+ {"id":"sample-2","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T10:05:00+00:00","chatName":"Mom","isGroup":false,"fromMe":true,"author":"Me","body":"Morning, will call in 10"}
3
+ {"id":"sample-3","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T11:00:00+00:00","chatName":"Project Team","isGroup":true,"fromMe":false,"author":"Alex","body":"Can you send the deck before the client meeting?"}
4
+ {"id":"sample-4","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T11:03:00+00:00","chatName":"Project Team","isGroup":true,"fromMe":true,"author":"Me","body":"Yes, sending the updated deck now"}
5
+ {"id":"sample-5","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T20:00:00+00:00","chatName":"Close Friend","isGroup":false,"fromMe":false,"author":"Friend","body":"That was fun haha, let's plan another trip"}
6
+ {"id":"sample-6","source":"sample","sourceSystem":"WhatsApp","timestamp":"2026-01-01T20:02:00+00:00","chatName":"Close Friend","isGroup":false,"fromMe":true,"author":"Me","body":"Yes absolutely, that was great"}
package/lib/fs.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import fs from "node:fs";
2
+ import os from "node:os";
2
3
  import path from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
 
@@ -28,5 +29,37 @@ export function resolveVault(cwd) {
28
29
  if (parent === current) break;
29
30
  current = parent;
30
31
  }
32
+ const configured = readDefaultVault();
33
+ if (configured) return configured;
31
34
  return path.resolve(cwd);
32
35
  }
36
+
37
+ export function globalConfigPath() {
38
+ return path.join(os.homedir(), ".digital-brain", "config.json");
39
+ }
40
+
41
+ export function readDefaultVault() {
42
+ const file = globalConfigPath();
43
+ if (!fs.existsSync(file)) return "";
44
+ try {
45
+ const config = JSON.parse(fs.readFileSync(file, "utf8"));
46
+ if (config.defaultVault && fs.existsSync(path.join(config.defaultVault, "digital-brain.config.json"))) {
47
+ return config.defaultVault;
48
+ }
49
+ } catch {
50
+ return "";
51
+ }
52
+ return "";
53
+ }
54
+
55
+ export function writeDefaultVault(vault) {
56
+ const file = globalConfigPath();
57
+ ensureDir(path.dirname(file));
58
+ writeFileAtomic(file, `${JSON.stringify({ defaultVault: vault }, null, 2)}\n`);
59
+ }
60
+
61
+ function writeFileAtomic(file, content) {
62
+ const temp = `${file}.${process.pid}.tmp`;
63
+ fs.writeFileSync(temp, content);
64
+ fs.renameSync(temp, file);
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "digital-brain",
3
- "version": "0.1.3",
3
+ "version": "1.0.3",
4
4
  "description": "Your private digital imprint for AI assistants.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,6 +29,7 @@
29
29
  "personal-ai",
30
30
  "obsidian",
31
31
  "whatsapp",
32
+ "imessage",
32
33
  "local-first",
33
34
  "context"
34
35
  ],