mneme-ai 2.196.0 → 2.197.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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `mneme geo` (v2.197.0) — GEOLOGICAL MEMORY: the compliant, self-cleaning ledger.
3
+ * geo add <text> — seed a raw entry
4
+ * geo metamorphose — run a geological cycle: old+idle raw → abstract (purged+signed) → axiom
5
+ * geo forget <needle> — right-to-be-forgotten: purge matching raw NOW + signed tombstone
6
+ * geo verify — verify every purge proof + the audit chain OFFLINE
7
+ * geo status — tiers + raw bytes reclaimed + compliance
8
+ *
9
+ * Memory does not pile up forever — it metamorphoses: the WISDOM is kept, the RAW is
10
+ * destroyed, provably. Right-to-be-forgotten by construction; no database bloat.
11
+ */
12
+ import type { Command } from "commander";
13
+ export declare function registerGeoCommands(program: Command): void;
14
+ //# sourceMappingURL=geo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo.d.ts","sourceRoot":"","sources":["../../src/commands/geo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuC1D"}
@@ -0,0 +1,62 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { createHash } from "node:crypto";
4
+ import { geo } from "@mneme-ai/core";
5
+ function out(s) { process.stdout.write(s + "\n"); }
6
+ const statePath = (cwd) => join(cwd, ".mneme", "geo", "state.json");
7
+ function load(cwd) { const p = statePath(cwd); if (!existsSync(p))
8
+ return geo.emptyGeo(); try {
9
+ return JSON.parse(readFileSync(p, "utf8"));
10
+ }
11
+ catch {
12
+ return geo.emptyGeo();
13
+ } }
14
+ function save(cwd, s) { mkdirSync(join(cwd, ".mneme", "geo"), { recursive: true }); writeFileSync(statePath(cwd), JSON.stringify(s), "utf8"); }
15
+ export function registerGeoCommands(program) {
16
+ const g = program.command("geo").description("🌋 GEOLOGICAL MEMORY — the compliant, self-cleaning ledger. Raw dissolves to abstract→axiom over time; the wisdom is kept, the raw is destroyed (provably). Right-to-be-forgotten by construction.");
17
+ g.command("add <text...>").description("Seed a raw memory entry.").action((text) => {
18
+ const cwd = process.cwd();
19
+ const raw = text.join(" ");
20
+ const id = "r:" + createHash("sha256").update(raw + Date.now()).digest("hex").slice(0, 12);
21
+ save(cwd, geo.seedRaw(load(cwd), { id, raw, ts: Date.now() }));
22
+ out(`✓ seeded raw entry ${id} (${Buffer.byteLength(raw, "utf8")}b). It will metamorphose with age.`);
23
+ });
24
+ g.command("metamorphose").description("Run a geological cycle: old+idle raw → abstract (purged + signed) → axiom. Idempotent; safe to run on the daemon's idle tick.")
25
+ .option("--decay-days <n>", "age past which raw decays", "90").option("--idle-days <n>", "no-access window required", "30")
26
+ .action((opts) => {
27
+ const cwd = process.cwd();
28
+ const before = geo.geoStats(load(cwd));
29
+ const after = geo.metamorphose(cwd, load(cwd), Date.now(), { decayDays: parseInt(opts.decayDays ?? "90", 10), idleDays: parseInt(opts.idleDays ?? "30", 10) });
30
+ save(cwd, after);
31
+ const st = geo.geoStats(after);
32
+ out(`🌋 metamorphosed · raw ${before.raw}→${st.raw} · abstract ${st.abstract} · axiom ${st.axiom} · ${st.rawBytesReclaimed}b raw reclaimed (destroyed + signed-purged).`);
33
+ });
34
+ g.command("forget <needle>").description("Right-to-be-forgotten: purge any raw matching <needle> NOW + emit a signed tombstone (no content survives).")
35
+ .action((needle) => {
36
+ const cwd = process.cwd();
37
+ const after = geo.forget(cwd, load(cwd), needle, Date.now());
38
+ save(cwd, after);
39
+ const gone = !geo.containsRaw(after, needle);
40
+ out(`${gone ? "✓" : "✗"} forget "${needle}" — ${gone ? "purged + signed tombstone (verifiable)" : "nothing matched"}.`);
41
+ });
42
+ g.command("verify").description("Verify every purge proof (Ed25519, offline) + the metamorphosis audit chain. Exit 2 on failure.")
43
+ .action(() => {
44
+ const v = geo.verifyGeo(load(process.cwd()));
45
+ out(`🌋 purge proofs ${v.proofsValid}/${v.proofsTotal} valid · audit chain ${v.chainIntact ? "intact ✓" : `BROKEN at ${v.brokenAt} ✗`} — ${v.ok ? "compliant: raw was provably destroyed, wisdom + proof remain." : "issues found"}`);
46
+ if (!v.ok)
47
+ process.exitCode = 2;
48
+ });
49
+ g.command("status", { isDefault: true }).description("Tiers + reclaimed bytes + compliance.").action(() => {
50
+ const cwd = process.cwd();
51
+ const s = load(cwd);
52
+ const st = geo.geoStats(s);
53
+ const v = geo.verifyGeo(s);
54
+ if (!s.cells.length) {
55
+ out("geo memory empty — `mneme geo add <text>` to seed, then `mneme geo metamorphose`.");
56
+ return;
57
+ }
58
+ out(`🌋 Geological memory: raw ${st.raw} · abstract ${st.abstract} · axiom ${st.axiom} · purged ${st.purged} (${st.rawBytesReclaimed}b reclaimed)`);
59
+ out(` compliance: ${v.proofsValid}/${v.proofsTotal} purge proofs valid · chain ${v.chainIntact ? "intact ✓" : "BROKEN ✗"} — the wisdom stays, the raw is provably gone.`);
60
+ });
61
+ }
62
+ //# sourceMappingURL=geo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geo.js","sourceRoot":"","sources":["../../src/commands/geo.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CA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,CAAC,CAAC;QACtO,IAAI,CAAC,CAAC,CAAC,EAAE;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEL,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;QACxG,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QAAC,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAAC,MAAM,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACvG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QAC1H,GAAG,CAAC,6BAA6B,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,QAAQ,YAAY,EAAE,CAAC,KAAK,aAAa,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,iBAAiB,cAAc,CAAC,CAAC;QACpJ,GAAG,CAAC,kBAAkB,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,+BAA+B,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,gDAAgD,CAAC,CAAC;IAC9K,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqLA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqlNvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsLA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAslNvD"}
package/dist/index.js CHANGED
@@ -99,6 +99,7 @@ import { registerXrayCommands } from "./commands/xray.js";
99
99
  import { registerAttestCommands } from "./commands/attest.js";
100
100
  import { registerAccountabilityCommands } from "./commands/accountability.js";
101
101
  import { registerWarmCommands } from "./commands/warm.js";
102
+ import { registerGeoCommands } from "./commands/geo.js";
102
103
  import { registerAdamasCommands } from "./commands/adamas.js";
103
104
  import { registerPrismCommands } from "./commands/prism.js";
104
105
  import { registerGoldilocksCommands } from "./commands/goldilocks.js";
@@ -4765,6 +4766,7 @@ export async function run(argv) {
4765
4766
  registerAttestCommands(program);
4766
4767
  registerAccountabilityCommands(program);
4767
4768
  registerWarmCommands(program);
4769
+ registerGeoCommands(program);
4768
4770
  registerAdamasCommands(program);
4769
4771
  registerPrismCommands(program);
4770
4772
  registerGoldilocksCommands(program);