@askexenow/exe-os 0.9.85 → 0.9.87

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 (86) hide show
  1. package/dist/bin/agentic-ontology-backfill.js +50 -14
  2. package/dist/bin/agentic-reflection-backfill.js +50 -14
  3. package/dist/bin/agentic-semantic-label.js +50 -14
  4. package/dist/bin/backfill-conversations.js +50 -14
  5. package/dist/bin/backfill-responses.js +50 -14
  6. package/dist/bin/backfill-vectors.js +50 -14
  7. package/dist/bin/bulk-sync-postgres.js +50 -14
  8. package/dist/bin/cleanup-stale-review-tasks.js +53 -17
  9. package/dist/bin/cli.js +339 -81
  10. package/dist/bin/exe-agent.js +18 -0
  11. package/dist/bin/exe-assign.js +50 -14
  12. package/dist/bin/exe-boot.js +75 -39
  13. package/dist/bin/exe-call.js +18 -0
  14. package/dist/bin/exe-cloud.js +40 -4
  15. package/dist/bin/exe-dispatch.js +61 -25
  16. package/dist/bin/exe-doctor.js +40 -4
  17. package/dist/bin/exe-export-behaviors.js +50 -14
  18. package/dist/bin/exe-forget.js +50 -14
  19. package/dist/bin/exe-gateway.js +65 -29
  20. package/dist/bin/exe-heartbeat.js +55 -19
  21. package/dist/bin/exe-kill.js +54 -18
  22. package/dist/bin/exe-launch-agent.js +58 -22
  23. package/dist/bin/exe-new-employee.js +33 -2
  24. package/dist/bin/exe-pending-messages.js +53 -17
  25. package/dist/bin/exe-pending-notifications.js +53 -17
  26. package/dist/bin/exe-pending-reviews.js +55 -19
  27. package/dist/bin/exe-rename.js +52 -16
  28. package/dist/bin/exe-review.js +50 -14
  29. package/dist/bin/exe-search.js +58 -22
  30. package/dist/bin/exe-session-cleanup.js +85 -44
  31. package/dist/bin/exe-start-codex.js +57 -21
  32. package/dist/bin/exe-start-opencode.js +55 -19
  33. package/dist/bin/exe-status.js +62 -26
  34. package/dist/bin/exe-team.js +50 -14
  35. package/dist/bin/git-sweep.js +63 -27
  36. package/dist/bin/graph-backfill.js +50 -14
  37. package/dist/bin/graph-export.js +50 -14
  38. package/dist/bin/install.js +9 -0
  39. package/dist/bin/intercom-check.js +67 -31
  40. package/dist/bin/scan-tasks.js +63 -27
  41. package/dist/bin/setup.js +53 -13
  42. package/dist/bin/shard-migrate.js +50 -14
  43. package/dist/bin/stack-update.js +59 -2
  44. package/dist/bin/update.js +1 -1
  45. package/dist/gateway/index.js +65 -29
  46. package/dist/hooks/bug-report-worker.js +65 -29
  47. package/dist/hooks/codex-stop-task-finalizer.js +59 -23
  48. package/dist/hooks/commit-complete.js +64 -28
  49. package/dist/hooks/error-recall.js +62 -26
  50. package/dist/hooks/ingest-worker.js +4 -4
  51. package/dist/hooks/ingest.js +56 -20
  52. package/dist/hooks/instructions-loaded.js +50 -14
  53. package/dist/hooks/notification.js +50 -14
  54. package/dist/hooks/post-compact.js +50 -14
  55. package/dist/hooks/post-tool-combined.js +63 -27
  56. package/dist/hooks/pre-compact.js +61 -25
  57. package/dist/hooks/pre-tool-use.js +58 -22
  58. package/dist/hooks/prompt-submit.js +78 -42
  59. package/dist/hooks/session-end.js +66 -30
  60. package/dist/hooks/session-start.js +68 -32
  61. package/dist/hooks/stop.js +53 -17
  62. package/dist/hooks/subagent-stop.js +50 -14
  63. package/dist/hooks/summary-worker.js +55 -19
  64. package/dist/index.js +61 -25
  65. package/dist/lib/cloud-sync.js +32 -14
  66. package/dist/lib/database.js +22 -4
  67. package/dist/lib/db-daemon-client.js +16 -4
  68. package/dist/lib/db.js +22 -4
  69. package/dist/lib/device-registry.js +22 -4
  70. package/dist/lib/embedder.js +16 -4
  71. package/dist/lib/employee-templates.js +18 -0
  72. package/dist/lib/exe-daemon-client.js +16 -4
  73. package/dist/lib/exe-daemon.js +874 -232
  74. package/dist/lib/hybrid-search.js +58 -22
  75. package/dist/lib/identity-templates.js +6 -2
  76. package/dist/lib/schedules.js +53 -17
  77. package/dist/lib/skill-learning.js +16 -4
  78. package/dist/lib/store.js +50 -14
  79. package/dist/lib/tasks.js +16 -4
  80. package/dist/lib/tmux-routing.js +18 -6
  81. package/dist/mcp/server.js +809 -200
  82. package/dist/mcp/tools/create-task.js +24 -8
  83. package/dist/mcp/tools/update-task.js +18 -6
  84. package/dist/runtime/index.js +61 -25
  85. package/dist/tui/App.js +91 -55
  86. package/package.json +1 -1
@@ -1031,7 +1031,7 @@ __export(exe_daemon_client_exports, {
1031
1031
  });
1032
1032
  import net from "net";
1033
1033
  import os4 from "os";
1034
- import { spawn } from "child_process";
1034
+ import { spawn, execSync as execSync2 } from "child_process";
1035
1035
  import { randomUUID } from "crypto";
1036
1036
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1037
1037
  import path5 from "path";
@@ -1061,6 +1061,14 @@ function handleData(chunk) {
1061
1061
  }
1062
1062
  }
1063
1063
  }
1064
+ function isZombie(pid) {
1065
+ try {
1066
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1067
+ return state.startsWith("Z");
1068
+ } catch {
1069
+ return false;
1070
+ }
1071
+ }
1064
1072
  function cleanupStaleFiles() {
1065
1073
  if (existsSync5(PID_PATH)) {
1066
1074
  try {
@@ -1068,7 +1076,11 @@ function cleanupStaleFiles() {
1068
1076
  if (pid > 0) {
1069
1077
  try {
1070
1078
  process.kill(pid, 0);
1071
- return;
1079
+ if (!isZombie(pid)) {
1080
+ return;
1081
+ }
1082
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1083
+ `);
1072
1084
  } catch {
1073
1085
  }
1074
1086
  }
@@ -1096,8 +1108,8 @@ function findPackageRoot() {
1096
1108
  function getAvailableMemoryGB() {
1097
1109
  if (process.platform === "darwin") {
1098
1110
  try {
1099
- const { execSync: execSync5 } = __require("child_process");
1100
- const vmstat = execSync5("vm_stat", { encoding: "utf8" });
1111
+ const { execSync: execSync6 } = __require("child_process");
1112
+ const vmstat = execSync6("vm_stat", { encoding: "utf8" });
1101
1113
  const pageSize = 16384;
1102
1114
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1103
1115
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3087,6 +3099,12 @@ async function disposeDatabase() {
3087
3099
  clearInterval(_walCheckpointTimer);
3088
3100
  _walCheckpointTimer = null;
3089
3101
  }
3102
+ if (_client) {
3103
+ try {
3104
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3105
+ } catch {
3106
+ }
3107
+ }
3090
3108
  if (_daemonClient) {
3091
3109
  _daemonClient.close();
3092
3110
  _daemonClient = null;
@@ -3123,7 +3141,7 @@ var init_database = __esm({
3123
3141
  // src/lib/keychain.ts
3124
3142
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3125
3143
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3126
- import { execSync as execSync2 } from "child_process";
3144
+ import { execSync as execSync3 } from "child_process";
3127
3145
  import path6 from "path";
3128
3146
  import os5 from "os";
3129
3147
  function getKeyDir() {
@@ -3140,13 +3158,13 @@ function linuxSecretAvailable() {
3140
3158
  if (process.platform !== "linux") return false;
3141
3159
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3142
3160
  try {
3143
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3161
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3144
3162
  } catch {
3145
3163
  linuxSecretAvailability = false;
3146
3164
  return false;
3147
3165
  }
3148
3166
  try {
3149
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3167
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3150
3168
  linuxSecretAvailability = true;
3151
3169
  } catch {
3152
3170
  linuxSecretAvailability = false;
@@ -3170,7 +3188,7 @@ function macKeychainGet(service = SERVICE) {
3170
3188
  if (!nativeKeychainAllowed()) return null;
3171
3189
  if (process.platform !== "darwin") return null;
3172
3190
  try {
3173
- return execSync2(
3191
+ return execSync3(
3174
3192
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3175
3193
  { encoding: "utf-8", timeout: 5e3 }
3176
3194
  ).trim();
@@ -3183,13 +3201,13 @@ function macKeychainSet(value, service = SERVICE) {
3183
3201
  if (process.platform !== "darwin") return false;
3184
3202
  try {
3185
3203
  try {
3186
- execSync2(
3204
+ execSync3(
3187
3205
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3188
3206
  { timeout: 5e3 }
3189
3207
  );
3190
3208
  } catch {
3191
3209
  }
3192
- execSync2(
3210
+ execSync3(
3193
3211
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3194
3212
  { timeout: 5e3 }
3195
3213
  );
@@ -3202,7 +3220,7 @@ function macKeychainDelete(service = SERVICE) {
3202
3220
  if (!nativeKeychainAllowed()) return false;
3203
3221
  if (process.platform !== "darwin") return false;
3204
3222
  try {
3205
- execSync2(
3223
+ execSync3(
3206
3224
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3207
3225
  { timeout: 5e3 }
3208
3226
  );
@@ -3214,7 +3232,7 @@ function macKeychainDelete(service = SERVICE) {
3214
3232
  function linuxSecretGet(service = SERVICE) {
3215
3233
  if (!linuxSecretAvailable()) return null;
3216
3234
  try {
3217
- return execSync2(
3235
+ return execSync3(
3218
3236
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3219
3237
  { encoding: "utf-8", timeout: 5e3 }
3220
3238
  ).trim();
@@ -3225,7 +3243,7 @@ function linuxSecretGet(service = SERVICE) {
3225
3243
  function linuxSecretSet(value, service = SERVICE) {
3226
3244
  if (!linuxSecretAvailable()) return false;
3227
3245
  try {
3228
- execSync2(
3246
+ execSync3(
3229
3247
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3230
3248
  { timeout: 5e3 }
3231
3249
  );
@@ -3238,7 +3256,7 @@ function linuxSecretDelete(service = SERVICE) {
3238
3256
  if (!nativeKeychainAllowed()) return false;
3239
3257
  if (process.platform !== "linux") return false;
3240
3258
  try {
3241
- execSync2(
3259
+ execSync3(
3242
3260
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3243
3261
  { timeout: 5e3 }
3244
3262
  );
@@ -4175,6 +4193,24 @@ var init_platform_procedures = __esm({
4175
4193
  priority: "p0",
4176
4194
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
4177
4195
  },
4196
+ {
4197
+ title: "Bug report status check \u2014 surface available fixes on boot",
4198
+ domain: "support",
4199
+ priority: "p1",
4200
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4201
+ },
4202
+ {
4203
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4204
+ domain: "support",
4205
+ priority: "p0",
4206
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
4207
+ },
4208
+ {
4209
+ title: "Feature request status check \u2014 surface shipped features on boot",
4210
+ domain: "support",
4211
+ priority: "p1",
4212
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4213
+ },
4178
4214
  // --- Operations ---
4179
4215
  {
4180
4216
  title: "Managers must supervise deployed workers",
@@ -5426,7 +5462,7 @@ var init_session_registry = __esm({
5426
5462
  });
5427
5463
 
5428
5464
  // src/lib/session-key.ts
5429
- import { execSync as execSync3 } from "child_process";
5465
+ import { execSync as execSync4 } from "child_process";
5430
5466
  function normalizeCommand(command) {
5431
5467
  const trimmed = command.trim().toLowerCase();
5432
5468
  const parts = trimmed.split(/[\\/]/);
@@ -5445,7 +5481,7 @@ function resolveRuntimeProcess() {
5445
5481
  let pid = process.ppid;
5446
5482
  for (let i = 0; i < 10; i++) {
5447
5483
  try {
5448
- const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
5484
+ const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
5449
5485
  encoding: "utf8",
5450
5486
  timeout: 2e3
5451
5487
  }).trim();
@@ -5611,7 +5647,7 @@ var init_transport = __esm({
5611
5647
  });
5612
5648
 
5613
5649
  // src/lib/cc-agent-support.ts
5614
- import { execSync as execSync4 } from "child_process";
5650
+ import { execSync as execSync5 } from "child_process";
5615
5651
  var init_cc_agent_support = __esm({
5616
5652
  "src/lib/cc-agent-support.ts"() {
5617
5653
  "use strict";
@@ -6030,8 +6066,8 @@ function hashOutput(text) {
6030
6066
  async function queryPendingReviews() {
6031
6067
  let sessionScope;
6032
6068
  try {
6033
- const { execSync: execSync5 } = await import("child_process");
6034
- const tmuxSession = execSync5("tmux display-message -p '#{session_name}'", { encoding: "utf8", timeout: 2e3 }).trim();
6069
+ const { execSync: execSync6 } = await import("child_process");
6070
+ const tmuxSession = execSync6("tmux display-message -p '#{session_name}'", { encoding: "utf8", timeout: 2e3 }).trim();
6035
6071
  if (isExeSession(tmuxSession)) sessionScope = tmuxSession;
6036
6072
  } catch {
6037
6073
  }
@@ -992,7 +992,7 @@ __export(exe_daemon_client_exports, {
992
992
  });
993
993
  import net from "net";
994
994
  import os4 from "os";
995
- import { spawn } from "child_process";
995
+ import { spawn, execSync as execSync2 } from "child_process";
996
996
  import { randomUUID } from "crypto";
997
997
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
998
998
  import path5 from "path";
@@ -1022,6 +1022,14 @@ function handleData(chunk) {
1022
1022
  }
1023
1023
  }
1024
1024
  }
1025
+ function isZombie(pid) {
1026
+ try {
1027
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1028
+ return state.startsWith("Z");
1029
+ } catch {
1030
+ return false;
1031
+ }
1032
+ }
1025
1033
  function cleanupStaleFiles() {
1026
1034
  if (existsSync5(PID_PATH)) {
1027
1035
  try {
@@ -1029,7 +1037,11 @@ function cleanupStaleFiles() {
1029
1037
  if (pid > 0) {
1030
1038
  try {
1031
1039
  process.kill(pid, 0);
1032
- return;
1040
+ if (!isZombie(pid)) {
1041
+ return;
1042
+ }
1043
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1044
+ `);
1033
1045
  } catch {
1034
1046
  }
1035
1047
  }
@@ -1057,8 +1069,8 @@ function findPackageRoot() {
1057
1069
  function getAvailableMemoryGB() {
1058
1070
  if (process.platform === "darwin") {
1059
1071
  try {
1060
- const { execSync: execSync4 } = __require("child_process");
1061
- const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1072
+ const { execSync: execSync5 } = __require("child_process");
1073
+ const vmstat = execSync5("vm_stat", { encoding: "utf8" });
1062
1074
  const pageSize = 16384;
1063
1075
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1064
1076
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3048,6 +3060,12 @@ async function disposeDatabase() {
3048
3060
  clearInterval(_walCheckpointTimer);
3049
3061
  _walCheckpointTimer = null;
3050
3062
  }
3063
+ if (_client) {
3064
+ try {
3065
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3066
+ } catch {
3067
+ }
3068
+ }
3051
3069
  if (_daemonClient) {
3052
3070
  _daemonClient.close();
3053
3071
  _daemonClient = null;
@@ -3084,7 +3102,7 @@ var init_database = __esm({
3084
3102
  // src/lib/keychain.ts
3085
3103
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3086
3104
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3087
- import { execSync as execSync2 } from "child_process";
3105
+ import { execSync as execSync3 } from "child_process";
3088
3106
  import path6 from "path";
3089
3107
  import os5 from "os";
3090
3108
  function getKeyDir() {
@@ -3101,13 +3119,13 @@ function linuxSecretAvailable() {
3101
3119
  if (process.platform !== "linux") return false;
3102
3120
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3103
3121
  try {
3104
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3122
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3105
3123
  } catch {
3106
3124
  linuxSecretAvailability = false;
3107
3125
  return false;
3108
3126
  }
3109
3127
  try {
3110
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3128
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3111
3129
  linuxSecretAvailability = true;
3112
3130
  } catch {
3113
3131
  linuxSecretAvailability = false;
@@ -3131,7 +3149,7 @@ function macKeychainGet(service = SERVICE) {
3131
3149
  if (!nativeKeychainAllowed()) return null;
3132
3150
  if (process.platform !== "darwin") return null;
3133
3151
  try {
3134
- return execSync2(
3152
+ return execSync3(
3135
3153
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3136
3154
  { encoding: "utf-8", timeout: 5e3 }
3137
3155
  ).trim();
@@ -3144,13 +3162,13 @@ function macKeychainSet(value, service = SERVICE) {
3144
3162
  if (process.platform !== "darwin") return false;
3145
3163
  try {
3146
3164
  try {
3147
- execSync2(
3165
+ execSync3(
3148
3166
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3149
3167
  { timeout: 5e3 }
3150
3168
  );
3151
3169
  } catch {
3152
3170
  }
3153
- execSync2(
3171
+ execSync3(
3154
3172
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3155
3173
  { timeout: 5e3 }
3156
3174
  );
@@ -3163,7 +3181,7 @@ function macKeychainDelete(service = SERVICE) {
3163
3181
  if (!nativeKeychainAllowed()) return false;
3164
3182
  if (process.platform !== "darwin") return false;
3165
3183
  try {
3166
- execSync2(
3184
+ execSync3(
3167
3185
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3168
3186
  { timeout: 5e3 }
3169
3187
  );
@@ -3175,7 +3193,7 @@ function macKeychainDelete(service = SERVICE) {
3175
3193
  function linuxSecretGet(service = SERVICE) {
3176
3194
  if (!linuxSecretAvailable()) return null;
3177
3195
  try {
3178
- return execSync2(
3196
+ return execSync3(
3179
3197
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3180
3198
  { encoding: "utf-8", timeout: 5e3 }
3181
3199
  ).trim();
@@ -3186,7 +3204,7 @@ function linuxSecretGet(service = SERVICE) {
3186
3204
  function linuxSecretSet(value, service = SERVICE) {
3187
3205
  if (!linuxSecretAvailable()) return false;
3188
3206
  try {
3189
- execSync2(
3207
+ execSync3(
3190
3208
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3191
3209
  { timeout: 5e3 }
3192
3210
  );
@@ -3199,7 +3217,7 @@ function linuxSecretDelete(service = SERVICE) {
3199
3217
  if (!nativeKeychainAllowed()) return false;
3200
3218
  if (process.platform !== "linux") return false;
3201
3219
  try {
3202
- execSync2(
3220
+ execSync3(
3203
3221
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3204
3222
  { timeout: 5e3 }
3205
3223
  );
@@ -4136,6 +4154,24 @@ var init_platform_procedures = __esm({
4136
4154
  priority: "p0",
4137
4155
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
4138
4156
  },
4157
+ {
4158
+ title: "Bug report status check \u2014 surface available fixes on boot",
4159
+ domain: "support",
4160
+ priority: "p1",
4161
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4162
+ },
4163
+ {
4164
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4165
+ domain: "support",
4166
+ priority: "p0",
4167
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
4168
+ },
4169
+ {
4170
+ title: "Feature request status check \u2014 surface shipped features on boot",
4171
+ domain: "support",
4172
+ priority: "p1",
4173
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4174
+ },
4139
4175
  // --- Operations ---
4140
4176
  {
4141
4177
  title: "Managers must supervise deployed workers",
@@ -5377,7 +5413,7 @@ var init_store = __esm({
5377
5413
 
5378
5414
  // src/bin/exe-kill.ts
5379
5415
  init_store();
5380
- import { execSync as execSync3 } from "child_process";
5416
+ import { execSync as execSync4 } from "child_process";
5381
5417
 
5382
5418
  // src/bin/fast-db-init.ts
5383
5419
  async function fastDbInit() {
@@ -5489,7 +5525,7 @@ function listSessions() {
5489
5525
  var MANUAL_KILL_REASON = "manual";
5490
5526
  function listLiveSessions() {
5491
5527
  try {
5492
- const out = execSync3("tmux list-sessions -F '#{session_name}' 2>/dev/null", {
5528
+ const out = execSync4("tmux list-sessions -F '#{session_name}' 2>/dev/null", {
5493
5529
  encoding: "utf8",
5494
5530
  timeout: 3e3
5495
5531
  });
@@ -5500,7 +5536,7 @@ function listLiveSessions() {
5500
5536
  }
5501
5537
  function currentExeSession() {
5502
5538
  try {
5503
- return execSync3("tmux display-message -p '#{session_name}' 2>/dev/null", {
5539
+ return execSync4("tmux display-message -p '#{session_name}' 2>/dev/null", {
5504
5540
  encoding: "utf8",
5505
5541
  timeout: 3e3
5506
5542
  }).trim() || null;
@@ -5523,7 +5559,7 @@ function resolveAgentId(sessionName, fallbackName) {
5523
5559
  return entry?.agentId ?? fallbackName;
5524
5560
  }
5525
5561
  function killTmuxSession(sessionName) {
5526
- execSync3(
5562
+ execSync4(
5527
5563
  `tmux kill-session -t ${JSON.stringify(sessionName)} 2>/dev/null`,
5528
5564
  { stdio: "ignore" }
5529
5565
  );
@@ -1090,7 +1090,7 @@ __export(exe_daemon_client_exports, {
1090
1090
  });
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: execSync7 } = __require("child_process");
1159
- const vmstat = execSync7("vm_stat", { encoding: "utf8" });
1170
+ const { execSync: execSync8 } = __require("child_process");
1171
+ const vmstat = execSync8("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;
@@ -3146,6 +3158,12 @@ async function disposeDatabase() {
3146
3158
  clearInterval(_walCheckpointTimer);
3147
3159
  _walCheckpointTimer = null;
3148
3160
  }
3161
+ if (_client) {
3162
+ try {
3163
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3164
+ } catch {
3165
+ }
3166
+ }
3149
3167
  if (_daemonClient) {
3150
3168
  _daemonClient.close();
3151
3169
  _daemonClient = null;
@@ -3182,7 +3200,7 @@ var init_database = __esm({
3182
3200
  // src/lib/keychain.ts
3183
3201
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3184
3202
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3185
- import { execSync as execSync2 } from "child_process";
3203
+ import { execSync as execSync3 } from "child_process";
3186
3204
  import path6 from "path";
3187
3205
  import os5 from "os";
3188
3206
  function getKeyDir() {
@@ -3199,13 +3217,13 @@ function linuxSecretAvailable() {
3199
3217
  if (process.platform !== "linux") return false;
3200
3218
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3201
3219
  try {
3202
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3220
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3203
3221
  } catch {
3204
3222
  linuxSecretAvailability = false;
3205
3223
  return false;
3206
3224
  }
3207
3225
  try {
3208
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3226
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3209
3227
  linuxSecretAvailability = true;
3210
3228
  } catch {
3211
3229
  linuxSecretAvailability = false;
@@ -3229,7 +3247,7 @@ function macKeychainGet(service = SERVICE) {
3229
3247
  if (!nativeKeychainAllowed()) return null;
3230
3248
  if (process.platform !== "darwin") return null;
3231
3249
  try {
3232
- return execSync2(
3250
+ return execSync3(
3233
3251
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3234
3252
  { encoding: "utf-8", timeout: 5e3 }
3235
3253
  ).trim();
@@ -3242,13 +3260,13 @@ function macKeychainSet(value, service = SERVICE) {
3242
3260
  if (process.platform !== "darwin") return false;
3243
3261
  try {
3244
3262
  try {
3245
- execSync2(
3263
+ execSync3(
3246
3264
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3247
3265
  { timeout: 5e3 }
3248
3266
  );
3249
3267
  } catch {
3250
3268
  }
3251
- execSync2(
3269
+ execSync3(
3252
3270
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3253
3271
  { timeout: 5e3 }
3254
3272
  );
@@ -3261,7 +3279,7 @@ function macKeychainDelete(service = SERVICE) {
3261
3279
  if (!nativeKeychainAllowed()) return false;
3262
3280
  if (process.platform !== "darwin") return false;
3263
3281
  try {
3264
- execSync2(
3282
+ execSync3(
3265
3283
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3266
3284
  { timeout: 5e3 }
3267
3285
  );
@@ -3273,7 +3291,7 @@ function macKeychainDelete(service = SERVICE) {
3273
3291
  function linuxSecretGet(service = SERVICE) {
3274
3292
  if (!linuxSecretAvailable()) return null;
3275
3293
  try {
3276
- return execSync2(
3294
+ return execSync3(
3277
3295
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3278
3296
  { encoding: "utf-8", timeout: 5e3 }
3279
3297
  ).trim();
@@ -3284,7 +3302,7 @@ function linuxSecretGet(service = SERVICE) {
3284
3302
  function linuxSecretSet(value, service = SERVICE) {
3285
3303
  if (!linuxSecretAvailable()) return false;
3286
3304
  try {
3287
- execSync2(
3305
+ execSync3(
3288
3306
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3289
3307
  { timeout: 5e3 }
3290
3308
  );
@@ -3297,7 +3315,7 @@ function linuxSecretDelete(service = SERVICE) {
3297
3315
  if (!nativeKeychainAllowed()) return false;
3298
3316
  if (process.platform !== "linux") return false;
3299
3317
  try {
3300
- execSync2(
3318
+ execSync3(
3301
3319
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3302
3320
  { timeout: 5e3 }
3303
3321
  );
@@ -4234,6 +4252,24 @@ var init_platform_procedures = __esm({
4234
4252
  priority: "p0",
4235
4253
  content: "When an agent encounters a suspected Exe OS bug, update breakage, MCP/tool failure, installer issue, memory/orchestration defect, or customer-local patch need, it MUST use create_bug_report. Do this before or alongside any local workaround so the report reaches AskExe support directly via the customer's license. Do NOT ask the founder for permission to file a required bug report. If create_bug_report is deferred/lazy-loaded, load it and call it. If it is unavailable in the live MCP surface, report 'create_bug_report unavailable in this session' and save a local report in exe/output \u2014 never claim the tool does not exist unless the live MCP surface was checked. If upstream delivery fails, call support_test (MCP) and include its result in the local report so AskExe can distinguish customer setup, license provisioning, and server intake issues; only ask the founder to run `exe-os support test` if MCP is disconnected/unavailable. Classify first: upstream_bug = reproducible exe-os/platform defect; customer_customization = identity, behavior, procedure, config, branding, workflow preference that belongs in customer-owned layers; emergency_hotfix = temporary local patch. For upstream bugs/emergency hotfixes include version, repro steps, expected/actual, files changed, workaround, and local diff summary. Avoid permanent platform-code patches unless founder approves; if a hotfix is unavoidable, document it in the bug report and re-check after npm update."
4236
4254
  },
4255
+ {
4256
+ title: "Bug report status check \u2014 surface available fixes on boot",
4257
+ domain: "support",
4258
+ priority: "p1",
4259
+ content: "Once per session (COO boot only, never repeat), call list_my_bug_reports to check if any previously filed bug reports have been fixed by AskExe. If any report has status 'fixed' with a fixed_version, surface it to the founder immediately: '\u{1F527} N bug fix(es) available \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no reports exist or none are fixed, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4260
+ },
4261
+ {
4262
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4263
+ domain: "support",
4264
+ priority: "p0",
4265
+ content: "When an agent or founder identifies a desired capability that exe-os does not yet provide, the COO (or equivalent coordinator) must decide: is this a local customization (identity, behavior, procedure, config, branding, workflow preference that can be configured in customer-owned layers) or an upstream feature request (a platform capability that requires changes to exe-os code, shipped via npm update)? Local customizations: implement immediately using store_behavior, update_identity, company_procedure, or config changes. Upstream features: use create_feature_request to submit to AskExe. Include use case, business impact, and current workaround. Do NOT ask the founder for permission to file a feature request \u2014 file it proactively when the need is clear."
4266
+ },
4267
+ {
4268
+ title: "Feature request status check \u2014 surface shipped features on boot",
4269
+ domain: "support",
4270
+ priority: "p1",
4271
+ content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
4272
+ },
4237
4273
  // --- Operations ---
4238
4274
  {
4239
4275
  title: "Managers must supervise deployed workers",
@@ -5536,7 +5572,7 @@ var init_agent_config = __esm({
5536
5572
  });
5537
5573
 
5538
5574
  // src/lib/session-key.ts
5539
- import { execSync as execSync4 } from "child_process";
5575
+ import { execSync as execSync5 } from "child_process";
5540
5576
  function normalizeCommand(command) {
5541
5577
  const trimmed = command.trim().toLowerCase();
5542
5578
  const parts = trimmed.split(/[\\/]/);
@@ -5555,7 +5591,7 @@ function resolveRuntimeProcess() {
5555
5591
  let pid = process.ppid;
5556
5592
  for (let i = 0; i < 10; i++) {
5557
5593
  try {
5558
- const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
5594
+ const info = execSync5(`ps -p ${pid} -o ppid=,comm=`, {
5559
5595
  encoding: "utf8",
5560
5596
  timeout: 2e3
5561
5597
  }).trim();
@@ -5627,7 +5663,7 @@ __export(active_agent_exports, {
5627
5663
  writeActiveAgent: () => writeActiveAgent
5628
5664
  });
5629
5665
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4, unlinkSync as unlinkSync4, readdirSync as readdirSync3 } from "fs";
5630
- import { execSync as execSync5 } from "child_process";
5666
+ import { execSync as execSync6 } from "child_process";
5631
5667
  import path10 from "path";
5632
5668
  function isNameWithOptionalInstance(candidate, baseName) {
5633
5669
  if (candidate === baseName) return true;
@@ -5721,7 +5757,7 @@ function getActiveAgent() {
5721
5757
  } catch {
5722
5758
  }
5723
5759
  try {
5724
- const sessionName = execSync5(
5760
+ const sessionName = execSync6(
5725
5761
  "tmux display-message -p '#{session_name}' 2>/dev/null",
5726
5762
  { encoding: "utf8", timeout: 2e3 }
5727
5763
  ).trim();
@@ -6136,7 +6172,7 @@ ${BASE_OPERATING_PROCEDURES}`;
6136
6172
  }
6137
6173
 
6138
6174
  // src/lib/cc-agent-support.ts
6139
- import { execSync as execSync3 } from "child_process";
6175
+ import { execSync as execSync4 } from "child_process";
6140
6176
  var _cachedSupport = null;
6141
6177
  function _resetCcAgentSupportCache() {
6142
6178
  _cachedSupport = null;
@@ -6144,7 +6180,7 @@ function _resetCcAgentSupportCache() {
6144
6180
  function claudeSupportsAgentFlag() {
6145
6181
  if (_cachedSupport !== null) return _cachedSupport;
6146
6182
  try {
6147
- const helpOutput = execSync3("claude --help 2>&1", {
6183
+ const helpOutput = execSync4("claude --help 2>&1", {
6148
6184
  encoding: "utf-8",
6149
6185
  timeout: 5e3
6150
6186
  });
@@ -6157,7 +6193,7 @@ function claudeSupportsAgentFlag() {
6157
6193
 
6158
6194
  // src/bin/exe-launch-agent.ts
6159
6195
  init_employees();
6160
- import { execSync as execSync6 } from "child_process";
6196
+ import { execSync as execSync7 } from "child_process";
6161
6197
 
6162
6198
  // src/lib/provider-table.ts
6163
6199
  var PROVIDER_TABLE = {
@@ -6314,7 +6350,7 @@ var _ccHelpOutput = null;
6314
6350
  function getCcHelpOutput() {
6315
6351
  if (_ccHelpOutput === null) {
6316
6352
  try {
6317
- const result = execSync6("claude --help 2>&1", { encoding: "utf8", timeout: 5e3 });
6353
+ const result = execSync7("claude --help 2>&1", { encoding: "utf8", timeout: 5e3 });
6318
6354
  _ccHelpOutput = typeof result === "string" ? result : "";
6319
6355
  } catch {
6320
6356
  _ccHelpOutput = "";