@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
@@ -1006,7 +1006,7 @@ __export(exe_daemon_client_exports, {
1006
1006
  });
1007
1007
  import net from "net";
1008
1008
  import os4 from "os";
1009
- import { spawn } from "child_process";
1009
+ import { spawn, execSync as execSync2 } from "child_process";
1010
1010
  import { randomUUID } from "crypto";
1011
1011
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1012
1012
  import path5 from "path";
@@ -1036,6 +1036,14 @@ function handleData(chunk) {
1036
1036
  }
1037
1037
  }
1038
1038
  }
1039
+ function isZombie(pid) {
1040
+ try {
1041
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1042
+ return state.startsWith("Z");
1043
+ } catch {
1044
+ return false;
1045
+ }
1046
+ }
1039
1047
  function cleanupStaleFiles() {
1040
1048
  if (existsSync5(PID_PATH)) {
1041
1049
  try {
@@ -1043,7 +1051,11 @@ function cleanupStaleFiles() {
1043
1051
  if (pid > 0) {
1044
1052
  try {
1045
1053
  process.kill(pid, 0);
1046
- return;
1054
+ if (!isZombie(pid)) {
1055
+ return;
1056
+ }
1057
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1058
+ `);
1047
1059
  } catch {
1048
1060
  }
1049
1061
  }
@@ -1071,8 +1083,8 @@ function findPackageRoot() {
1071
1083
  function getAvailableMemoryGB() {
1072
1084
  if (process.platform === "darwin") {
1073
1085
  try {
1074
- const { execSync: execSync3 } = __require("child_process");
1075
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1086
+ const { execSync: execSync4 } = __require("child_process");
1087
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1076
1088
  const pageSize = 16384;
1077
1089
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1078
1090
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3062,6 +3074,12 @@ async function disposeDatabase() {
3062
3074
  clearInterval(_walCheckpointTimer);
3063
3075
  _walCheckpointTimer = null;
3064
3076
  }
3077
+ if (_client) {
3078
+ try {
3079
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3080
+ } catch {
3081
+ }
3082
+ }
3065
3083
  if (_daemonClient) {
3066
3084
  _daemonClient.close();
3067
3085
  _daemonClient = null;
@@ -3098,7 +3116,7 @@ var init_database = __esm({
3098
3116
  // src/lib/keychain.ts
3099
3117
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3100
3118
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3101
- import { execSync as execSync2 } from "child_process";
3119
+ import { execSync as execSync3 } from "child_process";
3102
3120
  import path6 from "path";
3103
3121
  import os5 from "os";
3104
3122
  function getKeyDir() {
@@ -3115,13 +3133,13 @@ function linuxSecretAvailable() {
3115
3133
  if (process.platform !== "linux") return false;
3116
3134
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3117
3135
  try {
3118
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3136
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3119
3137
  } catch {
3120
3138
  linuxSecretAvailability = false;
3121
3139
  return false;
3122
3140
  }
3123
3141
  try {
3124
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3142
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3125
3143
  linuxSecretAvailability = true;
3126
3144
  } catch {
3127
3145
  linuxSecretAvailability = false;
@@ -3145,7 +3163,7 @@ function macKeychainGet(service = SERVICE) {
3145
3163
  if (!nativeKeychainAllowed()) return null;
3146
3164
  if (process.platform !== "darwin") return null;
3147
3165
  try {
3148
- return execSync2(
3166
+ return execSync3(
3149
3167
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3150
3168
  { encoding: "utf-8", timeout: 5e3 }
3151
3169
  ).trim();
@@ -3158,13 +3176,13 @@ function macKeychainSet(value, service = SERVICE) {
3158
3176
  if (process.platform !== "darwin") return false;
3159
3177
  try {
3160
3178
  try {
3161
- execSync2(
3179
+ execSync3(
3162
3180
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3163
3181
  { timeout: 5e3 }
3164
3182
  );
3165
3183
  } catch {
3166
3184
  }
3167
- execSync2(
3185
+ execSync3(
3168
3186
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3169
3187
  { timeout: 5e3 }
3170
3188
  );
@@ -3177,7 +3195,7 @@ function macKeychainDelete(service = SERVICE) {
3177
3195
  if (!nativeKeychainAllowed()) return false;
3178
3196
  if (process.platform !== "darwin") return false;
3179
3197
  try {
3180
- execSync2(
3198
+ execSync3(
3181
3199
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3182
3200
  { timeout: 5e3 }
3183
3201
  );
@@ -3189,7 +3207,7 @@ function macKeychainDelete(service = SERVICE) {
3189
3207
  function linuxSecretGet(service = SERVICE) {
3190
3208
  if (!linuxSecretAvailable()) return null;
3191
3209
  try {
3192
- return execSync2(
3210
+ return execSync3(
3193
3211
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3194
3212
  { encoding: "utf-8", timeout: 5e3 }
3195
3213
  ).trim();
@@ -3200,7 +3218,7 @@ function linuxSecretGet(service = SERVICE) {
3200
3218
  function linuxSecretSet(value, service = SERVICE) {
3201
3219
  if (!linuxSecretAvailable()) return false;
3202
3220
  try {
3203
- execSync2(
3221
+ execSync3(
3204
3222
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3205
3223
  { timeout: 5e3 }
3206
3224
  );
@@ -3213,7 +3231,7 @@ function linuxSecretDelete(service = SERVICE) {
3213
3231
  if (!nativeKeychainAllowed()) return false;
3214
3232
  if (process.platform !== "linux") return false;
3215
3233
  try {
3216
- execSync2(
3234
+ execSync3(
3217
3235
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3218
3236
  { timeout: 5e3 }
3219
3237
  );
@@ -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