@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
@@ -1245,7 +1245,7 @@ __export(exe_daemon_client_exports, {
1245
1245
  });
1246
1246
  import net from "net";
1247
1247
  import os4 from "os";
1248
- import { spawn } from "child_process";
1248
+ import { spawn, execSync as execSync2 } from "child_process";
1249
1249
  import { randomUUID } from "crypto";
1250
1250
  import { existsSync as existsSync5, unlinkSync as unlinkSync2, readFileSync as readFileSync4, openSync, closeSync, statSync } from "fs";
1251
1251
  import path5 from "path";
@@ -1275,6 +1275,14 @@ function handleData(chunk) {
1275
1275
  }
1276
1276
  }
1277
1277
  }
1278
+ function isZombie(pid) {
1279
+ try {
1280
+ const state = execSync2(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1281
+ return state.startsWith("Z");
1282
+ } catch {
1283
+ return false;
1284
+ }
1285
+ }
1278
1286
  function cleanupStaleFiles() {
1279
1287
  if (existsSync5(PID_PATH)) {
1280
1288
  try {
@@ -1282,7 +1290,11 @@ function cleanupStaleFiles() {
1282
1290
  if (pid > 0) {
1283
1291
  try {
1284
1292
  process.kill(pid, 0);
1285
- return;
1293
+ if (!isZombie(pid)) {
1294
+ return;
1295
+ }
1296
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1297
+ `);
1286
1298
  } catch {
1287
1299
  }
1288
1300
  }
@@ -1310,8 +1322,8 @@ function findPackageRoot() {
1310
1322
  function getAvailableMemoryGB() {
1311
1323
  if (process.platform === "darwin") {
1312
1324
  try {
1313
- const { execSync: execSync8 } = __require("child_process");
1314
- const vmstat = execSync8("vm_stat", { encoding: "utf8" });
1325
+ const { execSync: execSync9 } = __require("child_process");
1326
+ const vmstat = execSync9("vm_stat", { encoding: "utf8" });
1315
1327
  const pageSize = 16384;
1316
1328
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1317
1329
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3301,6 +3313,12 @@ async function disposeDatabase() {
3301
3313
  clearInterval(_walCheckpointTimer);
3302
3314
  _walCheckpointTimer = null;
3303
3315
  }
3316
+ if (_client) {
3317
+ try {
3318
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3319
+ } catch {
3320
+ }
3321
+ }
3304
3322
  if (_daemonClient) {
3305
3323
  _daemonClient.close();
3306
3324
  _daemonClient = null;
@@ -3337,7 +3355,7 @@ var init_database = __esm({
3337
3355
  // src/lib/keychain.ts
3338
3356
  import { readFile as readFile3, writeFile as writeFile3, unlink, mkdir as mkdir3, chmod as chmod2 } from "fs/promises";
3339
3357
  import { existsSync as existsSync6, statSync as statSync2 } from "fs";
3340
- import { execSync as execSync2 } from "child_process";
3358
+ import { execSync as execSync3 } from "child_process";
3341
3359
  import path6 from "path";
3342
3360
  import os5 from "os";
3343
3361
  function getKeyDir() {
@@ -3354,13 +3372,13 @@ function linuxSecretAvailable() {
3354
3372
  if (process.platform !== "linux") return false;
3355
3373
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
3356
3374
  try {
3357
- execSync2("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3375
+ execSync3("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
3358
3376
  } catch {
3359
3377
  linuxSecretAvailability = false;
3360
3378
  return false;
3361
3379
  }
3362
3380
  try {
3363
- execSync2("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3381
+ execSync3("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
3364
3382
  linuxSecretAvailability = true;
3365
3383
  } catch {
3366
3384
  linuxSecretAvailability = false;
@@ -3384,7 +3402,7 @@ function macKeychainGet(service = SERVICE) {
3384
3402
  if (!nativeKeychainAllowed()) return null;
3385
3403
  if (process.platform !== "darwin") return null;
3386
3404
  try {
3387
- return execSync2(
3405
+ return execSync3(
3388
3406
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
3389
3407
  { encoding: "utf-8", timeout: 5e3 }
3390
3408
  ).trim();
@@ -3397,13 +3415,13 @@ function macKeychainSet(value, service = SERVICE) {
3397
3415
  if (process.platform !== "darwin") return false;
3398
3416
  try {
3399
3417
  try {
3400
- execSync2(
3418
+ execSync3(
3401
3419
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3402
3420
  { timeout: 5e3 }
3403
3421
  );
3404
3422
  } catch {
3405
3423
  }
3406
- execSync2(
3424
+ execSync3(
3407
3425
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
3408
3426
  { timeout: 5e3 }
3409
3427
  );
@@ -3416,7 +3434,7 @@ function macKeychainDelete(service = SERVICE) {
3416
3434
  if (!nativeKeychainAllowed()) return false;
3417
3435
  if (process.platform !== "darwin") return false;
3418
3436
  try {
3419
- execSync2(
3437
+ execSync3(
3420
3438
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
3421
3439
  { timeout: 5e3 }
3422
3440
  );
@@ -3428,7 +3446,7 @@ function macKeychainDelete(service = SERVICE) {
3428
3446
  function linuxSecretGet(service = SERVICE) {
3429
3447
  if (!linuxSecretAvailable()) return null;
3430
3448
  try {
3431
- return execSync2(
3449
+ return execSync3(
3432
3450
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3433
3451
  { encoding: "utf-8", timeout: 5e3 }
3434
3452
  ).trim();
@@ -3439,7 +3457,7 @@ function linuxSecretGet(service = SERVICE) {
3439
3457
  function linuxSecretSet(value, service = SERVICE) {
3440
3458
  if (!linuxSecretAvailable()) return false;
3441
3459
  try {
3442
- execSync2(
3460
+ execSync3(
3443
3461
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3444
3462
  { timeout: 5e3 }
3445
3463
  );
@@ -3452,7 +3470,7 @@ function linuxSecretDelete(service = SERVICE) {
3452
3470
  if (!nativeKeychainAllowed()) return false;
3453
3471
  if (process.platform !== "linux") return false;
3454
3472
  try {
3455
- execSync2(
3473
+ execSync3(
3456
3474
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
3457
3475
  { timeout: 5e3 }
3458
3476
  );
@@ -4389,6 +4407,24 @@ var init_platform_procedures = __esm({
4389
4407
  priority: "p0",
4390
4408
  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."
4391
4409
  },
4410
+ {
4411
+ title: "Bug report status check \u2014 surface available fixes on boot",
4412
+ domain: "support",
4413
+ priority: "p1",
4414
+ 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."
4415
+ },
4416
+ {
4417
+ title: "Feature request triage \u2014 upstream feature vs local customization",
4418
+ domain: "support",
4419
+ priority: "p0",
4420
+ 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."
4421
+ },
4422
+ {
4423
+ title: "Feature request status check \u2014 surface shipped features on boot",
4424
+ domain: "support",
4425
+ priority: "p1",
4426
+ 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."
4427
+ },
4392
4428
  // --- Operations ---
4393
4429
  {
4394
4430
  title: "Managers must supervise deployed workers",
@@ -5920,7 +5956,7 @@ __export(project_name_exports, {
5920
5956
  _resetCache: () => _resetCache,
5921
5957
  getProjectName: () => getProjectName
5922
5958
  });
5923
- import { execSync as execSync3 } from "child_process";
5959
+ import { execSync as execSync4 } from "child_process";
5924
5960
  import path9 from "path";
5925
5961
  function getProjectName(cwd) {
5926
5962
  const dir = cwd ?? process.cwd();
@@ -5928,7 +5964,7 @@ function getProjectName(cwd) {
5928
5964
  try {
5929
5965
  let repoRoot;
5930
5966
  try {
5931
- const gitCommonDir = execSync3("git rev-parse --path-format=absolute --git-common-dir", {
5967
+ const gitCommonDir = execSync4("git rev-parse --path-format=absolute --git-common-dir", {
5932
5968
  cwd: dir,
5933
5969
  encoding: "utf8",
5934
5970
  timeout: 2e3,
@@ -5936,7 +5972,7 @@ function getProjectName(cwd) {
5936
5972
  }).trim();
5937
5973
  repoRoot = path9.dirname(gitCommonDir);
5938
5974
  } catch {
5939
- repoRoot = execSync3("git rev-parse --show-toplevel", {
5975
+ repoRoot = execSync4("git rev-parse --show-toplevel", {
5940
5976
  cwd: dir,
5941
5977
  encoding: "utf8",
5942
5978
  timeout: 2e3,
@@ -5970,14 +6006,14 @@ var file_grep_exports = {};
5970
6006
  __export(file_grep_exports, {
5971
6007
  grepProjectFiles: () => grepProjectFiles
5972
6008
  });
5973
- import { execSync as execSync4 } from "child_process";
6009
+ import { execSync as execSync5 } from "child_process";
5974
6010
  import { readFileSync as readFileSync5, readdirSync as readdirSync2, statSync as statSync4, existsSync as existsSync9 } from "fs";
5975
6011
  import path10 from "path";
5976
6012
  import crypto3 from "crypto";
5977
6013
  function hasRipgrep() {
5978
6014
  if (_hasRg === null) {
5979
6015
  try {
5980
- execSync4("rg --version", { stdio: "ignore", timeout: 2e3 });
6016
+ execSync5("rg --version", { stdio: "ignore", timeout: 2e3 });
5981
6017
  _hasRg = true;
5982
6018
  } catch {
5983
6019
  _hasRg = false;
@@ -6043,7 +6079,7 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
6043
6079
  const globs = (patterns ?? DEFAULT_PATTERNS).map((p) => `--glob '${p}'`).join(" ");
6044
6080
  const excludes = EXCLUDE_DIRS.map((d) => `--glob '!${d}'`).join(" ");
6045
6081
  const cmd = `rg -i -c --hidden --no-config --no-ignore '${pattern.replace(/'/g, "\\'")}' . ${globs} ${excludes} --max-filesize ${MAX_FILE_SIZE} 2>/dev/null || true`;
6046
- const output = execSync4(cmd, {
6082
+ const output = execSync5(cmd, {
6047
6083
  cwd: projectRoot,
6048
6084
  encoding: "utf8",
6049
6085
  timeout: 3e3,
@@ -6058,12 +6094,12 @@ function grepWithRipgrep(pattern, projectRoot, patterns) {
6058
6094
  const matchCount = parseInt(line.slice(colonIdx + 1));
6059
6095
  if (isNaN(matchCount) || matchCount === 0) continue;
6060
6096
  try {
6061
- const firstMatch = execSync4(
6097
+ const firstMatch = execSync5(
6062
6098
  `rg -i -n --hidden '${pattern.replace(/'/g, "\\'")}' '${filePath}' --max-count 1 2>/dev/null | head -1`,
6063
6099
  { cwd: projectRoot, encoding: "utf8", timeout: 1e3 }
6064
6100
  ).trim();
6065
6101
  const lineNum = parseInt(firstMatch.split(":")[0] ?? "1");
6066
- const totalLines = execSync4(`wc -l < '${filePath}'`, {
6102
+ const totalLines = execSync5(`wc -l < '${filePath}'`, {
6067
6103
  cwd: projectRoot,
6068
6104
  encoding: "utf8",
6069
6105
  timeout: 1e3
@@ -7414,7 +7450,7 @@ var init_hybrid_search = __esm({
7414
7450
  });
7415
7451
 
7416
7452
  // src/lib/session-key.ts
7417
- import { execSync as execSync5 } from "child_process";
7453
+ import { execSync as execSync6 } from "child_process";
7418
7454
  function normalizeCommand(command) {
7419
7455
  const trimmed = command.trim().toLowerCase();
7420
7456
  const parts = trimmed.split(/[\\/]/);
@@ -7433,7 +7469,7 @@ function resolveRuntimeProcess() {
7433
7469
  let pid = process.ppid;
7434
7470
  for (let i = 0; i < 10; i++) {
7435
7471
  try {
7436
- const info = execSync5(`ps -p ${pid} -o ppid=,comm=`, {
7472
+ const info = execSync6(`ps -p ${pid} -o ppid=,comm=`, {
7437
7473
  encoding: "utf8",
7438
7474
  timeout: 2e3
7439
7475
  }).trim();
@@ -7496,7 +7532,7 @@ var init_agent_context = __esm({
7496
7532
 
7497
7533
  // src/lib/active-agent.ts
7498
7534
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3, unlinkSync as unlinkSync3, readdirSync as readdirSync3 } from "fs";
7499
- import { execSync as execSync6 } from "child_process";
7535
+ import { execSync as execSync7 } from "child_process";
7500
7536
  import path11 from "path";
7501
7537
  function isNameWithOptionalInstance(candidate, baseName) {
7502
7538
  if (candidate === baseName) return true;
@@ -7590,7 +7626,7 @@ function getActiveAgent() {
7590
7626
  } catch {
7591
7627
  }
7592
7628
  try {
7593
- const sessionName = execSync6(
7629
+ const sessionName = execSync7(
7594
7630
  "tmux display-message -p '#{session_name}' 2>/dev/null",
7595
7631
  { encoding: "utf8", timeout: 2e3 }
7596
7632
  ).trim();
@@ -7881,7 +7917,7 @@ var init_transport = __esm({
7881
7917
  });
7882
7918
 
7883
7919
  // src/lib/cc-agent-support.ts
7884
- import { execSync as execSync7 } from "child_process";
7920
+ import { execSync as execSync8 } from "child_process";
7885
7921
  var init_cc_agent_support = __esm({
7886
7922
  "src/lib/cc-agent-support.ts"() {
7887
7923
  "use strict";
@@ -1580,7 +1580,7 @@ __export(exe_daemon_client_exports, {
1580
1580
  });
1581
1581
  import net from "net";
1582
1582
  import os6 from "os";
1583
- import { spawn } from "child_process";
1583
+ import { spawn, execSync as execSync5 } from "child_process";
1584
1584
  import { randomUUID } from "crypto";
1585
1585
  import { existsSync as existsSync8, unlinkSync as unlinkSync3, readFileSync as readFileSync8, openSync, closeSync, statSync } from "fs";
1586
1586
  import path9 from "path";
@@ -1610,6 +1610,14 @@ function handleData(chunk) {
1610
1610
  }
1611
1611
  }
1612
1612
  }
1613
+ function isZombie(pid) {
1614
+ try {
1615
+ const state = execSync5(`ps -p ${pid} -o state=`, { encoding: "utf8", timeout: 2e3 }).trim();
1616
+ return state.startsWith("Z");
1617
+ } catch {
1618
+ return false;
1619
+ }
1620
+ }
1613
1621
  function cleanupStaleFiles() {
1614
1622
  if (existsSync8(PID_PATH)) {
1615
1623
  try {
@@ -1617,7 +1625,11 @@ function cleanupStaleFiles() {
1617
1625
  if (pid > 0) {
1618
1626
  try {
1619
1627
  process.kill(pid, 0);
1620
- return;
1628
+ if (!isZombie(pid)) {
1629
+ return;
1630
+ }
1631
+ process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
1632
+ `);
1621
1633
  } catch {
1622
1634
  }
1623
1635
  }
@@ -1645,8 +1657,8 @@ function findPackageRoot() {
1645
1657
  function getAvailableMemoryGB() {
1646
1658
  if (process.platform === "darwin") {
1647
1659
  try {
1648
- const { execSync: execSync9 } = __require("child_process");
1649
- const vmstat = execSync9("vm_stat", { encoding: "utf8" });
1660
+ const { execSync: execSync10 } = __require("child_process");
1661
+ const vmstat = execSync10("vm_stat", { encoding: "utf8" });
1650
1662
  const pageSize = 16384;
1651
1663
  const pageSizeMatch = vmstat.match(/page size of (\d+) bytes/);
1652
1664
  const actualPageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : pageSize;
@@ -3636,6 +3648,12 @@ async function disposeDatabase() {
3636
3648
  clearInterval(_walCheckpointTimer);
3637
3649
  _walCheckpointTimer = null;
3638
3650
  }
3651
+ if (_client) {
3652
+ try {
3653
+ await _client.execute("PRAGMA wal_checkpoint(PASSIVE)");
3654
+ } catch {
3655
+ }
3656
+ }
3639
3657
  if (_daemonClient) {
3640
3658
  _daemonClient.close();
3641
3659
  _daemonClient = null;
@@ -3984,7 +4002,7 @@ var init_state_bus = __esm({
3984
4002
  });
3985
4003
 
3986
4004
  // src/lib/project-name.ts
3987
- import { execSync as execSync5 } from "child_process";
4005
+ import { execSync as execSync6 } from "child_process";
3988
4006
  import path14 from "path";
3989
4007
  function getProjectName(cwd) {
3990
4008
  const dir = cwd ?? process.cwd();
@@ -3992,7 +4010,7 @@ function getProjectName(cwd) {
3992
4010
  try {
3993
4011
  let repoRoot;
3994
4012
  try {
3995
- const gitCommonDir = execSync5("git rev-parse --path-format=absolute --git-common-dir", {
4013
+ const gitCommonDir = execSync6("git rev-parse --path-format=absolute --git-common-dir", {
3996
4014
  cwd: dir,
3997
4015
  encoding: "utf8",
3998
4016
  timeout: 2e3,
@@ -4000,7 +4018,7 @@ function getProjectName(cwd) {
4000
4018
  }).trim();
4001
4019
  repoRoot = path14.dirname(gitCommonDir);
4002
4020
  } catch {
4003
- repoRoot = execSync5("git rev-parse --show-toplevel", {
4021
+ repoRoot = execSync6("git rev-parse --show-toplevel", {
4004
4022
  cwd: dir,
4005
4023
  encoding: "utf8",
4006
4024
  timeout: 2e3,
@@ -4091,7 +4109,7 @@ var init_session_scope = __esm({
4091
4109
  import crypto4 from "crypto";
4092
4110
  import path15 from "path";
4093
4111
  import os10 from "os";
4094
- import { execSync as execSync6 } from "child_process";
4112
+ import { execSync as execSync7 } from "child_process";
4095
4113
  import { mkdir as mkdir3, writeFile as writeFile3, appendFile } from "fs/promises";
4096
4114
  import { existsSync as existsSync13, readFileSync as readFileSync12 } from "fs";
4097
4115
  async function writeCheckpoint(input2) {
@@ -4436,14 +4454,14 @@ function isTmuxSessionAlive(identifier) {
4436
4454
  if (!identifier || identifier === "unknown") return true;
4437
4455
  try {
4438
4456
  if (identifier.startsWith("%")) {
4439
- const output = execSync6("tmux list-panes -a -F '#{pane_id}'", {
4457
+ const output = execSync7("tmux list-panes -a -F '#{pane_id}'", {
4440
4458
  timeout: 2e3,
4441
4459
  encoding: "utf8",
4442
4460
  stdio: ["pipe", "pipe", "pipe"]
4443
4461
  });
4444
4462
  return output.split("\n").some((l) => l.trim() === identifier);
4445
4463
  } else {
4446
- execSync6(`tmux has-session -t ${JSON.stringify(identifier)}`, {
4464
+ execSync7(`tmux has-session -t ${JSON.stringify(identifier)}`, {
4447
4465
  timeout: 2e3,
4448
4466
  stdio: ["pipe", "pipe", "pipe"]
4449
4467
  });
@@ -4452,7 +4470,7 @@ function isTmuxSessionAlive(identifier) {
4452
4470
  } catch {
4453
4471
  if (identifier.startsWith("%")) return true;
4454
4472
  try {
4455
- execSync6("tmux list-sessions", {
4473
+ execSync7("tmux list-sessions", {
4456
4474
  timeout: 2e3,
4457
4475
  stdio: ["pipe", "pipe", "pipe"]
4458
4476
  });
@@ -4467,12 +4485,12 @@ function checkStaleCompletion(taskContext, taskCreatedAt) {
4467
4485
  if (!DELEGATION_KEYWORDS.test(taskContext)) return null;
4468
4486
  try {
4469
4487
  const since = new Date(taskCreatedAt).toISOString();
4470
- const branch = execSync6(
4488
+ const branch = execSync7(
4471
4489
  "git rev-parse --abbrev-ref HEAD 2>/dev/null",
4472
4490
  { encoding: "utf8", timeout: 3e3 }
4473
4491
  ).trim();
4474
4492
  const branchArg = branch && branch !== "HEAD" ? branch : "";
4475
- const commitCount = execSync6(
4493
+ const commitCount = execSync7(
4476
4494
  `git log --oneline --since="${since}" ${branchArg} 2>/dev/null | wc -l`,
4477
4495
  { encoding: "utf8", timeout: 5e3 }
4478
4496
  ).trim();
@@ -6071,7 +6089,7 @@ __export(tmux_routing_exports, {
6071
6089
  spawnEmployee: () => spawnEmployee,
6072
6090
  verifyPaneAtCapacity: () => verifyPaneAtCapacity
6073
6091
  });
6074
- import { execFileSync as execFileSync2, execSync as execSync7 } from "child_process";
6092
+ import { execFileSync as execFileSync2, execSync as execSync8 } from "child_process";
6075
6093
  import { readFileSync as readFileSync13, writeFileSync as writeFileSync9, mkdirSync as mkdirSync8, existsSync as existsSync15, appendFileSync, readdirSync as readdirSync4 } from "fs";
6076
6094
  import path19 from "path";
6077
6095
  import os11 from "os";
@@ -6792,7 +6810,7 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
6792
6810
  let booted = false;
6793
6811
  for (let i = 0; i < 30; i++) {
6794
6812
  try {
6795
- execSync7("sleep 0.5");
6813
+ execSync8("sleep 0.5");
6796
6814
  } catch {
6797
6815
  }
6798
6816
  try {
@@ -6904,7 +6922,7 @@ var init_task_scope = __esm({
6904
6922
  // src/lib/keychain.ts
6905
6923
  import { readFile as readFile4, writeFile as writeFile5, unlink, mkdir as mkdir4, chmod as chmod2 } from "fs/promises";
6906
6924
  import { existsSync as existsSync17, statSync as statSync3 } from "fs";
6907
- import { execSync as execSync8 } from "child_process";
6925
+ import { execSync as execSync9 } from "child_process";
6908
6926
  import path21 from "path";
6909
6927
  import os12 from "os";
6910
6928
  function getKeyDir() {
@@ -6921,13 +6939,13 @@ function linuxSecretAvailable() {
6921
6939
  if (process.platform !== "linux") return false;
6922
6940
  if (linuxSecretAvailability !== null) return linuxSecretAvailability;
6923
6941
  try {
6924
- execSync8("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
6942
+ execSync9("command -v secret-tool >/dev/null 2>&1", { timeout: 1e3 });
6925
6943
  } catch {
6926
6944
  linuxSecretAvailability = false;
6927
6945
  return false;
6928
6946
  }
6929
6947
  try {
6930
- execSync8("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
6948
+ execSync9("secret-tool search --all exe-os probe >/dev/null 2>&1", { timeout: 1e3 });
6931
6949
  linuxSecretAvailability = true;
6932
6950
  } catch {
6933
6951
  linuxSecretAvailability = false;
@@ -6951,7 +6969,7 @@ function macKeychainGet(service = SERVICE) {
6951
6969
  if (!nativeKeychainAllowed()) return null;
6952
6970
  if (process.platform !== "darwin") return null;
6953
6971
  try {
6954
- return execSync8(
6972
+ return execSync9(
6955
6973
  `security find-generic-password -s "${service}" -a "${ACCOUNT}" -w 2>/dev/null`,
6956
6974
  { encoding: "utf-8", timeout: 5e3 }
6957
6975
  ).trim();
@@ -6964,13 +6982,13 @@ function macKeychainSet(value, service = SERVICE) {
6964
6982
  if (process.platform !== "darwin") return false;
6965
6983
  try {
6966
6984
  try {
6967
- execSync8(
6985
+ execSync9(
6968
6986
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
6969
6987
  { timeout: 5e3 }
6970
6988
  );
6971
6989
  } catch {
6972
6990
  }
6973
- execSync8(
6991
+ execSync9(
6974
6992
  `security add-generic-password -s "${service}" -a "${ACCOUNT}" -w "${value}"`,
6975
6993
  { timeout: 5e3 }
6976
6994
  );
@@ -6983,7 +7001,7 @@ function macKeychainDelete(service = SERVICE) {
6983
7001
  if (!nativeKeychainAllowed()) return false;
6984
7002
  if (process.platform !== "darwin") return false;
6985
7003
  try {
6986
- execSync8(
7004
+ execSync9(
6987
7005
  `security delete-generic-password -s "${service}" -a "${ACCOUNT}" 2>/dev/null`,
6988
7006
  { timeout: 5e3 }
6989
7007
  );
@@ -6995,7 +7013,7 @@ function macKeychainDelete(service = SERVICE) {
6995
7013
  function linuxSecretGet(service = SERVICE) {
6996
7014
  if (!linuxSecretAvailable()) return null;
6997
7015
  try {
6998
- return execSync8(
7016
+ return execSync9(
6999
7017
  `secret-tool lookup service "${service}" account "${ACCOUNT}" 2>/dev/null`,
7000
7018
  { encoding: "utf-8", timeout: 5e3 }
7001
7019
  ).trim();
@@ -7006,7 +7024,7 @@ function linuxSecretGet(service = SERVICE) {
7006
7024
  function linuxSecretSet(value, service = SERVICE) {
7007
7025
  if (!linuxSecretAvailable()) return false;
7008
7026
  try {
7009
- execSync8(
7027
+ execSync9(
7010
7028
  `echo -n "${value}" | secret-tool store --label="exe-os master key" service "${service}" account "${ACCOUNT}" 2>/dev/null`,
7011
7029
  { timeout: 5e3 }
7012
7030
  );
@@ -7019,7 +7037,7 @@ function linuxSecretDelete(service = SERVICE) {
7019
7037
  if (!nativeKeychainAllowed()) return false;
7020
7038
  if (process.platform !== "linux") return false;
7021
7039
  try {
7022
- execSync8(
7040
+ execSync9(
7023
7041
  `secret-tool clear service "${service}" account "${ACCOUNT}" 2>/dev/null`,
7024
7042
  { timeout: 5e3 }
7025
7043
  );
@@ -7901,6 +7919,24 @@ var init_platform_procedures = __esm({
7901
7919
  priority: "p0",
7902
7920
  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."
7903
7921
  },
7922
+ {
7923
+ title: "Bug report status check \u2014 surface available fixes on boot",
7924
+ domain: "support",
7925
+ priority: "p1",
7926
+ 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."
7927
+ },
7928
+ {
7929
+ title: "Feature request triage \u2014 upstream feature vs local customization",
7930
+ domain: "support",
7931
+ priority: "p0",
7932
+ 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."
7933
+ },
7934
+ {
7935
+ title: "Feature request status check \u2014 surface shipped features on boot",
7936
+ domain: "support",
7937
+ priority: "p1",
7938
+ 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."
7939
+ },
7904
7940
  // --- Operations ---
7905
7941
  {
7906
7942
  title: "Managers must supervise deployed workers",