@kurrent/kcap 0.7.11 → 0.7.13

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/bin/kcap.js CHANGED
@@ -148,6 +148,25 @@ function runUpdate(binaryPath) {
148
148
  // Couldn't determine — fall through and let npm decide (it's idempotent).
149
149
  }
150
150
 
151
+ // Windows preflight: a running kcap-daemon.exe locks the binary, so `npm install`
152
+ // would FAIL to overwrite it. Detect a running daemon and abort with instructions
153
+ // BEFORE attempting the (doomed) install. macOS/Linux can replace the file in place,
154
+ // so this guard is Windows-only.
155
+ if (process.platform === "win32") {
156
+ try {
157
+ const status = execFileSync(binaryPath, ["daemon", "status"], { encoding: "utf8" });
158
+ if (/running \(PID/i.test(status)) {
159
+ console.error("A kcap daemon is running and locks the binary, so the update can't");
160
+ console.error("replace it. Stop it first, then re-run `kcap update`:");
161
+ console.error(" kcap daemon service stop (if installed as a service)");
162
+ console.error(" kcap daemon stop (otherwise)");
163
+ process.exit(1);
164
+ }
165
+ } catch {
166
+ // status probe failed (no daemon / old binary) — fall through to the normal install.
167
+ }
168
+ }
169
+
151
170
  // Fail clearly instead of half-installing under a root-owned prefix.
152
171
  try {
153
172
  fs.accessSync(globalRoot, fs.constants.W_OK);
@@ -173,5 +192,22 @@ function runUpdate(binaryPath) {
173
192
  console.log("Refreshing hooks and skills…");
174
193
  require("./refresh").runRefreshes(fs.realpathSync(__filename));
175
194
  console.log("kcap updated.");
195
+
196
+ // macOS/Linux: a running daemon self-detects the new binary and restarts when idle.
197
+ // Just inform the user (best-effort; never fail the update for this). On Windows the
198
+ // doomed install was already aborted by the preflight above, so this only runs on Unix.
199
+ if (process.platform !== "win32") {
200
+ try {
201
+ const status = execFileSync(binaryPath, ["daemon", "status"], { encoding: "utf8" });
202
+ if (/running \(PID/i.test(status)) {
203
+ console.log("A kcap daemon is running; it will restart automatically when idle to");
204
+ console.log("pick up the new version. Check with `kcap daemon status`, or apply now");
205
+ console.log("with `kcap daemon restart --force`.");
206
+ }
207
+ } catch {
208
+ // best-effort notice only
209
+ }
210
+ }
211
+
176
212
  process.exit(0);
177
213
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "kcap",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
4
4
  "description": "Records and visualizes Claude Code sessions via kcap CLI hooks"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kurrent/kcap",
3
- "version": "0.7.11",
3
+ "version": "0.7.13",
4
4
  "description": "CLI companion for Kurrent Capacitor — records and visualizes Claude Code sessions",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
@@ -14,12 +14,12 @@
14
14
  "postinstall": "node bin/postinstall.js"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@kurrent/kcap-darwin-arm64": "0.7.11",
18
- "@kurrent/kcap-linux-x64": "0.7.11",
19
- "@kurrent/kcap-linux-arm64": "0.7.11",
20
- "@kurrent/kcap-linux-musl-x64": "0.7.11",
21
- "@kurrent/kcap-linux-musl-arm64": "0.7.11",
22
- "@kurrent/kcap-win-x64": "0.7.11"
17
+ "@kurrent/kcap-darwin-arm64": "0.7.13",
18
+ "@kurrent/kcap-linux-x64": "0.7.13",
19
+ "@kurrent/kcap-linux-arm64": "0.7.13",
20
+ "@kurrent/kcap-linux-musl-x64": "0.7.13",
21
+ "@kurrent/kcap-linux-musl-arm64": "0.7.13",
22
+ "@kurrent/kcap-win-x64": "0.7.13"
23
23
  },
24
24
  "files": [
25
25
  "bin/",