@askexenow/exe-os 0.9.255 → 0.9.259

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 (272) hide show
  1. package/deploy/compose/.env.customer.example +13 -13
  2. package/deploy/compose/.env.example +8 -8
  3. package/deploy/compose/docker-compose.yml +18 -18
  4. package/deploy/compose/generate-env.ts +22 -18
  5. package/deploy/compose/init-db.sql +221 -20
  6. package/deploy/stack-manifests/v0.9.json +1207 -1136
  7. package/dist/{active-agent-DTZ6VJIR.js → active-agent-IGZXTTV4.js} +3 -3
  8. package/dist/{active-agent-7QNK5CJZ.js → active-agent-OYUXMTHS.js} +3 -3
  9. package/dist/{agentic-ontology-UZK33N6I.js → agentic-ontology-5WT23SLZ.js} +1 -1
  10. package/dist/{backfill-metadata-R7PNZ5TX.js → backfill-metadata-EG52U3GF.js} +4 -4
  11. package/dist/{behaviors-G6QHSQBN.js → behaviors-2TZCFJLU.js} +3 -3
  12. package/dist/bin/age-ontology-load.js +2 -2
  13. package/dist/bin/agentic-ontology-backfill.js +5 -5
  14. package/dist/bin/agentic-reflection-backfill.js +6 -6
  15. package/dist/bin/agentic-semantic-label.js +5 -5
  16. package/dist/bin/backfill-conversations.js +6 -5
  17. package/dist/bin/backfill-responses.js +6 -5
  18. package/dist/bin/backfill-vectors.js +7 -6
  19. package/dist/bin/bulk-sync-postgres.js +6 -6
  20. package/dist/bin/cleanup-stale-review-tasks.js +9 -9
  21. package/dist/bin/cli.js +17 -17
  22. package/dist/bin/deferred-daemon-restart.js +4 -1
  23. package/dist/bin/exe-agent-config.js +2 -2
  24. package/dist/bin/exe-agent.js +4 -4
  25. package/dist/bin/exe-assign.js +8 -7
  26. package/dist/bin/exe-boot.js +16 -16
  27. package/dist/bin/exe-call.js +4 -4
  28. package/dist/bin/exe-cloud.js +4 -4
  29. package/dist/bin/exe-dispatch.js +9 -9
  30. package/dist/bin/exe-doctor.js +1 -1
  31. package/dist/bin/exe-export-behaviors.js +7 -7
  32. package/dist/bin/exe-forget.js +6 -6
  33. package/dist/bin/exe-gateway.js +9 -9
  34. package/dist/bin/exe-heartbeat.js +9 -9
  35. package/dist/bin/exe-kill.js +12 -12
  36. package/dist/bin/exe-launch-agent.js +16 -16
  37. package/dist/bin/exe-new-employee.js +6 -6
  38. package/dist/bin/exe-pending-messages.js +11 -10
  39. package/dist/bin/exe-pending-notifications.js +9 -9
  40. package/dist/bin/exe-pending-reviews.js +11 -9
  41. package/dist/bin/exe-rename.js +4 -4
  42. package/dist/bin/exe-review.js +11 -11
  43. package/dist/bin/exe-search.js +5 -5
  44. package/dist/bin/exe-session-cleanup.js +14 -14
  45. package/dist/bin/exe-settings.js +4 -4
  46. package/dist/bin/exe-start-codex.js +11 -11
  47. package/dist/bin/exe-start-opencode.js +8 -8
  48. package/dist/bin/exe-status.js +10 -10
  49. package/dist/bin/exe-support.js +3 -1
  50. package/dist/bin/exe-team.js +3 -3
  51. package/dist/bin/git-sweep.js +71 -11
  52. package/dist/bin/graph-backfill.js +4 -4
  53. package/dist/bin/graph-export.js +5 -5
  54. package/dist/bin/graph-layer-benchmark.js +7 -7
  55. package/dist/bin/import-history.js +7 -7
  56. package/dist/bin/install.js +12 -9
  57. package/dist/bin/intercom-check.js +4 -4
  58. package/dist/bin/mcp-sessions.js +2 -2
  59. package/dist/bin/orchestration-metrics.js +4 -4
  60. package/dist/bin/postgres-agentic-reflection-backfill.js +7 -7
  61. package/dist/bin/postgres-agentic-semantic-backfill.js +7 -7
  62. package/dist/bin/scan-tasks.js +9 -9
  63. package/dist/bin/setup.js +1 -1
  64. package/dist/bin/shard-migrate.js +4 -4
  65. package/dist/bin/stack-update.js +20 -3
  66. package/dist/bin/vps-health-gate.js +1 -1
  67. package/dist/{capacity-monitor-QMKII67L.js → capacity-monitor-CTFWWTCR.js} +10 -10
  68. package/dist/{catchup-brief-CNISNLV7.js → catchup-brief-UML47LXI.js} +11 -11
  69. package/dist/{chunk-QP4FHME2.js → chunk-235ZCOYB.js} +18 -6
  70. package/dist/{chunk-2NEQQCRC.js → chunk-25JAXHON.js} +1 -1
  71. package/dist/{chunk-MU6ESLYL.js → chunk-2PFNATXD.js} +1 -1
  72. package/dist/chunk-2XZ6X3PJ.js +13 -0
  73. package/dist/chunk-3XX3CDKF.js +9 -0
  74. package/dist/{chunk-ZTB6E2ZL.js → chunk-4FGTT26Q.js} +1 -1
  75. package/dist/{chunk-YYSQAM4W.js → chunk-4TYAHVDI.js} +8 -8
  76. package/dist/{chunk-2QKNXGII.js → chunk-4VECWOUO.js} +2 -2
  77. package/dist/{chunk-YXMXP45V.js → chunk-57C3MZPQ.js} +2 -2
  78. package/dist/{chunk-FTNNNAMH.js → chunk-5JYCTIQD.js} +1 -1
  79. package/dist/{chunk-CS267UMH.js → chunk-5LDTCWYX.js} +79 -19
  80. package/dist/{chunk-FQVITYVF.js → chunk-6D2IZ5MB.js} +2 -2
  81. package/dist/{chunk-ZG3HADWE.js → chunk-7UJRF4WF.js} +1 -1
  82. package/dist/{chunk-JFVITKXI.js → chunk-A2UPDE3J.js} +1 -1
  83. package/dist/{chunk-KOCQAMAM.js → chunk-ANYOAZCZ.js} +238 -5
  84. package/dist/{chunk-PSQNT5DS.js → chunk-AQS2B3HC.js} +8 -8
  85. package/dist/{chunk-ABNALOLM.js → chunk-BGEXTWGR.js} +3 -3
  86. package/dist/{chunk-LPK5JPME.js → chunk-BPZL5YOM.js} +1 -1
  87. package/dist/{chunk-RLDOG7DI.js → chunk-C6SSCNOC.js} +2516 -2289
  88. package/dist/{chunk-JGEGEOVP.js → chunk-COKTAJUZ.js} +1 -1
  89. package/dist/{chunk-MRZE5IOP.js → chunk-CXOX7TRG.js} +1 -1
  90. package/dist/{chunk-6LFFIEDM.js → chunk-DU64OESH.js} +1 -1
  91. package/dist/{chunk-LYIUESG2.js → chunk-DYURFBPS.js} +10 -10
  92. package/dist/{chunk-X3SS45PO.js → chunk-FPXZY3FY.js} +1 -1
  93. package/dist/{chunk-TVTRMINO.js → chunk-FUGZF7VR.js} +1 -1
  94. package/dist/{chunk-O7SFCX5B.js → chunk-GB4FI66P.js} +2 -2
  95. package/dist/{chunk-VGWQBI76.js → chunk-GBR4MAAK.js} +1 -1
  96. package/dist/chunk-GH4LVBQM.js +371 -0
  97. package/dist/{chunk-AIXZ5O7U.js → chunk-GIHMDOSK.js} +1 -1
  98. package/dist/{chunk-RDCE652I.js → chunk-HDWVXSGO.js} +1 -1
  99. package/dist/{chunk-RF54NGPJ.js → chunk-IJ7R3MXE.js} +3 -5
  100. package/dist/{chunk-R7FBOZT5.js → chunk-ISL3NSVX.js} +1 -1
  101. package/dist/{chunk-5B2AEXVA.js → chunk-IVSRRIRG.js} +1 -1
  102. package/dist/{chunk-SD2R3SEA.js → chunk-J3YNCJ4A.js} +1 -1
  103. package/dist/{chunk-5IZYSS3M.js → chunk-JE4C74EE.js} +4 -4
  104. package/dist/{chunk-VRVHIVUE.js → chunk-KSR2PNRW.js} +2 -2
  105. package/dist/{chunk-LL2ARYTZ.js → chunk-L3PY4NFQ.js} +1 -1
  106. package/dist/{chunk-VFATLVRX.js → chunk-L5VPUOB6.js} +1 -1
  107. package/dist/{chunk-3VLFVOM7.js → chunk-LRKJGSNH.js} +2 -2
  108. package/dist/{chunk-4FT3SQAS.js → chunk-LVY74L2J.js} +2 -2
  109. package/dist/{chunk-X4T7LR2X.js → chunk-M7PZFYHE.js} +2 -2
  110. package/dist/{chunk-CIX64N7D.js → chunk-MGTVPIEZ.js} +1 -1
  111. package/dist/{chunk-MXCBORCC.js → chunk-MKTEGZ37.js} +3 -3
  112. package/dist/chunk-MMRUBN3I.js +36 -0
  113. package/dist/{chunk-4MONXPWR.js → chunk-MPXLF7TA.js} +1 -1
  114. package/dist/{chunk-6QMXKKFD.js → chunk-N27CTUFU.js} +1 -1
  115. package/dist/{chunk-YDHPC4PX.js → chunk-N4ES27RI.js} +3 -3
  116. package/dist/{chunk-WIRJ574R.js → chunk-NGQQRGLP.js} +2 -2
  117. package/dist/{chunk-AQOCHSIR.js → chunk-OCJ5GZKV.js} +4 -4
  118. package/dist/{chunk-O477L4LV.js → chunk-OSPS5N2I.js} +1 -1
  119. package/dist/{chunk-5WEH43HH.js → chunk-PQHA6X6Y.js} +1 -1
  120. package/dist/{chunk-DJYIBHN5.js → chunk-PQQTSNXS.js} +3 -3
  121. package/dist/{chunk-LGFB67MY.js → chunk-Q3GLQDZI.js} +1 -1
  122. package/dist/{chunk-7GR7VBBW.js → chunk-QUC27OCW.js} +1 -1
  123. package/dist/{chunk-5NBOFYJG.js → chunk-QYNFWFFH.js} +4 -4
  124. package/dist/{chunk-X7I6NLIA.js → chunk-T2EUNNUX.js} +5 -5
  125. package/dist/{chunk-VRWOLLKN.js → chunk-T4NFOOPB.js} +2 -2
  126. package/dist/{chunk-2YJSDJEH.js → chunk-TZPHTI5Q.js} +1 -1
  127. package/dist/{chunk-CQSFIQGN.js → chunk-UOZ5KUNN.js} +1 -1
  128. package/dist/{chunk-5R4R743Q.js → chunk-V2UVWYHO.js} +17 -15
  129. package/dist/{chunk-VKCZ3OGM.js → chunk-VD676VIC.js} +4 -4
  130. package/dist/{chunk-USLVSLQ5.js → chunk-VDCPKJUQ.js} +1 -1
  131. package/dist/{chunk-Y7NMPQXZ.js → chunk-VLX6AHTD.js} +8 -8
  132. package/dist/{chunk-ITPIBVSG.js → chunk-WMZTSHNX.js} +83 -1
  133. package/dist/{chunk-5U7WB4YG.js → chunk-WVBZ3QBR.js} +2 -2
  134. package/dist/{chunk-3EMZZZNU.js → chunk-X2RKYKTP.js} +1 -1
  135. package/dist/{chunk-XTIHYH64.js → chunk-YY2BCIAP.js} +2 -2
  136. package/dist/{chunk-Z6GHDYQI.js → chunk-Z2AEOVEZ.js} +30 -6
  137. package/dist/{chunk-PHTRZQR4.js → chunk-ZBDAFYDD.js} +4 -4
  138. package/dist/{chunk-E4CCKWZN.js → chunk-ZKFTDL4M.js} +1 -1
  139. package/dist/{co-activation-AIVMI5U2.js → co-activation-UNVL5JCP.js} +2 -2
  140. package/dist/{co-occurrence-L6QOQTJB.js → co-occurrence-ETAVWYVE.js} +2 -2
  141. package/dist/{code-context-index-DYHYVJHX.js → code-context-index-DCQYAYA2.js} +3 -2
  142. package/dist/{crdt-sync-YBMDPFNT.js → crdt-sync-AH7N6QOE.js} +1 -1
  143. package/dist/{crm-webhook-QO3ZESKR.js → crm-webhook-R6546T3Y.js} +2 -2
  144. package/dist/{cto-delegation-gate-UFPVFLIW.js → cto-delegation-gate-VB4TMZ3I.js} +8 -8
  145. package/dist/{daemon-orchestration-6XAISQ7B.js → daemon-orchestration-YAJKIL6Q.js} +12 -12
  146. package/dist/{db-backup-7UMCTS44.js → db-backup-2RG6VHT7.js} +11 -3
  147. package/dist/{dreaming-FJ75QVGZ.js → dreaming-WMBTSXGD.js} +9 -9
  148. package/dist/{exe-drift-OH3WV2ZQ.js → exe-drift-MQZGYHEN.js} +3 -3
  149. package/dist/{exe-export-UYKYNVBU.js → exe-export-E4BDIHOC.js} +5 -5
  150. package/dist/{exe-import-Q4FNSMLJ.js → exe-import-IWAD4HN6.js} +5 -5
  151. package/dist/{exe-key-22LOIIUX.js → exe-key-L2RV7XJX.js} +2 -2
  152. package/dist/{exe-snapshot-J7CL6QEL.js → exe-snapshot-IOGN4ARV.js} +12 -12
  153. package/dist/{fast-db-init-QXGL2PKQ.js → fast-db-init-GCY3F74H.js} +1 -1
  154. package/dist/gateway/index.js +8 -8
  155. package/dist/{git-staleness-YVWDCFIE.js → git-staleness-BQIFNZIU.js} +2 -2
  156. package/dist/{git-task-sweep-RRCOTTIS.js → git-task-sweep-GSKS6WKR.js} +9 -9
  157. package/dist/{global-procedures-FCGWAFES.js → global-procedures-3DJUA5OX.js} +3 -3
  158. package/dist/{graph-auto-extract-RUQC5IIS.js → graph-auto-extract-2I44WRDY.js} +2 -2
  159. package/dist/hooks/bug-report-worker.js +11 -11
  160. package/dist/hooks/codex-stop-task-finalizer.js +11 -11
  161. package/dist/hooks/commit-complete.js +11 -11
  162. package/dist/hooks/error-recall.js +6 -6
  163. package/dist/hooks/exe-heartbeat-hook.js +3 -3
  164. package/dist/hooks/ingest-worker.js +3 -2
  165. package/dist/hooks/ingest.js +6 -6
  166. package/dist/hooks/instructions-loaded.js +4 -4
  167. package/dist/hooks/manifest.json +20 -20
  168. package/dist/hooks/notification.js +4 -4
  169. package/dist/hooks/post-compact.js +10 -10
  170. package/dist/hooks/post-tool-combined.js +6 -6
  171. package/dist/hooks/pre-compact.js +14 -13
  172. package/dist/hooks/pre-tool-use.js +14 -14
  173. package/dist/hooks/prompt-submit.js +22 -22
  174. package/dist/hooks/session-end.js +19 -18
  175. package/dist/hooks/session-start.js +11 -11
  176. package/dist/hooks/stop.js +70 -17
  177. package/dist/hooks/subagent-stop.js +10 -10
  178. package/dist/hooks/summary-worker.js +17 -16
  179. package/dist/index.js +17 -17
  180. package/dist/{installer-7SMJC3SX.js → installer-6MQCAHUG.js} +5 -5
  181. package/dist/{installer-GFZVC43I.js → installer-TCMPFSSP.js} +5 -5
  182. package/dist/{installer-34DCTB5B.js → installer-ZY2BKTEO.js} +5 -5
  183. package/dist/lib/cloud-sync.js +4 -4
  184. package/dist/lib/consolidation.js +5 -5
  185. package/dist/lib/database.js +2 -2
  186. package/dist/lib/db-daemon-client.js +58 -13
  187. package/dist/lib/db.js +2 -2
  188. package/dist/lib/embedder.js +3 -2
  189. package/dist/lib/employee-templates.js +4 -4
  190. package/dist/lib/employees.js +2 -2
  191. package/dist/lib/exe-daemon-client.js +2 -1
  192. package/dist/lib/exe-daemon.js +255 -104
  193. package/dist/lib/hybrid-search.js +5 -5
  194. package/dist/lib/identity.js +2 -2
  195. package/dist/lib/messaging.js +9 -9
  196. package/dist/lib/reminders.js +3 -3
  197. package/dist/lib/schedules.js +5 -5
  198. package/dist/lib/session-registry.js +4 -4
  199. package/dist/lib/skill-learning.js +4 -4
  200. package/dist/lib/store.js +4 -4
  201. package/dist/lib/task-router.js +3 -3
  202. package/dist/lib/tasks.js +10 -10
  203. package/dist/lib/tmux-routing.js +8 -8
  204. package/dist/lib/token-spend.js +3 -3
  205. package/dist/mcp/register-tools.js +59 -56
  206. package/dist/mcp/server.js +60 -57
  207. package/dist/mcp/tools/complete-reminder.js +4 -4
  208. package/dist/mcp/tools/create-reminder.js +4 -4
  209. package/dist/mcp/tools/create-task.js +12 -12
  210. package/dist/mcp/tools/deactivate-behavior.js +5 -5
  211. package/dist/mcp/tools/list-reminders.js +4 -4
  212. package/dist/mcp/tools/list-tasks.js +12 -12
  213. package/dist/mcp/tools/send-message.js +11 -11
  214. package/dist/mcp/tools/update-task.js +11 -11
  215. package/dist/{mcp-http-config-MZMHKMJC.js → mcp-http-config-VUDZ3D5D.js} +3 -3
  216. package/dist/{memory-cards-3SFXU6IP.js → memory-cards-ZOOPC2WF.js} +2 -2
  217. package/dist/{memory-graph-extractor-T57YQQCW.js → memory-graph-extractor-RRQMUBMI.js} +3 -3
  218. package/dist/{memory-poisoning-defense-O53AHMTZ.js → memory-poisoning-defense-UQMNLG6H.js} +2 -2
  219. package/dist/{memory-queue-client-ITWQIFSD.js → memory-queue-client-TPQDAA4D.js} +3 -2
  220. package/dist/{memory-reflection-YPP2JC2S.js → memory-reflection-GSGXAGXV.js} +2 -2
  221. package/dist/{notifications-BETWD6EK.js → notifications-ZKGLZVCU.js} +8 -8
  222. package/dist/{orchestration-events-A5D52NXX.js → orchestration-events-7RMWC5SS.js} +3 -3
  223. package/dist/{orchestrator-X564XCWC.js → orchestrator-A6MX2OHA.js} +10 -10
  224. package/dist/{pipeline-router-RVHLL7UA.js → pipeline-router-6ZBYJD2U.js} +3 -3
  225. package/dist/{plan-limits-ANAVC6PM.js → plan-limits-4XH4A7IA.js} +3 -3
  226. package/dist/{project-boot-ENMCAL7G.js → project-boot-7ZEIDWUG.js} +3 -2
  227. package/dist/{projection-worker-O3HBG5QK.js → projection-worker-YKKBNQZT.js} +130 -51
  228. package/dist/{reranker-SRJL4IWB.js → reranker-DN2A3H6O.js} +1 -1
  229. package/dist/{review-polling-5JTTHHEO.js → review-polling-PK3CY4NI.js} +9 -9
  230. package/dist/runtime/index.js +11 -11
  231. package/dist/{session-events-RCSYHQQ2.js → session-events-IYU6FYHH.js} +9 -9
  232. package/dist/{session-kill-telemetry-AL3H4ELS.js → session-kill-telemetry-G2VV4CAH.js} +3 -3
  233. package/dist/{session-scope-ZB4SR3AX.js → session-scope-DHTVH3D4.js} +8 -8
  234. package/dist/{setup-wizard-HXTADFXI.js → setup-wizard-IA5ISHQ2.js} +1 -1
  235. package/dist/{skill-refinement-TT4VDYYW.js → skill-refinement-6PBAFLWP.js} +2 -2
  236. package/dist/{stack-release-7WDKQOCO.js → stack-release-NW7MV3WV.js} +41 -11
  237. package/dist/{stack-update-F4CQWMGV.js → stack-update-5SM62R3O.js} +3 -1
  238. package/dist/{steward-gate-HSV67KLF.js → steward-gate-EQV6CZKY.js} +3 -3
  239. package/dist/support-outbox-SZVLHHZG.js +295 -0
  240. package/dist/{task-enforcement-A6AZTYAN.js → task-enforcement-2LS5DOXK.js} +8 -8
  241. package/dist/{task-scope-XKNAY5S7.js → task-scope-AKF3CSWO.js} +8 -8
  242. package/dist/{tasks-crud-F732BVOE.js → tasks-crud-KOIA5SAH.js} +8 -8
  243. package/dist/{tasks-notify-LJ65U7DF.js → tasks-notify-7ZTE4ZQM.js} +9 -9
  244. package/dist/{tasks-review-Y5F4HRAR.js → tasks-review-VMMMAK2Y.js} +8 -8
  245. package/dist/{telemetry-upload-HVYO6FL3.js → telemetry-upload-YLW4NAUF.js} +15 -8
  246. package/dist/{token-budget-VODGJYKX.js → token-budget-NA4OLFNP.js} +2 -2
  247. package/dist/{tool-capability-index-PZWWVABO.js → tool-capability-index-C73KVY5O.js} +1 -1
  248. package/dist/{tool-telemetry-5BSTF3P6.js → tool-telemetry-OVI5KL4S.js} +1 -1
  249. package/dist/tui/App.js +16 -16
  250. package/dist/{tui-data-EHJWRNRZ.js → tui-data-5NT24CC5.js} +8 -8
  251. package/dist/{worker-gate-4AS4K7G4.js → worker-gate-AQLJUQ5G.js} +1 -1
  252. package/dist/{workflow-engine-BXGNFNUW.js → workflow-engine-TRGGUNIZ.js} +2 -2
  253. package/dist/{worktree-3N5BPITS.js → worktree-NK7GZNEA.js} +4 -4
  254. package/dist/worktree-sweep-5XVZCH6A.js +18 -0
  255. package/package.json +3 -2
  256. package/release-notes.json +32 -33
  257. package/stack.release.json +48 -48
  258. package/dist/prediction-log-DOEOHDHS.js +0 -120
  259. package/dist/support-outbox-KEJ73I3F.js +0 -206
  260. /package/dist/{chunk-AWVDA2FL.js → chunk-2H3FVAN3.js} +0 -0
  261. /package/dist/{chunk-VPHOOQLR.js → chunk-3GHTBVZO.js} +0 -0
  262. /package/dist/{chunk-CCPCIW4Z.js → chunk-BBPRL2MP.js} +0 -0
  263. /package/dist/{chunk-X2E6W3DB.js → chunk-BRSI3FD6.js} +0 -0
  264. /package/dist/{chunk-Y2FVN7CX.js → chunk-EYLQRPHF.js} +0 -0
  265. /package/dist/{chunk-4S5TEBXD.js → chunk-H6QJT5O5.js} +0 -0
  266. /package/dist/{chunk-FCII2MMI.js → chunk-J5CAYOJU.js} +0 -0
  267. /package/dist/{chunk-LY2DYTDL.js → chunk-RFJESVEL.js} +0 -0
  268. /package/dist/{chunk-GBHQ5TXO.js → chunk-UOOCGJUE.js} +0 -0
  269. /package/dist/{core-memory-WFP2L52F.js → core-memory-VZFTGOFE.js} +0 -0
  270. /package/dist/{entity-boost-RTYXAOWV.js → entity-boost-OAB2PZQP.js} +0 -0
  271. /package/dist/{message-queue-client-2CACBUA4.js → message-queue-client-YTKTHAYO.js} +0 -0
  272. /package/dist/{wiki-acl-MS7QLQCR.js → wiki-acl-UCPOROPR.js} +0 -0
@@ -17,7 +17,7 @@ import {
17
17
  findScopedDuplicate,
18
18
  governMemoryRecord,
19
19
  schedulePostWriteMemoryHygiene
20
- } from "../chunk-AWVDA2FL.js";
20
+ } from "../chunk-2H3FVAN3.js";
21
21
  import "../chunk-Y25OJWOQ.js";
22
22
  import {
23
23
  logRestartEvent
@@ -33,16 +33,16 @@ import "../chunk-LYH5HE24.js";
33
33
  import "../chunk-MLKGABMK.js";
34
34
 
35
35
  // src/lib/exe-daemon.ts
36
- import os2 from "os";
36
+ import os3 from "os";
37
37
  import net from "net";
38
38
  import v82 from "v8";
39
39
  import { createServer as createHttpServer } from "http";
40
40
  import { randomUUID } from "crypto";
41
- import { writeFileSync as writeFileSync2, unlinkSync, mkdirSync as mkdirSync2, existsSync as existsSync3, readFileSync as readFileSync2, chmodSync } from "fs";
41
+ import { writeFileSync as writeFileSync3, unlinkSync as unlinkSync2, mkdirSync as mkdirSync3, existsSync as existsSync4, readFileSync as readFileSync3, chmodSync } from "fs";
42
42
  import { writeFile } from "fs/promises";
43
43
  import { execSync as execSyncNode, execFile as execFileNode } from "child_process";
44
44
  import { promisify } from "util";
45
- import path3 from "path";
45
+ import path4 from "path";
46
46
  import { fork } from "child_process";
47
47
  import { Worker } from "worker_threads";
48
48
 
@@ -500,9 +500,79 @@ function logHeartbeat(data) {
500
500
  });
501
501
  }
502
502
 
503
+ // src/lib/daemon-restart-backoff.ts
504
+ import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2, unlinkSync, mkdirSync as mkdirSync2 } from "fs";
505
+ import path3 from "path";
506
+ import os2 from "os";
507
+ var BASE_DELAY_MS = 2e3;
508
+ var MAX_DELAY_MS = 5 * 6e4;
509
+ var FAILURE_THRESHOLD = 10;
510
+ var HEALTHY_RESET_MS = 30 * 6e4;
511
+ var FAST_FAILURE_MS = HEALTHY_RESET_MS;
512
+ var EXE_DIR = path3.join(os2.homedir(), ".exe-os");
513
+ var STATE_DIR = path3.join(EXE_DIR, "worker-backoff");
514
+ function computeBackoffDelayMs(consecutiveFailures, baseMs = BASE_DELAY_MS, maxMs = MAX_DELAY_MS) {
515
+ if (consecutiveFailures <= 0) return 0;
516
+ const exp = Math.min(consecutiveFailures - 1, 30);
517
+ const delay = baseMs * Math.pow(2, exp);
518
+ return Math.min(delay, maxMs);
519
+ }
520
+ function evaluateRestart(prev, uptimeMs, threshold = FAILURE_THRESHOLD, fastFailureMs = FAST_FAILURE_MS) {
521
+ const priorFailures = prev && uptimeMs < fastFailureMs ? prev.consecutiveFailures : 0;
522
+ const consecutiveFailures = priorFailures + 1;
523
+ if (consecutiveFailures >= threshold) {
524
+ return { action: "trip", consecutiveFailures };
525
+ }
526
+ return {
527
+ action: "restart",
528
+ delayMs: computeBackoffDelayMs(consecutiveFailures),
529
+ consecutiveFailures
530
+ };
531
+ }
532
+ function stateFile(workerKey) {
533
+ const safe = workerKey.replace(/[^a-zA-Z0-9_-]/g, "_");
534
+ return path3.join(STATE_DIR, `${safe}.json`);
535
+ }
536
+ function loadBackoffState(workerKey) {
537
+ try {
538
+ const f = stateFile(workerKey);
539
+ if (!existsSync3(f)) return null;
540
+ const parsed = JSON.parse(readFileSync2(f, "utf8"));
541
+ if (typeof parsed.consecutiveFailures !== "number" || typeof parsed.lastFailureAt !== "number") {
542
+ return null;
543
+ }
544
+ return { consecutiveFailures: parsed.consecutiveFailures, lastFailureAt: parsed.lastFailureAt };
545
+ } catch {
546
+ return null;
547
+ }
548
+ }
549
+ function saveBackoffState(workerKey, state) {
550
+ try {
551
+ if (!existsSync3(STATE_DIR)) mkdirSync2(STATE_DIR, { recursive: true });
552
+ writeFileSync2(stateFile(workerKey), JSON.stringify(state), { mode: 384 });
553
+ } catch {
554
+ }
555
+ }
556
+ function resetBackoffState(workerKey) {
557
+ try {
558
+ const f = stateFile(workerKey);
559
+ if (existsSync3(f)) unlinkSync(f);
560
+ } catch {
561
+ }
562
+ }
563
+ function recordWorkerFailure(workerKey, uptimeMs) {
564
+ const prev = loadBackoffState(workerKey);
565
+ const decision = evaluateRestart(prev, uptimeMs);
566
+ saveBackoffState(workerKey, {
567
+ consecutiveFailures: decision.consecutiveFailures,
568
+ lastFailureAt: Date.now()
569
+ });
570
+ return decision;
571
+ }
572
+
503
573
  // src/lib/exe-daemon.ts
504
- var SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path3.join(EXE_AI_DIR, "exed.sock");
505
- var PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path3.join(EXE_AI_DIR, "exed.pid");
574
+ var SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path4.join(EXE_AI_DIR, "exed.sock");
575
+ var PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path4.join(EXE_AI_DIR, "exed.pid");
506
576
  var MODEL_FILE = "jina-embeddings-v5-small-q4_k_m.gguf";
507
577
  var IDLE_TIMEOUT_MS = parseInt(process.env.EXE_DAEMON_IDLE_TIMEOUT_MS || "0", 10);
508
578
  var REVIEW_POLL_INTERVAL_MS = 60 * 1e3;
@@ -773,7 +843,7 @@ function enqueue(queue, entry) {
773
843
  }
774
844
  queue.push(entry);
775
845
  }
776
- var OOM_MARKER_PATH = path3.join(os2.homedir(), ".exe-os", "embedding-oom-marker");
846
+ var OOM_MARKER_PATH = path4.join(os3.homedir(), ".exe-os", "embedding-oom-marker");
777
847
  var MIN_FREE_MEM_BYTES = 2 * 1024 ** 3;
778
848
  var MAX_SMALL_TOTAL_BYTES = 16 * 1024 ** 3;
779
849
  async function loadModel() {
@@ -784,27 +854,27 @@ async function loadModel() {
784
854
  _embeddingsDisabledByDesign = true;
785
855
  return;
786
856
  }
787
- const modelPath = path3.join(MODELS_DIR, MODEL_FILE);
788
- if (!existsSync3(modelPath)) {
857
+ const modelPath = path4.join(MODELS_DIR, MODEL_FILE);
858
+ if (!existsSync4(modelPath)) {
789
859
  process.stderr.write(`[exed] No model at ${modelPath} \u2014 running without embeddings (VPS mode).
790
860
  `);
791
861
  _embeddingsDisabledByDesign = true;
792
862
  return;
793
863
  }
794
- if (existsSync3(OOM_MARKER_PATH)) {
864
+ if (existsSync4(OOM_MARKER_PATH)) {
795
865
  process.stderr.write(`[exed] Skipping embeddings \u2014 OOM marker exists. Delete ${OOM_MARKER_PATH} to retry.
796
866
  `);
797
867
  _embeddingsDisabledByDesign = true;
798
868
  return;
799
869
  }
800
- const totalMem = os2.totalmem();
870
+ const totalMem = os3.totalmem();
801
871
  if (totalMem <= MAX_SMALL_TOTAL_BYTES) {
802
872
  process.stderr.write(`[exed] Skipping embeddings \u2014 total RAM ${(totalMem / 1024 ** 3).toFixed(1)} GB <= 16 GB (FTS+Graph only).
803
873
  `);
804
874
  _embeddingsDisabledByDesign = true;
805
875
  return;
806
876
  }
807
- if (os2.freemem() < MIN_FREE_MEM_BYTES) {
877
+ if (os3.freemem() < MIN_FREE_MEM_BYTES) {
808
878
  process.stderr.write(`[exed] Skipping embeddings \u2014 free RAM < 2 GB.
809
879
  `);
810
880
  _embeddingsDisabledByDesign = true;
@@ -812,8 +882,8 @@ async function loadModel() {
812
882
  }
813
883
  process.stderr.write("[exed] Spawning embed worker process...\n");
814
884
  try {
815
- const workerPath = path3.join(path3.dirname(new URL(import.meta.url).pathname), "embed-worker.js");
816
- if (!existsSync3(workerPath)) {
885
+ const workerPath = path4.join(path4.dirname(new URL(import.meta.url).pathname), "embed-worker.js");
886
+ if (!existsSync4(workerPath)) {
817
887
  process.stderr.write(`[exed] Embed worker not found at ${workerPath} \u2014 running without embeddings.
818
888
  `);
819
889
  return;
@@ -1100,11 +1170,11 @@ async function shutdown() {
1100
1170
  `
1101
1171
  );
1102
1172
  try {
1103
- unlinkSync(SOCKET_PATH);
1173
+ unlinkSync2(SOCKET_PATH);
1104
1174
  } catch {
1105
1175
  }
1106
1176
  try {
1107
- unlinkSync(PID_PATH);
1177
+ unlinkSync2(PID_PATH);
1108
1178
  } catch {
1109
1179
  }
1110
1180
  process.kill(process.pid, "SIGKILL");
@@ -1125,10 +1195,11 @@ async function shutdown() {
1125
1195
  }
1126
1196
  }
1127
1197
  try {
1128
- const { createBackupAsync } = await import("../db-backup-7UMCTS44.js");
1198
+ const { createBackupAsync, enforceRetention } = await import("../db-backup-2RG6VHT7.js");
1129
1199
  const backupPath = await createBackupAsync("pre-restart");
1130
1200
  if (backupPath) {
1131
- process.stderr.write(`[exed] Pre-restart backup: ${backupPath}
1201
+ const deleted = enforceRetention("pre-restart");
1202
+ process.stderr.write(`[exed] Pre-restart backup: ${backupPath}${deleted > 0 ? ` (rotated ${deleted} old)` : ""}
1132
1203
  `);
1133
1204
  }
1134
1205
  } catch (e) {
@@ -1148,7 +1219,7 @@ async function shutdown() {
1148
1219
  `);
1149
1220
  }
1150
1221
  try {
1151
- const { stopProjectionWorker } = await import("../projection-worker-O3HBG5QK.js");
1222
+ const { stopProjectionWorker } = await import("../projection-worker-YKKBNQZT.js");
1152
1223
  stopProjectionWorker();
1153
1224
  } catch {
1154
1225
  }
@@ -1175,8 +1246,8 @@ async function shutdown() {
1175
1246
  savedAt: Date.now()
1176
1247
  })) : [];
1177
1248
  if (sessionsToSave.length > 0) {
1178
- const sessPath = path3.join(EXE_AI_DIR, "mcp-sessions-persist.json");
1179
- writeFileSync2(sessPath, JSON.stringify(sessionsToSave) + "\n", { mode: 384 });
1249
+ const sessPath = path4.join(EXE_AI_DIR, "mcp-sessions-persist.json");
1250
+ writeFileSync3(sessPath, JSON.stringify(sessionsToSave) + "\n", { mode: 384 });
1180
1251
  process.stderr.write(`[exed] Persisted ${sessionsToSave.length} MCP session(s) for next daemon.
1181
1252
  `);
1182
1253
  }
@@ -1185,13 +1256,13 @@ async function shutdown() {
1185
1256
  `);
1186
1257
  }
1187
1258
  try {
1188
- unlinkSync(SOCKET_PATH);
1259
+ unlinkSync2(SOCKET_PATH);
1189
1260
  } catch (e) {
1190
1261
  process.stderr.write(`[exed] socket cleanup: ${e.message}
1191
1262
  `);
1192
1263
  }
1193
1264
  try {
1194
- unlinkSync(PID_PATH);
1265
+ unlinkSync2(PID_PATH);
1195
1266
  } catch (e) {
1196
1267
  process.stderr.write(`[exed] pid cleanup: ${e.message}
1197
1268
  `);
@@ -1218,7 +1289,7 @@ async function handleHealthCheck(socket, requestId) {
1218
1289
  let pipelineStatus = "unknown";
1219
1290
  if (dbConnected) {
1220
1291
  try {
1221
- await import("../pipeline-router-RVHLL7UA.js");
1292
+ await import("../pipeline-router-6ZBYJD2U.js");
1222
1293
  pipelineStatus = "ok";
1223
1294
  } catch {
1224
1295
  pipelineStatus = "unavailable";
@@ -1255,9 +1326,45 @@ async function handleHealthCheck(socket, requestId) {
1255
1326
  logRestartEvent("daemon_self_exit", { trigger: "health_check_failure", dbConnected, embedStatus, uptime_s: Math.floor((Date.now() - _startedAt2) / 1e3) });
1256
1327
  void shutdown();
1257
1328
  } else if (embedStatus === "unavailable" && !_embeddingsDisabledByDesign) {
1258
- process.stderr.write("[exed] Health check: embed worker failed (not disabled by design) \u2014 exiting for restart.\n");
1259
- logRestartEvent("daemon_self_exit", { trigger: "embed_failure_not_disabled", dbConnected, embedStatus, uptime_s: Math.floor((Date.now() - _startedAt2) / 1e3) });
1260
- void shutdown();
1329
+ const uptimeMs = Date.now() - _startedAt2;
1330
+ const decision = recordWorkerFailure("embed", uptimeMs);
1331
+ if (decision.action === "trip") {
1332
+ _embeddingsDisabledByDesign = true;
1333
+ try {
1334
+ if (_embedWorker) {
1335
+ _embedWorker.kill(process.platform === "darwin" ? "SIGKILL" : "SIGTERM");
1336
+ }
1337
+ } catch {
1338
+ }
1339
+ _embedWorker = null;
1340
+ _embedWorkerReady = false;
1341
+ process.stderr.write(
1342
+ `[exed] CRITICAL: embed worker failed ${decision.consecutiveFailures}x consecutively \u2014 circuit breaker OPEN. Disabling embeddings and keeping daemon alive (FTS + graph retrieval still works). No more restarts for this fault.
1343
+ `
1344
+ );
1345
+ logRestartEvent("embed_circuit_breaker_open", {
1346
+ consecutive_failures: decision.consecutiveFailures,
1347
+ uptime_s: Math.floor(uptimeMs / 1e3)
1348
+ });
1349
+ return;
1350
+ }
1351
+ process.stderr.write(
1352
+ `[exed] Health check: embed worker failed (not disabled by design) \u2014 restart ${decision.consecutiveFailures}/${10} after ${Math.round(decision.delayMs / 1e3)}s backoff.
1353
+ `
1354
+ );
1355
+ logRestartEvent("daemon_self_exit", {
1356
+ trigger: "embed_failure_not_disabled",
1357
+ dbConnected,
1358
+ embedStatus,
1359
+ consecutive_failures: decision.consecutiveFailures,
1360
+ backoff_ms: decision.delayMs,
1361
+ uptime_s: Math.floor(uptimeMs / 1e3)
1362
+ });
1363
+ setTimeout(() => {
1364
+ void shutdown();
1365
+ }, decision.delayMs);
1366
+ } else if (coreHealthy && embedStatus === "ok") {
1367
+ if (Date.now() - _startedAt2 >= 30 * 6e4) resetBackoffState("embed");
1261
1368
  }
1262
1369
  }
1263
1370
  var _dbRequestsServed = 0;
@@ -1525,7 +1632,7 @@ async function _writeMemoryRecordInner(entry) {
1525
1632
  const vRow = await client.execute({ sql: "SELECT version FROM memories WHERE id = ?", args: [id] });
1526
1633
  const version = Number(vRow.rows[0]?.version) || 0;
1527
1634
  try {
1528
- const { insertOntologyForMemory } = await import("../agentic-ontology-UZK33N6I.js");
1635
+ const { insertOntologyForMemory } = await import("../agentic-ontology-5WT23SLZ.js");
1529
1636
  await insertOntologyForMemory({
1530
1637
  id,
1531
1638
  agent_id: record.agent_id,
@@ -1599,7 +1706,7 @@ function startMessageQueueDrain() {
1599
1706
  fired("message_queue_drain");
1600
1707
  if (!await ensureStoreForPolling()) return;
1601
1708
  try {
1602
- const { claimMessageQueue, ackMessageQueue } = await import("../message-queue-client-2CACBUA4.js");
1709
+ const { claimMessageQueue, ackMessageQueue } = await import("../message-queue-client-YTKTHAYO.js");
1603
1710
  const lease = claimMessageQueue();
1604
1711
  if (!lease || lease.entries.length === 0) return;
1605
1712
  acted("message_queue_drain");
@@ -1647,28 +1754,28 @@ function startMessageQueueDrain() {
1647
1754
  `);
1648
1755
  }
1649
1756
  function startServer() {
1650
- mkdirSync2(path3.dirname(SOCKET_PATH), { recursive: true });
1757
+ mkdirSync3(path4.dirname(SOCKET_PATH), { recursive: true });
1651
1758
  try {
1652
- chmodSync(path3.dirname(SOCKET_PATH), 448);
1759
+ chmodSync(path4.dirname(SOCKET_PATH), 448);
1653
1760
  } catch {
1654
1761
  }
1655
1762
  _daemonToken = ensureDaemonToken(process.env[DAEMON_TOKEN_ENV] ?? null);
1656
1763
  for (const oldFile of ["embed.sock", "embed.pid"]) {
1657
- const oldPath = path3.join(path3.dirname(SOCKET_PATH), oldFile);
1764
+ const oldPath = path4.join(path4.dirname(SOCKET_PATH), oldFile);
1658
1765
  try {
1659
1766
  if (oldFile.endsWith(".pid")) {
1660
- const pid = parseInt(readFileSync2(oldPath, "utf8").trim(), 10);
1767
+ const pid = parseInt(readFileSync3(oldPath, "utf8").trim(), 10);
1661
1768
  if (pid > 0) try {
1662
1769
  process.kill(pid, "SIGKILL");
1663
1770
  } catch {
1664
1771
  }
1665
1772
  }
1666
- unlinkSync(oldPath);
1773
+ unlinkSync2(oldPath);
1667
1774
  } catch {
1668
1775
  }
1669
1776
  }
1670
1777
  try {
1671
- unlinkSync(SOCKET_PATH);
1778
+ unlinkSync2(SOCKET_PATH);
1672
1779
  } catch {
1673
1780
  }
1674
1781
  const server = net.createServer((socket) => {
@@ -1989,13 +2096,13 @@ async function startMcpHttpServer() {
1989
2096
  let _cachedWrapTelemetry = null;
1990
2097
  async function getWrapTelemetry() {
1991
2098
  if (!_cachedWrapTelemetry) {
1992
- const { wrapServerWithTelemetry } = await import("../tool-telemetry-5BSTF3P6.js");
2099
+ const { wrapServerWithTelemetry } = await import("../tool-telemetry-OVI5KL4S.js");
1993
2100
  _cachedWrapTelemetry = wrapServerWithTelemetry;
1994
2101
  }
1995
2102
  return _cachedWrapTelemetry;
1996
2103
  }
1997
2104
  Promise.all([
1998
- import("../tool-capability-index-PZWWVABO.js"),
2105
+ import("../tool-capability-index-C73KVY5O.js"),
1999
2106
  import("../tool-gates-3IC7DK4R.js")
2000
2107
  ]).then(async ([{ getToolCapabilityIndex }, { TOOL_CATEGORIES }]) => {
2001
2108
  const gateState = getCachedLicenseGate();
@@ -2024,9 +2131,9 @@ async function startMcpHttpServer() {
2024
2131
  const pendingStaleSessionRecoveries = /* @__PURE__ */ new Map();
2025
2132
  _mcpSessionDetailsRef = sessionDetails;
2026
2133
  try {
2027
- const sessPath = path3.join(EXE_AI_DIR, "mcp-sessions-persist.json");
2028
- if (existsSync3(sessPath)) {
2029
- const raw = readFileSync2(sessPath, "utf-8");
2134
+ const sessPath = path4.join(EXE_AI_DIR, "mcp-sessions-persist.json");
2135
+ if (existsSync4(sessPath)) {
2136
+ const raw = readFileSync3(sessPath, "utf-8");
2030
2137
  const saved = JSON.parse(raw);
2031
2138
  const MAX_AGE_MS = 5 * 60 * 1e3;
2032
2139
  const now = Date.now();
@@ -2044,7 +2151,7 @@ async function startMcpHttpServer() {
2044
2151
  }
2045
2152
  }
2046
2153
  try {
2047
- unlinkSync(sessPath);
2154
+ unlinkSync2(sessPath);
2048
2155
  } catch {
2049
2156
  }
2050
2157
  if (restored > 0) {
@@ -2317,7 +2424,7 @@ async function startMcpHttpServer() {
2317
2424
  contextPct: body.context_pct
2318
2425
  });
2319
2426
  if (body.context_pct !== void 0 && body.context_pct > 70) {
2320
- void import("../orchestration-events-A5D52NXX.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
2427
+ void import("../orchestration-events-7RMWC5SS.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
2321
2428
  recordOE({
2322
2429
  eventType: "context.pressure",
2323
2430
  source: "exe-daemon.heartbeat",
@@ -2771,13 +2878,13 @@ async function ensureStoreForPolling() {
2771
2878
  }
2772
2879
  }
2773
2880
  async function startReviewPolling() {
2774
- const polling = await import("../review-polling-5JTTHHEO.js");
2881
+ const polling = await import("../review-polling-PK3CY4NI.js");
2775
2882
  const state = {
2776
2883
  lastIntercomSent: /* @__PURE__ */ new Map(),
2777
2884
  lastNudgeSent: /* @__PURE__ */ new Map(),
2778
2885
  intervalMs: REVIEW_POLL_INTERVAL_MS
2779
2886
  };
2780
- const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-6XAISQ7B.js");
2887
+ const { pollReviewNudge, createReviewNudgeRealDeps, loadNudgeState } = await import("../daemon-orchestration-YAJKIL6Q.js");
2781
2888
  const nudgeState = loadNudgeState();
2782
2889
  const tick = async () => traceDaemonTimer("review_polling", async () => {
2783
2890
  fired("review_polling");
@@ -2820,7 +2927,7 @@ function startSessionTTL() {
2820
2927
  if (!await ensureStoreForPolling()) return;
2821
2928
  try {
2822
2929
  const { getClient } = await import("./database.js");
2823
- const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
2930
+ const { checkSessionTTL, createSessionTTLRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
2824
2931
  const deps = createSessionTTLRealDeps(getClient);
2825
2932
  const killed = await checkSessionTTL(deps);
2826
2933
  if (killed.length > 0) acted("session_ttl");
@@ -2841,12 +2948,12 @@ function startIdleKill() {
2841
2948
  fired("idle_kill");
2842
2949
  if (!await ensureStoreForPolling()) return;
2843
2950
  try {
2844
- const signalDir = path3.join(os2.homedir(), ".exe-os", "task-signals");
2845
- if (existsSync3(signalDir)) {
2951
+ const signalDir = path4.join(os3.homedir(), ".exe-os", "task-signals");
2952
+ if (existsSync4(signalDir)) {
2846
2953
  const files = (await import("fs")).readdirSync(signalDir).filter((f) => f.endsWith(".terminate"));
2847
2954
  for (const file of files) {
2848
2955
  const agentId = file.replace(".terminate", "");
2849
- const signalPath = path3.join(signalDir, file);
2956
+ const signalPath = path4.join(signalDir, file);
2850
2957
  try {
2851
2958
  const sessions = await getTmuxSessionsAsync();
2852
2959
  const match = sessions.find((s) => s.startsWith(`${agentId}-`) || s.startsWith(`${agentId}2-`) || s.startsWith(`${agentId}3-`));
@@ -2856,9 +2963,9 @@ function startIdleKill() {
2856
2963
  `);
2857
2964
  acted("idle_kill");
2858
2965
  }
2859
- unlinkSync(signalPath);
2966
+ unlinkSync2(signalPath);
2860
2967
  } catch {
2861
- unlinkSync(signalPath);
2968
+ unlinkSync2(signalPath);
2862
2969
  }
2863
2970
  }
2864
2971
  }
@@ -2868,7 +2975,7 @@ function startIdleKill() {
2868
2975
  const cfg = await getCachedConfig();
2869
2976
  if (!cfg) return;
2870
2977
  const { getClient } = await import("./database.js");
2871
- const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
2978
+ const { pollIdleKill, createIdleKillRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
2872
2979
  const { sessions: liveSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
2873
2980
  const realDeps = createIdleKillRealDeps(
2874
2981
  getClient,
@@ -2937,8 +3044,9 @@ function startConsolidation() {
2937
3044
  `);
2938
3045
  }
2939
3046
  try {
2940
- const { createBackupAsync } = await import("../db-backup-7UMCTS44.js");
2941
- await createBackupAsync("pre-consolidation");
3047
+ const { createBackupAsync, enforceRetention } = await import("../db-backup-2RG6VHT7.js");
3048
+ const p = await createBackupAsync("pre-consolidation");
3049
+ if (p) enforceRetention("pre-consolidation");
2942
3050
  } catch (e) {
2943
3051
  process.stderr.write("[exe-daemon] pre-consolidation backup: " + (e instanceof Error ? e.message : String(e)) + "\n");
2944
3052
  }
@@ -3120,7 +3228,7 @@ function startSkillRefinement() {
3120
3228
  if (!shouldRunHeavyJob("skill_refinement")) return;
3121
3229
  try {
3122
3230
  if (!await ensureStoreForPolling()) return;
3123
- const { runSkillRefinement } = await import("../skill-refinement-TT4VDYYW.js");
3231
+ const { runSkillRefinement } = await import("../skill-refinement-6PBAFLWP.js");
3124
3232
  const result = await runSkillRefinement();
3125
3233
  if (result.reviewed > 0) {
3126
3234
  acted("skill_refinement");
@@ -3355,7 +3463,7 @@ function startGraphPgSync() {
3355
3463
  `);
3356
3464
  }
3357
3465
  var AGENT_STATS_INTERVAL_MS = 60 * 1e3;
3358
- var AGENT_STATS_PATH = path3.join(EXE_AI_DIR, "agent-stats.json");
3466
+ var AGENT_STATS_PATH = path4.join(EXE_AI_DIR, "agent-stats.json");
3359
3467
  var _agentStatsInFlight = false;
3360
3468
  var _cachedAgentData = null;
3361
3469
  async function writeAgentStats() {
@@ -3525,7 +3633,7 @@ function startReflectionSweep() {
3525
3633
  );
3526
3634
  let runReflection;
3527
3635
  try {
3528
- ({ runReflection } = await import("../memory-reflection-YPP2JC2S.js"));
3636
+ ({ runReflection } = await import("../memory-reflection-GSGXAGXV.js"));
3529
3637
  } catch (importErr) {
3530
3638
  _reflectionImportFailed = true;
3531
3639
  process.stderr.write(`[exed] Reflection module unavailable (stale chunk hash?) \u2014 disabled until daemon restart: ${importErr instanceof Error ? importErr.message : String(importErr)}
@@ -3564,7 +3672,7 @@ function startReflectionSweep() {
3564
3672
  if (memories > 100 && cards < memories * 0.1) {
3565
3673
  process.stderr.write(`[exed] Memory cards sparse (${cards} cards / ${memories} memories) \u2014 running backfill...
3566
3674
  `);
3567
- const { insertMemoryCardsForBatch } = await import("../memory-cards-3SFXU6IP.js");
3675
+ const { insertMemoryCardsForBatch } = await import("../memory-cards-ZOOPC2WF.js");
3568
3676
  const batchSize = 500;
3569
3677
  let offset = 0;
3570
3678
  let totalCards = 0;
@@ -3609,12 +3717,12 @@ function startDatabaseBackup() {
3609
3717
  fired("db_backup");
3610
3718
  if (!shouldRunHeavyJob("db_backup")) return;
3611
3719
  try {
3612
- const { createBackupAsync, rotateBackups, hasBackupToday } = await import("../db-backup-7UMCTS44.js");
3720
+ const { createBackupAsync, enforceRetention, hasBackupToday } = await import("../db-backup-2RG6VHT7.js");
3613
3721
  if (hasBackupToday("daily")) return;
3614
3722
  const backupPath = await createBackupAsync("daily");
3615
3723
  if (backupPath) {
3616
3724
  acted("db_backup");
3617
- const deleted = rotateBackups();
3725
+ const deleted = enforceRetention("daily");
3618
3726
  process.stderr.write(
3619
3727
  `[exed] DB backup: ${backupPath.split("/").pop()}${deleted > 0 ? ` (rotated ${deleted} old)` : ""}
3620
3728
  `
@@ -3709,7 +3817,7 @@ function startOrphanReaper() {
3709
3817
  const tick = async () => traceDaemonTimer("orphan_reaper", async () => {
3710
3818
  fired("orphan_reaper");
3711
3819
  try {
3712
- const { reapOrphanedMcpProcesses, createOrphanReaperRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
3820
+ const { reapOrphanedMcpProcesses, createOrphanReaperRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
3713
3821
  const deps = createOrphanReaperRealDeps();
3714
3822
  const reaped = await reapOrphanedMcpProcesses(deps);
3715
3823
  if (reaped.length > 0) acted("orphan_reaper");
@@ -3736,7 +3844,7 @@ function startZombieAgentReaper() {
3736
3844
  const tick = async () => traceDaemonTimer("zombie_agent_reaper", async () => {
3737
3845
  fired("zombie_agent_reaper");
3738
3846
  try {
3739
- const { reapZombieAgentProcesses, createZombieAgentReaperRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
3847
+ const { reapZombieAgentProcesses, createZombieAgentReaperRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
3740
3848
  const deps = createZombieAgentReaperRealDeps();
3741
3849
  const reaped = reapZombieAgentProcesses(deps);
3742
3850
  if (reaped.length > 0) acted("zombie_agent_reaper");
@@ -3762,7 +3870,7 @@ function startWorktreeReaper() {
3762
3870
  const tick = async () => traceDaemonTimer("worktree_reaper", async () => {
3763
3871
  fired("worktree_reaper");
3764
3872
  try {
3765
- const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
3873
+ const { reapOrphanedWorktrees, createWorktreeReaperRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
3766
3874
  const deps = await createWorktreeReaperRealDeps();
3767
3875
  const result = await reapOrphanedWorktrees(deps);
3768
3876
  if (result.pruned.length > 0) {
@@ -3778,6 +3886,49 @@ function startWorktreeReaper() {
3778
3886
  `
3779
3887
  );
3780
3888
  }
3889
+ try {
3890
+ const { existsSync: sigExists, readdirSync: sigReaddir, readFileSync: sigRead, unlinkSync: sigUnlink } = await import("fs");
3891
+ const sigPath = await import("path");
3892
+ const { EXE_AI_DIR: sigDir } = await import("./config.js");
3893
+ const signalDir = sigPath.join(sigDir, "worktree-cleanup-signals");
3894
+ if (sigExists(signalDir)) {
3895
+ const files = sigReaddir(signalDir).filter((f) => f.endsWith(".json"));
3896
+ for (const file of files) {
3897
+ try {
3898
+ const fullPath = sigPath.join(signalDir, file);
3899
+ const signal = JSON.parse(sigRead(fullPath, "utf8"));
3900
+ try {
3901
+ sigUnlink(fullPath);
3902
+ } catch {
3903
+ }
3904
+ if (!signal.worktreePath || !signal.safeToRemove) {
3905
+ if (signal.worktreePath && signal.isClean && !signal.isPushed) {
3906
+ process.stderr.write(
3907
+ `[exed] Worktree ${signal.agentId} has unpushed commits \u2014 preserved. Push and re-signal to clean up.
3908
+ `
3909
+ );
3910
+ }
3911
+ continue;
3912
+ }
3913
+ const { cleanupAgentWorktree } = await import("../worktree-sweep-5XVZCH6A.js");
3914
+ const { getMainRepoRoot } = await import("../worktree-NK7GZNEA.js");
3915
+ const repoRoot = getMainRepoRoot(signal.worktreePath);
3916
+ if (repoRoot && signal.agentId) {
3917
+ const notes = cleanupAgentWorktree(repoRoot, signal.agentId);
3918
+ if (notes) {
3919
+ acted("worktree_reaper");
3920
+ process.stderr.write(
3921
+ `[exed] Worktree signal cleanup for ${signal.agentId}: ${notes.replace(/\n/g, "; ")}
3922
+ `
3923
+ );
3924
+ }
3925
+ }
3926
+ } catch {
3927
+ }
3928
+ }
3929
+ }
3930
+ } catch {
3931
+ }
3781
3932
  });
3782
3933
  const intervalMs = 30 * 60 * 1e3;
3783
3934
  const timer = setInterval(() => void tick(), intervalMs);
@@ -3817,7 +3968,7 @@ function startStuckTaskRelease() {
3817
3968
  if (!await ensureStoreForPolling()) return;
3818
3969
  try {
3819
3970
  const { getClient } = await import("./database.js");
3820
- const { releaseStuckTasks, createStuckTaskRealDeps } = await import("../daemon-orchestration-6XAISQ7B.js");
3971
+ const { releaseStuckTasks, createStuckTaskRealDeps } = await import("../daemon-orchestration-YAJKIL6Q.js");
3821
3972
  const deps = createStuckTaskRealDeps(getClient);
3822
3973
  const released = await releaseStuckTasks(deps);
3823
3974
  if (released.length > 0) {
@@ -3898,7 +4049,7 @@ function startExternalRssWatchdog() {
3898
4049
  restartBytes: RSS_RESTART_BYTES,
3899
4050
  checkMs: RSS_CHECK_INTERVAL_MS,
3900
4051
  markerPath: OOM_MARKER_PATH,
3901
- cwd: os2.homedir()
4052
+ cwd: os3.homedir()
3902
4053
  }
3903
4054
  });
3904
4055
  worker.unref();
@@ -3921,12 +4072,12 @@ function startTaskEnforcementScanner() {
3921
4072
  const tick = async () => traceDaemonTimer("task_enforcement", async () => {
3922
4073
  fired("task_enforcement");
3923
4074
  try {
3924
- const { runTaskEnforcementTick } = await import("../task-enforcement-A6AZTYAN.js");
4075
+ const { runTaskEnforcementTick } = await import("../task-enforcement-2LS5DOXK.js");
3925
4076
  const { getTransport } = await import("./transport.js");
3926
4077
  const { loadAgentConfig } = await import("./agent-config.js");
3927
4078
  const { getClient } = await import("./database.js");
3928
4079
  const { loadEmployeesSync } = await import("./employees.js");
3929
- const { sessionScopeFilter } = await import("../task-scope-XKNAY5S7.js");
4080
+ const { sessionScopeFilter } = await import("../task-scope-AKF3CSWO.js");
3930
4081
  const transport = getTransport();
3931
4082
  const { sessions: allSessions, paneCache, aliveSessions } = await getSharedOrchestrationCaches();
3932
4083
  await yieldToEventLoop();
@@ -3937,7 +4088,7 @@ function startTaskEnforcementScanner() {
3937
4088
  sendKeysLiteral: transport.sendKeysLiteral?.bind(transport),
3938
4089
  isAlive: (session) => aliveSessions.has(session)
3939
4090
  };
3940
- const { checkAutoWakeGates } = await import("../daemon-orchestration-6XAISQ7B.js");
4091
+ const { checkAutoWakeGates } = await import("../daemon-orchestration-YAJKIL6Q.js");
3941
4092
  const { ensureEmployee } = await import("./tmux-routing.js");
3942
4093
  const { shouldAutoInstance } = await import("./employees.js");
3943
4094
  const projectDir = process.cwd();
@@ -4006,8 +4157,8 @@ function startRssWatchdog() {
4006
4157
  `
4007
4158
  );
4008
4159
  try {
4009
- mkdirSync2(path3.dirname(OOM_MARKER_PATH), { recursive: true });
4010
- writeFileSync2(OOM_MARKER_PATH, `RSS=${(rss / 1024 / 1024).toFixed(0)}MB at ${(/* @__PURE__ */ new Date()).toISOString()}
4160
+ mkdirSync3(path4.dirname(OOM_MARKER_PATH), { recursive: true });
4161
+ writeFileSync3(OOM_MARKER_PATH, `RSS=${(rss / 1024 / 1024).toFixed(0)}MB at ${(/* @__PURE__ */ new Date()).toISOString()}
4011
4162
  `);
4012
4163
  process.stderr.write(`[exed] Wrote OOM marker at ${OOM_MARKER_PATH}
4013
4164
  `);
@@ -4110,11 +4261,11 @@ function startApiWatchdog() {
4110
4261
  process.stderr.write(`[exed] API watchdog nudged ${session} (attempt ${nudgeCount}/3, matched: ${matchedPattern.source})
4111
4262
  `);
4112
4263
  try {
4113
- const { appendFileSync: appendFileSync2, mkdirSync: mkdirSync3, statSync: statSyncFs, renameSync: renameSyncFs } = await import("fs");
4264
+ const { appendFileSync: appendFileSync2, mkdirSync: mkdirSync4, statSync: statSyncFs, renameSync: renameSyncFs } = await import("fs");
4114
4265
  const { join } = await import("path");
4115
4266
  const logDir = join(process.env.EXE_OS_DIR ?? join(process.env.HOME ?? "", ".exe-os"), "logs");
4116
4267
  try {
4117
- mkdirSync3(logDir, { recursive: true });
4268
+ mkdirSync4(logDir, { recursive: true });
4118
4269
  } catch {
4119
4270
  }
4120
4271
  const watchdogLogPath = join(logDir, "api-watchdog.jsonl");
@@ -4267,11 +4418,11 @@ process.on("uncaughtException", (err) => {
4267
4418
  } catch {
4268
4419
  }
4269
4420
  try {
4270
- unlinkSync(SOCKET_PATH);
4421
+ unlinkSync2(SOCKET_PATH);
4271
4422
  } catch (_) {
4272
4423
  }
4273
4424
  try {
4274
- unlinkSync(PID_PATH);
4425
+ unlinkSync2(PID_PATH);
4275
4426
  } catch (_) {
4276
4427
  }
4277
4428
  setTimeout(() => process.exit(1), 3e3);
@@ -4305,18 +4456,18 @@ function killOrphanDaemons() {
4305
4456
  }
4306
4457
  function checkExistingDaemon() {
4307
4458
  try {
4308
- if (!existsSync3(PID_PATH)) {
4459
+ if (!existsSync4(PID_PATH)) {
4309
4460
  killOrphanDaemons();
4310
4461
  return false;
4311
4462
  }
4312
- const pid = parseInt(readFileSync2(PID_PATH, "utf8").trim(), 10);
4463
+ const pid = parseInt(readFileSync3(PID_PATH, "utf8").trim(), 10);
4313
4464
  if (!pid || isNaN(pid)) {
4314
4465
  killOrphanDaemons();
4315
4466
  return false;
4316
4467
  }
4317
4468
  if (pid === process.pid) {
4318
4469
  try {
4319
- unlinkSync(PID_PATH);
4470
+ unlinkSync2(PID_PATH);
4320
4471
  } catch {
4321
4472
  }
4322
4473
  return false;
@@ -4327,11 +4478,11 @@ function checkExistingDaemon() {
4327
4478
  process.stderr.write(`[exed] PID ${pid} is a zombie \u2014 cleaning up and proceeding.
4328
4479
  `);
4329
4480
  try {
4330
- unlinkSync(PID_PATH);
4481
+ unlinkSync2(PID_PATH);
4331
4482
  } catch {
4332
4483
  }
4333
4484
  try {
4334
- unlinkSync(SOCKET_PATH);
4485
+ unlinkSync2(SOCKET_PATH);
4335
4486
  } catch {
4336
4487
  }
4337
4488
  killOrphanDaemons();
@@ -4341,11 +4492,11 @@ function checkExistingDaemon() {
4341
4492
  process.stderr.write(`[exed] PID ${pid} no longer exists \u2014 cleaning stale PID file.
4342
4493
  `);
4343
4494
  try {
4344
- unlinkSync(PID_PATH);
4495
+ unlinkSync2(PID_PATH);
4345
4496
  } catch {
4346
4497
  }
4347
4498
  try {
4348
- unlinkSync(SOCKET_PATH);
4499
+ unlinkSync2(SOCKET_PATH);
4349
4500
  } catch {
4350
4501
  }
4351
4502
  killOrphanDaemons();
@@ -4367,7 +4518,7 @@ function checkExistingDaemon() {
4367
4518
  return true;
4368
4519
  }
4369
4520
  try {
4370
- unlinkSync(PID_PATH);
4521
+ unlinkSync2(PID_PATH);
4371
4522
  } catch {
4372
4523
  }
4373
4524
  killOrphanDaemons();
@@ -4435,20 +4586,20 @@ function startAutoUpdateCheck() {
4435
4586
  if (checkExistingDaemon()) {
4436
4587
  process.exit(0);
4437
4588
  }
4438
- writeFileSync2(PID_PATH, String(process.pid));
4589
+ writeFileSync3(PID_PATH, String(process.pid));
4439
4590
  try {
4440
4591
  chmodSync(PID_PATH, 384);
4441
4592
  } catch {
4442
4593
  }
4443
- var DAEMON_BOOT_PATH = path3.join(EXE_AI_DIR, "daemon-boot-ts");
4444
- writeFileSync2(DAEMON_BOOT_PATH, (/* @__PURE__ */ new Date()).toISOString());
4594
+ var DAEMON_BOOT_PATH = path4.join(EXE_AI_DIR, "daemon-boot-ts");
4595
+ writeFileSync3(DAEMON_BOOT_PATH, (/* @__PURE__ */ new Date()).toISOString());
4445
4596
  try {
4446
4597
  chmodSync(DAEMON_BOOT_PATH, 420);
4447
4598
  } catch {
4448
4599
  }
4449
4600
  await new Promise((r) => setTimeout(r, 500));
4450
4601
  try {
4451
- const claimedPid = parseInt(readFileSync2(PID_PATH, "utf8").trim(), 10);
4602
+ const claimedPid = parseInt(readFileSync3(PID_PATH, "utf8").trim(), 10);
4452
4603
  if (claimedPid !== process.pid) {
4453
4604
  process.stderr.write(
4454
4605
  `[exed] Race detected \u2014 PID ${claimedPid} claimed the lock. Exiting cleanly.
@@ -4466,13 +4617,13 @@ try {
4466
4617
  process.env.EXE_IS_DAEMON = "1";
4467
4618
  if (process.platform === "darwin") {
4468
4619
  try {
4469
- const oldPlist = path3.join(os2.homedir(), "Library", "LaunchAgents", "com.askexe.exed-keepalive.plist");
4470
- if (existsSync3(oldPlist)) {
4620
+ const oldPlist = path4.join(os3.homedir(), "Library", "LaunchAgents", "com.askexe.exed-keepalive.plist");
4621
+ if (existsSync4(oldPlist)) {
4471
4622
  try {
4472
4623
  execSyncNode(`launchctl unload "${oldPlist}" 2>/dev/null`, { timeout: 5e3 });
4473
4624
  } catch {
4474
4625
  }
4475
- unlinkSync(oldPlist);
4626
+ unlinkSync2(oldPlist);
4476
4627
  process.stderr.write("[exed] Removed old keepalive plist (replaced by launchd KeepAlive).\n");
4477
4628
  }
4478
4629
  } catch {
@@ -4511,12 +4662,12 @@ try {
4511
4662
  const msg = `[exed] EVENT LOOP BLOCKED ${(lag / 1e3).toFixed(1)}s \u2014 MCP UNRESPONSIVE. Sessions will die.`;
4512
4663
  process.stderr.write(msg + "\n");
4513
4664
  logDaemonHealth({ event: "event_loop_blocked", pid: process.pid, message: msg, data: { lagMs: lag } });
4514
- void import("../orchestration-events-A5D52NXX.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4665
+ void import("../orchestration-events-7RMWC5SS.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4515
4666
  recordOE({ eventType: "daemon.event_loop_blocked", source: "exe-daemon.lagDetector", severity: "error", durationMs: lag });
4516
4667
  }).catch(() => {
4517
4668
  });
4518
4669
  try {
4519
- writeFileSync2(path3.join(os2.homedir(), ".exe-os", "session-cache", "event-loop-blocked.marker"), `lag=${lag}ms at ${(/* @__PURE__ */ new Date()).toISOString()}
4670
+ writeFileSync3(path4.join(os3.homedir(), ".exe-os", "session-cache", "event-loop-blocked.marker"), `lag=${lag}ms at ${(/* @__PURE__ */ new Date()).toISOString()}
4520
4671
  `);
4521
4672
  } catch {
4522
4673
  }
@@ -4571,7 +4722,7 @@ try {
4571
4722
  const { readdir, readFile } = await import("fs/promises");
4572
4723
  const { getClient } = await import("./database.js");
4573
4724
  const client = getClient();
4574
- const tasksRoot = path3.join(os2.homedir(), ".exe-os", "tasks");
4725
+ const tasksRoot = path4.join(os3.homedir(), ".exe-os", "tasks");
4575
4726
  let synced = 0;
4576
4727
  const walkAsync = async (dir) => {
4577
4728
  let entries;
@@ -4581,7 +4732,7 @@ try {
4581
4732
  return;
4582
4733
  }
4583
4734
  for (const e of entries) {
4584
- const full = path3.join(dir, e.name);
4735
+ const full = path4.join(dir, e.name);
4585
4736
  if (e.isDirectory()) {
4586
4737
  await walkAsync(full);
4587
4738
  continue;
@@ -4606,7 +4757,7 @@ try {
4606
4757
  });
4607
4758
  if (Number(res.rowsAffected ?? 0) > 0) {
4608
4759
  synced++;
4609
- void import("../orchestration-events-A5D52NXX.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4760
+ void import("../orchestration-events-7RMWC5SS.js").then(({ recordOrchestrationEventBestEffort: recordOE }) => {
4610
4761
  recordOE({
4611
4762
  eventType: "task_file.resynced",
4612
4763
  source: "exe-daemon.taskFileResync",
@@ -4640,7 +4791,7 @@ try {
4640
4791
  fired("task_group_barriers");
4641
4792
  if (!await ensureStoreForPolling()) return;
4642
4793
  try {
4643
- const { pollTaskGroupBarriers } = await import("../daemon-orchestration-6XAISQ7B.js");
4794
+ const { pollTaskGroupBarriers } = await import("../daemon-orchestration-YAJKIL6Q.js");
4644
4795
  const firedCount = await pollTaskGroupBarriers();
4645
4796
  if (firedCount > 0) {
4646
4797
  acted("task_group_barriers");
@@ -4662,7 +4813,7 @@ try {
4662
4813
  fired("checkpoint_gc");
4663
4814
  if (!await ensureStoreForPolling()) return;
4664
4815
  try {
4665
- const { gcStaleCheckpoints } = await import("../daemon-orchestration-6XAISQ7B.js");
4816
+ const { gcStaleCheckpoints } = await import("../daemon-orchestration-YAJKIL6Q.js");
4666
4817
  const cleared = await gcStaleCheckpoints();
4667
4818
  if (cleared > 0) {
4668
4819
  acted("checkpoint_gc");
@@ -4714,7 +4865,7 @@ try {
4714
4865
  if (_intercomDedupCompleted) return;
4715
4866
  try {
4716
4867
  const { existsSync: markerExists } = await import("fs");
4717
- const markerPath = path3.join(os2.homedir(), ".exe-os", ".intercom-dedup-done");
4868
+ const markerPath = path4.join(os3.homedir(), ".exe-os", ".intercom-dedup-done");
4718
4869
  if (markerExists(markerPath)) {
4719
4870
  _intercomDedupCompleted = true;
4720
4871
  return;
@@ -4730,8 +4881,8 @@ try {
4730
4881
  }
4731
4882
  _intercomDedupCompleted = true;
4732
4883
  try {
4733
- const { writeFileSync: writeFileSync3 } = await import("fs");
4734
- writeFileSync3(markerPath, (/* @__PURE__ */ new Date()).toISOString(), "utf8");
4884
+ const { writeFileSync: writeFileSync4 } = await import("fs");
4885
+ writeFileSync4(markerPath, (/* @__PURE__ */ new Date()).toISOString(), "utf8");
4735
4886
  } catch {
4736
4887
  }
4737
4888
  } catch (err) {
@@ -4760,7 +4911,7 @@ try {
4760
4911
  fired("orphan_task_cleanup");
4761
4912
  try {
4762
4913
  if (!await ensureStoreForPolling()) return;
4763
- const { cleanOrphanedTaskFiles, checkTaskFileConsistency } = await import("../tasks-crud-F732BVOE.js");
4914
+ const { cleanOrphanedTaskFiles, checkTaskFileConsistency } = await import("../tasks-crud-KOIA5SAH.js");
4764
4915
  const count = await cleanOrphanedTaskFiles();
4765
4916
  if (count > 0) {
4766
4917
  acted("orphan_task_cleanup");
@@ -4798,7 +4949,7 @@ try {
4798
4949
  const TELEMETRY_DAILY_MS = 24 * 60 * 60 * 1e3;
4799
4950
  const telemetryDaily = async () => {
4800
4951
  try {
4801
- const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-HVYO6FL3.js");
4952
+ const { sendTelemetry, isTelemetryEnabled } = await import("../telemetry-upload-YLW4NAUF.js");
4802
4953
  if (!isTelemetryEnabled()) return;
4803
4954
  const { upstream } = await sendTelemetry(24);
4804
4955
  if (upstream.startsWith("sent")) {
@@ -4813,12 +4964,12 @@ try {
4813
4964
  setTimeout(telemetryDaily, 2 * 60 * 1e3);
4814
4965
  const dailyTimer = setInterval(telemetryDaily, TELEMETRY_DAILY_MS);
4815
4966
  dailyTimer.unref();
4816
- const { startToolTelemetryFlush } = await import("../tool-telemetry-5BSTF3P6.js");
4967
+ const { startToolTelemetryFlush } = await import("../tool-telemetry-OVI5KL4S.js");
4817
4968
  startToolTelemetryFlush();
4818
4969
  process.stderr.write("[exed] Tool telemetry started (flush every 5m)\n");
4819
4970
  setTimeout(async () => {
4820
4971
  try {
4821
- const { startProjectionWorker } = await import("../projection-worker-O3HBG5QK.js");
4972
+ const { startProjectionWorker } = await import("../projection-worker-YKKBNQZT.js");
4822
4973
  startProjectionWorker();
4823
4974
  } catch {
4824
4975
  }
@@ -4921,11 +5072,11 @@ try {
4921
5072
  process.stderr.write(`[exed] FATAL: ${err instanceof Error ? err.message : String(err)}
4922
5073
  `);
4923
5074
  try {
4924
- unlinkSync(SOCKET_PATH);
5075
+ unlinkSync2(SOCKET_PATH);
4925
5076
  } catch {
4926
5077
  }
4927
5078
  try {
4928
- unlinkSync(PID_PATH);
5079
+ unlinkSync2(PID_PATH);
4929
5080
  } catch {
4930
5081
  }
4931
5082
  process.exit(1);