@askexenow/exe-os 0.9.324 → 0.9.326

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 (293) hide show
  1. package/deploy/compose/docker-compose.yml +11 -3
  2. package/deploy/compose/observability/otel-collector-config.yaml +38 -10
  3. package/dist/{active-agent-IUVRZOSF.js → active-agent-3X5P2EOX.js} +3 -3
  4. package/dist/{active-agent-CVSB2EER.js → active-agent-NODPD3OF.js} +3 -3
  5. package/dist/{agentic-ontology-2QFPBIQP.js → agentic-ontology-DCFTNSZW.js} +1 -1
  6. package/dist/{anthropic-auth-NERIFVT5.js → anthropic-auth-EIGM3FAZ.js} +1 -1
  7. package/dist/{backfill-metadata-W3PRQPVV.js → backfill-metadata-CE35JGTX.js} +4 -4
  8. package/dist/{behaviors-MQCADHAD.js → behaviors-HZ6BIOGX.js} +5 -5
  9. package/dist/bin/agentic-ontology-backfill.js +5 -5
  10. package/dist/bin/agentic-reflection-backfill.js +6 -6
  11. package/dist/bin/agentic-semantic-label.js +5 -5
  12. package/dist/bin/backfill-conversations.js +5 -5
  13. package/dist/bin/backfill-responses.js +5 -5
  14. package/dist/bin/backfill-vectors.js +7 -7
  15. package/dist/bin/bulk-sync-postgres.js +11 -11
  16. package/dist/bin/cc-doctor.js +4 -4
  17. package/dist/bin/cleanup-stale-review-tasks.js +15 -15
  18. package/dist/bin/cli.js +16 -16
  19. package/dist/bin/deferred-daemon-restart.js +69 -69
  20. package/dist/bin/exe-agent-config.js +3 -3
  21. package/dist/bin/exe-agent.js +4 -4
  22. package/dist/bin/exe-assign.js +7 -7
  23. package/dist/bin/exe-boot.js +23 -23
  24. package/dist/bin/exe-call.js +4 -4
  25. package/dist/bin/exe-cloud.js +11 -11
  26. package/dist/bin/exe-config-dump.js +3 -3
  27. package/dist/bin/exe-dispatch.js +15 -15
  28. package/dist/bin/exe-doctor.js +5 -5
  29. package/dist/bin/exe-export-behaviors.js +7 -7
  30. package/dist/bin/exe-forget.js +6 -6
  31. package/dist/bin/exe-gateway.js +7 -7
  32. package/dist/bin/exe-healthcheck.js +4 -4
  33. package/dist/bin/exe-heartbeat.js +15 -15
  34. package/dist/bin/exe-kill.js +18 -18
  35. package/dist/bin/exe-launch-agent.js +24 -24
  36. package/dist/bin/exe-new-employee.js +8 -8
  37. package/dist/bin/exe-pending-messages.js +16 -16
  38. package/dist/bin/exe-pending-notifications.js +15 -15
  39. package/dist/bin/exe-pending-reviews.js +15 -15
  40. package/dist/bin/exe-rename.js +4 -4
  41. package/dist/bin/exe-review.js +17 -17
  42. package/dist/bin/exe-search.js +5 -5
  43. package/dist/bin/exe-session-cleanup.js +19 -19
  44. package/dist/bin/exe-settings.js +12 -12
  45. package/dist/bin/exe-start-codex.js +12 -12
  46. package/dist/bin/exe-start-opencode.js +8 -8
  47. package/dist/bin/exe-start.sh +13 -0
  48. package/dist/bin/exe-status.js +16 -16
  49. package/dist/bin/exe-support.js +3 -3
  50. package/dist/bin/exe-team.js +3 -3
  51. package/dist/bin/git-sweep.js +16 -16
  52. package/dist/bin/graph-backfill.js +4 -4
  53. package/dist/bin/graph-export.js +5 -5
  54. package/dist/bin/import-history.js +7 -7
  55. package/dist/bin/install.js +71 -71
  56. package/dist/bin/intercom-check.js +4 -4
  57. package/dist/bin/mcp-sessions.js +2 -2
  58. package/dist/bin/orchestration-metrics.js +4 -4
  59. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  60. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  61. package/dist/bin/registry-proxy.js +1 -1
  62. package/dist/bin/scan-tasks.js +15 -15
  63. package/dist/bin/setup.js +1 -1
  64. package/dist/bin/shard-migrate.js +4 -4
  65. package/dist/bin/stack-update.js +4 -4
  66. package/dist/bin/vps-health-gate.js +1 -1
  67. package/dist/{capability-cards-STD3NMCR.js → capability-cards-RRXD7KWE.js} +2 -2
  68. package/dist/{capacity-monitor-6O3PWYNM.js → capacity-monitor-HVWEYDCG.js} +16 -16
  69. package/dist/{catchup-brief-EDQ3VZCF.js → catchup-brief-YYEVWAZN.js} +18 -18
  70. package/dist/{chunk-GIFDGNIL.js → chunk-2233TQCA.js} +1 -1
  71. package/dist/{chunk-WF3J6GJZ.js → chunk-2G7MNOP2.js} +2 -2
  72. package/dist/{chunk-F2RK5YWB.js → chunk-3COTSHKH.js} +2 -2
  73. package/dist/{chunk-7M6TXYRQ.js → chunk-3EA2MF23.js} +11 -11
  74. package/dist/{chunk-MKIFYIXC.js → chunk-3NGQ35WZ.js} +1 -1
  75. package/dist/{chunk-ZRZ2Z6RZ.js → chunk-3QDSCJ3F.js} +1 -1
  76. package/dist/{chunk-PV7IG4V6.js → chunk-47PIQRBR.js} +1 -1
  77. package/dist/{chunk-HBKYKN3S.js → chunk-4AN2HICH.js} +1 -1
  78. package/dist/{chunk-WGHTISNK.js → chunk-4IVWTJDR.js} +3 -3
  79. package/dist/{chunk-AVKZIG4A.js → chunk-4J3CSEX7.js} +1 -1
  80. package/dist/{chunk-KWWHRJGG.js → chunk-4O7Y6WQX.js} +121 -116
  81. package/dist/{chunk-PROQW3NL.js → chunk-4TXRUGPA.js} +1 -1
  82. package/dist/{chunk-5YCOEPEX.js → chunk-4WAJZ2HV.js} +1 -1
  83. package/dist/{chunk-24WPWCD6.js → chunk-4YDFTZTH.js} +1 -1
  84. package/dist/{chunk-2YWUZPHE.js → chunk-5QYY6QIP.js} +2 -2
  85. package/dist/{chunk-HZ5J2GFE.js → chunk-6APWOKOT.js} +7 -7
  86. package/dist/{chunk-LWAGAC3H.js → chunk-6QTLUPXB.js} +1 -1
  87. package/dist/{chunk-CS6MYGNB.js → chunk-7A3E5ZWF.js} +3 -3
  88. package/dist/{chunk-SOXUF34Y.js → chunk-7D2YGQ7S.js} +2 -2
  89. package/dist/{chunk-BC7IIR3A.js → chunk-7TS64TBG.js} +32 -8
  90. package/dist/{chunk-5VT45EV6.js → chunk-7YWGURD6.js} +1 -1
  91. package/dist/{chunk-2QD5M47V.js → chunk-AKQJILJK.js} +3 -3
  92. package/dist/{chunk-MWIX3YKA.js → chunk-CF2PNIN2.js} +5 -5
  93. package/dist/{chunk-FROUDYRT.js → chunk-CUEOJO5W.js} +6 -1
  94. package/dist/{chunk-7PLMYXPG.js → chunk-DDONIN5J.js} +1 -1
  95. package/dist/{chunk-T3XHH5FE.js → chunk-E6TB5MMR.js} +5 -5
  96. package/dist/{chunk-TA3A4UQL.js → chunk-EZKZWSPO.js} +1 -1
  97. package/dist/{chunk-UAIMI7CK.js → chunk-F4PFF7ZI.js} +1 -1
  98. package/dist/{chunk-HAYDXMW6.js → chunk-F7DI6PDD.js} +3 -3
  99. package/dist/{chunk-NBDTQVWU.js → chunk-FDNYBZPT.js} +2 -2
  100. package/dist/{chunk-MB2YT5VQ.js → chunk-FKE5HFPR.js} +2 -2
  101. package/dist/{chunk-WJICX53Z.js → chunk-FL6KFQPT.js} +1 -1
  102. package/dist/{chunk-POOMY3CS.js → chunk-FYWV3S2F.js} +4 -4
  103. package/dist/{chunk-BB5IKY7B.js → chunk-GI6KCSTK.js} +2 -2
  104. package/dist/{chunk-QDI77B3E.js → chunk-H5SXFCU3.js} +1 -1
  105. package/dist/{chunk-KJOQLNX2.js → chunk-H6WYBKVG.js} +1 -1
  106. package/dist/{chunk-TGVKQ3QB.js → chunk-HAQUN74P.js} +3 -3
  107. package/dist/{chunk-FPTBCPI3.js → chunk-HO5VLDK4.js} +2 -2
  108. package/dist/{chunk-WGOAILWE.js → chunk-HP33PW3C.js} +2 -2
  109. package/dist/{chunk-MCEXBLLK.js → chunk-I5YP6SUP.js} +2 -2
  110. package/dist/{chunk-SPO2RLOB.js → chunk-IPQST5LI.js} +1 -1
  111. package/dist/{chunk-2E2NKFXK.js → chunk-JOSFV63U.js} +1 -1
  112. package/dist/{chunk-VDUHWQFA.js → chunk-K5A4TXTO.js} +1 -1
  113. package/dist/{chunk-JRD7ARQ6.js → chunk-KG77M4XU.js} +1 -1
  114. package/dist/{chunk-QQFZ32WS.js → chunk-KYWTZG2U.js} +5 -5
  115. package/dist/{chunk-W5GBB23I.js → chunk-L7NKIZCZ.js} +1 -1
  116. package/dist/{chunk-6FWMLTF2.js → chunk-LBG3TRZX.js} +1 -1
  117. package/dist/{chunk-2ZW4AQ24.js → chunk-LFRFAGV2.js} +3 -3
  118. package/dist/{chunk-KUJGADX6.js → chunk-MDMYOY6A.js} +14 -14
  119. package/dist/{chunk-AEFZEJKW.js → chunk-MMGYRA3H.js} +1 -1
  120. package/dist/{chunk-ZDNJ3TSB.js → chunk-MPF33E6Q.js} +7 -7
  121. package/dist/{chunk-PGFYWVOB.js → chunk-NUVHBQM3.js} +1 -1
  122. package/dist/{chunk-DYUISOIT.js → chunk-O4FGIGAS.js} +1 -1
  123. package/dist/{chunk-NGACCR2M.js → chunk-O67EESEG.js} +1 -1
  124. package/dist/{chunk-YBHOWK3L.js → chunk-OA4TVN4Q.js} +1 -1
  125. package/dist/{chunk-MIWPKWXQ.js → chunk-OIMLWXQU.js} +1 -1
  126. package/dist/{chunk-CSPHV5DJ.js → chunk-OVHMZ2MP.js} +1 -1
  127. package/dist/{chunk-UYOW7U24.js → chunk-POAG6MGC.js} +1 -1
  128. package/dist/{chunk-ID3V4BWS.js → chunk-PQ5Y34JU.js} +1 -1
  129. package/dist/{chunk-6XAAJ5OV.js → chunk-QITLEPNC.js} +1 -1
  130. package/dist/{chunk-BMSAJ2IH.js → chunk-QOQZFY5L.js} +1 -1
  131. package/dist/{chunk-PJTEZLAM.js → chunk-RDCJGYZW.js} +1 -1
  132. package/dist/{chunk-KK67DSCO.js → chunk-RULJKRL7.js} +144 -25
  133. package/dist/{chunk-V4VYIHSL.js → chunk-RXMYEWEC.js} +1 -1
  134. package/dist/{chunk-376J36IW.js → chunk-SG6N2YPV.js} +4 -4
  135. package/dist/{chunk-F6TJIWN5.js → chunk-UGNYF33S.js} +1 -1
  136. package/dist/{chunk-LUOQCGBO.js → chunk-UVVUWXTS.js} +1 -1
  137. package/dist/{chunk-KLDQFOFY.js → chunk-V4HBRYKM.js} +9 -9
  138. package/dist/{chunk-UXYQLOFW.js → chunk-VCQNILOK.js} +9 -9
  139. package/dist/{chunk-Y34FDPOY.js → chunk-VDHLCILZ.js} +5 -5
  140. package/dist/{chunk-C7B44DJI.js → chunk-W7DHFGCB.js} +1 -1
  141. package/dist/{chunk-PGUISLOT.js → chunk-WA6X7HFB.js} +2 -2
  142. package/dist/{chunk-Y2KBHLEO.js → chunk-WN5XF24Y.js} +1 -1
  143. package/dist/{chunk-BDJQWBWF.js → chunk-YUFM7I7D.js} +3 -3
  144. package/dist/{chunk-TNS6U2K7.js → chunk-ZDPQTWYD.js} +3 -3
  145. package/dist/{chunk-2NY7LZT7.js → chunk-ZMVYTOFT.js} +1 -1
  146. package/dist/{chunk-EWDTTTZP.js → chunk-ZOMG6FSE.js} +3 -3
  147. package/dist/{chunk-QGOMYIVT.js → chunk-ZZOW4BPC.js} +37 -4
  148. package/dist/{cleanup-graph-garbage-2YH52ADR.js → cleanup-graph-garbage-IGWP3WQY.js} +4 -4
  149. package/dist/{co-activation-7F3J2GC7.js → co-activation-357CXYXJ.js} +2 -2
  150. package/dist/{co-occurrence-B36Q5GY3.js → co-occurrence-WQFRS27F.js} +2 -2
  151. package/dist/{code-context-index-2PUBBQOE.js → code-context-index-EXXDY3QZ.js} +2 -2
  152. package/dist/{crdt-sync-MXHPR6V6.js → crdt-sync-32I7C3HE.js} +1 -1
  153. package/dist/{crm-webhook-56MWGMRY.js → crm-webhook-QSZYCR6W.js} +2 -2
  154. package/dist/{cto-delegation-gate-26BD7NEE.js → cto-delegation-gate-7WG3YIKI.js} +14 -14
  155. package/dist/{daemon-orchestration-IBP6PWEG.js → daemon-orchestration-TPZS2O7J.js} +18 -18
  156. package/dist/{db-backup-XLID57KW.js → db-backup-6LI4KWSP.js} +1 -1
  157. package/dist/{doc-graph-extractor-VBZ6XTTE.js → doc-graph-extractor-2MWOZKO7.js} +2 -2
  158. package/dist/{documents-C5LYSJT3.js → documents-HTJ5JWXT.js} +7 -7
  159. package/dist/{dreaming-LMVDIC5C.js → dreaming-Q3C57VM7.js} +15 -15
  160. package/dist/{exe-drift-T3K6WA47.js → exe-drift-4MASZVJF.js} +3 -3
  161. package/dist/{exe-export-QCTASWXI.js → exe-export-OEXUIYKT.js} +6 -6
  162. package/dist/{exe-import-WNP5A7VA.js → exe-import-GEBZ6BIU.js} +6 -6
  163. package/dist/{exe-key-JM3JXE2E.js → exe-key-HUYZOUI6.js} +69 -69
  164. package/dist/{exe-snapshot-ODDJUEM5.js → exe-snapshot-PZ2IFXI6.js} +18 -18
  165. package/dist/{fast-db-init-O6A3TK3F.js → fast-db-init-RQLJQFJG.js} +1 -1
  166. package/dist/{founder-context-FYTF4IMD.js → founder-context-RG5ZZYHR.js} +2 -2
  167. package/dist/gateway/index.js +8 -8
  168. package/dist/{git-staleness-YA5J6VYJ.js → git-staleness-THM2F3VG.js} +2 -2
  169. package/dist/{global-procedures-76NDWTYN.js → global-procedures-TKVCAUEW.js} +3 -3
  170. package/dist/{graph-auto-extract-I7QL2TY5.js → graph-auto-extract-SKWJTW5T.js} +2 -2
  171. package/dist/hooks/bug-report-worker.js +17 -17
  172. package/dist/hooks/codex-stop-task-finalizer.js +17 -17
  173. package/dist/hooks/commit-complete.js +17 -17
  174. package/dist/hooks/error-recall.js +6 -6
  175. package/dist/hooks/exe-heartbeat-hook.js +3 -3
  176. package/dist/hooks/ingest-worker.js +2 -2
  177. package/dist/hooks/ingest.js +6 -6
  178. package/dist/hooks/instructions-loaded.js +4 -4
  179. package/dist/hooks/manifest.json +20 -20
  180. package/dist/hooks/notification.js +4 -4
  181. package/dist/hooks/post-compact.js +16 -16
  182. package/dist/hooks/post-tool-combined.js +8 -8
  183. package/dist/hooks/pre-compact.js +17 -17
  184. package/dist/hooks/pre-tool-use.js +20 -20
  185. package/dist/hooks/prompt-submit.js +62 -38
  186. package/dist/hooks/session-end.js +22 -22
  187. package/dist/hooks/session-start.js +12 -12
  188. package/dist/hooks/stop.js +23 -23
  189. package/dist/hooks/subagent-stop.js +16 -16
  190. package/dist/hooks/summary-worker.js +20 -20
  191. package/dist/index.js +24 -24
  192. package/dist/{installer-3EYHBKWB.js → installer-5WLOKQH5.js} +5 -5
  193. package/dist/{installer-3VZMDDMJ.js → installer-Q6VP6AV2.js} +5 -5
  194. package/dist/{installer-GYABVCB7.js → installer-W2XVWWHU.js} +5 -5
  195. package/dist/{intercom-queue-ZCNT4LYU.js → intercom-queue-4B2S5UR5.js} +14 -14
  196. package/dist/lib/agent-config.js +3 -1
  197. package/dist/lib/cloud-sync.js +11 -11
  198. package/dist/lib/consolidation.js +6 -6
  199. package/dist/lib/database.js +2 -2
  200. package/dist/lib/db-daemon-client.js +2 -2
  201. package/dist/lib/db.js +2 -2
  202. package/dist/lib/device-registry.js +1 -1
  203. package/dist/lib/embedder.js +2 -2
  204. package/dist/lib/employee-templates.js +4 -4
  205. package/dist/lib/employees.js +2 -2
  206. package/dist/lib/exe-daemon-client.js +3 -1
  207. package/dist/lib/exe-daemon.js +85 -53
  208. package/dist/lib/hybrid-search.js +5 -5
  209. package/dist/lib/identity.js +2 -2
  210. package/dist/lib/license.js +2 -2
  211. package/dist/lib/messaging.js +15 -15
  212. package/dist/lib/registry-proxy.js +1 -1
  213. package/dist/lib/reminders.js +3 -3
  214. package/dist/lib/schedules.js +5 -5
  215. package/dist/lib/session-registry.js +4 -4
  216. package/dist/lib/skill-learning.js +6 -6
  217. package/dist/lib/store.js +4 -4
  218. package/dist/lib/task-router.js +3 -3
  219. package/dist/lib/tasks.js +16 -16
  220. package/dist/lib/tmux-routing.js +14 -14
  221. package/dist/lib/token-spend.js +3 -3
  222. package/dist/{license-gate-73XGUIVP.js → license-gate-4RLANPDC.js} +3 -3
  223. package/dist/{license-sync-CG5YRUVH.js → license-sync-ZD2WNKYK.js} +2 -2
  224. package/dist/mcp/register-tools.js +68 -68
  225. package/dist/mcp/server.js +69 -69
  226. package/dist/mcp/tools/complete-reminder.js +4 -4
  227. package/dist/mcp/tools/create-reminder.js +4 -4
  228. package/dist/mcp/tools/create-task.js +18 -18
  229. package/dist/mcp/tools/deactivate-behavior.js +7 -7
  230. package/dist/mcp/tools/list-reminders.js +4 -4
  231. package/dist/mcp/tools/list-tasks.js +18 -18
  232. package/dist/mcp/tools/send-message.js +17 -17
  233. package/dist/mcp/tools/update-task.js +17 -17
  234. package/dist/{mcp-http-config-TT7PXZLX.js → mcp-http-config-G27T6LND.js} +3 -3
  235. package/dist/{memory-cards-6NGUDUDN.js → memory-cards-NCNSZRNK.js} +4 -4
  236. package/dist/{memory-graph-extractor-FIMS3VQR.js → memory-graph-extractor-SXGYC7ST.js} +3 -3
  237. package/dist/{memory-poisoning-defense-M3LOQ3XU.js → memory-poisoning-defense-WCJFO4PM.js} +2 -2
  238. package/dist/{memory-pressure-watchdog-45GABDWH.js → memory-pressure-watchdog-UX4XMMP6.js} +15 -15
  239. package/dist/{memory-queue-client-BDYKFNB4.js → memory-queue-client-BKQHTYTH.js} +2 -2
  240. package/dist/{memory-reflection-LANCFYK2.js → memory-reflection-H2DEL3PT.js} +2 -2
  241. package/dist/{notifications-N5NKUYAU.js → notifications-O2GZIMSH.js} +14 -14
  242. package/dist/{orchestration-events-KVNRNIPR.js → orchestration-events-KWHUIABU.js} +3 -3
  243. package/dist/{orchestrator-VTF5BR26.js → orchestrator-5JIQZQ5G.js} +16 -16
  244. package/dist/{pipeline-router-KQAYWDPH.js → pipeline-router-JMKG24IL.js} +3 -3
  245. package/dist/{plan-limits-EUZI4X5W.js → plan-limits-3UIKKVOA.js} +5 -5
  246. package/dist/{projection-worker-FG6G226D.js → projection-worker-UCMUBSR3.js} +2 -2
  247. package/dist/{prospective-memory-FVDNUSIL.js → prospective-memory-YA3C2TU4.js} +2 -2
  248. package/dist/{reranker-54Q3L32E.js → reranker-NDRQJ3W6.js} +1 -1
  249. package/dist/{retrieval-health-YJ7CXYVD.js → retrieval-health-RWWVBLYS.js} +2 -2
  250. package/dist/{review-polling-TKXYSXH6.js → review-polling-3XGQGAZT.js} +15 -15
  251. package/dist/runtime/index.js +18 -18
  252. package/dist/{self-query-router-S3NVLRQH.js → self-query-router-EJ3ZWUOK.js} +1 -1
  253. package/dist/{session-events-WQHTP65R.js → session-events-RYV6U25T.js} +15 -15
  254. package/dist/{session-kill-telemetry-2HSE7IGH.js → session-kill-telemetry-PDV5AT74.js} +15 -15
  255. package/dist/{session-scope-RBKAC75W.js → session-scope-EWPUHO7C.js} +14 -14
  256. package/dist/{setup-wizard-AA6ZV57H.js → setup-wizard-ZZUNU3YM.js} +1 -1
  257. package/dist/{skill-refinement-QI35LMTZ.js → skill-refinement-TU54OAT7.js} +3 -3
  258. package/dist/{stack-update-BE6PX4AG.js → stack-update-GZASYAHK.js} +3 -3
  259. package/dist/{steward-gate-2XD5BXH6.js → steward-gate-SLQKHB2I.js} +3 -3
  260. package/dist/{task-enforcement-DMOCBRLB.js → task-enforcement-BIOCLX7K.js} +19 -16
  261. package/dist/{task-scope-ULBNFBFH.js → task-scope-SUWJ7NLW.js} +14 -14
  262. package/dist/{tasks-crud-6SJOKES5.js → tasks-crud-ZFTYVPD3.js} +14 -14
  263. package/dist/{tasks-notify-TESRABUM.js → tasks-notify-VXHGONXH.js} +15 -15
  264. package/dist/{tasks-review-INDAGLWJ.js → tasks-review-MUHMWDLT.js} +14 -14
  265. package/dist/{telemetry-upload-6XB3Q3IH.js → telemetry-upload-4NCZC5IX.js} +7 -7
  266. package/dist/{token-budget-NOF27AZC.js → token-budget-RBZW4K6X.js} +3 -3
  267. package/dist/{tool-capability-index-EFBBPTBI.js → tool-capability-index-Q6YQDL7I.js} +1 -1
  268. package/dist/{tool-telemetry-OEK6KQFF.js → tool-telemetry-ZMQW4H3X.js} +1 -1
  269. package/dist/tui/App.js +22 -22
  270. package/dist/{tui-data-EG6LEZFF.js → tui-data-235ICHCM.js} +14 -14
  271. package/dist/{worker-gate-YA35VMAN.js → worker-gate-CEVF4IZZ.js} +1 -1
  272. package/dist/{workflow-engine-3AVKRE5I.js → workflow-engine-AGYTVD5E.js} +2 -2
  273. package/dist/{worktree-72QYYL5L.js → worktree-B6YQISX7.js} +4 -4
  274. package/dist/{worktree-sweep-GDISKGQ2.js → worktree-sweep-SEYVSPLG.js} +5 -5
  275. package/package.json +1 -1
  276. package/release-notes.json +35 -17
  277. /package/dist/{chunk-RXS2LBKE.js → chunk-2GP3SFJT.js} +0 -0
  278. /package/dist/{chunk-IHRXCNSC.js → chunk-2YT2BR4Y.js} +0 -0
  279. /package/dist/{chunk-UBYAKNRF.js → chunk-BNCE4226.js} +0 -0
  280. /package/dist/{chunk-TSYMWC53.js → chunk-IWZHYCNV.js} +0 -0
  281. /package/dist/{chunk-EWKZKO7F.js → chunk-M6EPHA2V.js} +0 -0
  282. /package/dist/{chunk-7577GDDG.js → chunk-NKRGMHSS.js} +0 -0
  283. /package/dist/{chunk-QMUSJESS.js → chunk-O5JGX347.js} +0 -0
  284. /package/dist/{chunk-NIB2N6L2.js → chunk-QGJAR4HP.js} +0 -0
  285. /package/dist/{chunk-H43BPGIV.js → chunk-SYTYSN4J.js} +0 -0
  286. /package/dist/{chunk-SNFYZFXY.js → chunk-WHRTDN5J.js} +0 -0
  287. /package/dist/{chunk-4O3N7I5Z.js → chunk-XFMHIDL4.js} +0 -0
  288. /package/dist/{core-memory-NKKP2XUB.js → core-memory-3PQC5CJG.js} +0 -0
  289. /package/dist/{entity-boost-DRIUFTYB.js → entity-boost-DNI4A5I7.js} +0 -0
  290. /package/dist/{message-queue-client-4ERC7HLX.js → message-queue-client-Q5BW3O5W.js} +0 -0
  291. /package/dist/{oauth-server-PECJREY2.js → oauth-server-NJGMHCVI.js} +0 -0
  292. /package/dist/{project-boot-SFKP2MFW.js → project-boot-4YC2FS3X.js} +0 -0
  293. /package/dist/{wiki-acl-QIBDNXSM.js → wiki-acl-CQNO6YSC.js} +0 -0
@@ -119,7 +119,7 @@ function releaseBackfillLock() {
119
119
  }
120
120
  async function getTaskAwareCapacity() {
121
121
  const { getClient } = await import("./lib/database.js");
122
- const { sessionScopeFilter } = await import("./task-scope-ULBNFBFH.js");
122
+ const { sessionScopeFilter } = await import("./task-scope-SUWJ7NLW.js");
123
123
  const client = getClient();
124
124
  const scope = sessionScopeFilter();
125
125
  const result = await client.execute({
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  extractMemoryGraph
3
- } from "./chunk-WGOAILWE.js";
3
+ } from "./chunk-HP33PW3C.js";
4
4
  import {
5
5
  flushBatch,
6
6
  writeMemory
7
- } from "./chunk-KLDQFOFY.js";
7
+ } from "./chunk-V4HBRYKM.js";
8
8
  import {
9
9
  extractKeywords
10
10
  } from "./chunk-CHCA3ZM2.js";
11
11
  import {
12
12
  getActiveAgent
13
- } from "./chunk-ID3V4BWS.js";
13
+ } from "./chunk-PQ5Y34JU.js";
14
14
 
15
15
  // src/mcp/tools/import-conversations.ts
16
16
  import { z } from "zod";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  ensureAgentSymlink
3
- } from "./chunk-7PLMYXPG.js";
3
+ } from "./chunk-DDONIN5J.js";
4
4
  import {
5
5
  ensureWorktree,
6
6
  getGitRoot,
7
7
  isWorktreeDirty
8
- } from "./chunk-KJOQLNX2.js";
8
+ } from "./chunk-H6WYBKVG.js";
9
9
  import {
10
10
  incrementSkillSuccess
11
- } from "./chunk-Y2KBHLEO.js";
11
+ } from "./chunk-WN5XF24Y.js";
12
12
  import {
13
13
  reviewSignalPath,
14
14
  taskSignalDir
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  listSessions,
26
26
  registerSession
27
- } from "./chunk-JRD7ARQ6.js";
27
+ } from "./chunk-KG77M4XU.js";
28
28
  import {
29
29
  listTmuxSessions
30
30
  } from "./chunk-SSTLTIF3.js";
@@ -33,26 +33,26 @@ import {
33
33
  } from "./chunk-RMOBQ6A5.js";
34
34
  import {
35
35
  recordOrchestrationEventBestEffort
36
- } from "./chunk-F6TJIWN5.js";
36
+ } from "./chunk-UGNYF33S.js";
37
37
  import {
38
38
  assertRuntimeModelCompatible,
39
39
  getAgentRuntime,
40
40
  normalizeCcModelName,
41
41
  resolveSpawnRuntimeConfig
42
- } from "./chunk-FROUDYRT.js";
42
+ } from "./chunk-CUEOJO5W.js";
43
43
  import {
44
44
  RUNTIME_TABLE
45
45
  } from "./chunk-NGP6LSV2.js";
46
46
  import {
47
47
  PlanLimitError,
48
48
  assertEmployeeLimitSync
49
- } from "./chunk-BB5IKY7B.js";
49
+ } from "./chunk-GI6KCSTK.js";
50
50
  import {
51
51
  getSessionKey
52
52
  } from "./chunk-CVYC6DUW.js";
53
53
  import {
54
54
  writeMemoryViaDaemon
55
- } from "./chunk-GIFDGNIL.js";
55
+ } from "./chunk-2233TQCA.js";
56
56
  import {
57
57
  getProjectName
58
58
  } from "./chunk-OPU3NYOO.js";
@@ -74,10 +74,10 @@ import {
74
74
  loadEmployees,
75
75
  loadEmployeesSync,
76
76
  offloadReadIfMain
77
- } from "./chunk-QGOMYIVT.js";
77
+ } from "./chunk-ZZOW4BPC.js";
78
78
  import {
79
79
  loadDeviceId
80
- } from "./chunk-BMSAJ2IH.js";
80
+ } from "./chunk-QOQZFY5L.js";
81
81
  import {
82
82
  EXE_AI_DIR
83
83
  } from "./chunk-7Y5UDEVM.js";
@@ -1219,7 +1219,7 @@ async function createTaskCore(input) {
1219
1219
  if (isCoordinatorSession) {
1220
1220
  earlySessionScope = resolved;
1221
1221
  } else {
1222
- const { getSessionProject } = await import("./session-scope-RBKAC75W.js");
1222
+ const { getSessionProject } = await import("./session-scope-EWPUHO7C.js");
1223
1223
  const sessionProject = getSessionProject(resolved);
1224
1224
  if (sessionProject && sessionProject !== input.projectName) {
1225
1225
  scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
@@ -1468,7 +1468,7 @@ async function queryTaskRows(opts) {
1468
1468
  }
1469
1469
  if (opts.founderId !== null) {
1470
1470
  try {
1471
- const { founderScopeFilter } = await import("./founder-context-FYTF4IMD.js");
1471
+ const { founderScopeFilter } = await import("./founder-context-RG5ZZYHR.js");
1472
1472
  const founderFilter = founderScopeFilter(opts.founderId);
1473
1473
  const cleaned = founderFilter.sql.replace(/^\s*AND\s+/, "");
1474
1474
  conditions.push(cleaned);
@@ -3934,7 +3934,7 @@ async function verifyPaneAtCapacity(sessionName) {
3934
3934
  reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
3935
3935
  };
3936
3936
  }
3937
- const { isAtCapacity } = await import("./capacity-monitor-6O3PWYNM.js");
3937
+ const { isAtCapacity } = await import("./capacity-monitor-HVWEYDCG.js");
3938
3938
  if (!isAtCapacity(pane)) {
3939
3939
  return {
3940
3940
  atCapacity: false,
@@ -4297,7 +4297,7 @@ function scheduleDeferredSpawnNudge(input) {
4297
4297
  return;
4298
4298
  }
4299
4299
  queueIntercom(input.sessionName, `spawn nudge failed after ${attempt} attempts: ${msg}`, "signal");
4300
- void import("./notifications-N5NKUYAU.js").then(({ writeNotification: writeNotification2 }) => writeNotification2({
4300
+ void import("./notifications-O2GZIMSH.js").then(({ writeNotification: writeNotification2 }) => writeNotification2({
4301
4301
  agentId: getCoordinatorName(),
4302
4302
  agentRole: "COO",
4303
4303
  event: "error_spike",
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-WCGNCH3Q.js";
4
4
  import {
5
5
  registerAllTools
6
- } from "./chunk-KWWHRJGG.js";
6
+ } from "./chunk-4O7Y6WQX.js";
7
7
 
8
8
  // src/mcp/mcp-surface-hash.ts
9
9
  function computeMcpSurfaceHash() {
@@ -2,7 +2,7 @@ import {
2
2
  dispatchTaskToEmployee,
3
3
  markTaskNotificationsRead,
4
4
  notifyTaskDone
5
- } from "./chunk-MWIX3YKA.js";
5
+ } from "./chunk-CF2PNIN2.js";
6
6
  import {
7
7
  cleanupReviewFile,
8
8
  createTaskCore,
@@ -11,7 +11,7 @@ import {
11
11
  sessionScopeFilter,
12
12
  updateTaskStatus,
13
13
  writeNotification
14
- } from "./chunk-KUJGADX6.js";
14
+ } from "./chunk-MDMYOY6A.js";
15
15
  import {
16
16
  orgBus
17
17
  } from "./chunk-MP2AFCGL.js";
@@ -19,7 +19,7 @@ import {
19
19
  getClient,
20
20
  getCoordinatorName,
21
21
  isCoordinatorName
22
- } from "./chunk-QGOMYIVT.js";
22
+ } from "./chunk-ZZOW4BPC.js";
23
23
  import {
24
24
  EXE_AI_DIR
25
25
  } from "./chunk-7Y5UDEVM.js";
@@ -61,7 +61,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
61
61
  }
62
62
  if (unblockedRows.rows.length > 0 && !process.env.VITEST) {
63
63
  try {
64
- const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-TESRABUM.js");
64
+ const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-VXHGONXH.js");
65
65
  const dispatched = /* @__PURE__ */ new Set();
66
66
  for (const ur of unblockedRows.rows) {
67
67
  const assignee = String(ur.assigned_to);
@@ -86,7 +86,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
86
86
  }
87
87
  } catch {
88
88
  try {
89
- const { queueIntercom } = await import("./intercom-queue-ZCNT4LYU.js");
89
+ const { queueIntercom } = await import("./intercom-queue-4B2S5UR5.js");
90
90
  const dispatched = /* @__PURE__ */ new Set();
91
91
  for (const ur of unblockedRows.rows) {
92
92
  const assignee = String(ur.assigned_to);
@@ -289,7 +289,7 @@ async function updateTask(input) {
289
289
  try {
290
290
  process.stderr.write(`[tasks] EVENT: tmux delivery failed for reviewer="${reviewer}". Queueing for daemon delivery.
291
291
  `);
292
- const { queueIntercom } = await import("./intercom-queue-ZCNT4LYU.js");
292
+ const { queueIntercom } = await import("./intercom-queue-4B2S5UR5.js");
293
293
  const { resolveExeSession } = await import("./lib/tmux-routing.js");
294
294
  const exeSession = row.session_scope ? String(row.session_scope) : resolveExeSession();
295
295
  if (exeSession) {
@@ -333,7 +333,7 @@ async function updateTask(input) {
333
333
  await markTaskNotificationsRead(taskFile);
334
334
  if (isCompletionReviewTransition && !isCoordinator && row.reviewer) {
335
335
  try {
336
- const { writeNotification: writeNotification2 } = await import("./notifications-N5NKUYAU.js");
336
+ const { writeNotification: writeNotification2 } = await import("./notifications-O2GZIMSH.js");
337
337
  const reviewer = String(row.reviewer);
338
338
  await writeNotification2({
339
339
  agentId: reviewer,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeMemoryViaDaemon
3
- } from "./chunk-GIFDGNIL.js";
3
+ } from "./chunk-2233TQCA.js";
4
4
 
5
5
  // src/lib/auto-checkpoint.ts
6
6
  var FILE_RE = /(?:^|\s)([\w./-]+\.(?:ts|tsx|js|jsx|json|md|yml|yaml|sql|go|py|css|scss|html|sh))(?:\b|$)/g;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeAction,
3
3
  substituteTemplate
4
- } from "./chunk-4O3N7I5Z.js";
4
+ } from "./chunk-XFMHIDL4.js";
5
5
 
6
6
  // src/automation/workflow-engine.ts
7
7
  import { randomUUID } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadLicense
3
- } from "./chunk-BMSAJ2IH.js";
3
+ } from "./chunk-QOQZFY5L.js";
4
4
 
5
5
  // src/lib/stack-update.ts
6
6
  import { execFileSync, spawnSync } from "child_process";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-A47MXY2I.js";
5
5
  import {
6
6
  getClient
7
- } from "./chunk-QGOMYIVT.js";
7
+ } from "./chunk-ZZOW4BPC.js";
8
8
 
9
9
  // src/lib/global-procedures.ts
10
10
  import { randomUUID } from "crypto";
@@ -263,7 +263,7 @@ async function runRegistryProxy(options = registryProxyOptionsFromEnv()) {
263
263
  await new Promise((resolve) => server.listen(options.port, options.host, resolve));
264
264
  console.log(`exe-registry-proxy listening on ${options.host ?? "0.0.0.0"}:${options.port}`);
265
265
  console.log(`proxying /v2/${options.allowedNamespace ?? "askexe"}/* -> ${options.upstream ?? "https://ghcr.io"}`);
266
- const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-CG5YRUVH.js");
266
+ const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-ZD2WNKYK.js");
267
267
  const syncConfig = licenseSyncConfigFromEnv();
268
268
  if (syncConfig) {
269
269
  startLicenseSyncScheduler(syncConfig);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getIdentity,
3
3
  loadEmployeesSync
4
- } from "./chunk-QGOMYIVT.js";
4
+ } from "./chunk-ZZOW4BPC.js";
5
5
 
6
6
  // src/lib/drift-probes.ts
7
7
  var DRIFT_THRESHOLD = 80;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getGitRoot,
3
3
  isWorktreeDirty
4
- } from "./chunk-KJOQLNX2.js";
4
+ } from "./chunk-H6WYBKVG.js";
5
5
 
6
6
  // src/lib/worktree-sweep.ts
7
7
  import { execFileSync } from "child_process";
@@ -9,7 +9,7 @@ import {
9
9
  getCoordinatorEmployee,
10
10
  getEmployee,
11
11
  loadEmployeesSync
12
- } from "./chunk-QGOMYIVT.js";
12
+ } from "./chunk-ZZOW4BPC.js";
13
13
  import {
14
14
  EXE_AI_DIR
15
15
  } from "./chunk-7Y5UDEVM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeReminder
3
- } from "./chunk-W5GBB23I.js";
3
+ } from "./chunk-L7NKIZCZ.js";
4
4
 
5
5
  // src/mcp/tools/complete-reminder.ts
6
6
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDeviceInfo
3
- } from "./chunk-IHRXCNSC.js";
3
+ } from "./chunk-2YT2BR4Y.js";
4
4
  import {
5
5
  EXE_AI_DIR
6
6
  } from "./chunk-7Y5UDEVM.js";
@@ -212,7 +212,7 @@ async function main(args) {
212
212
  console.log("[health-gate] Starting rollback...");
213
213
  restorePreDeployBackup();
214
214
  try {
215
- const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-BE6PX4AG.js");
215
+ const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-GZASYAHK.js");
216
216
  const paths = defaultStackPaths();
217
217
  await rollbackStackUpdate({
218
218
  manifestRef: paths.manifestRef,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  recordSessionKill
3
- } from "./chunk-EWDTTTZP.js";
3
+ } from "./chunk-ZOMG6FSE.js";
4
4
  import {
5
5
  updateTask
6
- } from "./chunk-ZDNJ3TSB.js";
6
+ } from "./chunk-MPF33E6Q.js";
7
7
  import {
8
8
  countPendingReviews,
9
9
  ensureEmployeeAsync,
@@ -16,13 +16,13 @@ import {
16
16
  sessionScopeFilter,
17
17
  strictSessionScopeFilter,
18
18
  writeNotification
19
- } from "./chunk-KUJGADX6.js";
19
+ } from "./chunk-MDMYOY6A.js";
20
20
  import {
21
21
  isLeaseExpired
22
22
  } from "./chunk-E23LNUWJ.js";
23
23
  import {
24
24
  listSessions
25
- } from "./chunk-JRD7ARQ6.js";
25
+ } from "./chunk-KG77M4XU.js";
26
26
  import {
27
27
  listTmuxSessions,
28
28
  parseContextPercentage
@@ -32,16 +32,16 @@ import {
32
32
  } from "./chunk-RMOBQ6A5.js";
33
33
  import {
34
34
  recordOrchestrationEventBestEffort
35
- } from "./chunk-F6TJIWN5.js";
35
+ } from "./chunk-UGNYF33S.js";
36
36
  import {
37
37
  getAgentRuntime
38
- } from "./chunk-FROUDYRT.js";
38
+ } from "./chunk-CUEOJO5W.js";
39
39
  import {
40
40
  baseAgentName,
41
41
  getCoordinatorName,
42
42
  isCoordinatorName,
43
43
  shouldAutoInstance
44
- } from "./chunk-QGOMYIVT.js";
44
+ } from "./chunk-ZZOW4BPC.js";
45
45
  import {
46
46
  loadConfigSync
47
47
  } from "./chunk-7Y5UDEVM.js";
@@ -846,6 +846,26 @@ function shouldAutoWake(input) {
846
846
  if (running >= pending) return false;
847
847
  return true;
848
848
  }
849
+ function isPlausibleAutoWakeAgentId(agentId) {
850
+ const trimmed = agentId.trim();
851
+ if (!trimmed || trimmed.length > 64) return false;
852
+ if (/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(trimmed)) return false;
853
+ if (/^[0-9a-f]{7,12}$/i.test(trimmed)) return false;
854
+ return /^[a-z][a-z0-9_-]*$/i.test(trimmed);
855
+ }
856
+ function uniqueCoordinatorForProject(coordinatorSessions, registry, taskProject) {
857
+ if (!taskProject) return null;
858
+ const matches = coordinatorSessions.filter((cs) => {
859
+ const entry = registry.find((r) => r.windowName === cs);
860
+ return Boolean(entry?.projectDir) && basename(entry.projectDir) === taskProject;
861
+ });
862
+ return matches.length === 1 ? matches[0] : null;
863
+ }
864
+ function registryCanDisambiguateLiveCoordinators(coordinatorSessions, registry) {
865
+ if (coordinatorSessions.length === 0) return true;
866
+ const registered = new Set(registry.map((r) => r.windowName));
867
+ return coordinatorSessions.every((cs) => registered.has(cs));
868
+ }
849
869
  async function pollOrphanedTasks(deps, nowMs = Date.now()) {
850
870
  const checkGate = deps.checkGate ?? checkAutoWakeGates;
851
871
  const globalGate = checkGate("__global__", nowMs);
@@ -883,16 +903,58 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
883
903
  const VALID_SESSION_SCOPE = /^[a-zA-Z0-9_]+$/;
884
904
  const agentTasks = /* @__PURE__ */ new Map();
885
905
  let deadScopeStateDirty = false;
906
+ let registryForResolution = [];
907
+ let registryResolutionAttempted = false;
908
+ const getRegistryForResolution = () => {
909
+ if (!registryResolutionAttempted) {
910
+ registryResolutionAttempted = true;
911
+ try {
912
+ registryForResolution = deps.listRegisteredSessions?.() ?? [];
913
+ } catch {
914
+ registryForResolution = [];
915
+ }
916
+ }
917
+ return registryForResolution;
918
+ };
886
919
  for (const t of tasksByAgent) {
920
+ if (!isPlausibleAutoWakeAgentId(t.agentId) || isCoordinatorName(t.agentId)) {
921
+ process.stderr.write(
922
+ `[auto-wake] Skipping task ${t.taskId} \u2014 invalid/non-employee assigned_to "${String(t.agentId).slice(0, 80)}"
923
+ `
924
+ );
925
+ continue;
926
+ }
887
927
  const rawScope = t.sessionScope;
928
+ const taskProject = t.projectName ?? null;
888
929
  if (rawScope && !VALID_SESSION_SCOPE.test(rawScope)) {
889
930
  process.stderr.write(
890
- `[auto-wake] IGNORING corrupted session_scope for ${t.agentId} task ${t.taskId}: "${rawScope.slice(0, 60)}"
931
+ `[auto-wake] REPAIRING corrupted session_scope for ${t.agentId} task ${t.taskId}: "${rawScope.slice(0, 60)}"
891
932
  `
892
933
  );
893
- t.sessionScope = null;
934
+ const match = deps.reparentTask ? uniqueCoordinatorForProject(coordinatorSessions, getRegistryForResolution(), taskProject) : null;
935
+ if (match) {
936
+ try {
937
+ await deps.reparentTask(t.taskId, match);
938
+ t.sessionScope = match;
939
+ } catch {
940
+ t.sessionScope = null;
941
+ }
942
+ } else {
943
+ t.sessionScope = null;
944
+ }
894
945
  }
895
946
  let scope = t.sessionScope;
947
+ if (!scope) {
948
+ const match = deps.reparentTask ? uniqueCoordinatorForProject(coordinatorSessions, getRegistryForResolution(), taskProject) : null;
949
+ if (match) {
950
+ try {
951
+ await deps.reparentTask(t.taskId, match);
952
+ scope = match;
953
+ t.sessionScope = match;
954
+ } catch {
955
+ }
956
+ }
957
+ }
896
958
  if (!scope) {
897
959
  if (coordinatorSessions.length !== 1) {
898
960
  process.stderr.write(
@@ -916,22 +978,21 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
916
978
  );
917
979
  continue;
918
980
  }
919
- const taskProject = t.projectName ?? null;
920
981
  let reparented = false;
982
+ let registryReliable = true;
983
+ let registry = [];
984
+ if (deps.listRegisteredSessions) {
985
+ try {
986
+ registry = getRegistryForResolution();
987
+ registryReliable = registryCanDisambiguateLiveCoordinators(coordinatorSessions, registry);
988
+ } catch {
989
+ registryReliable = false;
990
+ }
991
+ }
921
992
  if (taskProject && deps.reparentTask && deps.listRegisteredSessions) {
922
993
  try {
923
- let registry = [];
924
- try {
925
- registry = deps.listRegisteredSessions();
926
- } catch {
927
- registry = [];
928
- }
929
- const matches = coordinatorSessions.filter((cs) => {
930
- const entry = registry.find((r) => r.windowName === cs);
931
- return Boolean(entry?.projectDir) && basename(entry.projectDir) === taskProject;
932
- });
933
- if (matches.length === 1) {
934
- const newScope = matches[0];
994
+ const newScope = uniqueCoordinatorForProject(coordinatorSessions, registry, taskProject);
995
+ if (newScope) {
935
996
  await deps.reparentTask(t.taskId, newScope);
936
997
  delete _autoWakeState.deadScopeSkips[t.taskId];
937
998
  process.stderr.write(
@@ -951,14 +1012,22 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
951
1012
  reparented = true;
952
1013
  } else {
953
1014
  process.stderr.write(
954
- `[auto-wake] Cannot re-parent task ${t.taskId} from dead scope "${deadScope}" \u2014 ${matches.length} live coordinator(s) match project "${taskProject}" (need exactly 1)
1015
+ `[auto-wake] Cannot re-parent task ${t.taskId} from dead scope "${deadScope}" \u2014 no unique live coordinator matches project "${taskProject}"
955
1016
  `
956
1017
  );
957
1018
  }
958
1019
  } catch (e) {
1020
+ registryReliable = false;
959
1021
  process.stderr.write("[daemon-orch] re-parent dead-scope task: " + (e instanceof Error ? e.message : String(e)) + "\n");
960
1022
  }
961
1023
  }
1024
+ if (!reparented && coordinatorSessions.length > 0 && !registryReliable) {
1025
+ process.stderr.write(
1026
+ `[auto-wake] Registry unavailable/incomplete while rescuing task ${t.taskId} from dead scope "${deadScope}" \u2014 leaving task open; refusing false close
1027
+ `
1028
+ );
1029
+ continue;
1030
+ }
962
1031
  if (!reparented) {
963
1032
  try {
964
1033
  const routed = await routeUnrecoverableTask(
@@ -2178,6 +2247,25 @@ async function reapOrphanedWorktrees(deps, nowMs = Date.now()) {
2178
2247
  continue;
2179
2248
  }
2180
2249
  const ageH = Math.round(ageMs / 36e5);
2250
+ if (deps.isBranchMerged) {
2251
+ let merged = false;
2252
+ try {
2253
+ merged = await deps.isBranchMerged(repoRoot, wt.branch);
2254
+ } catch {
2255
+ merged = false;
2256
+ }
2257
+ if (!merged) {
2258
+ result.skipped.push({ path: wt.path, reason: "branch not merged" });
2259
+ recordOrchestrationEventBestEffort({
2260
+ eventType: "worktree.skipped",
2261
+ source: "daemon-orchestration.reapOrphanedWorktrees",
2262
+ severity: "warn",
2263
+ agentId: agentName,
2264
+ payload: { reason: "branch not merged", branch: wt.branch, ageHours: ageH }
2265
+ });
2266
+ continue;
2267
+ }
2268
+ }
2181
2269
  const removed = await deps.removeWorktree(repoRoot, wt.path);
2182
2270
  if (removed) {
2183
2271
  await deps.deleteBranch(repoRoot, wt.branch);
@@ -2210,7 +2298,7 @@ async function reapOrphanedWorktrees(deps, nowMs = Date.now()) {
2210
2298
  }
2211
2299
  async function createWorktreeReaperRealDeps() {
2212
2300
  const { getPaneCwdAsync } = await import("./lib/tmux-status.js");
2213
- const { getGitRoot, isWorktreeDirty: isDirty } = await import("./worktree-72QYYL5L.js");
2301
+ const { getGitRoot, isWorktreeDirty: isDirty } = await import("./worktree-B6YQISX7.js");
2214
2302
  const { statSync: statSync3 } = await import("fs");
2215
2303
  const { basename: basename2 } = await import("path");
2216
2304
  const { promisify: promisify2 } = await import("util");
@@ -2300,6 +2388,37 @@ async function createWorktreeReaperRealDeps() {
2300
2388
  } catch {
2301
2389
  }
2302
2390
  },
2391
+ isBranchMerged: async (repoRoot, branch) => {
2392
+ try {
2393
+ const candidates = ["main", "master"];
2394
+ for (const candidate of candidates) {
2395
+ try {
2396
+ await execFileAsync2("git", ["rev-parse", "--verify", `refs/heads/${candidate}`], {
2397
+ cwd: repoRoot,
2398
+ encoding: "utf-8",
2399
+ timeout: 5e3
2400
+ });
2401
+ } catch {
2402
+ continue;
2403
+ }
2404
+ try {
2405
+ const { stdout } = await execFileAsync2("git", ["branch", "--merged", candidate], {
2406
+ cwd: repoRoot,
2407
+ encoding: "utf-8",
2408
+ timeout: 1e4
2409
+ });
2410
+ if (stdout.split("\n").map((l) => l.replace(/^[*+]?\s+/, "").trim()).includes(branch)) {
2411
+ return true;
2412
+ }
2413
+ } catch {
2414
+ return false;
2415
+ }
2416
+ }
2417
+ return false;
2418
+ } catch {
2419
+ return false;
2420
+ }
2421
+ },
2303
2422
  parseAgentFromWorktreePath: (wtPath) => {
2304
2423
  const dirName = basename2(wtPath);
2305
2424
  if (!dirName) return null;
@@ -2394,7 +2513,7 @@ async function gcStaleCheckpoints() {
2394
2513
  }
2395
2514
  async function pollTaskGroupBarriers() {
2396
2515
  try {
2397
- const { checkAndFireBarriers } = await import("./tasks-crud-6SJOKES5.js");
2516
+ const { checkAndFireBarriers } = await import("./tasks-crud-ZFTYVPD3.js");
2398
2517
  const firedGroupIds = await checkAndFireBarriers();
2399
2518
  if (firedGroupIds.length === 0) return 0;
2400
2519
  const { getClient } = await import("./lib/database.js");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  processCRMEvent
3
- } from "./chunk-4O3N7I5Z.js";
3
+ } from "./chunk-XFMHIDL4.js";
4
4
 
5
5
  // src/gateway/adapters/crm-webhook.ts
6
6
  function parseTwentyWebhook(payload) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  deactivateBehavior
3
- } from "./chunk-WF3J6GJZ.js";
3
+ } from "./chunk-2G7MNOP2.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-ID3V4BWS.js";
6
+ } from "./chunk-PQ5Y34JU.js";
7
7
  import {
8
8
  canCoordinate,
9
9
  getClient
10
- } from "./chunk-QGOMYIVT.js";
10
+ } from "./chunk-ZZOW4BPC.js";
11
11
 
12
12
  // src/mcp/tools/deactivate-behavior.ts
13
13
  import { z } from "zod";
@@ -24,7 +24,7 @@ function registerDeactivateBehavior(server) {
24
24
  async ({ behavior_id }) => {
25
25
  const caller = getActiveAgent();
26
26
  try {
27
- const { StewardGate } = await import("./steward-gate-2XD5BXH6.js");
27
+ const { StewardGate } = await import("./steward-gate-SLQKHB2I.js");
28
28
  const steward = new StewardGate();
29
29
  const gateDecision = await steward.checkAuthority(caller.agentId || "unknown", "deactivate_behavior", behavior_id);
30
30
  if (!gateDecision.allowed) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-QGOMYIVT.js";
3
+ } from "./chunk-ZZOW4BPC.js";
4
4
 
5
5
  // src/lib/orchestration-events.ts
6
6
  import crypto from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-QGOMYIVT.js";
3
+ } from "./chunk-ZZOW4BPC.js";
4
4
 
5
5
  // src/lib/token-budget.ts
6
6
  var WARN_THRESHOLD = 0.8;