mulch-cli 0.1.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/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +33 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +30 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/edit.d.ts +3 -0
- package/dist/commands/edit.d.ts.map +1 -0
- package/dist/commands/edit.js +128 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +20 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/onboard.d.ts +8 -0
- package/dist/commands/onboard.d.ts.map +1 -0
- package/dist/commands/onboard.js +144 -0
- package/dist/commands/onboard.js.map +1 -0
- package/dist/commands/prime.d.ts +3 -0
- package/dist/commands/prime.d.ts.map +1 -0
- package/dist/commands/prime.js +107 -0
- package/dist/commands/prime.js.map +1 -0
- package/dist/commands/prune.d.ts +3 -0
- package/dist/commands/prune.d.ts.map +1 -0
- package/dist/commands/prune.js +71 -0
- package/dist/commands/prune.js.map +1 -0
- package/dist/commands/query.d.ts +3 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +58 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/record.d.ts +3 -0
- package/dist/commands/record.d.ts.map +1 -0
- package/dist/commands/record.js +206 -0
- package/dist/commands/record.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +80 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/setup.d.ts +29 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +497 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +32 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/validate.d.ts +3 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +62 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/config.d.ts +17 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +16 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/index.d.ts +4 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/record-schema.d.ts +230 -0
- package/dist/schemas/record-schema.d.ts.map +1 -0
- package/dist/schemas/record-schema.js +111 -0
- package/dist/schemas/record-schema.js.map +1 -0
- package/dist/schemas/record.d.ts +49 -0
- package/dist/schemas/record.d.ts.map +1 -0
- package/dist/schemas/record.js +2 -0
- package/dist/schemas/record.js.map +1 -0
- package/dist/utils/config.d.ts +11 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +83 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/expertise.d.ts +14 -0
- package/dist/utils/expertise.d.ts.map +1 -0
- package/dist/utils/expertise.js +107 -0
- package/dist/utils/expertise.js.map +1 -0
- package/dist/utils/format.d.ts +28 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +373 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { readFile, appendFile, writeFile, stat } from "node:fs/promises";
|
|
2
|
+
export async function readExpertiseFile(filePath) {
|
|
3
|
+
let content;
|
|
4
|
+
try {
|
|
5
|
+
content = await readFile(filePath, "utf-8");
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
const records = [];
|
|
11
|
+
const lines = content.split("\n").filter((line) => line.trim().length > 0);
|
|
12
|
+
for (const line of lines) {
|
|
13
|
+
records.push(JSON.parse(line));
|
|
14
|
+
}
|
|
15
|
+
return records;
|
|
16
|
+
}
|
|
17
|
+
export async function appendRecord(filePath, record) {
|
|
18
|
+
const line = JSON.stringify(record) + "\n";
|
|
19
|
+
await appendFile(filePath, line, "utf-8");
|
|
20
|
+
}
|
|
21
|
+
export async function createExpertiseFile(filePath) {
|
|
22
|
+
await writeFile(filePath, "", "utf-8");
|
|
23
|
+
}
|
|
24
|
+
export async function getFileModTime(filePath) {
|
|
25
|
+
try {
|
|
26
|
+
const stats = await stat(filePath);
|
|
27
|
+
return stats.mtime;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export async function writeExpertiseFile(filePath, records) {
|
|
34
|
+
const content = records.map((r) => JSON.stringify(r)).join("\n") + (records.length > 0 ? "\n" : "");
|
|
35
|
+
await writeFile(filePath, content, "utf-8");
|
|
36
|
+
}
|
|
37
|
+
export function countRecords(records) {
|
|
38
|
+
return records.length;
|
|
39
|
+
}
|
|
40
|
+
export function filterByType(records, type) {
|
|
41
|
+
return records.filter((r) => r.type === type);
|
|
42
|
+
}
|
|
43
|
+
export function findDuplicate(existing, newRecord) {
|
|
44
|
+
for (let i = 0; i < existing.length; i++) {
|
|
45
|
+
const record = existing[i];
|
|
46
|
+
if (record.type !== newRecord.type)
|
|
47
|
+
continue;
|
|
48
|
+
switch (record.type) {
|
|
49
|
+
case "pattern":
|
|
50
|
+
if (newRecord.type === "pattern" &&
|
|
51
|
+
record.name === newRecord.name) {
|
|
52
|
+
return { index: i, record };
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case "decision":
|
|
56
|
+
if (newRecord.type === "decision" &&
|
|
57
|
+
record.title === newRecord.title) {
|
|
58
|
+
return { index: i, record };
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case "convention":
|
|
62
|
+
if (newRecord.type === "convention" &&
|
|
63
|
+
record.content === newRecord.content) {
|
|
64
|
+
return { index: i, record };
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "failure":
|
|
68
|
+
if (newRecord.type === "failure" &&
|
|
69
|
+
record.description === newRecord.description) {
|
|
70
|
+
return { index: i, record };
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case "reference":
|
|
74
|
+
if (newRecord.type === "reference" &&
|
|
75
|
+
record.name === newRecord.name) {
|
|
76
|
+
return { index: i, record };
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
case "guide":
|
|
80
|
+
if (newRecord.type === "guide" &&
|
|
81
|
+
record.name === newRecord.name) {
|
|
82
|
+
return { index: i, record };
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
export function searchRecords(records, query) {
|
|
90
|
+
const lowerQuery = query.toLowerCase();
|
|
91
|
+
return records.filter((record) => {
|
|
92
|
+
for (const value of Object.values(record)) {
|
|
93
|
+
if (typeof value === "string" && value.toLowerCase().includes(lowerQuery)) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
if (Array.isArray(value)) {
|
|
97
|
+
for (const item of value) {
|
|
98
|
+
if (typeof item === "string" && item.toLowerCase().includes(lowerQuery)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=expertise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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Eb,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACvC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC1E,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;wBACxE,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExpertiseRecord } from "../schemas/record.js";
|
|
2
|
+
export declare function formatDomainExpertiseCompact(domain: string, records: ExpertiseRecord[], lastUpdated: Date | null): string;
|
|
3
|
+
export declare function formatPrimeOutputCompact(domainSections: string[]): string;
|
|
4
|
+
export declare function formatDomainExpertise(domain: string, records: ExpertiseRecord[], lastUpdated: Date | null, options?: {
|
|
5
|
+
full?: boolean;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function formatPrimeOutput(domainSections: string[]): string;
|
|
8
|
+
export type PrimeFormat = "markdown" | "xml" | "plain";
|
|
9
|
+
export declare function formatDomainExpertiseXml(domain: string, records: ExpertiseRecord[], lastUpdated: Date | null): string;
|
|
10
|
+
export declare function formatPrimeOutputXml(domainSections: string[]): string;
|
|
11
|
+
export declare function formatDomainExpertisePlain(domain: string, records: ExpertiseRecord[], lastUpdated: Date | null): string;
|
|
12
|
+
export declare function formatPrimeOutputPlain(domainSections: string[]): string;
|
|
13
|
+
export interface McpDomain {
|
|
14
|
+
domain: string;
|
|
15
|
+
entry_count: number;
|
|
16
|
+
records: ExpertiseRecord[];
|
|
17
|
+
}
|
|
18
|
+
export declare function formatMcpOutput(domains: McpDomain[]): string;
|
|
19
|
+
export declare function formatStatusOutput(domainStats: Array<{
|
|
20
|
+
domain: string;
|
|
21
|
+
count: number;
|
|
22
|
+
lastUpdated: Date | null;
|
|
23
|
+
}>, governance: {
|
|
24
|
+
max_entries: number;
|
|
25
|
+
warn_entries: number;
|
|
26
|
+
hard_limit: number;
|
|
27
|
+
}): string;
|
|
28
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAOhB,MAAM,sBAAsB,CAAC;AAkI9B,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EAAE,EAC1B,WAAW,EAAE,IAAI,GAAG,IAAI,GACvB,MAAM,CAUR;AAED,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EAAE,GACvB,MAAM,CAaR;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EAAE,EAC1B,WAAW,EAAE,IAAI,GAAG,IAAI,EACxB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAuCR;AAED,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,MAAM,EAAE,GACvB,MAAM,CA4BR;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC;AAWvD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EAAE,EAC1B,WAAW,EAAE,IAAI,GAAG,IAAI,GACvB,MAAM,CA+CR;AAED,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EAAE,GACvB,MAAM,CAYR;AAID,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EAAE,EAC1B,WAAW,EAAE,IAAI,GAAG,IAAI,GACvB,MAAM,CAiFR;AAED,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EAAE,GACvB,MAAM,CAaR;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,EAAE,GACnB,MAAM,CAER;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,KAAK,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;CAC1B,CAAC,EACF,UAAU,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC5E,MAAM,CAyBR"}
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
function formatTimeAgo(date) {
|
|
2
|
+
const now = new Date();
|
|
3
|
+
const diffMs = now.getTime() - date.getTime();
|
|
4
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
5
|
+
const diffHours = Math.floor(diffMs / 3600000);
|
|
6
|
+
const diffDays = Math.floor(diffMs / 86400000);
|
|
7
|
+
if (diffMins < 1)
|
|
8
|
+
return "just now";
|
|
9
|
+
if (diffMins < 60)
|
|
10
|
+
return `${diffMins}m ago`;
|
|
11
|
+
if (diffHours < 24)
|
|
12
|
+
return `${diffHours}h ago`;
|
|
13
|
+
return `${diffDays}d ago`;
|
|
14
|
+
}
|
|
15
|
+
function formatEvidence(evidence) {
|
|
16
|
+
if (!evidence)
|
|
17
|
+
return "";
|
|
18
|
+
const parts = [];
|
|
19
|
+
if (evidence.commit)
|
|
20
|
+
parts.push(`commit: ${evidence.commit}`);
|
|
21
|
+
if (evidence.date)
|
|
22
|
+
parts.push(`date: ${evidence.date}`);
|
|
23
|
+
if (evidence.issue)
|
|
24
|
+
parts.push(`issue: ${evidence.issue}`);
|
|
25
|
+
if (evidence.file)
|
|
26
|
+
parts.push(`file: ${evidence.file}`);
|
|
27
|
+
return parts.length > 0 ? ` [${parts.join(", ")}]` : "";
|
|
28
|
+
}
|
|
29
|
+
function formatRecordMeta(r, full) {
|
|
30
|
+
if (!full)
|
|
31
|
+
return "";
|
|
32
|
+
const parts = [`(${r.classification})${formatEvidence(r.evidence)}`];
|
|
33
|
+
if (r.tags && r.tags.length > 0) {
|
|
34
|
+
parts.push(`[tags: ${r.tags.join(", ")}]`);
|
|
35
|
+
}
|
|
36
|
+
return " " + parts.join(" ");
|
|
37
|
+
}
|
|
38
|
+
function formatConventions(records, full = false) {
|
|
39
|
+
if (records.length === 0)
|
|
40
|
+
return "";
|
|
41
|
+
const lines = ["### Conventions"];
|
|
42
|
+
for (const r of records) {
|
|
43
|
+
lines.push(`- ${r.content}${formatRecordMeta(r, full)}`);
|
|
44
|
+
}
|
|
45
|
+
return lines.join("\n");
|
|
46
|
+
}
|
|
47
|
+
function formatPatterns(records, full = false) {
|
|
48
|
+
if (records.length === 0)
|
|
49
|
+
return "";
|
|
50
|
+
const lines = ["### Patterns"];
|
|
51
|
+
for (const r of records) {
|
|
52
|
+
let line = `- **${r.name}**: ${r.description}`;
|
|
53
|
+
if (r.files && r.files.length > 0) {
|
|
54
|
+
line += ` (${r.files.join(", ")})`;
|
|
55
|
+
}
|
|
56
|
+
line += formatRecordMeta(r, full);
|
|
57
|
+
lines.push(line);
|
|
58
|
+
}
|
|
59
|
+
return lines.join("\n");
|
|
60
|
+
}
|
|
61
|
+
function formatFailures(records, full = false) {
|
|
62
|
+
if (records.length === 0)
|
|
63
|
+
return "";
|
|
64
|
+
const lines = ["### Known Failures"];
|
|
65
|
+
for (const r of records) {
|
|
66
|
+
lines.push(`- ${r.description}${formatRecordMeta(r, full)}`);
|
|
67
|
+
lines.push(` → ${r.resolution}`);
|
|
68
|
+
}
|
|
69
|
+
return lines.join("\n");
|
|
70
|
+
}
|
|
71
|
+
function formatDecisions(records, full = false) {
|
|
72
|
+
if (records.length === 0)
|
|
73
|
+
return "";
|
|
74
|
+
const lines = ["### Decisions"];
|
|
75
|
+
for (const r of records) {
|
|
76
|
+
lines.push(`- **${r.title}**: ${r.rationale}${formatRecordMeta(r, full)}`);
|
|
77
|
+
}
|
|
78
|
+
return lines.join("\n");
|
|
79
|
+
}
|
|
80
|
+
function formatReferences(records, full = false) {
|
|
81
|
+
if (records.length === 0)
|
|
82
|
+
return "";
|
|
83
|
+
const lines = ["### References"];
|
|
84
|
+
for (const r of records) {
|
|
85
|
+
let line = `- **${r.name}**: ${r.description}`;
|
|
86
|
+
if (r.files && r.files.length > 0) {
|
|
87
|
+
line += ` (${r.files.join(", ")})`;
|
|
88
|
+
}
|
|
89
|
+
line += formatRecordMeta(r, full);
|
|
90
|
+
lines.push(line);
|
|
91
|
+
}
|
|
92
|
+
return lines.join("\n");
|
|
93
|
+
}
|
|
94
|
+
function formatGuides(records, full = false) {
|
|
95
|
+
if (records.length === 0)
|
|
96
|
+
return "";
|
|
97
|
+
const lines = ["### Guides"];
|
|
98
|
+
for (const r of records) {
|
|
99
|
+
lines.push(`- **${r.name}**: ${r.description}${formatRecordMeta(r, full)}`);
|
|
100
|
+
}
|
|
101
|
+
return lines.join("\n");
|
|
102
|
+
}
|
|
103
|
+
function truncate(text, maxLen = 100) {
|
|
104
|
+
if (text.length <= maxLen)
|
|
105
|
+
return text;
|
|
106
|
+
// Try to cut at first sentence boundary within limit
|
|
107
|
+
const sentenceEnd = text.search(/[.!?]\s/);
|
|
108
|
+
if (sentenceEnd > 0 && sentenceEnd < maxLen) {
|
|
109
|
+
return text.slice(0, sentenceEnd + 1);
|
|
110
|
+
}
|
|
111
|
+
return text.slice(0, maxLen) + "...";
|
|
112
|
+
}
|
|
113
|
+
function compactLine(r) {
|
|
114
|
+
switch (r.type) {
|
|
115
|
+
case "convention":
|
|
116
|
+
return `- [convention] ${truncate(r.content)}`;
|
|
117
|
+
case "pattern": {
|
|
118
|
+
const files = r.files && r.files.length > 0 ? ` (${r.files.join(", ")})` : "";
|
|
119
|
+
return `- [pattern] ${r.name}: ${truncate(r.description)}${files}`;
|
|
120
|
+
}
|
|
121
|
+
case "failure":
|
|
122
|
+
return `- [failure] ${truncate(r.description)} → ${truncate(r.resolution)}`;
|
|
123
|
+
case "decision":
|
|
124
|
+
return `- [decision] ${r.title}: ${truncate(r.rationale)}`;
|
|
125
|
+
case "reference": {
|
|
126
|
+
const refFiles = r.files && r.files.length > 0 ? `: ${r.files.join(", ")}` : `: ${truncate(r.description)}`;
|
|
127
|
+
return `- [reference] ${r.name}${refFiles}`;
|
|
128
|
+
}
|
|
129
|
+
case "guide":
|
|
130
|
+
return `- [guide] ${r.name}: ${truncate(r.description)}`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export function formatDomainExpertiseCompact(domain, records, lastUpdated) {
|
|
134
|
+
const updatedStr = lastUpdated ? `, updated ${formatTimeAgo(lastUpdated)}` : "";
|
|
135
|
+
const lines = [];
|
|
136
|
+
lines.push(`## ${domain} (${records.length} entries${updatedStr})`);
|
|
137
|
+
for (const r of records) {
|
|
138
|
+
lines.push(compactLine(r));
|
|
139
|
+
}
|
|
140
|
+
return lines.join("\n");
|
|
141
|
+
}
|
|
142
|
+
export function formatPrimeOutputCompact(domainSections) {
|
|
143
|
+
const lines = [];
|
|
144
|
+
lines.push("# Project Expertise (via Mulch)");
|
|
145
|
+
lines.push("");
|
|
146
|
+
if (domainSections.length === 0) {
|
|
147
|
+
lines.push("No expertise recorded yet. Use `mulch add <domain>` to create a domain, then `mulch record` to add entries.");
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
lines.push(domainSections.join("\n\n"));
|
|
151
|
+
}
|
|
152
|
+
return lines.join("\n");
|
|
153
|
+
}
|
|
154
|
+
export function formatDomainExpertise(domain, records, lastUpdated, options = {}) {
|
|
155
|
+
const full = options.full ?? false;
|
|
156
|
+
const updatedStr = lastUpdated ? `, updated ${formatTimeAgo(lastUpdated)}` : "";
|
|
157
|
+
const lines = [];
|
|
158
|
+
lines.push(`## ${domain} (${records.length} entries${updatedStr})`);
|
|
159
|
+
lines.push("");
|
|
160
|
+
const conventions = records.filter((r) => r.type === "convention");
|
|
161
|
+
const patterns = records.filter((r) => r.type === "pattern");
|
|
162
|
+
const failures = records.filter((r) => r.type === "failure");
|
|
163
|
+
const decisions = records.filter((r) => r.type === "decision");
|
|
164
|
+
const references = records.filter((r) => r.type === "reference");
|
|
165
|
+
const guides = records.filter((r) => r.type === "guide");
|
|
166
|
+
const sections = [
|
|
167
|
+
formatConventions(conventions, full),
|
|
168
|
+
formatPatterns(patterns, full),
|
|
169
|
+
formatFailures(failures, full),
|
|
170
|
+
formatDecisions(decisions, full),
|
|
171
|
+
formatReferences(references, full),
|
|
172
|
+
formatGuides(guides, full),
|
|
173
|
+
].filter((s) => s.length > 0);
|
|
174
|
+
lines.push(sections.join("\n\n"));
|
|
175
|
+
return lines.join("\n");
|
|
176
|
+
}
|
|
177
|
+
export function formatPrimeOutput(domainSections) {
|
|
178
|
+
const lines = [];
|
|
179
|
+
lines.push("# Project Expertise (via Mulch)");
|
|
180
|
+
lines.push("");
|
|
181
|
+
if (domainSections.length === 0) {
|
|
182
|
+
lines.push("No expertise recorded yet. Use `mulch add <domain>` to create a domain, then `mulch record` to add entries.");
|
|
183
|
+
lines.push("");
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
lines.push(domainSections.join("\n\n"));
|
|
187
|
+
lines.push("");
|
|
188
|
+
}
|
|
189
|
+
lines.push("## Recording New Learnings");
|
|
190
|
+
lines.push("");
|
|
191
|
+
lines.push("When you discover a pattern, convention, failure, or make an architectural decision:");
|
|
192
|
+
lines.push("");
|
|
193
|
+
lines.push('```bash');
|
|
194
|
+
lines.push('mulch record <domain> --type convention "description"');
|
|
195
|
+
lines.push('mulch record <domain> --type failure --description "..." --resolution "..."');
|
|
196
|
+
lines.push('mulch record <domain> --type decision --title "..." --rationale "..."');
|
|
197
|
+
lines.push('mulch record <domain> --type pattern --name "..." --description "..." --files "..."');
|
|
198
|
+
lines.push('mulch record <domain> --type reference --name "..." --description "..." --files "..."');
|
|
199
|
+
lines.push('mulch record <domain> --type guide --name "..." --description "..."');
|
|
200
|
+
lines.push("```");
|
|
201
|
+
return lines.join("\n");
|
|
202
|
+
}
|
|
203
|
+
// --- XML format (optimized for Claude) ---
|
|
204
|
+
function xmlEscape(str) {
|
|
205
|
+
return str
|
|
206
|
+
.replace(/&/g, "&")
|
|
207
|
+
.replace(/</g, "<")
|
|
208
|
+
.replace(/>/g, ">");
|
|
209
|
+
}
|
|
210
|
+
export function formatDomainExpertiseXml(domain, records, lastUpdated) {
|
|
211
|
+
const updatedStr = lastUpdated ? ` updated="${formatTimeAgo(lastUpdated)}"` : "";
|
|
212
|
+
const lines = [];
|
|
213
|
+
lines.push(`<domain name="${xmlEscape(domain)}" entries="${records.length}"${updatedStr}>`);
|
|
214
|
+
for (const r of records) {
|
|
215
|
+
lines.push(` <${r.type} classification="${r.classification}">`);
|
|
216
|
+
switch (r.type) {
|
|
217
|
+
case "convention":
|
|
218
|
+
lines.push(` ${xmlEscape(r.content)}`);
|
|
219
|
+
break;
|
|
220
|
+
case "pattern":
|
|
221
|
+
lines.push(` <name>${xmlEscape(r.name)}</name>`);
|
|
222
|
+
lines.push(` <description>${xmlEscape(r.description)}</description>`);
|
|
223
|
+
if (r.files && r.files.length > 0) {
|
|
224
|
+
lines.push(` <files>${r.files.map(xmlEscape).join(", ")}</files>`);
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
case "failure":
|
|
228
|
+
lines.push(` <description>${xmlEscape(r.description)}</description>`);
|
|
229
|
+
lines.push(` <resolution>${xmlEscape(r.resolution)}</resolution>`);
|
|
230
|
+
break;
|
|
231
|
+
case "decision":
|
|
232
|
+
lines.push(` <title>${xmlEscape(r.title)}</title>`);
|
|
233
|
+
lines.push(` <rationale>${xmlEscape(r.rationale)}</rationale>`);
|
|
234
|
+
break;
|
|
235
|
+
case "reference":
|
|
236
|
+
lines.push(` <name>${xmlEscape(r.name)}</name>`);
|
|
237
|
+
lines.push(` <description>${xmlEscape(r.description)}</description>`);
|
|
238
|
+
if (r.files && r.files.length > 0) {
|
|
239
|
+
lines.push(` <files>${r.files.map(xmlEscape).join(", ")}</files>`);
|
|
240
|
+
}
|
|
241
|
+
break;
|
|
242
|
+
case "guide":
|
|
243
|
+
lines.push(` <name>${xmlEscape(r.name)}</name>`);
|
|
244
|
+
lines.push(` <description>${xmlEscape(r.description)}</description>`);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
if (r.tags && r.tags.length > 0) {
|
|
248
|
+
lines.push(` <tags>${r.tags.map(xmlEscape).join(", ")}</tags>`);
|
|
249
|
+
}
|
|
250
|
+
lines.push(` </${r.type}>`);
|
|
251
|
+
}
|
|
252
|
+
lines.push("</domain>");
|
|
253
|
+
return lines.join("\n");
|
|
254
|
+
}
|
|
255
|
+
export function formatPrimeOutputXml(domainSections) {
|
|
256
|
+
const lines = [];
|
|
257
|
+
lines.push("<expertise>");
|
|
258
|
+
if (domainSections.length === 0) {
|
|
259
|
+
lines.push(" <empty>No expertise recorded yet. Use mulch add and mulch record to get started.</empty>");
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
lines.push(domainSections.join("\n"));
|
|
263
|
+
}
|
|
264
|
+
lines.push("</expertise>");
|
|
265
|
+
return lines.join("\n");
|
|
266
|
+
}
|
|
267
|
+
// --- Plain text format (optimized for Codex) ---
|
|
268
|
+
export function formatDomainExpertisePlain(domain, records, lastUpdated) {
|
|
269
|
+
const updatedStr = lastUpdated ? ` (updated ${formatTimeAgo(lastUpdated)})` : "";
|
|
270
|
+
const lines = [];
|
|
271
|
+
lines.push(`[${domain}] ${records.length} entries${updatedStr}`);
|
|
272
|
+
lines.push("");
|
|
273
|
+
const conventions = records.filter((r) => r.type === "convention");
|
|
274
|
+
const patterns = records.filter((r) => r.type === "pattern");
|
|
275
|
+
const failures = records.filter((r) => r.type === "failure");
|
|
276
|
+
const decisions = records.filter((r) => r.type === "decision");
|
|
277
|
+
if (conventions.length > 0) {
|
|
278
|
+
lines.push("Conventions:");
|
|
279
|
+
for (const r of conventions) {
|
|
280
|
+
lines.push(` - ${r.content}`);
|
|
281
|
+
}
|
|
282
|
+
lines.push("");
|
|
283
|
+
}
|
|
284
|
+
if (patterns.length > 0) {
|
|
285
|
+
lines.push("Patterns:");
|
|
286
|
+
for (const r of patterns) {
|
|
287
|
+
let line = ` - ${r.name}: ${r.description}`;
|
|
288
|
+
if (r.files && r.files.length > 0) {
|
|
289
|
+
line += ` (${r.files.join(", ")})`;
|
|
290
|
+
}
|
|
291
|
+
lines.push(line);
|
|
292
|
+
}
|
|
293
|
+
lines.push("");
|
|
294
|
+
}
|
|
295
|
+
if (failures.length > 0) {
|
|
296
|
+
lines.push("Known Failures:");
|
|
297
|
+
for (const r of failures) {
|
|
298
|
+
lines.push(` - ${r.description}`);
|
|
299
|
+
lines.push(` Fix: ${r.resolution}`);
|
|
300
|
+
}
|
|
301
|
+
lines.push("");
|
|
302
|
+
}
|
|
303
|
+
if (decisions.length > 0) {
|
|
304
|
+
lines.push("Decisions:");
|
|
305
|
+
for (const r of decisions) {
|
|
306
|
+
lines.push(` - ${r.title}: ${r.rationale}`);
|
|
307
|
+
}
|
|
308
|
+
lines.push("");
|
|
309
|
+
}
|
|
310
|
+
const references = records.filter((r) => r.type === "reference");
|
|
311
|
+
const guides = records.filter((r) => r.type === "guide");
|
|
312
|
+
if (references.length > 0) {
|
|
313
|
+
lines.push("References:");
|
|
314
|
+
for (const r of references) {
|
|
315
|
+
let line = ` - ${r.name}: ${r.description}`;
|
|
316
|
+
if (r.files && r.files.length > 0) {
|
|
317
|
+
line += ` (${r.files.join(", ")})`;
|
|
318
|
+
}
|
|
319
|
+
lines.push(line);
|
|
320
|
+
}
|
|
321
|
+
lines.push("");
|
|
322
|
+
}
|
|
323
|
+
if (guides.length > 0) {
|
|
324
|
+
lines.push("Guides:");
|
|
325
|
+
for (const r of guides) {
|
|
326
|
+
lines.push(` - ${r.name}: ${r.description}`);
|
|
327
|
+
}
|
|
328
|
+
lines.push("");
|
|
329
|
+
}
|
|
330
|
+
return lines.join("\n").trimEnd();
|
|
331
|
+
}
|
|
332
|
+
export function formatPrimeOutputPlain(domainSections) {
|
|
333
|
+
const lines = [];
|
|
334
|
+
lines.push("Project Expertise (via Mulch)");
|
|
335
|
+
lines.push("============================");
|
|
336
|
+
lines.push("");
|
|
337
|
+
if (domainSections.length === 0) {
|
|
338
|
+
lines.push("No expertise recorded yet. Use `mulch add <domain>` and `mulch record` to get started.");
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
lines.push(domainSections.join("\n\n"));
|
|
342
|
+
}
|
|
343
|
+
return lines.join("\n");
|
|
344
|
+
}
|
|
345
|
+
export function formatMcpOutput(domains) {
|
|
346
|
+
return JSON.stringify({ type: "expertise", domains }, null, 2);
|
|
347
|
+
}
|
|
348
|
+
export function formatStatusOutput(domainStats, governance) {
|
|
349
|
+
const lines = [];
|
|
350
|
+
lines.push("Mulch Status");
|
|
351
|
+
lines.push("============");
|
|
352
|
+
lines.push("");
|
|
353
|
+
if (domainStats.length === 0) {
|
|
354
|
+
lines.push("No domains configured. Run `mulch add <domain>` to get started.");
|
|
355
|
+
return lines.join("\n");
|
|
356
|
+
}
|
|
357
|
+
for (const { domain, count, lastUpdated } of domainStats) {
|
|
358
|
+
const updatedStr = lastUpdated ? formatTimeAgo(lastUpdated) : "never";
|
|
359
|
+
let status = "";
|
|
360
|
+
if (count >= governance.hard_limit) {
|
|
361
|
+
status = " ⚠ OVER HARD LIMIT — must decompose";
|
|
362
|
+
}
|
|
363
|
+
else if (count >= governance.warn_entries) {
|
|
364
|
+
status = " ⚠ consider splitting domain";
|
|
365
|
+
}
|
|
366
|
+
else if (count >= governance.max_entries) {
|
|
367
|
+
status = " — approaching limit";
|
|
368
|
+
}
|
|
369
|
+
lines.push(` ${domain}: ${count} entries (updated ${updatedStr})${status}`);
|
|
370
|
+
}
|
|
371
|
+
return lines.join("\n");
|
|
372
|
+
}
|
|
373
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAUA,SAAS,aAAa,CAAC,IAAU;IAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;IAE/C,IAAI,QAAQ,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACpC,IAAI,QAAQ,GAAG,EAAE;QAAE,OAAO,GAAG,QAAQ,OAAO,CAAC;IAC7C,IAAI,SAAS,GAAG,EAAE;QAAE,OAAO,GAAG,SAAS,OAAO,CAAC;IAC/C,OAAO,GAAG,QAAQ,OAAO,CAAC;AAC5B,CAAC;AAED,SAAS,cAAc,CAAC,QAAsC;IAC5D,IAAI,CAAC,QAAQ;QAAE,OAA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|
|
|
1
|
+
export { getMulchDir, getConfigPath, getExpertiseDir, getExpertisePath, readConfig, writeConfig, initMulchDir, } from "./config.js";
|
|
2
|
+
export { readExpertiseFile, appendRecord, createExpertiseFile, getFileModTime, countRecords, filterByType, } from "./expertise.js";
|
|
3
|
+
export { formatDomainExpertise, formatPrimeOutput, formatStatusOutput, } from "./format.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getMulchDir, getConfigPath, getExpertiseDir, getExpertisePath, readConfig, writeConfig, initMulchDir, } from "./config.js";
|
|
2
|
+
export { readExpertiseFile, appendRecord, createExpertiseFile, getFileModTime, countRecords, filterByType, } from "./expertise.js";
|
|
3
|
+
export { formatDomainExpertise, formatPrimeOutput, formatStatusOutput, } from "./format.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mulch-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Growing Expertise for Coding Agents — structured expertise files that accumulate over time, live in git, work with any agent",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mulch": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"test:watch": "vitest",
|
|
19
|
+
"lint": "tsc --noEmit"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ai",
|
|
26
|
+
"agents",
|
|
27
|
+
"expertise",
|
|
28
|
+
"knowledge-management",
|
|
29
|
+
"cli",
|
|
30
|
+
"developer-tools"
|
|
31
|
+
],
|
|
32
|
+
"author": "Jaymin West",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/jayminwest/mulch.git"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"ajv": "^8.17.1",
|
|
40
|
+
"chalk": "^5.6.2",
|
|
41
|
+
"commander": "^14.0.3",
|
|
42
|
+
"js-yaml": "^4.1.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/js-yaml": "^4.0.9",
|
|
46
|
+
"@types/node": "^25.2.2",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"vitest": "^4.0.18"
|
|
49
|
+
}
|
|
50
|
+
}
|