@ekkos/cli 1.0.9 → 1.0.11

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.
@@ -3,34 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deployClaudeSettings = deployClaudeSettings;
4
4
  exports.areHooksConfigured = areHooksConfigured;
5
5
  const fs_1 = require("fs");
6
+ const path_1 = require("path");
6
7
  const platform_1 = require("../utils/platform");
7
8
  /**
8
9
  * Generate the hooks configuration for Claude Code settings.json
9
10
  * Uses the new format required by Claude Code 2.1.40+
10
11
  */
11
12
  function generateHooksConfig() {
12
- // Use CLAUDE_HOOKS_DIR (path.join-based) to get correct OS separators.
13
- // Do NOT use template literals with HOME_DIR they produce mixed separators
14
- // on Windows (C:\Users\name/.claude/hooks) which causes "path not found".
15
- const hooksDir = platform_1.CLAUDE_HOOKS_DIR;
13
+ // Use path.join (via CLAUDE_HOOKS_DIR) so OS-correct separators are used.
14
+ // JSON.stringify handles backslash-escaping automaticallydo NOT pre-escape.
15
+ //
16
+ // IMPORTANT: Do NOT use `-File` on Windows — Claude Code has a known bug where
17
+ // it fails to canonicalize absolute script paths, producing "system cannot find
18
+ // the specified path". Use `-Command "& 'path'"` instead, which bypasses it.
19
+ // See: https://github.com/anthropics/claude-code/issues/12874
16
20
  if (platform_1.isWindows) {
17
- const ps1Dir = hooksDir.replace(/\\/g, '\\\\'); // escape backslashes for JSON string
18
21
  return {
19
22
  UserPromptSubmit: [
20
- { hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${ps1Dir}\\user-prompt-submit.ps1"` }] }
23
+ { hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -Command "& '${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'user-prompt-submit.ps1')}'"` }] }
21
24
  ],
22
25
  Stop: [
23
- { hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${ps1Dir}\\stop.ps1"` }] }
26
+ { hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -Command "& '${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'stop.ps1')}'"` }] }
24
27
  ],
25
28
  };
26
29
  }
27
- // Unix uses bash
30
+ // Unix: forward slashes, no quoting needed
28
31
  return {
29
32
  UserPromptSubmit: [
30
- { hooks: [{ type: 'command', command: `bash ${hooksDir}/user-prompt-submit.sh` }] }
33
+ { hooks: [{ type: 'command', command: `bash ${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'user-prompt-submit.sh')}` }] }
31
34
  ],
32
35
  Stop: [
33
- { hooks: [{ type: 'command', command: `bash ${hooksDir}/stop.sh` }] }
36
+ { hooks: [{ type: 'command', command: `bash ${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'stop.sh')}` }] }
34
37
  ],
35
38
  };
36
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekkos/cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Setup ekkOS memory for AI coding assistants (Claude Code, Cursor, Windsurf)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {