mneme-ai 2.78.0 → 2.79.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/notary.d.ts +23 -0
- package/dist/commands/notary.d.ts.map +1 -0
- package/dist/commands/notary.js +89 -0
- package/dist/commands/notary.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.79.0 — `mneme notary <action>`
|
|
3
|
+
*
|
|
4
|
+
* Portable proof-of-provenance receipts (Ed25519). Verify with a public key
|
|
5
|
+
* alone — no Mneme, no network, no shared secret.
|
|
6
|
+
*
|
|
7
|
+
* mneme notary pubkey — show this repo's issuer public key + fingerprint
|
|
8
|
+
* mneme notary issue --subject S [--kind K] [--payload JSON] [--no-payload] [--prev ID]
|
|
9
|
+
* mneme notary verify <file|-> — verify a receipt OFFLINE (exit 0 valid, 1 invalid)
|
|
10
|
+
*/
|
|
11
|
+
export interface NotaryOpts {
|
|
12
|
+
cwd: string;
|
|
13
|
+
action: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
kind?: string;
|
|
16
|
+
payload?: string;
|
|
17
|
+
noPayload?: boolean;
|
|
18
|
+
prev?: string;
|
|
19
|
+
file?: string;
|
|
20
|
+
json?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function notaryCommand(opts: NotaryOpts): Promise<number>;
|
|
23
|
+
//# sourceMappingURL=notary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notary.d.ts","sourceRoot":"","sources":["../../src/commands/notary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA8CrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.79.0 — `mneme notary <action>`
|
|
3
|
+
*
|
|
4
|
+
* Portable proof-of-provenance receipts (Ed25519). Verify with a public key
|
|
5
|
+
* alone — no Mneme, no network, no shared secret.
|
|
6
|
+
*
|
|
7
|
+
* mneme notary pubkey — show this repo's issuer public key + fingerprint
|
|
8
|
+
* mneme notary issue --subject S [--kind K] [--payload JSON] [--no-payload] [--prev ID]
|
|
9
|
+
* mneme notary verify <file|-> — verify a receipt OFFLINE (exit 0 valid, 1 invalid)
|
|
10
|
+
*/
|
|
11
|
+
import { writeSync, readFileSync } from "node:fs";
|
|
12
|
+
import * as core from "@mneme-ai/core";
|
|
13
|
+
import { parseJsonArg } from "../util/json_arg.js";
|
|
14
|
+
function out(s) {
|
|
15
|
+
try {
|
|
16
|
+
writeSync(1, s);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
process.stdout.write(s);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const KINDS = new Set(["claim-verdict", "protocol-hop", "memory-capsule", "reasoning-trace", "generic"]);
|
|
23
|
+
export async function notaryCommand(opts) {
|
|
24
|
+
const { getIssuerKeyPair, issueReceipt, verifyReceipt } = core.notary;
|
|
25
|
+
if (opts.action === "pubkey" || opts.action === "keygen") {
|
|
26
|
+
const kp = getIssuerKeyPair(opts.cwd);
|
|
27
|
+
if (opts.json) {
|
|
28
|
+
out(JSON.stringify({ alg: "ed25519", fingerprint: kp.fingerprint, publicKeyB64: kp.publicKeyB64 }, null, 2) + "\n");
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
out(`🪪 MNEME NOTARY — issuer public key (this repo)\n\n alg: ed25519\n fingerprint: ${kp.fingerprint}\n publicKey: ${kp.publicKeyB64}\n\n Share the public key. Anyone can verify your receipts offline with it.\n The private key stays in .mneme/notary/issuer.key (never shared).\n`);
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
if (opts.action === "issue") {
|
|
35
|
+
if (!opts.subject) {
|
|
36
|
+
out("✗ issue requires --subject\n");
|
|
37
|
+
return 2;
|
|
38
|
+
}
|
|
39
|
+
const kind = opts.kind && KINDS.has(opts.kind) ? opts.kind : "generic";
|
|
40
|
+
let payload = undefined;
|
|
41
|
+
if (opts.payload) {
|
|
42
|
+
try {
|
|
43
|
+
payload = parseJsonArg(opts.payload);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
out("✗ --payload is not valid JSON\n");
|
|
47
|
+
return 2;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const r = issueReceipt(opts.cwd, {
|
|
51
|
+
kind, subject: opts.subject, payload,
|
|
52
|
+
includePayload: !opts.noPayload, prev: opts.prev ?? null,
|
|
53
|
+
});
|
|
54
|
+
out(JSON.stringify(r, null, 2) + "\n");
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
if (opts.action === "verify") {
|
|
58
|
+
let raw;
|
|
59
|
+
try {
|
|
60
|
+
raw = opts.file && opts.file !== "-" ? readFileSync(opts.file, "utf8") : readFileSync(0, "utf8");
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
out(`✗ cannot read receipt: ${e.message}\n`);
|
|
64
|
+
return 2;
|
|
65
|
+
}
|
|
66
|
+
let receipt;
|
|
67
|
+
try {
|
|
68
|
+
receipt = JSON.parse(raw);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
out("✗ receipt is not valid JSON\n");
|
|
72
|
+
return 2;
|
|
73
|
+
}
|
|
74
|
+
const v = verifyReceipt(receipt);
|
|
75
|
+
if (opts.json) {
|
|
76
|
+
out(JSON.stringify(v, null, 2) + "\n");
|
|
77
|
+
return v.valid ? 0 : 1;
|
|
78
|
+
}
|
|
79
|
+
if (v.valid) {
|
|
80
|
+
out(`🟢 VALID — signature verifies offline against the embedded public key.\n issuer: ${v.issuerFingerprint}\n kind: ${v.kind}\n subject: ${v.subject}\n`);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
out(`🔴 INVALID — ${v.reason}\n`);
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
out(`✗ Unknown notary action "${opts.action}". Try: pubkey | issue | verify\n`);
|
|
87
|
+
return 2;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=notary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notary.js","sourceRoot":"","sources":["../../src/commands/notary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,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;AAcD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzG,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAgB;IAClD,MAAM,EAAE,gBAAgB,EAAE,YA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AC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;QAClF,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YACZ,GAAG,CAAC,uFAAuF,CAAC,CAAC,iBAAiB,iBAAiB,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;YACrK,OAAO,CAAC,CAAC;QACX,CAAC;QACD,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,GAAG,CAAC,4BAA4B,IAAI,CAAC,MAAM,mCAAmC,CAAC,CAAC;IAChF,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,CAq1MvD"}
|
package/dist/index.js
CHANGED
|
@@ -4181,6 +4181,34 @@ export async function run(argv) {
|
|
|
4181
4181
|
const { immuneCommand } = await import("./commands/immune.js");
|
|
4182
4182
|
process.exit(await immuneCommand({ cwd: process.cwd(), json: !!opts.json }));
|
|
4183
4183
|
});
|
|
4184
|
+
// v2.79.0 — NOTARY. Portable, offline-verifiable proof-of-provenance receipts
|
|
4185
|
+
// (Ed25519). Verify with a public key alone — no Mneme, no network, no secret.
|
|
4186
|
+
// The TRUST FABRIC spine for cross-protocol routing, portable memory, and the
|
|
4187
|
+
// AI flight recorder.
|
|
4188
|
+
program
|
|
4189
|
+
.command("notary <action>")
|
|
4190
|
+
.description("🪪 NOTARY — Ed25519-signed proof receipts anyone verifies OFFLINE with a public key (no Mneme, no network, no shared secret). actions: pubkey | issue | verify <file|->. Mneme's first asymmetric-crypto primitive.")
|
|
4191
|
+
.option("--subject <s>", "what the receipt attests (issue)")
|
|
4192
|
+
.option("--kind <k>", "claim-verdict | protocol-hop | memory-capsule | reasoning-trace | generic", "generic")
|
|
4193
|
+
.option("--payload <json>", "JSON payload to attest (issue)")
|
|
4194
|
+
.option("--hash-only", "privacy: omit the inline payload, attest only its hash (issue)", false)
|
|
4195
|
+
.option("--prev <id>", "previous receiptId to chain onto (issue)")
|
|
4196
|
+
.option("--file <path>", "receipt file to verify (use '-' for stdin)")
|
|
4197
|
+
.option("--json", "machine-readable output", false)
|
|
4198
|
+
.action(async (action, o) => {
|
|
4199
|
+
const { notaryCommand } = await import("./commands/notary.js");
|
|
4200
|
+
process.exit(await notaryCommand({
|
|
4201
|
+
cwd: process.cwd(),
|
|
4202
|
+
action,
|
|
4203
|
+
subject: o.subject,
|
|
4204
|
+
kind: o.kind,
|
|
4205
|
+
payload: o.payload,
|
|
4206
|
+
noPayload: !!o.hashOnly,
|
|
4207
|
+
prev: o.prev,
|
|
4208
|
+
file: o.file,
|
|
4209
|
+
json: !!o.json,
|
|
4210
|
+
}));
|
|
4211
|
+
});
|
|
4184
4212
|
program
|
|
4185
4213
|
.command("atlas")
|
|
4186
4214
|
.description("🗺 ATLAS HELP — six-layer discovery (TASTE · BLOOM · HOT · TAGS · INTENT · FULL). AI agents read 200 bytes here instead of 14 KB from --help.")
|