@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
@@ -1324,7 +1324,7 @@ __export(exe_daemon_client_exports, {
1324
1324
  });
1325
1325
  import net from "net";
1326
1326
  import os6 from "os";
1327
- import { spawn } from "child_process";
1327
+ import { spawn, execSync as execSync5 } from "child_process";
1328
1328
  import { randomUUID } from "crypto";
1329
1329
  import { existsSync as existsSync7, unlinkSync as unlinkSync3, readFileSync as readFileSync7, openSync, closeSync, statSync } from "fs";
1330
1330
  import path9 from "path";
@@ -1354,6 +1354,14 @@ function handleData(chunk) {
1354
1354
  }
1355
1355
  }
1356
1356
  }
1357
+ function isZombie(pid) {
1358
+ try {
1359
+ const state = execSync5(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1360
+ return state.startsWith("Z");
1361
+ } catch {
1362
+ return false;
1363
+ }
1364
+ }
1357
1365
  function cleanupStaleFiles() {
1358
1366
  if (existsSync7(PID_PATH)) {
1359
1367
  try {
@@ -1361,7 +1369,11 @@ function cleanupStaleFiles() {
1361
1369
  if (pid > 0) {
1362
1370
  try {
1363
1371
  process.kill(pid, 0);
1364
- return;
1372
+ if (!isZombie(pid)) {
1373
+ return;
1374
+ }
1375
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1376
+ `);
1365
1377
  } catch {
1366
1378
  }
1367
1379
  }
@@ -1389,8 +1401,8 @@ function findPackageRoot() {
1389
1401
  function getAvailableMemoryGB() {
1390
1402
  if (process.platform === "darwin") {
1391
1403
  try {
1392
- const { execSync: execSync7 } = __require("child_process");
1393
- const vmstat = execSync7("vm_stat", { encoding: "utf8" });
1404
+ const { execSync: execSync8 } = __require("child_process");
1405
+ const vmstat = execSync8("vm_stat", { encoding: "utf8" });
1394
1406
  const pageSize = 16384;
1395
1407
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1396
1408
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3380,6 +3392,12 @@ async function disposeDatabase() {
3380
3392
  clearInterval(_walCheckpointTimer);
3381
3393
  _walCheckpointTimer = null;
3382
3394
  }
3395
+ if (_client) {
3396
+ try {
3397
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3398
+ } catch {
3399
+ }
3400
+ }
3383
3401
  if (_daemonClient) {
3384
3402
  _daemonClient.close();
3385
3403
  _daemonClient = null;
@@ -3568,7 +3586,7 @@ var init_task_scope = __esm({
3568
3586
  // src/lib/keychain.ts
3569
3587
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3570
3588
  import { existsSync as existsSync12, statSync as statSync2 } from "fs";
3571
- import { execSync as execSync5 } from "child_process";
3589
+ import { execSync as execSync6 } from "child_process";
3572
3590
  import path14 from "path";
3573
3591
  import os10 from "os";
3574
3592
  function getKeyDir() {
@@ -3585,13 +3603,13 @@ function linuxSecretAvailable() {
3585
3603
  if (process.platform !== "linux") return false;
3586
3604
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3587
3605
  try {
3588
- execSync5("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3606
+ execSync6("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3589
3607
  } catch {
3590
3608
  linuxSecretAvailability = false;
3591
3609
  return false;
3592
3610
  }
3593
3611
  try {
3594
- execSync5("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3612
+ execSync6("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3595
3613
  linuxSecretAvailability = true;
3596
3614
  } catch {
3597
3615
  linuxSecretAvailability = false;
@@ -3615,7 +3633,7 @@ function macKeychainGet(service = SERVICE) {
3615
3633
  if (!nativeKeychainAllowed()) return null;
3616
3634
  if (process.platform !== "darwin") return null;
3617
3635
  try {
3618
- return execSync5(
3636
+ return execSync6(
3619
3637
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3620
3638
  { encoding: "utf-8", timeout: 5e3 }
3621
3639
  ).trim();
@@ -3628,13 +3646,13 @@ function macKeychainSet(value, service = SERVICE) {
3628
3646
  if (process.platform !== "darwin") return false;
3629
3647
  try {
3630
3648
  try {
3631
- execSync5(
3649
+ execSync6(
3632
3650
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3633
3651
  { timeout: 5e3 }
3634
3652
  );
3635
3653
  } catch {
3636
3654
  }
3637
- execSync5(
3655
+ execSync6(
3638
3656
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3639
3657
  { timeout: 5e3 }
3640
3658
  );
@@ -3647,7 +3665,7 @@ function macKeychainDelete(service = SERVICE) {
3647
3665
  if (!nativeKeychainAllowed()) return false;
3648
3666
  if (process.platform !== "darwin") return false;
3649
3667
  try {
3650
- execSync5(
3668
+ execSync6(
3651
3669
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3652
3670
  { timeout: 5e3 }
3653
3671
  );
@@ -3659,7 +3677,7 @@ function macKeychainDelete(service = SERVICE) {
3659
3677
  function linuxSecretGet(service = SERVICE) {
3660
3678
  if (!linuxSecretAvailable()) return null;
3661
3679
  try {
3662
- return execSync5(
3680
+ return execSync6(
3663
3681
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3664
3682
  { encoding: "utf-8", timeout: 5e3 }
3665
3683
  ).trim();
@@ -3670,7 +3688,7 @@ function linuxSecretGet(service = SERVICE) {
3670
3688
  function linuxSecretSet(value, service = SERVICE) {
3671
3689
  if (!linuxSecretAvailable()) return false;
3672
3690
  try {
3673
- execSync5(
3691
+ execSync6(
3674
3692
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3675
3693
  { timeout: 5e3 }
3676
3694
  );
@@ -3683,7 +3701,7 @@ function linuxSecretDelete(service = SERVICE) {
3683
3701
  if (!nativeKeychainAllowed()) return false;
3684
3702
  if (process.platform !== "linux") return false;
3685
3703
  try {
3686
- execSync5(
3704
+ execSync6(
3687
3705
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3688
3706
  { timeout: 5e3 }
3689
3707
  );
@@ -4620,6 +4638,24 @@ var init_platform_procedures = __esm({
4620
4638
  priority: "p0",
4621
4639
  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."
4622
4640
  },
4641
+ {
4642
+ title: "Bug report status check \u2014 surface available fixes on boot",
4643
+ domain: "support",
4644
+ priority: "p1",
4645
+ 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."
4646
+ },
4647
+ {
4648
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4649
+ domain: "support",
4650
+ priority: "p0",
4651
+ 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."
4652
+ },
4653
+ {
4654
+ title: "Feature request status check \u2014 surface shipped features on boot",
4655
+ domain: "support",
4656
+ priority: "p1",
4657
+ 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."
4658
+ },
4623
4659
  // --- Operations ---
4624
4660
  {
4625
4661
  title: "Managers must supervise deployed workers",
@@ -5932,7 +5968,7 @@ var init_fast_db_init = __esm({
5932
5968
  });
5933
5969
 
5934
5970
  // src/lib/project-name.ts
5935
- import { execSync as execSync6 } from "child_process";
5971
+ import { execSync as execSync7 } from "child_process";
5936
5972
  import path16 from "path";
5937
5973
  function getProjectName(cwd) {
5938
5974
  const dir = cwd ?? process.cwd();
@@ -5940,7 +5976,7 @@ function getProjectName(cwd) {
5940
5976
  try {
5941
5977
  let repoRoot;
5942
5978
  try {
5943
- const gitCommonDir = execSync6("git rev-parse --path-format=absolute --git-common-dir", {
5979
+ const gitCommonDir = execSync7("git rev-parse --path-format=absolute --git-common-dir", {
5944
5980
  cwd: dir,
5945
5981
  encoding: "utf8",
5946
5982
  timeout: 2e3,
@@ -5948,7 +5984,7 @@ function getProjectName(cwd) {
5948
5984
  }).trim();
5949
5985
  repoRoot = path16.dirname(gitCommonDir);
5950
5986
  } catch {
5951
- repoRoot = execSync6("git rev-parse --show-toplevel", {
5987
+ repoRoot = execSync7("git rev-parse --show-toplevel", {
5952
5988
  cwd: dir,
5953
5989
  encoding: "utf8",
5954
5990
  timeout: 2e3,
@@ -1296,7 +1296,7 @@ __export(exe_daemon_client_exports, {
1296
1296
  });
1297
1297
  import net from "net";
1298
1298
  import os6 from "os";
1299
- import { spawn } from "child_process";
1299
+ import { spawn, execSync as execSync5 } from "child_process";
1300
1300
  import { randomUUID } from "crypto";
1301
1301
  import { existsSync as existsSync7, unlinkSync as unlinkSync3, readFileSync as readFileSync7, openSync, closeSync, statSync } from "fs";
1302
1302
  import path9 from "path";
@@ -1326,6 +1326,14 @@ function handleData(chunk) {
1326
1326
  }
1327
1327
  }
1328
1328
  }
1329
+ function isZombie(pid) {
1330
+ try {
1331
+ const state = execSync5(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1332
+ return state.startsWith("Z");
1333
+ } catch {
1334
+ return false;
1335
+ }
1336
+ }
1329
1337
  function cleanupStaleFiles() {
1330
1338
  if (existsSync7(PID_PATH)) {
1331
1339
  try {
@@ -1333,7 +1341,11 @@ function cleanupStaleFiles() {
1333
1341
  if (pid > 0) {
1334
1342
  try {
1335
1343
  process.kill(pid, 0);
1336
- return;
1344
+ if (!isZombie(pid)) {
1345
+ return;
1346
+ }
1347
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1348
+ `);
1337
1349
  } catch {
1338
1350
  }
1339
1351
  }
@@ -1361,8 +1373,8 @@ function findPackageRoot() {
1361
1373
  function getAvailableMemoryGB() {
1362
1374
  if (process.platform === "darwin") {
1363
1375
  try {
1364
- const { execSync: execSync6 } = __require("child_process");
1365
- const vmstat = execSync6("vm_stat", { encoding: "utf8" });
1376
+ const { execSync: execSync7 } = __require("child_process");
1377
+ const vmstat = execSync7("vm_stat", { encoding: "utf8" });
1366
1378
  const pageSize = 16384;
1367
1379
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1368
1380
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3352,6 +3364,12 @@ async function disposeDatabase() {
3352
3364
  clearInterval(_walCheckpointTimer);
3353
3365
  _walCheckpointTimer = null;
3354
3366
  }
3367
+ if (_client) {
3368
+ try {
3369
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3370
+ } catch {
3371
+ }
3372
+ }
3355
3373
  if (_daemonClient) {
3356
3374
  _daemonClient.close();
3357
3375
  _daemonClient = null;
@@ -3531,7 +3549,7 @@ var init_task_scope = __esm({
3531
3549
  // src/lib/keychain.ts
3532
3550
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3533
3551
  import { existsSync as existsSync12, statSync as statSync2 } from "fs";
3534
- import { execSync as execSync5 } from "child_process";
3552
+ import { execSync as execSync6 } from "child_process";
3535
3553
  import path14 from "path";
3536
3554
  import os10 from "os";
3537
3555
  function getKeyDir() {
@@ -3548,13 +3566,13 @@ function linuxSecretAvailable() {
3548
3566
  if (process.platform !== "linux") return false;
3549
3567
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3550
3568
  try {
3551
- execSync5("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3569
+ execSync6("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3552
3570
  } catch {
3553
3571
  linuxSecretAvailability = false;
3554
3572
  return false;
3555
3573
  }
3556
3574
  try {
3557
- execSync5("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3575
+ execSync6("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3558
3576
  linuxSecretAvailability = true;
3559
3577
  } catch {
3560
3578
  linuxSecretAvailability = false;
@@ -3578,7 +3596,7 @@ function macKeychainGet(service = SERVICE) {
3578
3596
  if (!nativeKeychainAllowed()) return null;
3579
3597
  if (process.platform !== "darwin") return null;
3580
3598
  try {
3581
- return execSync5(
3599
+ return execSync6(
3582
3600
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3583
3601
  { encoding: "utf-8", timeout: 5e3 }
3584
3602
  ).trim();
@@ -3591,13 +3609,13 @@ function macKeychainSet(value, service = SERVICE) {
3591
3609
  if (process.platform !== "darwin") return false;
3592
3610
  try {
3593
3611
  try {
3594
- execSync5(
3612
+ execSync6(
3595
3613
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3596
3614
  { timeout: 5e3 }
3597
3615
  );
3598
3616
  } catch {
3599
3617
  }
3600
- execSync5(
3618
+ execSync6(
3601
3619
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3602
3620
  { timeout: 5e3 }
3603
3621
  );
@@ -3610,7 +3628,7 @@ function macKeychainDelete(service = SERVICE) {
3610
3628
  if (!nativeKeychainAllowed()) return false;
3611
3629
  if (process.platform !== "darwin") return false;
3612
3630
  try {
3613
- execSync5(
3631
+ execSync6(
3614
3632
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3615
3633
  { timeout: 5e3 }
3616
3634
  );
@@ -3622,7 +3640,7 @@ function macKeychainDelete(service = SERVICE) {
3622
3640
  function linuxSecretGet(service = SERVICE) {
3623
3641
  if (!linuxSecretAvailable()) return null;
3624
3642
  try {
3625
- return execSync5(
3643
+ return execSync6(
3626
3644
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3627
3645
  { encoding: "utf-8", timeout: 5e3 }
3628
3646
  ).trim();
@@ -3633,7 +3651,7 @@ function linuxSecretGet(service = SERVICE) {
3633
3651
  function linuxSecretSet(value, service = SERVICE) {
3634
3652
  if (!linuxSecretAvailable()) return false;
3635
3653
  try {
3636
- execSync5(
3654
+ execSync6(
3637
3655
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3638
3656
  { timeout: 5e3 }
3639
3657
  );
@@ -3646,7 +3664,7 @@ function linuxSecretDelete(service = SERVICE) {
3646
3664
  if (!nativeKeychainAllowed()) return false;
3647
3665
  if (process.platform !== "linux") return false;
3648
3666
  try {
3649
- execSync5(
3667
+ execSync6(
3650
3668
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3651
3669
  { timeout: 5e3 }
3652
3670
  );
@@ -4583,6 +4601,24 @@ var init_platform_procedures = __esm({
4583
4601
  priority: "p0",
4584
4602
  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."
4585
4603
  },
4604
+ {
4605
+ title: "Bug report status check \u2014 surface available fixes on boot",
4606
+ domain: "support",
4607
+ priority: "p1",
4608
+ 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."
4609
+ },
4610
+ {
4611
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4612
+ domain: "support",
4613
+ priority: "p0",
4614
+ 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."
4615
+ },
4616
+ {
4617
+ title: "Feature request status check \u2014 surface shipped features on boot",
4618
+ domain: "support",
4619
+ priority: "p1",
4620
+ 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."
4621
+ },
4586
4622
  // --- Operations ---
4587
4623
  {
4588
4624
  title: "Managers must supervise deployed workers",
@@ -1118,7 +1118,7 @@ var init_daemon_auth = __esm({
1118
1118
  // src/lib/exe-daemon-client.ts
1119
1119
  import net from "net";
1120
1120
  import os4 from "os";
1121
- import { spawn } from "child_process";
1121
+ import { spawn, execSync as execSync2 } from "child_process";
1122
1122
  import { randomUUID } from "crypto";
1123
1123
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1124
1124
  import path5 from "path";
@@ -1148,6 +1148,14 @@ function handleData(chunk) {
1148
1148
  }
1149
1149
  }
1150
1150
  }
1151
+ function isZombie(pid) {
1152
+ try {
1153
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1154
+ return state.startsWith("Z");
1155
+ } catch {
1156
+ return false;
1157
+ }
1158
+ }
1151
1159
  function cleanupStaleFiles() {
1152
1160
  if (existsSync5(PID_PATH)) {
1153
1161
  try {
@@ -1155,7 +1163,11 @@ function cleanupStaleFiles() {
1155
1163
  if (pid > 0) {
1156
1164
  try {
1157
1165
  process.kill(pid, 0);
1158
- return;
1166
+ if (!isZombie(pid)) {
1167
+ return;
1168
+ }
1169
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1170
+ `);
1159
1171
  } catch {
1160
1172
  }
1161
1173
  }
@@ -1183,8 +1195,8 @@ function findPackageRoot() {
1183
1195
  function getAvailableMemoryGB() {
1184
1196
  if (process.platform === "darwin") {
1185
1197
  try {
1186
- const { execSync: execSync6 } = __require("child_process");
1187
- const vmstat = execSync6("vm_stat", { encoding: "utf8" });
1198
+ const { execSync: execSync7 } = __require("child_process");
1199
+ const vmstat = execSync7("vm_stat", { encoding: "utf8" });
1188
1200
  const pageSize = 16384;
1189
1201
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1190
1202
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3119,6 +3131,12 @@ async function disposeDatabase() {
3119
3131
  clearInterval(_walCheckpointTimer);
3120
3132
  _walCheckpointTimer = null;
3121
3133
  }
3134
+ if (_client) {
3135
+ try {
3136
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3137
+ } catch {
3138
+ }
3139
+ }
3122
3140
  if (_daemonClient) {
3123
3141
  _daemonClient.close();
3124
3142
  _daemonClient = null;
@@ -3164,7 +3182,7 @@ __export(keychain_exports, {
3164
3182
  });
3165
3183
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3166
3184
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3167
- import { execSync as execSync2 } from "child_process";
3185
+ import { execSync as execSync3 } from "child_process";
3168
3186
  import path6 from "path";
3169
3187
  import os5 from "os";
3170
3188
  function getKeyDir() {
@@ -3181,13 +3199,13 @@ function linuxSecretAvailable() {
3181
3199
  if (process.platform !== "linux") return false;
3182
3200
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3183
3201
  try {
3184
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3202
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3185
3203
  } catch {
3186
3204
  linuxSecretAvailability = false;
3187
3205
  return false;
3188
3206
  }
3189
3207
  try {
3190
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3208
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3191
3209
  linuxSecretAvailability = true;
3192
3210
  } catch {
3193
3211
  linuxSecretAvailability = false;
@@ -3211,7 +3229,7 @@ function macKeychainGet(service = SERVICE) {
3211
3229
  if (!nativeKeychainAllowed()) return null;
3212
3230
  if (process.platform !== "darwin") return null;
3213
3231
  try {
3214
- return execSync2(
3232
+ return execSync3(
3215
3233
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3216
3234
  { encoding: "utf-8", timeout: 5e3 }
3217
3235
  ).trim();
@@ -3224,13 +3242,13 @@ function macKeychainSet(value, service = SERVICE) {
3224
3242
  if (process.platform !== "darwin") return false;
3225
3243
  try {
3226
3244
  try {
3227
- execSync2(
3245
+ execSync3(
3228
3246
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3229
3247
  { timeout: 5e3 }
3230
3248
  );
3231
3249
  } catch {
3232
3250
  }
3233
- execSync2(
3251
+ execSync3(
3234
3252
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3235
3253
  { timeout: 5e3 }
3236
3254
  );
@@ -3243,7 +3261,7 @@ function macKeychainDelete(service = SERVICE) {
3243
3261
  if (!nativeKeychainAllowed()) return false;
3244
3262
  if (process.platform !== "darwin") return false;
3245
3263
  try {
3246
- execSync2(
3264
+ execSync3(
3247
3265
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3248
3266
  { timeout: 5e3 }
3249
3267
  );
@@ -3255,7 +3273,7 @@ function macKeychainDelete(service = SERVICE) {
3255
3273
  function linuxSecretGet(service = SERVICE) {
3256
3274
  if (!linuxSecretAvailable()) return null;
3257
3275
  try {
3258
- return execSync2(
3276
+ return execSync3(
3259
3277
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3260
3278
  { encoding: "utf-8", timeout: 5e3 }
3261
3279
  ).trim();
@@ -3266,7 +3284,7 @@ function linuxSecretGet(service = SERVICE) {
3266
3284
  function linuxSecretSet(value, service = SERVICE) {
3267
3285
  if (!linuxSecretAvailable()) return false;
3268
3286
  try {
3269
- execSync2(
3287
+ execSync3(
3270
3288
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3271
3289
  { timeout: 5e3 }
3272
3290
  );
@@ -3279,7 +3297,7 @@ function linuxSecretDelete(service = SERVICE) {
3279
3297
  if (!nativeKeychainAllowed()) return false;
3280
3298
  if (process.platform !== "linux") return false;
3281
3299
  try {
3282
- execSync2(
3300
+ execSync3(
3283
3301
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3284
3302
  { timeout: 5e3 }
3285
3303
  );
@@ -4182,6 +4200,24 @@ var init_platform_procedures = __esm({
4182
4200
  priority: "p0",
4183
4201
  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."
4184
4202
  },
4203
+ {
4204
+ title: "Bug report status check \u2014 surface available fixes on boot",
4205
+ domain: "support",
4206
+ priority: "p1",
4207
+ 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."
4208
+ },
4209
+ {
4210
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4211
+ domain: "support",
4212
+ priority: "p0",
4213
+ 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."
4214
+ },
4215
+ {
4216
+ title: "Feature request status check \u2014 surface shipped features on boot",
4217
+ domain: "support",
4218
+ priority: "p1",
4219
+ 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."
4220
+ },
4185
4221
  // --- Operations ---
4186
4222
  {
4187
4223
  title: "Managers must supervise deployed workers",
@@ -4384,7 +4420,7 @@ var init_session_registry = __esm({
4384
4420
  });
4385
4421
 
4386
4422
  // src/lib/session-key.ts
4387
- import { execSync as execSync3 } from "child_process";
4423
+ import { execSync as execSync4 } from "child_process";
4388
4424
  function normalizeCommand(command) {
4389
4425
  const trimmed = command.trim().toLowerCase();
4390
4426
  const parts = trimmed.split(/[\\/]/);
@@ -4403,7 +4439,7 @@ function resolveRuntimeProcess() {
4403
4439
  let pid = process.ppid;
4404
4440
  for (let i = 0; i < 10; i++) {
4405
4441
  try {
4406
- const info = execSync3(`ps -p ${pid} -o ppid=,comm=`, {
4442
+ const info = execSync4(`ps -p ${pid} -o ppid=,comm=`, {
4407
4443
  encoding: "utf8",
4408
4444
  timeout: 2e3
4409
4445
  }).trim();
@@ -4569,7 +4605,7 @@ var init_transport = __esm({
4569
4605
  });
4570
4606
 
4571
4607
  // src/lib/cc-agent-support.ts
4572
- import { execSync as execSync4 } from "child_process";
4608
+ import { execSync as execSync5 } from "child_process";
4573
4609
  var init_cc_agent_support = __esm({
4574
4610
  "src/lib/cc-agent-support.ts"() {
4575
4611
  "use strict";
@@ -7405,7 +7441,7 @@ init_database();
7405
7441
  init_notifications();
7406
7442
  init_task_scope();
7407
7443
  init_employees();
7408
- import { execSync as execSync5 } from "child_process";
7444
+ import { execSync as execSync6 } from "child_process";
7409
7445
  import { existsSync as existsSync20, mkdirSync as mkdirSync11, openSync as openSync3, closeSync as closeSync3 } from "fs";
7410
7446
  import path21 from "path";
7411
7447
 
@@ -7806,7 +7842,7 @@ async function main() {
7806
7842
  const taskTitle = String(taskRow.title);
7807
7843
  let lastCommit = "";
7808
7844
  try {
7809
- lastCommit = execSync5("git log --oneline -1 --since='30 minutes ago'", {
7845
+ lastCommit = execSync6("git log --oneline -1 --since='30 minutes ago'", {
7810
7846
  encoding: "utf8",
7811
7847
  timeout: 5e3
7812
7848
  }).trim();