skalpel 4.0.3 → 4.0.5

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/install.mjs +10 -4
  2. package/package.json +1 -1
package/install.mjs CHANGED
@@ -40,6 +40,7 @@ function stageHookRuntime() {
40
40
  // this rule and is guarded by the all-or-nothing check below instead).
41
41
  // a hook entrypoint staged without a module it imports — the exact 0.3.12–0.3.16 bug shape.
42
42
  copyFileSync(join(PKG_DIR, "insights.mjs"), join(HOOKS_DIR, "insights.mjs")); // hooks import ./insights.mjs
43
+ copyFileSync(join(PKG_DIR, "reveal.mjs"), join(HOOKS_DIR, "reveal.mjs")); // both hooks import ./reveal.mjs
43
44
  copyFileSync(join(PKG_DIR, "skalpel-hook.mjs"), HOOK_FILE);
44
45
  copyFileSync(join(PKG_DIR, "skalpel-hook-session.mjs"), SESSION_FILE);
45
46
  copyFileSync(join(PKG_DIR, "incremental-ingest.mjs"), join(HOOKS_DIR, "incremental-ingest.mjs"));
@@ -66,14 +67,17 @@ if (!uninstall && !process.env.SKALPEL_HOOK_BIN) {
66
67
 
67
68
  // The wired command. Defaults to the staged absolute `node <path>`; SKALPEL_HOOK_BIN /
68
69
  // SKALPEL_HOOK_SESSION_BIN still override (dev, or a deliberate global-bin install).
69
- const CMD = process.env.SKALPEL_HOOK_BIN || `node ${HOOK_FILE}`;
70
- const SESSION_CMD = process.env.SKALPEL_HOOK_SESSION_BIN || `node ${SESSION_FILE}`;
70
+ // QUOTE the path: on Windows the staged path is `C:\Users\First Last\.skalpel\hooks\…`, and an
71
+ // UNQUOTED `node <path>` splits at the space so node gets `C:\Users\First` → ERR_MODULE_NOT_FOUND
72
+ // (the esm/resolve crash on every hook). Double-quotes are safe on Windows cmd/PowerShell AND POSIX.
73
+ const CMD = process.env.SKALPEL_HOOK_BIN || `node "${HOOK_FILE}"`;
74
+ const SESSION_CMD = process.env.SKALPEL_HOOK_SESSION_BIN || `node "${SESSION_FILE}"`;
71
75
  const sessionEndRuntime =
72
76
  process.env.SKALPEL_HOOK_BIN && PKG_DIR !== HOOKS_DIR
73
77
  ? join(PKG_DIR, "skalpel-hook-session-end.mjs")
74
78
  : SESSION_END_FILE;
75
- const SESSION_END_CMD = process.env.SKALPEL_HOOK_SESSION_END_BIN || `node ${sessionEndRuntime}`;
76
- const STATUSLINE_CMD = process.env.SKALPEL_STATUSLINE_BIN || `node ${STATUSLINE_FILE}`;
79
+ const SESSION_END_CMD = process.env.SKALPEL_HOOK_SESSION_END_BIN || `node "${sessionEndRuntime}"`;
80
+ const STATUSLINE_CMD = process.env.SKALPEL_STATUSLINE_BIN || `node "${STATUSLINE_FILE}"`;
77
81
  const CLAUDE = join(homedir(), ".claude", "settings.json");
78
82
  const CODEX_DIR = join(homedir(), ".codex");
79
83
  const CODEX = join(CODEX_DIR, "hooks.json");
@@ -82,6 +86,8 @@ const CODEX_TOML = join(CODEX_DIR, "config.toml"); // Codex reads hooks from con
82
86
  // installer wired, including bare-bin names and absolute `node <path>` commands.
83
87
  const markerOf = (cmd) =>
84
88
  cmd
89
+ .replace(/"/g, "") // tolerate the quoted `node "<path>"` form (Windows-safe) — strip quotes first
90
+ .trim()
85
91
  .split(/[/\\]/)
86
92
  .pop()
87
93
  .replace(/\.(mjs|js|exe)$/, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skalpel",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "description": "Behavioral graph for AI-assisted coding — learns how you work and steers Claude Code + Codex in real time.",
5
5
  "type": "module",
6
6
  "bin": {