@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
@@ -985,7 +985,7 @@ var init_daemon_auth = __esm({
985
985
  // src/lib/exe-daemon-client.ts
986
986
  import net from "net";
987
987
  import os4 from "os";
988
- import { spawn } from "child_process";
988
+ import { spawn, execSync as execSync2 } from "child_process";
989
989
  import { randomUUID } from "crypto";
990
990
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
991
991
  import path5 from "path";
@@ -1015,6 +1015,14 @@ function handleData(chunk) {
1015
1015
  }
1016
1016
  }
1017
1017
  }
1018
+ function isZombie(pid) {
1019
+ try {
1020
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1021
+ return state.startsWith("Z");
1022
+ } catch {
1023
+ return false;
1024
+ }
1025
+ }
1018
1026
  function cleanupStaleFiles() {
1019
1027
  if (existsSync5(PID_PATH)) {
1020
1028
  try {
@@ -1022,7 +1030,11 @@ function cleanupStaleFiles() {
1022
1030
  if (pid > 0) {
1023
1031
  try {
1024
1032
  process.kill(pid, 0);
1025
- return;
1033
+ if (!isZombie(pid)) {
1034
+ return;
1035
+ }
1036
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1037
+ `);
1026
1038
  } catch {
1027
1039
  }
1028
1040
  }
@@ -1050,8 +1062,8 @@ function findPackageRoot() {
1050
1062
  function getAvailableMemoryGB() {
1051
1063
  if (process.platform === "darwin") {
1052
1064
  try {
1053
- const { execSync: execSync3 } = __require("child_process");
1054
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1065
+ const { execSync: execSync4 } = __require("child_process");
1066
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1055
1067
  const pageSize = 16384;
1056
1068
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1057
1069
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2973,6 +2985,12 @@ async function disposeDatabase() {
2973
2985
  clearInterval(_walCheckpointTimer);
2974
2986
  _walCheckpointTimer = null;
2975
2987
  }
2988
+ if (_client) {
2989
+ try {
2990
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2991
+ } catch {
2992
+ }
2993
+ }
2976
2994
  if (_daemonClient) {
2977
2995
  _daemonClient.close();
2978
2996
  _daemonClient = null;
@@ -3504,6 +3522,24 @@ var init_platform_procedures = __esm({
3504
3522
  priority: "p0",
3505
3523
  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."
3506
3524
  },
3525
+ {
3526
+ title: "Bug report status check \u2014 surface available fixes on boot",
3527
+ domain: "support",
3528
+ priority: "p1",
3529
+ 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."
3530
+ },
3531
+ {
3532
+ title: "Feature request triage \u2014 upstream feature vs local customization",
3533
+ domain: "support",
3534
+ priority: "p0",
3535
+ 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."
3536
+ },
3537
+ {
3538
+ title: "Feature request status check \u2014 surface shipped features on boot",
3539
+ domain: "support",
3540
+ priority: "p1",
3541
+ 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."
3542
+ },
3507
3543
  // --- Operations ---
3508
3544
  {
3509
3545
  title: "Managers must supervise deployed workers",
@@ -4136,7 +4172,7 @@ init_database();
4136
4172
  // src/lib/keychain.ts
4137
4173
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
4138
4174
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
4139
- import { execSync as execSync2 } from "child_process";
4175
+ import { execSync as execSync3 } from "child_process";
4140
4176
  import path6 from "path";
4141
4177
  import os5 from "os";
4142
4178
  var SERVICE = "exe-os";
@@ -4157,13 +4193,13 @@ function linuxSecretAvailable() {
4157
4193
  if (process.platform !== "linux") return false;
4158
4194
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
4159
4195
  try {
4160
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4196
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4161
4197
  } catch {
4162
4198
  linuxSecretAvailability = false;
4163
4199
  return false;
4164
4200
  }
4165
4201
  try {
4166
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4202
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4167
4203
  linuxSecretAvailability = true;
4168
4204
  } catch {
4169
4205
  linuxSecretAvailability = false;
@@ -4187,7 +4223,7 @@ function macKeychainGet(service = SERVICE) {
4187
4223
  if (!nativeKeychainAllowed()) return null;
4188
4224
  if (process.platform !== "darwin") return null;
4189
4225
  try {
4190
- return execSync2(
4226
+ return execSync3(
4191
4227
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
4192
4228
  { encoding: "utf-8", timeout: 5e3 }
4193
4229
  ).trim();
@@ -4200,13 +4236,13 @@ function macKeychainSet(value, service = SERVICE) {
4200
4236
  if (process.platform !== "darwin") return false;
4201
4237
  try {
4202
4238
  try {
4203
- execSync2(
4239
+ execSync3(
4204
4240
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4205
4241
  { timeout: 5e3 }
4206
4242
  );
4207
4243
  } catch {
4208
4244
  }
4209
- execSync2(
4245
+ execSync3(
4210
4246
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
4211
4247
  { timeout: 5e3 }
4212
4248
  );
@@ -4219,7 +4255,7 @@ function macKeychainDelete(service = SERVICE) {
4219
4255
  if (!nativeKeychainAllowed()) return false;
4220
4256
  if (process.platform !== "darwin") return false;
4221
4257
  try {
4222
- execSync2(
4258
+ execSync3(
4223
4259
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4224
4260
  { timeout: 5e3 }
4225
4261
  );
@@ -4231,7 +4267,7 @@ function macKeychainDelete(service = SERVICE) {
4231
4267
  function linuxSecretGet(service = SERVICE) {
4232
4268
  if (!linuxSecretAvailable()) return null;
4233
4269
  try {
4234
- return execSync2(
4270
+ return execSync3(
4235
4271
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4236
4272
  { encoding: "utf-8", timeout: 5e3 }
4237
4273
  ).trim();
@@ -4242,7 +4278,7 @@ function linuxSecretGet(service = SERVICE) {
4242
4278
  function linuxSecretSet(value, service = SERVICE) {
4243
4279
  if (!linuxSecretAvailable()) return false;
4244
4280
  try {
4245
- execSync2(
4281
+ execSync3(
4246
4282
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4247
4283
  { timeout: 5e3 }
4248
4284
  );
@@ -4255,7 +4291,7 @@ function linuxSecretDelete(service = SERVICE) {
4255
4291
  if (!nativeKeychainAllowed()) return false;
4256
4292
  if (process.platform !== "linux") return false;
4257
4293
  try {
4258
- execSync2(
4294
+ execSync3(
4259
4295
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4260
4296
  { timeout: 5e3 }
4261
4297
  );
@@ -985,7 +985,7 @@ var init_daemon_auth = __esm({
985
985
  // src/lib/exe-daemon-client.ts
986
986
  import net from "net";
987
987
  import os4 from "os";
988
- import { spawn } from "child_process";
988
+ import { spawn, execSync as execSync2 } from "child_process";
989
989
  import { randomUUID } from "crypto";
990
990
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
991
991
  import path5 from "path";
@@ -1015,6 +1015,14 @@ function handleData(chunk) {
1015
1015
  }
1016
1016
  }
1017
1017
  }
1018
+ function isZombie(pid) {
1019
+ try {
1020
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1021
+ return state.startsWith("Z");
1022
+ } catch {
1023
+ return false;
1024
+ }
1025
+ }
1018
1026
  function cleanupStaleFiles() {
1019
1027
  if (existsSync5(PID_PATH)) {
1020
1028
  try {
@@ -1022,7 +1030,11 @@ function cleanupStaleFiles() {
1022
1030
  if (pid > 0) {
1023
1031
  try {
1024
1032
  process.kill(pid, 0);
1025
- return;
1033
+ if (!isZombie(pid)) {
1034
+ return;
1035
+ }
1036
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1037
+ `);
1026
1038
  } catch {
1027
1039
  }
1028
1040
  }
@@ -1050,8 +1062,8 @@ function findPackageRoot() {
1050
1062
  function getAvailableMemoryGB() {
1051
1063
  if (process.platform === "darwin") {
1052
1064
  try {
1053
- const { execSync: execSync3 } = __require("child_process");
1054
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1065
+ const { execSync: execSync4 } = __require("child_process");
1066
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1055
1067
  const pageSize = 16384;
1056
1068
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1057
1069
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2973,6 +2985,12 @@ async function disposeDatabase() {
2973
2985
  clearInterval(_walCheckpointTimer);
2974
2986
  _walCheckpointTimer = null;
2975
2987
  }
2988
+ if (_client) {
2989
+ try {
2990
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2991
+ } catch {
2992
+ }
2993
+ }
2976
2994
  if (_daemonClient) {
2977
2995
  _daemonClient.close();
2978
2996
  _daemonClient = null;
@@ -3504,6 +3522,24 @@ var init_platform_procedures = __esm({
3504
3522
  priority: "p0",
3505
3523
  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."
3506
3524
  },
3525
+ {
3526
+ title: "Bug report status check \u2014 surface available fixes on boot",
3527
+ domain: "support",
3528
+ priority: "p1",
3529
+ 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."
3530
+ },
3531
+ {
3532
+ title: "Feature request triage \u2014 upstream feature vs local customization",
3533
+ domain: "support",
3534
+ priority: "p0",
3535
+ 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."
3536
+ },
3537
+ {
3538
+ title: "Feature request status check \u2014 surface shipped features on boot",
3539
+ domain: "support",
3540
+ priority: "p1",
3541
+ 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."
3542
+ },
3507
3543
  // --- Operations ---
3508
3544
  {
3509
3545
  title: "Managers must supervise deployed workers",
@@ -4135,7 +4171,7 @@ init_database();
4135
4171
  // src/lib/keychain.ts
4136
4172
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
4137
4173
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
4138
- import { execSync as execSync2 } from "child_process";
4174
+ import { execSync as execSync3 } from "child_process";
4139
4175
  import path6 from "path";
4140
4176
  import os5 from "os";
4141
4177
  var SERVICE = "exe-os";
@@ -4156,13 +4192,13 @@ function linuxSecretAvailable() {
4156
4192
  if (process.platform !== "linux") return false;
4157
4193
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
4158
4194
  try {
4159
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4195
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
4160
4196
  } catch {
4161
4197
  linuxSecretAvailability = false;
4162
4198
  return false;
4163
4199
  }
4164
4200
  try {
4165
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4201
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
4166
4202
  linuxSecretAvailability = true;
4167
4203
  } catch {
4168
4204
  linuxSecretAvailability = false;
@@ -4186,7 +4222,7 @@ function macKeychainGet(service = SERVICE) {
4186
4222
  if (!nativeKeychainAllowed()) return null;
4187
4223
  if (process.platform !== "darwin") return null;
4188
4224
  try {
4189
- return execSync2(
4225
+ return execSync3(
4190
4226
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
4191
4227
  { encoding: "utf-8", timeout: 5e3 }
4192
4228
  ).trim();
@@ -4199,13 +4235,13 @@ function macKeychainSet(value, service = SERVICE) {
4199
4235
  if (process.platform !== "darwin") return false;
4200
4236
  try {
4201
4237
  try {
4202
- execSync2(
4238
+ execSync3(
4203
4239
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4204
4240
  { timeout: 5e3 }
4205
4241
  );
4206
4242
  } catch {
4207
4243
  }
4208
- execSync2(
4244
+ execSync3(
4209
4245
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
4210
4246
  { timeout: 5e3 }
4211
4247
  );
@@ -4218,7 +4254,7 @@ function macKeychainDelete(service = SERVICE) {
4218
4254
  if (!nativeKeychainAllowed()) return false;
4219
4255
  if (process.platform !== "darwin") return false;
4220
4256
  try {
4221
- execSync2(
4257
+ execSync3(
4222
4258
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
4223
4259
  { timeout: 5e3 }
4224
4260
  );
@@ -4230,7 +4266,7 @@ function macKeychainDelete(service = SERVICE) {
4230
4266
  function linuxSecretGet(service = SERVICE) {
4231
4267
  if (!linuxSecretAvailable()) return null;
4232
4268
  try {
4233
- return execSync2(
4269
+ return execSync3(
4234
4270
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4235
4271
  { encoding: "utf-8", timeout: 5e3 }
4236
4272
  ).trim();
@@ -4241,7 +4277,7 @@ function linuxSecretGet(service = SERVICE) {
4241
4277
  function linuxSecretSet(value, service = SERVICE) {
4242
4278
  if (!linuxSecretAvailable()) return false;
4243
4279
  try {
4244
- execSync2(
4280
+ execSync3(
4245
4281
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4246
4282
  { timeout: 5e3 }
4247
4283
  );
@@ -4254,7 +4290,7 @@ function linuxSecretDelete(service = SERVICE) {
4254
4290
  if (!nativeKeychainAllowed()) return false;
4255
4291
  if (process.platform !== "linux") return false;
4256
4292
  try {
4257
- execSync2(
4293
+ execSync3(
4258
4294
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
4259
4295
  { timeout: 5e3 }
4260
4296
  );
@@ -981,7 +981,7 @@ var init_daemon_auth = __esm({
981
981
  // src/lib/exe-daemon-client.ts
982
982
  import net from "net";
983
983
  import os4 from "os";
984
- import { spawn } from "child_process";
984
+ import { spawn, execSync as execSync2 } from "child_process";
985
985
  import { randomUUID } from "crypto";
986
986
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
987
987
  import path5 from "path";
@@ -1011,6 +1011,14 @@ function handleData(chunk) {
1011
1011
  }
1012
1012
  }
1013
1013
  }
1014
+ function isZombie(pid) {
1015
+ try {
1016
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1017
+ return state.startsWith("Z");
1018
+ } catch {
1019
+ return false;
1020
+ }
1021
+ }
1014
1022
  function cleanupStaleFiles() {
1015
1023
  if (existsSync5(PID_PATH)) {
1016
1024
  try {
@@ -1018,7 +1026,11 @@ function cleanupStaleFiles() {
1018
1026
  if (pid > 0) {
1019
1027
  try {
1020
1028
  process.kill(pid, 0);
1021
- return;
1029
+ if (!isZombie(pid)) {
1030
+ return;
1031
+ }
1032
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1033
+ `);
1022
1034
  } catch {
1023
1035
  }
1024
1036
  }
@@ -1046,8 +1058,8 @@ function findPackageRoot() {
1046
1058
  function getAvailableMemoryGB() {
1047
1059
  if (process.platform === "darwin") {
1048
1060
  try {
1049
- const { execSync: execSync3 } = __require("child_process");
1050
- const vmstat = execSync3("vm_stat", { encoding: "utf8" });
1061
+ const { execSync: execSync4 } = __require("child_process");
1062
+ const vmstat = execSync4("vm_stat", { encoding: "utf8" });
1051
1063
  const pageSize = 16384;
1052
1064
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1053
1065
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -2969,6 +2981,12 @@ async function disposeDatabase() {
2969
2981
  clearInterval(_walCheckpointTimer);
2970
2982
  _walCheckpointTimer = null;
2971
2983
  }
2984
+ if (_client) {
2985
+ try {
2986
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
2987
+ } catch {
2988
+ }
2989
+ }
2972
2990
  if (_daemonClient) {
2973
2991
  _daemonClient.close();
2974
2992
  _daemonClient = null;
@@ -3500,6 +3518,24 @@ var init_platform_procedures = __esm({
3500
3518
  priority: "p0",
3501
3519
  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."
3502
3520
  },
3521
+ {
3522
+ title: "Bug report status check \u2014 surface available fixes on boot",
3523
+ domain: "support",
3524
+ priority: "p1",
3525
+ 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."
3526
+ },
3527
+ {
3528
+ title: "Feature request triage \u2014 upstream feature vs local customization",
3529
+ domain: "support",
3530
+ priority: "p0",
3531
+ 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."
3532
+ },
3533
+ {
3534
+ title: "Feature request status check \u2014 surface shipped features on boot",
3535
+ domain: "support",
3536
+ priority: "p1",
3537
+ 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."
3538
+ },
3503
3539
  // --- Operations ---
3504
3540
  {
3505
3541
  title: "Managers must supervise deployed workers",
@@ -3697,7 +3733,7 @@ init_database();
3697
3733
  // src/lib/keychain.ts
3698
3734
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3699
3735
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3700
- import { execSync as execSync2 } from "child_process";
3736
+ import { execSync as execSync3 } from "child_process";
3701
3737
  import path6 from "path";
3702
3738
  import os5 from "os";
3703
3739
  var SERVICE = "exe-os";
@@ -3718,13 +3754,13 @@ function linuxSecretAvailable() {
3718
3754
  if (process.platform !== "linux") return false;
3719
3755
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3720
3756
  try {
3721
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3757
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3722
3758
  } catch {
3723
3759
  linuxSecretAvailability = false;
3724
3760
  return false;
3725
3761
  }
3726
3762
  try {
3727
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3763
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3728
3764
  linuxSecretAvailability = true;
3729
3765
  } catch {
3730
3766
  linuxSecretAvailability = false;
@@ -3748,7 +3784,7 @@ function macKeychainGet(service = SERVICE) {
3748
3784
  if (!nativeKeychainAllowed()) return null;
3749
3785
  if (process.platform !== "darwin") return null;
3750
3786
  try {
3751
- return execSync2(
3787
+ return execSync3(
3752
3788
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3753
3789
  { encoding: "utf-8", timeout: 5e3 }
3754
3790
  ).trim();
@@ -3761,13 +3797,13 @@ function macKeychainSet(value, service = SERVICE) {
3761
3797
  if (process.platform !== "darwin") return false;
3762
3798
  try {
3763
3799
  try {
3764
- execSync2(
3800
+ execSync3(
3765
3801
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3766
3802
  { timeout: 5e3 }
3767
3803
  );
3768
3804
  } catch {
3769
3805
  }
3770
- execSync2(
3806
+ execSync3(
3771
3807
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3772
3808
  { timeout: 5e3 }
3773
3809
  );
@@ -3780,7 +3816,7 @@ function macKeychainDelete(service = SERVICE) {
3780
3816
  if (!nativeKeychainAllowed()) return false;
3781
3817
  if (process.platform !== "darwin") return false;
3782
3818
  try {
3783
- execSync2(
3819
+ execSync3(
3784
3820
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3785
3821
  { timeout: 5e3 }
3786
3822
  );
@@ -3792,7 +3828,7 @@ function macKeychainDelete(service = SERVICE) {
3792
3828
  function linuxSecretGet(service = SERVICE) {
3793
3829
  if (!linuxSecretAvailable()) return null;
3794
3830
  try {
3795
- return execSync2(
3831
+ return execSync3(
3796
3832
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3797
3833
  { encoding: "utf-8", timeout: 5e3 }
3798
3834
  ).trim();
@@ -3803,7 +3839,7 @@ function linuxSecretGet(service = SERVICE) {
3803
3839
  function linuxSecretSet(value, service = SERVICE) {
3804
3840
  if (!linuxSecretAvailable()) return false;
3805
3841
  try {
3806
- execSync2(
3842
+ execSync3(
3807
3843
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3808
3844
  { timeout: 5e3 }
3809
3845
  );
@@ -3816,7 +3852,7 @@ function linuxSecretDelete(service = SERVICE) {
3816
3852
  if (!nativeKeychainAllowed()) return false;
3817
3853
  if (process.platform !== "linux") return false;
3818
3854
  try {
3819
- execSync2(
3855
+ execSync3(
3820
3856
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3821
3857
  { timeout: 5e3 }
3822
3858
  );