mindkeeper-openclaw 0.2.27 → 0.2.29
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/index.js +58 -10
- package/package.json +9 -10
- package/skills/mindkeeper/SKILL.md +2 -1
- package/skills/mindkeeper/clawhub.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 context-vault contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ openclaw plugins install mindkeeper-openclaw
|
|
|
24
24
|
|
|
25
25
|
Then restart your Gateway once.
|
|
26
26
|
|
|
27
|
-
On startup, the plugin
|
|
27
|
+
On startup, the plugin mirrors its built-in `mindkeeper` skill into `<workspace>/skills/mindkeeper/` (OpenClaw's standard workspace skills path) so new sessions can find the bootstrap instructions even if no separate ClawHub skill was installed.
|
|
28
28
|
|
|
29
29
|
### Option 2 — Install the skill and let the AI guide setup
|
|
30
30
|
|
package/dist/index.js
CHANGED
|
@@ -756,8 +756,8 @@ var Tracker = class {
|
|
|
756
756
|
}
|
|
757
757
|
async diff(options) {
|
|
758
758
|
const to = options.to ?? "HEAD";
|
|
759
|
-
const fromOid =
|
|
760
|
-
const toOid =
|
|
759
|
+
const fromOid = await this.resolveOid(options.from);
|
|
760
|
+
const toOid = await this.resolveOid(to);
|
|
761
761
|
if (!fromOid || !toOid) {
|
|
762
762
|
throw new Error("Could not resolve commit references");
|
|
763
763
|
}
|
|
@@ -772,7 +772,11 @@ var Tracker = class {
|
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
async rollback(options) {
|
|
775
|
-
await this.
|
|
775
|
+
const toOid = await this.resolveOid(options.to);
|
|
776
|
+
if (!toOid) {
|
|
777
|
+
throw new Error(`Could not resolve commit: ${options.to}`);
|
|
778
|
+
}
|
|
779
|
+
await this.store.restoreFile(options.file, toOid);
|
|
776
780
|
await this.store.addFiles([options.file]);
|
|
777
781
|
const shortHash = options.to.slice(0, 8);
|
|
778
782
|
const message = generateTemplateMessage([options.file], {
|
|
@@ -810,13 +814,36 @@ var Tracker = class {
|
|
|
810
814
|
const filesToCommit = changed.map((e) => e.filepath);
|
|
811
815
|
await this.store.addFiles(filesToCommit);
|
|
812
816
|
const diffs = [];
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
817
|
+
let headOid = null;
|
|
818
|
+
try {
|
|
819
|
+
headOid = await this.resolveHead();
|
|
820
|
+
} catch {
|
|
821
|
+
}
|
|
822
|
+
if (headOid) {
|
|
823
|
+
for (const file of filesToCommit) {
|
|
824
|
+
try {
|
|
825
|
+
const oldContent = await this.store.readFile(file, headOid) ?? "";
|
|
826
|
+
let newContent;
|
|
827
|
+
try {
|
|
828
|
+
newContent = await import_promises3.default.readFile(
|
|
829
|
+
import_node_path3.default.join(this.workDir, file),
|
|
830
|
+
"utf-8"
|
|
831
|
+
);
|
|
832
|
+
} catch {
|
|
833
|
+
newContent = "";
|
|
834
|
+
}
|
|
835
|
+
const d = computeDiff({
|
|
836
|
+
file,
|
|
837
|
+
fromVersion: headOid.slice(0, 8),
|
|
838
|
+
toVersion: "(staged)",
|
|
839
|
+
oldContent,
|
|
840
|
+
newContent
|
|
841
|
+
});
|
|
842
|
+
if (d.additions > 0 || d.deletions > 0) {
|
|
843
|
+
diffs.push(d);
|
|
844
|
+
}
|
|
845
|
+
} catch {
|
|
818
846
|
}
|
|
819
|
-
} catch {
|
|
820
847
|
}
|
|
821
848
|
}
|
|
822
849
|
let message = null;
|
|
@@ -890,6 +917,27 @@ var Tracker = class {
|
|
|
890
917
|
ref: "HEAD"
|
|
891
918
|
});
|
|
892
919
|
}
|
|
920
|
+
/**
|
|
921
|
+
* Resolves a ref (HEAD, short hash, or full oid) to a full commit oid.
|
|
922
|
+
* Uses expandOid for short hashes since isomorphic-git readBlob may not support them.
|
|
923
|
+
*/
|
|
924
|
+
async resolveOid(ref) {
|
|
925
|
+
if (ref === "HEAD") {
|
|
926
|
+
return this.resolveHead();
|
|
927
|
+
}
|
|
928
|
+
const git2 = await import("isomorphic-git");
|
|
929
|
+
const fs2 = await import("node:fs");
|
|
930
|
+
try {
|
|
931
|
+
return await git2.default.expandOid({
|
|
932
|
+
fs: fs2.default,
|
|
933
|
+
dir: this.workDir,
|
|
934
|
+
gitdir: this.gitDir,
|
|
935
|
+
oid: ref
|
|
936
|
+
});
|
|
937
|
+
} catch {
|
|
938
|
+
return null;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
893
941
|
async ensureGitignore() {
|
|
894
942
|
const gitignorePath = import_node_path3.default.join(this.workDir, ".gitignore");
|
|
895
943
|
const entry = ".mindkeeper/";
|
|
@@ -1187,7 +1235,7 @@ var SKILL_FILES = ["SKILL.md", "README.md", "clawhub.json"];
|
|
|
1187
1235
|
function ensureWorkspaceSkillMirror(workspaceDir, options = {}) {
|
|
1188
1236
|
if (!workspaceDir) return;
|
|
1189
1237
|
const sourceDir = options.sourceDir ?? resolveBundledSkillDir();
|
|
1190
|
-
const targetDir = import_node_path6.default.join(workspaceDir, SKILL_DIR_NAME);
|
|
1238
|
+
const targetDir = import_node_path6.default.join(workspaceDir, "skills", SKILL_DIR_NAME);
|
|
1191
1239
|
if (!(0, import_node_fs2.existsSync)(sourceDir)) {
|
|
1192
1240
|
options.log?.warn?.(`[mindkeeper] Built-in skill directory not found: ${sourceDir}`);
|
|
1193
1241
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mindkeeper-openclaw",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.29",
|
|
4
4
|
"description": "OpenClaw plugin for mindkeeper: auto-snapshot, diff, and rollback for agent context files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openclaw",
|
|
@@ -29,14 +29,6 @@
|
|
|
29
29
|
"scripts/postinstall-merge-config.cjs",
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "node build.mjs",
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"typecheck": "tsc --noEmit",
|
|
36
|
-
"clean": "rm -rf dist",
|
|
37
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
38
|
-
"postinstall": "node scripts/postinstall-merge-config.cjs"
|
|
39
|
-
},
|
|
40
32
|
"openclaw": {
|
|
41
33
|
"extensions": [
|
|
42
34
|
"./dist/index.js"
|
|
@@ -59,5 +51,12 @@
|
|
|
59
51
|
},
|
|
60
52
|
"publishConfig": {
|
|
61
53
|
"access": "public"
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "node build.mjs",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"typecheck": "tsc --noEmit",
|
|
59
|
+
"clean": "rm -rf dist",
|
|
60
|
+
"postinstall": "node scripts/postinstall-merge-config.cjs"
|
|
62
61
|
}
|
|
63
|
-
}
|
|
62
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mindkeeper
|
|
3
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
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.7
|
|
5
5
|
homepage: https://github.com/seekcontext/mindkeeper
|
|
6
6
|
repository: https://github.com/seekcontext/mindkeeper
|
|
7
7
|
---
|
|
@@ -102,6 +102,7 @@ mind_history({ file: "SOUL.md", limit: 20 })
|
|
|
102
102
|
### mind_diff
|
|
103
103
|
Compares two versions of a file. `from` and `to` are short or full commit hashes from `mind_history`.
|
|
104
104
|
- Omit `to` to compare `from` against the current version (HEAD).
|
|
105
|
+
- **To see what changed in the latest commit**: use `from: entries[1].oid` (the parent) and `to: entries[0].oid` or omit `to` for HEAD. Do NOT use `from: entries[0].oid` with `to: HEAD` — that compares the same commit to itself and yields an empty diff.
|
|
105
106
|
|
|
106
107
|
```
|
|
107
108
|
mind_diff({ file: "SOUL.md", from: "a1b2c3d4" })
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Time Machine for Your AI's Brain — install this skill if you want your AI to inspect history, show diffs, create checkpoints, and guide rollback in natural language across agent context files.\n\nSetup: add this skill alone. On first use, the AI checks whether the mindkeeper-openclaw plugin is available. If it is not, the AI asks for explicit confirmation before installing the plugin and before restarting Gateway. User consent is required for plugin install and Gateway restart.\n\nUse this skill when the user asks about changes, history, or versions of their agent context files. The skill teaches the AI how to bootstrap and use the mind_status, mind_history, mind_diff, mind_rollback, and mind_snapshot tools safely.",
|
|
5
5
|
"category": "productivity",
|
|
6
6
|
"tags": ["version-control", "agent", "history", "rollback", "snapshot", "diff", "openclaw"],
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.6",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"pricing": "free",
|
|
10
10
|
"homepage": "https://github.com/seekcontext/mindkeeper",
|