@askexenow/exe-os 0.9.85 → 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 (80) 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 +152 -77
  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 +40 -22
  21. package/dist/bin/exe-pending-messages.js +35 -17
  22. package/dist/bin/exe-pending-notifications.js +35 -17
  23. package/dist/bin/exe-pending-reviews.js +37 -19
  24. package/dist/bin/exe-rename.js +34 -16
  25. package/dist/bin/exe-review.js +32 -14
  26. package/dist/bin/exe-search.js +40 -22
  27. package/dist/bin/exe-session-cleanup.js +67 -44
  28. package/dist/bin/exe-start-codex.js +39 -21
  29. package/dist/bin/exe-start-opencode.js +37 -19
  30. package/dist/bin/exe-status.js +44 -26
  31. package/dist/bin/exe-team.js +32 -14
  32. package/dist/bin/git-sweep.js +45 -27
  33. package/dist/bin/graph-backfill.js +32 -14
  34. package/dist/bin/graph-export.js +32 -14
  35. package/dist/bin/intercom-check.js +49 -31
  36. package/dist/bin/scan-tasks.js +45 -27
  37. package/dist/bin/setup.js +29 -11
  38. package/dist/bin/shard-migrate.js +32 -14
  39. package/dist/bin/stack-update.js +59 -2
  40. package/dist/bin/update.js +1 -1
  41. package/dist/gateway/index.js +47 -29
  42. package/dist/hooks/bug-report-worker.js +47 -29
  43. package/dist/hooks/codex-stop-task-finalizer.js +41 -23
  44. package/dist/hooks/commit-complete.js +46 -28
  45. package/dist/hooks/error-recall.js +44 -26
  46. package/dist/hooks/ingest-worker.js +4 -4
  47. package/dist/hooks/ingest.js +38 -20
  48. package/dist/hooks/instructions-loaded.js +32 -14
  49. package/dist/hooks/notification.js +32 -14
  50. package/dist/hooks/post-compact.js +32 -14
  51. package/dist/hooks/post-tool-combined.js +45 -27
  52. package/dist/hooks/pre-compact.js +43 -25
  53. package/dist/hooks/pre-tool-use.js +40 -22
  54. package/dist/hooks/prompt-submit.js +60 -42
  55. package/dist/hooks/session-end.js +48 -30
  56. package/dist/hooks/session-start.js +50 -32
  57. package/dist/hooks/stop.js +35 -17
  58. package/dist/hooks/subagent-stop.js +32 -14
  59. package/dist/hooks/summary-worker.js +37 -19
  60. package/dist/index.js +43 -25
  61. package/dist/lib/cloud-sync.js +32 -14
  62. package/dist/lib/database.js +22 -4
  63. package/dist/lib/db-daemon-client.js +16 -4
  64. package/dist/lib/db.js +22 -4
  65. package/dist/lib/device-registry.js +22 -4
  66. package/dist/lib/embedder.js +16 -4
  67. package/dist/lib/exe-daemon-client.js +16 -4
  68. package/dist/lib/exe-daemon.js +165 -66
  69. package/dist/lib/hybrid-search.js +40 -22
  70. package/dist/lib/schedules.js +35 -17
  71. package/dist/lib/skill-learning.js +16 -4
  72. package/dist/lib/store.js +32 -14
  73. package/dist/lib/tasks.js +16 -4
  74. package/dist/lib/tmux-routing.js +18 -6
  75. package/dist/mcp/server.js +142 -60
  76. package/dist/mcp/tools/create-task.js +18 -6
  77. package/dist/mcp/tools/update-task.js +18 -6
  78. package/dist/runtime/index.js +43 -25
  79. package/dist/tui/App.js +73 -55
  80. package/package.json +1 -1
@@ -1046,7 +1046,7 @@ var init_daemon_auth = __esm({
1046
1046
  // src/lib/exe-daemon-client.ts
1047
1047
  import net from "net";
1048
1048
  import os4 from "os";
1049
- import { spawn } from "child_process";
1049
+ import { spawn, execSync as execSync2 } from "child_process";
1050
1050
  import { randomUUID } from "crypto";
1051
1051
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1052
1052
  import path5 from "path";
@@ -1076,6 +1076,14 @@ function handleData(chunk) {
1076
1076
  }
1077
1077
  }
1078
1078
  }
1079
+ function isZombie(pid) {
1080
+ try {
1081
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1082
+ return state.startsWith("Z");
1083
+ } catch {
1084
+ return false;
1085
+ }
1086
+ }
1079
1087
  function cleanupStaleFiles() {
1080
1088
  if (existsSync5(PID_PATH)) {
1081
1089
  try {
@@ -1083,7 +1091,11 @@ function cleanupStaleFiles() {
1083
1091
  if (pid > 0) {
1084
1092
  try {
1085
1093
  process.kill(pid, 0);
1086
- return;
1094
+ if (!isZombie(pid)) {
1095
+ return;
1096
+ }
1097
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1098
+ `);
1087
1099
  } catch {
1088
1100
  }
1089
1101
  }
@@ -1111,8 +1123,8 @@ function findPackageRoot() {
1111
1123
  function getAvailableMemoryGB() {
1112
1124
  if (process.platform === "darwin") {
1113
1125
  try {
1114
- const { execSync: execSync5 } = __require("child_process");
1115
- const vmstat = execSync5("vm_stat", { encoding: "utf8" });
1126
+ const { execSync: execSync6 } = __require("child_process");
1127
+ const vmstat = execSync6("vm_stat", { encoding: "utf8" });
1116
1128
  const pageSize = 16384;
1117
1129
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1118
1130
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3047,6 +3059,12 @@ async function disposeDatabase() {
3047
3059
  clearInterval(_walCheckpointTimer);
3048
3060
  _walCheckpointTimer = null;
3049
3061
  }
3062
+ if (_client) {
3063
+ try {
3064
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3065
+ } catch {
3066
+ }
3067
+ }
3050
3068
  if (_daemonClient) {
3051
3069
  _daemonClient.close();
3052
3070
  _daemonClient = null;
@@ -3083,7 +3101,7 @@ var init_database = __esm({
3083
3101
  // src/lib/keychain.ts
3084
3102
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3085
3103
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3086
- import { execSync as execSync2 } from "child_process";
3104
+ import { execSync as execSync3 } from "child_process";
3087
3105
  import path6 from "path";
3088
3106
  import os5 from "os";
3089
3107
  function getKeyDir() {
@@ -3100,13 +3118,13 @@ function linuxSecretAvailable() {
3100
3118
  if (process.platform !== "linux") return false;
3101
3119
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3102
3120
  try {
3103
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3121
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3104
3122
  } catch {
3105
3123
  linuxSecretAvailability = false;
3106
3124
  return false;
3107
3125
  }
3108
3126
  try {
3109
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3127
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3110
3128
  linuxSecretAvailability = true;
3111
3129
  } catch {
3112
3130
  linuxSecretAvailability = false;
@@ -3130,7 +3148,7 @@ function macKeychainGet(service = SERVICE) {
3130
3148
  if (!nativeKeychainAllowed()) return null;
3131
3149
  if (process.platform !== "darwin") return null;
3132
3150
  try {
3133
- return execSync2(
3151
+ return execSync3(
3134
3152
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3135
3153
  { encoding: "utf-8", timeout: 5e3 }
3136
3154
  ).trim();
@@ -3143,13 +3161,13 @@ function macKeychainSet(value, service = SERVICE) {
3143
3161
  if (process.platform !== "darwin") return false;
3144
3162
  try {
3145
3163
  try {
3146
- execSync2(
3164
+ execSync3(
3147
3165
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3148
3166
  { timeout: 5e3 }
3149
3167
  );
3150
3168
  } catch {
3151
3169
  }
3152
- execSync2(
3170
+ execSync3(
3153
3171
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3154
3172
  { timeout: 5e3 }
3155
3173
  );
@@ -3162,7 +3180,7 @@ function macKeychainDelete(service = SERVICE) {
3162
3180
  if (!nativeKeychainAllowed()) return false;
3163
3181
  if (process.platform !== "darwin") return false;
3164
3182
  try {
3165
- execSync2(
3183
+ execSync3(
3166
3184
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3167
3185
  { timeout: 5e3 }
3168
3186
  );
@@ -3174,7 +3192,7 @@ function macKeychainDelete(service = SERVICE) {
3174
3192
  function linuxSecretGet(service = SERVICE) {
3175
3193
  if (!linuxSecretAvailable()) return null;
3176
3194
  try {
3177
- return execSync2(
3195
+ return execSync3(
3178
3196
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3179
3197
  { encoding: "utf-8", timeout: 5e3 }
3180
3198
  ).trim();
@@ -3185,7 +3203,7 @@ function linuxSecretGet(service = SERVICE) {
3185
3203
  function linuxSecretSet(value, service = SERVICE) {
3186
3204
  if (!linuxSecretAvailable()) return false;
3187
3205
  try {
3188
- execSync2(
3206
+ execSync3(
3189
3207
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3190
3208
  { timeout: 5e3 }
3191
3209
  );
@@ -3198,7 +3216,7 @@ function linuxSecretDelete(service = SERVICE) {
3198
3216
  if (!nativeKeychainAllowed()) return false;
3199
3217
  if (process.platform !== "linux") return false;
3200
3218
  try {
3201
- execSync2(
3219
+ execSync3(
3202
3220
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3203
3221
  { timeout: 5e3 }
3204
3222
  );
@@ -5666,7 +5684,7 @@ __export(project_name_exports, {
5666
5684
  _resetCache: () => _resetCache,
5667
5685
  getProjectName: () => getProjectName
5668
5686
  });
5669
- import { execSync as execSync3 } from "child_process";
5687
+ import { execSync as execSync4 } from "child_process";
5670
5688
  import path9 from "path";
5671
5689
  function getProjectName(cwd) {
5672
5690
  const dir = cwd ?? process.cwd();
@@ -5674,7 +5692,7 @@ function getProjectName(cwd) {
5674
5692
  try {
5675
5693
  let repoRoot;
5676
5694
  try {
5677
- const gitCommonDir = execSync3("git rev-parse --path-format=absolute --git-common-dir", {
5695
+ const gitCommonDir = execSync4("git rev-parse --path-format=absolute --git-common-dir", {
5678
5696
  cwd: dir,
5679
5697
  encoding: "utf8",
5680
5698
  timeout: 2e3,
@@ -5682,7 +5700,7 @@ function getProjectName(cwd) {
5682
5700
  }).trim();
5683
5701
  repoRoot = path9.dirname(gitCommonDir);
5684
5702
  } catch {
5685
- repoRoot = execSync3("git rev-parse --show-toplevel", {
5703
+ repoRoot = execSync4("git rev-parse --show-toplevel", {
5686
5704
  cwd: dir,
5687
5705
  encoding: "utf8",
5688
5706
  timeout: 2e3,
@@ -5716,14 +5734,14 @@ var file_grep_exports = {};
5716
5734
  __export(file_grep_exports, {
5717
5735
  grepProjectFiles: () => grepProjectFiles
5718
5736
  });
5719
- import { execSync as execSync4 } from "child_process";
5737
+ import { execSync as execSync5 } from "child_process";
5720
5738
  import { readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync4, existsSync as existsSync9 } from "fs";
5721
5739
  import path10 from "path";
5722
5740
  import crypto2 from "crypto";
5723
5741
  function hasRipgrep() {
5724
5742
  if (_hasRg === null) {
5725
5743
  try {
5726
- execSync4("rg --version", { stdio: "ignore", timeout: 2e3 });
5744
+ execSync5("rg --version", { stdio: "ignore", timeout: 2e3 });
5727
5745
  _hasRg = true;
5728
5746
  } catch {
5729
5747
  _hasRg = false;
@@ -5789,7 +5807,7 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
5789
5807
  const globs = (patterns ?? DEFAULT_PATTERNS).map((p) => `--glob '${p}'`).join(" ");
5790
5808
  const excludes = EXCLUDE_DIRS.map((d) => `--glob '!${d}'`).join(" ");
5791
5809
  const cmd = `rg -i -c --hidden --no-config --no-ignore '${pattern.replace(/'/g, "\\'")}' . ${globs} ${excludes} --max-filesize ${MAX_FILE_SIZE} 2>/dev/null || true`;
5792
- const output = execSync4(cmd, {
5810
+ const output = execSync5(cmd, {
5793
5811
  cwd: projectRoot,
5794
5812
  encoding: "utf8",
5795
5813
  timeout: 3e3,
@@ -5804,12 +5822,12 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
5804
5822
  const matchCount = parseInt(line.slice(colonIdx + 1));
5805
5823
  if (isNaN(matchCount) || matchCount === 0) continue;
5806
5824
  try {
5807
- const firstMatch = execSync4(
5825
+ const firstMatch = execSync5(
5808
5826
  `rg -i -n --hidden '${pattern.replace(/'/g, "\\'")}' '${filePath}' --max-count 1 2>/dev/null | head -1`,
5809
5827
  { cwd: projectRoot, encoding: "utf8", timeout: 1e3 }
5810
5828
  ).trim();
5811
5829
  const lineNum = parseInt(firstMatch.split(":")[0] ?? "1");
5812
- const totalLines = execSync4(`wc -l < '${filePath}'`, {
5830
+ const totalLines = execSync5(`wc -l < '${filePath}'`, {
5813
5831
  cwd: projectRoot,
5814
5832
  encoding: "utf8",
5815
5833
  timeout: 1e3
@@ -1090,7 +1090,7 @@ var init_daemon_auth = __esm({
1090
1090
  // src/lib/exe-daemon-client.ts
1091
1091
  import net from "net";
1092
1092
  import os4 from "os";
1093
- import { spawn } from "child_process";
1093
+ import { spawn, execSync as execSync2 } from "child_process";
1094
1094
  import { randomUUID } from "crypto";
1095
1095
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1096
1096
  import path5 from "path";
@@ -1120,6 +1120,14 @@ function handleData(chunk) {
1120
1120
  }
1121
1121
  }
1122
1122
  }
1123
+ function isZombie(pid) {
1124
+ try {
1125
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1126
+ return state.startsWith("Z");
1127
+ } catch {
1128
+ return false;
1129
+ }
1130
+ }
1123
1131
  function cleanupStaleFiles() {
1124
1132
  if (existsSync5(PID_PATH)) {
1125
1133
  try {
@@ -1127,7 +1135,11 @@ function cleanupStaleFiles() {
1127
1135
  if (pid > 0) {
1128
1136
  try {
1129
1137
  process.kill(pid, 0);
1130
- return;
1138
+ if (!isZombie(pid)) {
1139
+ return;
1140
+ }
1141
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1142
+ `);
1131
1143
  } catch {
1132
1144
  }
1133
1145
  }
@@ -1155,8 +1167,8 @@ function findPackageRoot() {
1155
1167
  function getAvailableMemoryGB() {
1156
1168
  if (process.platform === "darwin") {
1157
1169
  try {
1158
- const { execSync: execSync11 } = __require("child_process");
1159
- const vmstat = execSync11("vm_stat", { encoding: "utf8" });
1170
+ const { execSync: execSync12 } = __require("child_process");
1171
+ const vmstat = execSync12("vm_stat", { encoding: "utf8" });
1160
1172
  const pageSize = 16384;
1161
1173
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1162
1174
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3091,6 +3103,12 @@ async function disposeDatabase() {
3091
3103
  clearInterval(_walCheckpointTimer);
3092
3104
  _walCheckpointTimer = null;
3093
3105
  }
3106
+ if (_client) {
3107
+ try {
3108
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3109
+ } catch {
3110
+ }
3111
+ }
3094
3112
  if (_daemonClient) {
3095
3113
  _daemonClient.close();
3096
3114
  _daemonClient = null;
@@ -3127,7 +3145,7 @@ var init_database = __esm({
3127
3145
  // src/lib/keychain.ts
3128
3146
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3129
3147
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3130
- import { execSync as execSync2 } from "child_process";
3148
+ import { execSync as execSync3 } from "child_process";
3131
3149
  import path6 from "path";
3132
3150
  import os5 from "os";
3133
3151
  function getKeyDir() {
@@ -3144,13 +3162,13 @@ function linuxSecretAvailable() {
3144
3162
  if (process.platform !== "linux") return false;
3145
3163
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3146
3164
  try {
3147
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3165
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3148
3166
  } catch {
3149
3167
  linuxSecretAvailability = false;
3150
3168
  return false;
3151
3169
  }
3152
3170
  try {
3153
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3171
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3154
3172
  linuxSecretAvailability = true;
3155
3173
  } catch {
3156
3174
  linuxSecretAvailability = false;
@@ -3174,7 +3192,7 @@ function macKeychainGet(service = SERVICE) {
3174
3192
  if (!nativeKeychainAllowed()) return null;
3175
3193
  if (process.platform !== "darwin") return null;
3176
3194
  try {
3177
- return execSync2(
3195
+ return execSync3(
3178
3196
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3179
3197
  { encoding: "utf-8", timeout: 5e3 }
3180
3198
  ).trim();
@@ -3187,13 +3205,13 @@ function macKeychainSet(value, service = SERVICE) {
3187
3205
  if (process.platform !== "darwin") return false;
3188
3206
  try {
3189
3207
  try {
3190
- execSync2(
3208
+ execSync3(
3191
3209
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3192
3210
  { timeout: 5e3 }
3193
3211
  );
3194
3212
  } catch {
3195
3213
  }
3196
- execSync2(
3214
+ execSync3(
3197
3215
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3198
3216
  { timeout: 5e3 }
3199
3217
  );
@@ -3206,7 +3224,7 @@ function macKeychainDelete(service = SERVICE) {
3206
3224
  if (!nativeKeychainAllowed()) return false;
3207
3225
  if (process.platform !== "darwin") return false;
3208
3226
  try {
3209
- execSync2(
3227
+ execSync3(
3210
3228
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3211
3229
  { timeout: 5e3 }
3212
3230
  );
@@ -3218,7 +3236,7 @@ function macKeychainDelete(service = SERVICE) {
3218
3236
  function linuxSecretGet(service = SERVICE) {
3219
3237
  if (!linuxSecretAvailable()) return null;
3220
3238
  try {
3221
- return execSync2(
3239
+ return execSync3(
3222
3240
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3223
3241
  { encoding: "utf-8", timeout: 5e3 }
3224
3242
  ).trim();
@@ -3229,7 +3247,7 @@ function linuxSecretGet(service = SERVICE) {
3229
3247
  function linuxSecretSet(value, service = SERVICE) {
3230
3248
  if (!linuxSecretAvailable()) return false;
3231
3249
  try {
3232
- execSync2(
3250
+ execSync3(
3233
3251
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3234
3252
  { timeout: 5e3 }
3235
3253
  );
@@ -3242,7 +3260,7 @@ function linuxSecretDelete(service = SERVICE) {
3242
3260
  if (!nativeKeychainAllowed()) return false;
3243
3261
  if (process.platform !== "linux") return false;
3244
3262
  try {
3245
- execSync2(
3263
+ execSync3(
3246
3264
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3247
3265
  { timeout: 5e3 }
3248
3266
  );
@@ -5453,7 +5471,7 @@ var init_session_registry = __esm({
5453
5471
  });
5454
5472
 
5455
5473
  // src/lib/session-key.ts
5456
- import { execSync as execSync3 } from "child_process";
5474
+ import { execSync as execSync4 } from "child_process";
5457
5475
  function normalizeCommand(command) {
5458
5476
  const trimmed = command.trim().toLowerCase();
5459
5477
  const parts = trimmed.split(/[\\/]/);
@@ -5472,7 +5490,7 @@ function resolveRuntimeProcess() {
5472
5490
  let pid = process.ppid;
5473
5491
  for (let i = 0; i < 10; i++) {
5474
5492
  try {
5475
- const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
5493
+ const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
5476
5494
  encoding: "utf8",
5477
5495
  timeout: 2e3
5478
5496
  }).trim();
@@ -5638,14 +5656,14 @@ var init_transport = __esm({
5638
5656
  });
5639
5657
 
5640
5658
  // src/lib/cc-agent-support.ts
5641
- import { execSync as execSync4 } from "child_process";
5659
+ import { execSync as execSync5 } from "child_process";
5642
5660
  function _resetCcAgentSupportCache() {
5643
5661
  _cachedSupport = null;
5644
5662
  }
5645
5663
  function claudeSupportsAgentFlag() {
5646
5664
  if (_cachedSupport !== null) return _cachedSupport;
5647
5665
  try {
5648
- const helpOutput = execSync4("claude --help 2>&1", {
5666
+ const helpOutput = execSync5("claude --help 2>&1", {
5649
5667
  encoding: "utf-8",
5650
5668
  timeout: 5e3
5651
5669
  });
@@ -6158,7 +6176,7 @@ var init_session_kill_telemetry = __esm({
6158
6176
  });
6159
6177
 
6160
6178
  // src/lib/project-name.ts
6161
- import { execSync as execSync5 } from "child_process";
6179
+ import { execSync as execSync6 } from "child_process";
6162
6180
  import path15 from "path";
6163
6181
  function getProjectName(cwd) {
6164
6182
  const dir = cwd ?? process.cwd();
@@ -6166,7 +6184,7 @@ function getProjectName(cwd) {
6166
6184
  try {
6167
6185
  let repoRoot;
6168
6186
  try {
6169
- const gitCommonDir = execSync5("git rev-parse --path-format=absolute --git-common-dir", {
6187
+ const gitCommonDir = execSync6("git rev-parse --path-format=absolute --git-common-dir", {
6170
6188
  cwd: dir,
6171
6189
  encoding: "utf8",
6172
6190
  timeout: 2e3,
@@ -6174,7 +6192,7 @@ function getProjectName(cwd) {
6174
6192
  }).trim();
6175
6193
  repoRoot = path15.dirname(gitCommonDir);
6176
6194
  } catch {
6177
- repoRoot = execSync5("git rev-parse --show-toplevel", {
6195
+ repoRoot = execSync6("git rev-parse --show-toplevel", {
6178
6196
  cwd: dir,
6179
6197
  encoding: "utf8",
6180
6198
  timeout: 2e3,
@@ -6281,7 +6299,7 @@ __export(tasks_crud_exports, {
6281
6299
  import crypto4 from "crypto";
6282
6300
  import path16 from "path";
6283
6301
  import os11 from "os";
6284
- import { execSync as execSync6 } from "child_process";
6302
+ import { execSync as execSync7 } from "child_process";
6285
6303
  import { mkdir as mkdir4, writeFile as writeFile4, appendFile } from "fs/promises";
6286
6304
  import { existsSync as existsSync15, readFileSync as readFileSync11 } from "fs";
6287
6305
  async function writeCheckpoint(input) {
@@ -6626,14 +6644,14 @@ function isTmuxSessionAlive(identifier) {
6626
6644
  if (!identifier || identifier === "unknown") return true;
6627
6645
  try {
6628
6646
  if (identifier.startsWith("%")) {
6629
- const output = execSync6("tmux list-panes -a -F '#{pane_id}'", {
6647
+ const output = execSync7("tmux list-panes -a -F '#{pane_id}'", {
6630
6648
  timeout: 2e3,
6631
6649
  encoding: "utf8",
6632
6650
  stdio: ["pipe", "pipe", "pipe"]
6633
6651
  });
6634
6652
  return output.split("\n").some((l) => l.trim() === identifier);
6635
6653
  } else {
6636
- execSync6(`tmux has-session -t ${JSON.stringify(identifier)}`, {
6654
+ execSync7(`tmux has-session -t ${JSON.stringify(identifier)}`, {
6637
6655
  timeout: 2e3,
6638
6656
  stdio: ["pipe", "pipe", "pipe"]
6639
6657
  });
@@ -6642,7 +6660,7 @@ function isTmuxSessionAlive(identifier) {
6642
6660
  } catch {
6643
6661
  if (identifier.startsWith("%")) return true;
6644
6662
  try {
6645
- execSync6("tmux list-sessions", {
6663
+ execSync7("tmux list-sessions", {
6646
6664
  timeout: 2e3,
6647
6665
  stdio: ["pipe", "pipe", "pipe"]
6648
6666
  });
@@ -6657,12 +6675,12 @@ function checkStaleCompletion(taskContext, taskCreatedAt) {
6657
6675
  if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
6658
6676
  try {
6659
6677
  const since = new Date(taskCreatedAt).toISOString();
6660
- const branch = execSync6(
6678
+ const branch = execSync7(
6661
6679
  "git rev-parse --abbrev-ref HEAD 2>/dev/null",
6662
6680
  { encoding: "utf8", timeout: 3e3 }
6663
6681
  ).trim();
6664
6682
  const branchArg = branch && branch !== "HEAD" ? branch : "";
6665
- const commitCount = execSync6(
6683
+ const commitCount = execSync7(
6666
6684
  `git log --oneline --since="${since}" ${branchArg} 2>/dev/null | wc -l`,
6667
6685
  { encoding: "utf8", timeout: 5e3 }
6668
6686
  ).trim();
@@ -8261,7 +8279,7 @@ __export(tmux_routing_exports, {
8261
8279
  spawnEmployee: () => spawnEmployee,
8262
8280
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
8263
8281
  });
8264
- import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
8282
+ import { execFileSync as execFileSync2, execSync as execSync8 } from "child_process";
8265
8283
  import { readFileSync as readFileSync12, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, existsSync as existsSync17, appendFileSync, readdirSync as readdirSync4 } from "fs";
8266
8284
  import path20 from "path";
8267
8285
  import os12 from "os";
@@ -8982,7 +9000,7 @@ function spawnEmployee(employeeName, exeSession2, projectDir, opts) {
8982
9000
  let booted = false;
8983
9001
  for (let i = 0; i < 30; i++) {
8984
9002
  try {
8985
- execSync7("sleep 0.5");
9003
+ execSync8("sleep 0.5");
8986
9004
  } catch {
8987
9005
  }
8988
9006
  try {
@@ -9100,7 +9118,7 @@ __export(git_task_sweep_exports, {
9100
9118
  matchScore: () => matchScore,
9101
9119
  sweepTasks: () => sweepTasks
9102
9120
  });
9103
- import { execSync as execSync8 } from "child_process";
9121
+ import { execSync as execSync9 } from "child_process";
9104
9122
  function extractKeywords(text) {
9105
9123
  return text.toLowerCase().replace(/[^a-z0-9\s-]/g, " ").split(/\s+/).filter((w) => w.length >= 3 && !STOP_WORDS.has(w));
9106
9124
  }
@@ -9129,7 +9147,7 @@ function matchScore(task, commitMessage, changedFiles) {
9129
9147
  function getRecentCommits(limit = DEFAULT_COMMIT_LIMIT) {
9130
9148
  try {
9131
9149
  const SEPARATOR = "<<SEP>>";
9132
- const output = execSync8(
9150
+ const output = execSync9(
9133
9151
  `git log --format="%h${SEPARATOR}%s${SEPARATOR}%aI" --name-only -n ${limit} -z`,
9134
9152
  { encoding: "utf8", timeout: 1e4 }
9135
9153
  );
@@ -9320,12 +9338,12 @@ __export(worktree_exports, {
9320
9338
  worktreeBranch: () => worktreeBranch,
9321
9339
  worktreePath: () => worktreePath
9322
9340
  });
9323
- import { execSync as execSync9 } from "child_process";
9341
+ import { execSync as execSync10 } from "child_process";
9324
9342
  import { existsSync as existsSync18, readFileSync as readFileSync13, appendFileSync as appendFileSync2, mkdirSync as mkdirSync9, realpathSync } from "fs";
9325
9343
  import path21 from "path";
9326
9344
  function getGitRoot(dir) {
9327
9345
  try {
9328
- const root = execSync9("git rev-parse --show-toplevel", {
9346
+ const root = execSync10("git rev-parse --show-toplevel", {
9329
9347
  cwd: dir,
9330
9348
  encoding: "utf-8",
9331
9349
  timeout: GIT_TIMEOUT_MS,
@@ -9338,7 +9356,7 @@ function getGitRoot(dir) {
9338
9356
  }
9339
9357
  function getMainRepoRoot(dir) {
9340
9358
  try {
9341
- const commonDir = execSync9(
9359
+ const commonDir = execSync10(
9342
9360
  "git rev-parse --path-format=absolute --git-common-dir",
9343
9361
  { cwd: dir, encoding: "utf-8", timeout: GIT_TIMEOUT_MS, stdio: ["pipe", "pipe", "pipe"] }
9344
9362
  ).trim();
@@ -9369,7 +9387,7 @@ function ensureWorktree(projectDir, employeeName, instance) {
9369
9387
  mkdirSync9(worktreesDir, { recursive: true });
9370
9388
  ensureGitignoreEntry(repoRoot, "/.worktrees/");
9371
9389
  try {
9372
- execSync9("git worktree prune", {
9390
+ execSync10("git worktree prune", {
9373
9391
  cwd: repoRoot,
9374
9392
  encoding: "utf-8",
9375
9393
  timeout: GIT_TIMEOUT_MS,
@@ -9380,14 +9398,14 @@ function ensureWorktree(projectDir, employeeName, instance) {
9380
9398
  const branchExists = branchExistsLocally(repoRoot, branch);
9381
9399
  try {
9382
9400
  if (branchExists) {
9383
- execSync9(`git worktree add "${wtPath}" "${branch}"`, {
9401
+ execSync10(`git worktree add "${wtPath}" "${branch}"`, {
9384
9402
  cwd: repoRoot,
9385
9403
  encoding: "utf-8",
9386
9404
  timeout: GIT_TIMEOUT_MS,
9387
9405
  stdio: ["pipe", "pipe", "pipe"]
9388
9406
  });
9389
9407
  } else {
9390
- execSync9(`git worktree add "${wtPath}" -b "${branch}" HEAD`, {
9408
+ execSync10(`git worktree add "${wtPath}" -b "${branch}" HEAD`, {
9391
9409
  cwd: repoRoot,
9392
9410
  encoding: "utf-8",
9393
9411
  timeout: GIT_TIMEOUT_MS,
@@ -9405,7 +9423,7 @@ function ensureWorktree(projectDir, employeeName, instance) {
9405
9423
  }
9406
9424
  function isWorktreeDirty(wtPath) {
9407
9425
  try {
9408
- const status = execSync9("git status --porcelain", {
9426
+ const status = execSync10("git status --porcelain", {
9409
9427
  cwd: wtPath,
9410
9428
  encoding: "utf-8",
9411
9429
  timeout: GIT_TIMEOUT_MS,
@@ -9435,7 +9453,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
9435
9453
  return { cleaned: false, reason: `branch ${branch} not merged into ${mainBranch}` };
9436
9454
  }
9437
9455
  try {
9438
- execSync9(`git worktree remove "${wtPath}"`, {
9456
+ execSync10(`git worktree remove "${wtPath}"`, {
9439
9457
  cwd: repoRoot,
9440
9458
  encoding: "utf-8",
9441
9459
  timeout: GIT_TIMEOUT_MS,
@@ -9448,7 +9466,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
9448
9466
  };
9449
9467
  }
9450
9468
  try {
9451
- execSync9(`git branch -d "${branch}"`, {
9469
+ execSync10(`git branch -d "${branch}"`, {
9452
9470
  cwd: repoRoot,
9453
9471
  encoding: "utf-8",
9454
9472
  timeout: GIT_TIMEOUT_MS,
@@ -9460,7 +9478,7 @@ function cleanupWorktree(projectDir, employeeName, instance) {
9460
9478
  }
9461
9479
  function branchExistsLocally(repoRoot, branch) {
9462
9480
  try {
9463
- execSync9(`git rev-parse --verify "refs/heads/${branch}"`, {
9481
+ execSync10(`git rev-parse --verify "refs/heads/${branch}"`, {
9464
9482
  cwd: repoRoot,
9465
9483
  encoding: "utf-8",
9466
9484
  timeout: GIT_TIMEOUT_MS,
@@ -9479,7 +9497,7 @@ function detectMainBranch(repoRoot) {
9479
9497
  }
9480
9498
  function isBranchMerged(repoRoot, branch, into) {
9481
9499
  try {
9482
- const merged = execSync9(`git branch --merged "${into}"`, {
9500
+ const merged = execSync10(`git branch --merged "${into}"`, {
9483
9501
  cwd: repoRoot,
9484
9502
  encoding: "utf-8",
9485
9503
  timeout: GIT_TIMEOUT_MS,
@@ -9526,7 +9544,7 @@ init_database();
9526
9544
  init_task_scope();
9527
9545
  init_project_name();
9528
9546
  import crypto7 from "crypto";
9529
- import { execSync as execSync10 } from "child_process";
9547
+ import { execSync as execSync11 } from "child_process";
9530
9548
  var agentName = process.argv[2];
9531
9549
  var exeSession = process.argv[3];
9532
9550
  if (!agentName) process.exit(0);
@@ -9702,7 +9720,7 @@ try {
9702
9720
  }
9703
9721
  const msg = `session-ended: ${agentName} session terminated. ${parts.join(". ")}`;
9704
9722
  try {
9705
- execSync10(`tmux send-keys -t ${JSON.stringify(exeSession)} ${JSON.stringify(msg)} Enter`, {
9723
+ execSync11(`tmux send-keys -t ${JSON.stringify(exeSession)} ${JSON.stringify(msg)} Enter`, {
9706
9724
  timeout: 3e3
9707
9725
  });
9708
9726
  } catch {
@@ -9718,6 +9736,11 @@ try {
9718
9736
  }
9719
9737
  } catch {
9720
9738
  }
9739
+ try {
9740
+ const client = getClient();
9741
+ await client.execute("PRAGMA wal_checkpoint(PASSIVE)");
9742
+ } catch {
9743
+ }
9721
9744
  try {
9722
9745
  const { cleanupWorktree: cleanupWorktree2 } = await Promise.resolve().then(() => (init_worktree(), worktree_exports));
9723
9746
  const cleanup = cleanupWorktree2(process.cwd(), agentName);