@askexenow/exe-os 0.9.84 → 0.9.86

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 (82) hide show
  1. package/dist/bin/agentic-ontology-backfill.js +32 -14
  2. package/dist/bin/agentic-reflection-backfill.js +32 -14
  3. package/dist/bin/agentic-semantic-label.js +32 -14
  4. package/dist/bin/backfill-conversations.js +32 -14
  5. package/dist/bin/backfill-responses.js +32 -14
  6. package/dist/bin/backfill-vectors.js +32 -14
  7. package/dist/bin/bulk-sync-postgres.js +32 -14
  8. package/dist/bin/cleanup-stale-review-tasks.js +35 -17
  9. package/dist/bin/cli.js +224 -86
  10. package/dist/bin/exe-assign.js +32 -14
  11. package/dist/bin/exe-boot.js +57 -39
  12. package/dist/bin/exe-cloud.js +22 -4
  13. package/dist/bin/exe-dispatch.js +43 -25
  14. package/dist/bin/exe-doctor.js +22 -4
  15. package/dist/bin/exe-export-behaviors.js +32 -14
  16. package/dist/bin/exe-forget.js +32 -14
  17. package/dist/bin/exe-gateway.js +47 -29
  18. package/dist/bin/exe-heartbeat.js +37 -19
  19. package/dist/bin/exe-kill.js +36 -18
  20. package/dist/bin/exe-launch-agent.js +170 -79
  21. package/dist/bin/exe-new-employee.js +32 -0
  22. package/dist/bin/exe-pending-messages.js +35 -17
  23. package/dist/bin/exe-pending-notifications.js +35 -17
  24. package/dist/bin/exe-pending-reviews.js +37 -19
  25. package/dist/bin/exe-rename.js +34 -16
  26. package/dist/bin/exe-review.js +32 -14
  27. package/dist/bin/exe-search.js +40 -22
  28. package/dist/bin/exe-session-cleanup.js +67 -44
  29. package/dist/bin/exe-start-codex.js +39 -21
  30. package/dist/bin/exe-start-opencode.js +37 -19
  31. package/dist/bin/exe-status.js +44 -26
  32. package/dist/bin/exe-team.js +32 -14
  33. package/dist/bin/git-sweep.js +45 -27
  34. package/dist/bin/graph-backfill.js +32 -14
  35. package/dist/bin/graph-export.js +32 -14
  36. package/dist/bin/install.js +32 -0
  37. package/dist/bin/intercom-check.js +49 -31
  38. package/dist/bin/scan-tasks.js +45 -27
  39. package/dist/bin/setup.js +29 -11
  40. package/dist/bin/shard-migrate.js +32 -14
  41. package/dist/bin/stack-update.js +95 -7
  42. package/dist/bin/update.js +1 -1
  43. package/dist/gateway/index.js +47 -29
  44. package/dist/hooks/bug-report-worker.js +47 -29
  45. package/dist/hooks/codex-stop-task-finalizer.js +41 -23
  46. package/dist/hooks/commit-complete.js +46 -28
  47. package/dist/hooks/error-recall.js +44 -26
  48. package/dist/hooks/ingest-worker.js +4 -4
  49. package/dist/hooks/ingest.js +38 -20
  50. package/dist/hooks/instructions-loaded.js +32 -14
  51. package/dist/hooks/notification.js +32 -14
  52. package/dist/hooks/post-compact.js +32 -14
  53. package/dist/hooks/post-tool-combined.js +45 -27
  54. package/dist/hooks/pre-compact.js +43 -25
  55. package/dist/hooks/pre-tool-use.js +40 -22
  56. package/dist/hooks/prompt-submit.js +60 -42
  57. package/dist/hooks/session-end.js +48 -30
  58. package/dist/hooks/session-start.js +50 -32
  59. package/dist/hooks/stop.js +35 -17
  60. package/dist/hooks/subagent-stop.js +32 -14
  61. package/dist/hooks/summary-worker.js +37 -19
  62. package/dist/index.js +43 -25
  63. package/dist/lib/cloud-sync.js +32 -14
  64. package/dist/lib/database.js +22 -4
  65. package/dist/lib/db-daemon-client.js +16 -4
  66. package/dist/lib/db.js +22 -4
  67. package/dist/lib/device-registry.js +22 -4
  68. package/dist/lib/embedder.js +16 -4
  69. package/dist/lib/exe-daemon-client.js +16 -4
  70. package/dist/lib/exe-daemon.js +165 -66
  71. package/dist/lib/hybrid-search.js +40 -22
  72. package/dist/lib/schedules.js +35 -17
  73. package/dist/lib/skill-learning.js +16 -4
  74. package/dist/lib/store.js +32 -14
  75. package/dist/lib/tasks.js +16 -4
  76. package/dist/lib/tmux-routing.js +18 -6
  77. package/dist/mcp/server.js +142 -60
  78. package/dist/mcp/tools/create-task.js +18 -6
  79. package/dist/mcp/tools/update-task.js +18 -6
  80. package/dist/runtime/index.js +43 -25
  81. package/dist/tui/App.js +73 -55
  82. package/package.json +1 -1
@@ -356,7 +356,7 @@ var init_daemon_auth = __esm({
356
356
  // src/lib/exe-daemon-client.ts
357
357
  import net from "net";
358
358
  import os3 from "os";
359
- import { spawn } from "child_process";
359
+ import { spawn, execSync as execSync2 } from "child_process";
360
360
  import { randomUUID as randomUUID2 } from "crypto";
361
361
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
362
362
  import path4 from "path";
@@ -386,6 +386,14 @@ function handleData(chunk) {
386
386
  }
387
387
  }
388
388
  }
389
+ function isZombie(pid) {
390
+ try {
391
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
392
+ return state.startsWith("Z");
393
+ } catch {
394
+ return false;
395
+ }
396
+ }
389
397
  function cleanupStaleFiles() {
390
398
  if (existsSync5(PID_PATH)) {
391
399
  try {
@@ -393,7 +401,11 @@ function cleanupStaleFiles() {
393
401
  if (pid > 0) {
394
402
  try {
395
403
  process.kill(pid, 0);
396
- return;
404
+ if (!isZombie(pid)) {
405
+ return;
406
+ }
407
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
408
+ `);
397
409
  } catch {
398
410
  }
399
411
  }
@@ -421,8 +433,8 @@ function findPackageRoot() {
421
433
  function getAvailableMemoryGB() {
422
434
  if (process.platform === "darwin") {
423
435
  try {
424
- const { execSync: execSync3 } = __require("child_process");
425
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
436
+ const { execSync: execSync4 } = __require("child_process");
437
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
426
438
  const pageSize = 16384;
427
439
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
428
440
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2983,6 +2995,12 @@ async function disposeDatabase() {
2983
2995
  clearInterval(_walCheckpointTimer);
2984
2996
  _walCheckpointTimer = null;
2985
2997
  }
2998
+ if (_client) {
2999
+ try {
3000
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3001
+ } catch {
3002
+ }
3003
+ }
2986
3004
  if (_daemonClient) {
2987
3005
  _daemonClient.close();
2988
3006
  _daemonClient = null;
@@ -4283,7 +4301,7 @@ init_database();
4283
4301
  // src/lib/keychain.ts
4284
4302
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
4285
4303
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
4286
- import { execSync as execSync2 } from "child_process";
4304
+ import { execSync as execSync3 } from "child_process";
4287
4305
  import path6 from "path";
4288
4306
  import os5 from "os";
4289
4307
  var SERVICE = "exe-os";
@@ -4304,13 +4322,13 @@ function linuxSecretAvailable() {
4304
4322
  if (process.platform !== "linux") return false;
4305
4323
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
4306
4324
  try {
4307
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4325
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4308
4326
  } catch {
4309
4327
  linuxSecretAvailability = false;
4310
4328
  return false;
4311
4329
  }
4312
4330
  try {
4313
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4331
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4314
4332
  linuxSecretAvailability = true;
4315
4333
  } catch {
4316
4334
  linuxSecretAvailability = false;
@@ -4334,7 +4352,7 @@ function macKeychainGet(service = SERVICE) {
4334
4352
  if (!nativeKeychainAllowed()) return null;
4335
4353
  if (process.platform !== "darwin") return null;
4336
4354
  try {
4337
- return execSync2(
4355
+ return execSync3(
4338
4356
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
4339
4357
  { encoding: "utf-8", timeout: 5e3 }
4340
4358
  ).trim();
@@ -4347,13 +4365,13 @@ function macKeychainSet(value, service = SERVICE) {
4347
4365
  if (process.platform !== "darwin") return false;
4348
4366
  try {
4349
4367
  try {
4350
- execSync2(
4368
+ execSync3(
4351
4369
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4352
4370
  { timeout: 5e3 }
4353
4371
  );
4354
4372
  } catch {
4355
4373
  }
4356
- execSync2(
4374
+ execSync3(
4357
4375
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
4358
4376
  { timeout: 5e3 }
4359
4377
  );
@@ -4366,7 +4384,7 @@ function macKeychainDelete(service = SERVICE) {
4366
4384
  if (!nativeKeychainAllowed()) return false;
4367
4385
  if (process.platform !== "darwin") return false;
4368
4386
  try {
4369
- execSync2(
4387
+ execSync3(
4370
4388
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4371
4389
  { timeout: 5e3 }
4372
4390
  );
@@ -4378,7 +4396,7 @@ function macKeychainDelete(service = SERVICE) {
4378
4396
  function linuxSecretGet(service = SERVICE) {
4379
4397
  if (!linuxSecretAvailable()) return null;
4380
4398
  try {
4381
- return execSync2(
4399
+ return execSync3(
4382
4400
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4383
4401
  { encoding: "utf-8", timeout: 5e3 }
4384
4402
  ).trim();
@@ -4389,7 +4407,7 @@ function linuxSecretGet(service = SERVICE) {
4389
4407
  function linuxSecretSet(value, service = SERVICE) {
4390
4408
  if (!linuxSecretAvailable()) return false;
4391
4409
  try {
4392
- execSync2(
4410
+ execSync3(
4393
4411
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4394
4412
  { timeout: 5e3 }
4395
4413
  );
@@ -4402,7 +4420,7 @@ function linuxSecretDelete(service = SERVICE) {
4402
4420
  if (!nativeKeychainAllowed()) return false;
4403
4421
  if (process.platform !== "linux") return false;
4404
4422
  try {
4405
- execSync2(
4423
+ execSync3(
4406
4424
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4407
4425
  { timeout: 5e3 }
4408
4426
  );
@@ -1134,7 +1134,7 @@ var init_daemon_auth = __esm({
1134
1134
  // src/lib/exe-daemon-client.ts
1135
1135
  import net from "net";
1136
1136
  import os4 from "os";
1137
- import { spawn } from "child_process";
1137
+ import { spawn, execSync as execSync2 } from "child_process";
1138
1138
  import { randomUUID } from "crypto";
1139
1139
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1140
1140
  import path5 from "path";
@@ -1164,6 +1164,14 @@ function handleData(chunk) {
1164
1164
  }
1165
1165
  }
1166
1166
  }
1167
+ function isZombie(pid) {
1168
+ try {
1169
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1170
+ return state.startsWith("Z");
1171
+ } catch {
1172
+ return false;
1173
+ }
1174
+ }
1167
1175
  function cleanupStaleFiles() {
1168
1176
  if (existsSync5(PID_PATH)) {
1169
1177
  try {
@@ -1171,7 +1179,11 @@ function cleanupStaleFiles() {
1171
1179
  if (pid > 0) {
1172
1180
  try {
1173
1181
  process.kill(pid, 0);
1174
- return;
1182
+ if (!isZombie(pid)) {
1183
+ return;
1184
+ }
1185
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1186
+ `);
1175
1187
  } catch {
1176
1188
  }
1177
1189
  }
@@ -1199,8 +1211,8 @@ function findPackageRoot() {
1199
1211
  function getAvailableMemoryGB() {
1200
1212
  if (process.platform === "darwin") {
1201
1213
  try {
1202
- const { execSync: execSync11 } = __require("child_process");
1203
- const vmstat = execSync11("vm_stat", { encoding: "utf8" });
1214
+ const { execSync: execSync12 } = __require("child_process");
1215
+ const vmstat = execSync12("vm_stat", { encoding: "utf8" });
1204
1216
  const pageSize = 16384;
1205
1217
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1206
1218
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3135,6 +3147,12 @@ async function disposeDatabase() {
3135
3147
  clearInterval(_walCheckpointTimer);
3136
3148
  _walCheckpointTimer = null;
3137
3149
  }
3150
+ if (_client) {
3151
+ try {
3152
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3153
+ } catch {
3154
+ }
3155
+ }
3138
3156
  if (_daemonClient) {
3139
3157
  _daemonClient.close();
3140
3158
  _daemonClient = null;
@@ -3453,7 +3471,7 @@ __export(keychain_exports, {
3453
3471
  });
3454
3472
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3455
3473
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3456
- import { execSync as execSync2 } from "child_process";
3474
+ import { execSync as execSync3 } from "child_process";
3457
3475
  import path6 from "path";
3458
3476
  import os5 from "os";
3459
3477
  function getKeyDir() {
@@ -3470,13 +3488,13 @@ function linuxSecretAvailable() {
3470
3488
  if (process.platform !== "linux") return false;
3471
3489
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3472
3490
  try {
3473
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3491
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3474
3492
  } catch {
3475
3493
  linuxSecretAvailability = false;
3476
3494
  return false;
3477
3495
  }
3478
3496
  try {
3479
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3497
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3480
3498
  linuxSecretAvailability = true;
3481
3499
  } catch {
3482
3500
  linuxSecretAvailability = false;
@@ -3500,7 +3518,7 @@ function macKeychainGet(service = SERVICE) {
3500
3518
  if (!nativeKeychainAllowed()) return null;
3501
3519
  if (process.platform !== "darwin") return null;
3502
3520
  try {
3503
- return execSync2(
3521
+ return execSync3(
3504
3522
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3505
3523
  { encoding: "utf-8", timeout: 5e3 }
3506
3524
  ).trim();
@@ -3513,13 +3531,13 @@ function macKeychainSet(value, service = SERVICE) {
3513
3531
  if (process.platform !== "darwin") return false;
3514
3532
  try {
3515
3533
  try {
3516
- execSync2(
3534
+ execSync3(
3517
3535
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3518
3536
  { timeout: 5e3 }
3519
3537
  );
3520
3538
  } catch {
3521
3539
  }
3522
- execSync2(
3540
+ execSync3(
3523
3541
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3524
3542
  { timeout: 5e3 }
3525
3543
  );
@@ -3532,7 +3550,7 @@ function macKeychainDelete(service = SERVICE) {
3532
3550
  if (!nativeKeychainAllowed()) return false;
3533
3551
  if (process.platform !== "darwin") return false;
3534
3552
  try {
3535
- execSync2(
3553
+ execSync3(
3536
3554
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3537
3555
  { timeout: 5e3 }
3538
3556
  );
@@ -3544,7 +3562,7 @@ function macKeychainDelete(service = SERVICE) {
3544
3562
  function linuxSecretGet(service = SERVICE) {
3545
3563
  if (!linuxSecretAvailable()) return null;
3546
3564
  try {
3547
- return execSync2(
3565
+ return execSync3(
3548
3566
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3549
3567
  { encoding: "utf-8", timeout: 5e3 }
3550
3568
  ).trim();
@@ -3555,7 +3573,7 @@ function linuxSecretGet(service = SERVICE) {
3555
3573
  function linuxSecretSet(value, service = SERVICE) {
3556
3574
  if (!linuxSecretAvailable()) return false;
3557
3575
  try {
3558
- execSync2(
3576
+ execSync3(
3559
3577
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3560
3578
  { timeout: 5e3 }
3561
3579
  );
@@ -3568,7 +3586,7 @@ function linuxSecretDelete(service = SERVICE) {
3568
3586
  if (!nativeKeychainAllowed()) return false;
3569
3587
  if (process.platform !== "linux") return false;
3570
3588
  try {
3571
- execSync2(
3589
+ execSync3(
3572
3590
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3573
3591
  { timeout: 5e3 }
3574
3592
  );
@@ -4502,7 +4520,7 @@ __export(session_registry_exports, {
4502
4520
  registerSession: () => registerSession
4503
4521
  });
4504
4522
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, existsSync as existsSync8 } from "fs";
4505
- import { execSync as execSync3 } from "child_process";
4523
+ import { execSync as execSync4 } from "child_process";
4506
4524
  import path8 from "path";
4507
4525
  import os6 from "os";
4508
4526
  function registerSession(entry) {
@@ -4542,7 +4560,7 @@ function pruneStaleSessions() {
4542
4560
  if (sessions.length === 0) return 0;
4543
4561
  let liveSessions = [];
4544
4562
  try {
4545
- liveSessions = execSync3("tmux list-sessions -F '#{session_name}' 2>/dev/null", {
4563
+ liveSessions = execSync4("tmux list-sessions -F '#{session_name}' 2>/dev/null", {
4546
4564
  encoding: "utf8"
4547
4565
  }).trim().split("\n").filter(Boolean);
4548
4566
  } catch {
@@ -4565,7 +4583,7 @@ var init_session_registry = __esm({
4565
4583
  });
4566
4584
 
4567
4585
  // src/lib/session-key.ts
4568
- import { execSync as execSync4 } from "child_process";
4586
+ import { execSync as execSync5 } from "child_process";
4569
4587
  function normalizeCommand(command) {
4570
4588
  const trimmed = command.trim().toLowerCase();
4571
4589
  const parts = trimmed.split(/[\\/]/);
@@ -4584,7 +4602,7 @@ function resolveRuntimeProcess() {
4584
4602
  let pid = process.ppid;
4585
4603
  for (let i = 0; i < 10; i++) {
4586
4604
  try {
4587
- const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
4605
+ const info = execSync5(`ps -p ${pid} -o ppid=,comm=`, {
4588
4606
  encoding: "utf8",
4589
4607
  timeout: 2e3
4590
4608
  }).trim();
@@ -4750,14 +4768,14 @@ var init_transport = __esm({
4750
4768
  });
4751
4769
 
4752
4770
  // src/lib/cc-agent-support.ts
4753
- import { execSync as execSync5 } from "child_process";
4771
+ import { execSync as execSync6 } from "child_process";
4754
4772
  function _resetCcAgentSupportCache() {
4755
4773
  _cachedSupport = null;
4756
4774
  }
4757
4775
  function claudeSupportsAgentFlag() {
4758
4776
  if (_cachedSupport !== null) return _cachedSupport;
4759
4777
  try {
4760
- const helpOutput = execSync5("claude --help 2>&1", {
4778
+ const helpOutput = execSync6("claude --help 2>&1", {
4761
4779
  encoding: "utf-8",
4762
4780
  timeout: 5e3
4763
4781
  });
@@ -5914,7 +5932,7 @@ __export(project_name_exports, {
5914
5932
  _resetCache: () => _resetCache,
5915
5933
  getProjectName: () => getProjectName
5916
5934
  });
5917
- import { execSync as execSync6 } from "child_process";
5935
+ import { execSync as execSync7 } from "child_process";
5918
5936
  import path15 from "path";
5919
5937
  function getProjectName(cwd) {
5920
5938
  const dir = cwd ?? process.cwd();
@@ -5922,7 +5940,7 @@ function getProjectName(cwd) {
5922
5940
  try {
5923
5941
  let repoRoot;
5924
5942
  try {
5925
- const gitCommonDir = execSync6("git rev-parse --path-format=absolute --git-common-dir", {
5943
+ const gitCommonDir = execSync7("git rev-parse --path-format=absolute --git-common-dir", {
5926
5944
  cwd: dir,
5927
5945
  encoding: "utf8",
5928
5946
  timeout: 2e3,
@@ -5930,7 +5948,7 @@ function getProjectName(cwd) {
5930
5948
  }).trim();
5931
5949
  repoRoot = path15.dirname(gitCommonDir);
5932
5950
  } catch {
5933
- repoRoot = execSync6("git rev-parse --show-toplevel", {
5951
+ repoRoot = execSync7("git rev-parse --show-toplevel", {
5934
5952
  cwd: dir,
5935
5953
  encoding: "utf8",
5936
5954
  timeout: 2e3,
@@ -6025,7 +6043,7 @@ var init_session_scope = __esm({
6025
6043
  import crypto4 from "crypto";
6026
6044
  import path16 from "path";
6027
6045
  import os11 from "os";
6028
- import { execSync as execSync7 } from "child_process";
6046
+ import { execSync as execSync8 } from "child_process";
6029
6047
  import { mkdir as mkdir4, writeFile as writeFile4, appendFile } from "fs/promises";
6030
6048
  import { existsSync as existsSync15, readFileSync as readFileSync11 } from "fs";
6031
6049
  async function writeCheckpoint(input) {
@@ -6370,14 +6388,14 @@ function isTmuxSessionAlive(identifier) {
6370
6388
  if (!identifier || identifier === "unknown") return true;
6371
6389
  try {
6372
6390
  if (identifier.startsWith("%")) {
6373
- const output = execSync7("tmux list-panes -a -F '#{pane_id}'", {
6391
+ const output = execSync8("tmux list-panes -a -F '#{pane_id}'", {
6374
6392
  timeout: 2e3,
6375
6393
  encoding: "utf8",
6376
6394
  stdio: ["pipe", "pipe", "pipe"]
6377
6395
  });
6378
6396
  return output.split("\n").some((l) => l.trim() === identifier);
6379
6397
  } else {
6380
- execSync7(`tmux has-session -t ${JSON.stringify(identifier)}`, {
6398
+ execSync8(`tmux has-session -t ${JSON.stringify(identifier)}`, {
6381
6399
  timeout: 2e3,
6382
6400
  stdio: ["pipe", "pipe", "pipe"]
6383
6401
  });
@@ -6386,7 +6404,7 @@ function isTmuxSessionAlive(identifier) {
6386
6404
  } catch {
6387
6405
  if (identifier.startsWith("%")) return true;
6388
6406
  try {
6389
- execSync7("tmux list-sessions", {
6407
+ execSync8("tmux list-sessions", {
6390
6408
  timeout: 2e3,
6391
6409
  stdio: ["pipe", "pipe", "pipe"]
6392
6410
  });
@@ -6401,12 +6419,12 @@ function checkStaleCompletion(taskContext, taskCreatedAt) {
6401
6419
  if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
6402
6420
  try {
6403
6421
  const since = new Date(taskCreatedAt).toISOString();
6404
- const branch = execSync7(
6422
+ const branch = execSync8(
6405
6423
  "git rev-parse --abbrev-ref HEAD 2>/dev/null",
6406
6424
  { encoding: "utf8", timeout: 3e3 }
6407
6425
  ).trim();
6408
6426
  const branchArg = branch && branch !== "HEAD" ? branch : "";
6409
- const commitCount = execSync7(
6427
+ const commitCount = execSync8(
6410
6428
  `git log --oneline --since="${since}" ${branchArg} 2>/dev/null | wc -l`,
6411
6429
  { encoding: "utf8", timeout: 5e3 }
6412
6430
  ).trim();
@@ -8005,7 +8023,7 @@ __export(tmux_routing_exports, {
8005
8023
  spawnEmployee: () => spawnEmployee,
8006
8024
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
8007
8025
  });
8008
- import { execFileSync as execFileSync2, execSync as execSync8 } from "child_process";
8026
+ import { execFileSync as execFileSync2, execSync as execSync9 } from "child_process";
8009
8027
  import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, existsSync as existsSync17, appendFileSync, readdirSync as readdirSync4 } from "fs";
8010
8028
  import path20 from "path";
8011
8029
  import os12 from "os";
@@ -8726,7 +8744,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
8726
8744
  let booted = false;
8727
8745
  for (let i = 0; i < 30; i++) {
8728
8746
  try {
8729
- execSync8("sleep 0.5");
8747
+ execSync9("sleep 0.5");
8730
8748
  } catch {
8731
8749
  }
8732
8750
  try {
@@ -10692,7 +10710,7 @@ __export(schedules_exports, {
10692
10710
  parseHumanCron: () => parseHumanCron
10693
10711
  });
10694
10712
  import crypto9 from "crypto";
10695
- import { execSync as execSync10 } from "child_process";
10713
+ import { execSync as execSync11 } from "child_process";
10696
10714
  function isValidCron(cron) {
10697
10715
  const fields = cron.trim().split(/\s+/);
10698
10716
  if (fields.length !== 5) return false;
@@ -10852,7 +10870,7 @@ function addToCrontab(id, cron, prompt, projectDir) {
10852
10870
  const cwd = projectDir ? `cd ${JSON.stringify(projectDir)} && ` : "";
10853
10871
  const escapedPrompt = prompt.replace(/"/g, '\\"');
10854
10872
  const entry = `${cron} ${cwd}claude -p --dangerously-skip-permissions "${escapedPrompt}" # exe-schedule:${id}`;
10855
- execSync10(
10873
+ execSync11(
10856
10874
  `(crontab -l 2>/dev/null; echo ${JSON.stringify(entry)}) | crontab -`,
10857
10875
  { timeout: 5e3, stdio: "ignore" }
10858
10876
  );
@@ -10863,7 +10881,7 @@ function addToCrontab(id, cron, prompt, projectDir) {
10863
10881
  function removeFromCrontab(id) {
10864
10882
  if (!isValidScheduleId(id)) return;
10865
10883
  try {
10866
- execSync10(
10884
+ execSync11(
10867
10885
  `crontab -l 2>/dev/null | grep -v "exe-schedule:${id}" | crontab -`,
10868
10886
  { timeout: 5e3, stdio: "ignore" }
10869
10887
  );
@@ -11428,7 +11446,7 @@ init_notifications();
11428
11446
  init_config();
11429
11447
  init_session_key();
11430
11448
  import { readFileSync as readFileSync13, writeFileSync as writeFileSync9, mkdirSync as mkdirSync9, unlinkSync as unlinkSync7, readdirSync as readdirSync5 } from "fs";
11431
- import { execSync as execSync9 } from "child_process";
11449
+ import { execSync as execSync10 } from "child_process";
11432
11450
  import path21 from "path";
11433
11451
 
11434
11452
  // src/mcp/agent-context.ts
@@ -12178,8 +12196,8 @@ async function boot(options) {
12178
12196
  updatedAt: String(row.updated_at)
12179
12197
  }));
12180
12198
  try {
12181
- const { execSync: execSync11 } = await import("child_process");
12182
- const gitLog = execSync11(
12199
+ const { execSync: execSync12 } = await import("child_process");
12200
+ const gitLog = execSync12(
12183
12201
  "git log --oneline -10 --grep='Co-Authored-By: Claude' --grep='task(' --all-match 2>/dev/null || git log --oneline -5 --grep='Co-Authored-By: Claude' 2>/dev/null || git log --oneline -5 --grep='^task(' 2>/dev/null",
12184
12202
  {
12185
12203
  encoding: "utf8",
@@ -12468,11 +12486,11 @@ async function updateIdleKillSuspectStreak(client, killsToday, liveSessions, tod
12468
12486
  }
12469
12487
  function runSplash() {
12470
12488
  try {
12471
- const { execSync: execSync11 } = __require("child_process");
12489
+ const { execSync: execSync12 } = __require("child_process");
12472
12490
  const { loadConfigSync: loadConfigSync2 } = (init_config(), __toCommonJS(config_exports));
12473
12491
  const config = loadConfigSync2();
12474
12492
  if (!config.splashEffect) return;
12475
- execSync11(
12493
+ execSync12(
12476
12494
  'echo "EXE OS" | python3 -m terminaltexteffects decrypt --typing-speed 2 --ciphertext-colors 6B4C9A F5D76E --final-gradient-stops F5D76E F0EDE8 --final-gradient-direction vertical',
12477
12495
  { stdio: "inherit", timeout: 5e3 }
12478
12496
  );
@@ -1531,7 +1531,7 @@ __export(exe_daemon_client_exports, {
1531
1531
  });
1532
1532
  import net from "net";
1533
1533
  import os5 from "os";
1534
- import { spawn } from "child_process";
1534
+ import { spawn, execSync as execSync3 } from "child_process";
1535
1535
  import { randomUUID } from "crypto";
1536
1536
  import { existsSync as existsSync6, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync as statSync2 } from "fs";
1537
1537
  import path6 from "path";
@@ -1561,6 +1561,14 @@ function handleData(chunk) {
1561
1561
  }
1562
1562
  }
1563
1563
  }
1564
+ function isZombie(pid) {
1565
+ try {
1566
+ const state = execSync3(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1567
+ return state.startsWith("Z");
1568
+ } catch {
1569
+ return false;
1570
+ }
1571
+ }
1564
1572
  function cleanupStaleFiles() {
1565
1573
  if (existsSync6(PID_PATH)) {
1566
1574
  try {
@@ -1568,7 +1576,11 @@ function cleanupStaleFiles() {
1568
1576
  if (pid > 0) {
1569
1577
  try {
1570
1578
  process.kill(pid, 0);
1571
- return;
1579
+ if (!isZombie(pid)) {
1580
+ return;
1581
+ }
1582
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1583
+ `);
1572
1584
  } catch {
1573
1585
  }
1574
1586
  }
@@ -1596,8 +1608,8 @@ function findPackageRoot() {
1596
1608
  function getAvailableMemoryGB() {
1597
1609
  if (process.platform === "darwin") {
1598
1610
  try {
1599
- const { execSync: execSync3 } = __require("child_process");
1600
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1611
+ const { execSync: execSync4 } = __require("child_process");
1612
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1601
1613
  const pageSize = 16384;
1602
1614
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1603
1615
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3552,6 +3564,12 @@ async function disposeDatabase() {
3552
3564
  clearInterval(_walCheckpointTimer);
3553
3565
  _walCheckpointTimer = null;
3554
3566
  }
3567
+ if (_client) {
3568
+ try {
3569
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3570
+ } catch {
3571
+ }
3572
+ }
3555
3573
  if (_daemonClient) {
3556
3574
  _daemonClient.close();
3557
3575
  _daemonClient = null;