infernoflow 0.34.1 → 0.34.2

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.
@@ -5,13 +5,16 @@
5
5
  * The inverse of `infernoflow setup`.
6
6
  *
7
7
  * What it removes:
8
- * - inferno/ — contract, capabilities, session memory, HANDOFF.md
9
- * - CLAUDE.md — auto-behavior instruction file
10
- * - .claude/settings.json with pre-approved tools
11
- * - .cursor/inferno-mcp-server.mjs — MCP server file
12
- * - .cursor/mcp.json infernoflow entry (other entries preserved)
13
- * - ~/.claude.json infernoflow mcpServers entry (other entries preserved)
14
- * - .git/hooks/post-commit / pre-push — infernoflow sections (other hooks preserved)
8
+ * - inferno/ — contract, capabilities, session memory, HANDOFF.md
9
+ * - CLAUDE.md — auto-behavior instruction file
10
+ * - .claude/settings.json pre-approved tools (infernoflow entries only)
11
+ * - .cursor/inferno-mcp-server.mjs — MCP server file
12
+ * - .cursor/hooks.json cursor hooks config (if infernoflow-only)
13
+ * - .cursor/hooks/inferno-session-draft.mjs cursor hook script
14
+ * - .cursor/mcp.json — infernoflow entry (other entries preserved)
15
+ * - inferno-mcp-server.mjs — root-level MCP server copy
16
+ * - ~/.claude.json — infernoflow mcpServers entry (other entries preserved)
17
+ * - .git/hooks/post-commit / pre-push — infernoflow sections (other hooks preserved)
15
18
  *
16
19
  * Flags:
17
20
  * --dry-run Preview what would be removed without touching anything
@@ -33,15 +36,18 @@ import * as os from "node:os";
33
36
  import * as readline from "node:readline";
34
37
  import { bold, cyan, gray, green, yellow, red } from "../ui/output.mjs";
35
38
 
36
- const INFERNO_DIR = "inferno";
37
- const CLAUDE_MD = "CLAUDE.md";
38
- const CLAUDE_DIR = ".claude";
39
- const CURSOR_DIR = ".cursor";
40
- const MCP_SERVER = path.join(CURSOR_DIR, "inferno-mcp-server.mjs");
41
- const CURSOR_MCP = path.join(CURSOR_DIR, "mcp.json");
42
- const CLAUDE_JSON = path.join(os.homedir(), ".claude.json");
43
- const GIT_HOOKS = [".git/hooks/post-commit", ".git/hooks/pre-push"];
44
- const INFERNO_MARKER = "# infernoflow";
39
+ const INFERNO_DIR = "inferno";
40
+ const CLAUDE_MD = "CLAUDE.md";
41
+ const CLAUDE_DIR = ".claude";
42
+ const CURSOR_DIR = ".cursor";
43
+ const MCP_SERVER = path.join(CURSOR_DIR, "inferno-mcp-server.mjs");
44
+ const MCP_SERVER_ROOT = "inferno-mcp-server.mjs"; // root-level copy from install-cursor-hooks
45
+ const CURSOR_HOOKS_JSON= path.join(CURSOR_DIR, "hooks.json");
46
+ const CURSOR_HOOK_FILE = path.join(CURSOR_DIR, "hooks", "inferno-session-draft.mjs");
47
+ const CURSOR_MCP = path.join(CURSOR_DIR, "mcp.json");
48
+ const CLAUDE_JSON = path.join(os.homedir(), ".claude.json");
49
+ const GIT_HOOKS = [".git/hooks/post-commit", ".git/hooks/pre-push"];
50
+ const INFERNO_MARKER = "# infernoflow";
45
51
 
46
52
  // ── helpers ──────────────────────────────────────────────────────────────────
47
53
 
@@ -123,9 +129,26 @@ function planClaudeDir(cwd) {
123
129
  }
124
130
 
125
131
  function planCursorMcpServer(cwd) {
126
- const p = path.join(cwd, MCP_SERVER);
127
- if (!exists(p)) return [];
128
- return [{ type: "rm", path: MCP_SERVER }];
132
+ const items = [];
133
+ // .cursor/inferno-mcp-server.mjs
134
+ if (exists(path.join(cwd, MCP_SERVER))) items.push({ type: "rm", path: MCP_SERVER });
135
+ // root-level inferno-mcp-server.mjs (written by install-cursor-hooks)
136
+ if (exists(path.join(cwd, MCP_SERVER_ROOT))) items.push({ type: "rm", path: MCP_SERVER_ROOT });
137
+ // .cursor/hooks/inferno-session-draft.mjs
138
+ if (exists(path.join(cwd, CURSOR_HOOK_FILE))) items.push({ type: "rm", path: CURSOR_HOOK_FILE });
139
+ // .cursor/hooks.json — only remove if it only contains the infernoflow hook
140
+ const hooksJsonPath = path.join(cwd, CURSOR_HOOKS_JSON);
141
+ if (exists(hooksJsonPath)) {
142
+ const cfg = readJSON(hooksJsonPath);
143
+ const hooks = cfg?.hooks || [];
144
+ const hasOnlyInferno = hooks.every(h => (h.name || h.command || "").includes("inferno"));
145
+ if (hasOnlyInferno) {
146
+ items.push({ type: "rm", path: CURSOR_HOOKS_JSON, desc: "infernoflow-only hooks config" });
147
+ } else {
148
+ items.push({ type: "edit", path: CURSOR_HOOKS_JSON, desc: "remove infernoflow hook entry (preserve others)" });
149
+ }
150
+ }
151
+ return items;
129
152
  }
130
153
 
131
154
  function planCursorMcpJson(cwd) {
@@ -212,7 +235,15 @@ function removeCursorMcpServer(cwd, plan, dryRun) {
212
235
  if (dryRun) return;
213
236
  for (const item of plan) {
214
237
  if (item.type === "rm") {
215
- try { fs.unlinkSync(path.join(cwd, MCP_SERVER)); } catch {}
238
+ try { fs.unlinkSync(path.join(cwd, item.path)); } catch {}
239
+ } else if (item.type === "edit" && item.path === CURSOR_HOOKS_JSON) {
240
+ try {
241
+ const cfg = readJSON(path.join(cwd, CURSOR_HOOKS_JSON));
242
+ if (cfg?.hooks) {
243
+ cfg.hooks = cfg.hooks.filter(h => !(h.name || h.command || "").includes("inferno"));
244
+ }
245
+ fs.writeFileSync(path.join(cwd, CURSOR_HOOKS_JSON), JSON.stringify(cfg, null, 2) + "\n", "utf8");
246
+ } catch {}
216
247
  }
217
248
  }
218
249
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infernoflow",
3
- "version": "0.34.1",
3
+ "version": "0.34.2",
4
4
  "description": "The forge for liquid code - keep capabilities, contracts, and docs in sync.",
5
5
  "type": "module",
6
6
  "bin": {