mneme-ai 2.136.0 → 2.137.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/commands/stele.d.ts +14 -0
- package/dist/commands/stele.d.ts.map +1 -0
- package/dist/commands/stele.js +86 -0
- package/dist/commands/stele.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme stele` (v2.137.0) — the signed, merkle-rooted, delta-syncable
|
|
3
|
+
* capability inscription. An agent learns the WHOLE Mneme surface at O(delta)
|
|
4
|
+
* tokens and can PROVE it holds the latest, complete set.
|
|
5
|
+
*
|
|
6
|
+
* mneme stele # the current merkle root + count (signed)
|
|
7
|
+
* mneme stele --held <root> # delta vs what you hold (added/changed/removed)
|
|
8
|
+
* mneme stele --held-file held.json # held = {"root":"…","leaves":{name:hash}}
|
|
9
|
+
* mneme stele --verify <root> # is my held root current? (stale/tamper-evident)
|
|
10
|
+
* mneme stele --json
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from "commander";
|
|
13
|
+
export declare function registerSteleCommands(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=stele.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stele.d.ts","sourceRoot":"","sources":["../../src/commands/stele.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0C5D"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme stele` (v2.137.0) — the signed, merkle-rooted, delta-syncable
|
|
3
|
+
* capability inscription. An agent learns the WHOLE Mneme surface at O(delta)
|
|
4
|
+
* tokens and can PROVE it holds the latest, complete set.
|
|
5
|
+
*
|
|
6
|
+
* mneme stele # the current merkle root + count (signed)
|
|
7
|
+
* mneme stele --held <root> # delta vs what you hold (added/changed/removed)
|
|
8
|
+
* mneme stele --held-file held.json # held = {"root":"…","leaves":{name:hash}}
|
|
9
|
+
* mneme stele --verify <root> # is my held root current? (stale/tamper-evident)
|
|
10
|
+
* mneme stele --json
|
|
11
|
+
*/
|
|
12
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
13
|
+
import { stele, notary, agentManifest } from "@mneme-ai/core";
|
|
14
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
15
|
+
function catalogEntries() {
|
|
16
|
+
try {
|
|
17
|
+
return agentManifest.MNEME_COMMAND_CATALOG.map((c) => ({ name: c.command, version: c.since, summary: c.what }));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function registerSteleCommands(program) {
|
|
24
|
+
program
|
|
25
|
+
.command("stele")
|
|
26
|
+
.description("🗿 STELE — the signed, merkle-rooted, delta-syncable inscription of Mneme's whole capability surface. An agent proves it holds the latest/complete set (merkle root) + pulls only the delta at boot (O(delta) tokens, not O(900 tools)). The honest fix for 'I didn't know that tool existed' + a stale manifest.")
|
|
27
|
+
.option("--held <root>", "the merkle root your agent currently holds (for a delta).")
|
|
28
|
+
.option("--held-file <p>", "JSON file: {\"root\":\"…\",\"leaves\":{\"name\":\"hash\"}} — full delta incl. tamper-detect.")
|
|
29
|
+
.option("--verify <root>", "verify a held root against the live catalog (stale/tamper-evident).")
|
|
30
|
+
.option("--json", "JSON output (signed).")
|
|
31
|
+
.action((opts) => {
|
|
32
|
+
const cwd = process.cwd();
|
|
33
|
+
const entries = catalogEntries();
|
|
34
|
+
if (opts.verify) {
|
|
35
|
+
const v = stele.verifyStele(entries, opts.verify);
|
|
36
|
+
if (opts.json) {
|
|
37
|
+
out(JSON.stringify(v, null, 2));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
out(`${v.ok ? "✓ CURRENT" : "🛑 STALE/TAMPERED"} — ${v.reason}\n live root: ${v.currentRoot}`);
|
|
41
|
+
}
|
|
42
|
+
process.exitCode = v.ok ? 0 : 2;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let heldRoot = opts.held ?? "";
|
|
46
|
+
let heldLeaves;
|
|
47
|
+
if (opts.heldFile && existsSync(opts.heldFile)) {
|
|
48
|
+
try {
|
|
49
|
+
const j = JSON.parse(readFileSync(opts.heldFile, "utf8"));
|
|
50
|
+
heldRoot = typeof j.root === "string" ? j.root : heldRoot;
|
|
51
|
+
if (j.leaves && typeof j.leaves === "object")
|
|
52
|
+
heldLeaves = j.leaves;
|
|
53
|
+
}
|
|
54
|
+
catch { /* */ }
|
|
55
|
+
}
|
|
56
|
+
if (heldRoot || heldLeaves) {
|
|
57
|
+
const d = stele.steleDelta(entries, heldRoot, heldLeaves);
|
|
58
|
+
const receipt = notary.issueReceipt(cwd, { kind: "claim-verdict", subject: "stele.delta", payload: { currentRoot: d.currentRoot, upToDate: d.upToDate, added: d.added.length, changed: d.changed.length, removed: d.removed.length }, includePayload: true });
|
|
59
|
+
if (opts.json) {
|
|
60
|
+
out(JSON.stringify({ ...d, receipt }, null, 2));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (d.upToDate) {
|
|
64
|
+
out(`✓ UP TO DATE — ${d.note}\n root: ${d.currentRoot}`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
out(`🔄 STELE delta — ${d.added.length} new · ${d.changed.length} changed · ${d.removed.length} removed (~${d.deltaTokenEstimate} tok vs ~${d.fullTokenEstimate} full)`);
|
|
68
|
+
for (const e of d.added.slice(0, 20))
|
|
69
|
+
out(` + ${e.name}${e.summary ? ` — ${e.summary.slice(0, 70)}` : ""}`);
|
|
70
|
+
for (const e of d.changed.slice(0, 20))
|
|
71
|
+
out(` ~ ${e.name}${e.summary ? ` — ${e.summary.slice(0, 70)}` : ""}`);
|
|
72
|
+
for (const n of d.removed.slice(0, 20))
|
|
73
|
+
out(` - ${n}`);
|
|
74
|
+
out(` new root: ${d.currentRoot} · receipt ${receipt.receiptId ? receipt.receiptId.slice(0, 12) + "…" : "(signed)"}`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const s = stele.buildStele(entries);
|
|
78
|
+
const receipt = notary.issueReceipt(cwd, { kind: "claim-verdict", subject: "stele.root", payload: { root: s.root, count: s.count }, includePayload: true });
|
|
79
|
+
if (opts.json) {
|
|
80
|
+
out(JSON.stringify({ root: s.root, count: s.count, receipt }, null, 2));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
out(`🗿 STELE — ${s.count} capabilities · merkle root:\n ${s.root}\n signed · pass --held <root> for a delta, --verify <root> to check freshness.`);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=stele.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stele.js","sourceRoot":"","sources":["../../src/commands/stele.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE9D,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAQ,aAAa,CAAC,qBAAmF,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjL,CAAC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,UAAU,EAAE,CAAC,CAAC;YAC1H,OAAO;QACT,CAAC;QAED,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5J,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QACnG,GAAG,CAAC,cAAc,CAAC,CAAC,KAAK,oCAAoC,CAAC,CAAC,IAAI,mFAAmF,CAAC,CAAC;IAC1J,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+JA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqhNvD"}
|
package/dist/index.js
CHANGED
|
@@ -91,6 +91,7 @@ import { registerFirewallCommands } from "./commands/firewall.js";
|
|
|
91
91
|
import { registerRailCommands } from "./commands/rail.js";
|
|
92
92
|
import { registerBootCommands } from "./commands/boot.js";
|
|
93
93
|
import { registerElleipsisCommands } from "./commands/elleipsis.js";
|
|
94
|
+
import { registerSteleCommands } from "./commands/stele.js";
|
|
94
95
|
import { registerTrustCommands } from "./commands/trust.js";
|
|
95
96
|
import { registerNuclearCommands } from "./commands/nuclear-cli.js";
|
|
96
97
|
import { registerOvernightCommand } from "./commands/overnight.js";
|
|
@@ -4731,6 +4732,7 @@ export async function run(argv) {
|
|
|
4731
4732
|
registerRailCommands(program);
|
|
4732
4733
|
registerBootCommands(program);
|
|
4733
4734
|
registerElleipsisCommands(program);
|
|
4735
|
+
registerSteleCommands(program);
|
|
4734
4736
|
// ─── Trust calibrator (v1.31.0) -- per-subsystem precision/recall/band
|
|
4735
4737
|
registerTrustCommands(program);
|
|
4736
4738
|
// ─── Wisdom reactor (v1.33.0) -- five nuclear-physics formulas as Mneme metrics
|