@askexenow/exe-os 0.9.346 → 0.9.348

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 (316) hide show
  1. package/deploy/compose/cloudflared/config.yml.example +9 -6
  2. package/deploy/compose/docker-compose.yml +16 -9
  3. package/deploy/compose/sso-edge/default.conf.template +26 -0
  4. package/deploy/stack-manifests/v0.9.json +1 -1
  5. package/dist/{active-agent-Y7B6SUEV.js → active-agent-PX6KAEEQ.js} +4 -3
  6. package/dist/{active-agent-JXJFAZMM.js → active-agent-QVLZKWR2.js} +4 -3
  7. package/dist/{agentic-ontology-AUJAVTHS.js → agentic-ontology-6MEXY5L7.js} +1 -1
  8. package/dist/{backfill-metadata-3LUJK7D4.js → backfill-metadata-MCFBGWKX.js} +6 -5
  9. package/dist/{backup-verify-6UAZ5ETR.js → backup-verify-RGB3KKD4.js} +2 -1
  10. package/dist/{behaviors-BVOBYS73.js → behaviors-6GI6VND2.js} +7 -6
  11. package/dist/bin/agentic-ontology-backfill.js +7 -6
  12. package/dist/bin/agentic-reflection-backfill.js +8 -7
  13. package/dist/bin/agentic-semantic-label.js +7 -6
  14. package/dist/bin/backfill-conversations.js +6 -5
  15. package/dist/bin/backfill-responses.js +6 -5
  16. package/dist/bin/backfill-vectors.js +7 -6
  17. package/dist/bin/bulk-sync-postgres.js +11 -10
  18. package/dist/bin/cc-doctor.js +5 -4
  19. package/dist/bin/cleanup-stale-review-tasks.js +16 -15
  20. package/dist/bin/cli.js +16 -16
  21. package/dist/bin/deferred-daemon-restart.js +107 -94
  22. package/dist/bin/exe-agent-config.js +5 -4
  23. package/dist/bin/exe-agent.js +6 -5
  24. package/dist/bin/exe-assign.js +7 -6
  25. package/dist/bin/exe-boot.js +31 -30
  26. package/dist/bin/exe-call.js +6 -5
  27. package/dist/bin/exe-cloud.js +26 -15
  28. package/dist/bin/exe-config-dump.js +5 -4
  29. package/dist/bin/exe-dispatch.js +16 -15
  30. package/dist/bin/exe-doctor.js +5 -4
  31. package/dist/bin/exe-export-behaviors.js +9 -8
  32. package/dist/bin/exe-forget.js +8 -7
  33. package/dist/bin/exe-gateway.js +8 -7
  34. package/dist/bin/exe-healthcheck.js +5 -4
  35. package/dist/bin/exe-heartbeat.js +18 -17
  36. package/dist/bin/exe-kill.js +20 -19
  37. package/dist/bin/exe-launch-agent.js +26 -25
  38. package/dist/bin/exe-memory-reads.js +6 -5
  39. package/dist/bin/exe-new-employee.js +10 -9
  40. package/dist/bin/exe-os-mcp-proxy.js +4 -3
  41. package/dist/bin/exe-pending-messages.js +17 -16
  42. package/dist/bin/exe-pending-notifications.js +16 -15
  43. package/dist/bin/exe-pending-reviews.js +16 -15
  44. package/dist/bin/exe-rename.js +6 -5
  45. package/dist/bin/exe-review.js +19 -18
  46. package/dist/bin/exe-search.js +7 -6
  47. package/dist/bin/exe-session-cleanup.js +20 -19
  48. package/dist/bin/exe-settings.js +13 -12
  49. package/dist/bin/exe-start-codex.js +102 -21
  50. package/dist/bin/exe-start-opencode.js +11 -10
  51. package/dist/bin/exe-status.js +17 -16
  52. package/dist/bin/exe-support.js +3 -3
  53. package/dist/bin/exe-team.js +4 -3
  54. package/dist/bin/git-sweep.js +17 -16
  55. package/dist/bin/graph-backfill.js +7 -6
  56. package/dist/bin/graph-export.js +7 -6
  57. package/dist/bin/import-history.js +10 -9
  58. package/dist/bin/install.js +73 -73
  59. package/dist/bin/intercom-check.js +4 -4
  60. package/dist/bin/mcp-sessions.js +2 -2
  61. package/dist/bin/orchestration-metrics.js +5 -4
  62. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  63. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  64. package/dist/bin/pre-publish.js +1 -1
  65. package/dist/bin/reconcile-backlog.js +2 -2
  66. package/dist/bin/registry-proxy.js +1 -1
  67. package/dist/bin/scan-tasks.js +16 -15
  68. package/dist/bin/setup.js +2 -2
  69. package/dist/bin/shard-migrate.js +6 -5
  70. package/dist/bin/stack-update.js +7 -6
  71. package/dist/bin/vps-health-gate.js +1 -1
  72. package/dist/{boot-generation-IF4J6UEJ.js → boot-generation-FB2J53IG.js} +4 -3
  73. package/dist/{boot-review-sections-WEEFCSBX.js → boot-review-sections-QF5MZGJI.js} +15 -14
  74. package/dist/{capability-cards-C65NRVTL.js → capability-cards-YADEM2KN.js} +3 -2
  75. package/dist/{capacity-monitor-PGYDR35M.js → capacity-monitor-CG2IGONS.js} +17 -16
  76. package/dist/{catchup-brief-QB7M3OY7.js → catchup-brief-QFVNMTU5.js} +20 -19
  77. package/dist/{chunk-H5RS3XRJ.js → chunk-23O6LHII.js} +1 -1
  78. package/dist/{chunk-RLULWMUL.js → chunk-27REQ7KR.js} +1 -1
  79. package/dist/{chunk-GGPLVRYZ.js → chunk-2AD2GAPC.js} +1 -1
  80. package/dist/{chunk-25CXLXZQ.js → chunk-2WJYLXPF.js} +1 -1
  81. package/dist/{chunk-CFA4T2HP.js → chunk-43RTUMUT.js} +1 -1
  82. package/dist/{chunk-RYTY7KNZ.js → chunk-5C46Y4AK.js} +1 -1
  83. package/dist/{chunk-X7NSCRCD.js → chunk-5KCC26FB.js} +2 -2
  84. package/dist/{chunk-44ZGOBMU.js → chunk-5RPCWLXE.js} +1 -1
  85. package/dist/{chunk-ZASZQDAI.js → chunk-6GSYN262.js} +1 -1
  86. package/dist/{chunk-QS6KVXUN.js → chunk-6JQTSKDR.js} +263 -111
  87. package/dist/{chunk-QCM3YWL7.js → chunk-6QRS3IZF.js} +1 -1
  88. package/dist/{chunk-X2PLFBVG.js → chunk-6WFXNQDJ.js} +1 -1
  89. package/dist/{chunk-LUQ57SRM.js → chunk-7QRMFYOV.js} +23 -9
  90. package/dist/{chunk-HBJAMWHT.js → chunk-7WQ3WHPW.js} +195 -153
  91. package/dist/{chunk-OIF65HXR.js → chunk-A3YHWWE6.js} +10 -6
  92. package/dist/{chunk-OZLNCLS3.js → chunk-A42356G7.js} +1 -1
  93. package/dist/{chunk-24BHZNOP.js → chunk-A43SIGAO.js} +3 -3
  94. package/dist/{chunk-LSTIMHL4.js → chunk-AFY4V4N3.js} +1 -1
  95. package/dist/{chunk-Y7GJ6HXA.js → chunk-AJIXH5JF.js} +79 -25
  96. package/dist/{chunk-EU2GUT67.js → chunk-AMC2OPYP.js} +1 -1
  97. package/dist/{chunk-N4XVAP7Z.js → chunk-AQ24P2O7.js} +4 -4
  98. package/dist/{chunk-KQ3HRA6Q.js → chunk-AUILJKSM.js} +2 -2
  99. package/dist/{chunk-OQB5SKO4.js → chunk-AXNUMBLO.js} +3 -3
  100. package/dist/{chunk-SQIH3TDK.js → chunk-BOQUXG7N.js} +4 -4
  101. package/dist/{chunk-4A6RX2N6.js → chunk-BTP7BORU.js} +1 -1
  102. package/dist/{chunk-LYNELMA2.js → chunk-BUUGFQHL.js} +2 -2
  103. package/dist/{chunk-6OEMGMOV.js → chunk-CCOKYSJA.js} +3 -3
  104. package/dist/{chunk-6F3OMSZJ.js → chunk-DAODOSH4.js} +1 -1
  105. package/dist/{chunk-MWXXVXJL.js → chunk-DJYJDK53.js} +7 -7
  106. package/dist/{chunk-ZK6I3PUX.js → chunk-DXMTJJP3.js} +4 -4
  107. package/dist/{chunk-CMTS2MLG.js → chunk-E3BNUQHW.js} +2 -2
  108. package/dist/{chunk-YKIQF6EY.js → chunk-EFHGK6JP.js} +1 -1
  109. package/dist/{chunk-Q6ZQIX7L.js → chunk-FE6WBI2M.js} +5 -1
  110. package/dist/{chunk-6YABSGAW.js → chunk-FENYNW52.js} +1 -1
  111. package/dist/{chunk-4KLQ4GH5.js → chunk-FFCPSPNK.js} +1 -1
  112. package/dist/{chunk-FEIACXDV.js → chunk-FPK753IZ.js} +16 -16
  113. package/dist/{chunk-NCMFMJMZ.js → chunk-GA655CUD.js} +2 -2
  114. package/dist/{chunk-BDFRAQG5.js → chunk-GJ6KIHOM.js} +4 -4
  115. package/dist/{chunk-CR7XPLLC.js → chunk-GKNWKQFY.js} +1 -1
  116. package/dist/{chunk-VQLGFSML.js → chunk-GLOWJP5H.js} +2 -2
  117. package/dist/{chunk-XTGZDP2L.js → chunk-H3TA23PH.js} +4 -4
  118. package/dist/{chunk-GGHH54QD.js → chunk-H5QNVWU4.js} +18 -10
  119. package/dist/{chunk-WKUX5PFV.js → chunk-HL24OHHS.js} +9 -9
  120. package/dist/{chunk-3WELJGZN.js → chunk-HYZE3MNS.js} +1 -1
  121. package/dist/{chunk-HVZKJMJX.js → chunk-JORPYG4O.js} +1 -1
  122. package/dist/{chunk-JNEVNS5R.js → chunk-JW5XS35A.js} +9 -9
  123. package/dist/{chunk-OM2XM5HU.js → chunk-KIMAQNSM.js} +3 -3
  124. package/dist/{chunk-TIZE727O.js → chunk-KZUU6MNF.js} +1 -1
  125. package/dist/{chunk-OELDRRCZ.js → chunk-L36RX54F.js} +104 -11
  126. package/dist/{chunk-ZZQ4AEYB.js → chunk-M7PBRIRH.js} +1 -1
  127. package/dist/{chunk-4JDRUXQV.js → chunk-MGMXYI7Y.js} +2 -2
  128. package/dist/{chunk-4BQYN4IJ.js → chunk-MH5HWMVH.js} +1 -1
  129. package/dist/{chunk-BUDVHNV2.js → chunk-MMOONM6D.js} +1 -1
  130. package/dist/{chunk-CQN4IKRB.js → chunk-MMXIE6HV.js} +1 -1
  131. package/dist/{chunk-LNMTCTSH.js → chunk-MOZY4IQO.js} +1 -1
  132. package/dist/{chunk-EYGMCOTV.js → chunk-MVZLF27P.js} +2 -2
  133. package/dist/{chunk-HMVGXC4I.js → chunk-NY6DU5RB.js} +1 -1
  134. package/dist/{chunk-WMJK4GBF.js → chunk-O522M4YZ.js} +1 -1
  135. package/dist/{chunk-EDC57TDH.js → chunk-OBWIVRD6.js} +1 -1
  136. package/dist/{chunk-Q7UHMUCE.js → chunk-PAXAF2UY.js} +35 -15
  137. package/dist/{chunk-YLLUGK6J.js → chunk-PBLDPW4U.js} +2 -2
  138. package/dist/{chunk-D74XYSA3.js → chunk-QCQT5RXR.js} +5 -1
  139. package/dist/{chunk-3QYE5U6D.js → chunk-QNKR7WEL.js} +20 -6
  140. package/dist/{chunk-E6TLQG2T.js → chunk-RBRGSOK5.js} +1 -1
  141. package/dist/{chunk-6I6OMBYY.js → chunk-RFRUDXOI.js} +2 -2
  142. package/dist/{chunk-MHZAUM7G.js → chunk-SLH2743O.js} +3 -3
  143. package/dist/{chunk-LP6EJVVN.js → chunk-SMQ642D3.js} +4 -4
  144. package/dist/{chunk-BCFWDNH7.js → chunk-SQ4WACH4.js} +1 -1
  145. package/dist/{chunk-6LLDY7AL.js → chunk-TF5E6O5Q.js} +1 -1
  146. package/dist/{chunk-IXIQSWHV.js → chunk-TLWYOMSS.js} +3 -3
  147. package/dist/{chunk-2LC2ASCN.js → chunk-UAKGNQWE.js} +1 -1
  148. package/dist/{chunk-2WEUQWFQ.js → chunk-UTQWVRU6.js} +5 -5
  149. package/dist/{chunk-VPY4CMD6.js → chunk-WL3IQJKN.js} +3 -3
  150. package/dist/{chunk-NGP6LSV2.js → chunk-WNBZJSQT.js} +10 -1
  151. package/dist/{chunk-MCZWZEVE.js → chunk-WUMWXU6B.js} +1 -1
  152. package/dist/{chunk-R6C6UGVG.js → chunk-WWT3E7DO.js} +3 -3
  153. package/dist/{chunk-ACYZER3P.js → chunk-WZJ3VYRJ.js} +3 -3
  154. package/dist/{chunk-2KOQKLDF.js → chunk-X6VEQ7MC.js} +1 -1
  155. package/dist/{chunk-HXIBVZC3.js → chunk-Y3JXLIZV.js} +3 -3
  156. package/dist/{chunk-2UA263BM.js → chunk-YAIFZXOM.js} +5 -5
  157. package/dist/{chunk-YGTKGAWM.js → chunk-YM6GJM2F.js} +4 -4
  158. package/dist/chunk-YMUZWC33.js +8 -0
  159. package/dist/{chunk-DKKMBEU6.js → chunk-YTPCJLEL.js} +1 -1
  160. package/dist/{chunk-RPAMFCPP.js → chunk-Z52QQB4Z.js} +2 -2
  161. package/dist/{chunk-PJOHJ7Q4.js → chunk-ZXSFUR77.js} +172 -35
  162. package/dist/{cleanup-graph-garbage-INHZJESS.js → cleanup-graph-garbage-XTSBQXD6.js} +8 -7
  163. package/dist/{cloud-sync-shutdown-HNQ7T3LA.js → cloud-sync-shutdown-A2QB74YM.js} +3 -2
  164. package/dist/{co-activation-IMZM3IXG.js → co-activation-S2FVGMQP.js} +3 -2
  165. package/dist/{co-occurrence-PZAEUDAP.js → co-occurrence-VQB6U5ME.js} +6 -5
  166. package/dist/{conversation-entity-extractor-AU55E6YT.js → conversation-entity-extractor-YF3ZLTEJ.js} +3 -3
  167. package/dist/{crdt-sync-LI6FL3DG.js → crdt-sync-2SGCDWC3.js} +1 -1
  168. package/dist/{crm-webhook-NOLMWTAP.js → crm-webhook-P64SXEHD.js} +2 -2
  169. package/dist/{cto-delegation-gate-SZCLR4PI.js → cto-delegation-gate-6KLGT2LB.js} +15 -14
  170. package/dist/{daemon-orchestration-R5HT252K.js → daemon-orchestration-JQGKEWPD.js} +20 -20
  171. package/dist/{dispatch-ack-VUGMAGNL.js → dispatch-ack-AZL3WKCK.js} +1 -2
  172. package/dist/{doc-graph-extractor-E5SXO6NZ.js → doc-graph-extractor-DCJMATVZ.js} +6 -5
  173. package/dist/{documents-PYKWTZBA.js → documents-7EPH3VPE.js} +7 -6
  174. package/dist/{dreaming-JAHOTVRJ.js → dreaming-O4P2W5E5.js} +19 -18
  175. package/dist/{exe-drift-DGIY5YBT.js → exe-drift-ED7FBS2C.js} +4 -3
  176. package/dist/{exe-export-A6MC7LZ7.js → exe-export-YJI4USGZ.js} +9 -8
  177. package/dist/{exe-import-HKA6LKHC.js → exe-import-SUTAYKUW.js} +9 -8
  178. package/dist/{exe-key-6QXOAVR4.js → exe-key-CRSDAOZD.js} +71 -71
  179. package/dist/{exe-snapshot-BUPXYKMH.js → exe-snapshot-KB4YYDCA.js} +20 -19
  180. package/dist/{fast-db-init-BXLBA6II.js → fast-db-init-3K2PV6GJ.js} +1 -1
  181. package/dist/{founder-context-5KQR3ER3.js → founder-context-JHHFM4GF.js} +2 -2
  182. package/dist/gateway/index.js +9 -8
  183. package/dist/{git-main-guard-UZP3KXYI.js → git-main-guard-TGK3RQY3.js} +1 -1
  184. package/dist/{git-staleness-OTIXXNBN.js → git-staleness-YPHGWE3B.js} +3 -2
  185. package/dist/{global-procedures-ACYUMLIG.js → global-procedures-PEWDBSPJ.js} +5 -4
  186. package/dist/{graph-auto-extract-QWVENG4K.js → graph-auto-extract-7OJYYV4G.js} +6 -5
  187. package/dist/{graph-rag-2I24BQC2.js → graph-rag-YFITUAVO.js} +3 -3
  188. package/dist/{hook-prefetch-22IJRGX4.js → hook-prefetch-O6ZCZCTX.js} +16 -15
  189. package/dist/hooks/bug-report-worker.js +18 -18
  190. package/dist/hooks/codex-stop-task-finalizer.js +19 -19
  191. package/dist/hooks/commit-complete.js +18 -17
  192. package/dist/hooks/error-recall.js +8 -7
  193. package/dist/hooks/exe-heartbeat-hook.js +4 -3
  194. package/dist/hooks/ingest.js +7 -6
  195. package/dist/hooks/instructions-loaded.js +5 -4
  196. package/dist/hooks/manifest.json +19 -19
  197. package/dist/hooks/notification.js +5 -4
  198. package/dist/hooks/post-compact.js +17 -16
  199. package/dist/hooks/post-tool-combined.js +9 -9
  200. package/dist/hooks/pre-compact.js +18 -17
  201. package/dist/hooks/pre-tool-use.js +38 -40
  202. package/dist/hooks/prompt-submit.js +31 -30
  203. package/dist/hooks/session-end.js +22 -21
  204. package/dist/hooks/session-start.js +13 -13
  205. package/dist/hooks/stop.js +21 -20
  206. package/dist/hooks/subagent-stop.js +19 -18
  207. package/dist/hooks/summary-worker.js +22 -21
  208. package/dist/index.js +25 -24
  209. package/dist/{installer-QYXL3HBG.js → installer-3ONNP5JV.js} +6 -5
  210. package/dist/{installer-RWPVEBMJ.js → installer-CY5PN7TN.js} +6 -5
  211. package/dist/{installer-NZ76KPYJ.js → installer-N4QXGINR.js} +6 -5
  212. package/dist/{intercom-queue-TAARE4O7.js → intercom-queue-A52WQOCD.js} +15 -14
  213. package/dist/lib/agent-config.js +2 -2
  214. package/dist/lib/cloud-sync.js +15 -10
  215. package/dist/lib/consolidation.js +8 -7
  216. package/dist/lib/database.js +5 -2
  217. package/dist/lib/db-backup.js +2 -1
  218. package/dist/lib/db-checkpoint-worker.js +9 -0
  219. package/dist/lib/db-read-worker-client.js +21 -8
  220. package/dist/lib/db-read-worker.js +15 -0
  221. package/dist/lib/db-write-worker-client.js +4 -1
  222. package/dist/lib/db-write-worker.js +21 -6
  223. package/dist/lib/db.js +5 -2
  224. package/dist/lib/device-registry.js +1 -1
  225. package/dist/lib/employee-templates.js +6 -5
  226. package/dist/lib/employees.js +3 -2
  227. package/dist/lib/exe-daemon.js +344 -179
  228. package/dist/lib/hybrid-search.js +7 -6
  229. package/dist/lib/identity.js +3 -2
  230. package/dist/lib/license.js +2 -2
  231. package/dist/lib/messaging.js +16 -15
  232. package/dist/lib/registry-proxy.js +1 -1
  233. package/dist/lib/reminders.js +4 -3
  234. package/dist/lib/runtime-table.js +9 -3
  235. package/dist/lib/schedules.js +7 -6
  236. package/dist/lib/session-registry.js +5 -4
  237. package/dist/lib/skill-learning.js +8 -7
  238. package/dist/lib/store.js +6 -5
  239. package/dist/lib/task-router.js +4 -3
  240. package/dist/lib/tasks.js +17 -17
  241. package/dist/lib/tmux-routing.js +15 -14
  242. package/dist/lib/token-spend.js +4 -3
  243. package/dist/{license-gate-CVHDQZJV.js → license-gate-ZRORTAQ2.js} +3 -3
  244. package/dist/{license-sync-72S7BWQY.js → license-sync-CQHBDUQE.js} +2 -2
  245. package/dist/mcp/register-tools.js +70 -70
  246. package/dist/mcp/server.js +71 -71
  247. package/dist/mcp/tools/complete-reminder.js +5 -4
  248. package/dist/mcp/tools/create-reminder.js +5 -4
  249. package/dist/mcp/tools/create-task.js +19 -19
  250. package/dist/mcp/tools/deactivate-behavior.js +9 -8
  251. package/dist/mcp/tools/list-reminders.js +5 -4
  252. package/dist/mcp/tools/list-tasks.js +19 -19
  253. package/dist/mcp/tools/send-message.js +18 -17
  254. package/dist/mcp/tools/update-task.js +18 -18
  255. package/dist/{mcp-http-config-JP3XSY2X.js → mcp-http-config-2A6HKQP5.js} +4 -3
  256. package/dist/{mcp-session-identity-DDAM464U.js → mcp-session-identity-OPRX32H5.js} +15 -14
  257. package/dist/{memory-cards-XJ2JMF3V.js → memory-cards-GFO2CSPV.js} +6 -5
  258. package/dist/{memory-graph-extractor-FJVF7RTG.js → memory-graph-extractor-2Z72HN5P.js} +7 -6
  259. package/dist/{memory-poisoning-defense-GM3GQPRI.js → memory-poisoning-defense-WZJ52KXT.js} +3 -2
  260. package/dist/{memory-pressure-watchdog-HB572OZG.js → memory-pressure-watchdog-IG7VRFIX.js} +16 -15
  261. package/dist/{memory-reflection-WIMMTW7M.js → memory-reflection-LTRHDGUL.js} +3 -2
  262. package/dist/{notification-ledger-5TQXBYY2.js → notification-ledger-KSCPGLQG.js} +16 -15
  263. package/dist/{notifications-LA3X57YT.js → notifications-YKHZPCXU.js} +15 -14
  264. package/dist/{orchestration-events-KFZMGU3D.js → orchestration-events-HAFDPTLV.js} +4 -3
  265. package/dist/{orchestrator-MOJEAZ3K.js → orchestrator-4MZEQULR.js} +17 -16
  266. package/dist/{pipeline-router-2V5NFQ2O.js → pipeline-router-RSRJPZNI.js} +4 -3
  267. package/dist/{plan-limits-2LHFEYOT.js → plan-limits-5QYYPIPT.js} +6 -5
  268. package/dist/{platform-procedures-G44IYUM2.js → platform-procedures-DZ6YABEK.js} +1 -1
  269. package/dist/{projection-worker-ZMHVILPW.js → projection-worker-SKAMSZJF.js} +2 -2
  270. package/dist/{prospective-memory-JEWS5GFU.js → prospective-memory-V7LFCPU4.js} +3 -2
  271. package/dist/{reranker-TBQV76K4.js → reranker-HXMJ7SKW.js} +1 -1
  272. package/dist/{retrieval-health-HYXDUNFE.js → retrieval-health-4NCBHUUS.js} +1 -1
  273. package/dist/{review-polling-OFGP5Q7M.js → review-polling-KQUALBEU.js} +16 -15
  274. package/dist/runtime/index.js +19 -18
  275. package/dist/{session-events-ABAI2KE3.js → session-events-3KL735DZ.js} +16 -15
  276. package/dist/{session-kill-telemetry-2MHLK4Z4.js → session-kill-telemetry-KVRGLYVI.js} +16 -15
  277. package/dist/{session-scope-MRIE7ZKS.js → session-scope-LBG6DT5O.js} +15 -14
  278. package/dist/{setup-wizard-UQ3B2E6D.js → setup-wizard-UL3AKI6E.js} +2 -2
  279. package/dist/{skill-refinement-46QDGAGE.js → skill-refinement-6HPISXQC.js} +4 -3
  280. package/dist/{stack-update-5BPENFJK.js → stack-update-WBDTJJEF.js} +7 -3
  281. package/dist/{steward-gate-GXINMHNV.js → steward-gate-CWPD4HEK.js} +4 -3
  282. package/dist/{support-inbox-TCOASPLK.js → support-inbox-HRIHHKPU.js} +3 -3
  283. package/dist/{task-enforcement-OJAG2BGJ.js → task-enforcement-OAOL7XFL.js} +16 -15
  284. package/dist/{task-scope-5GKJTQL2.js → task-scope-PSVAE3EM.js} +15 -14
  285. package/dist/{tasks-crud-ZWKPTGPU.js → tasks-crud-TLELWWUL.js} +17 -14
  286. package/dist/{tasks-notify-IUDI6SYJ.js → tasks-notify-7Q2XTDZ7.js} +16 -16
  287. package/dist/{tasks-review-INJKVN63.js → tasks-review-S6QB5KGS.js} +15 -14
  288. package/dist/{telemetry-upload-LIC7M7AY.js → telemetry-upload-LTL5SW24.js} +8 -7
  289. package/dist/{token-budget-PABF5ZBO.js → token-budget-SK32GKFZ.js} +4 -3
  290. package/dist/{tool-telemetry-PDHE36YD.js → tool-telemetry-QJGJAHOC.js} +1 -1
  291. package/dist/tui/App.js +24 -23
  292. package/dist/{tui-data-Y6X7A4U4.js → tui-data-3JSV56ME.js} +15 -14
  293. package/dist/{update-support-COJYGU2V.js → update-support-LMPGWJVG.js} +10 -9
  294. package/dist/{work-state-heartbeat-YV3MAIQY.js → work-state-heartbeat-MQQOCU54.js} +1 -1
  295. package/dist/{worker-gate-BLJENHMV.js → worker-gate-P2O64XMH.js} +1 -1
  296. package/dist/{workflow-engine-AAPPPMFS.js → workflow-engine-BLLQKA3O.js} +2 -2
  297. package/dist/{worktree-MGYTWKCA.js → worktree-FJZXHDCJ.js} +5 -4
  298. package/dist/{worktree-sweep-HNNHNAXN.js → worktree-sweep-SW4AG6JR.js} +6 -5
  299. package/package.json +1 -1
  300. package/release-notes.json +56 -104
  301. package/dist/chunk-GSIJL4YA.js +0 -58
  302. /package/dist/{chunk-GH5YKFE7.js → chunk-AQ6ECPUP.js} +0 -0
  303. /package/dist/{chunk-O3XAKSKI.js → chunk-DRHXISWL.js} +0 -0
  304. /package/dist/{chunk-A3MGVYSP.js → chunk-E42D2E5F.js} +0 -0
  305. /package/dist/{chunk-PDN25UJU.js → chunk-FXZRJT3H.js} +0 -0
  306. /package/dist/{chunk-CHDPANT4.js → chunk-GFIWADEH.js} +0 -0
  307. /package/dist/{chunk-W7JPRQM2.js → chunk-GPZQZTJB.js} +0 -0
  308. /package/dist/{chunk-WPQ5LWMW.js → chunk-H4JKOLXU.js} +0 -0
  309. /package/dist/{chunk-RYWVPACG.js → chunk-HTJKAAHD.js} +0 -0
  310. /package/dist/{chunk-PDWIUSQH.js → chunk-PIUDQ7P2.js} +0 -0
  311. /package/dist/{chunk-HIN6X5QB.js → chunk-QUOMJKVF.js} +0 -0
  312. /package/dist/{chunk-DY7WDHMC.js → chunk-XF2D4CDA.js} +0 -0
  313. /package/dist/{core-memory-TBLZ2YQQ.js → core-memory-Z7LPR3RX.js} +0 -0
  314. /package/dist/{oauth-server-IB7OWY4H.js → oauth-server-FSKABATB.js} +0 -0
  315. /package/dist/{project-boot-TI3PUQNN.js → project-boot-FVSC4VQC.js} +0 -0
  316. /package/dist/{wiki-acl-V5IRECJ3.js → wiki-acl-CW2UALTJ.js} +0 -0
@@ -17,7 +17,7 @@ import {
17
17
  isWriteWorkerEnabled,
18
18
  spawnDbWriteWorker,
19
19
  writeMemoryInWorker
20
- } from "../chunk-LUQ57SRM.js";
20
+ } from "../chunk-7QRMFYOV.js";
21
21
  import {
22
22
  shouldScheduleDaemonRestartHandoff
23
23
  } from "../chunk-PWRC5XZO.js";
@@ -47,7 +47,7 @@ import {
47
47
  findScopedDuplicate,
48
48
  governMemoryRecord,
49
49
  schedulePostWriteMemoryHygiene
50
- } from "../chunk-W7JPRQM2.js";
50
+ } from "../chunk-GPZQZTJB.js";
51
51
  import "../chunk-5MOYSU5A.js";
52
52
  import "../chunk-4QCFFW2H.js";
53
53
  import "../chunk-76CJBM36.js";
@@ -55,7 +55,6 @@ import {
55
55
  BUSY_PATTERN
56
56
  } from "../chunk-OSKWCKUC.js";
57
57
  import {
58
- recordTimerPauseMs,
59
58
  runWithTimerPauseAccounting,
60
59
  sweepPauseTotalMs
61
60
  } from "../chunk-KI5PFRG6.js";
@@ -100,6 +99,9 @@ import {
100
99
  logHeartbeat,
101
100
  logShutdown
102
101
  } from "../chunk-BBMTVAE3.js";
102
+ import {
103
+ isPostgresBackendEnabled
104
+ } from "../chunk-YMUZWC33.js";
103
105
  import {
104
106
  EMBEDDING_DIM
105
107
  } from "../chunk-FXU7JOXK.js";
@@ -118,7 +120,7 @@ import net from "net";
118
120
  import v8 from "v8";
119
121
  import { createServer as createHttpServer, request as httpRequest } from "http";
120
122
  import { randomUUID, timingSafeEqual } from "crypto";
121
- import { writeFileSync as writeFileSync5, unlinkSync as unlinkSync4, mkdirSync as mkdirSync5, existsSync as existsSync7, readFileSync as readFileSync6, chmodSync as chmodSync2, readdirSync, renameSync as renameSync2, statSync as statSync4 } from "fs";
123
+ import { writeFileSync as writeFileSync5, unlinkSync as unlinkSync4, mkdirSync as mkdirSync5, existsSync as existsSync7, readFileSync as readFileSync6, chmodSync as chmodSync2, readdirSync as readdirSync2, renameSync as renameSync2, statSync as statSync4 } from "fs";
122
124
  import { writeFile } from "fs/promises";
123
125
  import { execSync as execSyncNode, execFile as execFileNode } from "child_process";
124
126
  import { promisify } from "util";
@@ -154,6 +156,36 @@ function createMemoizedNpmGlobalRootResolver(execFile, log = (m) => void process
154
156
  // src/lib/exe-daemon.ts
155
157
  import path4 from "path";
156
158
  import { fileURLToPath } from "url";
159
+
160
+ // src/lib/dist-drift.ts
161
+ import { readdirSync } from "fs";
162
+ function listDistChunkFiles(distDir, readdir = readdirSync) {
163
+ try {
164
+ return readdir(distDir).filter((f) => typeof f === "string" && f.endsWith(".js")).sort();
165
+ } catch {
166
+ return [];
167
+ }
168
+ }
169
+ function snapshotDist(distDir, pkgVersion, readdir = readdirSync) {
170
+ return { version: pkgVersion, chunks: listDistChunkFiles(distDir, readdir) };
171
+ }
172
+ function detectDistDrift(boot, current) {
173
+ const versionChanged = boot.version !== "unknown" && current.version !== "unknown" && boot.version !== current.version;
174
+ const currentSet = new Set(current.chunks);
175
+ const missingChunks = current.chunks.length === 0 && boot.chunks.length > 0 ? [] : boot.chunks.filter((c) => !currentSet.has(c));
176
+ const drifted = versionChanged || missingChunks.length > 0;
177
+ let reason = null;
178
+ if (versionChanged && missingChunks.length > 0) {
179
+ reason = `version ${boot.version} -> ${current.version} and ${missingChunks.length} chunk(s) removed`;
180
+ } else if (versionChanged) {
181
+ reason = `version ${boot.version} -> ${current.version}`;
182
+ } else if (missingChunks.length > 0) {
183
+ reason = `${missingChunks.length} boot chunk(s) removed from dist`;
184
+ }
185
+ return { drifted, reason, missingChunks, versionChanged };
186
+ }
187
+
188
+ // src/lib/exe-daemon.ts
157
189
  import { fork, spawn as spawn2 } from "child_process";
158
190
  import { Worker } from "worker_threads";
159
191
 
@@ -537,6 +569,25 @@ function startTimerTimeoutWatchdog(options) {
537
569
  };
538
570
  }
539
571
 
572
+ // src/lib/cloud-sync-daemon-runner.ts
573
+ function launchCloudSyncDaemonAttempt(options) {
574
+ if (options.isBusy()) {
575
+ options.onSkipped?.();
576
+ return false;
577
+ }
578
+ options.setBusy(true);
579
+ let running;
580
+ try {
581
+ running = options.run();
582
+ } catch (err) {
583
+ options.setBusy(false);
584
+ void options.onError(err);
585
+ return true;
586
+ }
587
+ void running.then((result) => options.onResult(result)).catch((err) => options.onError(err)).finally(() => options.setBusy(false));
588
+ return true;
589
+ }
590
+
540
591
  // src/lib/mcp-init-grace.ts
541
592
  var defaultSleep = (ms) => new Promise((r) => setTimeout(r, ms));
542
593
  async function awaitPendingMcpInit(ownerKey, requestSessionId, deps, transientMatch) {
@@ -1185,6 +1236,21 @@ var PACKAGE_VERSION = (() => {
1185
1236
  return "unknown";
1186
1237
  }
1187
1238
  })();
1239
+ var DIST_DIR = (() => {
1240
+ try {
1241
+ return fileURLToPath(new URL("..", import.meta.url));
1242
+ } catch {
1243
+ return "";
1244
+ }
1245
+ })();
1246
+ var PACKAGE_JSON_PATH = (() => {
1247
+ try {
1248
+ return fileURLToPath(new URL("../../package.json", import.meta.url));
1249
+ } catch {
1250
+ return "";
1251
+ }
1252
+ })();
1253
+ var BOOT_DIST_SNAPSHOT = snapshotDist(DIST_DIR, PACKAGE_VERSION);
1188
1254
  var _embedWorker = null;
1189
1255
  var _embedWorkerReady = false;
1190
1256
  var _embedLoadDeferrals = 0;
@@ -2061,7 +2127,7 @@ async function loadModel() {
2061
2127
  void (async () => {
2062
2128
  try {
2063
2129
  if (_storeInitialized) {
2064
- const { writeNotification } = await import("../notifications-LA3X57YT.js");
2130
+ const { writeNotification } = await import("../notifications-YKHZPCXU.js");
2065
2131
  await writeNotification({
2066
2132
  agentId: "exe",
2067
2133
  agentRole: "system",
@@ -2177,7 +2243,7 @@ function disableEmbeddingsForInferenceTimeouts() {
2177
2243
  void (async () => {
2178
2244
  try {
2179
2245
  if (_storeInitialized) {
2180
- const { writeNotification } = await import("../notifications-LA3X57YT.js");
2246
+ const { writeNotification } = await import("../notifications-YKHZPCXU.js");
2181
2247
  await writeNotification({
2182
2248
  agentId: "exe",
2183
2249
  agentRole: "system",
@@ -2423,7 +2489,7 @@ async function shutdown(exitCode = 0, reason = null) {
2423
2489
  dbBytes = dbPath ? statSync4(dbPath).size : 0;
2424
2490
  } catch {
2425
2491
  }
2426
- const { getAvailableMemoryBytesSync } = await import("../memory-pressure-watchdog-HB572OZG.js");
2492
+ const { getAvailableMemoryBytesSync } = await import("../memory-pressure-watchdog-IG7VRFIX.js");
2427
2493
  const freeBytes = getAvailableMemoryBytesSync();
2428
2494
  if (shouldSkipBackupUnderMemoryPressure(freeBytes, dbBytes)) {
2429
2495
  memoryGateSkip = true;
@@ -2476,7 +2542,7 @@ async function shutdown(exitCode = 0, reason = null) {
2476
2542
  `);
2477
2543
  }
2478
2544
  try {
2479
- const { stopProjectionWorker } = await import("../projection-worker-ZMHVILPW.js");
2545
+ const { stopProjectionWorker } = await import("../projection-worker-SKAMSZJF.js");
2480
2546
  stopProjectionWorker();
2481
2547
  } catch {
2482
2548
  }
@@ -2572,7 +2638,7 @@ async function handleHealthCheck(socket, requestId) {
2572
2638
  let pipelineStatus = "unknown";
2573
2639
  if (dbConnected) {
2574
2640
  try {
2575
- await import("../pipeline-router-2V5NFQ2O.js");
2641
+ await import("../pipeline-router-RSRJPZNI.js");
2576
2642
  pipelineStatus = "ok";
2577
2643
  } catch {
2578
2644
  pipelineStatus = "unavailable";
@@ -2773,7 +2839,7 @@ function persistIngestOutbox(req) {
2773
2839
  async function drainIngestOutbox() {
2774
2840
  try {
2775
2841
  if (!existsSync7(INGEST_OUTBOX_DIR)) return;
2776
- const files = readdirSync(INGEST_OUTBOX_DIR).filter((f) => f.endsWith(".json")).sort().slice(0, 500);
2842
+ const files = readdirSync2(INGEST_OUTBOX_DIR).filter((f) => f.endsWith(".json")).sort().slice(0, 500);
2777
2843
  for (const file of files) {
2778
2844
  const fullPath = path4.join(INGEST_OUTBOX_DIR, file);
2779
2845
  try {
@@ -3004,7 +3070,7 @@ async function _writeMemoryRecordInner(entry, syncOnly = false) {
3004
3070
  const vRow = await client.execute({ sql: "SELECT version FROM memories WHERE id = ?", args: [id] });
3005
3071
  const version = Number(vRow.rows[0]?.version) || 0;
3006
3072
  try {
3007
- const { insertOntologyForMemory } = await import("../agentic-ontology-AUJAVTHS.js");
3073
+ const { insertOntologyForMemory } = await import("../agentic-ontology-6MEXY5L7.js");
3008
3074
  await insertOntologyForMemory({
3009
3075
  id,
3010
3076
  agent_id: record.agent_id,
@@ -3814,7 +3880,7 @@ async function startMcpHttpServer() {
3814
3880
  clearBootstrapFailureMarker();
3815
3881
  setBootPhase("db_ready");
3816
3882
  _storeInitialized = true;
3817
- const { initLicenseGate, getCachedLicenseGate } = await import("../license-gate-CVHDQZJV.js");
3883
+ const { initLicenseGate, getCachedLicenseGate } = await import("../license-gate-ZRORTAQ2.js");
3818
3884
  const gateResult = await initLicenseGate();
3819
3885
  if (!gateResult.hasKey) {
3820
3886
  process.stderr.write(
@@ -3829,7 +3895,7 @@ async function startMcpHttpServer() {
3829
3895
  let _cachedWrapTelemetry = null;
3830
3896
  async function getWrapTelemetry() {
3831
3897
  if (!_cachedWrapTelemetry) {
3832
- const { wrapServerWithTelemetry } = await import("../tool-telemetry-PDHE36YD.js");
3898
+ const { wrapServerWithTelemetry } = await import("../tool-telemetry-QJGJAHOC.js");
3833
3899
  _cachedWrapTelemetry = wrapServerWithTelemetry;
3834
3900
  }
3835
3901
  return _cachedWrapTelemetry;
@@ -3901,7 +3967,7 @@ async function startMcpHttpServer() {
3901
3967
  const expectedBuf = Buffer.from(_daemonToken);
3902
3968
  if (tokenBuf.length === expectedBuf.length && timingSafeEqual(tokenBuf, expectedBuf)) return true;
3903
3969
  try {
3904
- const { verifyAccessToken } = await import("../oauth-server-IB7OWY4H.js");
3970
+ const { verifyAccessToken } = await import("../oauth-server-FSKABATB.js");
3905
3971
  const result = verifyAccessToken(token);
3906
3972
  return result.valid;
3907
3973
  } catch {
@@ -4154,7 +4220,7 @@ async function startMcpHttpServer() {
4154
4220
  return;
4155
4221
  }
4156
4222
  try {
4157
- const { handleOAuthRoute } = await import("../oauth-server-IB7OWY4H.js");
4223
+ const { handleOAuthRoute } = await import("../oauth-server-FSKABATB.js");
4158
4224
  const handled = await handleOAuthRoute(req, res, url, MCP_HTTP_PORT);
4159
4225
  if (handled) return;
4160
4226
  } catch (err) {
@@ -4282,7 +4348,7 @@ async function startMcpHttpServer() {
4282
4348
  contextPct: body.context_pct
4283
4349
  });
4284
4350
  if (body.context_pct !== void 0 && body.context_pct > 70) {
4285
- void import("../orchestration-events-KFZMGU3D.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4351
+ void import("../orchestration-events-HAFDPTLV.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4286
4352
  recordOE({
4287
4353
  eventType: "context.pressure",
4288
4354
  source: "exe-daemon.heartbeat",
@@ -4367,7 +4433,7 @@ async function startMcpHttpServer() {
4367
4433
  let sessionHint = req.headers["x-exe-session-name"] || req.headers["x-exe-session"] || "";
4368
4434
  if (sessionHint) {
4369
4435
  try {
4370
- const { sanitizeSessionHintHeader, rejectForgedSessionHint } = await import("../mcp-session-identity-DDAM464U.js");
4436
+ const { sanitizeSessionHintHeader, rejectForgedSessionHint } = await import("../mcp-session-identity-OPRX32H5.js");
4371
4437
  const rawHint = sessionHint;
4372
4438
  sessionHint = sanitizeSessionHintHeader(sessionHint);
4373
4439
  if (!sessionHint) {
@@ -4406,7 +4472,7 @@ async function startMcpHttpServer() {
4406
4472
  try {
4407
4473
  const liveSessions = await getTmuxSessionsAsync();
4408
4474
  const paneCommands = await getPaneCommandsAsync();
4409
- const { resolveMcpSessionHint } = await import("../mcp-session-identity-DDAM464U.js");
4475
+ const { resolveMcpSessionHint } = await import("../mcp-session-identity-OPRX32H5.js");
4410
4476
  let registrySessions = [];
4411
4477
  try {
4412
4478
  const { listSessions: listRegistrySessions } = await import("./session-registry.js");
@@ -4543,7 +4609,7 @@ async function startMcpHttpServer() {
4543
4609
  bindLive = await getTmuxSessionsAsync();
4544
4610
  } catch {
4545
4611
  }
4546
- const { isLauncherCorroboratedIdentity } = await import("../mcp-session-identity-DDAM464U.js");
4612
+ const { isLauncherCorroboratedIdentity } = await import("../mcp-session-identity-OPRX32H5.js");
4547
4613
  const corroborated = isLauncherCorroboratedIdentity({
4548
4614
  agentId,
4549
4615
  registrySessions: bindRegistry,
@@ -4786,7 +4852,7 @@ async function startMcpHttpServer() {
4786
4852
  }
4787
4853
  }
4788
4854
  try {
4789
- const { reconcileHintWithRegistryIdentity } = await import("../mcp-session-identity-DDAM464U.js");
4855
+ const { reconcileHintWithRegistryIdentity } = await import("../mcp-session-identity-OPRX32H5.js");
4790
4856
  const { listSessions: listRegistrySessions } = await import("./session-registry.js");
4791
4857
  const recon = reconcileHintWithRegistryIdentity({
4792
4858
  agentId,
@@ -4966,15 +5032,31 @@ var _storeInitialized = false;
4966
5032
  async function ensureStoreForPolling() {
4967
5033
  if (_storeInitialized) return true;
4968
5034
  try {
4969
- const { initDatabase, isInitialized, ensureSchema } = await import("./database.js");
5035
+ const { initDatabase, initPostgresOnlyDatabase, isInitialized, ensureSchema } = await import("./database.js");
4970
5036
  if (!isInitialized()) {
4971
5037
  const { loadConfig } = await import("./config.js");
4972
5038
  const { getMasterKey } = await import("./keychain.js");
4973
5039
  const config = await loadConfig();
4974
5040
  const masterKey = await getMasterKey();
4975
5041
  if (!masterKey) {
4976
- if (process.env.DATABASE_URL && process.env.EXE_CLOUD_SYNC_TO_POSTGRES) {
5042
+ if (isPostgresBackendEnabled()) {
5043
+ await initPostgresOnlyDatabase();
4977
5044
  process.stderr.write("[exed] No encryption key \u2014 running in PostgreSQL-only mode (VPS)\n");
5045
+ try {
5046
+ const { spawnDbReadWorker } = await import("./db-read-worker-client.js");
5047
+ spawnDbReadWorker();
5048
+ } catch (e) {
5049
+ process.stderr.write(`[exed] DB read worker spawn failed (non-fatal): ${e instanceof Error ? e.message : String(e)}
5050
+ `);
5051
+ }
5052
+ try {
5053
+ if (isWriteWorkerEnabled()) {
5054
+ spawnDbWriteWorker();
5055
+ }
5056
+ } catch (e) {
5057
+ process.stderr.write(`[exed] DB write worker spawn failed (non-fatal): ${e instanceof Error ? e.message : String(e)}
5058
+ `);
5059
+ }
4978
5060
  _storeInitialized = true;
4979
5061
  return true;
4980
5062
  }
@@ -4983,9 +5065,9 @@ async function ensureStoreForPolling() {
4983
5065
  await initDatabase({ dbPath: config.dbPath, encryptionKey: masterKey.toString("hex") });
4984
5066
  await ensureSchema();
4985
5067
  try {
4986
- const { isLedgerEnabled } = await import("../notification-ledger-5TQXBYY2.js");
5068
+ const { isLedgerEnabled } = await import("../notification-ledger-KSCPGLQG.js");
4987
5069
  if (isLedgerEnabled()) {
4988
- const { bumpBootGeneration } = await import("../boot-generation-IF4J6UEJ.js");
5070
+ const { bumpBootGeneration } = await import("../boot-generation-FB2J53IG.js");
4989
5071
  const { setDaemonReadyGeneration } = await import("../daemon-ready-signal-TVCPSG7J.js");
4990
5072
  const generation = await bumpBootGeneration();
4991
5073
  setDaemonReadyGeneration(generation);
@@ -5025,13 +5107,13 @@ async function ensureStoreForPolling() {
5025
5107
  }
5026
5108
  }
5027
5109
  async function startReviewPolling() {
5028
- const polling = await import("../review-polling-OFGP5Q7M.js");
5110
+ const polling = await import("../review-polling-KQUALBEU.js");
5029
5111
  const state = {
5030
5112
  lastIntercomSent: /* @__PURE__ */ new Map(),
5031
5113
  lastNudgeSent: /* @__PURE__ */ new Map(),
5032
5114
  intervalMs: REVIEW_POLL_INTERVAL_MS
5033
5115
  };
5034
- const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-R5HT252K.js");
5116
+ const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-JQGKEWPD.js");
5035
5117
  const nudgeState = loadNudgeState();
5036
5118
  const tick = async () => traceDaemonTimer("review_polling", async () => {
5037
5119
  fired("review_polling");
@@ -5077,7 +5159,7 @@ function startSessionTTL() {
5077
5159
  if (!await ensureStoreForPolling()) return;
5078
5160
  if (inPostRestartDestructiveGrace("session_ttl")) return;
5079
5161
  const { getClient } = await import("./database.js");
5080
- const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-R5HT252K.js");
5162
+ const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-JQGKEWPD.js");
5081
5163
  const deps = createSessionTTLRealDeps(getClient);
5082
5164
  const killed = await checkSessionTTL(deps, _wedgeObservations);
5083
5165
  if (killed.length > 0) acted("session_ttl");
@@ -5129,7 +5211,7 @@ function startIdleKill() {
5129
5211
  const cfg = await getCachedConfig();
5130
5212
  if (!cfg) return;
5131
5213
  const { getClient } = await import("./database.js");
5132
- const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-R5HT252K.js");
5214
+ const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-JQGKEWPD.js");
5133
5215
  const { sessions: liveSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
5134
5216
  const realDeps = createIdleKillRealDeps(
5135
5217
  getClient,
@@ -5282,18 +5364,19 @@ async function runCloudSyncChild() {
5282
5364
  const env = buildCloudSyncChildEnv(process.env, { dbPath });
5283
5365
  const timeoutMs = cloudSyncChildTimeoutMs({ dbPath });
5284
5366
  cloudSyncDebugLog(`[exed] Cloud sync child timeout: ${timeoutMs}ms${dbPath ? ` (db=${dbPath})` : ""}`);
5285
- try {
5286
- const { verifyAndCleanStaleDbLock } = await import("./database.js");
5287
- const lockResult = await verifyAndCleanStaleDbLock();
5288
- if (lockResult === "cleaned-dead" || lockResult === "cleaned-pid-reuse") {
5289
- process.stderr.write(`[exed] Cloud sync pre-spawn db.lock verification: ${lockResult}
5367
+ if (!isPostgresBackendEnabled()) {
5368
+ try {
5369
+ const { verifyAndCleanStaleDbLock } = await import("./database.js");
5370
+ const lockResult = await verifyAndCleanStaleDbLock();
5371
+ if (lockResult === "cleaned-dead" || lockResult === "cleaned-pid-reuse") {
5372
+ process.stderr.write(`[exed] Cloud sync pre-spawn db.lock verification: ${lockResult}
5290
5373
  `);
5291
- }
5292
- } catch (err) {
5293
- process.stderr.write(`[exed] Cloud sync pre-spawn db.lock verification failed: ${err instanceof Error ? err.message : String(err)}
5374
+ }
5375
+ } catch (err) {
5376
+ process.stderr.write(`[exed] Cloud sync pre-spawn db.lock verification failed: ${err instanceof Error ? err.message : String(err)}
5294
5377
  `);
5378
+ }
5295
5379
  }
5296
- const childWaitProbe = captureClockProbe();
5297
5380
  try {
5298
5381
  return await runCapturedCloudSyncChild({
5299
5382
  command: process.execPath,
@@ -5306,12 +5389,92 @@ async function runCloudSyncChild() {
5306
5389
  }
5307
5390
  });
5308
5391
  } finally {
5309
- const childWait = measureSpan(childWaitProbe);
5310
- recordTimerPauseMs(Math.round(childWait.monoMs));
5311
5392
  _cloudSyncChild = null;
5312
5393
  }
5313
5394
  }
5314
5395
  function startCloudSyncTimer() {
5396
+ const handleCloudSyncResult = async (result) => {
5397
+ if (result.code !== 0) {
5398
+ const err = new Error(
5399
+ `cloud sync child exited code=${result.code ?? "null"} signal=${result.signal ?? "null"} \u2014 last stderr: ${formatCloudSyncStderrTail(result.stderrTail)}`
5400
+ );
5401
+ err.stderrTail = result.stderrTail;
5402
+ throw err;
5403
+ }
5404
+ if (_cloudSyncConsecutiveFailures > 0) {
5405
+ process.stderr.write(`[exed] Cloud sync recovered after ${_cloudSyncConsecutiveFailures} failures
5406
+ `);
5407
+ }
5408
+ _cloudSyncConsecutiveFailures = 0;
5409
+ _cloudSyncBackoffMs = 0;
5410
+ _cloudSyncPaused = false;
5411
+ acted("cloud_sync");
5412
+ process.stderr.write(`[exed] Cloud sync child completed successfully
5413
+ `);
5414
+ };
5415
+ const handleCloudSyncError = (err) => {
5416
+ _cloudSyncConsecutiveFailures++;
5417
+ const msg = err instanceof Error ? err.message : String(err);
5418
+ const stderrTail = err instanceof Error ? err.stderrTail : void 0;
5419
+ const lastSuccessAt = previousCloudSyncLastSuccessAt();
5420
+ _cloudSyncBackoffMs = Math.min(
5421
+ CLOUD_SYNC_BACKOFF_BASE_MS * Math.pow(2, _cloudSyncConsecutiveFailures - 1),
5422
+ CLOUD_SYNC_BACKOFF_MAX_MS
5423
+ );
5424
+ logDaemonHealth({
5425
+ event: "cloud_sync_fail",
5426
+ pid: process.pid,
5427
+ message: "Cloud sync child failed",
5428
+ data: {
5429
+ consecutiveFailures: _cloudSyncConsecutiveFailures,
5430
+ lastError: msg,
5431
+ ...stderrTail ? { stderrTail: formatCloudSyncStderrTail(stderrTail) } : {}
5432
+ }
5433
+ });
5434
+ const failureNow = (/* @__PURE__ */ new Date()).toISOString();
5435
+ persistCloudSyncState({
5436
+ lastSuccessAt,
5437
+ lastError: msg,
5438
+ consecutiveFailures: _cloudSyncConsecutiveFailures,
5439
+ paused: false,
5440
+ pausedAt: null,
5441
+ intervalMs: CLOUD_SYNC_INTERVAL_MS,
5442
+ updatedAt: failureNow
5443
+ });
5444
+ if (_cloudSyncConsecutiveFailures >= CLOUD_SYNC_CIRCUIT_BREAK) {
5445
+ _cloudSyncPaused = true;
5446
+ _cloudSyncPausedAt = Date.now();
5447
+ const pausedAt = new Date(_cloudSyncPausedAt).toISOString();
5448
+ persistCloudSyncState({
5449
+ lastSuccessAt,
5450
+ lastError: msg,
5451
+ consecutiveFailures: _cloudSyncConsecutiveFailures,
5452
+ paused: true,
5453
+ pausedAt,
5454
+ intervalMs: CLOUD_SYNC_INTERVAL_MS,
5455
+ updatedAt: pausedAt
5456
+ });
5457
+ process.stderr.write(
5458
+ `[exed] Cloud sync PAUSED after ${CLOUD_SYNC_CIRCUIT_BREAK} consecutive failures. Last error: ${msg}. Will retry when daemon restarts or /exe-cloud sync is run manually.
5459
+ `
5460
+ );
5461
+ logDaemonHealth({
5462
+ event: "cloud_sync_fail",
5463
+ pid: process.pid,
5464
+ message: `Cloud sync circuit-breaker tripped after ${CLOUD_SYNC_CIRCUIT_BREAK} failures`,
5465
+ data: {
5466
+ consecutiveFailures: _cloudSyncConsecutiveFailures,
5467
+ lastError: msg,
5468
+ ...stderrTail ? { stderrTail: formatCloudSyncStderrTail(stderrTail) } : {}
5469
+ }
5470
+ });
5471
+ } else {
5472
+ process.stderr.write(
5473
+ `[exed] Cloud sync error (${_cloudSyncConsecutiveFailures}/${CLOUD_SYNC_CIRCUIT_BREAK}, backoff ${Math.round(_cloudSyncBackoffMs / 1e3)}s): ${msg}
5474
+ `
5475
+ );
5476
+ }
5477
+ };
5315
5478
  const tick = async () => {
5316
5479
  fired("cloud_sync");
5317
5480
  if (_shuttingDown) return;
@@ -5320,115 +5483,43 @@ function startCloudSyncTimer() {
5320
5483
  `);
5321
5484
  return;
5322
5485
  }
5323
- _cloudSyncRunning = true;
5324
- try {
5325
- if (_cloudSyncPaused) {
5326
- if (Date.now() - _cloudSyncPausedAt > CLOUD_SYNC_AUTO_RECOVERY_MS) {
5327
- process.stderr.write(`[exed] Cloud sync auto-recovery: retrying after ${Math.round(CLOUD_SYNC_AUTO_RECOVERY_MS / 6e4)}m pause
5328
- `);
5329
- _cloudSyncPaused = false;
5330
- _cloudSyncConsecutiveFailures = 0;
5331
- _cloudSyncBackoffMs = 0;
5332
- } else {
5333
- if (_cloudSyncConsecutiveFailures > 0 && _cloudSyncConsecutiveFailures % 20 === 0) {
5334
- process.stderr.write(`[exed] Cloud sync still paused after ${_cloudSyncConsecutiveFailures} failures (auto-retry in ${Math.round((CLOUD_SYNC_AUTO_RECOVERY_MS - (Date.now() - _cloudSyncPausedAt)) / 6e4)}m)
5335
- `);
5336
- }
5337
- _cloudSyncConsecutiveFailures++;
5338
- return;
5339
- }
5340
- }
5341
- if (_cloudSyncBackoffMs > 0) {
5342
- _cloudSyncBackoffMs = Math.max(0, _cloudSyncBackoffMs - CLOUD_SYNC_INTERVAL_MS);
5343
- return;
5344
- }
5345
- try {
5346
- const { loadConfig } = await import("./config.js");
5347
- const config = await loadConfig();
5348
- if (!config.cloud?.apiKey || !config.cloud?.endpoint) return;
5349
- const result = await runCloudSyncChild();
5350
- if (result.code !== 0) {
5351
- const err = new Error(
5352
- `cloud sync child exited code=${result.code ?? "null"} signal=${result.signal ?? "null"} \u2014 last stderr: ${formatCloudSyncStderrTail(result.stderrTail)}`
5353
- );
5354
- err.stderrTail = result.stderrTail;
5355
- throw err;
5356
- }
5357
- if (_cloudSyncConsecutiveFailures > 0) {
5358
- process.stderr.write(`[exed] Cloud sync recovered after ${_cloudSyncConsecutiveFailures} failures
5486
+ if (_cloudSyncPaused) {
5487
+ if (Date.now() - _cloudSyncPausedAt > CLOUD_SYNC_AUTO_RECOVERY_MS) {
5488
+ process.stderr.write(`[exed] Cloud sync auto-recovery: retrying after ${Math.round(CLOUD_SYNC_AUTO_RECOVERY_MS / 6e4)}m pause
5359
5489
  `);
5360
- }
5490
+ _cloudSyncPaused = false;
5361
5491
  _cloudSyncConsecutiveFailures = 0;
5362
5492
  _cloudSyncBackoffMs = 0;
5363
- _cloudSyncPaused = false;
5364
- acted("cloud_sync");
5365
- process.stderr.write(`[exed] Cloud sync child completed successfully
5493
+ } else {
5494
+ if (_cloudSyncConsecutiveFailures > 0 && _cloudSyncConsecutiveFailures % 20 === 0) {
5495
+ process.stderr.write(`[exed] Cloud sync still paused after ${_cloudSyncConsecutiveFailures} failures (auto-retry in ${Math.round((CLOUD_SYNC_AUTO_RECOVERY_MS - (Date.now() - _cloudSyncPausedAt)) / 6e4)}m)
5366
5496
  `);
5367
- } catch (err) {
5368
- _cloudSyncConsecutiveFailures++;
5369
- const msg = err instanceof Error ? err.message : String(err);
5370
- const stderrTail = err instanceof Error ? err.stderrTail : void 0;
5371
- const lastSuccessAt = previousCloudSyncLastSuccessAt();
5372
- _cloudSyncBackoffMs = Math.min(
5373
- CLOUD_SYNC_BACKOFF_BASE_MS * Math.pow(2, _cloudSyncConsecutiveFailures - 1),
5374
- CLOUD_SYNC_BACKOFF_MAX_MS
5375
- );
5376
- logDaemonHealth({
5377
- event: "cloud_sync_fail",
5378
- pid: process.pid,
5379
- message: "Cloud sync child failed",
5380
- data: {
5381
- consecutiveFailures: _cloudSyncConsecutiveFailures,
5382
- lastError: msg,
5383
- ...stderrTail ? { stderrTail: formatCloudSyncStderrTail(stderrTail) } : {}
5384
- }
5385
- });
5386
- const failureNow = (/* @__PURE__ */ new Date()).toISOString();
5387
- persistCloudSyncState({
5388
- lastSuccessAt,
5389
- lastError: msg,
5390
- consecutiveFailures: _cloudSyncConsecutiveFailures,
5391
- paused: false,
5392
- pausedAt: null,
5393
- intervalMs: CLOUD_SYNC_INTERVAL_MS,
5394
- updatedAt: failureNow
5395
- });
5396
- if (_cloudSyncConsecutiveFailures >= CLOUD_SYNC_CIRCUIT_BREAK) {
5397
- _cloudSyncPaused = true;
5398
- _cloudSyncPausedAt = Date.now();
5399
- const pausedAt = new Date(_cloudSyncPausedAt).toISOString();
5400
- persistCloudSyncState({
5401
- lastSuccessAt,
5402
- lastError: msg,
5403
- consecutiveFailures: _cloudSyncConsecutiveFailures,
5404
- paused: true,
5405
- pausedAt,
5406
- intervalMs: CLOUD_SYNC_INTERVAL_MS,
5407
- updatedAt: pausedAt
5408
- });
5409
- process.stderr.write(
5410
- `[exed] Cloud sync PAUSED after ${CLOUD_SYNC_CIRCUIT_BREAK} consecutive failures. Last error: ${msg}. Will retry when daemon restarts or /exe-cloud sync is run manually.
5411
- `
5412
- );
5413
- logDaemonHealth({
5414
- event: "cloud_sync_fail",
5415
- pid: process.pid,
5416
- message: `Cloud sync circuit-breaker tripped after ${CLOUD_SYNC_CIRCUIT_BREAK} failures`,
5417
- data: {
5418
- consecutiveFailures: _cloudSyncConsecutiveFailures,
5419
- lastError: msg,
5420
- ...stderrTail ? { stderrTail: formatCloudSyncStderrTail(stderrTail) } : {}
5421
- }
5422
- });
5423
- } else {
5424
- process.stderr.write(
5425
- `[exed] Cloud sync error (${_cloudSyncConsecutiveFailures}/${CLOUD_SYNC_CIRCUIT_BREAK}, backoff ${Math.round(_cloudSyncBackoffMs / 1e3)}s): ${msg}
5426
- `
5427
- );
5428
5497
  }
5498
+ _cloudSyncConsecutiveFailures++;
5499
+ return;
5429
5500
  }
5430
- } finally {
5431
- _cloudSyncRunning = false;
5501
+ }
5502
+ if (_cloudSyncBackoffMs > 0) {
5503
+ _cloudSyncBackoffMs = Math.max(0, _cloudSyncBackoffMs - CLOUD_SYNC_INTERVAL_MS);
5504
+ return;
5505
+ }
5506
+ try {
5507
+ const { loadConfig } = await import("./config.js");
5508
+ const config = await loadConfig();
5509
+ if (!config.cloud?.apiKey || !config.cloud?.endpoint) return;
5510
+ launchCloudSyncDaemonAttempt({
5511
+ isBusy: () => _cloudSyncRunning || _cloudSyncChild !== null,
5512
+ setBusy: (busy) => {
5513
+ _cloudSyncRunning = busy;
5514
+ },
5515
+ run: runCloudSyncChild,
5516
+ onResult: handleCloudSyncResult,
5517
+ onError: handleCloudSyncError,
5518
+ onSkipped: () => process.stderr.write(`[exed] Cloud sync skipped \u2014 previous sync still running
5519
+ `)
5520
+ });
5521
+ } catch (err) {
5522
+ handleCloudSyncError(err);
5432
5523
  }
5433
5524
  };
5434
5525
  const timer = setInterval(() => void traceDaemonTimer("cloud_sync", tick), CLOUD_SYNC_INTERVAL_MS);
@@ -5493,7 +5584,7 @@ function startSkillRefinement() {
5493
5584
  if (!shouldRunHeavyJob("skill_refinement")) return;
5494
5585
  try {
5495
5586
  if (!await ensureStoreForPolling()) return;
5496
- const { runSkillRefinement } = await import("../skill-refinement-46QDGAGE.js");
5587
+ const { runSkillRefinement } = await import("../skill-refinement-6HPISXQC.js");
5497
5588
  const result = await runSkillRefinement();
5498
5589
  if (result.reviewed > 0) {
5499
5590
  acted("skill_refinement");
@@ -5519,7 +5610,7 @@ function startStaleBranchSweep() {
5519
5610
  const tick = async () => {
5520
5611
  fired("stale_branch_sweep");
5521
5612
  try {
5522
- const { discoverRepoPaths } = await import("../worktree-sweep-HNNHNAXN.js");
5613
+ const { discoverRepoPaths } = await import("../worktree-sweep-SW4AG6JR.js");
5523
5614
  const { scanUnmergedBranchesCached } = await import("../branch-hygiene-HNSOUDJE.js");
5524
5615
  const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
5525
5616
  for (const k of _staleBranchAlertedToday) {
@@ -5551,7 +5642,7 @@ function startStaleBranchSweep() {
5551
5642
  if (!_storeInitialized) continue;
5552
5643
  const stale = scan.branches.filter((b) => b.ageHours >= STALE_BRANCH_HOURS).slice(0, 5).map((b) => `${b.name} (+${b.ahead} commits, ${(b.ageHours / 24).toFixed(1)}d)`).join("; ");
5553
5644
  try {
5554
- const { writeNotification } = await import("../notifications-LA3X57YT.js");
5645
+ const { writeNotification } = await import("../notifications-YKHZPCXU.js");
5555
5646
  await writeNotification({
5556
5647
  agentId: "exe",
5557
5648
  agentRole: "system",
@@ -5606,7 +5697,7 @@ function startWorkStateHeartbeat() {
5606
5697
  const { getClient } = await import("./database.js");
5607
5698
  const { listSessions } = await import("./session-registry.js");
5608
5699
  const { isCoordinatorName } = await import("./employees.js");
5609
- const { runWorkStateTick } = await import("../work-state-heartbeat-YV3MAIQY.js");
5700
+ const { runWorkStateTick } = await import("../work-state-heartbeat-MQQOCU54.js");
5610
5701
  let liveTmux = null;
5611
5702
  const loadLiveTmux = async () => {
5612
5703
  if (!liveTmux) liveTmux = await listTmuxSessionNamesAsync();
@@ -5671,7 +5762,7 @@ function startGraphExtraction() {
5671
5762
  if (!await ensureStoreForPolling()) return;
5672
5763
  const { getClient } = await import("./database.js");
5673
5764
  const client = getClient();
5674
- const { extractBatch } = await import("../graph-rag-2I24BQC2.js");
5765
+ const { extractBatch } = await import("../graph-rag-YFITUAVO.js");
5675
5766
  const result = await extractBatch(client, 50, config.selfQueryModel);
5676
5767
  if (result.processed > 0) {
5677
5768
  acted("graph_extraction");
@@ -6089,7 +6180,7 @@ function startReflectionSweep() {
6089
6180
  );
6090
6181
  let runReflection;
6091
6182
  try {
6092
- ({ runReflection } = await import("../memory-reflection-WIMMTW7M.js"));
6183
+ ({ runReflection } = await import("../memory-reflection-LTRHDGUL.js"));
6093
6184
  } catch (importErr) {
6094
6185
  _reflectionImportFailed = true;
6095
6186
  process.stderr.write(`[exed] Reflection module unavailable (stale chunk hash?) \u2014 disabled until daemon restart: ${importErr instanceof Error ? importErr.message : String(importErr)}
@@ -6130,7 +6221,7 @@ function startReflectionSweep() {
6130
6221
  if (memories > 100 && cards < memories * 0.1) {
6131
6222
  process.stderr.write(`[exed] Memory cards sparse (${cards} cards / ${memories} memories) \u2014 running backfill...
6132
6223
  `);
6133
- const { insertMemoryCardsForBatch } = await import("../memory-cards-XJ2JMF3V.js");
6224
+ const { insertMemoryCardsForBatch } = await import("../memory-cards-GFO2CSPV.js");
6134
6225
  const batchSize = 500;
6135
6226
  let offset = 0;
6136
6227
  let totalCards = 0;
@@ -6198,7 +6289,7 @@ function startDatabaseBackup() {
6198
6289
  `
6199
6290
  );
6200
6291
  try {
6201
- const { maybeVerifyDailyBackup } = await import("../backup-verify-6UAZ5ETR.js");
6292
+ const { maybeVerifyDailyBackup } = await import("../backup-verify-RGB3KKD4.js");
6202
6293
  const verdict = await maybeVerifyDailyBackup(backupPath);
6203
6294
  if (verdict && !verdict.ok) {
6204
6295
  process.stderr.write(
@@ -6275,7 +6366,7 @@ function startSessionEventsRetention() {
6275
6366
  if (!await ensureStoreForPolling()) return;
6276
6367
  try {
6277
6368
  const { getClient } = await import("./database.js");
6278
- const { sweepExpiredSessionEvents, DEFAULT_SESSION_EVENTS_RETENTION_DAYS } = await import("../session-events-ABAI2KE3.js");
6369
+ const { sweepExpiredSessionEvents, DEFAULT_SESSION_EVENTS_RETENTION_DAYS } = await import("../session-events-3KL735DZ.js");
6279
6370
  const days = SESSION_EVENTS_RETENTION_DAYS ?? DEFAULT_SESSION_EVENTS_RETENTION_DAYS;
6280
6371
  const count = await sweepExpiredSessionEvents(getClient(), days);
6281
6372
  if (count > 0) {
@@ -6306,7 +6397,7 @@ function startIntercomQueueDrain() {
6306
6397
  const tick = async () => traceDaemonTimer("intercom_queue_drain", async () => {
6307
6398
  fired("intercom_queue_drain");
6308
6399
  try {
6309
- const { drainQueueAsync, readQueue } = await import("../intercom-queue-TAARE4O7.js");
6400
+ const { drainQueueAsync, readQueue } = await import("../intercom-queue-A52WQOCD.js");
6310
6401
  const {
6311
6402
  sendIntercomAsync: centralSendIntercomAsync,
6312
6403
  countScopedPendingReviews,
@@ -6438,7 +6529,7 @@ function startLedgerDrain() {
6438
6529
  const tick = async () => traceDaemonTimer("ledger_drain", async () => {
6439
6530
  fired("ledger_drain");
6440
6531
  try {
6441
- const { isLedgerEnabled, drainLedger } = await import("../notification-ledger-5TQXBYY2.js");
6532
+ const { isLedgerEnabled, drainLedger } = await import("../notification-ledger-KSCPGLQG.js");
6442
6533
  if (!isLedgerEnabled()) return;
6443
6534
  const result = await drainLedger({
6444
6535
  // Shadow "would-deliver": idle target = would-deliver, busy = retry.
@@ -6477,7 +6568,7 @@ function startOrphanReaper() {
6477
6568
  const tick = async () => traceDaemonTimer("orphan_reaper", async () => {
6478
6569
  fired("orphan_reaper");
6479
6570
  try {
6480
- const { reapOrphanedMcpProcesses, createOrphanReaperRealDepsAsync } = await import("../daemon-orchestration-R5HT252K.js");
6571
+ const { reapOrphanedMcpProcesses, createOrphanReaperRealDepsAsync } = await import("../daemon-orchestration-JQGKEWPD.js");
6481
6572
  const deps = await createOrphanReaperRealDepsAsync();
6482
6573
  const reaped = await reapOrphanedMcpProcesses(deps);
6483
6574
  if (reaped.length > 0) acted("orphan_reaper");
@@ -6502,7 +6593,7 @@ function startZombieAgentReaper() {
6502
6593
  const tick = async () => traceDaemonTimer("zombie_agent_reaper", async () => {
6503
6594
  fired("zombie_agent_reaper");
6504
6595
  try {
6505
- const { reapZombieAgentProcesses, createZombieAgentReaperRealDepsAsync } = await import("../daemon-orchestration-R5HT252K.js");
6596
+ const { reapZombieAgentProcesses, createZombieAgentReaperRealDepsAsync } = await import("../daemon-orchestration-JQGKEWPD.js");
6506
6597
  const deps = await createZombieAgentReaperRealDepsAsync();
6507
6598
  const reaped = reapZombieAgentProcesses(deps);
6508
6599
  if (reaped.length > 0) acted("zombie_agent_reaper");
@@ -6526,7 +6617,7 @@ async function startDaemonMemoryPressureWatchdog() {
6526
6617
  try {
6527
6618
  const cfg = await getCachedConfig();
6528
6619
  if (!cfg) return;
6529
- const { startMemoryPressureWatchdog: startWatchdog, MEMORY_PRESSURE_WATCHDOG_DEFAULTS } = await import("../memory-pressure-watchdog-HB572OZG.js");
6620
+ const { startMemoryPressureWatchdog: startWatchdog, MEMORY_PRESSURE_WATCHDOG_DEFAULTS } = await import("../memory-pressure-watchdog-IG7VRFIX.js");
6530
6621
  const watchdogCfg = {
6531
6622
  ...MEMORY_PRESSURE_WATCHDOG_DEFAULTS,
6532
6623
  ...cfg.memoryPressureWatchdog ?? {}
@@ -6557,7 +6648,7 @@ function startWorktreeReaper() {
6557
6648
  const tick = async () => traceDaemonTimer("worktree_reaper", async () => {
6558
6649
  fired("worktree_reaper");
6559
6650
  try {
6560
- const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-R5HT252K.js");
6651
+ const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-JQGKEWPD.js");
6561
6652
  const deps = await createWorktreeReaperRealDeps();
6562
6653
  const result = await reapOrphanedWorktrees(deps);
6563
6654
  if (result.pruned.length > 0) {
@@ -6597,8 +6688,8 @@ function startWorktreeReaper() {
6597
6688
  }
6598
6689
  continue;
6599
6690
  }
6600
- const { cleanupAgentWorktree } = await import("../worktree-sweep-HNNHNAXN.js");
6601
- const { getMainRepoRootAsync } = await import("../worktree-MGYTWKCA.js");
6691
+ const { cleanupAgentWorktree } = await import("../worktree-sweep-SW4AG6JR.js");
6692
+ const { getMainRepoRootAsync } = await import("../worktree-FJZXHDCJ.js");
6602
6693
  const repoRoot = await getMainRepoRootAsync(signal.worktreePath);
6603
6694
  if (repoRoot && signal.agentId) {
6604
6695
  const notes = await cleanupAgentWorktree(repoRoot, signal.agentId);
@@ -6631,7 +6722,7 @@ function startAutoWake() {
6631
6722
  if (!await ensureStoreForPolling()) return;
6632
6723
  try {
6633
6724
  const { getClient } = await import("./database.js");
6634
- const { pollOrphanedTasks, createAutoWakeRealDeps } = await import("../daemon-orchestration-R5HT252K.js");
6725
+ const { pollOrphanedTasks, createAutoWakeRealDeps } = await import("../daemon-orchestration-JQGKEWPD.js");
6635
6726
  const deps = createAutoWakeRealDeps(getClient, process.cwd(), getTmuxSessionsAsync);
6636
6727
  const woken = await pollOrphanedTasks(deps);
6637
6728
  if (woken.length > 0) acted("auto_wake");
@@ -6642,12 +6733,12 @@ function startAutoWake() {
6642
6733
  try {
6643
6734
  const signalBase = path4.join(os3.homedir(), ".exe-os", "task-signals");
6644
6735
  if (existsSync7(signalBase)) {
6645
- const { readdirSync: readdirSync2, statSync: statSyncFs } = await import("fs");
6736
+ const { readdirSync: readdirSync3, statSync: statSyncFs } = await import("fs");
6646
6737
  const { sendIntercomAsync, extractRootExe } = await import("./tmux-routing.js");
6647
6738
  const sessionCache = path4.join(os3.homedir(), ".exe-os", "session-cache");
6648
6739
  const sessions = await getTmuxSessionsAsync();
6649
6740
  const signalDirs = [];
6650
- for (const entry of readdirSync2(signalBase, { withFileTypes: true })) {
6741
+ for (const entry of readdirSync3(signalBase, { withFileTypes: true })) {
6651
6742
  if (entry.isDirectory()) signalDirs.push({ dir: path4.join(signalBase, entry.name), scope: entry.name });
6652
6743
  }
6653
6744
  signalDirs.push({ dir: signalBase, scope: null });
@@ -6672,7 +6763,7 @@ function startAutoWake() {
6672
6763
  for (const { dir, scope } of signalDirs) {
6673
6764
  let files = [];
6674
6765
  try {
6675
- files = readdirSync2(dir).filter((f) => f.endsWith(".pending") && !f.includes("review-"));
6766
+ files = readdirSync3(dir).filter((f) => f.endsWith(".pending") && !f.includes("review-"));
6676
6767
  } catch {
6677
6768
  continue;
6678
6769
  }
@@ -6682,7 +6773,7 @@ function startAutoWake() {
6682
6773
  if (age > 60 * 60 * 1e3) {
6683
6774
  try {
6684
6775
  unlinkSync4(signalPath);
6685
- void import("../orchestration-events-KFZMGU3D.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
6776
+ void import("../orchestration-events-HAFDPTLV.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
6686
6777
  recordOE({ eventType: "signal.stale", source: "exe-daemon.autoWake", severity: "warn", payload: { file, ageMinutes: Math.round(age / 6e4) } });
6687
6778
  }).catch(() => {
6688
6779
  });
@@ -6828,7 +6919,7 @@ function startStuckTaskRelease() {
6828
6919
  createStuckTaskRealDeps,
6829
6920
  escalateStuckBlockedTasks,
6830
6921
  createStuckBlockedRealDeps
6831
- } = await import("../daemon-orchestration-R5HT252K.js");
6922
+ } = await import("../daemon-orchestration-JQGKEWPD.js");
6832
6923
  const deps = createStuckTaskRealDeps(getClient);
6833
6924
  const released = await releaseStuckTasks(deps);
6834
6925
  if (released.length > 0) {
@@ -7023,12 +7114,12 @@ function startTaskEnforcementScanner() {
7023
7114
  const tick = async () => traceDaemonTimer("task_enforcement", async () => {
7024
7115
  fired("task_enforcement");
7025
7116
  try {
7026
- const { runTaskEnforcementTick } = await import("../task-enforcement-OJAG2BGJ.js");
7117
+ const { runTaskEnforcementTick } = await import("../task-enforcement-OAOL7XFL.js");
7027
7118
  const { getTransport } = await import("./transport.js");
7028
7119
  const { loadAgentConfig } = await import("./agent-config.js");
7029
7120
  const { getClient } = await import("./database.js");
7030
7121
  const { loadEmployeesSync } = await import("./employees.js");
7031
- const { sessionScopeFilter } = await import("../task-scope-5GKJTQL2.js");
7122
+ const { sessionScopeFilter } = await import("../task-scope-PSVAE3EM.js");
7032
7123
  const transport = getTransport();
7033
7124
  const { sessions: allSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
7034
7125
  await yieldToEventLoop();
@@ -7039,10 +7130,10 @@ function startTaskEnforcementScanner() {
7039
7130
  sendKeysLiteral: transport.sendKeysLiteral?.bind(transport),
7040
7131
  isAlive: (session) => aliveSessions.has(session)
7041
7132
  };
7042
- const { checkAutoWakeGates } = await import("../daemon-orchestration-R5HT252K.js");
7133
+ const { checkAutoWakeGates } = await import("../daemon-orchestration-JQGKEWPD.js");
7043
7134
  const { ensureEmployeeAsync, employeeSessionName, sendIntercomAsync } = await import("./tmux-routing.js");
7044
7135
  const { shouldAutoInstance } = await import("./employees.js");
7045
- const { recordOrchestrationEventBestEffort } = await import("../orchestration-events-KFZMGU3D.js");
7136
+ const { recordOrchestrationEventBestEffort } = await import("../orchestration-events-HAFDPTLV.js");
7046
7137
  const projectDir = process.cwd();
7047
7138
  await runTaskEnforcementTick({
7048
7139
  transport: enforcementTransport,
@@ -7423,6 +7514,78 @@ process.on("unhandledRejection", (reason) => {
7423
7514
  logCrash(reason instanceof Error ? reason : String(reason), "unhandled_rejection");
7424
7515
  maybeSelfHealStaleDist(reason, "unhandledRejection");
7425
7516
  });
7517
+ var DIST_DRIFT_CHECK_INTERVAL_MS = 2e4;
7518
+ var _distDriftRestartRequested = false;
7519
+ var _distDriftPendingMissing = false;
7520
+ function readOnDiskPackageVersion() {
7521
+ if (!PACKAGE_JSON_PATH) return PACKAGE_VERSION;
7522
+ try {
7523
+ const pkg = JSON.parse(readFileSync6(PACKAGE_JSON_PATH, "utf8"));
7524
+ return typeof pkg.version === "string" ? pkg.version : PACKAGE_VERSION;
7525
+ } catch {
7526
+ return PACKAGE_VERSION;
7527
+ }
7528
+ }
7529
+ function startDistDriftWatch() {
7530
+ if (!DIST_DIR) {
7531
+ process.stderr.write("[exed] Dist-drift watch skipped \u2014 could not resolve dist dir\n");
7532
+ return;
7533
+ }
7534
+ const tick = () => {
7535
+ fired("dist_drift_watch");
7536
+ if (_distDriftRestartRequested) return;
7537
+ const current = {
7538
+ version: readOnDiskPackageVersion(),
7539
+ chunks: listDistChunkFiles(DIST_DIR)
7540
+ };
7541
+ const drift = detectDistDrift(BOOT_DIST_SNAPSHOT, current);
7542
+ if (!drift.drifted) {
7543
+ _distDriftPendingMissing = false;
7544
+ return;
7545
+ }
7546
+ if (!drift.versionChanged) {
7547
+ if (!_distDriftPendingMissing) {
7548
+ _distDriftPendingMissing = true;
7549
+ process.stderr.write(
7550
+ `[exed] Dist-drift candidate (${drift.reason}) \u2014 re-checking next pass before restart
7551
+ `
7552
+ );
7553
+ return;
7554
+ }
7555
+ }
7556
+ _distDriftRestartRequested = true;
7557
+ acted("dist_drift_watch");
7558
+ process.stderr.write(
7559
+ `[exed] Dist drift detected (${drift.reason}) \u2014 daemon is running against a swapped build; requesting restart. boot=v${BOOT_DIST_SNAPSHOT.version} disk=v${current.version} missing=[${drift.missingChunks.slice(0, 8).join(", ")}]
7560
+ `
7561
+ );
7562
+ logRestartEvent("daemon_self_exit", {
7563
+ trigger: "dist_drift",
7564
+ reason: drift.reason ?? "unknown",
7565
+ version_changed: drift.versionChanged,
7566
+ missing_chunks: drift.missingChunks.length,
7567
+ boot_version: BOOT_DIST_SNAPSHOT.version,
7568
+ disk_version: current.version,
7569
+ uptime_s: Math.floor((Date.now() - _startedAt2) / 1e3)
7570
+ });
7571
+ try {
7572
+ const result = requestRestart("dist-drift-self-heal");
7573
+ if (!result.ok) _distDriftRestartRequested = false;
7574
+ } catch (err) {
7575
+ _distDriftRestartRequested = false;
7576
+ process.stderr.write(
7577
+ `[exed] requestRestart for dist-drift self-heal failed (non-fatal): ${err instanceof Error ? err.message : String(err)}
7578
+ `
7579
+ );
7580
+ }
7581
+ };
7582
+ const timer = setInterval(() => void traceDaemonTimer("dist_drift_watch", tick), DIST_DRIFT_CHECK_INTERVAL_MS);
7583
+ timer.unref();
7584
+ process.stderr.write(
7585
+ `[exed] Dist-drift watch started (every ${DIST_DRIFT_CHECK_INTERVAL_MS / 1e3}s; boot v${BOOT_DIST_SNAPSHOT.version}, ${BOOT_DIST_SNAPSHOT.chunks.length} chunks tracked)
7586
+ `
7587
+ );
7588
+ }
7426
7589
  var BUG_AUTOFIX_INTERVAL_MS = 5 * 6e4;
7427
7590
  var AUTOFIX_DEDUP_TTL_MS = 6 * 60 * 60 * 1e3;
7428
7591
  var AUTOFIX_DEDUP_MAX_ENTRIES = 1e3;
@@ -7950,7 +8113,7 @@ function startEventLoopLagDetector() {
7950
8113
  const msg = `[exed] EVENT LOOP BLOCKED ${(lag / 1e3).toFixed(1)}s \u2014 MCP UNRESPONSIVE. Sessions will die.`;
7951
8114
  process.stderr.write(msg + "\n");
7952
8115
  logDaemonHealth({ event: "event_loop_blocked", pid: process.pid, message: msg, data: { lagMs: lag } });
7953
- void import("../orchestration-events-KFZMGU3D.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
8116
+ void import("../orchestration-events-HAFDPTLV.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
7954
8117
  recordOE({ eventType: "daemon.event_loop_blocked", source: "exe-daemon.lagDetector", severity: "error", durationMs: lag });
7955
8118
  }).catch(() => {
7956
8119
  });
@@ -8144,7 +8307,7 @@ function startTaskFileResync() {
8144
8307
  });
8145
8308
  if (Number(res.rowsAffected ?? 0) > 0) {
8146
8309
  synced++;
8147
- void import("../orchestration-events-KFZMGU3D.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
8310
+ void import("../orchestration-events-HAFDPTLV.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
8148
8311
  recordOE({
8149
8312
  eventType: "task_file.resynced",
8150
8313
  source: "exe-daemon.taskFileResync",
@@ -8178,7 +8341,7 @@ function startTaskGroupBarriers() {
8178
8341
  fired("task_group_barriers");
8179
8342
  if (!await ensureStoreForPolling()) return;
8180
8343
  try {
8181
- const { pollTaskGroupBarriers } = await import("../daemon-orchestration-R5HT252K.js");
8344
+ const { pollTaskGroupBarriers } = await import("../daemon-orchestration-JQGKEWPD.js");
8182
8345
  const firedCount = await pollTaskGroupBarriers();
8183
8346
  if (firedCount > 0) {
8184
8347
  acted("task_group_barriers");
@@ -8200,7 +8363,7 @@ function startCheckpointGc() {
8200
8363
  fired("checkpoint_gc");
8201
8364
  if (!await ensureStoreForPolling()) return;
8202
8365
  try {
8203
- const { gcStaleCheckpoints } = await import("../daemon-orchestration-R5HT252K.js");
8366
+ const { gcStaleCheckpoints } = await import("../daemon-orchestration-JQGKEWPD.js");
8204
8367
  const cleared = await gcStaleCheckpoints();
8205
8368
  if (cleared > 0) {
8206
8369
  acted("checkpoint_gc");
@@ -8231,7 +8394,7 @@ function startDaemonHeartbeat() {
8231
8394
  function startDispatchAckCleanup() {
8232
8395
  setInterval(async () => {
8233
8396
  try {
8234
- const { cleanStaleDispatchAcks } = await import("../dispatch-ack-VUGMAGNL.js");
8397
+ const { cleanStaleDispatchAcks } = await import("../dispatch-ack-AZL3WKCK.js");
8235
8398
  cleanStaleDispatchAcks();
8236
8399
  } catch {
8237
8400
  }
@@ -8240,14 +8403,14 @@ function startDispatchAckCleanup() {
8240
8403
  function startProjectionWorkerDeferred() {
8241
8404
  setTimeout(async () => {
8242
8405
  try {
8243
- const { startProjectionWorker } = await import("../projection-worker-ZMHVILPW.js");
8406
+ const { startProjectionWorker } = await import("../projection-worker-SKAMSZJF.js");
8244
8407
  startProjectionWorker();
8245
8408
  } catch {
8246
8409
  }
8247
8410
  }, 2e4);
8248
8411
  }
8249
8412
  async function startToolTelemetry() {
8250
- const { startToolTelemetryFlush } = await import("../tool-telemetry-PDHE36YD.js");
8413
+ const { startToolTelemetryFlush } = await import("../tool-telemetry-QJGJAHOC.js");
8251
8414
  startToolTelemetryFlush();
8252
8415
  process.stderr.write("[exed] Tool telemetry started (flush every 5m)\n");
8253
8416
  }
@@ -8272,6 +8435,7 @@ function startServerModeTimers() {
8272
8435
  startDispatchAckCleanup();
8273
8436
  void startToolTelemetry();
8274
8437
  startProjectionWorkerDeferred();
8438
+ setTimeout(startDistDriftWatch, 3e4);
8275
8439
  }
8276
8440
  function startLocalFirstTimers() {
8277
8441
  startMemoryQueueDrain();
@@ -8287,6 +8451,7 @@ function startLocalFirstTimers() {
8287
8451
  startApiWatchdog();
8288
8452
  startIdleKill();
8289
8453
  startRssWatchdog();
8454
+ setTimeout(startDistDriftWatch, 3e4);
8290
8455
  startOrchestrationTimer();
8291
8456
  setTimeout(startWalCheckpoint, 5e3);
8292
8457
  startTaskFileResync();
@@ -8415,7 +8580,7 @@ function startLocalFirstTimers() {
8415
8580
  fired("orphan_task_cleanup");
8416
8581
  try {
8417
8582
  if (!await ensureStoreForPolling()) return;
8418
- const { cleanOrphanedTaskFiles } = await import("../tasks-crud-ZWKPTGPU.js");
8583
+ const { cleanOrphanedTaskFiles } = await import("../tasks-crud-TLELWWUL.js");
8419
8584
  const count = await cleanOrphanedTaskFiles();
8420
8585
  if (count > 0) {
8421
8586
  acted("orphan_task_cleanup");
@@ -8431,7 +8596,7 @@ function startLocalFirstTimers() {
8431
8596
  fired("task_file_consistency");
8432
8597
  try {
8433
8598
  if (!await ensureStoreForPolling()) return;
8434
- const { checkTaskFileConsistency } = await import("../tasks-crud-ZWKPTGPU.js");
8599
+ const { checkTaskFileConsistency } = await import("../tasks-crud-TLELWWUL.js");
8435
8600
  const mismatches = await checkTaskFileConsistency();
8436
8601
  if (mismatches > 0) {
8437
8602
  acted("task_file_consistency");
@@ -8450,7 +8615,7 @@ function startLocalFirstTimers() {
8450
8615
  const TELEMETRY_DAILY_MS = 24 * 60 * 60 * 1e3;
8451
8616
  const telemetryDaily = async () => {
8452
8617
  try {
8453
- const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-LIC7M7AY.js");
8618
+ const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-LTL5SW24.js");
8454
8619
  if (!isTelemetryEnabled()) return;
8455
8620
  const { upstream } = await sendTelemetry(24);
8456
8621
  if (upstream.startsWith("sent")) {