@mneme-ai/mcp 1.17.6 → 1.19.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/README.md +64 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp_primitives/completion.d.ts +19 -0
- package/dist/mcp_primitives/completion.d.ts.map +1 -0
- package/dist/mcp_primitives/completion.js +55 -0
- package/dist/mcp_primitives/completion.js.map +1 -0
- package/dist/mcp_primitives/prompts.d.ts +36 -0
- package/dist/mcp_primitives/prompts.d.ts.map +1 -0
- package/dist/mcp_primitives/prompts.js +140 -0
- package/dist/mcp_primitives/prompts.js.map +1 -0
- package/dist/mcp_primitives/resources.d.ts +30 -0
- package/dist/mcp_primitives/resources.d.ts.map +1 -0
- package/dist/mcp_primitives/resources.js +127 -0
- package/dist/mcp_primitives/resources.js.map +1 -0
- package/dist/tools/_aletheia.d.ts +82 -0
- package/dist/tools/_aletheia.d.ts.map +1 -0
- package/dist/tools/_aletheia.js +800 -0
- package/dist/tools/_aletheia.js.map +1 -0
- package/dist/tools/_confess.d.ts +67 -0
- package/dist/tools/_confess.d.ts.map +1 -0
- package/dist/tools/_confess.js +260 -0
- package/dist/tools/_confess.js.map +1 -0
- package/dist/tools/_confess.test.d.ts +6 -0
- package/dist/tools/_confess.test.d.ts.map +1 -0
- package/dist/tools/_confess.test.js +96 -0
- package/dist/tools/_confess.test.js.map +1 -0
- package/dist/tools/_contract.test.d.ts +19 -0
- package/dist/tools/_contract.test.d.ts.map +1 -0
- package/dist/tools/_contract.test.js +117 -0
- package/dist/tools/_contract.test.js.map +1 -0
- package/dist/tools/_court.d.ts +57 -0
- package/dist/tools/_court.d.ts.map +1 -0
- package/dist/tools/_court.js +261 -0
- package/dist/tools/_court.js.map +1 -0
- package/dist/tools/_court.test.d.ts +8 -0
- package/dist/tools/_court.test.d.ts.map +1 -0
- package/dist/tools/_court.test.js +111 -0
- package/dist/tools/_court.test.js.map +1 -0
- package/dist/tools/_genome_marketplace.d.ts +83 -0
- package/dist/tools/_genome_marketplace.d.ts.map +1 -0
- package/dist/tools/_genome_marketplace.js +410 -0
- package/dist/tools/_genome_marketplace.js.map +1 -0
- package/dist/tools/_genome_marketplace.test.d.ts +5 -0
- package/dist/tools/_genome_marketplace.test.d.ts.map +1 -0
- package/dist/tools/_genome_marketplace.test.js +157 -0
- package/dist/tools/_genome_marketplace.test.js.map +1 -0
- package/dist/tools/_lineage.d.ts +35 -0
- package/dist/tools/_lineage.d.ts.map +1 -0
- package/dist/tools/_lineage.js +782 -0
- package/dist/tools/_lineage.js.map +1 -0
- package/dist/tools/_mesh.d.ts +51 -0
- package/dist/tools/_mesh.d.ts.map +1 -0
- package/dist/tools/_mesh.js +182 -0
- package/dist/tools/_mesh.js.map +1 -0
- package/dist/tools/_registry.d.ts.map +1 -1
- package/dist/tools/_registry.js +19 -0
- package/dist/tools/_registry.js.map +1 -1
- package/dist/tools/_replay.d.ts +52 -0
- package/dist/tools/_replay.d.ts.map +1 -0
- package/dist/tools/_replay.js +253 -0
- package/dist/tools/_replay.js.map +1 -0
- package/dist/tools/_replay.test.d.ts +5 -0
- package/dist/tools/_replay.test.d.ts.map +1 -0
- package/dist/tools/_replay.test.js +90 -0
- package/dist/tools/_replay.test.js.map +1 -0
- package/dist/tools/_timetravel.d.ts +46 -0
- package/dist/tools/_timetravel.d.ts.map +1 -0
- package/dist/tools/_timetravel.js +243 -0
- package/dist/tools/_timetravel.js.map +1 -0
- package/dist/tools/_timetravel.test.d.ts +7 -0
- package/dist/tools/_timetravel.test.d.ts.map +1 -0
- package/dist/tools/_timetravel.test.js +31 -0
- package/dist/tools/_timetravel.test.js.map +1 -0
- package/dist/tools/_tool_meta.d.ts +30 -0
- package/dist/tools/_tool_meta.d.ts.map +1 -0
- package/dist/tools/_tool_meta.js +530 -0
- package/dist/tools/_tool_meta.js.map +1 -0
- package/dist/tools/_types.d.ts +46 -5
- package/dist/tools/_types.d.ts.map +1 -1
- package/dist/tools/_types.js.map +1 -1
- package/dist/tools/_verify_claims_tool.d.ts.map +1 -1
- package/dist/tools/_verify_claims_tool.js +23 -0
- package/dist/tools/_verify_claims_tool.js.map +1 -1
- package/dist/tools/audit.d.ts.map +1 -1
- package/dist/tools/audit.js +37 -0
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +23 -0
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/quant.d.ts +10 -2
- package/dist/tools/quant.d.ts.map +1 -1
- package/dist/tools/quant.js +311 -18
- package/dist/tools/quant.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genome Marketplace (v1.18.0 — black sheep #4)
|
|
3
|
+
*
|
|
4
|
+
* Pack the team's accumulated `.mneme/` wisdom (constitution, custom packs,
|
|
5
|
+
* library molecules, voice fingerprint) into a portable, signed,
|
|
6
|
+
* PII-scrubbed `.mneme-genome.json` file. Other teams `install` it to
|
|
7
|
+
* inherit conventions — `npm install` for engineering wisdom.
|
|
8
|
+
*
|
|
9
|
+
* • mneme.genome.publish(outputPath?) — pack repo's .mneme/ into a genome
|
|
10
|
+
* • mneme.genome.install(genomeFile) — apply a genome to the current repo
|
|
11
|
+
* • mneme.genome.list — enumerate genomes installed locally
|
|
12
|
+
*
|
|
13
|
+
* Privacy model:
|
|
14
|
+
* • Email addresses scrubbed → "<email>@<domain>" placeholder
|
|
15
|
+
* • Absolute paths inside the repo → relative
|
|
16
|
+
* • SHA-256 commit hashes preserved (already non-identifying)
|
|
17
|
+
* • Author NAMES preserved (they're public via git log anyway)
|
|
18
|
+
*
|
|
19
|
+
* Signature model:
|
|
20
|
+
* • Each genome carries a SHA-256 of its content + a publishedBy field
|
|
21
|
+
* • `install` verifies the hash before applying — corrupt genomes
|
|
22
|
+
* trigger an error
|
|
23
|
+
* • Genomes from untrusted sources should be reviewed before install
|
|
24
|
+
* (we surface the diff in the install handler so the agent / user
|
|
25
|
+
* can reject)
|
|
26
|
+
*/
|
|
27
|
+
import type { MnemeTool } from "./_types.js";
|
|
28
|
+
interface GenomeFile {
|
|
29
|
+
name: string;
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Genome {
|
|
33
|
+
/** Schema version of this genome format. */
|
|
34
|
+
schemaVersion: 1;
|
|
35
|
+
/** Genome unique identifier — defaults to {repoName}-{date}. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Free-text title surfaced when listing. */
|
|
38
|
+
title: string;
|
|
39
|
+
/** Plain-English description: what this genome teaches. */
|
|
40
|
+
description: string;
|
|
41
|
+
/** ISO timestamp when this genome was packed. */
|
|
42
|
+
publishedAt: string;
|
|
43
|
+
/** Author or organization that published — free-text label. */
|
|
44
|
+
publishedBy: string;
|
|
45
|
+
/** Mneme version that packed this genome. */
|
|
46
|
+
mnemeVersion: string;
|
|
47
|
+
/** SHA-256 of the JSON-stringified files array — tamper detection. */
|
|
48
|
+
contentHash: string;
|
|
49
|
+
/** Files included in the genome — paths relative to .mneme/. */
|
|
50
|
+
files: GenomeFile[];
|
|
51
|
+
}
|
|
52
|
+
declare const GENOME_PATTERN: RegExp;
|
|
53
|
+
export declare function packGenome(repoRoot: string, repoName: string, mnemeVersion: string, opts?: {
|
|
54
|
+
title?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
publishedBy?: string;
|
|
57
|
+
}): Genome;
|
|
58
|
+
export declare function verifyGenome(g: Genome): {
|
|
59
|
+
valid: boolean;
|
|
60
|
+
reason?: string;
|
|
61
|
+
};
|
|
62
|
+
export interface InstallResult {
|
|
63
|
+
installed: number;
|
|
64
|
+
skipped: number;
|
|
65
|
+
conflicts: string[];
|
|
66
|
+
installedFiles: string[];
|
|
67
|
+
}
|
|
68
|
+
export declare function installGenome(repoRoot: string, genome: Genome, opts?: {
|
|
69
|
+
force?: boolean;
|
|
70
|
+
}): InstallResult;
|
|
71
|
+
interface InstalledGenomeRecord {
|
|
72
|
+
id: string;
|
|
73
|
+
installedAt: string;
|
|
74
|
+
source: string;
|
|
75
|
+
contentHash: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function listInstalledGenomes(repoRoot: string): InstalledGenomeRecord[];
|
|
78
|
+
export declare const genomePublishTool: MnemeTool;
|
|
79
|
+
export declare const genomeInstallTool: MnemeTool;
|
|
80
|
+
export declare const genomeListTool: MnemeTool;
|
|
81
|
+
export declare const genomeMarketplaceTools: MnemeTool[];
|
|
82
|
+
export { GENOME_PATTERN };
|
|
83
|
+
//# sourceMappingURL=_genome_marketplace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_genome_marketplace.d.ts","sourceRoot":"","sources":["../../src/tools/_genome_marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,MAAM;IACrB,4CAA4C;IAC5C,aAAa,EAAE,CAAC,CAAC;IACjB,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAGD,QAAA,MAAM,cAAc,QAA0C,CAAC;AAwE/D,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,QAAQ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
5
|
+
* library molecules, voice fingerprint) into a portable, signed,
|
|
6
|
+
* PII-scrubbed `.mneme-genome.json` file. Other teams `install` it to
|
|
7
|
+
* inherit conventions — `npm install` for engineering wisdom.
|
|
8
|
+
*
|
|
9
|
+
* • mneme.genome.publish(outputPath?) — pack repo's .mneme/ into a genome
|
|
10
|
+
* • mneme.genome.install(genomeFile) — apply a genome to the current repo
|
|
11
|
+
* • mneme.genome.list — enumerate genomes installed locally
|
|
12
|
+
*
|
|
13
|
+
* Privacy model:
|
|
14
|
+
* • Email addresses scrubbed → "<email>@<domain>" placeholder
|
|
15
|
+
* • Absolute paths inside the repo → relative
|
|
16
|
+
* • SHA-256 commit hashes preserved (already non-identifying)
|
|
17
|
+
* • Author NAMES preserved (they're public via git log anyway)
|
|
18
|
+
*
|
|
19
|
+
* Signature model:
|
|
20
|
+
* • Each genome carries a SHA-256 of its content + a publishedBy field
|
|
21
|
+
* • `install` verifies the hash before applying — corrupt genomes
|
|
22
|
+
* trigger an error
|
|
23
|
+
* • Genomes from untrusted sources should be reviewed before install
|
|
24
|
+
* (we surface the diff in the install handler so the agent / user
|
|
25
|
+
* can reject)
|
|
26
|
+
*/
|
|
27
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, statSync, } from "node:fs";
|
|
28
|
+
import { join, basename, isAbsolute, resolve as pathResolve, relative } from "node:path";
|
|
29
|
+
import { createHash } from "node:crypto";
|
|
30
|
+
const GENOME_DIR = ".mneme/genomes";
|
|
31
|
+
const GENOME_PATTERN = /\.(mneme-genome\.json|genome\.json)$/i;
|
|
32
|
+
/** Files inside .mneme/ we ship in a genome by default. Other files
|
|
33
|
+
* are skipped (e.g. mneme.db, replay.jsonl, confess-scoreboard.json
|
|
34
|
+
* — local runtime state, not portable wisdom). */
|
|
35
|
+
const PORTABLE_PATHS = [
|
|
36
|
+
"constitution.json",
|
|
37
|
+
"constitution.md",
|
|
38
|
+
"tribal-knowledge.json",
|
|
39
|
+
"voice-fingerprint.json",
|
|
40
|
+
"library.json",
|
|
41
|
+
"packs", // directory — recursed
|
|
42
|
+
"rules.yml",
|
|
43
|
+
"wisdom.md",
|
|
44
|
+
];
|
|
45
|
+
const PII_EMAIL = /[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g;
|
|
46
|
+
function scrubEmails(text) {
|
|
47
|
+
return text.replace(PII_EMAIL, (match) => {
|
|
48
|
+
const at = match.indexOf("@");
|
|
49
|
+
if (at < 0)
|
|
50
|
+
return "<email>";
|
|
51
|
+
const domain = match.slice(at + 1);
|
|
52
|
+
return `<email>@${domain}`;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function listFilesRecursive(root, prefix = "") {
|
|
56
|
+
if (!existsSync(root))
|
|
57
|
+
return [];
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const entry of readdirSync(root)) {
|
|
60
|
+
const full = join(root, entry);
|
|
61
|
+
const rel = prefix ? `${prefix}/${entry}` : entry;
|
|
62
|
+
const st = statSync(full);
|
|
63
|
+
if (st.isDirectory()) {
|
|
64
|
+
out.push(...listFilesRecursive(full, rel));
|
|
65
|
+
}
|
|
66
|
+
else if (st.isFile()) {
|
|
67
|
+
out.push(rel);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
function collectGenomeFiles(repoRoot) {
|
|
73
|
+
const mnemeDir = join(repoRoot, ".mneme");
|
|
74
|
+
if (!existsSync(mnemeDir))
|
|
75
|
+
return [];
|
|
76
|
+
const files = [];
|
|
77
|
+
for (const portable of PORTABLE_PATHS) {
|
|
78
|
+
const full = join(mnemeDir, portable);
|
|
79
|
+
if (!existsSync(full))
|
|
80
|
+
continue;
|
|
81
|
+
const st = statSync(full);
|
|
82
|
+
if (st.isFile()) {
|
|
83
|
+
const raw = readFileSync(full, "utf8");
|
|
84
|
+
files.push({ name: portable, content: scrubEmails(raw) });
|
|
85
|
+
}
|
|
86
|
+
else if (st.isDirectory()) {
|
|
87
|
+
const children = listFilesRecursive(full);
|
|
88
|
+
for (const child of children) {
|
|
89
|
+
const childFull = join(full, child);
|
|
90
|
+
const raw = readFileSync(childFull, "utf8");
|
|
91
|
+
files.push({ name: `${portable}/${child}`, content: scrubEmails(raw) });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return files;
|
|
96
|
+
}
|
|
97
|
+
function computeContentHash(files) {
|
|
98
|
+
const sorted = [...files].sort((a, b) => a.name.localeCompare(b.name));
|
|
99
|
+
const json = JSON.stringify(sorted);
|
|
100
|
+
return createHash("sha256").update(json).digest("hex");
|
|
101
|
+
}
|
|
102
|
+
export function packGenome(repoRoot, repoName, mnemeVersion, opts = {}) {
|
|
103
|
+
const files = collectGenomeFiles(repoRoot);
|
|
104
|
+
const id = `${repoName}-${new Date().toISOString().slice(0, 10)}`;
|
|
105
|
+
const contentHash = computeContentHash(files);
|
|
106
|
+
return {
|
|
107
|
+
schemaVersion: 1,
|
|
108
|
+
id,
|
|
109
|
+
title: opts.title ?? `Wisdom from ${repoName}`,
|
|
110
|
+
description: opts.description ??
|
|
111
|
+
`Constitution + packs + tribal knowledge from the ${repoName} repo, scrubbed of PII.`,
|
|
112
|
+
publishedAt: new Date().toISOString(),
|
|
113
|
+
publishedBy: opts.publishedBy ?? "anonymous",
|
|
114
|
+
mnemeVersion,
|
|
115
|
+
contentHash,
|
|
116
|
+
files,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export function verifyGenome(g) {
|
|
120
|
+
if (g.schemaVersion !== 1) {
|
|
121
|
+
return { valid: false, reason: `unsupported schemaVersion ${g.schemaVersion}` };
|
|
122
|
+
}
|
|
123
|
+
if (!Array.isArray(g.files))
|
|
124
|
+
return { valid: false, reason: "missing files array" };
|
|
125
|
+
const expected = computeContentHash(g.files);
|
|
126
|
+
if (expected !== g.contentHash) {
|
|
127
|
+
return { valid: false, reason: `contentHash mismatch (expected ${expected}, got ${g.contentHash})` };
|
|
128
|
+
}
|
|
129
|
+
return { valid: true };
|
|
130
|
+
}
|
|
131
|
+
export function installGenome(repoRoot, genome, opts = {}) {
|
|
132
|
+
const verdict = verifyGenome(genome);
|
|
133
|
+
if (!verdict.valid)
|
|
134
|
+
throw new Error(`refused to install — ${verdict.reason}`);
|
|
135
|
+
const mnemeDir = join(repoRoot, ".mneme");
|
|
136
|
+
if (!existsSync(mnemeDir))
|
|
137
|
+
mkdirSync(mnemeDir, { recursive: true });
|
|
138
|
+
const conflicts = [];
|
|
139
|
+
const installedFiles = [];
|
|
140
|
+
let skipped = 0;
|
|
141
|
+
for (const f of genome.files) {
|
|
142
|
+
// Path traversal guard.
|
|
143
|
+
if (f.name.includes("..") || isAbsolute(f.name)) {
|
|
144
|
+
conflicts.push(`${f.name} (refused — unsafe path)`);
|
|
145
|
+
skipped += 1;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const dest = join(mnemeDir, f.name);
|
|
149
|
+
if (existsSync(dest) && !opts.force) {
|
|
150
|
+
conflicts.push(f.name);
|
|
151
|
+
skipped += 1;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const destDir = join(dest, "..");
|
|
155
|
+
if (!existsSync(destDir))
|
|
156
|
+
mkdirSync(destDir, { recursive: true });
|
|
157
|
+
writeFileSync(dest, f.content, "utf8");
|
|
158
|
+
installedFiles.push(f.name);
|
|
159
|
+
}
|
|
160
|
+
// Record the installed genome.
|
|
161
|
+
const recDir = join(repoRoot, GENOME_DIR);
|
|
162
|
+
if (!existsSync(recDir))
|
|
163
|
+
mkdirSync(recDir, { recursive: true });
|
|
164
|
+
writeFileSync(join(recDir, `${genome.id}.installed.json`), JSON.stringify({ id: genome.id, installedAt: new Date().toISOString(), source: genome.publishedBy, contentHash: genome.contentHash }, null, 2), "utf8");
|
|
165
|
+
return { installed: installedFiles.length, skipped, conflicts, installedFiles };
|
|
166
|
+
}
|
|
167
|
+
export function listInstalledGenomes(repoRoot) {
|
|
168
|
+
const dir = join(repoRoot, GENOME_DIR);
|
|
169
|
+
if (!existsSync(dir))
|
|
170
|
+
return [];
|
|
171
|
+
const out = [];
|
|
172
|
+
for (const f of readdirSync(dir)) {
|
|
173
|
+
if (!f.endsWith(".installed.json"))
|
|
174
|
+
continue;
|
|
175
|
+
try {
|
|
176
|
+
const r = JSON.parse(readFileSync(join(dir, f), "utf8"));
|
|
177
|
+
out.push(r);
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
// skip invalid records
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return out.sort((a, b) => b.installedAt.localeCompare(a.installedAt));
|
|
184
|
+
}
|
|
185
|
+
export const genomePublishTool = {
|
|
186
|
+
name: "mneme.genome.publish",
|
|
187
|
+
category: "meta",
|
|
188
|
+
description: "Pack the team's .mneme/ wisdom (constitution + custom packs + tribal " +
|
|
189
|
+
"knowledge + voice fingerprint) into a portable, PII-scrubbed, " +
|
|
190
|
+
"content-hashed `.mneme-genome.json` file. Other teams can install it " +
|
|
191
|
+
"via mneme.genome.install to inherit your conventions. Email addresses " +
|
|
192
|
+
"are auto-scrubbed; runtime state (mneme.db / replay.jsonl / scoreboard) " +
|
|
193
|
+
"is excluded. Use WHEN your team has accumulated patterns worth sharing — " +
|
|
194
|
+
"open-source it, send to a sister team, or vendor it across repos.",
|
|
195
|
+
whenToUse: "You want to export your team's accumulated Mneme wisdom as a portable, signed, PII-scrubbed file.",
|
|
196
|
+
triggers: ["pack genome", "publish wisdom", "export mneme conventions"],
|
|
197
|
+
inputSchema: {
|
|
198
|
+
type: "object",
|
|
199
|
+
properties: {
|
|
200
|
+
outputPath: {
|
|
201
|
+
type: "string",
|
|
202
|
+
description: "Where to write the genome file. Default: .mneme/genomes/{repo}-{date}.mneme-genome.json.",
|
|
203
|
+
},
|
|
204
|
+
title: { type: "string", description: "Short title for the genome (default: 'Wisdom from {repo}')." },
|
|
205
|
+
description: { type: "string", description: "Plain-English description of what the genome teaches." },
|
|
206
|
+
publishedBy: { type: "string", description: "Free-text identifier for who published (org / handle / 'anonymous')." },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
outputSchema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
path: { type: "string", description: "Where the genome file was written." },
|
|
213
|
+
id: { type: "string" },
|
|
214
|
+
contentHash: { type: "string" },
|
|
215
|
+
fileCount: { type: "number" },
|
|
216
|
+
bytes: { type: "number" },
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
examples: [
|
|
220
|
+
{
|
|
221
|
+
userQuery: "Pack our team's Mneme wisdom into a portable file",
|
|
222
|
+
args: { title: "Acme Corp engineering wisdom", publishedBy: "acme-eng" },
|
|
223
|
+
expectedOutput: "Returns { path, id, contentHash, fileCount, bytes }. Sends the file to .mneme/genomes/{id}.mneme-genome.json.",
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
pitfalls: [
|
|
227
|
+
"PII scrubbing only handles email addresses — review the genome before sharing publicly to catch other secrets (API keys, server URLs).",
|
|
228
|
+
"Runtime state (mneme.db, replay.jsonl, confess-scoreboard.json) is intentionally excluded — install will NOT restore it.",
|
|
229
|
+
"Conflicts with absolute paths and `..` in filenames are rejected at install — keep your portable files inside .mneme/.",
|
|
230
|
+
],
|
|
231
|
+
composeWith: ["mneme.genome.install", "mneme.genome.list", "mneme.constitution.get"],
|
|
232
|
+
handler: async (rt, args) => {
|
|
233
|
+
const repoName = basename(rt.meta.rootPath);
|
|
234
|
+
const mnemeVersion = process.env["npm_package_version"] ?? "unknown";
|
|
235
|
+
const genome = packGenome(rt.meta.rootPath, repoName, mnemeVersion, {
|
|
236
|
+
title: args["title"] ? String(args["title"]) : undefined,
|
|
237
|
+
description: args["description"] ? String(args["description"]) : undefined,
|
|
238
|
+
publishedBy: args["publishedBy"] ? String(args["publishedBy"]) : undefined,
|
|
239
|
+
});
|
|
240
|
+
const outDir = join(rt.meta.rootPath, GENOME_DIR);
|
|
241
|
+
if (!existsSync(outDir))
|
|
242
|
+
mkdirSync(outDir, { recursive: true });
|
|
243
|
+
const outputPath = args["outputPath"]
|
|
244
|
+
? (isAbsolute(String(args["outputPath"]))
|
|
245
|
+
? String(args["outputPath"])
|
|
246
|
+
: pathResolve(rt.meta.rootPath, String(args["outputPath"])))
|
|
247
|
+
: join(outDir, `${genome.id}.mneme-genome.json`);
|
|
248
|
+
const json = JSON.stringify(genome, null, 2);
|
|
249
|
+
writeFileSync(outputPath, json, "utf8");
|
|
250
|
+
const rel = relative(rt.meta.rootPath, outputPath) || outputPath;
|
|
251
|
+
return {
|
|
252
|
+
data: {
|
|
253
|
+
path: rel,
|
|
254
|
+
id: genome.id,
|
|
255
|
+
contentHash: genome.contentHash,
|
|
256
|
+
fileCount: genome.files.length,
|
|
257
|
+
bytes: Buffer.byteLength(json, "utf8"),
|
|
258
|
+
},
|
|
259
|
+
wisdom: genome.files.length === 0
|
|
260
|
+
? "Nothing portable to publish — .mneme/ has no constitution / packs / tribal knowledge yet. Run `mneme constitution synth` first."
|
|
261
|
+
: `Published genome ${genome.id} — ${genome.files.length} file${genome.files.length === 1 ? "" : "s"}, hash ${genome.contentHash.slice(0, 12)}. Share the file at ${rel}.`,
|
|
262
|
+
followUp: ["mneme.genome.install"],
|
|
263
|
+
confidence: { level: "high" },
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
export const genomeInstallTool = {
|
|
268
|
+
name: "mneme.genome.install",
|
|
269
|
+
category: "meta",
|
|
270
|
+
description: "Install a `.mneme-genome.json` packed by another team — applies their " +
|
|
271
|
+
"constitution / packs / tribal knowledge to the current repo's .mneme/. " +
|
|
272
|
+
"Verifies the content hash before applying. By default, refuses to " +
|
|
273
|
+
"overwrite existing files (returns conflicts list); pass force=true to " +
|
|
274
|
+
"override. Use WHEN you want to adopt another team's Mneme conventions.",
|
|
275
|
+
whenToUse: "You received a .mneme-genome.json file and want to apply its conventions to your current repo.",
|
|
276
|
+
triggers: ["install genome", "apply mneme wisdom", "import conventions"],
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: "object",
|
|
279
|
+
properties: {
|
|
280
|
+
genomeFile: { type: "string", description: "Path to a .mneme-genome.json file." },
|
|
281
|
+
force: { type: "boolean", description: "Overwrite existing .mneme/ files. Default false." },
|
|
282
|
+
},
|
|
283
|
+
required: ["genomeFile"],
|
|
284
|
+
},
|
|
285
|
+
outputSchema: {
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
installed: { type: "number" },
|
|
289
|
+
skipped: { type: "number" },
|
|
290
|
+
conflicts: { type: "array", items: { type: "string" } },
|
|
291
|
+
installedFiles: { type: "array", items: { type: "string" } },
|
|
292
|
+
genome: { type: "object" },
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
examples: [
|
|
296
|
+
{
|
|
297
|
+
userQuery: "Install acme-eng's Mneme genome",
|
|
298
|
+
args: { genomeFile: "./acme-eng-2026-05-09.mneme-genome.json" },
|
|
299
|
+
expectedOutput: "Returns { installed, skipped, conflicts, installedFiles, genome }. If a file already exists, it appears in `conflicts`; pass force=true to overwrite.",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
pitfalls: [
|
|
303
|
+
"Refused if the genome's contentHash doesn't match its files — corrupt or hand-edited genomes are rejected.",
|
|
304
|
+
"Path-traversal attempts (../, absolute paths) are blocked individually — those files appear in `conflicts` with reason 'unsafe path'.",
|
|
305
|
+
"force=true OVERWRITES your existing .mneme/ files — diff your repo first if unsure.",
|
|
306
|
+
],
|
|
307
|
+
composeWith: ["mneme.genome.publish", "mneme.genome.list", "mneme.constitution.get"],
|
|
308
|
+
handler: async (rt, args) => {
|
|
309
|
+
const file = String(args["genomeFile"] ?? "");
|
|
310
|
+
if (!file) {
|
|
311
|
+
return {
|
|
312
|
+
data: { error: "missing required argument: genomeFile" },
|
|
313
|
+
wisdom: "Pass the path to a .mneme-genome.json file.",
|
|
314
|
+
confidence: { level: "high" },
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
const abs = isAbsolute(file) ? file : pathResolve(rt.meta.rootPath, file);
|
|
318
|
+
if (!existsSync(abs)) {
|
|
319
|
+
return {
|
|
320
|
+
data: { error: `file not found: ${abs}` },
|
|
321
|
+
wisdom: `Could not find genome at ${file}. Confirm the path and try again.`,
|
|
322
|
+
confidence: { level: "high" },
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
let genome;
|
|
326
|
+
try {
|
|
327
|
+
genome = JSON.parse(readFileSync(abs, "utf8"));
|
|
328
|
+
}
|
|
329
|
+
catch (err) {
|
|
330
|
+
return {
|
|
331
|
+
data: { error: `could not parse genome JSON: ${err.message}` },
|
|
332
|
+
wisdom: "The file isn't valid JSON. Confirm it's a real Mneme genome file.",
|
|
333
|
+
confidence: { level: "high" },
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
const force = Boolean(args["force"]);
|
|
337
|
+
let result;
|
|
338
|
+
try {
|
|
339
|
+
result = installGenome(rt.meta.rootPath, genome, { force });
|
|
340
|
+
}
|
|
341
|
+
catch (err) {
|
|
342
|
+
return {
|
|
343
|
+
data: { error: err.message },
|
|
344
|
+
wisdom: `Refused to install: ${err.message}`,
|
|
345
|
+
confidence: { level: "high" },
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
data: {
|
|
350
|
+
...result,
|
|
351
|
+
genome: {
|
|
352
|
+
id: genome.id,
|
|
353
|
+
title: genome.title,
|
|
354
|
+
publishedBy: genome.publishedBy,
|
|
355
|
+
contentHash: genome.contentHash,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
wisdom: result.installed > 0
|
|
359
|
+
? `Installed ${result.installed} file${result.installed === 1 ? "" : "s"} from genome '${genome.title}'.${result.conflicts.length > 0 ? ` Skipped ${result.conflicts.length} conflict${result.conflicts.length === 1 ? "" : "s"} (use force=true to overwrite).` : ""}`
|
|
360
|
+
: `No files installed — ${result.conflicts.length} conflict${result.conflicts.length === 1 ? "" : "s"}. Pass force=true to overwrite, or review the conflicts list.`,
|
|
361
|
+
followUp: result.installed > 0 ? ["mneme.constitution.get", "mneme.capabilities"] : [],
|
|
362
|
+
confidence: { level: "high" },
|
|
363
|
+
};
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
export const genomeListTool = {
|
|
367
|
+
name: "mneme.genome.list",
|
|
368
|
+
category: "meta",
|
|
369
|
+
description: "List every Mneme genome installed locally to this repo, with installation " +
|
|
370
|
+
"timestamp + source + content hash. Use WHEN you want to know which external " +
|
|
371
|
+
"wisdom packs are currently shaping this repo's behavior.",
|
|
372
|
+
whenToUse: "You want to audit which external genomes this repo has installed.",
|
|
373
|
+
triggers: ["list genomes", "what genomes installed", "mneme genome inventory"],
|
|
374
|
+
inputSchema: { type: "object", properties: {} },
|
|
375
|
+
outputSchema: {
|
|
376
|
+
type: "object",
|
|
377
|
+
properties: {
|
|
378
|
+
total: { type: "number" },
|
|
379
|
+
genomes: { type: "array", items: { type: "object" } },
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
examples: [
|
|
383
|
+
{
|
|
384
|
+
userQuery: "Which Mneme genomes have we installed?",
|
|
385
|
+
expectedOutput: "Returns { total, genomes: [{ id, installedAt, source, contentHash }] }. Empty array if none.",
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
pitfalls: [
|
|
389
|
+
"Lists records — not the genome FILES themselves. To re-install, you need the original .mneme-genome.json.",
|
|
390
|
+
],
|
|
391
|
+
composeWith: ["mneme.genome.publish", "mneme.genome.install"],
|
|
392
|
+
handler: async (rt) => {
|
|
393
|
+
const genomes = listInstalledGenomes(rt.meta.rootPath);
|
|
394
|
+
return {
|
|
395
|
+
data: { total: genomes.length, genomes },
|
|
396
|
+
wisdom: genomes.length === 0
|
|
397
|
+
? "No external genomes installed in this repo. Run mneme.genome.install with a .mneme-genome.json file to adopt one."
|
|
398
|
+
: `${genomes.length} genome${genomes.length === 1 ? "" : "s"} installed. Most recent: ${genomes[0].id} (from ${genomes[0].source}).`,
|
|
399
|
+
confidence: { level: "high" },
|
|
400
|
+
};
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
export const genomeMarketplaceTools = [
|
|
404
|
+
genomePublishTool,
|
|
405
|
+
genomeInstallTool,
|
|
406
|
+
genomeListTool,
|
|
407
|
+
];
|
|
408
|
+
// Re-export pattern constant for downstream consumers (tests, CLI integration).
|
|
409
|
+
export { GENOME_PATTERN };
|
|
410
|
+
//# sourceMappingURL=_genome_marketplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_genome_marketplace.js","sourceRoot":"","sources":["../../src/tools/_genome_marketplace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,IAAI,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA6BzC,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAE/D;;mDAEmD;AACnD,MAAM,cAAc,GAAG;IACrB,mBAAmB;IACnB,iBAAiB;IACjB,uBAAuB;IACvB,wBAAwB;IACxB,cAAc;IACd,OAAO,EAAE,uBAAuB;IAChC,WAAW;IACX,WAAW;CACZ,CAAC;AAEF,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAElD,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,EAAE,GAAG,CAAC;YAAE,OAAO,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