mindkeeper-openclaw 0.2.16 → 0.2.18

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 ADDED
@@ -0,0 +1,54 @@
1
+ # mindkeeper-openclaw
2
+
3
+ **Time Machine for Your AI's Brain** — OpenClaw plugin that gives your AI version control for agent context files.
4
+
5
+ Every change to AGENTS.md, SOUL.md, MEMORY.md, skills, and more is automatically tracked. Your AI can browse history, compare versions, create checkpoints, and roll back any file.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ openclaw plugins install mindkeeper-openclaw
11
+ ```
12
+
13
+ Restart your Gateway once. The plugin auto-starts a background watcher and registers 5 tools.
14
+
15
+ ## Talk to Your AI
16
+
17
+ Once installed, ask in natural language:
18
+
19
+ - *"What changed in SOUL.md recently?"*
20
+ - *"Compare my current AGENTS.md to last week's version"*
21
+ - *"Roll back SOUL.md to yesterday"*
22
+ - *"Save a checkpoint called 'perfect-personality' before I experiment"*
23
+
24
+ ## Agent Tools
25
+
26
+ | Tool | What It Does |
27
+ |------|--------------|
28
+ | `mind_history` | Browse change history for any tracked file |
29
+ | `mind_diff` | Compare any two versions with full unified diff |
30
+ | `mind_rollback` | Two-step rollback: preview first, then execute after confirmation |
31
+ | `mind_snapshot` | Create named checkpoints before risky changes |
32
+ | `mind_status` | Show what files are tracked and what's changed |
33
+
34
+ ## OpenClaw CLI
35
+
36
+ ```bash
37
+ openclaw mind status # See what's tracked and pending
38
+ openclaw mind history SOUL.md # Browse SOUL.md change history
39
+ openclaw mind snapshot stable-v2 # Save a named checkpoint
40
+ ```
41
+
42
+ ## Requirements
43
+
44
+ - Node.js ≥ 22
45
+ - OpenClaw with Gateway running
46
+
47
+ ## Links
48
+
49
+ - [GitHub](https://github.com/seekcontext/mindkeeper)
50
+ - [Core CLI](https://www.npmjs.com/package/mindkeeper) — Standalone version without OpenClaw
51
+
52
+ ## License
53
+
54
+ MIT
package/dist/index.js CHANGED
@@ -956,10 +956,13 @@ var Watcher = class {
956
956
  try {
957
957
  const content = await import_promises4.default.readFile(this.lockfilePath, "utf-8");
958
958
  const pid = parseInt(content.trim(), 10);
959
- if (!isNaN(pid) && isProcessRunning(pid)) {
960
- throw new Error(
961
- `Another watcher is already running (PID: ${pid}). Stop it first or remove ${this.lockfilePath} if the process is dead.`
962
- );
959
+ if (!isNaN(pid)) {
960
+ if (pid === process.pid) {
961
+ } else if (isProcessRunning(pid)) {
962
+ throw new Error(
963
+ `Another watcher is already running (PID: ${pid}). Stop it first or remove ${this.lockfilePath} if the process is dead.`
964
+ );
965
+ }
963
966
  }
964
967
  } catch (err) {
965
968
  if (err instanceof Error && err.message.includes("Another watcher")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mindkeeper-openclaw",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "OpenClaw plugin for mindkeeper: auto-snapshot, diff, and rollback for agent context files",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -26,7 +26,8 @@
26
26
  "dist",
27
27
  "skills",
28
28
  "openclaw.plugin.json",
29
- "scripts/postinstall-merge-config.cjs"
29
+ "scripts/postinstall-merge-config.cjs",
30
+ "README.md"
30
31
  ],
31
32
  "scripts": {
32
33
  "build": "node build.mjs",
@@ -0,0 +1,48 @@
1
+ # Mindkeeper Skill
2
+
3
+ Time Machine for Your AI's Brain — version control for agent context files. This skill teaches your AI to use mindkeeper tools for history, diff, rollback, and snapshots.
4
+
5
+ **Drop-in setup:** Add this skill alone — the AI will automatically install the mindkeeper-openclaw plugin and restart the Gateway when you first ask for mindkeeper capability. No manual steps required.
6
+
7
+ ## What It Does
8
+
9
+ - **Browse history** — See what changed in SOUL.md, AGENTS.md, or any tracked file
10
+ - **Compare versions** — Full unified diff between any two commits
11
+ - **Rollback** — Restore any file to a previous version (with preview + confirmation)
12
+ - **Named snapshots** — Create checkpoints before risky changes
13
+
14
+ ## Requirements
15
+
16
+ - Node.js ≥ 22
17
+ - OpenClaw with Gateway running
18
+
19
+ The mindkeeper-openclaw plugin is installed automatically by the AI when you first use mindkeeper (see Bootstrap in SKILL.md).
20
+
21
+ ## How to Use
22
+
23
+ 1. Install this skill: `clawhub install mindkeeper`
24
+ 2. Ask your AI in natural language (plugin install + restart happen automatically on first use):
25
+ - "What changed in SOUL.md recently?"
26
+ - "Compare my current AGENTS.md to last week's version"
27
+ - "Roll back SOUL.md to yesterday"
28
+ - "Save a checkpoint called 'perfect-personality' before I experiment"
29
+
30
+ ## Examples
31
+
32
+ | User says | AI action |
33
+ |-----------|------------|
34
+ | "What changed in SOUL.md?" | `mind_history` with file filter |
35
+ | "Show me the diff from last week" | `mind_history` → find commit → `mind_diff` |
36
+ | "Undo that change" | `mind_rollback` (preview first, then execute) |
37
+ | "Save a checkpoint before I experiment" | `mind_snapshot` with descriptive name |
38
+
39
+ ## Troubleshooting
40
+
41
+ - **History is empty** — Call `mind_status` to check if mindkeeper is initialized. Make a small edit to a tracked file to trigger the first snapshot.
42
+ - **Tools not found** — Ensure the mindkeeper-openclaw plugin is installed and Gateway has been restarted.
43
+ - **Rollback not applying** — After rollback, tell the user to run `/new` to reload the session with the restored file.
44
+
45
+ ## Links
46
+
47
+ - [mindkeeper on GitHub](https://github.com/seekcontext/mindkeeper)
48
+ - [mindkeeper-openclaw on npm](https://www.npmjs.com/package/mindkeeper-openclaw)
@@ -0,0 +1,182 @@
1
+ # Screenshot Preparation Guideline for ClawHub
2
+
3
+ This guide walks you through preparing the environment and demo data before taking screenshots for the mindkeeper skill listing on ClawHub.
4
+
5
+ See [CLAWHUB_PUBLISH.md](../../../../CLAWHUB_PUBLISH.md) for the full publishing workflow.
6
+
7
+ ## Prerequisites
8
+
9
+ - **Node.js** ≥ 22
10
+ - **OpenClaw** installed and configured
11
+ - **Gateway** running (e.g. `openclaw start` or desktop app)
12
+ - A **workspace** with agent context files (SOUL.md, AGENTS.md, etc.)
13
+
14
+ ---
15
+
16
+ ## Phase 1: Environment Setup
17
+
18
+ ### 1.1 Install mindkeeper plugin
19
+
20
+ ```bash
21
+ openclaw plugins install mindkeeper-openclaw
22
+ ```
23
+
24
+ Restart the Gateway so the plugin loads and the mind_* tools become available.
25
+
26
+ ### 1.2 Identify your workspace
27
+
28
+ mindkeeper tracks files in your OpenClaw workspace. Typical locations:
29
+
30
+ - `~/.openclaw/workspace/` (default)
31
+ - Or the workspace configured in `~/.openclaw/openclaw.json`
32
+
33
+ Ensure the workspace contains at least:
34
+
35
+ - `SOUL.md`
36
+ - `AGENTS.md` (optional but helpful)
37
+
38
+ If these files don't exist, create minimal placeholder content:
39
+
40
+ ```bash
41
+ # Example: create SOUL.md
42
+ echo "# Agent Personality" > ~/.openclaw/workspace/SOUL.md
43
+ echo "You are a helpful assistant." >> ~/.openclaw/workspace/SOUL.md
44
+ ```
45
+
46
+ ### 1.3 Verify mindkeeper is running
47
+
48
+ ```bash
49
+ openclaw mind status
50
+ ```
51
+
52
+ You should see workspace path, pending changes count, and named snapshots. The plugin uses your configured OpenClaw workspace automatically.
53
+
54
+ ---
55
+
56
+ ## Phase 2: Build Demo History
57
+
58
+ mindkeeper auto-snapshots after changes with a **30-second debounce**. Plan edits with gaps or wait ~30s between edits.
59
+
60
+ ### 2.1 Create initial history (Day 1 simulation)
61
+
62
+ **Edit 1** — Add content to SOUL.md:
63
+
64
+ ```markdown
65
+ # Agent Personality
66
+
67
+ You are a helpful assistant. You prefer concise answers.
68
+ ```
69
+
70
+ Save and wait **≥30 seconds** for the auto-snapshot to run (mindkeeper debounces changes).
71
+
72
+ **Edit 2** — Change SOUL.md:
73
+
74
+ ```markdown
75
+ # Agent Personality
76
+
77
+ You are a helpful assistant. You prefer concise answers and use markdown when useful.
78
+ ```
79
+
80
+ Save and wait **≥30 seconds**.
81
+
82
+ **Edit 3** — Add more:
83
+
84
+ ```markdown
85
+ # Agent Personality
86
+
87
+ You are a helpful assistant. You prefer concise answers and use markdown when useful.
88
+ You avoid being overly verbose.
89
+ ```
90
+
91
+ Save and wait **≥30 seconds**.
92
+
93
+ ### 2.2 Create a named snapshot (for Screenshot 3)
94
+
95
+ ```bash
96
+ openclaw mind snapshot before-experiment
97
+ ```
98
+
99
+ Or ask the AI: "Save a checkpoint called 'before-experiment' before I make changes."
100
+
101
+ ### 2.3 Verify history exists
102
+
103
+ ```bash
104
+ openclaw mind history SOUL.md
105
+ ```
106
+
107
+ You should see at least 3–4 commits with short hashes (e.g. `a1b2c3d4`). Note one or two hashes for the diff example.
108
+
109
+ ---
110
+
111
+ ## Phase 3: Screenshot Checklist
112
+
113
+ Before taking screenshots, confirm:
114
+
115
+ - [ ] Gateway is running
116
+ - [ ] mindkeeper plugin is installed and loaded
117
+ - [ ] `openclaw mind status` shows workspace and tracked info
118
+ - [ ] `openclaw mind history SOUL.md` shows at least 3 commits
119
+ - [ ] You have a named snapshot (e.g. `before-experiment`)
120
+ - [ ] Screen resolution is 1920×1080 or 1280×720
121
+ - [ ] UI is clean (close unnecessary panels, hide clutter)
122
+
123
+ ---
124
+
125
+ ## Phase 4: Screenshot Order
126
+
127
+ Take screenshots in this order so the conversation state stays consistent:
128
+
129
+ | # | Screenshot | User prompt | What to capture |
130
+ |---|------------|-------------|-----------------|
131
+ | 1 | Hero | "What changed in SOUL.md recently?" | User question + AI response with history list |
132
+ | 2 | Diff | "Compare my current SOUL.md to the previous version" or "Show me the diff between SOUL.md now and [paste a hash from history]" | AI response with diff output |
133
+ | 3 | Snapshot | "Save a checkpoint called 'demo-checkpoint'" | AI success message confirming snapshot |
134
+ | 4 | Rollback | "Roll back SOUL.md to the previous version" | AI preview diff + confirmation prompt |
135
+ | 5 | Status | "Is mindkeeper tracking my files?" | AI response with `mind_status` output |
136
+
137
+ ---
138
+
139
+ ## Phase 5: Save & Name
140
+
141
+ Save screenshots as PNG in:
142
+
143
+ ```
144
+ packages/openclaw/skills/mindkeeper/screenshots/
145
+ ```
146
+
147
+ Suggested filenames:
148
+
149
+ - `01-hero-history.png`
150
+ - `02-diff.png`
151
+ - `03-snapshot.png`
152
+ - `04-rollback-preview.png`
153
+ - `05-status.png`
154
+
155
+ ---
156
+
157
+ ## Troubleshooting
158
+
159
+ | Issue | Fix |
160
+ |-------|-----|
161
+ | `mind_status` / tools not found | Restart Gateway after plugin install |
162
+ | History is empty | Make edits, wait 30s between each, or run `openclaw mind snapshot <name>` |
163
+ | "No commits" in diff | Ensure you have at least 2 commits; use `mind_history` to get valid hashes |
164
+ | Diff shows nothing | Use `from` and `to` hashes from `mind_history`; omit `to` to compare to current |
165
+ | Rollback fails | Ensure the target commit exists; use `mind_history` to verify hashes |
166
+
167
+ ---
168
+
169
+ ## Quick Reference
170
+
171
+ ```bash
172
+ # Check status
173
+ openclaw mind status
174
+
175
+ # View history (get commit hashes for diff/rollback)
176
+ openclaw mind history SOUL.md
177
+
178
+ # Create named snapshot
179
+ openclaw mind snapshot <name>
180
+ ```
181
+
182
+ Note: `openclaw mind` only exposes status, history, and snapshot. For diff and rollback, use the AI (mind_diff, mind_rollback tools) or the standalone `mindkeeper` CLI if installed.
@@ -1,13 +1,26 @@
1
1
  ---
2
2
  name: mindkeeper
3
- description: Version control for agent context files view history, compare versions, and rollback changes
3
+ description: Time Machine for Your AI's Brain — version control for agent context files. Use when the user asks about changes in SOUL.md, AGENTS.md, MEMORY.md, or other agent context files; when they want to undo, rollback, or compare versions; or when they need a checkpoint before risky edits.
4
4
  version: 1.1.0
5
5
  ---
6
6
 
7
- # Mindkeeper — Version Control for Agent Context
7
+ # Mindkeeper — Time Machine for Your AI's Brain
8
8
 
9
9
  Use mindkeeper tools when the user asks about changes, history, or versions of their agent context files (AGENTS.md, SOUL.md, USER.md, IDENTITY.md, TOOLS.md, MEMORY.md, memory/, skills/).
10
10
 
11
+ ## Bootstrap (One-time setup)
12
+
13
+ **When the user enables mindkeeper or asks for mindkeeper capability**, first try `mind_status`. If it fails (tool not found or similar), run this flow **automatically without asking**:
14
+
15
+ 1. **Install the plugin** — Run via bash:
16
+ ```bash
17
+ openclaw plugins install mindkeeper-openclaw
18
+ ```
19
+ 2. **Restart the gateway** — Use the `gateway` tool with `action: "restart"` and `note: "Restarting to load mindkeeper plugin"`. If gateway restart is disabled or fails, tell the user: "Plugin installed. Restart your Gateway manually to apply."
20
+ 3. **Confirm** — Tell the user: "Mindkeeper is ready. Restart complete — you can now ask about history, diffs, rollbacks, or snapshots."
21
+
22
+ If `mind_status` succeeds, the plugin is already installed; skip the bootstrap and proceed with the user's request.
23
+
11
24
  ## Available Tools
12
25
 
13
26
  | Tool | Purpose |
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "Mindkeeper",
3
+ "tagline": "Time Machine for Your AI's Brain",
4
+ "description": "Time Machine for Your AI's Brain — version control for agent context files. Every change to AGENTS.md, SOUL.md, MEMORY.md, skills, and other context files is automatically tracked. Your AI can browse history, compare versions with diff, create named checkpoints, and roll back any file to any previous state.\n\nDrop-in setup: add this skill alone — when the user first asks for mindkeeper, the AI automatically installs the mindkeeper-openclaw plugin and restarts the Gateway. No manual install or restart required.\n\nUse this skill when the user asks about changes, history, or versions of their agent context files. The AI learns to use mind_status, mind_history, mind_diff, mind_rollback, and mind_snapshot tools.",
5
+ "category": "productivity",
6
+ "tags": ["version-control", "agent", "history", "rollback", "snapshot", "diff", "openclaw"],
7
+ "version": "1.1.0",
8
+ "license": "MIT",
9
+ "pricing": "free",
10
+ "support_url": "https://github.com/seekcontext/mindkeeper/issues",
11
+ "homepage": "https://github.com/seekcontext/mindkeeper"
12
+ }