@henryqw/pi-memory 0.2.0 → 0.2.2

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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Auto-managed markdown memory for Pi: two size-capped entry stores (`MEMORY.md`, `USER.md`) with a frozen system-prompt snapshot per session.
4
4
 
5
+ ## Why
6
+
7
+ - **Created for**: Giving Pi compact global notes and user facts that survive across sessions.
8
+ - **Advantage**: Size-capped, auto-managed Markdown stores provide predictable prompt cost without a hand-maintained knowledge tree.
9
+ - **Inspired by**: [Hermes Agent](https://github.com/NousResearch/hermes-agent) and its bounded `MEMORY.md`/`USER.md` cross-session memory pattern.
10
+
5
11
  ## Install
6
12
 
7
13
  ```bash
@@ -41,6 +47,8 @@ Invalid configuration fails fast; malformed config files are never rewritten.
41
47
 
42
48
  Point `directory` at an iCloud Drive or Obsidian-vault-synced folder. The synced vault acts as a dumb sync pipe: pi-memory owns the file format and treats the remote as opaque storage, so no merge logic runs on the Pi side.
43
49
 
50
+ Backups and the lock file live outside `directory`, under `~/.pi/agent/backups/pi-memory/`.
51
+
44
52
  ## Threat model
45
53
 
46
54
  Because the directory can be a globally synced location readable outside Pi, review [`ADR 006 — pi-memory global store threat model`](https://github.com/HenryQW/pi-packages/blob/main/docs/adr/006-pi-memory-global-store-threat-model.md) before pointing it at a shared or cloud-synced path.
@@ -11,7 +11,7 @@ import { ENTRY_DELIMITER, MemoryStore, type Target } from "../src/store.ts";
11
11
  const SEPARATOR = "═".repeat(46);
12
12
  // Backups and the lock file live OUTSIDE config.directory (which may be
13
13
  // iCloud-synced) so the memory dir holds exactly MEMORY.md and USER.md (ADR 005).
14
- const BACKUP_DIR = () => join(getAgentDir(), "memory-backups");
14
+ const BACKUP_DIR = () => join(getAgentDir(), "backups", "pi-memory");
15
15
  // Defense-in-depth against snapshot frame spoofing by poisoned on-disk entries.
16
16
  const FRAME_TOKEN_LINE = /^\s*(?:═{3,}|MEMORY \(your personal notes|USER PROFILE \(who the user is)/;
17
17
  const FRAME_TOKEN_REPLACEMENT = "[filtered frame token]";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-memory",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Auto-managed markdown memory for Pi: capped MEMORY.md/USER.md entry stores with frozen session snapshots.",
5
5
  "keywords": [
6
6
  "pi-package",