mindkeeper-openclaw 0.2.12 → 0.2.13
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/dist/index.js +26 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21196,42 +21196,36 @@ function getTracker2(ref) {
|
|
|
21196
21196
|
}
|
|
21197
21197
|
function registerTrackerCli(api, trackerRef) {
|
|
21198
21198
|
if (!api.registerCli) return;
|
|
21199
|
-
api.registerCli(
|
|
21200
|
-
|
|
21201
|
-
|
|
21202
|
-
|
|
21203
|
-
|
|
21204
|
-
|
|
21205
|
-
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
|
|
21214
|
-
|
|
21215
|
-
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
mindCmd,
|
|
21222
|
-
"snapshot [name]",
|
|
21223
|
-
"Create a named snapshot",
|
|
21224
|
-
async (...args) => {
|
|
21199
|
+
api.registerCli(
|
|
21200
|
+
(ctx) => {
|
|
21201
|
+
const mindCmd = ctx.program.command("mind").description("mindkeeper version control");
|
|
21202
|
+
mindCmd.command("status").description("Show tracking status").action(async () => {
|
|
21203
|
+
const status = await getTracker2(trackerRef).status();
|
|
21204
|
+
console.log(`Workspace: ${status.workDir}`);
|
|
21205
|
+
console.log(`Pending changes: ${status.pendingChanges.length}`);
|
|
21206
|
+
console.log(`Named snapshots: ${status.snapshots.length}`);
|
|
21207
|
+
});
|
|
21208
|
+
mindCmd.command("history [file]").description("View change history").action(async (...args) => {
|
|
21209
|
+
const file = args[0];
|
|
21210
|
+
const commits = await getTracker2(trackerRef).history({ file, limit: 20 });
|
|
21211
|
+
if (commits.length === 0) {
|
|
21212
|
+
console.log("No history found.");
|
|
21213
|
+
return;
|
|
21214
|
+
}
|
|
21215
|
+
for (const c of commits) {
|
|
21216
|
+
const date = c.date.toISOString().replace("T", " ").slice(0, 19);
|
|
21217
|
+
console.log(`${c.oid.slice(0, 8)} ${date} ${c.message}`);
|
|
21218
|
+
}
|
|
21219
|
+
});
|
|
21220
|
+
mindCmd.command("snapshot [name]").description("Create a named snapshot").action(async (...args) => {
|
|
21225
21221
|
const name = args[0];
|
|
21226
21222
|
const commit = await getTracker2(trackerRef).snapshot({ name });
|
|
21227
21223
|
console.log(`Snapshot created: ${commit.oid.slice(0, 8)} ${commit.message}`);
|
|
21228
21224
|
if (name) console.log(`Tagged as: ${name}`);
|
|
21229
|
-
}
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
function addSubcommand(parent, name, description, handler) {
|
|
21234
|
-
parent.command(name).description(description).action(handler);
|
|
21225
|
+
});
|
|
21226
|
+
},
|
|
21227
|
+
{ commands: ["mind"] }
|
|
21228
|
+
);
|
|
21235
21229
|
}
|
|
21236
21230
|
|
|
21237
21231
|
// ../core/src/tracker.ts
|