abmind 0.1.8-alpha.9 → 0.1.8

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 (86) hide show
  1. package/dist/cli/abmind-doctor.js +49 -2
  2. package/dist/cli/abmind-doctor.js.map +1 -1
  3. package/dist/cli/abmind-hook-wakeup.js +16 -7
  4. package/dist/cli/abmind-hook-wakeup.js.map +1 -1
  5. package/dist/cli/abmind-install.js +9 -1
  6. package/dist/cli/abmind-install.js.map +1 -1
  7. package/dist/cli/abmind-passwd.js +10 -10
  8. package/dist/cli/abmind-passwd.js.map +1 -1
  9. package/dist/cli/abmind-recall.js +8 -0
  10. package/dist/cli/abmind-recall.js.map +1 -1
  11. package/dist/cli/abmind-restore.js +20 -0
  12. package/dist/cli/abmind-restore.js.map +1 -1
  13. package/dist/cli/abmind-sleep.js +16 -1
  14. package/dist/cli/abmind-sleep.js.map +1 -1
  15. package/dist/cli/abmind.js +13 -1
  16. package/dist/cli/abmind.js.map +1 -1
  17. package/dist/src/backup.d.ts.map +1 -1
  18. package/dist/src/backup.js +26 -2
  19. package/dist/src/backup.js.map +1 -1
  20. package/dist/src/citation-detector.d.ts +14 -0
  21. package/dist/src/citation-detector.d.ts.map +1 -0
  22. package/dist/src/citation-detector.js +64 -0
  23. package/dist/src/citation-detector.js.map +1 -0
  24. package/dist/src/deploy-lib/manifest.d.ts +2 -0
  25. package/dist/src/deploy-lib/manifest.d.ts.map +1 -1
  26. package/dist/src/deploy-lib/manifest.js.map +1 -1
  27. package/dist/src/emotion-arc.d.ts +1 -1
  28. package/dist/src/emotion-arc.d.ts.map +1 -1
  29. package/dist/src/emotion-utils.d.ts +2 -0
  30. package/dist/src/emotion-utils.d.ts.map +1 -1
  31. package/dist/src/emotion-utils.js.map +1 -1
  32. package/dist/src/ensure-initialized.d.ts.map +1 -1
  33. package/dist/src/ensure-initialized.js +11 -3
  34. package/dist/src/ensure-initialized.js.map +1 -1
  35. package/dist/src/imemory-system.d.ts +1 -1
  36. package/dist/src/imemory-system.d.ts.map +1 -1
  37. package/dist/src/index.d.ts +2 -0
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/dist/src/index.js +1 -0
  40. package/dist/src/index.js.map +1 -1
  41. package/dist/src/mem-types.d.ts +5 -0
  42. package/dist/src/mem-types.d.ts.map +1 -1
  43. package/dist/src/memory-db.d.ts.map +1 -1
  44. package/dist/src/memory-db.js +2 -29
  45. package/dist/src/memory-db.js.map +1 -1
  46. package/dist/src/memory-editor.d.ts.map +1 -1
  47. package/dist/src/memory-editor.js +20 -4
  48. package/dist/src/memory-editor.js.map +1 -1
  49. package/dist/src/memory-index.d.ts +4 -0
  50. package/dist/src/memory-index.d.ts.map +1 -1
  51. package/dist/src/memory-index.js +26 -0
  52. package/dist/src/memory-index.js.map +1 -1
  53. package/dist/src/memory-ipc-client.d.ts +2 -0
  54. package/dist/src/memory-ipc-client.d.ts.map +1 -1
  55. package/dist/src/memory-ipc-client.js +12 -2
  56. package/dist/src/memory-ipc-client.js.map +1 -1
  57. package/dist/src/memory-ipc-server.d.ts +3 -0
  58. package/dist/src/memory-ipc-server.d.ts.map +1 -1
  59. package/dist/src/memory-ipc-server.js +9 -1
  60. package/dist/src/memory-ipc-server.js.map +1 -1
  61. package/dist/src/memory-manager.d.ts +9 -1
  62. package/dist/src/memory-manager.d.ts.map +1 -1
  63. package/dist/src/memory-manager.js +34 -11
  64. package/dist/src/memory-manager.js.map +1 -1
  65. package/dist/src/message-store.d.ts +9 -2
  66. package/dist/src/message-store.d.ts.map +1 -1
  67. package/dist/src/message-store.js +13 -2
  68. package/dist/src/message-store.js.map +1 -1
  69. package/dist/src/recall-engine.d.ts.map +1 -1
  70. package/dist/src/recall-engine.js +38 -1
  71. package/dist/src/recall-engine.js.map +1 -1
  72. package/dist/src/session-context.d.ts +12 -3
  73. package/dist/src/session-context.d.ts.map +1 -1
  74. package/dist/src/session-context.js +68 -38
  75. package/dist/src/session-context.js.map +1 -1
  76. package/dist/src/status-block.d.ts.map +1 -1
  77. package/dist/src/status-block.js +16 -0
  78. package/dist/src/status-block.js.map +1 -1
  79. package/package.json +2 -2
  80. package/prompts/sleep/05-contradiction-and-graph.md +2 -0
  81. package/templates/core/SOUL.md +1 -1
  82. package/templates/core/memory-tools.md +21 -2
  83. package/dist/src/emotion-tagger.d.ts +0 -8
  84. package/dist/src/emotion-tagger.d.ts.map +0 -1
  85. package/dist/src/emotion-tagger.js +0 -45
  86. package/dist/src/emotion-tagger.js.map +0 -1
@@ -46,6 +46,22 @@ export function buildStatusBlock(memory) {
46
46
  }
47
47
  }
48
48
  catch { /* skip */ }
49
+ // Task failures (today)
50
+ try {
51
+ const abtarsHome = process.env["ABTARS_HOME"] ?? join(require("os").homedir(), ".abtars");
52
+ const tasksPath = join(abtarsHome, "tasks", "tasks.json");
53
+ if (existsSync(tasksPath)) {
54
+ const tasks = JSON.parse(readFileSync(tasksPath, "utf-8"));
55
+ const todayStart = new Date();
56
+ todayStart.setHours(0, 0, 0, 0);
57
+ const todayMs = todayStart.getTime();
58
+ const failed = tasks.filter(t => t.history?.some(h => h.ts >= todayMs && h.exitCode && h.exitCode !== 0));
59
+ if (failed.length > 0) {
60
+ warnings.push(`⚠️ ${failed.length} task(s) failed today: ${failed.map(t => t.message).join(", ")}`);
61
+ }
62
+ }
63
+ }
64
+ catch { /* skip */ }
49
65
  // Errors
50
66
  const errLog = join(abmindHooksDir(), "errors.log");
51
67
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"status-block.js","sourceRoot":"","sources":["../../src/status-block.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnE,QAAQ,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC;IAEtB,IAAI,MAAM,GAAG,mBAAmB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACpD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "abmind",
3
- "version": "0.1.8-alpha.9",
4
- "description": "Standalone AI agent memory system SQLite, FTS5, embeddings, 4-layer recall, sleep maintenance",
3
+ "version": "0.1.8",
4
+ "description": "Standalone AI agent memory system \u2014 SQLite, FTS5, embeddings, 4-layer recall, sleep maintenance",
5
5
  "keywords": [
6
6
  "ai",
7
7
  "agent",
@@ -16,6 +16,8 @@ ${CONTRADICTION_CANDIDATES}
16
16
 
17
17
  Do any NEW memories contradict EXISTING ones? A contradiction is when a new fact makes an old fact false (not just different — actually incompatible).
18
18
 
19
+ Note: Obvious contradictions (explicit negation patterns like "no longer", "switched from", "actually") are already caught at store time and the old memory will have valid_to set. Focus on SUBTLE contradictions that keyword matching would miss — implicit conflicts, contextual incompatibilities, changed circumstances.
20
+
19
21
  Examples of contradictions:
20
22
  - NEW: "User prefers Sonnet" vs EXISTING: "User prefers Opus" → contradiction
21
23
  - NEW: "Peter moved to Berlin" vs EXISTING: "Peter lives in Budapest" → contradiction
@@ -20,5 +20,5 @@ Store aggressively — if it's a fact, preference, decision, event, or lesson, s
20
20
  - In group chats: respond only when mentioned or directly addressed
21
21
 
22
22
  ## Emotions
23
- I track emotional context with every memory (emotion_score -5 to +5).
23
+ I track emotional context via emotion_tags on every memory. Tags come from me (at store time) or from user emoji reactions. Score is derived automatically — never set it manually.
24
24
  Reactions are non-verbal memory — they tell me how the user felt.
@@ -15,11 +15,11 @@ Returns matching memories ranked by relevance. Use when user asks about past con
15
15
  ## Store (save a memory)
16
16
 
17
17
  ```
18
- abmind store --translated "English content" --original "user's actual words" --memory-type fact --emotion-score 0 --user-id <USER_ID>
18
+ abmind store --translated "English content" --original "user's actual words" --memory-type fact --emotion-tags "pride,satisfaction" --user-id <USER_ID>
19
19
  ```
20
20
 
21
21
  Types: `fact`, `decision`, `preference`, `event`, `lesson`, `feedback`, `story`
22
- Emotion: -3 (very negative) to +3 (very positive), 0 = neutral
22
+ `--emotion-tags` (REQUIRED your best read of the emotional tone. Comma-separated from: joy, trust, hope, fear, grief, anger, doubt, relief, pride, curiosity, frustration, surprise, determination, exhaustion, anxiety, gratitude, love, humor, peace, confusion, excitement, conviction, tenderness)
23
23
 
24
24
  ## Edit (modify existing memory)
25
25
 
@@ -43,6 +43,25 @@ abmind edit --memory-id <N> [--credibility N] [--classification N] [--emotion-sc
43
43
  ## When to store
44
44
  Store when user says "remember" or info is important. Don't store greetings/small talk.
45
45
 
46
+ ## Learning Signals — what to store and how
47
+
48
+ | Signal | Examples | Store as |
49
+ |--------|----------|----------|
50
+ | Correction | "No that's wrong", "I told you before", "Stop doing X", "Why do you keep..." | type=lesson, confidence=4. Contradicts prior → store it, the old one expires automatically. |
51
+ | Preference | "I like when you...", "Always do X", "Never do Y", "My style is..." | type=preference, confidence=3 |
52
+ | Explicit rule | "Remember that I always...", "For [project] use..." | type=fact, confidence=4 |
53
+ | Repeated praise | Same approach praised 3+ times | type=lesson, note what worked |
54
+
55
+ ## Don't store
56
+
57
+ - One-time instructions — "do X now", "run this command", "fix this line"
58
+ - Context-specific — "in this file", "for this PR", "just this once"
59
+ - Hypotheticals — "what if...", "could you try..."
60
+ - Transient state — file contents, errors, build output, log snippets
61
+ - Already known — check recall before storing duplicates
62
+
63
+ Rule: "will this matter in a week?" No → don't store.
64
+
46
65
  ## ABM-L Format
47
66
  Memory injection uses compact ABM-L format: `[TYPE+FLAGS|topic|emotion|confidence|date] content`
48
67
  Types: F=fact D=decision P=preference E=event L=lesson. Flags: T=technical C=correction V=pivot O=origin M=milestone.
@@ -1,8 +0,0 @@
1
- /**
2
- * emotion-tagger.ts — Pattern-based emotion detection.
3
- * Pure function, no LLM, ~1ms per call.
4
- */
5
- export type EmotionTag = "joy" | "trust" | "hope" | "fear" | "grief" | "anger" | "doubt" | "relief" | "pride" | "curiosity" | "frustration" | "surprise" | "determination" | "exhaustion" | "anxiety" | "gratitude" | "love" | "humor" | "vulnerability" | "conviction" | "peace" | "confusion" | "excitement" | "tenderness" | "raw_honesty";
6
- /** Detect emotions from text via keyword patterns. Returns deduplicated tags. */
7
- export declare function detectEmotions(text: string): EmotionTag[];
8
- //# sourceMappingURL=emotion-tagger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emotion-tagger.d.ts","sourceRoot":"","sources":["../../src/emotion-tagger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAClB,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GACrD,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,aAAa,GAC1D,UAAU,GAAG,eAAe,GAAG,YAAY,GAAG,SAAS,GACvD,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,YAAY,GAC/D,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AAqCxE,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAMzD"}
@@ -1,45 +0,0 @@
1
- /**
2
- * emotion-tagger.ts — Pattern-based emotion detection.
3
- * Pure function, no LLM, ~1ms per call.
4
- */
5
- const PATTERNS = [
6
- // joy / positive
7
- [/\b(happy|glad|delighted|wonderful|amazing|fantastic|brilliant|perfect)\b/i, "joy"],
8
- [/\b(love|adore|cherish|devoted)\b/i, "love"],
9
- [/\b(grateful|thankful|appreciate|thanks)\b/i, "gratitude"],
10
- [/\b(proud|pride|accomplished|nailed it)\b/i, "pride"],
11
- [/\b(excited|thrilled|can't wait|pumped)\b/i, "excitement"],
12
- [/\b(funny|hilarious|lol|lmao|haha|😂|🤣)\b/i, "humor"],
13
- [/\b(peaceful|calm|serene|at ease)\b/i, "peace"],
14
- [/\b(tender|gentle|warm|caring)\b/i, "tenderness"],
15
- // trust / conviction
16
- [/\b(trust|reliable|dependable|count on)\b/i, "trust"],
17
- [/\b(decided|committed|convinced|certain|absolutely)\b/i, "conviction"],
18
- [/\b(determined|persistent|won't give up|keep going)\b/i, "determination"],
19
- // hope / relief
20
- [/\b(hope|hopeful|optimistic|looking forward)\b/i, "hope"],
21
- [/\b(relief|relieved|finally|phew|thank god)\b/i, "relief"],
22
- [/\b(surprised|unexpected|didn't expect|wow|whoa)\b/i, "surprise"],
23
- [/\b(curious|wondering|interesting|intrigued|fascinated)\b/i, "curiosity"],
24
- // negative
25
- [/\b(afraid|scared|terrified|frightened|worried about)\b/i, "fear"],
26
- [/\b(anxious|nervous|uneasy|stressed|overwhelmed)\b/i, "anxiety"],
27
- [/\b(angry|furious|rage|pissed|infuriated|hate)\b/i, "anger"],
28
- [/\b(frustrated|annoying|irritating|ugh|damn)\b/i, "frustration"],
29
- [/\b(confused|lost|don't understand|makes no sense|wtf)\b/i, "confusion"],
30
- [/\b(sad|grief|mourning|loss|heartbroken|devastated)\b/i, "grief"],
31
- [/\b(doubt|uncertain|not sure|skeptical|questionable)\b/i, "doubt"],
32
- [/\b(exhausted|burned out|drained|tired of|fed up)\b/i, "exhaustion"],
33
- [/\b(vulnerable|exposed|raw|honest truth|admit)\b/i, "vulnerability"],
34
- [/\b(brutal honesty|hard truth|real talk|no sugar)\b/i, "raw_honesty"],
35
- ];
36
- /** Detect emotions from text via keyword patterns. Returns deduplicated tags. */
37
- export function detectEmotions(text) {
38
- const seen = new Set();
39
- for (const [pattern, tag] of PATTERNS) {
40
- if (pattern.test(text) && !seen.has(tag))
41
- seen.add(tag);
42
- }
43
- return [...seen];
44
- }
45
- //# sourceMappingURL=emotion-tagger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emotion-tagger.js","sourceRoot":"","sources":["../../src/emotion-tagger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,QAAQ,GAAiD;IAC7D,iBAAiB;IACjB,CAAC,2EAA2E,EAAE,KAAK,CAAC;IACpF,CAAC,mCAAmC,EAAE,MAAM,CAAC;IAC7C,CAAC,4CAA4C,EAAE,WAAW,CAAC;IAC3D,CAAC,2CAA2C,EAAE,OAAO,CAAC;IACtD,CAAC,2CAA2C,EAAE,YAAY,CAAC;IAC3D,CAAC,4CAA4C,EAAE,OAAO,CAAC;IACvD,CAAC,qCAAqC,EAAE,OAAO,CAAC;IAChD,CAAC,kCAAkC,EAAE,YAAY,CAAC;IAElD,qBAAqB;IACrB,CAAC,2CAA2C,EAAE,OAAO,CAAC;IACtD,CAAC,uDAAuD,EAAE,YAAY,CAAC;IACvE,CAAC,uDAAuD,EAAE,eAAe,CAAC;IAE1E,gBAAgB;IAChB,CAAC,gDAAgD,EAAE,MAAM,CAAC;IAC1D,CAAC,+CAA+C,EAAE,QAAQ,CAAC;IAC3D,CAAC,oDAAoD,EAAE,UAAU,CAAC;IAClE,CAAC,2DAA2D,EAAE,WAAW,CAAC;IAE1E,WAAW;IACX,CAAC,yDAAyD,EAAE,MAAM,CAAC;IACnE,CAAC,oDAAoD,EAAE,SAAS,CAAC;IACjE,CAAC,kDAAkD,EAAE,OAAO,CAAC;IAC7D,CAAC,gDAAgD,EAAE,aAAa,CAAC;IACjE,CAAC,0DAA0D,EAAE,WAAW,CAAC;IACzE,CAAC,uDAAuD,EAA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