@ekkos/cli 1.0.7 → 1.0.9
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/dist/deploy/settings.js
CHANGED
|
@@ -9,14 +9,18 @@ const platform_1 = require("../utils/platform");
|
|
|
9
9
|
* Uses the new format required by Claude Code 2.1.40+
|
|
10
10
|
*/
|
|
11
11
|
function generateHooksConfig() {
|
|
12
|
-
|
|
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
16
|
if (platform_1.isWindows) {
|
|
17
|
+
const ps1Dir = hooksDir.replace(/\\/g, '\\\\'); // escape backslashes for JSON string
|
|
14
18
|
return {
|
|
15
19
|
UserPromptSubmit: [
|
|
16
|
-
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${
|
|
20
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${ps1Dir}\\user-prompt-submit.ps1"` }] }
|
|
17
21
|
],
|
|
18
22
|
Stop: [
|
|
19
|
-
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${
|
|
23
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${ps1Dir}\\stop.ps1"` }] }
|
|
20
24
|
],
|
|
21
25
|
};
|
|
22
26
|
}
|
package/package.json
CHANGED
|
@@ -141,6 +141,39 @@ function Convert-UuidToWords {
|
|
|
141
141
|
|
|
142
142
|
$sessionName = Convert-UuidToWords $rawSessionId
|
|
143
143
|
|
|
144
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
145
|
+
# PROXY SESSION BIND: _pending → real session name (fires every turn)
|
|
146
|
+
# Mirrors bash user-prompt-submit.sh lines 319-338.
|
|
147
|
+
# No PTY on Windows so run.ts can't detect session name — hook must bind it.
|
|
148
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
149
|
+
if ($sessionName -ne "unknown-session" -and $rawSessionId -ne "unknown") {
|
|
150
|
+
$configFile = Join-Path $EkkosConfigDir "config.json"
|
|
151
|
+
if (Test-Path $configFile) {
|
|
152
|
+
try {
|
|
153
|
+
$config = Get-Content $configFile -Raw | ConvertFrom-Json
|
|
154
|
+
$userId = $config.userId
|
|
155
|
+
if ($userId) {
|
|
156
|
+
$projectPath = if ($env:PWD) { $env:PWD } else { (Get-Location).Path }
|
|
157
|
+
$pendingSession = if ($env:EKKOS_PENDING_SESSION) { $env:EKKOS_PENDING_SESSION } else { "_pending" }
|
|
158
|
+
$bindBody = @{
|
|
159
|
+
userId = $userId
|
|
160
|
+
realSession = $sessionName
|
|
161
|
+
projectPath = $projectPath
|
|
162
|
+
pendingSession = $pendingSession
|
|
163
|
+
} | ConvertTo-Json -Compress
|
|
164
|
+
|
|
165
|
+
Start-Job -ScriptBlock {
|
|
166
|
+
param($body)
|
|
167
|
+
Invoke-RestMethod -Uri "https://proxy.ekkos.dev/proxy/session/bind" `
|
|
168
|
+
-Method POST `
|
|
169
|
+
-Headers @{ "Content-Type" = "application/json" } `
|
|
170
|
+
-Body $body -ErrorAction SilentlyContinue | Out-Null
|
|
171
|
+
} -ArgumentList $bindBody | Out-Null
|
|
172
|
+
}
|
|
173
|
+
} catch {}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
144
177
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
145
178
|
# TURN TRACKING & STATE MANAGEMENT
|
|
146
179
|
# ═══════════════════════════════════════════════════════════════════════════
|