mneme-ai 3.102.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.
- package/dist/commands/morph.d.ts +13 -0
- package/dist/commands/morph.d.ts.map +1 -0
- package/dist/commands/morph.js +61 -0
- package/dist/commands/morph.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme morph` (v3.103.0) — MORPH, the polymorphic surface. State an intent in
|
|
3
|
+
* free natural language (any language, EN/Thai); MORPH resolves the RIGHT Mneme
|
|
4
|
+
* capability and hands back the typed next call — the MCP tool to invoke, a
|
|
5
|
+
* runnable CLI invocation, and the args projected from the sentence — signed.
|
|
6
|
+
*
|
|
7
|
+
* mneme morph "is this claim actually true"
|
|
8
|
+
* mneme morph "ใครแก้ฟังก์ชันนี้ล่าสุดและทำไม"
|
|
9
|
+
* mneme morph "ดูแลเรื่องงบ 5 หมื่น ห้ามโพสต์ด่าใคร" --json
|
|
10
|
+
*/
|
|
11
|
+
import type { Command } from "commander";
|
|
12
|
+
export declare function registerMorphCommands(program: Command): void;
|
|
13
|
+
//# sourceMappingURL=morph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph.d.ts","sourceRoot":"","sources":["../../src/commands/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6B5D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mneme morph` (v3.103.0) — MORPH, the polymorphic surface. State an intent in
|
|
3
|
+
* free natural language (any language, EN/Thai); MORPH resolves the RIGHT Mneme
|
|
4
|
+
* capability and hands back the typed next call — the MCP tool to invoke, a
|
|
5
|
+
* runnable CLI invocation, and the args projected from the sentence — signed.
|
|
6
|
+
*
|
|
7
|
+
* mneme morph "is this claim actually true"
|
|
8
|
+
* mneme morph "ใครแก้ฟังก์ชันนี้ล่าสุดและทำไม"
|
|
9
|
+
* mneme morph "ดูแลเรื่องงบ 5 หมื่น ห้ามโพสต์ด่าใคร" --json
|
|
10
|
+
*/
|
|
11
|
+
import { morph as morphCore, notary } from "@mneme-ai/core";
|
|
12
|
+
function out(s) { process.stdout.write(s + "\n"); }
|
|
13
|
+
export function registerMorphCommands(program) {
|
|
14
|
+
program
|
|
15
|
+
.command("morph")
|
|
16
|
+
.alias("plug")
|
|
17
|
+
.argument("[intent...]", "what you want, in your own words — any language")
|
|
18
|
+
.description("🧬 MORPH — the polymorphic plug for AI agents: state an intent in free natural language; MORPH resolves the RIGHT Mneme capability and returns the typed next call (the MCP tool to invoke + a runnable CLI + args projected from your sentence), signed (offline-verifiable). One surface instead of memorizing 600+ tools; abstains (clarify) rather than misfire. Composes the Intent Gateway + the manifest. (MCP: mneme.morph)")
|
|
19
|
+
.option("--json", "JSON output (signed)")
|
|
20
|
+
.action((intent, opts) => {
|
|
21
|
+
const q = Array.isArray(intent) ? intent.join(" ") : String(intent ?? "");
|
|
22
|
+
if (!q.trim()) {
|
|
23
|
+
out("usage: mneme morph \"<what you want, in your own words>\"");
|
|
24
|
+
process.exitCode = 2;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const m = morphCore.morph(q);
|
|
28
|
+
let receipt = null;
|
|
29
|
+
try {
|
|
30
|
+
receipt = notary.issueReceipt(process.cwd(), { kind: "claim-verdict", subject: `morph:${m.verdict}`, payload: { verdict: m.verdict, command: m.capability?.command ?? null, mcpTool: m.capability?.mcpTool ?? null, confidence: m.confidence }, includePayload: true });
|
|
31
|
+
}
|
|
32
|
+
catch { /* */ }
|
|
33
|
+
if (opts.json) {
|
|
34
|
+
out(JSON.stringify({ ...m, signed: receipt }, null, 2));
|
|
35
|
+
process.exitCode = m.verdict === "MORPHED" ? 0 : 2;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (m.verdict === "MORPHED" && m.capability) {
|
|
39
|
+
out(`🧬 morphed → ${m.capability.command} (confidence ${(m.confidence * 100).toFixed(0)}%)`);
|
|
40
|
+
if (m.capability.mcpTool)
|
|
41
|
+
out(` MCP tool: ${m.capability.mcpTool}`);
|
|
42
|
+
if (m.shape?.cli && m.shape.cli !== m.capability.command)
|
|
43
|
+
out(` CLI: ${m.shape.cli}`);
|
|
44
|
+
const argKeys = Object.keys(m.shape?.args ?? {}).filter((k) => k !== "intent");
|
|
45
|
+
if (argKeys.length)
|
|
46
|
+
out(` args: ${argKeys.map((k) => `${k}=${JSON.stringify((m.shape.args)[k])}`).join(" · ")}`);
|
|
47
|
+
if (m.capability.what)
|
|
48
|
+
out(` what: ${m.capability.what.slice(0, 160)}${m.capability.what.length > 160 ? "…" : ""}`);
|
|
49
|
+
}
|
|
50
|
+
else if (m.verdict === "CLARIFY") {
|
|
51
|
+
out(`❔ Not sure which capability — did you mean one of these?`);
|
|
52
|
+
for (const c of m.candidates)
|
|
53
|
+
out(` • ${c.command}${c.mcpTool ? ` (${c.mcpTool})` : ""} [${c.score.toFixed(2)}]`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
out(`❔ I couldn't morph that to a Mneme capability — try rephrasing, or 'mneme boot' to see what's possible.`);
|
|
57
|
+
}
|
|
58
|
+
process.exitCode = m.verdict === "MORPHED" ? 0 : 2;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=morph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morph.js","sourceRoot":"","sources":["../../src/commands/morph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA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CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzH,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI;gBAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7H,CAAC;aAAM,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACnC,GAAG,CAAC,0DAA0D,CAAC,CAAC;YAChE,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU;gBAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACxH,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,yGAAyG,CAAC,CAAC;QACjH,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,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":"AAqMA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqmNvD"}
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,7 @@ import { registerCrucibleCommands } from "./commands/crucible.js";
|
|
|
124
124
|
import { registerDriftCommands } from "./commands/drift.js";
|
|
125
125
|
import { registerGovernCommands } from "./commands/govern.js";
|
|
126
126
|
import { registerGatewayCommands } from "./commands/gateway.js";
|
|
127
|
+
import { registerMorphCommands } from "./commands/morph.js";
|
|
127
128
|
import { registerMyceliumCommands } from "./commands/mycelium.js";
|
|
128
129
|
import { registerSiegeCommands } from "./commands/siege.js";
|
|
129
130
|
import { registerCanonCommands } from "./commands/canon.js";
|
|
@@ -4805,6 +4806,7 @@ export async function run(argv) {
|
|
|
4805
4806
|
registerDriftCommands(program);
|
|
4806
4807
|
registerGovernCommands(program);
|
|
4807
4808
|
registerGatewayCommands(program);
|
|
4809
|
+
registerMorphCommands(program);
|
|
4808
4810
|
registerMyceliumCommands(program);
|
|
4809
4811
|
registerSiegeCommands(program);
|
|
4810
4812
|
registerCanonCommands(program);
|