mneme-ai 3.101.0 โ†’ 3.103.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":"live.d.ts","sourceRoot":"","sources":["../../src/commands/live.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuqC3D"}
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/commands/live.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsrC3D"}
@@ -3,7 +3,7 @@ import { createHash } from "node:crypto";
3
3
  import { join } from "node:path";
4
4
  import { get as httpsGet, request as httpsRequest } from "node:https";
5
5
  import { spawn, spawnSync } from "node:child_process";
6
- import { live, agentFit, proofLoop, turnSignal, skillEffectiveness, crossLayerGraph, scopeCovenant, agentCollision, testGap, authzGap, intentImpact, riskHotspots, onboarding, crossService, logicEngine, graphLogic, accuracy, apiSurface, graphqlSurface, archLock, invariants, archBisect, archDecay, hotspots, changeCoupling, archRegressions, archLineage, deadPath, archFirewall, scarVaccine, equivReceipt, changeGate, scarMining, agentLedger, trustService, equivDiff, exfilPath, injectionTaint, behavioralDiff, securityAudit } from "@mneme-ai/core";
6
+ import { live, agentFit, proofLoop, turnSignal, skillEffectiveness, crossLayerGraph, scopeCovenant, agentCollision, testGap, authzGap, intentImpact, riskHotspots, onboarding, crossService, logicEngine, graphLogic, accuracy, apiSurface, graphqlSurface, archLock, invariants, archBisect, archDecay, hotspots, changeCoupling, archRegressions, archLineage, deadPath, archFirewall, scarVaccine, equivReceipt, changeGate, scarMining, agentLedger, trustService, equivDiff, exfilPath, injectionTaint, behavioralDiff, securityAudit, mediator } from "@mneme-ai/core";
7
7
  import { createContext as vmCreateContext, runInContext as vmRunInContext } from "node:vm";
8
8
  import { createServer as httpCreateServer } from "node:http";
9
9
  import { appendFileSync, readFileSync as _rf } from "node:fs";
@@ -1290,7 +1290,36 @@ jobs:
1290
1290
  if (v.verdict === "BLOCK")
1291
1291
  process.exitCode = 2;
1292
1292
  });
1293
- program.command("security").alias("appsec").description("๐Ÿ›ก SECURITY POSTURE โ€” the AppSec triad in one pass: AUTHZ GAP (unguarded sensitive WRITE) + EXFIL PATH (sensitive READ to response, no redaction) + INJECTION (request input โ†’ dangerous sink, no sanitizer). One verdict (CLEAR / REVIEW / AT-RISK) + a posture 0-100. Exit 2 if AT-RISK.")
1293
+ program.command("mediate").alias("fair-split").description("โš–๏ธ FAIR-DIVISION MEDIATOR โ€” find the fairest agreement between parties who can't (divorce / inheritance / M&A split / partnership). Each party gives point-valuations over the items; for TWO parties it runs Adjusted Winner โ†’ an envy-free + equitable + Pareto-optimal split (โ‰ค1 item split); for N>2 โ†’ proportional. Every fairness property is re-checkable from the parties' own values (the neutrality proof). Pass --file <json> or --json '[{\"name\":\"A\",\"vals\":{\"house\":50,...}},...]'.")
1294
+ .option("--file <path>", "JSON file: [{name, vals:{item:points}}]").option("--json <s>", "inline JSON of the parties")
1295
+ .action((o) => {
1296
+ let parties = [];
1297
+ try {
1298
+ const raw = o.json ? o.json : o.file ? readFileSync(o.file.includes("/") || o.file.includes("\\") ? o.file : join(process.cwd(), o.file), "utf8") : "";
1299
+ if (!raw) {
1300
+ out("โœ— pass --json '[...]' or --file <path> with [{name, vals:{item:points}}]");
1301
+ process.exitCode = 2;
1302
+ return;
1303
+ }
1304
+ parties = JSON.parse(raw);
1305
+ }
1306
+ catch (e) {
1307
+ out(`โœ— invalid JSON: ${e.message.slice(0, 120)}`);
1308
+ process.exitCode = 2;
1309
+ return;
1310
+ }
1311
+ const r = mediator.mediate(parties);
1312
+ out(`โš–๏ธ ${r.method === "adjusted-winner" ? "Adjusted Winner" : "Proportional"} mediation ยท ${r.parties.length} parties ยท ${r.items.length} items\n`);
1313
+ for (const it of r.items) {
1314
+ const shares = Object.entries(r.allocation[it] || {}).filter(([, f]) => f > 1e-6).map(([p, f]) => f >= 1 - 1e-6 ? `${p}` : `${p} ${Math.round(f * 100)}%`).join(" / ");
1315
+ out(` โ€ข ${it} โ†’ ${shares}`);
1316
+ }
1317
+ out(`\n payoffs (each party's own perceived value): ${Object.entries(r.proof.payoffs).map(([p, v]) => `${p}=${v}`).join(" ยท ")}`);
1318
+ out(` โœ… envy-free: ${r.proof.envyFree} ยท equitable: ${r.proof.equitable} ยท proportional: ${r.proof.proportional}${r.proof.splitItems.length ? ` ยท split: ${r.proof.splitItems.join(", ")}` : ""}`);
1319
+ out(`\n ${r.note}`);
1320
+ out(` neutrality: every property above is re-checkable from the parties' OWN valuations โ€” the math decided, not a biased AI.`);
1321
+ });
1322
+ program.command("appsec").alias("security-posture").description("๐Ÿ›ก SECURITY POSTURE โ€” the AppSec triad in one pass: AUTHZ GAP (unguarded sensitive WRITE) + EXFIL PATH (sensitive READ to response, no redaction) + INJECTION (request input โ†’ dangerous sink, no sanitizer). One verdict (CLEAR / REVIEW / AT-RISK) + a posture 0-100. Exit 2 if AT-RISK.")
1294
1323
  .action(() => {
1295
1324
  const cwd = process.cwd();
1296
1325
  const files = scanWithDocs(cwd);