mneme-ai 2.225.0 โ 3.0.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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme compile` (v3.0.0) โ MNEME-BC, the Behavioral Compiler. Parse ANY vendor's action
|
|
3
|
+
* (a bash string, or a JSON tool-call on stdin) into the vendor-neutral Behavioral IR + a
|
|
4
|
+
* deterministic verdict. The "common language" every AI vendor speaks once Mneme parses it.
|
|
5
|
+
*/
|
|
6
|
+
import type { Command } from "commander";
|
|
7
|
+
export declare function registerCompileCommands(program: Command): void;
|
|
8
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiB9D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { compiler } from "@mneme-ai/core";
|
|
3
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
4
|
+
export function registerCompileCommands(program) {
|
|
5
|
+
program.command("compile [command...]")
|
|
6
|
+
.description("๐ MNEME-BC โ compile an AI action into the Behavioral IR (typed effect nodes) + a deterministic risk verdict. Reads the command from args, or a Claude Code hook JSON / raw command on stdin.")
|
|
7
|
+
.option("--json", "emit the full IR + verdict as JSON")
|
|
8
|
+
.action((commandParts, o) => {
|
|
9
|
+
let input = (commandParts ?? []).join(" ");
|
|
10
|
+
if (!String(input).trim()) {
|
|
11
|
+
try {
|
|
12
|
+
if (!process.stdin.isTTY)
|
|
13
|
+
input = readFileSync(0, "utf8");
|
|
14
|
+
}
|
|
15
|
+
catch { /* */ }
|
|
16
|
+
}
|
|
17
|
+
const ir = compiler.compileToIR(input);
|
|
18
|
+
const v = compiler.analyzeIR(ir);
|
|
19
|
+
if (o.json) {
|
|
20
|
+
out(JSON.stringify({ ir, verdict: v }, null, 2));
|
|
21
|
+
if (v.verdict === "BLOCK")
|
|
22
|
+
process.exitCode = 2;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const icon = v.verdict === "BLOCK" ? "๐ด" : v.verdict === "REVIEW" ? "๐ก" : "๐ข";
|
|
26
|
+
out(`๐ MNEME-BC โ ${icon} ${v.verdict} ยท maxRisk ${ir.maxRisk} ยท from ${ir.vendorShape}`);
|
|
27
|
+
if (!ir.nodes.length) {
|
|
28
|
+
out(" (no actionable nodes)");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
for (const n of ir.nodes)
|
|
32
|
+
out(` ${n.joinedBy || "ยท"} [${n.effect} ${n.risk}] ${n.verb}${n.flags.length ? " {" + n.flags.join(",") + "}" : ""}`);
|
|
33
|
+
if (v.reasons.length)
|
|
34
|
+
out(" โ " + v.reasons.join("; "));
|
|
35
|
+
if (v.verdict === "BLOCK")
|
|
36
|
+
process.exitCode = 2;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=compile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/commands/compile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjE,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC;SACpC,WAAW,CAAC,gMAAgM,CAA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EAAE,CAAC;YAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QAClE,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK;YAAE,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,IAAI,GAAG,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACnJ,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM;YAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO;YAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4LA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4lNvD"}
|
package/dist/index.js
CHANGED
|
@@ -105,6 +105,7 @@ import { registerReckonCommands } from "./commands/reckon.js";
|
|
|
105
105
|
import { registerSuccessionCommands } from "./commands/succession.js";
|
|
106
106
|
import { registerPagerCommands } from "./commands/pager.js";
|
|
107
107
|
import { registerKeryxCommands } from "./commands/keryx.js";
|
|
108
|
+
import { registerCompileCommands } from "./commands/compile.js";
|
|
108
109
|
import { registerAdamasCommands } from "./commands/adamas.js";
|
|
109
110
|
import { registerPrismCommands } from "./commands/prism.js";
|
|
110
111
|
import { registerGoldilocksCommands } from "./commands/goldilocks.js";
|
|
@@ -4777,6 +4778,7 @@ export async function run(argv) {
|
|
|
4777
4778
|
registerSuccessionCommands(program);
|
|
4778
4779
|
registerPagerCommands(program);
|
|
4779
4780
|
registerKeryxCommands(program);
|
|
4781
|
+
registerCompileCommands(program);
|
|
4780
4782
|
registerAdamasCommands(program);
|
|
4781
4783
|
registerPrismCommands(program);
|
|
4782
4784
|
registerGoldilocksCommands(program);
|