mneme-ai 2.61.0 → 2.63.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/index.d.ts.map +1 -1
- package/dist/index.js +222 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
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,CA63LvD"}
|
package/dist/index.js
CHANGED
|
@@ -4682,6 +4682,228 @@ export async function run(argv) {
|
|
|
4682
4682
|
process.exitCode = 1;
|
|
4683
4683
|
}
|
|
4684
4684
|
});
|
|
4685
|
+
// v2.63.0 — TIME-CRYSTAL: federated agent wisdom.
|
|
4686
|
+
// When agent A hits problem P → "342 agents saw same in 7 days; 89%
|
|
4687
|
+
// used X; 11% tried Y but broke on pnpm".
|
|
4688
|
+
const timeCrystalParent = program
|
|
4689
|
+
.command("time_crystal")
|
|
4690
|
+
.description("v2.63 — federated agent wisdom. Default action = stats summary.")
|
|
4691
|
+
.action(async () => {
|
|
4692
|
+
try {
|
|
4693
|
+
const core = await import("@mneme-ai/core");
|
|
4694
|
+
const stats = core.timeCrystal.contributorStats(process.cwd());
|
|
4695
|
+
const led = core.timeCrystal.verifyLedgerChain(process.cwd());
|
|
4696
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, ledger: led, ...stats }, null, 2) + "\n");
|
|
4697
|
+
}
|
|
4698
|
+
catch (e) {
|
|
4699
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4700
|
+
process.exitCode = 1;
|
|
4701
|
+
}
|
|
4702
|
+
});
|
|
4703
|
+
timeCrystalParent.command("lookup")
|
|
4704
|
+
.description("Look up wisdom for a problem (returns ranked approaches + gotchas + related buckets).")
|
|
4705
|
+
.requiredOption("--problem <text>", "Problem description")
|
|
4706
|
+
.option("--env <kv...>", "Env hints (e.g. node=22 pm=npm)", (val, prev = []) => prev.concat([val]), [])
|
|
4707
|
+
.option("--top <n>", "Max approaches", (v) => Number(v), 5)
|
|
4708
|
+
.option("--banner", "Render ASCII banner instead of JSON")
|
|
4709
|
+
.action(async (opts) => {
|
|
4710
|
+
try {
|
|
4711
|
+
const core = await import("@mneme-ai/core");
|
|
4712
|
+
const envMap = {};
|
|
4713
|
+
for (const e of opts.env ?? []) {
|
|
4714
|
+
const [k, v] = e.split("=");
|
|
4715
|
+
if (k && v)
|
|
4716
|
+
envMap[k] = v;
|
|
4717
|
+
}
|
|
4718
|
+
const r = core.timeCrystal.lookupWisdom({
|
|
4719
|
+
problem: opts.problem,
|
|
4720
|
+
env: Object.keys(envMap).length > 0 ? envMap : undefined,
|
|
4721
|
+
topN: opts.top ?? 5,
|
|
4722
|
+
cwd: process.cwd(),
|
|
4723
|
+
});
|
|
4724
|
+
if (opts.banner)
|
|
4725
|
+
process.stdout.write(core.timeCrystal.renderLookupBanner(r) + "\n");
|
|
4726
|
+
else
|
|
4727
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4728
|
+
}
|
|
4729
|
+
catch (e) {
|
|
4730
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4731
|
+
process.exitCode = 1;
|
|
4732
|
+
}
|
|
4733
|
+
});
|
|
4734
|
+
timeCrystalParent.command("contribute")
|
|
4735
|
+
.description("Contribute a (problem, approach, outcome) record. Anyone using Mneme MCP contributes back.")
|
|
4736
|
+
.requiredOption("--problem <text>", "Problem description")
|
|
4737
|
+
.requiredOption("--approach <text>", "What you tried")
|
|
4738
|
+
.requiredOption("--outcome <s>", "success / failure / partial")
|
|
4739
|
+
.requiredOption("--agent <id>", "Reporting agent identifier")
|
|
4740
|
+
.option("--env <kv...>", "Env hints (node=22 pm=npm)", (val, prev = []) => prev.concat([val]), [])
|
|
4741
|
+
.option("--note <text>", "Free-text gotcha hint")
|
|
4742
|
+
.action(async (opts) => {
|
|
4743
|
+
try {
|
|
4744
|
+
const core = await import("@mneme-ai/core");
|
|
4745
|
+
const envMap = {};
|
|
4746
|
+
for (const e of opts.env ?? []) {
|
|
4747
|
+
const [k, v] = e.split("=");
|
|
4748
|
+
if (k && v)
|
|
4749
|
+
envMap[k] = v;
|
|
4750
|
+
}
|
|
4751
|
+
const r = core.timeCrystal.contribute({
|
|
4752
|
+
problem: opts.problem,
|
|
4753
|
+
approach: opts.approach,
|
|
4754
|
+
outcome: opts.outcome,
|
|
4755
|
+
agent: opts.agent,
|
|
4756
|
+
env: Object.keys(envMap).length > 0 ? envMap : undefined,
|
|
4757
|
+
note: opts.note,
|
|
4758
|
+
cwd: process.cwd(),
|
|
4759
|
+
});
|
|
4760
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4761
|
+
}
|
|
4762
|
+
catch (e) {
|
|
4763
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4764
|
+
process.exitCode = 1;
|
|
4765
|
+
}
|
|
4766
|
+
});
|
|
4767
|
+
timeCrystalParent.command("stats")
|
|
4768
|
+
.description("Show contributor stats: total contributions, distinct agents, top problems.")
|
|
4769
|
+
.action(async () => {
|
|
4770
|
+
try {
|
|
4771
|
+
const core = await import("@mneme-ai/core");
|
|
4772
|
+
const stats = core.timeCrystal.contributorStats(process.cwd());
|
|
4773
|
+
process.stdout.write(JSON.stringify(stats, null, 2) + "\n");
|
|
4774
|
+
}
|
|
4775
|
+
catch (e) {
|
|
4776
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4777
|
+
process.exitCode = 1;
|
|
4778
|
+
}
|
|
4779
|
+
});
|
|
4780
|
+
timeCrystalParent.command("audit")
|
|
4781
|
+
.description("Verify HMAC-chained wisdom ledger + show last N entries.")
|
|
4782
|
+
.option("--limit <n>", "Max rows", (v) => Number(v), 20)
|
|
4783
|
+
.action(async (opts) => {
|
|
4784
|
+
try {
|
|
4785
|
+
const core = await import("@mneme-ai/core");
|
|
4786
|
+
const led = core.timeCrystal.verifyLedgerChain(process.cwd());
|
|
4787
|
+
const rows = core.timeCrystal.readLedger(process.cwd());
|
|
4788
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, totalRows: led.rows, brokenAt: led.brokenAt, recent: rows.slice(-(opts.limit ?? 20)) }, null, 2) + "\n");
|
|
4789
|
+
if (!led.ok)
|
|
4790
|
+
process.exitCode = 1;
|
|
4791
|
+
}
|
|
4792
|
+
catch (e) {
|
|
4793
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4794
|
+
process.exitCode = 1;
|
|
4795
|
+
}
|
|
4796
|
+
});
|
|
4797
|
+
// v2.62.0 — MIRRAGE: live conscience for AI agents via MCP reverse-channel.
|
|
4798
|
+
// Agent calls `mneme.mirrage.scan {draft}` BEFORE shipping; per-sentence
|
|
4799
|
+
// nudges (5-level conscience ladder) + suggested edit + ship-block on
|
|
4800
|
+
// critical findings.
|
|
4801
|
+
const mirrageParent = program
|
|
4802
|
+
.command("mirrage")
|
|
4803
|
+
.description("v2.62 — live conscience. Default action = ledger audit.")
|
|
4804
|
+
.action(async () => {
|
|
4805
|
+
try {
|
|
4806
|
+
const core = await import("@mneme-ai/core");
|
|
4807
|
+
const led = core.mirrage.verifyLedgerChain(process.cwd());
|
|
4808
|
+
const rows = core.mirrage.readLedger(process.cwd());
|
|
4809
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, rows: led.rows, brokenAt: led.brokenAt, recent: rows.slice(-10) }, null, 2) + "\n");
|
|
4810
|
+
}
|
|
4811
|
+
catch (e) {
|
|
4812
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4813
|
+
process.exitCode = 1;
|
|
4814
|
+
}
|
|
4815
|
+
});
|
|
4816
|
+
mirrageParent.command("scan")
|
|
4817
|
+
.description("Scan a draft for refutable claims. Returns per-sentence nudges + suggested edit + ship-block decision.")
|
|
4818
|
+
.requiredOption("--draft <text>", "Draft text (or use --stdin)")
|
|
4819
|
+
.requiredOption("--agent <id>", "Requesting agent identifier")
|
|
4820
|
+
.option("--cursor <n>", "Streaming mode: only scan sentences ending before this offset", (v) => Number(v))
|
|
4821
|
+
.option("--min-risk <n>", "Risk threshold below which no nudge is emitted (default 0.30)", (v) => Number(v), 0.30)
|
|
4822
|
+
.option("--banner", "Render ASCII banner instead of JSON")
|
|
4823
|
+
.action(async (opts) => {
|
|
4824
|
+
try {
|
|
4825
|
+
const core = await import("@mneme-ai/core");
|
|
4826
|
+
const r = core.mirrage.scanDraft({
|
|
4827
|
+
draft: opts.draft,
|
|
4828
|
+
agent: opts.agent,
|
|
4829
|
+
cursorPos: opts.cursor,
|
|
4830
|
+
minRisk: opts.minRisk ?? 0.30,
|
|
4831
|
+
cwd: process.cwd(),
|
|
4832
|
+
});
|
|
4833
|
+
if (opts.banner)
|
|
4834
|
+
process.stdout.write(core.mirrage.renderBanner(r) + "\n");
|
|
4835
|
+
else
|
|
4836
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4837
|
+
if (r.blocksShip)
|
|
4838
|
+
process.exitCode = 1;
|
|
4839
|
+
}
|
|
4840
|
+
catch (e) {
|
|
4841
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4842
|
+
process.exitCode = 1;
|
|
4843
|
+
}
|
|
4844
|
+
});
|
|
4845
|
+
mirrageParent.command("ack")
|
|
4846
|
+
.description("Acknowledge a nudge (closes alert + bumps fatigue counter + optional cross-agent wisdom broadcast).")
|
|
4847
|
+
.requiredOption("--scan-id <id>", "Scan id from a prior scan")
|
|
4848
|
+
.requiredOption("--nudge-id <id>", "Nudge id within that scan")
|
|
4849
|
+
.requiredOption("--agent <id>", "Acknowledging agent")
|
|
4850
|
+
.option("--broadcast", "Append lesson to cross-agent wisdom feed")
|
|
4851
|
+
.option("--sentence <text>", "Sentence (required if --broadcast)")
|
|
4852
|
+
.option("--level <l>", "Conscience level (hint/suggestion/warning/block/reject)")
|
|
4853
|
+
.option("--reason <r>", "Why the agent acked")
|
|
4854
|
+
.option("--fingerprint <fp>", "Fingerprint hash (for fatigue gating)")
|
|
4855
|
+
.action(async (opts) => {
|
|
4856
|
+
try {
|
|
4857
|
+
const core = await import("@mneme-ai/core");
|
|
4858
|
+
const r = core.mirrage.acknowledgeNudge({
|
|
4859
|
+
scanId: opts.scanId,
|
|
4860
|
+
nudgeId: opts.nudgeId,
|
|
4861
|
+
agent: opts.agent,
|
|
4862
|
+
broadcast: opts.broadcast === true,
|
|
4863
|
+
sentence: opts.sentence,
|
|
4864
|
+
level: opts.level,
|
|
4865
|
+
reason: opts.reason,
|
|
4866
|
+
fingerprint: opts.fingerprint,
|
|
4867
|
+
cwd: process.cwd(),
|
|
4868
|
+
});
|
|
4869
|
+
process.stdout.write(JSON.stringify(r, null, 2) + "\n");
|
|
4870
|
+
}
|
|
4871
|
+
catch (e) {
|
|
4872
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4873
|
+
process.exitCode = 1;
|
|
4874
|
+
}
|
|
4875
|
+
});
|
|
4876
|
+
mirrageParent.command("wisdom")
|
|
4877
|
+
.description("Show cross-agent wisdom feed (lessons broadcast after nudge acks).")
|
|
4878
|
+
.option("--limit <n>", "Max rows", (v) => Number(v), 20)
|
|
4879
|
+
.action(async (opts) => {
|
|
4880
|
+
try {
|
|
4881
|
+
const core = await import("@mneme-ai/core");
|
|
4882
|
+
const rows = core.mirrage.readWisdom(process.cwd());
|
|
4883
|
+
process.stdout.write(JSON.stringify({ ok: true, total: rows.length, recent: rows.slice(-(opts.limit ?? 20)) }, null, 2) + "\n");
|
|
4884
|
+
}
|
|
4885
|
+
catch (e) {
|
|
4886
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4887
|
+
process.exitCode = 1;
|
|
4888
|
+
}
|
|
4889
|
+
});
|
|
4890
|
+
mirrageParent.command("audit")
|
|
4891
|
+
.description("Verify the HMAC-chained nudge ledger + last N entries.")
|
|
4892
|
+
.option("--limit <n>", "Max rows", (v) => Number(v), 20)
|
|
4893
|
+
.action(async (opts) => {
|
|
4894
|
+
try {
|
|
4895
|
+
const core = await import("@mneme-ai/core");
|
|
4896
|
+
const led = core.mirrage.verifyLedgerChain(process.cwd());
|
|
4897
|
+
const rows = core.mirrage.readLedger(process.cwd());
|
|
4898
|
+
process.stdout.write(JSON.stringify({ ok: led.ok, totalRows: led.rows, brokenAt: led.brokenAt, recent: rows.slice(-(opts.limit ?? 20)) }, null, 2) + "\n");
|
|
4899
|
+
if (!led.ok)
|
|
4900
|
+
process.exitCode = 1;
|
|
4901
|
+
}
|
|
4902
|
+
catch (e) {
|
|
4903
|
+
process.stdout.write(JSON.stringify({ ok: false, error: e.message }) + "\n");
|
|
4904
|
+
process.exitCode = 1;
|
|
4905
|
+
}
|
|
4906
|
+
});
|
|
4685
4907
|
// v2.61.0 — PASSPORT: capability-based security for MCP.
|
|
4686
4908
|
// Agents request HMAC-signed passports before sensitive tool calls;
|
|
4687
4909
|
// trust score gates issuance; delegation chain + revocation cascade
|