mneme-ai 2.62.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 +112 -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,118 @@ 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
|
+
});
|
|
4685
4797
|
// v2.62.0 — MIRRAGE: live conscience for AI agents via MCP reverse-channel.
|
|
4686
4798
|
// Agent calls `mneme.mirrage.scan {draft}` BEFORE shipping; per-sentence
|
|
4687
4799
|
// nudges (5-level conscience ladder) + suggested edit + ship-block on
|