mneme-ai 2.56.0 → 2.57.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.
@@ -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,CAsoKvD"}
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,CAwxKvD"}
package/dist/index.js CHANGED
@@ -4849,6 +4849,206 @@ export async function run(argv) {
4849
4849
  process.exitCode = 1;
4850
4850
  }
4851
4851
  });
4852
+ // ──────────────────────────────────────────────────────────────────
4853
+ // v2.57.0 — Top-level surface promotion (no `nemesis` prefix needed)
4854
+ // + WIRING DOCTOR primitive (AST-level per-feature check)
4855
+ // ──────────────────────────────────────────────────────────────────
4856
+ // 🧠 LETHE top-level alias
4857
+ const letheParent = program
4858
+ .command("lethe")
4859
+ .description("🧠 v2.57 — LETHE alias (forwards to `mneme nemesis lethe_forget`). GDPR Art 17 forget primitive.");
4860
+ letheParent.command("forget")
4861
+ .description("Forget a row from a JSONL ledger. Use --ledger <p> --row <n> [--dry-run].")
4862
+ .requiredOption("--ledger <p>", "Repo-relative ledger path")
4863
+ .requiredOption("--row <n>", "Row index (0-based)", (v) => Number(v))
4864
+ .option("--jurisdiction <t>", "GDPR jurisdiction tag", "EU-GDPR-Art17")
4865
+ .option("--dry-run", "Build receipt without rewriting", false)
4866
+ .action(async (opts) => {
4867
+ try {
4868
+ const core = await import("@mneme-ai/core");
4869
+ const r = core.nemesis.forgetRow({ repoRoot: process.cwd(), ledgerRelative: opts.ledger, rowIndex: opts.row, jurisdiction: opts.jurisdiction, dryRun: opts.dryRun ?? false });
4870
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4871
+ if (!r.ok)
4872
+ process.exitCode = 1;
4873
+ }
4874
+ catch (e) {
4875
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4876
+ process.exitCode = 1;
4877
+ }
4878
+ });
4879
+ letheParent.command("verify")
4880
+ .description("Verify a ForgetReceipt cryptographically. Use --stdin.")
4881
+ .option("--stdin", "Read receipt JSON from stdin")
4882
+ .action(async () => {
4883
+ try {
4884
+ const core = await import("@mneme-ai/core");
4885
+ const chunks = [];
4886
+ for await (const c of process.stdin)
4887
+ chunks.push(c);
4888
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4889
+ if (!body) {
4890
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass receipt JSON via stdin" }) + "\n");
4891
+ process.exitCode = 1;
4892
+ return;
4893
+ }
4894
+ const v = core.nemesis.verifyForgetReceipt(JSON.parse(body));
4895
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4896
+ if (!v.ok)
4897
+ process.exitCode = 1;
4898
+ }
4899
+ catch (e) {
4900
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4901
+ process.exitCode = 1;
4902
+ }
4903
+ });
4904
+ // ⚖ GAVEL top-level alias
4905
+ const gavelParent = program
4906
+ .command("gavel")
4907
+ .description("⚖ v2.57 — GAVEL alias (forwards to `mneme nemesis gavel_pack/verify`). Court-admissible bundle.");
4908
+ gavelParent.command("pack")
4909
+ .description("Bind THEMIS + EU stamp + SIBYL into court-admissible Merkle bundle. Use --stdin.")
4910
+ .option("--stdin", "Read bundle input JSON from stdin")
4911
+ .action(async () => {
4912
+ try {
4913
+ const core = await import("@mneme-ai/core");
4914
+ const chunks = [];
4915
+ for await (const c of process.stdin)
4916
+ chunks.push(c);
4917
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4918
+ if (!body) {
4919
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass bundle input JSON via stdin" }) + "\n");
4920
+ process.exitCode = 1;
4921
+ return;
4922
+ }
4923
+ const r = core.nemesis.buildGavelBundle(JSON.parse(body));
4924
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4925
+ if (!r.ok)
4926
+ process.exitCode = 1;
4927
+ }
4928
+ catch (e) {
4929
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4930
+ process.exitCode = 1;
4931
+ }
4932
+ });
4933
+ gavelParent.command("verify")
4934
+ .description("Verify bundle HMAC + Merkle root + per-artifact signature. Use --stdin.")
4935
+ .option("--stdin", "Read bundle JSON from stdin")
4936
+ .action(async () => {
4937
+ try {
4938
+ const core = await import("@mneme-ai/core");
4939
+ const chunks = [];
4940
+ for await (const c of process.stdin)
4941
+ chunks.push(c);
4942
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4943
+ if (!body) {
4944
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass bundle JSON via stdin" }) + "\n");
4945
+ process.exitCode = 1;
4946
+ return;
4947
+ }
4948
+ const v = core.nemesis.verifyGavelBundle(JSON.parse(body));
4949
+ process.stdout.write(JSON.stringify(v, null, 2) + "\n");
4950
+ if (!v.ok)
4951
+ process.exitCode = 1;
4952
+ }
4953
+ catch (e) {
4954
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4955
+ process.exitCode = 1;
4956
+ }
4957
+ });
4958
+ // 🌐 NIMBUS top-level alias
4959
+ const nimbusParent = program
4960
+ .command("nimbus")
4961
+ .description("🌐 v2.57 — NIMBUS alias (forwards to `mneme nemesis nimbus_*`). Federated trust mesh.");
4962
+ nimbusParent.command("publish")
4963
+ .description("Publish leaderboard card to local pub-store. Use --stdin or --org-tag.")
4964
+ .option("--stdin", "Read publish input JSON from stdin")
4965
+ .option("--org-tag <name>", "Org tag (alternative to --stdin)")
4966
+ .action(async (opts) => {
4967
+ try {
4968
+ const core = await import("@mneme-ai/core");
4969
+ let j = null;
4970
+ if (opts.stdin) {
4971
+ const chunks = [];
4972
+ for await (const c of process.stdin)
4973
+ chunks.push(c);
4974
+ const body = Buffer.concat(chunks).toString("utf8").trim();
4975
+ if (body)
4976
+ j = JSON.parse(body);
4977
+ }
4978
+ const orgTag = opts.orgTag ?? j?.orgTag;
4979
+ if (!orgTag) {
4980
+ process.stdout.write(JSON.stringify({ ok: false, error: "orgTag required (--org-tag or via stdin)" }) + "\n");
4981
+ process.exitCode = 1;
4982
+ return;
4983
+ }
4984
+ const input = { ...(j ?? {}), repoRoot: process.cwd(), orgTag };
4985
+ const r = core.nemesis.publishCard(input);
4986
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
4987
+ if (!r.ok)
4988
+ process.exitCode = 1;
4989
+ }
4990
+ catch (e) {
4991
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
4992
+ process.exitCode = 1;
4993
+ }
4994
+ });
4995
+ nimbusParent.command("subscribe")
4996
+ .description("Subscribe to foreign org's card. Verifies HMAC + expiry. --trust <0..1> optional.")
4997
+ .option("--stdin", "Read card JSON from stdin")
4998
+ .option("--trust <n>", "Local trust weight (0..1)", (v) => Number(v), 0.5)
4999
+ .action(async (opts) => {
5000
+ try {
5001
+ const core = await import("@mneme-ai/core");
5002
+ const chunks = [];
5003
+ for await (const c of process.stdin)
5004
+ chunks.push(c);
5005
+ const body = Buffer.concat(chunks).toString("utf8").trim();
5006
+ if (!body) {
5007
+ process.stdout.write(JSON.stringify({ ok: false, error: "pass card JSON via stdin" }) + "\n");
5008
+ process.exitCode = 1;
5009
+ return;
5010
+ }
5011
+ const r = core.nemesis.subscribeCard({ repoRoot: process.cwd(), card: JSON.parse(body), trustWeight: opts.trust });
5012
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
5013
+ if (!r.ok)
5014
+ process.exitCode = 1;
5015
+ }
5016
+ catch (e) {
5017
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5018
+ process.exitCode = 1;
5019
+ }
5020
+ });
5021
+ nimbusParent.command("reputation")
5022
+ .description("Compute cross-org weighted vendor reputation from subscribed cards.")
5023
+ .action(async () => {
5024
+ try {
5025
+ const core = await import("@mneme-ai/core");
5026
+ const r = core.nemesis.computeCrossOrgReputation(process.cwd());
5027
+ process.stdout.write(JSON.stringify({ ok: true, vendors: r }, null, 2) + "\n");
5028
+ }
5029
+ catch (e) {
5030
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5031
+ process.exitCode = 1;
5032
+ }
5033
+ });
5034
+ // 🤯 WIRING DOCTOR — AST-level per-feature surface check
5035
+ program
5036
+ .command("wiring_doctor")
5037
+ .description("🤯 v2.57 — WIRING DOCTOR: scan core / sdk / cli source for per-feature surface coverage (core export · SDK method · CLI verb · TG claim). Replaces commit-msg parsing with structural verification.")
5038
+ .option("--features <list...>", "Features to check (default: lethe / gavel / nimbus / janus / stargate / dragon / launch_window)")
5039
+ .action(async (opts) => {
5040
+ try {
5041
+ const core = await import("@mneme-ai/core");
5042
+ const r = core.wiringDoctor.diagnose(process.cwd(), { features: opts.features });
5043
+ process.stdout.write(JSON.stringify(r, null, 2) + "\n");
5044
+ if (!r.ok)
5045
+ process.exitCode = 1;
5046
+ }
5047
+ catch (e) {
5048
+ process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
5049
+ process.exitCode = 1;
5050
+ }
5051
+ });
4852
5052
  // v2.53.0 — CATALOG COUNT single source of truth.
4853
5053
  const catalogParent = program
4854
5054
  .command("catalog")