@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
@@ -985,7 +985,7 @@ var init_daemon_auth = __esm({
985
985
  // src/lib/exe-daemon-client.ts
986
986
  import net from "net";
987
987
  import os4 from "os";
988
- import { spawn } from "child_process";
988
+ import { spawn, execSync as execSync2 } from "child_process";
989
989
  import { randomUUID } from "crypto";
990
990
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
991
991
  import path5 from "path";
@@ -1015,6 +1015,14 @@ function handleData(chunk) {
1015
1015
  }
1016
1016
  }
1017
1017
  }
1018
+ function isZombie(pid) {
1019
+ try {
1020
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1021
+ return state.startsWith("Z");
1022
+ } catch {
1023
+ return false;
1024
+ }
1025
+ }
1018
1026
  function cleanupStaleFiles() {
1019
1027
  if (existsSync5(PID_PATH)) {
1020
1028
  try {
@@ -1022,7 +1030,11 @@ function cleanupStaleFiles() {
1022
1030
  if (pid > 0) {
1023
1031
  try {
1024
1032
  process.kill(pid, 0);
1025
- return;
1033
+ if (!isZombie(pid)) {
1034
+ return;
1035
+ }
1036
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1037
+ `);
1026
1038
  } catch {
1027
1039
  }
1028
1040
  }
@@ -1050,8 +1062,8 @@ function findPackageRoot() {
1050
1062
  function getAvailableMemoryGB() {
1051
1063
  if (process.platform === "darwin") {
1052
1064
  try {
1053
- const { execSync: execSync3 } = __require("child_process");
1054
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1065
+ const { execSync: execSync4 } = __require("child_process");
1066
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1055
1067
  const pageSize = 16384;
1056
1068
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1057
1069
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2973,6 +2985,12 @@ async function disposeDatabase() {
2973
2985
  clearInterval(_walCheckpointTimer);
2974
2986
  _walCheckpointTimer = null;
2975
2987
  }
2988
+ if (_client) {
2989
+ try {
2990
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2991
+ } catch {
2992
+ }
2993
+ }
2976
2994
  if (_daemonClient) {
2977
2995
  _daemonClient.close();
2978
2996
  _daemonClient = null;
@@ -4135,7 +4153,7 @@ init_database();
4135
4153
  // src/lib/keychain.ts
4136
4154
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
4137
4155
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
4138
- import { execSync as execSync2 } from "child_process";
4156
+ import { execSync as execSync3 } from "child_process";
4139
4157
  import path6 from "path";
4140
4158
  import os5 from "os";
4141
4159
  var SERVICE = "exe-os";
@@ -4156,13 +4174,13 @@ function linuxSecretAvailable() {
4156
4174
  if (process.platform !== "linux") return false;
4157
4175
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
4158
4176
  try {
4159
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4177
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4160
4178
  } catch {
4161
4179
  linuxSecretAvailability = false;
4162
4180
  return false;
4163
4181
  }
4164
4182
  try {
4165
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4183
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4166
4184
  linuxSecretAvailability = true;
4167
4185
  } catch {
4168
4186
  linuxSecretAvailability = false;
@@ -4186,7 +4204,7 @@ function macKeychainGet(service = SERVICE) {
4186
4204
  if (!nativeKeychainAllowed()) return null;
4187
4205
  if (process.platform !== "darwin") return null;
4188
4206
  try {
4189
- return execSync2(
4207
+ return execSync3(
4190
4208
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
4191
4209
  { encoding: "utf-8", timeout: 5e3 }
4192
4210
  ).trim();
@@ -4199,13 +4217,13 @@ function macKeychainSet(value, service = SERVICE) {
4199
4217
  if (process.platform !== "darwin") return false;
4200
4218
  try {
4201
4219
  try {
4202
- execSync2(
4220
+ execSync3(
4203
4221
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4204
4222
  { timeout: 5e3 }
4205
4223
  );
4206
4224
  } catch {
4207
4225
  }
4208
- execSync2(
4226
+ execSync3(
4209
4227
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
4210
4228
  { timeout: 5e3 }
4211
4229
  );
@@ -4218,7 +4236,7 @@ function macKeychainDelete(service = SERVICE) {
4218
4236
  if (!nativeKeychainAllowed()) return false;
4219
4237
  if (process.platform !== "darwin") return false;
4220
4238
  try {
4221
- execSync2(
4239
+ execSync3(
4222
4240
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4223
4241
  { timeout: 5e3 }
4224
4242
  );
@@ -4230,7 +4248,7 @@ function macKeychainDelete(service = SERVICE) {
4230
4248
  function linuxSecretGet(service = SERVICE) {
4231
4249
  if (!linuxSecretAvailable()) return null;
4232
4250
  try {
4233
- return execSync2(
4251
+ return execSync3(
4234
4252
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4235
4253
  { encoding: "utf-8", timeout: 5e3 }
4236
4254
  ).trim();
@@ -4241,7 +4259,7 @@ function linuxSecretGet(service = SERVICE) {
4241
4259
  function linuxSecretSet(value, service = SERVICE) {
4242
4260
  if (!linuxSecretAvailable()) return false;
4243
4261
  try {
4244
- execSync2(
4262
+ execSync3(
4245
4263
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4246
4264
  { timeout: 5e3 }
4247
4265
  );
@@ -4254,7 +4272,7 @@ function linuxSecretDelete(service = SERVICE) {
4254
4272
  if (!nativeKeychainAllowed()) return false;
4255
4273
  if (process.platform !== "linux") return false;
4256
4274
  try {
4257
- execSync2(
4275
+ execSync3(
4258
4276
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4259
4277
  { timeout: 5e3 }
4260
4278
  );
@@ -981,7 +981,7 @@ var init_daemon_auth = __esm({
981
981
  // src/lib/exe-daemon-client.ts
982
982
  import net from "net";
983
983
  import os4 from "os";
984
- import { spawn } from "child_process";
984
+ import { spawn, execSync as execSync2 } from "child_process";
985
985
  import { randomUUID } from "crypto";
986
986
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
987
987
  import path5 from "path";
@@ -1011,6 +1011,14 @@ function handleData(chunk) {
1011
1011
  }
1012
1012
  }
1013
1013
  }
1014
+ function isZombie(pid) {
1015
+ try {
1016
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1017
+ return state.startsWith("Z");
1018
+ } catch {
1019
+ return false;
1020
+ }
1021
+ }
1014
1022
  function cleanupStaleFiles() {
1015
1023
  if (existsSync5(PID_PATH)) {
1016
1024
  try {
@@ -1018,7 +1026,11 @@ function cleanupStaleFiles() {
1018
1026
  if (pid > 0) {
1019
1027
  try {
1020
1028
  process.kill(pid, 0);
1021
- return;
1029
+ if (!isZombie(pid)) {
1030
+ return;
1031
+ }
1032
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1033
+ `);
1022
1034
  } catch {
1023
1035
  }
1024
1036
  }
@@ -1046,8 +1058,8 @@ function findPackageRoot() {
1046
1058
  function getAvailableMemoryGB() {
1047
1059
  if (process.platform === "darwin") {
1048
1060
  try {
1049
- const { execSync: execSync3 } = __require("child_process");
1050
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1061
+ const { execSync: execSync4 } = __require("child_process");
1062
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1051
1063
  const pageSize = 16384;
1052
1064
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1053
1065
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2969,6 +2981,12 @@ async function disposeDatabase() {
2969
2981
  clearInterval(_walCheckpointTimer);
2970
2982
  _walCheckpointTimer = null;
2971
2983
  }
2984
+ if (_client) {
2985
+ try {
2986
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2987
+ } catch {
2988
+ }
2989
+ }
2972
2990
  if (_daemonClient) {
2973
2991
  _daemonClient.close();
2974
2992
  _daemonClient = null;
@@ -3697,7 +3715,7 @@ init_database();
3697
3715
  // src/lib/keychain.ts
3698
3716
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3699
3717
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3700
- import { execSync as execSync2 } from "child_process";
3718
+ import { execSync as execSync3 } from "child_process";
3701
3719
  import path6 from "path";
3702
3720
  import os5 from "os";
3703
3721
  var SERVICE = "exe-os";
@@ -3718,13 +3736,13 @@ function linuxSecretAvailable() {
3718
3736
  if (process.platform !== "linux") return false;
3719
3737
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3720
3738
  try {
3721
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3739
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3722
3740
  } catch {
3723
3741
  linuxSecretAvailability = false;
3724
3742
  return false;
3725
3743
  }
3726
3744
  try {
3727
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3745
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3728
3746
  linuxSecretAvailability = true;
3729
3747
  } catch {
3730
3748
  linuxSecretAvailability = false;
@@ -3748,7 +3766,7 @@ function macKeychainGet(service = SERVICE) {
3748
3766
  if (!nativeKeychainAllowed()) return null;
3749
3767
  if (process.platform !== "darwin") return null;
3750
3768
  try {
3751
- return execSync2(
3769
+ return execSync3(
3752
3770
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3753
3771
  { encoding: "utf-8", timeout: 5e3 }
3754
3772
  ).trim();
@@ -3761,13 +3779,13 @@ function macKeychainSet(value, service = SERVICE) {
3761
3779
  if (process.platform !== "darwin") return false;
3762
3780
  try {
3763
3781
  try {
3764
- execSync2(
3782
+ execSync3(
3765
3783
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3766
3784
  { timeout: 5e3 }
3767
3785
  );
3768
3786
  } catch {
3769
3787
  }
3770
- execSync2(
3788
+ execSync3(
3771
3789
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3772
3790
  { timeout: 5e3 }
3773
3791
  );
@@ -3780,7 +3798,7 @@ function macKeychainDelete(service = SERVICE) {
3780
3798
  if (!nativeKeychainAllowed()) return false;
3781
3799
  if (process.platform !== "darwin") return false;
3782
3800
  try {
3783
- execSync2(
3801
+ execSync3(
3784
3802
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3785
3803
  { timeout: 5e3 }
3786
3804
  );
@@ -3792,7 +3810,7 @@ function macKeychainDelete(service = SERVICE) {
3792
3810
  function linuxSecretGet(service = SERVICE) {
3793
3811
  if (!linuxSecretAvailable()) return null;
3794
3812
  try {
3795
- return execSync2(
3813
+ return execSync3(
3796
3814
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3797
3815
  { encoding: "utf-8", timeout: 5e3 }
3798
3816
  ).trim();
@@ -3803,7 +3821,7 @@ function linuxSecretGet(service = SERVICE) {
3803
3821
  function linuxSecretSet(value, service = SERVICE) {
3804
3822
  if (!linuxSecretAvailable()) return false;
3805
3823
  try {
3806
- execSync2(
3824
+ execSync3(
3807
3825
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3808
3826
  { timeout: 5e3 }
3809
3827
  );
@@ -3816,7 +3834,7 @@ function linuxSecretDelete(service = SERVICE) {
3816
3834
  if (!nativeKeychainAllowed()) return false;
3817
3835
  if (process.platform !== "linux") return false;
3818
3836
  try {
3819
- execSync2(
3837
+ execSync3(
3820
3838
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3821
3839
  { timeout: 5e3 }
3822
3840
  );
@@ -981,7 +981,7 @@ var init_daemon_auth = __esm({
981
981
  // src/lib/exe-daemon-client.ts
982
982
  import net from "net";
983
983
  import os4 from "os";
984
- import { spawn } from "child_process";
984
+ import { spawn, execSync as execSync2 } from "child_process";
985
985
  import { randomUUID } from "crypto";
986
986
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
987
987
  import path5 from "path";
@@ -1011,6 +1011,14 @@ function handleData(chunk) {
1011
1011
  }
1012
1012
  }
1013
1013
  }
1014
+ function isZombie(pid) {
1015
+ try {
1016
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1017
+ return state.startsWith("Z");
1018
+ } catch {
1019
+ return false;
1020
+ }
1021
+ }
1014
1022
  function cleanupStaleFiles() {
1015
1023
  if (existsSync5(PID_PATH)) {
1016
1024
  try {
@@ -1018,7 +1026,11 @@ function cleanupStaleFiles() {
1018
1026
  if (pid > 0) {
1019
1027
  try {
1020
1028
  process.kill(pid, 0);
1021
- return;
1029
+ if (!isZombie(pid)) {
1030
+ return;
1031
+ }
1032
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1033
+ `);
1022
1034
  } catch {
1023
1035
  }
1024
1036
  }
@@ -1046,8 +1058,8 @@ function findPackageRoot() {
1046
1058
  function getAvailableMemoryGB() {
1047
1059
  if (process.platform === "darwin") {
1048
1060
  try {
1049
- const { execSync: execSync3 } = __require("child_process");
1050
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1061
+ const { execSync: execSync4 } = __require("child_process");
1062
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1051
1063
  const pageSize = 16384;
1052
1064
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1053
1065
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2833,6 +2845,12 @@ async function disposeDatabase() {
2833
2845
  clearInterval(_walCheckpointTimer);
2834
2846
  _walCheckpointTimer = null;
2835
2847
  }
2848
+ if (_client) {
2849
+ try {
2850
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2851
+ } catch {
2852
+ }
2853
+ }
2836
2854
  if (_daemonClient) {
2837
2855
  _daemonClient.close();
2838
2856
  _daemonClient = null;
@@ -2869,7 +2887,7 @@ var init_database = __esm({
2869
2887
  // src/lib/keychain.ts
2870
2888
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
2871
2889
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
2872
- import { execSync as execSync2 } from "child_process";
2890
+ import { execSync as execSync3 } from "child_process";
2873
2891
  import path6 from "path";
2874
2892
  import os5 from "os";
2875
2893
  function getKeyDir() {
@@ -2886,13 +2904,13 @@ function linuxSecretAvailable() {
2886
2904
  if (process.platform !== "linux") return false;
2887
2905
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
2888
2906
  try {
2889
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
2907
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
2890
2908
  } catch {
2891
2909
  linuxSecretAvailability = false;
2892
2910
  return false;
2893
2911
  }
2894
2912
  try {
2895
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
2913
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
2896
2914
  linuxSecretAvailability = true;
2897
2915
  } catch {
2898
2916
  linuxSecretAvailability = false;
@@ -2916,7 +2934,7 @@ function macKeychainGet(service = SERVICE) {
2916
2934
  if (!nativeKeychainAllowed()) return null;
2917
2935
  if (process.platform !== "darwin") return null;
2918
2936
  try {
2919
- return execSync2(
2937
+ return execSync3(
2920
2938
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
2921
2939
  { encoding: "utf-8", timeout: 5e3 }
2922
2940
  ).trim();
@@ -2929,13 +2947,13 @@ function macKeychainSet(value, service = SERVICE) {
2929
2947
  if (process.platform !== "darwin") return false;
2930
2948
  try {
2931
2949
  try {
2932
- execSync2(
2950
+ execSync3(
2933
2951
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
2934
2952
  { timeout: 5e3 }
2935
2953
  );
2936
2954
  } catch {
2937
2955
  }
2938
- execSync2(
2956
+ execSync3(
2939
2957
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
2940
2958
  { timeout: 5e3 }
2941
2959
  );
@@ -2948,7 +2966,7 @@ function macKeychainDelete(service = SERVICE) {
2948
2966
  if (!nativeKeychainAllowed()) return false;
2949
2967
  if (process.platform !== "darwin") return false;
2950
2968
  try {
2951
- execSync2(
2969
+ execSync3(
2952
2970
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
2953
2971
  { timeout: 5e3 }
2954
2972
  );
@@ -2960,7 +2978,7 @@ function macKeychainDelete(service = SERVICE) {
2960
2978
  function linuxSecretGet(service = SERVICE) {
2961
2979
  if (!linuxSecretAvailable()) return null;
2962
2980
  try {
2963
- return execSync2(
2981
+ return execSync3(
2964
2982
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
2965
2983
  { encoding: "utf-8", timeout: 5e3 }
2966
2984
  ).trim();
@@ -2971,7 +2989,7 @@ function linuxSecretGet(service = SERVICE) {
2971
2989
  function linuxSecretSet(value, service = SERVICE) {
2972
2990
  if (!linuxSecretAvailable()) return false;
2973
2991
  try {
2974
- execSync2(
2992
+ execSync3(
2975
2993
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
2976
2994
  { timeout: 5e3 }
2977
2995
  );
@@ -2984,7 +3002,7 @@ function linuxSecretDelete(service = SERVICE) {
2984
3002
  if (!nativeKeychainAllowed()) return false;
2985
3003
  if (process.platform !== "linux") return false;
2986
3004
  try {
2987
- execSync2(
3005
+ execSync3(
2988
3006
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
2989
3007
  { timeout: 5e3 }
2990
3008
  );
@@ -1003,7 +1003,7 @@ __export(exe_daemon_client_exports, {
1003
1003
  });
1004
1004
  import net from "net";
1005
1005
  import os4 from "os";
1006
- import { spawn } from "child_process";
1006
+ import { spawn, execSync as execSync2 } from "child_process";
1007
1007
  import { randomUUID } from "crypto";
1008
1008
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1009
1009
  import path5 from "path";
@@ -1033,6 +1033,14 @@ function handleData(chunk) {
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
+ function isZombie(pid) {
1037
+ try {
1038
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1039
+ return state.startsWith("Z");
1040
+ } catch {
1041
+ return false;
1042
+ }
1043
+ }
1036
1044
  function cleanupStaleFiles() {
1037
1045
  if (existsSync5(PID_PATH)) {
1038
1046
  try {
@@ -1040,7 +1048,11 @@ function cleanupStaleFiles() {
1040
1048
  if (pid > 0) {
1041
1049
  try {
1042
1050
  process.kill(pid, 0);
1043
- return;
1051
+ if (!isZombie(pid)) {
1052
+ return;
1053
+ }
1054
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1055
+ `);
1044
1056
  } catch {
1045
1057
  }
1046
1058
  }
@@ -1068,8 +1080,8 @@ function findPackageRoot() {
1068
1080
  function getAvailableMemoryGB() {
1069
1081
  if (process.platform === "darwin") {
1070
1082
  try {
1071
- const { execSync: execSync5 } = __require("child_process");
1072
- const vmstat = execSync5("vm_stat", { encoding: "utf8" });
1083
+ const { execSync: execSync6 } = __require("child_process");
1084
+ const vmstat = execSync6("vm_stat", { encoding: "utf8" });
1073
1085
  const pageSize = 16384;
1074
1086
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1075
1087
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3059,6 +3071,12 @@ async function disposeDatabase() {
3059
3071
  clearInterval(_walCheckpointTimer);
3060
3072
  _walCheckpointTimer = null;
3061
3073
  }
3074
+ if (_client) {
3075
+ try {
3076
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3077
+ } catch {
3078
+ }
3079
+ }
3062
3080
  if (_daemonClient) {
3063
3081
  _daemonClient.close();
3064
3082
  _daemonClient = null;
@@ -3095,7 +3113,7 @@ var init_database = __esm({
3095
3113
  // src/lib/keychain.ts
3096
3114
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3097
3115
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3098
- import { execSync as execSync2 } from "child_process";
3116
+ import { execSync as execSync3 } from "child_process";
3099
3117
  import path6 from "path";
3100
3118
  import os5 from "os";
3101
3119
  function getKeyDir() {
@@ -3112,13 +3130,13 @@ function linuxSecretAvailable() {
3112
3130
  if (process.platform !== "linux") return false;
3113
3131
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3114
3132
  try {
3115
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3133
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3116
3134
  } catch {
3117
3135
  linuxSecretAvailability = false;
3118
3136
  return false;
3119
3137
  }
3120
3138
  try {
3121
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3139
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3122
3140
  linuxSecretAvailability = true;
3123
3141
  } catch {
3124
3142
  linuxSecretAvailability = false;
@@ -3142,7 +3160,7 @@ function macKeychainGet(service = SERVICE) {
3142
3160
  if (!nativeKeychainAllowed()) return null;
3143
3161
  if (process.platform !== "darwin") return null;
3144
3162
  try {
3145
- return execSync2(
3163
+ return execSync3(
3146
3164
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3147
3165
  { encoding: "utf-8", timeout: 5e3 }
3148
3166
  ).trim();
@@ -3155,13 +3173,13 @@ function macKeychainSet(value, service = SERVICE) {
3155
3173
  if (process.platform !== "darwin") return false;
3156
3174
  try {
3157
3175
  try {
3158
- execSync2(
3176
+ execSync3(
3159
3177
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3160
3178
  { timeout: 5e3 }
3161
3179
  );
3162
3180
  } catch {
3163
3181
  }
3164
- execSync2(
3182
+ execSync3(
3165
3183
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3166
3184
  { timeout: 5e3 }
3167
3185
  );
@@ -3174,7 +3192,7 @@ function macKeychainDelete(service = SERVICE) {
3174
3192
  if (!nativeKeychainAllowed()) return false;
3175
3193
  if (process.platform !== "darwin") return false;
3176
3194
  try {
3177
- execSync2(
3195
+ execSync3(
3178
3196
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3179
3197
  { timeout: 5e3 }
3180
3198
  );
@@ -3186,7 +3204,7 @@ function macKeychainDelete(service = SERVICE) {
3186
3204
  function linuxSecretGet(service = SERVICE) {
3187
3205
  if (!linuxSecretAvailable()) return null;
3188
3206
  try {
3189
- return execSync2(
3207
+ return execSync3(
3190
3208
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3191
3209
  { encoding: "utf-8", timeout: 5e3 }
3192
3210
  ).trim();
@@ -3197,7 +3215,7 @@ function linuxSecretGet(service = SERVICE) {
3197
3215
  function linuxSecretSet(value, service = SERVICE) {
3198
3216
  if (!linuxSecretAvailable()) return false;
3199
3217
  try {
3200
- execSync2(
3218
+ execSync3(
3201
3219
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3202
3220
  { timeout: 5e3 }
3203
3221
  );
@@ -3210,7 +3228,7 @@ function linuxSecretDelete(service = SERVICE) {
3210
3228
  if (!nativeKeychainAllowed()) return false;
3211
3229
  if (process.platform !== "linux") return false;
3212
3230
  try {
3213
- execSync2(
3231
+ execSync3(
3214
3232
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3215
3233
  { timeout: 5e3 }
3216
3234
  );
@@ -5398,7 +5416,7 @@ var init_session_registry = __esm({
5398
5416
  });
5399
5417
 
5400
5418
  // src/lib/session-key.ts
5401
- import { execSync as execSync3 } from "child_process";
5419
+ import { execSync as execSync4 } from "child_process";
5402
5420
  function normalizeCommand(command) {
5403
5421
  const trimmed = command.trim().toLowerCase();
5404
5422
  const parts = trimmed.split(/[\\/]/);
@@ -5417,7 +5435,7 @@ function resolveRuntimeProcess() {
5417
5435
  let pid = process.ppid;
5418
5436
  for (let i = 0; i < 10; i++) {
5419
5437
  try {
5420
- const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
5438
+ const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
5421
5439
  encoding: "utf8",
5422
5440
  timeout: 2e3
5423
5441
  }).trim();
@@ -5583,7 +5601,7 @@ var init_transport = __esm({
5583
5601
  });
5584
5602
 
5585
5603
  // src/lib/cc-agent-support.ts
5586
- import { execSync as execSync4 } from "child_process";
5604
+ import { execSync as execSync5 } from "child_process";
5587
5605
  var init_cc_agent_support = __esm({
5588
5606
  "src/lib/cc-agent-support.ts"() {
5589
5607
  "use strict";