debug-ledger-mcp 0.1.4 → 0.1.6

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 (2) hide show
  1. package/dist/mcp/setup.js +15 -14
  2. package/package.json +1 -1
package/dist/mcp/setup.js CHANGED
@@ -3,18 +3,19 @@ import fs from "fs";
3
3
  import path from "path";
4
4
  import { fileURLToPath } from "url";
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
- const projectDir = process.cwd();
7
- const ledgerDir = path.join(projectDir, "debug_ledger");
8
- if (fs.existsSync(ledgerDir)) {
9
- console.log("debug_ledger/ already exists — skipping setup");
10
- process.exit(0);
11
- }
12
- const sourceDir = path.join(__dirname, "../../debug_ledger");
13
- fs.mkdirSync(ledgerDir);
14
- const files = fs.readdirSync(sourceDir);
15
- files.forEach((file) => {
16
- if (file.endsWith(".md")) {
17
- fs.copyFileSync(path.join(sourceDir, file), path.join(ledgerDir, file));
6
+ export function setupIfNeeded() {
7
+ const projectDir = process.cwd();
8
+ const ledgerDir = path.join(projectDir, "debug_ledger");
9
+ if (fs.existsSync(ledgerDir))
10
+ return;
11
+ fs.mkdirSync(ledgerDir, { recursive: true });
12
+ const templates = {
13
+ "bugs.md": `# Bug Log\n\n| Date | Bug | Fix | Rejected Approaches |\n|------|-----|-----|--------------------|\n`,
14
+ "fixes.md": `# Fix Log\n\n| Date | Fix | Why it worked |\n|------|-----|---------------|\n`,
15
+ "README.md": `# Debug Ledger\n\nAI-readable log of past bugs and fixes.\n`,
16
+ };
17
+ for (const [filename, content] of Object.entries(templates)) {
18
+ fs.writeFileSync(path.join(ledgerDir, filename), content);
18
19
  }
19
- });
20
- console.log("debug_ledger/ created with example files");
20
+ console.log("debug_ledger/ created");
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "debug-ledger-mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Read-only debug memory for AI — a repo-local ledger of past bugs, rejected fixes, and historical constraints so AI debugs with context, not amnesia.",
5
5
  "type": "module",
6
6
  "engines": {