mneme-ai 2.65.0 → 2.66.0
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.d.ts.map +1 -1
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuIA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsoMvD"}
|
package/dist/index.js
CHANGED
|
@@ -4682,6 +4682,100 @@ export async function run(argv) {
|
|
|
4682
4682
|
process.exitCode = 1;
|
|
4683
4683
|
}
|
|
4684
4684
|
});
|
|
4685
|
+
// v2.66.0 — REFLOG: cross-session time-machine.
|
|
4686
|
+
const reflogParent = program
|
|
4687
|
+
.command("reflog")
|
|
4688
|
+
.description("v2.66 — time-machine: per-file checkpoints + selective rewind. Default = list checkpoints.")
|
|
4689
|
+
.action(async () => {
|
|
4690
|
+
try {
|
|
4691
|
+
const core = await import("@mneme-ai/core");
|
|
4692
|
+
const list = core.reflog.listCheckpoints(process.cwd());
|
|
4693
|
+
const led = core.reflog.verifyLedgerChain(process.cwd());
|
|
4694
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, checkpoints: list, ledger: led }, null, 2) + "\n");
|
|
4695
|
+
}
|
|
4696
|
+
catch (e) {
|
|
4697
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4698
|
+
process.exitCode = 1;
|
|
4699
|
+
}
|
|
4700
|
+
});
|
|
4701
|
+
reflogParent.command("checkpoint")
|
|
4702
|
+
.description("Create an HMAC-signed checkpoint of all tracked files with pheromone tag.")
|
|
4703
|
+
.option("--label <text>", "Optional label (e.g. 'before refactor')")
|
|
4704
|
+
.option("--include <list>", "Comma-separated include globs", (v) => v.split(",").map((s) => s.trim()).filter(Boolean), ["**/*"])
|
|
4705
|
+
.option("--exclude <list>", "Comma-separated additional exclude globs", (v) => v.split(",").map((s) => s.trim()).filter(Boolean), [])
|
|
4706
|
+
.option("--max-files <n>", "Max files to track (default 5000)", (v) => Number(v), 5000)
|
|
4707
|
+
.action(async (opts) => {
|
|
4708
|
+
try {
|
|
4709
|
+
const core = await import("@mneme-ai/core");
|
|
4710
|
+
const r = core.reflog.createCheckpoint({ cwd: process.cwd(), label: opts.label, include: opts.include, exclude: opts.exclude, maxFiles: opts.maxFiles });
|
|
4711
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4712
|
+
}
|
|
4713
|
+
catch (e) {
|
|
4714
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4715
|
+
process.exitCode = 1;
|
|
4716
|
+
}
|
|
4717
|
+
});
|
|
4718
|
+
reflogParent.command("list")
|
|
4719
|
+
.description("List all checkpoints with timestamps + pheromone tags.")
|
|
4720
|
+
.action(async () => {
|
|
4721
|
+
try {
|
|
4722
|
+
const core = await import("@mneme-ai/core");
|
|
4723
|
+
const list = core.reflog.listCheckpoints(process.cwd());
|
|
4724
|
+
process.stdout.write(JSON.stringify({ ok: true, count: list.length, checkpoints: list }, null, 2) + "\n");
|
|
4725
|
+
}
|
|
4726
|
+
catch (e) {
|
|
4727
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4728
|
+
process.exitCode = 1;
|
|
4729
|
+
}
|
|
4730
|
+
});
|
|
4731
|
+
reflogParent.command("rewind")
|
|
4732
|
+
.description("PREVIEW a rewind proposal (dry-run by design). Returns toRevert + toKeep with HMAC proof. Apply manually via your IDE.")
|
|
4733
|
+
.option("--since <window>", "Time window like '2h', '30m', '1d'")
|
|
4734
|
+
.option("--checkpoint <id>", "Specific checkpoint id")
|
|
4735
|
+
.option("--include <list>", "Comma-separated include globs", (v) => v.split(",").map((s) => s.trim()).filter(Boolean), [])
|
|
4736
|
+
.option("--exclude <list>", "Comma-separated exclude globs (e.g. 'tests/**')", (v) => v.split(",").map((s) => s.trim()).filter(Boolean), [])
|
|
4737
|
+
.option("--pheromone <name>", "Only rewind files where target checkpoint pheromone equals this")
|
|
4738
|
+
.option("--banner", "Render ASCII banner instead of JSON")
|
|
4739
|
+
.action(async (opts) => {
|
|
4740
|
+
try {
|
|
4741
|
+
const core = await import("@mneme-ai/core");
|
|
4742
|
+
const r = core.reflog.rewindPreview({
|
|
4743
|
+
cwd: process.cwd(),
|
|
4744
|
+
since: opts.since,
|
|
4745
|
+
checkpointId: opts.checkpoint,
|
|
4746
|
+
include: opts.include,
|
|
4747
|
+
exclude: opts.exclude,
|
|
4748
|
+
pheromone: opts.pheromone,
|
|
4749
|
+
});
|
|
4750
|
+
if (opts.banner)
|
|
4751
|
+
process.stdout.write(core.reflog.renderRewindBanner(r) + "\n");
|
|
4752
|
+
else
|
|
4753
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4754
|
+
if (!r.ok)
|
|
4755
|
+
process.exitCode = 1;
|
|
4756
|
+
}
|
|
4757
|
+
catch (e) {
|
|
4758
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4759
|
+
process.exitCode = 1;
|
|
4760
|
+
}
|
|
4761
|
+
});
|
|
4762
|
+
reflogParent.command("audit")
|
|
4763
|
+
.description("Verify HMAC-chained reflog ledger + last N entries.")
|
|
4764
|
+
.option("--limit <n>", "Max rows", (v) => Number(v), 20)
|
|
4765
|
+
.action(async (opts) => {
|
|
4766
|
+
try {
|
|
4767
|
+
const core = await import("@mneme-ai/core");
|
|
4768
|
+
const led = core.reflog.verifyLedgerChain(process.cwd());
|
|
4769
|
+
const rows = core.reflog.readLedger(process.cwd());
|
|
4770
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, totalRows: led.rows, brokenAt: led.brokenAt, recent: rows.slice(-(opts.limit ?? 20)) }, null, 2) + "\n");
|
|
4771
|
+
if (!led.ok)
|
|
4772
|
+
process.exitCode = 1;
|
|
4773
|
+
}
|
|
4774
|
+
catch (e) {
|
|
4775
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4776
|
+
process.exitCode = 1;
|
|
4777
|
+
}
|
|
4778
|
+
});
|
|
4685
4779
|
// v2.65.0 — SWARM BUS: cross-agent message bus.
|
|
4686
4780
|
const swarmBusParent = program
|
|
4687
4781
|
.command("swarm_bus")
|