@mneme-ai/core 2.3.1 → 2.4.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.
Files changed (159) hide show
  1. package/dist/aegis/consent_kernel.d.ts.map +1 -1
  2. package/dist/aegis/consent_kernel.js +6 -3
  3. package/dist/aegis/consent_kernel.js.map +1 -1
  4. package/dist/aegis/killswitch.d.ts.map +1 -1
  5. package/dist/aegis/killswitch.js +3 -1
  6. package/dist/aegis/killswitch.js.map +1 -1
  7. package/dist/agent_manifest.d.ts.map +1 -1
  8. package/dist/agent_manifest.js +9 -4
  9. package/dist/agent_manifest.js.map +1 -1
  10. package/dist/anchor/pole_id.d.ts.map +1 -1
  11. package/dist/anchor/pole_id.js +10 -2
  12. package/dist/anchor/pole_id.js.map +1 -1
  13. package/dist/apoptosis/witnesses.d.ts.map +1 -1
  14. package/dist/apoptosis/witnesses.js +8 -11
  15. package/dist/apoptosis/witnesses.js.map +1 -1
  16. package/dist/audit/merkle-chain.d.ts.map +1 -1
  17. package/dist/audit/merkle-chain.js +2 -1
  18. package/dist/audit/merkle-chain.js.map +1 -1
  19. package/dist/aura/pair_payload.d.ts.map +1 -1
  20. package/dist/aura/pair_payload.js +2 -1
  21. package/dist/aura/pair_payload.js.map +1 -1
  22. package/dist/autoboot/install_linux.d.ts +0 -1
  23. package/dist/autoboot/install_linux.d.ts.map +1 -1
  24. package/dist/autoboot/install_linux.js +37 -39
  25. package/dist/autoboot/install_linux.js.map +1 -1
  26. package/dist/autoboot/install_macos.d.ts +0 -1
  27. package/dist/autoboot/install_macos.d.ts.map +1 -1
  28. package/dist/autoboot/install_macos.js +43 -34
  29. package/dist/autoboot/install_macos.js.map +1 -1
  30. package/dist/autoboot/install_windows.d.ts +0 -1
  31. package/dist/autoboot/install_windows.d.ts.map +1 -1
  32. package/dist/autoboot/install_windows.js +25 -24
  33. package/dist/autoboot/install_windows.js.map +1 -1
  34. package/dist/avatar/gossip_mesh.d.ts.map +1 -1
  35. package/dist/avatar/gossip_mesh.js +2 -1
  36. package/dist/avatar/gossip_mesh.js.map +1 -1
  37. package/dist/avatar/replicating_wisdom.d.ts.map +1 -1
  38. package/dist/avatar/replicating_wisdom.js +2 -1
  39. package/dist/avatar/replicating_wisdom.js.map +1 -1
  40. package/dist/covenant/covenant.d.ts.map +1 -1
  41. package/dist/covenant/covenant.js +3 -1
  42. package/dist/covenant/covenant.js.map +1 -1
  43. package/dist/diaspora/session_capsule.d.ts.map +1 -1
  44. package/dist/diaspora/session_capsule.js +2 -1
  45. package/dist/diaspora/session_capsule.js.map +1 -1
  46. package/dist/evolve/synthesis/lineage.d.ts.map +1 -1
  47. package/dist/evolve/synthesis/lineage.js +2 -1
  48. package/dist/evolve/synthesis/lineage.js.map +1 -1
  49. package/dist/evolve/synthesis/synthesize.d.ts.map +1 -1
  50. package/dist/evolve/synthesis/synthesize.js +3 -1
  51. package/dist/evolve/synthesis/synthesize.js.map +1 -1
  52. package/dist/exodus/wanderer.d.ts.map +1 -1
  53. package/dist/exodus/wanderer.js +2 -1
  54. package/dist/exodus/wanderer.js.map +1 -1
  55. package/dist/genesplice/soul_prompt.d.ts.map +1 -1
  56. package/dist/genesplice/soul_prompt.js +16 -4
  57. package/dist/genesplice/soul_prompt.js.map +1 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +9 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/interstellar/index.d.ts.map +1 -1
  63. package/dist/interstellar/index.js +2 -1
  64. package/dist/interstellar/index.js.map +1 -1
  65. package/dist/lexicon/index.d.ts +1 -0
  66. package/dist/lexicon/index.d.ts.map +1 -1
  67. package/dist/lexicon/index.js +22 -0
  68. package/dist/lexicon/index.js.map +1 -1
  69. package/dist/lexicon/writer_routing.test.d.ts +2 -0
  70. package/dist/lexicon/writer_routing.test.d.ts.map +1 -0
  71. package/dist/lexicon/writer_routing.test.js +22 -0
  72. package/dist/lexicon/writer_routing.test.js.map +1 -0
  73. package/dist/living_will/index.d.ts.map +1 -1
  74. package/dist/living_will/index.js +2 -1
  75. package/dist/living_will/index.js.map +1 -1
  76. package/dist/parasite/bridge.d.ts.map +1 -1
  77. package/dist/parasite/bridge.js +10 -3
  78. package/dist/parasite/bridge.js.map +1 -1
  79. package/dist/precog/trust_certificate.d.ts.map +1 -1
  80. package/dist/precog/trust_certificate.js +2 -1
  81. package/dist/precog/trust_certificate.js.map +1 -1
  82. package/dist/prophecy/index.d.ts.map +1 -1
  83. package/dist/prophecy/index.js +2 -1
  84. package/dist/prophecy/index.js.map +1 -1
  85. package/dist/pulse.d.ts.map +1 -1
  86. package/dist/pulse.js +18 -4
  87. package/dist/pulse.js.map +1 -1
  88. package/dist/rainbow/passport.d.ts.map +1 -1
  89. package/dist/rainbow/passport.js +2 -1
  90. package/dist/rainbow/passport.js.map +1 -1
  91. package/dist/reactor/reactor_modules.d.ts.map +1 -1
  92. package/dist/reactor/reactor_modules.js +2 -1
  93. package/dist/reactor/reactor_modules.js.map +1 -1
  94. package/dist/security/audit-log.d.ts.map +1 -1
  95. package/dist/security/audit-log.js +4 -2
  96. package/dist/security/audit-log.js.map +1 -1
  97. package/dist/sentinel/audit_ledger.d.ts.map +1 -1
  98. package/dist/sentinel/audit_ledger.js +2 -1
  99. package/dist/sentinel/audit_ledger.js.map +1 -1
  100. package/dist/symbiosis/fusion.d.ts +46 -0
  101. package/dist/symbiosis/fusion.d.ts.map +1 -0
  102. package/dist/symbiosis/fusion.js +62 -0
  103. package/dist/symbiosis/fusion.js.map +1 -0
  104. package/dist/symbiosis/index.d.ts +25 -0
  105. package/dist/symbiosis/index.d.ts.map +1 -0
  106. package/dist/symbiosis/index.js +25 -0
  107. package/dist/symbiosis/index.js.map +1 -0
  108. package/dist/symbiosis/intent.d.ts +28 -0
  109. package/dist/symbiosis/intent.d.ts.map +1 -0
  110. package/dist/symbiosis/intent.js +63 -0
  111. package/dist/symbiosis/intent.js.map +1 -0
  112. package/dist/symbiosis/ledger.d.ts +54 -0
  113. package/dist/symbiosis/ledger.d.ts.map +1 -0
  114. package/dist/symbiosis/ledger.js +95 -0
  115. package/dist/symbiosis/ledger.js.map +1 -0
  116. package/dist/symbiosis/symbiosis.test.d.ts +2 -0
  117. package/dist/symbiosis/symbiosis.test.d.ts.map +1 -0
  118. package/dist/symbiosis/symbiosis.test.js +155 -0
  119. package/dist/symbiosis/symbiosis.test.js.map +1 -0
  120. package/dist/symbiosis/voice.d.ts +50 -0
  121. package/dist/symbiosis/voice.d.ts.map +1 -0
  122. package/dist/symbiosis/voice.js +121 -0
  123. package/dist/symbiosis/voice.js.map +1 -0
  124. package/dist/util/hmac_compare.d.ts +27 -0
  125. package/dist/util/hmac_compare.d.ts.map +1 -0
  126. package/dist/util/hmac_compare.js +43 -0
  127. package/dist/util/hmac_compare.js.map +1 -0
  128. package/dist/util/hmac_compare.test.d.ts +2 -0
  129. package/dist/util/hmac_compare.test.d.ts.map +1 -0
  130. package/dist/util/hmac_compare.test.js +30 -0
  131. package/dist/util/hmac_compare.test.js.map +1 -0
  132. package/dist/util/prompt_sanitize.d.ts +38 -0
  133. package/dist/util/prompt_sanitize.d.ts.map +1 -0
  134. package/dist/util/prompt_sanitize.js +78 -0
  135. package/dist/util/prompt_sanitize.js.map +1 -0
  136. package/dist/util/prompt_sanitize.test.d.ts +2 -0
  137. package/dist/util/prompt_sanitize.test.d.ts.map +1 -0
  138. package/dist/util/prompt_sanitize.test.js +58 -0
  139. package/dist/util/prompt_sanitize.test.js.map +1 -0
  140. package/dist/util/safe_exec.d.ts +66 -0
  141. package/dist/util/safe_exec.d.ts.map +1 -0
  142. package/dist/util/safe_exec.js +106 -0
  143. package/dist/util/safe_exec.js.map +1 -0
  144. package/dist/util/safe_exec.test.d.ts +2 -0
  145. package/dist/util/safe_exec.test.d.ts.map +1 -0
  146. package/dist/util/safe_exec.test.js +0 -0
  147. package/dist/util/safe_exec.test.js.map +1 -0
  148. package/dist/util/secret_store.d.ts +38 -0
  149. package/dist/util/secret_store.d.ts.map +1 -0
  150. package/dist/util/secret_store.js +100 -0
  151. package/dist/util/secret_store.js.map +1 -0
  152. package/dist/util/secret_store.test.d.ts +2 -0
  153. package/dist/util/secret_store.test.d.ts.map +1 -0
  154. package/dist/util/secret_store.test.js +54 -0
  155. package/dist/util/secret_store.test.js.map +1 -0
  156. package/dist/wisdom_shards/index.d.ts.map +1 -1
  157. package/dist/wisdom_shards/index.js +2 -1
  158. package/dist/wisdom_shards/index.js.map +1 -1
  159. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * v2.4.0 -- SYMBIOSIS · master facade.
3
+ *
4
+ * "Mneme should be a close friend to every AI model — not just a tool
5
+ * the AI calls, but a co-thinker that speaks the AI's own voice."
6
+ *
7
+ * Four cooperating layers:
8
+ * VOICE per-vendor verbosity / hedging / code-ratio / structure / formality
9
+ * INTENT shape an intent string the way the vendor prefers to read it
10
+ * LEDGER record which intents actually succeeded per vendor (Wilson LB)
11
+ * FUSION single paste-able bundle (voice + intents + lexicon + sha digest)
12
+ *
13
+ * SYMBIOSIS composes the four into one call: fuseWithVendor({vendor, intents}).
14
+ * The returned bundle is byte-stable for the same input (deterministic
15
+ * digest), so callers can cache it across turns.
16
+ *
17
+ * Pure functions. The optional ledger is the only mutable surface, and
18
+ * persistence is the caller's responsibility (so the daemon decides
19
+ * where to keep the JSONL).
20
+ */
21
+ export * from "./voice.js";
22
+ export * from "./intent.js";
23
+ export * from "./ledger.js";
24
+ export * from "./fusion.js";
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/symbiosis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * v2.4.0 -- SYMBIOSIS · INTENT SHAPER.
3
+ *
4
+ * Same intent, different surface. Claude likes named tools and verbal
5
+ * intent ("call mneme.flash.run before claiming a fact"). GPT likes
6
+ * function-call JSON. Gemini likes structured intent objects. Cursor
7
+ * wants the tool name inline in code-style backticks. SYMBIOSIS shapes
8
+ * the intent string to match the receiver — so Mneme's MCP tools resolve
9
+ * cleanly in every vendor without the AI having to reinterpret.
10
+ *
11
+ * This module is PURE — it does not invoke tools, it only RENDERS the
12
+ * intent in vendor-preferred shape. The actual tool routing is done by
13
+ * v2.1 TOOL SELECTOR.
14
+ */
15
+ import type { VoiceProfile } from "./voice.js";
16
+ export interface IntentShape {
17
+ /** Tool name in canonical form (mneme.flash.run). */
18
+ tool: string;
19
+ /** Short reason (one sentence) the receiver should run it. */
20
+ reason: string;
21
+ /** Optional arg map. */
22
+ args?: Record<string, string>;
23
+ }
24
+ /** Render the intent in the shape this vendor prefers. */
25
+ export declare function shapeIntent(intent: IntentShape, voice: VoiceProfile): string;
26
+ /** Bulk-shape a list of intents. The voice-profile choice happens once. */
27
+ export declare function shapeIntents(intents: IntentShape[], voice: VoiceProfile): string[];
28
+ //# sourceMappingURL=intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../src/symbiosis/intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAe5E;AAgCD,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAElF"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * v2.4.0 -- SYMBIOSIS · INTENT SHAPER.
3
+ *
4
+ * Same intent, different surface. Claude likes named tools and verbal
5
+ * intent ("call mneme.flash.run before claiming a fact"). GPT likes
6
+ * function-call JSON. Gemini likes structured intent objects. Cursor
7
+ * wants the tool name inline in code-style backticks. SYMBIOSIS shapes
8
+ * the intent string to match the receiver — so Mneme's MCP tools resolve
9
+ * cleanly in every vendor without the AI having to reinterpret.
10
+ *
11
+ * This module is PURE — it does not invoke tools, it only RENDERS the
12
+ * intent in vendor-preferred shape. The actual tool routing is done by
13
+ * v2.1 TOOL SELECTOR.
14
+ */
15
+ /** Render the intent in the shape this vendor prefers. */
16
+ export function shapeIntent(intent, voice) {
17
+ const v = voice.vendor.toLowerCase();
18
+ if (v === "claude" || v === "anthropic") {
19
+ return claudeShape(intent);
20
+ }
21
+ if (v === "gpt" || v === "openai" || v === "chatgpt") {
22
+ return gptShape(intent);
23
+ }
24
+ if (v === "gemini" || v === "google") {
25
+ return geminiShape(intent);
26
+ }
27
+ if (v === "cursor" || v === "codex") {
28
+ return cursorShape(intent);
29
+ }
30
+ return genericShape(intent);
31
+ }
32
+ function claudeShape(i) {
33
+ const args = i.args ? Object.entries(i.args).map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(", ") : "";
34
+ const argStr = args ? ` with ${args}` : "";
35
+ return `Call ${i.tool}${argStr} — ${i.reason}.`;
36
+ }
37
+ function gptShape(i) {
38
+ if (!i.args)
39
+ return JSON.stringify({ tool: i.tool, reason: i.reason });
40
+ return JSON.stringify({ tool: i.tool, reason: i.reason, args: i.args });
41
+ }
42
+ function geminiShape(i) {
43
+ const lines = [`### Tool: ${i.tool}`, `Why: ${i.reason}`];
44
+ if (i.args) {
45
+ lines.push("Args:");
46
+ for (const [k, v] of Object.entries(i.args))
47
+ lines.push(`- ${k}: ${v}`);
48
+ }
49
+ return lines.join("\n");
50
+ }
51
+ function cursorShape(i) {
52
+ const args = i.args ? " " + Object.entries(i.args).map(([k, v]) => `${k}=${v}`).join(" ") : "";
53
+ return `\`${i.tool}${args}\` // ${i.reason}`;
54
+ }
55
+ function genericShape(i) {
56
+ const args = i.args ? ` (${Object.entries(i.args).map(([k, v]) => `${k}=${v}`).join(", ")})` : "";
57
+ return `${i.tool}${args} — ${i.reason}`;
58
+ }
59
+ /** Bulk-shape a list of intents. The voice-profile choice happens once. */
60
+ export function shapeIntents(intents, voice) {
61
+ return intents.map((i) => shapeIntent(i, voice));
62
+ }
63
+ //# sourceMappingURL=intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.js","sourceRoot":"","sources":["../../src/symbiosis/intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAaH,0DAA0D;AAC1D,MAAM,UAAU,WAAW,CAAC,MAAmB,EAAE,KAAmB;IAClE,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,WAAW,EAAE,CAAC;QACxC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,YAAY,CAAC,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/**
2
+ * v2.4.0 -- SYMBIOSIS · PER-VENDOR SUCCESS LEDGER.
3
+ *
4
+ * After Mneme phrases an intent in vendor-preferred shape (via INTENT
5
+ * SHAPER) and ships it, the receiving AI either DOES the right thing
6
+ * (called the right tool, produced the right answer) or DOESN'T. The
7
+ * ledger records the outcome. Over time we learn which intent shapes
8
+ * actually work for each vendor — and reinforce the winners.
9
+ *
10
+ * Pure in-memory store with optional caller-supplied persistence. The
11
+ * caller (CLI / daemon) decides where to keep the ledger on disk so
12
+ * SYMBIOSIS itself remains free of filesystem coupling.
13
+ */
14
+ export type IntentOutcome = "succeeded" | "wrong-tool" | "no-call" | "refused";
15
+ export interface IntentTrial {
16
+ vendor: string;
17
+ tool: string;
18
+ shape: string;
19
+ outcome: IntentOutcome;
20
+ ts: number;
21
+ }
22
+ export interface IntentStat {
23
+ vendor: string;
24
+ tool: string;
25
+ trials: number;
26
+ succeeded: number;
27
+ rate: number;
28
+ /** Wilson lower bound of success rate at 95% conf — a calibrated estimate
29
+ * that doesn't over-trust a single lucky trial. */
30
+ wilson: number;
31
+ }
32
+ export declare class IntentLedger {
33
+ private readonly trials;
34
+ constructor(initial?: IntentTrial[]);
35
+ record(trial: IntentTrial): void;
36
+ /** All trials, newest first. */
37
+ list(): IntentTrial[];
38
+ /** Aggregate trials per (vendor, tool) pair. */
39
+ stats(): IntentStat[];
40
+ /** Per-vendor recommendation: which tools have the highest Wilson LB. */
41
+ recommendTools(vendor: string, topK?: number): IntentStat[];
42
+ /** Cross-vendor lift: which tool benefits most from per-vendor shaping. */
43
+ shapingLift(): Array<{
44
+ tool: string;
45
+ bestVendor: string;
46
+ worstVendor: string;
47
+ lift: number;
48
+ }>;
49
+ /** Serialize for persistence. */
50
+ serialize(): string;
51
+ /** Parse a previously-serialized ledger. */
52
+ static parse(text: string): IntentLedger;
53
+ }
54
+ //# sourceMappingURL=ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":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R SUCCESS LEDGER.
3
+ *
4
+ * After Mneme phrases an intent in vendor-preferred shape (via INTENT
5
+ * SHAPER) and ships it, the receiving AI either DOES the right thing
6
+ * (called the right tool, produced the right answer) or DOESN'T. The
7
+ * ledger records the outcome. Over time we learn which intent shapes
8
+ * actually work for each vendor — and reinforce the winners.
9
+ *
10
+ * Pure in-memory store with optional caller-supplied persistence. The
11
+ * caller (CLI / daemon) decides where to keep the ledger on disk so
12
+ * SYMBIOSIS itself remains free of filesystem coupling.
13
+ */
14
+ /** Wilson lower bound of a binary success rate at 95% confidence. */
15
+ function wilsonLower(succ, total) {
16
+ if (total === 0)
17
+ return 0;
18
+ const z = 1.96;
19
+ const p = succ / total;
20
+ const denom = 1 + (z * z) / total;
21
+ const center = p + (z * z) / (2 * total);
22
+ const margin = z * Math.sqrt((p * (1 - p) + (z * z) / (4 * total)) / total);
23
+ return Math.max(0, Math.min(1, (center - margin) / denom));
24
+ }
25
+ export class IntentLedger {
26
+ trials = [];
27
+ constructor(initial = []) {
28
+ this.trials = initial.slice();
29
+ }
30
+ record(trial) {
31
+ this.trials.push(trial);
32
+ }
33
+ /** All trials, newest first. */
34
+ list() {
35
+ return this.trials.slice().reverse();
36
+ }
37
+ /** Aggregate trials per (vendor, tool) pair. */
38
+ stats() {
39
+ const map = new Map();
40
+ for (const t of this.trials) {
41
+ const k = `${t.vendor}::${t.tool}`;
42
+ const e = map.get(k) ?? { vendor: t.vendor, tool: t.tool, trials: 0, succeeded: 0 };
43
+ e.trials++;
44
+ if (t.outcome === "succeeded")
45
+ e.succeeded++;
46
+ map.set(k, e);
47
+ }
48
+ return Array.from(map.values()).map((e) => ({
49
+ ...e,
50
+ rate: e.trials > 0 ? e.succeeded / e.trials : 0,
51
+ wilson: wilsonLower(e.succeeded, e.trials),
52
+ }));
53
+ }
54
+ /** Per-vendor recommendation: which tools have the highest Wilson LB. */
55
+ recommendTools(vendor, topK = 5) {
56
+ return this.stats()
57
+ .filter((s) => s.vendor === vendor)
58
+ .sort((a, b) => b.wilson - a.wilson)
59
+ .slice(0, topK);
60
+ }
61
+ /** Cross-vendor lift: which tool benefits most from per-vendor shaping. */
62
+ shapingLift() {
63
+ const byTool = new Map();
64
+ for (const s of this.stats()) {
65
+ (byTool.get(s.tool) ?? byTool.set(s.tool, []).get(s.tool)).push(s);
66
+ }
67
+ const out = [];
68
+ for (const [tool, stats] of byTool.entries()) {
69
+ if (stats.length < 2)
70
+ continue;
71
+ const sorted = stats.slice().sort((a, b) => b.wilson - a.wilson);
72
+ const best = sorted[0];
73
+ const worst = sorted[sorted.length - 1];
74
+ out.push({ tool, bestVendor: best.vendor, worstVendor: worst.vendor, lift: best.wilson - worst.wilson });
75
+ }
76
+ return out.sort((a, b) => b.lift - a.lift);
77
+ }
78
+ /** Serialize for persistence. */
79
+ serialize() {
80
+ return JSON.stringify(this.trials);
81
+ }
82
+ /** Parse a previously-serialized ledger. */
83
+ static parse(text) {
84
+ try {
85
+ const arr = JSON.parse(text);
86
+ if (!Array.isArray(arr))
87
+ return new IntentLedger();
88
+ return new IntentLedger(arr);
89
+ }
90
+ catch {
91
+ return new IntentLedger();
92
+ }
93
+ }
94
+ }
95
+ //# sourceMappingURL=ledger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/symbiosis/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,qEAAqE;AACrE,SAAS,WAAW,CAAC,IAAY,EAAE,KAAa;IAC9C,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC1B,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;IACvB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,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YACP,OAAO,IAAI,YAAY,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=symbiosis.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbiosis.test.d.ts","sourceRoot":"","sources":["../../src/symbiosis/symbiosis.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,155 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { voiceForVendor, renderVoiceDirective, voiceDistance, shapeIntent, shapeIntents, IntentLedger, fuseWithVendor, verifyFusion, formatFusionPulseLine, VOICE_CLAUDE, VOICE_GPT, VOICE_GEMINI, VOICE_CURSOR, } from "./index.js";
3
+ describe("v2.4 SYMBIOSIS · voice tuner", () => {
4
+ it("voiceForVendor maps known vendors", () => {
5
+ expect(voiceForVendor("Claude").vendor).toBe("claude");
6
+ expect(voiceForVendor("Anthropic Claude").vendor).toBe("claude");
7
+ expect(voiceForVendor("gpt-4").vendor).toBe("gpt");
8
+ expect(voiceForVendor("ChatGPT").vendor).toBe("gpt");
9
+ expect(voiceForVendor("Gemini Pro").vendor).toBe("gemini");
10
+ expect(voiceForVendor("Cursor").vendor).toBe("cursor");
11
+ expect(voiceForVendor("Codex").vendor).toBe("codex");
12
+ expect(voiceForVendor("unknown-vendor").vendor).toBe("generic");
13
+ });
14
+ it("renderVoiceDirective produces a one-liner per profile", () => {
15
+ const claude = renderVoiceDirective(VOICE_CLAUDE);
16
+ const cursor = renderVoiceDirective(VOICE_CURSOR);
17
+ expect(claude).toContain("claude");
18
+ expect(cursor).toContain("cursor");
19
+ // Cursor is terse-coded → directive should say so
20
+ expect(cursor).toMatch(/terse|concise/);
21
+ expect(cursor).toMatch(/code-first|code only/);
22
+ });
23
+ it("voiceDistance: same profile is 0", () => {
24
+ expect(voiceDistance(VOICE_CLAUDE, VOICE_CLAUDE)).toBe(0);
25
+ });
26
+ it("voiceDistance: Cursor vs Gemini is larger than Cursor vs Codex", () => {
27
+ const farther = voiceDistance(VOICE_CURSOR, VOICE_GEMINI);
28
+ const closer = voiceDistance(VOICE_CURSOR, voiceForVendor("codex"));
29
+ expect(closer).toBeLessThan(farther);
30
+ });
31
+ });
32
+ describe("v2.4 SYMBIOSIS · intent shaper", () => {
33
+ const intent = {
34
+ tool: "mneme.flash.run",
35
+ reason: "verify the factual claim before stating it",
36
+ args: { veff_min: "0.5" },
37
+ };
38
+ it("Claude shape: imperative natural-language", () => {
39
+ const out = shapeIntent(intent, VOICE_CLAUDE);
40
+ expect(out).toContain("mneme.flash.run");
41
+ expect(out.toLowerCase()).toContain("call");
42
+ });
43
+ it("GPT shape: JSON-encoded", () => {
44
+ const out = shapeIntent(intent, VOICE_GPT);
45
+ const parsed = JSON.parse(out);
46
+ expect(parsed.tool).toBe("mneme.flash.run");
47
+ expect(parsed.args).toEqual({ veff_min: "0.5" });
48
+ });
49
+ it("Gemini shape: structured list with headers", () => {
50
+ const out = shapeIntent(intent, VOICE_GEMINI);
51
+ expect(out).toContain("### Tool: mneme.flash.run");
52
+ expect(out).toContain("- veff_min: 0.5");
53
+ });
54
+ it("Cursor shape: backtick-wrapped command", () => {
55
+ const out = shapeIntent(intent, VOICE_CURSOR);
56
+ expect(out).toContain("`mneme.flash.run");
57
+ expect(out).toContain("//");
58
+ });
59
+ it("shapeIntents bulk-applies same voice", () => {
60
+ const out = shapeIntents([intent, intent], VOICE_GPT);
61
+ expect(out.length).toBe(2);
62
+ expect(out.every((s) => JSON.parse(s).tool === "mneme.flash.run")).toBe(true);
63
+ });
64
+ });
65
+ describe("v2.4 SYMBIOSIS · ledger", () => {
66
+ it("records trials + aggregates per (vendor, tool)", () => {
67
+ const led = new IntentLedger();
68
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "succeeded", ts: 1 });
69
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "succeeded", ts: 2 });
70
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "wrong-tool", ts: 3 });
71
+ const s = led.stats();
72
+ expect(s.length).toBe(1);
73
+ expect(s[0].trials).toBe(3);
74
+ expect(s[0].succeeded).toBe(2);
75
+ expect(s[0].rate).toBeCloseTo(0.6667, 3);
76
+ expect(s[0].wilson).toBeGreaterThan(0);
77
+ expect(s[0].wilson).toBeLessThan(s[0].rate); // Wilson LB is conservative
78
+ });
79
+ it("recommendTools per vendor: high-Wilson tools rank first", () => {
80
+ const led = new IntentLedger();
81
+ for (let i = 0; i < 10; i++)
82
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "succeeded", ts: i });
83
+ for (let i = 0; i < 5; i++)
84
+ led.record({ vendor: "claude", tool: "mneme.memory.ask", shape: "y", outcome: "succeeded", ts: 100 + i });
85
+ for (let i = 0; i < 5; i++)
86
+ led.record({ vendor: "claude", tool: "mneme.memory.ask", shape: "y", outcome: "no-call", ts: 200 + i });
87
+ const rec = led.recommendTools("claude", 5);
88
+ expect(rec[0].tool).toBe("mneme.flash.run");
89
+ });
90
+ it("shapingLift identifies tools that benefit most from per-vendor shaping", () => {
91
+ const led = new IntentLedger();
92
+ for (let i = 0; i < 10; i++)
93
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "succeeded", ts: i });
94
+ for (let i = 0; i < 10; i++)
95
+ led.record({ vendor: "gpt", tool: "mneme.flash.run", shape: "y", outcome: "no-call", ts: i });
96
+ const lift = led.shapingLift();
97
+ expect(lift.length).toBe(1);
98
+ expect(lift[0].tool).toBe("mneme.flash.run");
99
+ expect(lift[0].bestVendor).toBe("claude");
100
+ expect(lift[0].worstVendor).toBe("gpt");
101
+ expect(lift[0].lift).toBeGreaterThan(0.5);
102
+ });
103
+ it("serialize / parse round-trips", () => {
104
+ const led = new IntentLedger();
105
+ led.record({ vendor: "claude", tool: "mneme.flash.run", shape: "x", outcome: "succeeded", ts: 1 });
106
+ const text = led.serialize();
107
+ const led2 = IntentLedger.parse(text);
108
+ expect(led2.list().length).toBe(1);
109
+ expect(led2.list()[0].tool).toBe("mneme.flash.run");
110
+ });
111
+ it("parse handles garbage gracefully", () => {
112
+ expect(IntentLedger.parse("not json").list().length).toBe(0);
113
+ expect(IntentLedger.parse('{"not":"array"}').list().length).toBe(0);
114
+ });
115
+ });
116
+ describe("v2.4 SYMBIOSIS · fusion bundle", () => {
117
+ const intents = [
118
+ { tool: "mneme.flash.run", reason: "verify the factual claim" },
119
+ { tool: "mneme.memory.ask", reason: "look up prior context" },
120
+ ];
121
+ it("fuseWithVendor produces a stable digest for the same input", () => {
122
+ const a = fuseWithVendor({ vendor: "claude", intents });
123
+ const b = fuseWithVendor({ vendor: "claude", intents });
124
+ expect(a.digest).toBe(b.digest);
125
+ expect(a.rendered).toBe(b.rendered);
126
+ });
127
+ it("different vendors → different rendered bytes", () => {
128
+ const a = fuseWithVendor({ vendor: "claude", intents });
129
+ const b = fuseWithVendor({ vendor: "gpt", intents });
130
+ expect(a.digest).not.toBe(b.digest);
131
+ expect(a.voice.vendor).toBe("claude");
132
+ expect(b.voice.vendor).toBe("gpt");
133
+ });
134
+ it("anthropic vendor → bundle contains no MUTINY/SEPPUKU/killswitch raw bytes", () => {
135
+ const intentsWithRisk = [
136
+ { tool: "mneme.mutiny.check", reason: "block requests matching MUTINY pattern" },
137
+ ];
138
+ const b = fuseWithVendor({ vendor: "claude", intents: intentsWithRisk });
139
+ expect(b.rendered).not.toMatch(/MUTINY/);
140
+ // The fused output uses the COMPLIANCE-GATE alias from PROFILE_ANTHROPIC.
141
+ expect(b.rendered).toMatch(/COMPLIANCE-GATE|compliance_gate/);
142
+ });
143
+ it("verifyFusion detects untampered bundles", () => {
144
+ const b = fuseWithVendor({ vendor: "claude", intents });
145
+ expect(verifyFusion(b, { vendor: "claude", intents })).toBe(true);
146
+ });
147
+ it("formatFusionPulseLine emits a one-line summary with sha prefix", () => {
148
+ const b = fuseWithVendor({ vendor: "claude", intents });
149
+ const line = formatFusionPulseLine(b);
150
+ expect(line).toContain("SYMBIOSIS");
151
+ expect(line).toContain("vendor=claude");
152
+ expect(line).toContain("sha256=");
153
+ });
154
+ });
155
+ //# sourceMappingURL=symbiosis.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbiosis.test.js","sourceRoot":"","sources":["../../src/symbiosis/symbiosis.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,cAAc,EAAE,oBAAoB,EAAE,aAAa,EACnD,WAAW,EAAE,YAAY,EACzB,YAAY,EACZ,cAAc,EAAE,YAAY,EAAE,qBAAqB,EACnD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,GAEpD,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrD,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC3D,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC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AC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * v2.4.0 -- SYMBIOSIS · VOICE TUNER.
3
+ *
4
+ * Every AI has a personality. Claude is hedgy and verbose; GPT is
5
+ * confident and concise; Gemini likes structured lists; Cursor wants
6
+ * compact code-block-heavy answers. When Mneme writes content that
7
+ * an AI will read (a soul prompt, a pulse banner, a tool description),
8
+ * it should match the receiver's voice. Otherwise the AI re-formats
9
+ * the input on the fly and burns tokens + drifts meaning.
10
+ *
11
+ * VOICE PROFILE — five axes per vendor:
12
+ * verbosity 0..1 how dense to write (low = punchy; high = wordy)
13
+ * hedging 0..1 density of "may / might / depending on" qualifiers
14
+ * codeRatio 0..1 share of output that should be code blocks vs prose
15
+ * structureBias 0..1 bullet-list / table preference (low = paragraphs)
16
+ * formalityBias 0..1 tone register (low = casual; high = formal)
17
+ *
18
+ * Source of profiles: empirical observation across our own AGENT
19
+ * COMMAND MANIFEST + per-vendor pulse template logs (v1.42). Profiles
20
+ * can be overridden by .mneme/symbiosis-voice.json — same shape.
21
+ */
22
+ export interface VoiceProfile {
23
+ vendor: string;
24
+ /** 0..1 — preferred output density. */
25
+ verbosity: number;
26
+ /** 0..1 — density of qualifier words. */
27
+ hedging: number;
28
+ /** 0..1 — share of output as code blocks. */
29
+ codeRatio: number;
30
+ /** 0..1 — bullet-list / table bias. */
31
+ structureBias: number;
32
+ /** 0..1 — tone register. */
33
+ formalityBias: number;
34
+ }
35
+ export declare const VOICE_CLAUDE: VoiceProfile;
36
+ export declare const VOICE_GPT: VoiceProfile;
37
+ export declare const VOICE_GEMINI: VoiceProfile;
38
+ export declare const VOICE_CURSOR: VoiceProfile;
39
+ export declare const VOICE_CODEX: VoiceProfile;
40
+ export declare const VOICE_GENERIC: VoiceProfile;
41
+ export declare const BUILTIN_VOICES: VoiceProfile[];
42
+ export declare function voiceForVendor(vendor: string): VoiceProfile;
43
+ /** A short, AI-readable directive that primes the receiver to write
44
+ * in the requested voice. Drops into a soul prompt or system prompt. */
45
+ export declare function renderVoiceDirective(profile: VoiceProfile): string;
46
+ /** Compose a numeric "voice distance" between two profiles 0..1.
47
+ * Used by the success ledger to decide whether a prompt that worked
48
+ * for one vendor is likely to work for another. */
49
+ export declare function voiceDistance(a: VoiceProfile, b: VoiceProfile): number;
50
+ //# sourceMappingURL=voice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/symbiosis/voice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,YAOvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAO3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAAY,EAOxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAQ3D;AAED;yEACyE;AACzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAkBlE;AAED;;oDAEoD;AACpD,wBAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,MAAM,CAQtE"}