mneme-ai 2.79.0 → 2.80.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/flight.d.ts +22 -0
- package/dist/commands/flight.d.ts.map +1 -0
- package/dist/commands/flight.js +83 -0
- package/dist/commands/flight.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.80.0 — `mneme flight <action>` · the AI black box.
|
|
3
|
+
*
|
|
4
|
+
* mneme flight record --agent A --action "..." [--kind K] [--reasoning R] [--claim C] [--reality O] [--delta MATCH|CONTRADICT|UNVERIFIED]
|
|
5
|
+
* mneme flight replay — causal-order narrative + the incident moment
|
|
6
|
+
* mneme flight verify — verify the whole recorder offline (public-key)
|
|
7
|
+
* mneme flight seal — emit ONE court-admissible signed receipt
|
|
8
|
+
*/
|
|
9
|
+
export interface FlightOpts {
|
|
10
|
+
cwd: string;
|
|
11
|
+
action: string;
|
|
12
|
+
agent?: string;
|
|
13
|
+
frameKind?: string;
|
|
14
|
+
actionText?: string;
|
|
15
|
+
reasoning?: string;
|
|
16
|
+
claim?: string;
|
|
17
|
+
reality?: string;
|
|
18
|
+
delta?: string;
|
|
19
|
+
json?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function flightCommand(o: FlightOpts): Promise<number>;
|
|
22
|
+
//# sourceMappingURL=flight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight.d.ts","sourceRoot":"","sources":["../../src/commands/flight.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDlE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.80.0 — `mneme flight <action>` · the AI black box.
|
|
3
|
+
*
|
|
4
|
+
* mneme flight record --agent A --action "..." [--kind K] [--reasoning R] [--claim C] [--reality O] [--delta MATCH|CONTRADICT|UNVERIFIED]
|
|
5
|
+
* mneme flight replay — causal-order narrative + the incident moment
|
|
6
|
+
* mneme flight verify — verify the whole recorder offline (public-key)
|
|
7
|
+
* mneme flight seal — emit ONE court-admissible signed receipt
|
|
8
|
+
*/
|
|
9
|
+
import { writeSync } from "node:fs";
|
|
10
|
+
import * as core from "@mneme-ai/core";
|
|
11
|
+
function out(s) {
|
|
12
|
+
try {
|
|
13
|
+
writeSync(1, s);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
process.stdout.write(s);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const KINDS = new Set(["action", "decision", "claim", "tool-call", "payment", "observation"]);
|
|
20
|
+
const DELTAS = new Set(["MATCH", "CONTRADICT", "UNVERIFIED"]);
|
|
21
|
+
export async function flightCommand(o) {
|
|
22
|
+
const fr = core.flightRecorder;
|
|
23
|
+
if (o.action === "record") {
|
|
24
|
+
if (!o.agent || !o.actionText) {
|
|
25
|
+
out("✗ record requires --agent and --action\n");
|
|
26
|
+
return 2;
|
|
27
|
+
}
|
|
28
|
+
const f = fr.record(o.cwd, {
|
|
29
|
+
agent: o.agent,
|
|
30
|
+
kind: o.frameKind && KINDS.has(o.frameKind) ? o.frameKind : "action",
|
|
31
|
+
action: o.actionText,
|
|
32
|
+
reasoning: o.reasoning,
|
|
33
|
+
claim: o.claim,
|
|
34
|
+
observedReality: o.reality,
|
|
35
|
+
truthDelta: o.delta && DELTAS.has(o.delta) ? o.delta : undefined,
|
|
36
|
+
});
|
|
37
|
+
if (o.json) {
|
|
38
|
+
out(JSON.stringify(f, null, 2) + "\n");
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
const mark = f.truthDelta === "CONTRADICT" ? "🔴" : f.truthDelta === "MATCH" ? "🟢" : "⚪";
|
|
42
|
+
out(`🛫 recorded frame #${f.seq} ${mark} (${f.truthDelta}) — receipt ${f.receiptId.slice(0, 12)}…\n`);
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
if (o.action === "verify") {
|
|
46
|
+
const v = fr.verifyCdr(o.cwd, { sameIssuer: true });
|
|
47
|
+
if (o.json) {
|
|
48
|
+
out(JSON.stringify(v, null, 2) + "\n");
|
|
49
|
+
return v.valid ? 0 : 1;
|
|
50
|
+
}
|
|
51
|
+
out(v.valid ? `🟢 BLACK BOX INTACT — ${v.frames} frame(s) verify offline (signed + chained).\n` : `🔴 TAMPERED — ${v.reason} (at frame ${v.brokenAt}).\n`);
|
|
52
|
+
return v.valid ? 0 : 1;
|
|
53
|
+
}
|
|
54
|
+
if (o.action === "replay") {
|
|
55
|
+
const r = fr.replay(o.cwd);
|
|
56
|
+
if (o.json) {
|
|
57
|
+
out(JSON.stringify(r, null, 2) + "\n");
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
const lines = [];
|
|
61
|
+
lines.push(`🎞 FLIGHT REPLAY — ${r.frames} frame(s) · chain ${r.chainValid ? "VALID ✓" : "BROKEN ✗"}`);
|
|
62
|
+
lines.push(` match=${r.counts.match} contradict=${r.counts.contradict} unverified=${r.counts.unverified}`);
|
|
63
|
+
if (r.incidentSeq !== null)
|
|
64
|
+
lines.push(` 🔴 INCIDENT at frame #${r.incidentSeq} (first claim≠reality)`);
|
|
65
|
+
lines.push("");
|
|
66
|
+
for (const n of r.narrative)
|
|
67
|
+
lines.push(` ${n}`);
|
|
68
|
+
out(lines.join("\n") + "\n");
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
if (o.action === "seal") {
|
|
72
|
+
const s = fr.seal(o.cwd);
|
|
73
|
+
if (o.json) {
|
|
74
|
+
out(JSON.stringify(s, null, 2) + "\n");
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
out(`🔏 SEALED — ${s.frames} frame(s), ${s.contradictions} contradiction(s)${s.incidentSeq !== null ? ` (incident #${s.incidentSeq})` : ""}.\n head: ${s.head ?? "(empty)"}\n receipt: ${s.receipt.receiptId}\n issuer: ${s.receipt.issuerFingerprint}\n\n Hand the receipt to an auditor — it verifies offline (mneme notary verify).\n`);
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
out(`✗ Unknown flight action "${o.action}". Try: record | replay | verify | seal\n`);
|
|
81
|
+
return 2;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=flight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flight.js","sourceRoot":"","sources":["../../src/commands/flight.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AAEvC,SAAS,GAAG,CAAC,CAAS;IACpB,IAAI,CAAC;QAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;AAC7D,CAAC;AAED,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,a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C,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,IAAI,IAAI,SAAS,gBAAgB,CAAC,CAAC,OAAO,CAAC,SAAS,gBAAgB,CAAC,CAAC,OAAO,CAAC,iBAAiB,qFAAqF,CAAC,CAAC;QACnV,OAAO,CAAC,CAAC;IACX,CAAC;IAED,GAAG,CAAC,4BAA4B,CAAC,CAAC,MAAM,2CAA2C,CAAC,CAAC;IACrF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
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,CAm3MvD"}
|
package/dist/index.js
CHANGED
|
@@ -4209,6 +4209,35 @@ export async function run(argv) {
|
|
|
4209
4209
|
json: !!o.json,
|
|
4210
4210
|
}));
|
|
4211
4211
|
});
|
|
4212
|
+
// v2.80.0 — FLIGHT RECORDER (💎3). The tamper-evident, replayable AI black box,
|
|
4213
|
+
// built on the NOTARY spine — every frame is a signed, chained receipt the
|
|
4214
|
+
// whole recorder verifies offline; seal = one court-admissible artifact.
|
|
4215
|
+
program
|
|
4216
|
+
.command("flight <action>")
|
|
4217
|
+
.description("🛫 FLIGHT RECORDER — the AI black box. record/replay/verify/seal an agent's actions+reasoning+claim-vs-reality as signed, chained receipts (built on NOTARY). actions: record | replay | verify | seal.")
|
|
4218
|
+
.option("--agent <a>", "agent id (record)")
|
|
4219
|
+
.option("--action <text>", "what the agent did (record)")
|
|
4220
|
+
.option("--kind <k>", "action | decision | claim | tool-call | payment | observation", "action")
|
|
4221
|
+
.option("--reasoning <r>", "why — reasoning trace (record)")
|
|
4222
|
+
.option("--claim <c>", "a checkable claim the agent asserted (record)")
|
|
4223
|
+
.option("--reality <o>", "what was actually observed/true (record)")
|
|
4224
|
+
.option("--delta <d>", "explicit MATCH | CONTRADICT | UNVERIFIED (overrides heuristic)")
|
|
4225
|
+
.option("--json", "machine-readable output", false)
|
|
4226
|
+
.action(async (action, o) => {
|
|
4227
|
+
const { flightCommand } = await import("./commands/flight.js");
|
|
4228
|
+
process.exit(await flightCommand({
|
|
4229
|
+
cwd: process.cwd(),
|
|
4230
|
+
action,
|
|
4231
|
+
agent: o.agent,
|
|
4232
|
+
actionText: o.action,
|
|
4233
|
+
frameKind: o.kind,
|
|
4234
|
+
reasoning: o.reasoning,
|
|
4235
|
+
claim: o.claim,
|
|
4236
|
+
reality: o.reality,
|
|
4237
|
+
delta: o.delta,
|
|
4238
|
+
json: !!o.json,
|
|
4239
|
+
}));
|
|
4240
|
+
});
|
|
4212
4241
|
program
|
|
4213
4242
|
.command("atlas")
|
|
4214
4243
|
.description("🗺 ATLAS HELP — six-layer discovery (TASTE · BLOOM · HOT · TAGS · INTENT · FULL). AI agents read 200 bytes here instead of 14 KB from --help.")
|