@askexenow/exe-os 0.9.372 → 0.9.374

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 (470) hide show
  1. package/deploy/compose/.env.customer.example +45 -10
  2. package/deploy/compose/.env.example +46 -9
  3. package/deploy/compose/docker-compose.yml +136 -18
  4. package/deploy/compose/generate-env.ts +142 -34
  5. package/deploy/compose/sso-edge/default.conf.template +78 -7
  6. package/deploy/compose/sso-edge/sso-redirect.conf +109 -13
  7. package/deploy/stack-manifests/v0.9.30-apps.json +1 -1
  8. package/deploy/stack-manifests/v0.9.json +4 -4
  9. package/dist/.dist-verified.json +3 -3
  10. package/dist/{active-agent-GRT5MKD5.js → active-agent-ONPPEWQV.js} +7 -6
  11. package/dist/{active-agent-L2ZSSXDK.js → active-agent-UJKMG7LJ.js} +7 -6
  12. package/dist/{agent-defs-generator-M4ZNYIVX.js → agent-defs-generator-ZWI6DXOE.js} +6 -5
  13. package/dist/{agent-loop-FOK2IRZQ.js → agent-loop-OYHJKNYH.js} +1 -1
  14. package/dist/{agentic-ontology-DMPRDEUX.js → agentic-ontology-WHFJ3QFS.js} +1 -1
  15. package/dist/{artifact-backup-767STHSW.js → artifact-backup-WXZNB7KE.js} +2 -1
  16. package/dist/{backfill-gate-VX2RZTQV.js → backfill-gate-KWJQ35YX.js} +3 -2
  17. package/dist/{backfill-metadata-ZMEHJQ5M.js → backfill-metadata-3OUSQD5V.js} +8 -7
  18. package/dist/{background-jobs-LTPWCMA3.js → background-jobs-6VMD55PK.js} +3 -2
  19. package/dist/{backup-verify-EX2K732J.js → backup-verify-ZKTUYLTA.js} +4 -3
  20. package/dist/{behavior-injection-22AGMS25.js → behavior-injection-M6UYZCMW.js} +17 -15
  21. package/dist/{behaviors-DVFXAWF5.js → behaviors-ZJ45TFBJ.js} +21 -13
  22. package/dist/bin/age-ontology-load.js +3 -2
  23. package/dist/bin/agentic-ontology-backfill.js +10 -9
  24. package/dist/bin/agentic-reflection-backfill.js +11 -10
  25. package/dist/bin/agentic-semantic-label.js +10 -9
  26. package/dist/bin/backfill-conversations.js +13 -11
  27. package/dist/bin/backfill-responses.js +13 -11
  28. package/dist/bin/backfill-vectors.js +17 -15
  29. package/dist/bin/bulk-sync-postgres.js +22 -20
  30. package/dist/bin/cc-doctor.js +10 -9
  31. package/dist/bin/cleanup-stale-review-tasks.js +29 -26
  32. package/dist/bin/cli.js +36 -26
  33. package/dist/bin/deferred-daemon-restart.js +114 -110
  34. package/dist/bin/exe-agent-config.js +6 -5
  35. package/dist/bin/exe-agent.js +127 -33
  36. package/dist/bin/exe-assign.js +15 -13
  37. package/dist/bin/exe-boot.js +57 -54
  38. package/dist/bin/exe-call.js +8 -7
  39. package/dist/bin/exe-cloud.js +24 -22
  40. package/dist/bin/exe-config-dump.js +6 -5
  41. package/dist/bin/exe-dispatch.js +30 -27
  42. package/dist/bin/exe-doctor.js +14 -10
  43. package/dist/bin/exe-export-behaviors.js +19 -17
  44. package/dist/bin/exe-forget.js +10 -9
  45. package/dist/bin/exe-gateway.js +199 -19
  46. package/dist/bin/exe-grant.js +5 -5
  47. package/dist/bin/exe-healthcheck.js +10 -9
  48. package/dist/bin/exe-heartbeat.js +35 -32
  49. package/dist/bin/exe-kill.js +34 -31
  50. package/dist/bin/exe-launch-agent.js +126 -54
  51. package/dist/bin/exe-mcp.js +6 -5
  52. package/dist/bin/exe-memory-reads.js +8 -7
  53. package/dist/bin/exe-new-employee.js +12 -11
  54. package/dist/bin/exe-os-mcp-proxy.js +6 -5
  55. package/dist/bin/exe-pending-messages.js +30 -27
  56. package/dist/bin/exe-pending-notifications.js +29 -26
  57. package/dist/bin/exe-pending-reviews.js +30 -27
  58. package/dist/bin/exe-rename.js +8 -7
  59. package/dist/bin/exe-repo-truth.js +1 -1
  60. package/dist/bin/exe-review.js +33 -30
  61. package/dist/bin/exe-search.js +9 -8
  62. package/dist/bin/exe-session-cleanup.js +35 -32
  63. package/dist/bin/exe-settings.js +24 -22
  64. package/dist/bin/exe-start-codex.js +137 -55
  65. package/dist/bin/exe-start-opencode.js +121 -23
  66. package/dist/bin/exe-status.js +31 -28
  67. package/dist/bin/exe-support.js +5 -4
  68. package/dist/bin/exe-team.js +7 -6
  69. package/dist/bin/exe-watchdog.js +31 -11
  70. package/dist/bin/generate-hook-manifest.js +44 -7
  71. package/dist/bin/git-sweep.js +31 -28
  72. package/dist/bin/graph-backfill.js +89 -35
  73. package/dist/bin/graph-export.js +9 -8
  74. package/dist/bin/import-history.js +14 -13
  75. package/dist/bin/install.js +137 -113
  76. package/dist/bin/intercom-check.js +5 -5
  77. package/dist/bin/mcp-sessions.js +2 -2
  78. package/dist/bin/orchestration-metrics.js +7 -6
  79. package/dist/bin/postgres-agentic-reflection-backfill.js +5 -4
  80. package/dist/bin/postgres-agentic-semantic-backfill.js +4 -3
  81. package/dist/bin/pre-publish.js +1 -1
  82. package/dist/bin/reconcile-backlog.js +2 -2
  83. package/dist/bin/registry-proxy.js +1 -1
  84. package/dist/bin/scan-tasks.js +29 -26
  85. package/dist/bin/setup.js +5 -4
  86. package/dist/bin/shard-migrate.js +9 -8
  87. package/dist/bin/stack-update.js +40 -9
  88. package/dist/bin/verify-stack.js +2 -2
  89. package/dist/bin/vps-health-gate.js +1 -1
  90. package/dist/{boot-generation-OHXH4YC5.js → boot-generation-JKVZ4ZAT.js} +6 -5
  91. package/dist/{boot-review-sections-N5IXIGSS.js → boot-review-sections-2M6BTG73.js} +28 -25
  92. package/dist/{branch-hygiene-KCGXRAWP.js → branch-hygiene-U5GFRSTP.js} +31 -7
  93. package/dist/{branding-GH43W3PU.js → branding-I6KIMB7F.js} +3 -2
  94. package/dist/budget-fallback-XJRPMP2D.js +11 -0
  95. package/dist/build-manifest.json +1318 -1233
  96. package/dist/{capability-cards-4PXVLIVS.js → capability-cards-5IMJT6J7.js} +5 -4
  97. package/dist/{capacity-monitor-FKMQXORX.js → capacity-monitor-SAXCQK7O.js} +30 -27
  98. package/dist/{catchup-brief-SN5EKO4N.js → catchup-brief-U2TXBLHD.js} +34 -31
  99. package/dist/{chunk-CNC57JCS.js → chunk-23MVDXLY.js} +4 -4
  100. package/dist/{chunk-V4XAKXXF.js → chunk-2AJGV5UL.js} +1 -1
  101. package/dist/{chunk-FBYAXTDM.js → chunk-2ZOEC4KC.js} +10 -2
  102. package/dist/{chunk-ELXFSIIM.js → chunk-32YV32VA.js} +2 -2
  103. package/dist/{chunk-44C7QNZS.js → chunk-3KDCORDO.js} +1 -1
  104. package/dist/{chunk-JTB5V6BV.js → chunk-3SXHEQ7X.js} +1 -1
  105. package/dist/{chunk-HDW4XPDV.js → chunk-3UUX5OY4.js} +1 -1
  106. package/dist/{chunk-7PSLK36P.js → chunk-44TLJZJ5.js} +1 -1
  107. package/dist/{chunk-JTWTBX2M.js → chunk-4EN3IZ3Q.js} +2 -1
  108. package/dist/{chunk-KPMC7PY7.js → chunk-4HKTO2SV.js} +1 -1
  109. package/dist/{chunk-CDUB5Q6J.js → chunk-4IK2K3B3.js} +1 -1
  110. package/dist/{chunk-GH6YJOOC.js → chunk-4SJ4LK4V.js} +6 -6
  111. package/dist/{chunk-PVEM537A.js → chunk-4YLBKEL5.js} +2 -2
  112. package/dist/chunk-4YNA3CM6.js +872 -0
  113. package/dist/{chunk-KYFFVTGO.js → chunk-55BEFF4V.js} +3 -3
  114. package/dist/{chunk-SEP5ITFQ.js → chunk-636LKCKE.js} +2 -2
  115. package/dist/{chunk-QTI4QAWA.js → chunk-6EZQUNE6.js} +338 -5
  116. package/dist/{chunk-WAEKYKTK.js → chunk-6RKKVPYF.js} +1 -1
  117. package/dist/{chunk-VX2F4ZUY.js → chunk-6SCGLHJ7.js} +3 -3
  118. package/dist/{chunk-MEGRQ53A.js → chunk-6VHOQ3IM.js} +51 -6
  119. package/dist/{chunk-HIIXCAEE.js → chunk-6YVUR3OU.js} +3 -3
  120. package/dist/{chunk-L6ZNURWN.js → chunk-7GE2EQ23.js} +1 -1
  121. package/dist/{chunk-2CWS374F.js → chunk-7RI2CNXJ.js} +1 -1
  122. package/dist/{chunk-OL3QP3AU.js → chunk-7TSBV3SD.js} +1 -1
  123. package/dist/{chunk-DSOQUQTV.js → chunk-A27Q27CT.js} +27 -0
  124. package/dist/{chunk-5AHRZI3R.js → chunk-AETLDRZB.js} +1 -1
  125. package/dist/{chunk-RNLF3CBB.js → chunk-AKLJ4JH3.js} +1 -1
  126. package/dist/{chunk-XHYHX6F7.js → chunk-AKLQSC6W.js} +329 -164
  127. package/dist/chunk-ANLFH23R.js +261 -0
  128. package/dist/{chunk-QLA3RTH4.js → chunk-AWWKRZMB.js} +5 -5
  129. package/dist/{chunk-ERVQTR7P.js → chunk-BBSIEYF5.js} +17 -3
  130. package/dist/{chunk-IPMUWYRQ.js → chunk-BJ7AVSY6.js} +2 -2
  131. package/dist/{chunk-HV6Y6F4X.js → chunk-C2L622QJ.js} +89 -3
  132. package/dist/{chunk-TX3Q2GIL.js → chunk-C5HUMAA7.js} +24 -1
  133. package/dist/{chunk-QTYJPWJN.js → chunk-CBCGDEJA.js} +7 -7
  134. package/dist/{chunk-XXSNLM6R.js → chunk-DB55JZHU.js} +1 -1
  135. package/dist/{chunk-LAZKEJMS.js → chunk-DIXXEE3S.js} +840 -607
  136. package/dist/{chunk-FB343XQX.js → chunk-DJ7YXOTU.js} +2 -2
  137. package/dist/{chunk-YFCNWQAM.js → chunk-DJOIMFKV.js} +2 -2
  138. package/dist/{chunk-UTDMTQNH.js → chunk-DSJI76XL.js} +92 -14
  139. package/dist/{chunk-EEXX4UMQ.js → chunk-DZKPOSFD.js} +1 -1
  140. package/dist/{chunk-WSOA3WMC.js → chunk-E426DOSY.js} +161 -4
  141. package/dist/{chunk-ZISQOOER.js → chunk-EKE37MO4.js} +3 -3
  142. package/dist/{chunk-RIECV7SR.js → chunk-EKYYMIVT.js} +1 -1
  143. package/dist/{chunk-HIVZ53YB.js → chunk-EXTZSNWL.js} +2 -2
  144. package/dist/{chunk-YYA5LXCT.js → chunk-FNEZ4BWT.js} +1 -1
  145. package/dist/chunk-FTZET5YX.js +313 -0
  146. package/dist/chunk-GHR4ZPJ7.js +70 -0
  147. package/dist/{chunk-MINXPXAB.js → chunk-GJI77VDO.js} +3 -3
  148. package/dist/{chunk-AAMGHW5W.js → chunk-GLQEJOXE.js} +1 -0
  149. package/dist/{chunk-ADNBOKYZ.js → chunk-GM7TLYOK.js} +60 -18
  150. package/dist/{chunk-RUWWES2K.js → chunk-GNUAL43X.js} +2 -2
  151. package/dist/{chunk-QZL6E4UB.js → chunk-GOMQ7PVQ.js} +2 -2
  152. package/dist/{chunk-GB3AHV5F.js → chunk-GQOEWNVM.js} +1 -1
  153. package/dist/{chunk-NQZUSEAR.js → chunk-GS7LIT34.js} +246 -17
  154. package/dist/{chunk-XTWHNLGD.js → chunk-GZOG2MAX.js} +1 -1
  155. package/dist/{chunk-E5HAY3DQ.js → chunk-HDLAB7W3.js} +1 -1
  156. package/dist/{chunk-E5QQZDQN.js → chunk-HNWS7YHN.js} +358 -136
  157. package/dist/{chunk-VV5EZZNT.js → chunk-HTBEVCO2.js} +1 -1
  158. package/dist/{chunk-OZBII5E3.js → chunk-I4DNJFDR.js} +4 -4
  159. package/dist/{chunk-SI5SZAJA.js → chunk-IBS2FAI4.js} +21 -4
  160. package/dist/{chunk-J5EYOBFF.js → chunk-IHXW4VUI.js} +1 -1
  161. package/dist/{chunk-RUVO3NJC.js → chunk-IN6CAM4F.js} +9 -3
  162. package/dist/{chunk-53PYNYTW.js → chunk-IRVOXUSK.js} +5 -5
  163. package/dist/{chunk-THM7J6UI.js → chunk-JHI5WMK5.js} +5 -5
  164. package/dist/{chunk-3KTQWMHI.js → chunk-JSMDRKPJ.js} +12 -4
  165. package/dist/chunk-JTVIANUB.js +131 -0
  166. package/dist/{chunk-2ADYTOHQ.js → chunk-K4ESASPL.js} +1 -1
  167. package/dist/{chunk-YWUQVHDL.js → chunk-KTCXJWJG.js} +1 -1
  168. package/dist/{chunk-RGUDGC6A.js → chunk-KTU3EAWK.js} +5 -5
  169. package/dist/{chunk-DKBPCOU4.js → chunk-L6RXG36J.js} +2 -2
  170. package/dist/{chunk-T4EK56WI.js → chunk-LDNYSMPZ.js} +1 -1
  171. package/dist/{chunk-RIK5GRWI.js → chunk-LGS2V2XD.js} +3 -3
  172. package/dist/{chunk-JKXZGRWR.js → chunk-LP4GB656.js} +2 -2
  173. package/dist/{chunk-H74466TM.js → chunk-M7O7TGGU.js} +1 -1
  174. package/dist/chunk-MJCSEIFI.js +54 -0
  175. package/dist/{chunk-IDZPQG2D.js → chunk-MOGA4Q7F.js} +2 -2
  176. package/dist/{chunk-OYQNNKNS.js → chunk-MXPNVSXI.js} +37 -14
  177. package/dist/{chunk-UVW7YFAF.js → chunk-N7VEP5B3.js} +4 -4
  178. package/dist/{chunk-HHE2HV3V.js → chunk-NBXDXKLC.js} +1 -1
  179. package/dist/{chunk-LDL3S7AC.js → chunk-NKETJCB5.js} +7 -3
  180. package/dist/{chunk-ECHLVLA7.js → chunk-NMH5ZQPU.js} +1 -1
  181. package/dist/{chunk-U3XLRMJD.js → chunk-NT7W4RXD.js} +1 -1
  182. package/dist/{chunk-UQUUNGTP.js → chunk-NUK7EEN5.js} +11 -9
  183. package/dist/{chunk-GBNB4EWD.js → chunk-ORM7ZFKC.js} +16 -0
  184. package/dist/{chunk-O4ZFRK6W.js → chunk-OVEQE6YS.js} +244 -49
  185. package/dist/{chunk-4ZJ5BPY6.js → chunk-PB5S7YOF.js} +2 -2
  186. package/dist/{chunk-JR23BL74.js → chunk-PDVXWXTL.js} +4 -4
  187. package/dist/{chunk-3CIMDFXG.js → chunk-PFQ3VEEM.js} +1 -1
  188. package/dist/{chunk-SBJV2PCU.js → chunk-PHBU4LGO.js} +1 -1
  189. package/dist/{chunk-W25RLOQ2.js → chunk-PLZSZOZN.js} +3 -3
  190. package/dist/{chunk-THIJIOE2.js → chunk-PY3FOMRN.js} +18 -6
  191. package/dist/{chunk-AAUWFXOX.js → chunk-Q3AXXKDF.js} +3 -3
  192. package/dist/{chunk-VKXS2YGN.js → chunk-QHJR7IMX.js} +2 -2
  193. package/dist/chunk-QLZ46RCK.js +45 -0
  194. package/dist/{chunk-UHPMK6QZ.js → chunk-R3CZWFFC.js} +10 -2
  195. package/dist/{chunk-6XEYELCA.js → chunk-R4CBHKZ2.js} +1 -1
  196. package/dist/{chunk-5APCDDJZ.js → chunk-R522MWAR.js} +9 -9
  197. package/dist/chunk-RH4AH3YB.js +80 -0
  198. package/dist/{chunk-AMKSDKMK.js → chunk-S2WBS6BG.js} +22 -35
  199. package/dist/{chunk-WUKQVNLP.js → chunk-SEQIPGLU.js} +1 -1
  200. package/dist/{chunk-7WQRFSZI.js → chunk-SL6KQYDU.js} +26 -6
  201. package/dist/chunk-SLLLOOEI.js +103 -0
  202. package/dist/{chunk-5N4SG5NB.js → chunk-T35RCQFE.js} +3 -3
  203. package/dist/{chunk-7V6M3QUS.js → chunk-T3QUKNLI.js} +1 -1
  204. package/dist/{chunk-CW2UCKHS.js → chunk-TADAO3HV.js} +2 -2
  205. package/dist/{chunk-5DCCKHDY.js → chunk-TAMDAOCU.js} +109 -13
  206. package/dist/{chunk-ZXB56YR2.js → chunk-TFKCERAK.js} +101 -23
  207. package/dist/{chunk-RBYHJDAT.js → chunk-TQAZTRQ3.js} +3 -3
  208. package/dist/{chunk-OKGIOWOB.js → chunk-U6SUKSZR.js} +2 -2
  209. package/dist/{chunk-23QKEUF6.js → chunk-U73AC5AN.js} +34 -12
  210. package/dist/{chunk-PM6WSWVU.js → chunk-UBK7HK3J.js} +3 -3
  211. package/dist/{chunk-H37FSTF2.js → chunk-UBMZ3YQU.js} +1 -1
  212. package/dist/{chunk-JJUGI2YL.js → chunk-UCFC2AEI.js} +1 -1
  213. package/dist/{chunk-6IWLAQ7O.js → chunk-UCUOGVDX.js} +4 -0
  214. package/dist/{chunk-E7UCDSUE.js → chunk-UKLN57Q5.js} +2 -2
  215. package/dist/{chunk-ZYCLSEZT.js → chunk-ULIBLJ6W.js} +33 -11
  216. package/dist/{chunk-RLR6VVKV.js → chunk-UM3N6VND.js} +4 -4
  217. package/dist/{chunk-ZNUJFX7L.js → chunk-UQGSBM3U.js} +1 -1
  218. package/dist/{chunk-ZZXMB5F2.js → chunk-UZDF6FLJ.js} +1 -1
  219. package/dist/{chunk-LNOS24GV.js → chunk-V3WLC5TJ.js} +2 -95
  220. package/dist/{chunk-UXLO7VHX.js → chunk-VI4ATC6I.js} +1 -1
  221. package/dist/{chunk-77JP3LK4.js → chunk-VKJGHAZT.js} +92 -21
  222. package/dist/{chunk-7R73IAHU.js → chunk-VMTZ4RUW.js} +67 -150
  223. package/dist/{chunk-TGPQMMQP.js → chunk-VYQ7B7DI.js} +30 -17
  224. package/dist/{chunk-E2WEFZOR.js → chunk-W75GTHR3.js} +1 -1
  225. package/dist/{chunk-UKLF7F3Z.js → chunk-WJG344NC.js} +9 -9
  226. package/dist/{chunk-MBNIJXKI.js → chunk-WMEYJT4R.js} +18 -4
  227. package/dist/{chunk-R6FLELV6.js → chunk-XFTEX77S.js} +3 -3
  228. package/dist/{chunk-MDGYXUOV.js → chunk-XH7YL7JM.js} +1 -1
  229. package/dist/{chunk-JOO35RHR.js → chunk-XL5MFGMR.js} +3 -3
  230. package/dist/{chunk-OW5RZIDW.js → chunk-XNNECNDL.js} +95 -33
  231. package/dist/{chunk-5AHDQCTB.js → chunk-XXFKSJYA.js} +6 -6
  232. package/dist/{chunk-TGEPLJ66.js → chunk-XXOPG4BW.js} +3 -3
  233. package/dist/{chunk-PGLPUP37.js → chunk-XZ65ST2I.js} +1 -1
  234. package/dist/{chunk-3TTKAT6V.js → chunk-YKC7QDZH.js} +9 -4
  235. package/dist/{chunk-KXYFBBZR.js → chunk-YMP2QSOP.js} +20 -3
  236. package/dist/{chunk-TK4MI6F6.js → chunk-YSLGFPWX.js} +6 -6
  237. package/dist/{chunk-X2P43TB2.js → chunk-YTSXPJUQ.js} +1 -1
  238. package/dist/{chunk-HECXZGGZ.js → chunk-ZCERWHY2.js} +33 -35
  239. package/dist/{chunk-IVU3WN7S.js → chunk-ZG62LIK3.js} +74 -4
  240. package/dist/{chunk-GU62SNDH.js → chunk-ZGYNKA3O.js} +744 -111
  241. package/dist/{chunk-QMSEL5YS.js → chunk-ZIG7VPJV.js} +28 -76
  242. package/dist/{chunk-WZJVGA5I.js → chunk-ZL4AGWAH.js} +258 -13
  243. package/dist/{chunk-QR624DER.js → chunk-ZSODLMFV.js} +2 -2
  244. package/dist/{cleanup-graph-garbage-IPYDS5OX.js → cleanup-graph-garbage-DPJGO52H.js} +11 -10
  245. package/dist/{cloud-sync-command-JLNVG7H4.js → cloud-sync-command-JPNTT4OQ.js} +2 -2
  246. package/dist/{cloud-sync-db-init-JXUF6GI3.js → cloud-sync-db-init-V2LWIUQU.js} +1 -1
  247. package/dist/{cloud-sync-shutdown-Z4SBP6PL.js → cloud-sync-shutdown-BNALPWGX.js} +5 -4
  248. package/dist/{co-activation-74RDFTKS.js → co-activation-CMNSWS6B.js} +5 -4
  249. package/dist/{co-occurrence-CN3TBYVR.js → co-occurrence-WRI2NAN6.js} +9 -8
  250. package/dist/{code-context-index-D4MJ4VFX.js → code-context-index-NOJSHLPN.js} +12 -6
  251. package/dist/code-context-watcher-VZNZU3BO.js +118 -0
  252. package/dist/{codex-consolidation-PPXNBXCV.js → codex-consolidation-SH4UKFBQ.js} +2 -1
  253. package/dist/{conversation-entity-extractor-QGTLH4BP.js → conversation-entity-extractor-74252CAO.js} +4 -4
  254. package/dist/{conversation-wiki-populator-EBUZXYEU.js → conversation-wiki-populator-OS4C6W54.js} +1 -1
  255. package/dist/conversations-retention-C4BLKFEL.js +54 -0
  256. package/dist/coordinator-notice-MHUY7AQB.js +55 -0
  257. package/dist/{crdt-sync-7T4WCOKD.js → crdt-sync-B3JN6AIV.js} +1 -1
  258. package/dist/{crm-webhook-FTW3XZTO.js → crm-webhook-GYWQRFET.js} +2 -2
  259. package/dist/{cto-delegation-gate-SZCE34LB.js → cto-delegation-gate-LQHVLEMW.js} +29 -26
  260. package/dist/{daemon-auth-SSPY5ODS.js → daemon-auth-QZHEO7IQ.js} +3 -2
  261. package/dist/{daemon-orchestration-IGPHVNFR.js → daemon-orchestration-5HIQALZH.js} +36 -34
  262. package/dist/{daemon-ready-OT2VQLS7.js → daemon-ready-P2BR2XP5.js} +1 -1
  263. package/dist/{db-integrity-events-5DTASXJF.js → db-integrity-events-2DTFO37N.js} +3 -2
  264. package/dist/{db-restore-events-2FI4ZMKA.js → db-restore-events-G6NOQOVE.js} +2 -1
  265. package/dist/{destructive-data-guard-6I5MDFVD.js → destructive-data-guard-BVFWPPIS.js} +1 -1
  266. package/dist/doc-graph-extractor-PQHDHQPQ.js +367 -0
  267. package/dist/{documents-URULIXGM.js → documents-C4SSPJMC.js} +15 -13
  268. package/dist/{dreaming-VIZO3QDO.js → dreaming-XAO3FCBV.js} +33 -30
  269. package/dist/{employee-boot-brief-XLOG4ULP.js → employee-boot-brief-W4OHUMRQ.js} +37 -34
  270. package/dist/{exe-drift-TLQM3IHD.js → exe-drift-AG2KMKD5.js} +6 -5
  271. package/dist/{exe-export-7YWYWJHY.js → exe-export-IC5BT335.js} +17 -15
  272. package/dist/{exe-import-DW6VAUKW.js → exe-import-A35ZLDPG.js} +17 -15
  273. package/dist/{exe-key-TLJP2B4Y.js → exe-key-TCMJNYLA.js} +116 -112
  274. package/dist/{exe-org-LU46N36E.js → exe-org-JXCR3JYZ.js} +24 -23
  275. package/dist/{exe-snapshot-QHUZRS62.js → exe-snapshot-SV6SRIG6.js} +36 -33
  276. package/dist/{fast-db-init-SCTOOIUT.js → fast-db-init-L2RGKJWH.js} +1 -1
  277. package/dist/{founder-context-ZFZC4UHO.js → founder-context-D4HFIESJ.js} +4 -3
  278. package/dist/{founder-monitor-envelope-5KTKNL5G.js → founder-monitor-envelope-TFKRGCFE.js} +5 -4
  279. package/dist/{fts-integrity-LKAZEZJE.js → fts-integrity-4YB34KWX.js} +3 -2
  280. package/dist/gateway/index.js +19 -17
  281. package/dist/{git-main-guard-TN27QBAI.js → git-main-guard-VTW4N3CM.js} +7 -1
  282. package/dist/{git-staleness-GSGP344N.js → git-staleness-TN7CYGFG.js} +5 -4
  283. package/dist/{global-procedures-YAR7G4C6.js → global-procedures-YFDEIOG7.js} +7 -6
  284. package/dist/{graph-auto-extract-GNQS64F5.js → graph-auto-extract-3YR3TYRW.js} +9 -8
  285. package/dist/{graph-rag-RMSFLUOB.js → graph-rag-Z2KCJTPK.js} +6 -4
  286. package/dist/{hook-integrity-CF567MVN.js → hook-integrity-KGAV6ZC2.js} +14 -4
  287. package/dist/{hook-prefetch-36BK4F7U.js → hook-prefetch-K5DN3TOQ.js} +29 -26
  288. package/dist/hooks/bug-report-worker.js +34 -30
  289. package/dist/hooks/codex-stop-task-finalizer.js +36 -32
  290. package/dist/hooks/commit-complete.js +33 -30
  291. package/dist/hooks/error-recall.js +12 -11
  292. package/dist/hooks/exe-heartbeat-hook.js +8 -7
  293. package/dist/hooks/ingest-worker.js +23 -11
  294. package/dist/hooks/ingest.js +18 -17
  295. package/dist/hooks/instructions-loaded.js +10 -9
  296. package/dist/hooks/manifest.json +20 -20
  297. package/dist/hooks/notification.js +9 -8
  298. package/dist/hooks/post-compact.js +8 -7
  299. package/dist/hooks/post-tool-combined.js +26 -15
  300. package/dist/hooks/pre-compact.js +33 -30
  301. package/dist/hooks/pre-tool-use.js +404 -46
  302. package/dist/hooks/prompt-submit.js +57 -47
  303. package/dist/hooks/session-end.js +40 -41
  304. package/dist/hooks/session-start.js +21 -20
  305. package/dist/hooks/stop.js +40 -37
  306. package/dist/hooks/subagent-stop.js +38 -35
  307. package/dist/hooks/summary-worker.js +39 -36
  308. package/dist/hyde-MP4QNMU5.js +80 -0
  309. package/dist/index.js +44 -39
  310. package/dist/{installer-LUN4HQIC.js → installer-54HTN5RE.js} +8 -7
  311. package/dist/{installer-OC5VXNC7.js → installer-LK35OX6R.js} +8 -7
  312. package/dist/{installer-MPRFUQJE.js → installer-LLWKZI2S.js} +8 -7
  313. package/dist/intercom-ack-VCW755TN.js +13 -0
  314. package/dist/{intercom-queue-6DZ7BANV.js → intercom-queue-5NOT2RKI.js} +28 -25
  315. package/dist/{key-backup-status-6L2ARCXW.js → key-backup-status-LQPINQ3W.js} +2 -1
  316. package/dist/lib/agent-config.js +3 -2
  317. package/dist/lib/cloud-sync.js +26 -20
  318. package/dist/lib/config.js +2 -1
  319. package/dist/lib/consolidation.js +17 -10
  320. package/dist/lib/database.js +7 -4
  321. package/dist/lib/db-backup.js +17 -2
  322. package/dist/lib/db-daemon-client.js +8 -6
  323. package/dist/lib/db-write-worker-client.js +3 -1
  324. package/dist/lib/db-write-worker.js +20 -3
  325. package/dist/lib/db.js +7 -4
  326. package/dist/lib/device-registry.js +3 -2
  327. package/dist/lib/embed-worker.js +2 -1
  328. package/dist/lib/embedder.js +8 -6
  329. package/dist/lib/employee-templates.js +8 -7
  330. package/dist/lib/employees.js +5 -4
  331. package/dist/lib/exe-daemon-client.js +7 -5
  332. package/dist/lib/exe-daemon.js +467 -221
  333. package/dist/lib/hybrid-search.js +11 -8
  334. package/dist/lib/identity.js +5 -4
  335. package/dist/lib/license.js +4 -3
  336. package/dist/lib/messaging.js +29 -26
  337. package/dist/lib/post-tool-memory.js +16 -2
  338. package/dist/lib/registry-proxy.js +3 -1
  339. package/dist/lib/reminders.js +6 -5
  340. package/dist/lib/schedules.js +9 -8
  341. package/dist/lib/session-registry.js +7 -6
  342. package/dist/lib/skill-learning.js +16 -14
  343. package/dist/lib/stack-invariants.js +17 -1
  344. package/dist/lib/status-brief.js +5 -4
  345. package/dist/lib/store.js +10 -7
  346. package/dist/lib/task-router.js +6 -5
  347. package/dist/lib/tasks.js +31 -27
  348. package/dist/lib/tmux-routing.js +40 -25
  349. package/dist/lib/tmux-status.js +3 -1
  350. package/dist/lib/tmux-transport.js +2 -1
  351. package/dist/lib/token-spend.js +6 -5
  352. package/dist/lib/transport.js +3 -2
  353. package/dist/{license-gate-ESER24PJ.js → license-gate-JVMB6OFD.js} +5 -4
  354. package/dist/{license-sync-JVG5KNIY.js → license-sync-5VYS2F2W.js} +4 -3
  355. package/dist/mcp/register-tools.js +113 -109
  356. package/dist/mcp/server.js +118 -114
  357. package/dist/mcp/tools/complete-reminder.js +7 -6
  358. package/dist/mcp/tools/create-reminder.js +7 -6
  359. package/dist/mcp/tools/create-task.js +34 -30
  360. package/dist/mcp/tools/deactivate-behavior.js +18 -16
  361. package/dist/mcp/tools/list-reminders.js +7 -6
  362. package/dist/mcp/tools/list-tasks.js +34 -30
  363. package/dist/mcp/tools/send-message.js +32 -29
  364. package/dist/mcp/tools/update-task.js +32 -28
  365. package/dist/mcp-child-registry-OTG4MWO7.js +25 -0
  366. package/dist/{mcp-http-config-6K6IKH5F.js → mcp-http-config-DQWL7U2Z.js} +6 -5
  367. package/dist/{mcp-session-identity-LRC6WJSD.js → mcp-session-identity-277GASTQ.js} +28 -25
  368. package/dist/{memory-cards-V3OZHIYP.js → memory-cards-3S2ZQPR7.js} +17 -8
  369. package/dist/{memory-graph-extractor-JC2Z64L4.js → memory-graph-extractor-A6DFEFIN.js} +10 -9
  370. package/dist/{memory-poisoning-defense-YM4QJHCX.js → memory-poisoning-defense-ZVP4H6DY.js} +5 -4
  371. package/dist/{memory-pressure-watchdog-6F6KEQHN.js → memory-pressure-watchdog-6W5F6R7H.js} +29 -26
  372. package/dist/{memory-queue-QJNWKWKG.js → memory-queue-YF7IDSFY.js} +3 -2
  373. package/dist/{memory-queue-client-COA4ABEV.js → memory-queue-client-ADSDP6OX.js} +9 -7
  374. package/dist/{memory-reflection-QXHJPYPC.js → memory-reflection-BKB2YOE6.js} +52 -6
  375. package/dist/{monitor-grants-BW2WL4IU.js → monitor-grants-EV747HMW.js} +4 -3
  376. package/dist/{notification-ledger-6QRLQW4Q.js → notification-ledger-CLGM7ODF.js} +30 -27
  377. package/dist/{notifications-7B6D7Y5C.js → notifications-MACUZPYP.js} +28 -25
  378. package/dist/{oauth-server-TZFNQAFS.js → oauth-server-AYM37SQ4.js} +25 -4
  379. package/dist/{orchestration-events-GY5VP5LU.js → orchestration-events-N7LYMUGA.js} +6 -5
  380. package/dist/{orchestration-phase-UDS24CVQ.js → orchestration-phase-T2WD45UA.js} +3 -2
  381. package/dist/{orchestrator-JVPVOYWA.js → orchestrator-4X24EWHV.js} +30 -27
  382. package/dist/{org-brief-session-GRV5R5E3.js → org-brief-session-FZOFMO5U.js} +13 -12
  383. package/dist/{org-consent-policy-3FHHSYXV.js → org-consent-policy-O5E6HXBL.js} +1 -1
  384. package/dist/{org-join-BY4PV6UO.js → org-join-POWUG25F.js} +8 -7
  385. package/dist/{org-key-admin-WSCPT2CZ.js → org-key-admin-E7EMDOZZ.js} +9 -8
  386. package/dist/{org-key-pin-5WUSPGVN.js → org-key-pin-WHWHVWUO.js} +4 -3
  387. package/dist/{org-membership-ESALTLLN.js → org-membership-WRT2IHJK.js} +5 -4
  388. package/dist/{org-partner-config-YKHPDPZR.js → org-partner-config-B7T4CL2T.js} +7 -6
  389. package/dist/{org-partner-runtime-UJDGECZ4.js → org-partner-runtime-FODONVTM.js} +13 -12
  390. package/dist/{org-row-visibility-V5DXIHTE.js → org-row-visibility-VX4AVV5Q.js} +1 -1
  391. package/dist/{pipeline-router-YY5FQKTY.js → pipeline-router-6GGT2ZW3.js} +6 -5
  392. package/dist/{plan-limits-OVX6SN6B.js → plan-limits-FUN76LYY.js} +8 -7
  393. package/dist/{platform-procedures-I57ITMDC.js → platform-procedures-7YSCLF4Z.js} +1 -1
  394. package/dist/{postinstall-failure-B2JHNFPM.js → postinstall-failure-O6TSSNJB.js} +3 -2
  395. package/dist/{project-boot-LXLU2J32.js → project-boot-3Q65LCIP.js} +2 -1
  396. package/dist/project-name-LJVFMYTQ.js +30 -0
  397. package/dist/{projection-worker-D2472IOD.js → projection-worker-4OANGP5K.js} +5 -4
  398. package/dist/{prospective-memory-JXO2A6PL.js → prospective-memory-KR3P4T6N.js} +5 -4
  399. package/dist/{push-notifications-HR3FZRDI.js → push-notifications-NCZLH6DI.js} +29 -26
  400. package/dist/ref-provenance-gate-M4AQO4OT.js +269 -0
  401. package/dist/{reproject-worktree-memories-OSS3PGRF.js → reproject-worktree-memories-PWYKPB2U.js} +106 -23
  402. package/dist/{reranker-IMZRPYJ2.js → reranker-6V3C2AO4.js} +3 -2
  403. package/dist/resolve-image-labels-ZI6UBW5W.js +15 -0
  404. package/dist/{retrieval-health-W7OD44FE.js → retrieval-health-5D7O6VH6.js} +4 -3
  405. package/dist/{review-polling-2INP7H6M.js → review-polling-QW3LJ4KN.js} +29 -26
  406. package/dist/runtime/index.js +38 -34
  407. package/dist/{session-events-G4XUPVWV.js → session-events-T45SSTMF.js} +31 -26
  408. package/dist/{session-kill-telemetry-W7MHWJTQ.js → session-kill-telemetry-QSPVJGBF.js} +29 -26
  409. package/dist/{session-mcp-config-F7KATWOF.js → session-mcp-config-SC5BLWZG.js} +3 -2
  410. package/dist/{session-scope-LG2J4EMQ.js → session-scope-KRWE54C4.js} +28 -25
  411. package/dist/{setup-wizard-YQJI3SVM.js → setup-wizard-GP3TBTPF.js} +5 -4
  412. package/dist/{shard-manager-UROHZE46.js → shard-manager-OE36A4MY.js} +3 -2
  413. package/dist/{skill-refinement-RA37U756.js → skill-refinement-C7JTMLJG.js} +6 -5
  414. package/dist/stack-generate-manifest-MFMDWRUP.js +810 -0
  415. package/dist/{stack-promote-IYBRXHTA.js → stack-promote-EKSCYY63.js} +8 -6
  416. package/dist/{stack-release-OXWLVVG6.js → stack-release-2GZAAFO4.js} +8 -6
  417. package/dist/{stack-update-2CZEROPK.js → stack-update-J6JXSTAZ.js} +51 -5
  418. package/dist/{steward-gate-LTNFB3FY.js → steward-gate-BFCCMCSW.js} +6 -5
  419. package/dist/{subagent-brief-injection-OHLWLECQ.js → subagent-brief-injection-ED36PLYY.js} +44 -36
  420. package/dist/{subagent-spawn-ledger-USYZXU3M.js → subagent-spawn-ledger-E6U3OY6Z.js} +3 -2
  421. package/dist/{supervisor-handoff-CSJQMI53.js → supervisor-handoff-SGLEPOCY.js} +12 -3
  422. package/dist/{support-inbox-4KCEPAZQ.js → support-inbox-YW47SYJF.js} +20 -5
  423. package/dist/{task-enforcement-LGXWXGVZ.js → task-enforcement-CECTQX4U.js} +29 -26
  424. package/dist/{task-request-inbox-WHCOSUCP.js → task-request-inbox-Q5T4N5K7.js} +1 -1
  425. package/dist/{task-scope-KXF7Y6KA.js → task-scope-ERVEUEYU.js} +28 -25
  426. package/dist/{tasks-crud-5EM55WRZ.js → tasks-crud-ZRQNJXQ2.js} +28 -25
  427. package/dist/{tasks-notify-VFMAURTN.js → tasks-notify-MIZH4C2O.js} +29 -26
  428. package/dist/{tasks-review-MHGMBHUZ.js → tasks-review-Z7J2P6DG.js} +28 -25
  429. package/dist/{telemetry-upload-6NRTN7QJ.js → telemetry-upload-LVQUQYFP.js} +10 -9
  430. package/dist/{token-budget-LZPOYTRP.js → token-budget-BU4NOVZF.js} +6 -5
  431. package/dist/{tool-capability-index-ED5OAPMW.js → tool-capability-index-7F42MOJT.js} +1 -1
  432. package/dist/{tool-gates-7PLIOLAL.js → tool-gates-JWVSAYTW.js} +1 -1
  433. package/dist/{tool-gates-2OZY3GZM.js → tool-gates-VXITVRFQ.js} +1 -1
  434. package/dist/{tool-telemetry-ZX7VSAXK.js → tool-telemetry-O27EVMBR.js} +1 -1
  435. package/dist/tui/App.js +43 -40
  436. package/dist/{tui-data-CC5POSUV.js → tui-data-TPWWBIUQ.js} +28 -25
  437. package/dist/{update-support-KH6NSQON.js → update-support-F2F5537B.js} +22 -20
  438. package/dist/{whatsapp-QW3X7OCN.js → whatsapp-YM4A2CSK.js} +3 -1
  439. package/dist/{work-claims-MNK7PEPW.js → work-claims-B73X5NE7.js} +6 -5
  440. package/dist/{work-state-heartbeat-YEWT5NMZ.js → work-state-heartbeat-P4YX6E2R.js} +1 -1
  441. package/dist/{worker-gate-BOQSIU2Z.js → worker-gate-BEEIIVWA.js} +3 -2
  442. package/dist/{workflow-engine-MUUD7ZEX.js → workflow-engine-5X46PFCW.js} +4 -2
  443. package/dist/{worktree-GOGT2LZP.js → worktree-W47CIMJ6.js} +9 -6
  444. package/dist/worktree-ownership-guard-OUWJROW2.js +88 -0
  445. package/dist/{worktree-sweep-46VWPVQT.js → worktree-sweep-BNBD4RFX.js} +8 -7
  446. package/package.json +14 -5
  447. package/release-notes.json +5 -5
  448. package/src/commands/exe/call.md +1 -1
  449. package/stack.release.json +6 -0
  450. package/dist/chunk-KZXMP6JG.js +0 -319
  451. package/dist/chunk-TCTED52S.js +0 -120
  452. package/dist/chunk-W2IRQJ6R.js +0 -67
  453. package/dist/doc-graph-extractor-VPTRIEKN.js +0 -149
  454. package/dist/project-name-ILJTETUE.js +0 -14
  455. /package/dist/{chunk-3Y5THOU6.js → chunk-6WIFPD2P.js} +0 -0
  456. /package/dist/{chunk-7XGXRD22.js → chunk-AISULNGL.js} +0 -0
  457. /package/dist/{chunk-3F2UB4IQ.js → chunk-DN4YVV4Z.js} +0 -0
  458. /package/dist/{chunk-WV3TOOL7.js → chunk-KQ6RJWRW.js} +0 -0
  459. /package/dist/{chunk-HR2R2QER.js → chunk-M4IRPXSZ.js} +0 -0
  460. /package/dist/{chunk-ORA5BWCV.js → chunk-NRG7KZIP.js} +0 -0
  461. /package/dist/{chunk-7UTJA6HF.js → chunk-VZAFWPAY.js} +0 -0
  462. /package/dist/{chunk-VJSDGDNS.js → chunk-WSQASFLP.js} +0 -0
  463. /package/dist/{chunk-FZQWVQJG.js → chunk-YO4BO2CL.js} +0 -0
  464. /package/dist/{core-memory-6WBNT2HL.js → core-memory-7I7RE2SJ.js} +0 -0
  465. /package/dist/{entity-boost-MT336PI3.js → entity-boost-3UWGXG5O.js} +0 -0
  466. /package/dist/{memory-isolation-EJ45IXBH.js → memory-isolation-2TUZ7Z4K.js} +0 -0
  467. /package/dist/{message-queue-client-MVBTYCSV.js → message-queue-client-XQN7QABL.js} +0 -0
  468. /package/dist/{webhook-pipe-UQSEHFPO.js → webhook-pipe-W2FVXY7M.js} +0 -0
  469. /package/dist/{wiki-acl-WXRJGZ5Q.js → wiki-acl-IBQLLBTS.js} +0 -0
  470. /package/dist/{wiki-client-AXNM5FWY.js → wiki-client-W65IOSWF.js} +0 -0
@@ -3,10 +3,7 @@ import {
3
3
  } from "./chunk-BTSWFMEH.js";
4
4
  import {
5
5
  ensureAgentSymlink
6
- } from "./chunk-WAEKYKTK.js";
7
- import {
8
- resolveRowVisibility
9
- } from "./chunk-44C7QNZS.js";
6
+ } from "./chunk-6RKKVPYF.js";
10
7
  import {
11
8
  ensureWorktree,
12
9
  ensureWorktreeAsync,
@@ -14,10 +11,13 @@ import {
14
11
  getMainRepoRoot,
15
12
  isInsideGitRepo,
16
13
  isWorktreeDirty
17
- } from "./chunk-JTWTBX2M.js";
14
+ } from "./chunk-4EN3IZ3Q.js";
18
15
  import {
19
16
  runBudgetedSweep
20
17
  } from "./chunk-KI5PFRG6.js";
18
+ import {
19
+ resolveRowVisibility
20
+ } from "./chunk-3KDCORDO.js";
21
21
  import {
22
22
  LEASE_MINUTES,
23
23
  isLeaseExpired,
@@ -31,19 +31,22 @@ import {
31
31
  reviewSignalPath,
32
32
  taskSignalDir
33
33
  } from "./chunk-EIKATSE4.js";
34
+ import {
35
+ hasIntercomAckAfter
36
+ } from "./chunk-MJCSEIFI.js";
34
37
  import {
35
38
  listSessions,
36
39
  registerSession
37
- } from "./chunk-MDGYXUOV.js";
40
+ } from "./chunk-XH7YL7JM.js";
38
41
  import {
39
42
  listTmuxSessions
40
- } from "./chunk-GBNB4EWD.js";
43
+ } from "./chunk-ORM7ZFKC.js";
41
44
  import {
42
45
  getTransport
43
- } from "./chunk-UXLO7VHX.js";
46
+ } from "./chunk-VI4ATC6I.js";
44
47
  import {
45
48
  recordOrchestrationEventBestEffort
46
- } from "./chunk-E2WEFZOR.js";
49
+ } from "./chunk-W75GTHR3.js";
47
50
  import {
48
51
  appendDispatchJournalEvent,
49
52
  releaseDispatchClaim,
@@ -52,30 +55,30 @@ import {
52
55
  } from "./chunk-AJIXH5JF.js";
53
56
  import {
54
57
  incrementSkillSuccess
55
- } from "./chunk-L6ZNURWN.js";
58
+ } from "./chunk-7GE2EQ23.js";
56
59
  import {
57
60
  assertRuntimeModelCompatible,
58
61
  getAgentRuntime,
59
62
  normalizeCcModelName,
60
63
  resolveSpawnRuntimeConfig
61
- } from "./chunk-XTWHNLGD.js";
64
+ } from "./chunk-GZOG2MAX.js";
62
65
  import {
63
66
  PlanLimitError,
64
67
  assertEmployeeLimitSync
65
- } from "./chunk-HIIXCAEE.js";
68
+ } from "./chunk-6YVUR3OU.js";
66
69
  import {
67
70
  getSessionKey
68
71
  } from "./chunk-CVYC6DUW.js";
69
72
  import {
70
73
  writeMemoryViaDaemon
71
- } from "./chunk-QZL6E4UB.js";
74
+ } from "./chunk-GOMQ7PVQ.js";
72
75
  import {
73
76
  AGENT_IDENTITY_TOKEN_ENV,
74
77
  getDaemonAgentIdentityBroker
75
- } from "./chunk-RIECV7SR.js";
78
+ } from "./chunk-EKYYMIVT.js";
76
79
  import {
77
80
  getProjectName
78
- } from "./chunk-W2IRQJ6R.js";
81
+ } from "./chunk-JTVIANUB.js";
79
82
  import {
80
83
  expandDualPrefixTools
81
84
  } from "./chunk-HYZV25LY.js";
@@ -96,16 +99,16 @@ import {
96
99
  loadEmployeesSync,
97
100
  offloadReadIfMain,
98
101
  offloadReadQuery
99
- } from "./chunk-5DCCKHDY.js";
102
+ } from "./chunk-TAMDAOCU.js";
100
103
  import {
101
104
  RUNTIME_TABLE
102
105
  } from "./chunk-WNBZJSQT.js";
103
106
  import {
104
107
  loadDeviceId
105
- } from "./chunk-DKBPCOU4.js";
108
+ } from "./chunk-L6RXG36J.js";
106
109
  import {
107
110
  EXE_AI_DIR
108
- } from "./chunk-QMSEL5YS.js";
111
+ } from "./chunk-ZIG7VPJV.js";
109
112
  import {
110
113
  atomicWriteJsonSync,
111
114
  atomicWriteSync
@@ -1528,7 +1531,7 @@ async function createTaskCore(input) {
1528
1531
  if (isCoordinatorSession) {
1529
1532
  earlySessionScope = resolved;
1530
1533
  } else {
1531
- const { getSessionProject } = await import("./session-scope-LG2J4EMQ.js");
1534
+ const { getSessionProject } = await import("./session-scope-KRWE54C4.js");
1532
1535
  const sessionProject = getSessionProject(resolved);
1533
1536
  if (sessionProject && sessionProject !== input.projectName) {
1534
1537
  scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
@@ -1832,7 +1835,7 @@ async function buildTaskRowsStatement(opts) {
1832
1835
  }
1833
1836
  if (opts.founderId !== null) {
1834
1837
  try {
1835
- const { founderScopeFilter } = await import("./founder-context-ZFZC4UHO.js");
1838
+ const { founderScopeFilter } = await import("./founder-context-D4HFIESJ.js");
1836
1839
  const founderFilter = founderScopeFilter(opts.founderId);
1837
1840
  const cleaned = founderFilter.sql.replace(/^\s*AND\s+/, "");
1838
1841
  conditions.push(cleaned);
@@ -1875,30 +1878,30 @@ async function listTasks(input) {
1875
1878
  extraConditions.push("priority = ?");
1876
1879
  extraArgs.push(input.priority);
1877
1880
  }
1881
+ if (input.effectiveReviewer) {
1882
+ extraConditions.push("(reviewer = ? OR (reviewer IS NULL AND assigned_by = ?))");
1883
+ extraArgs.push(input.effectiveReviewer, input.effectiveReviewer);
1884
+ }
1878
1885
  const callerSession = input.callerSession?.trim();
1879
1886
  if (input.isOwnQuery && callerSession) {
1880
1887
  const live = await resolveLiveTmuxSessions();
1881
- const liveForeign = live.verified ? [...live.sessions].filter((s) => s !== callerSession) : null;
1882
- if (liveForeign === null) {
1883
- extraConditions.push("(instance_id IS NULL OR instance_id = ?)");
1884
- extraArgs.push(callerSession);
1885
- extraConditions.push(
1886
- "(assigned_tmux IS NULL OR assigned_tmux = 'unknown' OR assigned_tmux = ? OR assigned_tmux LIKE ?)"
1887
- );
1888
- extraArgs.push(callerSession, `${callerSession}:%`);
1889
- } else if (liveForeign.length === 0) {
1888
+ if (!live.verified) {
1890
1889
  } else {
1891
- const ph = liveForeign.map(() => "?").join(", ");
1892
- extraConditions.push(
1893
- `(instance_id IS NULL OR instance_id = ? OR instance_id NOT IN (${ph}))`
1894
- );
1895
- extraArgs.push(callerSession, ...liveForeign);
1896
- const notLive = liveForeign.map(() => "(assigned_tmux <> ? AND assigned_tmux NOT LIKE ?)").join(" AND ");
1897
- extraConditions.push(
1898
- `(assigned_tmux IS NULL OR assigned_tmux = 'unknown' OR assigned_tmux = ? OR assigned_tmux LIKE ? OR (${notLive}))`
1899
- );
1900
- extraArgs.push(callerSession, `${callerSession}:%`);
1901
- for (const s of liveForeign) extraArgs.push(s, `${s}:%`);
1890
+ const liveForeign = [...live.sessions].filter((s) => s !== callerSession);
1891
+ if (liveForeign.length === 0) {
1892
+ } else {
1893
+ const ph = liveForeign.map(() => "?").join(", ");
1894
+ extraConditions.push(
1895
+ `(instance_id IS NULL OR instance_id = ? OR instance_id NOT IN (${ph}))`
1896
+ );
1897
+ extraArgs.push(callerSession, ...liveForeign);
1898
+ const notLive = liveForeign.map(() => "(assigned_tmux <> ? AND assigned_tmux NOT LIKE ?)").join(" AND ");
1899
+ extraConditions.push(
1900
+ `(assigned_tmux IS NULL OR assigned_tmux = 'unknown' OR assigned_tmux = ? OR assigned_tmux LIKE ? OR (${notLive}))`
1901
+ );
1902
+ extraArgs.push(callerSession, `${callerSession}:%`);
1903
+ for (const s of liveForeign) extraArgs.push(s, `${s}:%`);
1904
+ }
1902
1905
  }
1903
1906
  }
1904
1907
  const callerRoot = callerSession ? callerSession.includes("-") ? callerSession.split("-").pop() || null : callerSession : null;
@@ -2139,7 +2142,16 @@ var VALID_TRANSITIONS = {
2139
2142
  open: ["in_progress", "needs_review", "cancelled", "blocked"],
2140
2143
  in_progress: ["in_progress", "open", "needs_review", "blocked", "cancelled"],
2141
2144
  blocked: ["open", "in_progress", "needs_review", "cancelled"],
2142
- needs_review: ["closed", "in_progress", "open"],
2145
+ // Bug 02d2255a: needs_review had no self-transition, so when a hook had
2146
+ // already flipped in_progress → needs_review, the worker's own
2147
+ // update(status="done", result=..., assertions_resolved=...) was rejected —
2148
+ // and the payload went with it. The task then showed needs_review carrying an
2149
+ // auto-generated generic completion report while the agent's real deliverable
2150
+ // was silently discarded. Data loss on the single most important call in the
2151
+ // task lifecycle. in_progress already allows a self-transition for exactly
2152
+ // this reason; needs_review now does too. It does NOT re-fire the reviewer
2153
+ // notification: isReviewTransition requires previousStatus !== "needs_review".
2154
+ needs_review: ["closed", "in_progress", "open", "needs_review"],
2143
2155
  closed: [],
2144
2156
  // terminal — no transitions out
2145
2157
  cancelled: ["open"]
@@ -2896,19 +2908,19 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
2896
2908
  const hasResult = typeof input.result === "string" && input.result.trim().length > 0;
2897
2909
  if (!hasResult) {
2898
2910
  return {
2899
- sql: `UPDATE tasks SET status = ?, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ?`,
2900
- args: [input.status, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope]
2911
+ sql: `UPDATE tasks SET status = ?, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ? AND status IS ?`,
2912
+ args: [input.status, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope, previousStatus]
2901
2913
  };
2902
2914
  }
2903
2915
  if (input.preserveResultIfPresent) {
2904
2916
  return {
2905
- sql: `UPDATE tasks SET status = ?, result = CASE WHEN result IS NULL OR trim(result, char(32)||char(9)||char(10)||char(13)) = '' THEN ? ELSE result END, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ?`,
2906
- args: [input.status, input.result, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope]
2917
+ sql: `UPDATE tasks SET status = ?, result = CASE WHEN result IS NULL OR trim(result, char(32)||char(9)||char(10)||char(13)) = '' THEN ? ELSE result END, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ? AND status IS ?`,
2918
+ args: [input.status, input.result, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope, previousStatus]
2907
2919
  };
2908
2920
  }
2909
2921
  return {
2910
- sql: `UPDATE tasks SET status = ?, result = ?, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ?`,
2911
- args: [input.status, input.result, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope]
2922
+ sql: `UPDATE tasks SET status = ?, result = ?, updated_at = ?${actualMinutesClause} WHERE id = ? AND project_name IS ? AND session_scope IS ? AND status IS ?`,
2923
+ args: [input.status, input.result, now, ...actualMinutesArgs, taskId, eventProjectName, eventSessionScope, previousStatus]
2912
2924
  };
2913
2925
  };
2914
2926
  const writeStatements = [];
@@ -2919,8 +2931,15 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
2919
2931
  });
2920
2932
  }
2921
2933
  writeStatements.push(buildStatusStatement());
2934
+ const assertStatusWriteLanded = (results) => {
2935
+ const affected = Number(results[results.length - 1]?.rowsAffected ?? 0);
2936
+ if (affected > 0) return;
2937
+ throw new Error(
2938
+ `Task ${taskId} changed underneath this update: expected status "${previousStatus}" when writing "${input.status}", but the row no longer matches. Another session very likely transitioned it first. Re-read the task and retry.`
2939
+ );
2940
+ };
2922
2941
  try {
2923
- await client.batch(writeStatements, "write");
2942
+ assertStatusWriteLanded(await client.batch(writeStatements, "write"));
2924
2943
  } catch (err) {
2925
2944
  const errMsg2 = err instanceof Error ? err.message : String(err);
2926
2945
  if (structuredSerialized && /structured_result/i.test(errMsg2)) {
@@ -2930,7 +2949,7 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
2930
2949
  );
2931
2950
  input.result = `<!-- STRUCTURED_RESULT:${structuredSerialized} -->
2932
2951
  ${input.result ?? ""}`;
2933
- await client.batch([buildStatusStatement()], "write");
2952
+ assertStatusWriteLanded(await client.batch([buildStatusStatement()], "write"));
2934
2953
  } else {
2935
2954
  throw err;
2936
2955
  }
@@ -3355,15 +3374,22 @@ async function ensureArchitectureDoc(baseDir, projectName) {
3355
3374
  } catch {
3356
3375
  }
3357
3376
  }
3377
+ var GITIGNORE_EXE_BLOCK = "# Employee task assignments (private)\n# exe/output/ stays tracked \u2014 it is the sanctioned deliverable handoff\n# location (bug 4c8d4c4b). Never collapse this back to a blanket /exe/.\n/exe/*\n!/exe/output/\n";
3358
3378
  async function ensureGitignoreExe(baseDir) {
3359
3379
  const gitignorePath = path5.join(baseDir, ".gitignore");
3360
3380
  try {
3361
3381
  if (existsSync6(gitignorePath)) {
3362
3382
  const content = readFileSync5(gitignorePath, "utf-8");
3363
- if (/^\/?exe\/?$/m.test(content)) return;
3364
- await appendFile(gitignorePath, "\n# Employee task assignments (private)\n/exe/\n");
3383
+ if (/^\/?exe\/\*$/m.test(content) && /^!\/?exe\/output\/?$/m.test(content)) return;
3384
+ if (/^\/?exe\/?$/m.test(content)) {
3385
+ const narrowed = content.replace(/^\/?exe\/?$/m, "/exe/*\n!/exe/output/");
3386
+ await writeFile(gitignorePath, narrowed, "utf-8");
3387
+ return;
3388
+ }
3389
+ await appendFile(gitignorePath, `
3390
+ ${GITIGNORE_EXE_BLOCK}`);
3365
3391
  } else {
3366
- await writeFile(gitignorePath, "# Employee task assignments (private)\n/exe/\n", "utf-8");
3392
+ await writeFile(gitignorePath, GITIGNORE_EXE_BLOCK, "utf-8");
3367
3393
  }
3368
3394
  } catch {
3369
3395
  }
@@ -3830,6 +3856,7 @@ function isStale(isoTimestamp) {
3830
3856
  if (!isoTimestamp) return false;
3831
3857
  return Date.now() - new Date(isoTimestamp).getTime() > STALE_REVIEW_AGE_MS;
3832
3858
  }
3859
+ var EFFECTIVE_REVIEWER_SQL = "(reviewer = ? OR (reviewer IS NULL AND assigned_by = ?))";
3833
3860
  function pendingReviewsCountOpts(sessionScope, reviewer) {
3834
3861
  return {
3835
3862
  status: "needs_review",
@@ -3838,8 +3865,8 @@ function pendingReviewsCountOpts(sessionScope, reviewer) {
3838
3865
  strictSession: sessionScope !== void 0,
3839
3866
  projectName: null,
3840
3867
  // no project filter for review counts
3841
- extraConditions: reviewer ? ["reviewer = ?"] : void 0,
3842
- extraArgs: reviewer ? [reviewer] : void 0,
3868
+ extraConditions: reviewer ? [EFFECTIVE_REVIEWER_SQL] : void 0,
3869
+ extraArgs: reviewer ? [reviewer, reviewer] : void 0,
3843
3870
  limit: 1,
3844
3871
  orderBy: "1"
3845
3872
  };
@@ -3855,8 +3882,8 @@ async function countNewPendingReviewsSince(sinceIso, sessionScope, reviewer) {
3855
3882
  const extraConditions = ["updated_at > ?"];
3856
3883
  const extraArgs = [sinceIso];
3857
3884
  if (reviewer) {
3858
- extraConditions.push("reviewer = ?");
3859
- extraArgs.push(reviewer);
3885
+ extraConditions.push(EFFECTIVE_REVIEWER_SQL);
3886
+ extraArgs.push(reviewer, reviewer);
3860
3887
  }
3861
3888
  const rows = await queryTaskRows({
3862
3889
  status: "needs_review",
@@ -3872,8 +3899,8 @@ async function countNewPendingReviewsSince(sinceIso, sessionScope, reviewer) {
3872
3899
  return Number(rows[0]?.cnt) || 0;
3873
3900
  }
3874
3901
  async function listPendingReviews(limit, sessionScope, projectName, reviewer) {
3875
- const extraConditions = reviewer ? ["reviewer = ?"] : void 0;
3876
- const extraArgs = reviewer ? [reviewer] : void 0;
3902
+ const extraConditions = reviewer ? [EFFECTIVE_REVIEWER_SQL] : void 0;
3903
+ const extraArgs = reviewer ? [reviewer, reviewer] : void 0;
3877
3904
  const rows = await queryTaskRows({
3878
3905
  status: "needs_review",
3879
3906
  columns: "title, assigned_to, reviewer, project_name, updated_at",
@@ -5087,12 +5114,14 @@ function resolveExeSession() {
5087
5114
  function isEmployeeAlive(sessionName) {
5088
5115
  return getTransport().isAlive(sessionName);
5089
5116
  }
5090
- function findFreeInstance(employeeName, exeSession, maxInstances = 10, isAlive = isEmployeeAlive) {
5117
+ function findFreeInstance(employeeName, exeSession, maxInstances = 10, isAlive = isEmployeeAlive, isIdle) {
5091
5118
  const base = employeeSessionName(employeeName, exeSession);
5092
5119
  if (!isAlive(base) && acquireSpawnLock(base)) return 0;
5120
+ if (isIdle && isAlive(base) && isIdle(base) && acquireSpawnLock(base)) return 0;
5093
5121
  for (let i = 2; i <= maxInstances; i++) {
5094
5122
  const candidate = employeeSessionName(employeeName, exeSession, i);
5095
5123
  if (!isAlive(candidate) && acquireSpawnLock(candidate)) return i;
5124
+ if (isIdle && isAlive(candidate) && isIdle(candidate) && acquireSpawnLock(candidate)) return i;
5096
5125
  }
5097
5126
  return null;
5098
5127
  }
@@ -5158,7 +5187,7 @@ async function verifyPaneAtCapacity(sessionName) {
5158
5187
  reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
5159
5188
  };
5160
5189
  }
5161
- const { isAtCapacity } = await import("./capacity-monitor-FKMQXORX.js");
5190
+ const { isAtCapacity } = await import("./capacity-monitor-SAXCQK7O.js");
5162
5191
  if (!isAtCapacity(pane)) {
5163
5192
  return {
5164
5193
  atCapacity: false,
@@ -5307,23 +5336,65 @@ function confirmNudgeSubmitted(targetSession, runtime) {
5307
5336
  const transport = getTransport();
5308
5337
  if (typeof transport.submitEnter !== "function") return true;
5309
5338
  for (let attempt = 0; attempt < SUBMIT_CONFIRM_ATTEMPTS; attempt++) {
5310
- if (!sessionHasPendingInput(targetSession)) return true;
5339
+ const verdict = classifyNudgeDelivery(capturePaneSafe(targetSession));
5340
+ if (verdict.state === "confirmed") return true;
5341
+ if (!isSubmitRepairable(verdict.reason)) return false;
5311
5342
  transport.submitEnter(targetSession, runtime);
5312
5343
  confirmSleepSync(SUBMIT_CONFIRM_DELAY_MS);
5313
5344
  }
5314
- return !sessionHasPendingInput(targetSession);
5345
+ return classifyNudgeDelivery(capturePaneSafe(targetSession)).state === "confirmed";
5315
5346
  }
5316
5347
  async function confirmNudgeSubmittedAsync(targetSession, runtime) {
5317
5348
  const isCodex = runtime === "codex";
5318
5349
  for (let attempt = 0; attempt < SUBMIT_CONFIRM_ATTEMPTS; attempt++) {
5319
- if (!await sessionHasPendingInputAsync(targetSession)) return true;
5350
+ const verdict = classifyNudgeDelivery(await capturePaneSafeAsync(targetSession));
5351
+ if (verdict.state === "confirmed") return true;
5352
+ if (!isSubmitRepairable(verdict.reason)) return false;
5320
5353
  try {
5321
5354
  await execFileAsync3("tmux", ["send-keys", "-t", targetSession, isCodex ? "C-m" : "Enter"], { timeout: 1e3 });
5322
5355
  } catch {
5323
5356
  }
5324
5357
  await new Promise((r) => setTimeout(r, SUBMIT_CONFIRM_DELAY_MS));
5325
5358
  }
5326
- return !await sessionHasPendingInputAsync(targetSession);
5359
+ return classifyNudgeDelivery(await capturePaneSafeAsync(targetSession)).state === "confirmed";
5360
+ }
5361
+ function capturePaneSafe(sessionName) {
5362
+ try {
5363
+ return getTransport().capturePane(sessionName, PANE_TAIL_LINES);
5364
+ } catch {
5365
+ return null;
5366
+ }
5367
+ }
5368
+ async function capturePaneSafeAsync(sessionName) {
5369
+ try {
5370
+ return await captureSessionPaneAsync(sessionName, PANE_TAIL_LINES);
5371
+ } catch {
5372
+ return null;
5373
+ }
5374
+ }
5375
+ function classifyNudgeDelivery(paneAfterSend) {
5376
+ if (paneAfterSend === null) return { state: "unconfirmed", reason: "capture_failed" };
5377
+ const blocked = paneBlockedState(paneAfterSend);
5378
+ if (blocked !== null) return { state: "unconfirmed", reason: blocked };
5379
+ if (paneHasPendingInput(paneAfterSend)) return { state: "unconfirmed", reason: "pending_input" };
5380
+ return { state: "confirmed" };
5381
+ }
5382
+ function isSubmitRepairable(reason) {
5383
+ return reason === "pending_input" || reason === "queued_messages";
5384
+ }
5385
+ function verifyNudgeDelivered(targetSession, runtime, mayPressEnter) {
5386
+ const verdict = classifyNudgeDelivery(capturePaneSafe(targetSession));
5387
+ if (verdict.state === "confirmed") return verdict;
5388
+ if (!mayPressEnter || !isSubmitRepairable(verdict.reason)) return verdict;
5389
+ confirmNudgeSubmitted(targetSession, runtime);
5390
+ return classifyNudgeDelivery(capturePaneSafe(targetSession));
5391
+ }
5392
+ async function verifyNudgeDeliveredAsync(targetSession, runtime, mayPressEnter) {
5393
+ const verdict = classifyNudgeDelivery(await capturePaneSafeAsync(targetSession));
5394
+ if (verdict.state === "confirmed") return verdict;
5395
+ if (!mayPressEnter || !isSubmitRepairable(verdict.reason)) return verdict;
5396
+ await confirmNudgeSubmittedAsync(targetSession, runtime);
5397
+ return classifyNudgeDelivery(await capturePaneSafeAsync(targetSession));
5327
5398
  }
5328
5399
  function isSessionBusy(sessionName) {
5329
5400
  const state = getSessionState(sessionName);
@@ -5334,11 +5405,42 @@ function isExeSession(sessionName) {
5334
5405
  const coordinatorName = getCoordinatorName();
5335
5406
  return matchesBaseWithInstance(coordinatorName);
5336
5407
  }
5408
+ function isProvenIntercomDelivery(result) {
5409
+ return result === "acknowledged" || result === "delivered";
5410
+ }
5411
+ function classifyIntercomHandoff(result) {
5412
+ switch (result) {
5413
+ case "delivered":
5414
+ case "sent":
5415
+ return "intercom_unprocessed";
5416
+ case "acknowledged":
5417
+ case "skipped_exe":
5418
+ case "debounced":
5419
+ case "queued":
5420
+ return "intercom_sent";
5421
+ case "failed":
5422
+ return "failed";
5423
+ default: {
5424
+ const exhaustive = result;
5425
+ return exhaustive;
5426
+ }
5427
+ }
5428
+ }
5337
5429
  var PROMPT_INPUT_LINE = /(?:^|\s|│)\s*[❯›>]\s?(.*)$/u;
5338
5430
  var PROMPT_PLACEHOLDER = /^Try\s+["'“]/u;
5431
+ var PANE_BLOCKED_MARKERS = [
5432
+ ["queued_messages", /press\s+up\s+to\s+edit\s+queued\s+messages?/iu]
5433
+ ];
5434
+ var PANE_TAIL_LINES = 12;
5435
+ function paneBlockedState(pane) {
5436
+ const tail = pane.split("\n").slice(-PANE_TAIL_LINES).join("\n");
5437
+ for (const [state, re] of PANE_BLOCKED_MARKERS) if (re.test(tail)) return state;
5438
+ return null;
5439
+ }
5339
5440
  function paneHasPendingInput(pane) {
5441
+ if (paneBlockedState(pane) !== null) return true;
5340
5442
  const lines = pane.split("\n");
5341
- const tail = lines.slice(-12);
5443
+ const tail = lines.slice(-PANE_TAIL_LINES);
5342
5444
  for (let i = tail.length - 1; i >= 0; i--) {
5343
5445
  const line = tail[i];
5344
5446
  if (!line || line.trim().length === 0) continue;
@@ -5392,7 +5494,7 @@ async function countScopedPendingReviews(targetSession, reviewer) {
5392
5494
  }
5393
5495
  async function countScopedOpenTasks(targetSession, agentId) {
5394
5496
  try {
5395
- const { fastDbInit } = await import("./fast-db-init-SCTOOIUT.js");
5497
+ const { fastDbInit } = await import("./fast-db-init-L2RGKJWH.js");
5396
5498
  const client = await fastDbInit();
5397
5499
  const scope = extractRootExe(targetSession);
5398
5500
  if (!scope) return 0;
@@ -5447,7 +5549,7 @@ function buildScopedInProgressTaskQuery(targetSession) {
5447
5549
  async function findScopedInProgressTaskId(targetSession) {
5448
5550
  const q = buildScopedInProgressTaskQuery(targetSession);
5449
5551
  if (!q) return null;
5450
- const { fastDbInit } = await import("./fast-db-init-SCTOOIUT.js");
5552
+ const { fastDbInit } = await import("./fast-db-init-L2RGKJWH.js");
5451
5553
  const client = await fastDbInit();
5452
5554
  const result = await client.execute(q);
5453
5555
  const id = result.rows[0]?.id;
@@ -5493,7 +5595,7 @@ async function decideDrainSend(item, ctx) {
5493
5595
  return true;
5494
5596
  }
5495
5597
  const result = await ctx.deliver(item.targetSession, item.intercomReason ?? "nudge");
5496
- return result === "delivered" || result === "debounced" || result === "skipped_exe";
5598
+ return result === "delivered" || result === "sent" || result === "debounced" || result === "skipped_exe";
5497
5599
  }
5498
5600
  function sendIntercom(targetSession, opts) {
5499
5601
  const transport = getTransport();
@@ -5566,9 +5668,9 @@ function sendIntercom(targetSession, opts) {
5566
5668
  } catch {
5567
5669
  }
5568
5670
  const ledgerEnv = (process.env.EXE_NOTIFICATION_LEDGER ?? "").trim().toLowerCase();
5569
- if (ledgerEnv === "shadow" || ledgerEnv === "on") {
5671
+ if (ledgerEnv === "shadow") {
5570
5672
  const ledgerScope = opts && "callerSessionScope" in opts ? opts.callerSessionScope : void 0;
5571
- void import("./notification-ledger-6QRLQW4Q.js").then((m) => m.recordShadowNudge(targetSession, reason, ledgerScope, { force: opts?.force })).catch(() => {
5673
+ void import("./notification-ledger-CLGM7ODF.js").then((m) => m.recordShadowNudge(targetSession, reason, ledgerScope, { force: opts?.force })).catch(() => {
5572
5674
  });
5573
5675
  }
5574
5676
  if (!opts?.force && isDebounced(targetSession)) {
@@ -5624,11 +5726,17 @@ function sendIntercom(targetSession, opts) {
5624
5726
  }
5625
5727
  if (sessionHasPendingInput(targetSession)) {
5626
5728
  const isEmployeePane = targetSession.includes("-") && !isExeSession(targetSession) && !isCoordinatorName(rawAgent);
5729
+ const resubmitAt = Date.now();
5627
5730
  if (sessionState === "idle" && isEmployeePane && typeof transport.submitEnter === "function" && confirmNudgeSubmitted(targetSession, resolveSessionRuntime(targetSession))) {
5628
5731
  const batched3 = recordDebounce(targetSession);
5629
- logIntercom(`RESUBMITTED \u2192 ${targetSession} (completed half-delivered nudge \u2014 pressed Enter)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
5630
- recordResult("delivered", "resubmit_pending_input");
5631
- return "delivered";
5732
+ if (hasIntercomAckAfter(targetSession, resubmitAt)) {
5733
+ logIntercom(`RESUBMITTED \u2192 ${targetSession} (completed half-delivered nudge \u2014 pressed Enter + target ack)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
5734
+ recordResult("delivered", "resubmit_pending_input");
5735
+ return "delivered";
5736
+ }
5737
+ logIntercom(`RESUBMITTED \u2192 ${targetSession} (pressed Enter; awaiting target ack)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
5738
+ recordResult("sent", "resubmit_pending_input");
5739
+ return "sent";
5632
5740
  }
5633
5741
  queueIntercom(targetSession, "non-empty input buffer at send time", reason);
5634
5742
  const batched2 = recordDebounce(targetSession);
@@ -5638,18 +5746,25 @@ function sendIntercom(targetSession, opts) {
5638
5746
  }
5639
5747
  const msg = formatIntercomPrompt(reason);
5640
5748
  const runtime = resolveSessionRuntime(targetSession);
5749
+ const injectedAt = Date.now();
5641
5750
  transport.sendKeysLiteral(targetSession, msg, runtime);
5642
- if (sessionState === "idle" && !confirmNudgeSubmitted(targetSession, runtime)) {
5643
- queueIntercom(targetSession, "nudge typed but submit Enter unconfirmed (e4889b61)", reason);
5751
+ const verdict = verifyNudgeDelivered(targetSession, runtime, sessionState === "idle");
5752
+ if (verdict.state !== "confirmed") {
5753
+ queueIntercom(targetSession, `nudge unconfirmed at target pane (${verdict.reason})`, reason);
5644
5754
  const batched2 = recordDebounce(targetSession);
5645
- logIntercom(`UNCONFIRMED \u2192 ${targetSession} (typed but not submitted \u2014 re-queued)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
5646
- recordResult("queued", "submit_unconfirmed");
5755
+ logIntercom(`UNCONFIRMED \u2192 ${targetSession} (${verdict.reason} \u2014 re-queued)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
5756
+ recordResult("queued", `unconfirmed_${verdict.reason}`);
5647
5757
  return "queued";
5648
5758
  }
5649
5759
  const batched = recordDebounce(targetSession);
5650
- logIntercom(`DELIVERED \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (fire-and-forget)`);
5651
- recordResult("delivered");
5652
- return "delivered";
5760
+ if (hasIntercomAckAfter(targetSession, injectedAt)) {
5761
+ logIntercom(`DELIVERED \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (confirmed at target pane + target ack)`);
5762
+ recordResult("delivered");
5763
+ return "delivered";
5764
+ }
5765
+ logIntercom(`SENT \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (injected at target pane; awaiting target ack)`);
5766
+ recordResult("sent");
5767
+ return "sent";
5653
5768
  } catch (e) {
5654
5769
  process.stderr.write("[tmux-routing] sendIntercom to " + targetSession + ": " + (e instanceof Error ? e.message : String(e)) + "\n");
5655
5770
  logIntercom(`FAIL \u2192 ${targetSession}`);
@@ -5662,58 +5777,64 @@ var DEFERRED_SPAWN_NUDGE_RETRY_MS = Number(process.env.EXE_DEFERRED_SPAWN_NUDGE_
5662
5777
  function scheduleDeferredSpawnNudge(input) {
5663
5778
  const attemptSend = (attempt) => {
5664
5779
  setTimeout(() => {
5665
- try {
5666
- if (!input.transport.isAlive(input.sessionName)) {
5667
- throw new Error("session not alive at deferred nudge time");
5668
- }
5669
- input.transport.sendKeysLiteral(input.sessionName, input.message, input.runtime);
5670
- process.stderr.write(
5671
- `[tmux-routing] deferred spawn nudge delivered to ${input.sessionName} (attempt ${attempt}/${DEFERRED_SPAWN_NUDGE_ATTEMPTS})
5780
+ void (async () => {
5781
+ try {
5782
+ if (!input.transport.isAlive(input.sessionName)) {
5783
+ throw new Error("session not alive at deferred nudge time");
5784
+ }
5785
+ input.transport.sendKeysLiteral(input.sessionName, input.message, input.runtime);
5786
+ const verdict = await verifyNudgeDeliveredAsync(input.sessionName, input.runtime, true);
5787
+ if (verdict.state !== "confirmed") {
5788
+ throw new Error(`nudge unconfirmed at target pane (${verdict.reason})`);
5789
+ }
5790
+ process.stderr.write(
5791
+ `[tmux-routing] deferred spawn nudge delivered to ${input.sessionName} (attempt ${attempt}/${DEFERRED_SPAWN_NUDGE_ATTEMPTS})
5672
5792
  `
5673
- );
5674
- recordOrchestrationEventBestEffort({
5675
- eventType: "dispatch.spawn_nudge.delivered",
5676
- source: "tmux-routing.scheduleDeferredSpawnNudge",
5677
- agentId: input.employeeName,
5678
- sessionScope: input.exeSession,
5679
- tmuxSession: input.sessionName,
5680
- runtime: input.runtime,
5681
- result: "delivered",
5682
- payload: { attempt }
5683
- });
5684
- } catch (err) {
5685
- const msg = err instanceof Error ? err.message : String(err);
5686
- process.stderr.write(
5687
- `[tmux-routing] deferred spawn nudge failed for ${input.sessionName} (attempt ${attempt}/${DEFERRED_SPAWN_NUDGE_ATTEMPTS}): ${msg}
5793
+ );
5794
+ recordOrchestrationEventBestEffort({
5795
+ eventType: "dispatch.spawn_nudge.delivered",
5796
+ source: "tmux-routing.scheduleDeferredSpawnNudge",
5797
+ agentId: input.employeeName,
5798
+ sessionScope: input.exeSession,
5799
+ tmuxSession: input.sessionName,
5800
+ runtime: input.runtime,
5801
+ result: "delivered",
5802
+ payload: { attempt }
5803
+ });
5804
+ } catch (err) {
5805
+ const msg = err instanceof Error ? err.message : String(err);
5806
+ process.stderr.write(
5807
+ `[tmux-routing] deferred spawn nudge failed for ${input.sessionName} (attempt ${attempt}/${DEFERRED_SPAWN_NUDGE_ATTEMPTS}): ${msg}
5688
5808
  `
5689
- );
5690
- recordOrchestrationEventBestEffort({
5691
- eventType: "dispatch.spawn_nudge.failed",
5692
- source: "tmux-routing.scheduleDeferredSpawnNudge",
5693
- severity: "warn",
5694
- agentId: input.employeeName,
5695
- sessionScope: input.exeSession,
5696
- tmuxSession: input.sessionName,
5697
- runtime: input.runtime,
5698
- result: "failed",
5699
- errorCode: "deferred_nudge_failed",
5700
- payload: { attempt, error: msg }
5701
- });
5702
- if (attempt < DEFERRED_SPAWN_NUDGE_ATTEMPTS) {
5703
- attemptSend(attempt + 1);
5704
- return;
5809
+ );
5810
+ recordOrchestrationEventBestEffort({
5811
+ eventType: "dispatch.spawn_nudge.failed",
5812
+ source: "tmux-routing.scheduleDeferredSpawnNudge",
5813
+ severity: "warn",
5814
+ agentId: input.employeeName,
5815
+ sessionScope: input.exeSession,
5816
+ tmuxSession: input.sessionName,
5817
+ runtime: input.runtime,
5818
+ result: "failed",
5819
+ errorCode: "deferred_nudge_failed",
5820
+ payload: { attempt, error: msg }
5821
+ });
5822
+ if (attempt < DEFERRED_SPAWN_NUDGE_ATTEMPTS) {
5823
+ attemptSend(attempt + 1);
5824
+ return;
5825
+ }
5826
+ queueIntercom(input.sessionName, `spawn nudge failed after ${attempt} attempts: ${msg}`, "signal");
5827
+ void import("./notifications-MACUZPYP.js").then(({ writeNotification: writeNotification2 }) => writeNotification2({
5828
+ agentId: getCoordinatorName(),
5829
+ agentRole: "COO",
5830
+ event: "error_spike",
5831
+ project: "",
5832
+ summary: `Spawned ${input.sessionName}, but the initial task nudge failed after ${attempt} attempts (${msg}). Worker may be idle with open task; check session and re-dispatch if needed.`,
5833
+ sessionScope: input.exeSession
5834
+ })).catch(() => {
5835
+ });
5705
5836
  }
5706
- queueIntercom(input.sessionName, `spawn nudge failed after ${attempt} attempts: ${msg}`, "signal");
5707
- void import("./notifications-7B6D7Y5C.js").then(({ writeNotification: writeNotification2 }) => writeNotification2({
5708
- agentId: getCoordinatorName(),
5709
- agentRole: "COO",
5710
- event: "error_spike",
5711
- project: "",
5712
- summary: `Spawned ${input.sessionName}, but the initial task nudge failed after ${attempt} attempts (${msg}). Worker may be idle with open task; check session and re-dispatch if needed.`,
5713
- sessionScope: input.exeSession
5714
- })).catch(() => {
5715
- });
5716
- }
5837
+ })();
5717
5838
  }, attempt === 1 ? 1e4 : DEFERRED_SPAWN_NUDGE_RETRY_MS);
5718
5839
  };
5719
5840
  attemptSend(1);
@@ -5798,7 +5919,7 @@ async function sendIntercomAsync(targetSession, opts) {
5798
5919
  let ledgerClaim = null;
5799
5920
  if (authoritativeLedger) {
5800
5921
  try {
5801
- const { claimAuthoritativeNudge } = await import("./notification-ledger-6QRLQW4Q.js");
5922
+ const { claimAuthoritativeNudge } = await import("./notification-ledger-CLGM7ODF.js");
5802
5923
  const claim2 = await claimAuthoritativeNudge(
5803
5924
  targetSession,
5804
5925
  reason,
@@ -5821,7 +5942,7 @@ async function sendIntercomAsync(targetSession, opts) {
5821
5942
  const markLedgerDelivered = async () => {
5822
5943
  if (!ledgerClaim) return;
5823
5944
  try {
5824
- const { markNudgeDelivered } = await import("./notification-ledger-6QRLQW4Q.js");
5945
+ const { markNudgeDelivered } = await import("./notification-ledger-CLGM7ODF.js");
5825
5946
  await markNudgeDelivered(ledgerClaim.id, ledgerClaim.sessionScope);
5826
5947
  } catch {
5827
5948
  }
@@ -5829,7 +5950,7 @@ async function sendIntercomAsync(targetSession, opts) {
5829
5950
  const markLedgerFailed = async (error) => {
5830
5951
  if (!ledgerClaim) return;
5831
5952
  try {
5832
- const { markNudgeDeliveryFailed } = await import("./notification-ledger-6QRLQW4Q.js");
5953
+ const { markNudgeDeliveryFailed } = await import("./notification-ledger-CLGM7ODF.js");
5833
5954
  await markNudgeDeliveryFailed(ledgerClaim.id, error, ledgerClaim.sessionScope);
5834
5955
  } catch {
5835
5956
  }
@@ -5880,12 +6001,18 @@ async function sendIntercomAsync(targetSession, opts) {
5880
6001
  }
5881
6002
  if (await sessionHasPendingInputAsync(targetSession)) {
5882
6003
  const isEmployeePane = targetSession.includes("-") && !isExeSession(targetSession) && !isCoordinatorName(rawAgent);
6004
+ const resubmitAt = Date.now();
5883
6005
  if (sessionState === "idle" && isEmployeePane && await confirmNudgeSubmittedAsync(targetSession, resolveSessionRuntime(targetSession))) {
5884
6006
  const batched3 = recordDebounce(targetSession);
5885
- logIntercom(`RESUBMITTED \u2192 ${targetSession} (completed half-delivered nudge \u2014 pressed Enter)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
5886
- await markLedgerDelivered();
5887
- recordResult("delivered", "resubmit_pending_input");
5888
- return "delivered";
6007
+ if (hasIntercomAckAfter(targetSession, resubmitAt)) {
6008
+ logIntercom(`RESUBMITTED \u2192 ${targetSession} (completed half-delivered nudge \u2014 pressed Enter + target ack)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
6009
+ await markLedgerDelivered();
6010
+ recordResult("delivered", "resubmit_pending_input");
6011
+ return "delivered";
6012
+ }
6013
+ logIntercom(`RESUBMITTED \u2192 ${targetSession} (pressed Enter; awaiting target ack)${batched3 > 0 ? ` [${batched3} batched]` : ""}`);
6014
+ recordResult("sent", "resubmit_pending_input");
6015
+ return "sent";
5889
6016
  }
5890
6017
  queueIntercom(targetSession, "non-empty input buffer at send time", reason);
5891
6018
  const batched2 = recordDebounce(targetSession);
@@ -5894,19 +6021,27 @@ async function sendIntercomAsync(targetSession, opts) {
5894
6021
  return "queued";
5895
6022
  }
5896
6023
  const runtime = resolveSessionRuntime(targetSession);
6024
+ const injectedAt = Date.now();
5897
6025
  await sendKeysLiteralAsync(targetSession, formatIntercomPrompt(reason), runtime);
5898
- if (sessionState === "idle" && !await confirmNudgeSubmittedAsync(targetSession, runtime)) {
5899
- queueIntercom(targetSession, "nudge typed but submit Enter unconfirmed (e4889b61)", reason);
6026
+ const verdict = await verifyNudgeDeliveredAsync(targetSession, runtime, sessionState === "idle");
6027
+ if (verdict.state !== "confirmed") {
6028
+ queueIntercom(targetSession, `nudge unconfirmed at target pane (${verdict.reason})`, reason);
5900
6029
  const batched2 = recordDebounce(targetSession);
5901
- logIntercom(`UNCONFIRMED \u2192 ${targetSession} (typed but not submitted \u2014 re-queued)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
5902
- recordResult("queued", "submit_unconfirmed");
6030
+ logIntercom(`UNCONFIRMED \u2192 ${targetSession} (${verdict.reason} \u2014 re-queued)${batched2 > 0 ? ` [${batched2} batched]` : ""}`);
6031
+ await markLedgerFailed(`unconfirmed_${verdict.reason}`);
6032
+ recordResult("queued", `unconfirmed_${verdict.reason}`);
5903
6033
  return "queued";
5904
6034
  }
5905
6035
  const batched = recordDebounce(targetSession);
5906
- logIntercom(`DELIVERED \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (async fire-and-forget)`);
5907
- await markLedgerDelivered();
5908
- recordResult("delivered");
5909
- return "delivered";
6036
+ if (hasIntercomAckAfter(targetSession, injectedAt)) {
6037
+ logIntercom(`DELIVERED \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (confirmed at target pane + target ack)`);
6038
+ await markLedgerDelivered();
6039
+ recordResult("delivered");
6040
+ return "delivered";
6041
+ }
6042
+ logIntercom(`SENT \u2192 ${targetSession}${batched > 0 ? ` [${batched} nudges batched during debounce]` : ""} (injected at target pane; awaiting target ack)`);
6043
+ recordResult("sent");
6044
+ return "sent";
5910
6045
  } catch (e) {
5911
6046
  process.stderr.write("[tmux-routing] sendIntercomAsync to " + targetSession + ": " + (e instanceof Error ? e.message : String(e)) + "\n");
5912
6047
  logIntercom(`FAIL \u2192 ${targetSession}`);
@@ -6083,13 +6218,11 @@ function ensureEmployee(employeeName, exeSession, projectDir, opts) {
6083
6218
  reason: "signal",
6084
6219
  callerSessionScope: exeSession
6085
6220
  });
6086
- if (result2 === "delivered") {
6087
- return { status: "intercom_unprocessed", sessionName: liveSession };
6088
- }
6089
- if (result2 === "acknowledged" || result2 === "skipped_exe" || result2 === "debounced" || result2 === "queued") {
6090
- return { status: "intercom_sent", sessionName: liveSession };
6221
+ const status = classifyIntercomHandoff(result2);
6222
+ if (status === "failed") {
6223
+ return { status, sessionName: liveSession, error: "intercom delivery failed during spawn mutex handoff" };
6091
6224
  }
6092
- return { status: "failed", sessionName: liveSession, error: "intercom delivery failed during spawn mutex handoff" };
6225
+ return { status, sessionName: liveSession };
6093
6226
  }
6094
6227
  const baseSession = employeeSessionName(employeeName, exeSession);
6095
6228
  const message = `Spawn already in flight for ${baseAgentName(employeeName)} in coordinator session ${exeSession}; refusing to create a numbered duplicate before tmux liveness is established. Retry after the active spawn finishes.`;
@@ -6115,7 +6248,10 @@ function ensureEmployee(employeeName, exeSession, projectDir, opts) {
6115
6248
  const free = findFreeInstance(
6116
6249
  employeeName,
6117
6250
  exeSession,
6118
- opts.maxAutoInstances ?? 10
6251
+ opts.maxAutoInstances ?? 10,
6252
+ isEmployeeAlive,
6253
+ // Bug 3d7c9fea: prefer an alive-but-idle session over spawning a duplicate.
6254
+ (s) => getSessionState(s) === "idle"
6119
6255
  );
6120
6256
  if (free === null) {
6121
6257
  releaseSpawnMutexIfOwned();
@@ -6169,13 +6305,11 @@ function ensureEmployee(employeeName, exeSession, projectDir, opts) {
6169
6305
  releaseIfOwned();
6170
6306
  releaseSpawnMutexIfOwned();
6171
6307
  const result2 = sendIntercom(sessionName, { force: true, reason: "signal", callerSessionScope: exeSession });
6172
- if (result2 === "acknowledged" || result2 === "skipped_exe" || result2 === "debounced" || result2 === "queued") {
6173
- return { status: "intercom_sent", sessionName };
6308
+ const status = classifyIntercomHandoff(result2);
6309
+ if (status === "failed") {
6310
+ return { status, sessionName, error: "intercom delivery failed" };
6174
6311
  }
6175
- if (result2 === "delivered") {
6176
- return { status: "intercom_unprocessed", sessionName };
6177
- }
6178
- return { status: "failed", sessionName, error: "intercom delivery failed" };
6312
+ return { status, sessionName };
6179
6313
  }
6180
6314
  const spawnOpts = { ...opts, instance: effectiveInstance };
6181
6315
  if (!spawnOpts.cwd) {
@@ -6297,13 +6431,11 @@ async function ensureEmployeeAsync(employeeName, exeSession, projectDir, opts) {
6297
6431
  reason: "signal",
6298
6432
  callerSessionScope: exeSession
6299
6433
  });
6300
- if (result2 === "delivered") {
6301
- return { status: "intercom_unprocessed", sessionName: liveSession };
6302
- }
6303
- if (result2 === "acknowledged" || result2 === "skipped_exe" || result2 === "debounced" || result2 === "queued") {
6304
- return { status: "intercom_sent", sessionName: liveSession };
6434
+ const status = classifyIntercomHandoff(result2);
6435
+ if (status === "failed") {
6436
+ return { status, sessionName: liveSession, error: "intercom delivery failed during spawn mutex handoff" };
6305
6437
  }
6306
- return { status: "failed", sessionName: liveSession, error: "intercom delivery failed during spawn mutex handoff" };
6438
+ return { status, sessionName: liveSession };
6307
6439
  }
6308
6440
  const baseSession = employeeSessionName(employeeName, exeSession);
6309
6441
  const message = `Spawn already in flight for ${baseAgentName(employeeName)} in coordinator session ${exeSession}; refusing to create a numbered duplicate before tmux liveness is established. Retry after the active spawn finishes.`;
@@ -6323,7 +6455,31 @@ async function ensureEmployeeAsync(employeeName, exeSession, projectDir, opts) {
6323
6455
  return { status: "failed", sessionName: baseSession, error: message };
6324
6456
  }
6325
6457
  }
6326
- const free = findFreeInstance(employeeName, exeSession, asyncOpts.maxAutoInstances ?? 10);
6458
+ const maxAuto = asyncOpts.maxAutoInstances ?? 10;
6459
+ const idleSet = /* @__PURE__ */ new Set();
6460
+ {
6461
+ const slotNames = [
6462
+ employeeSessionName(employeeName, exeSession),
6463
+ ...Array.from(
6464
+ { length: Math.max(0, maxAuto - 1) },
6465
+ (_, k) => employeeSessionName(employeeName, exeSession, k + 2)
6466
+ )
6467
+ ];
6468
+ await Promise.all(
6469
+ slotNames.map(async (s) => {
6470
+ if (isEmployeeAlive(s) && await getSessionStateAsync(s) === "idle") {
6471
+ idleSet.add(s);
6472
+ }
6473
+ })
6474
+ );
6475
+ }
6476
+ const free = findFreeInstance(
6477
+ employeeName,
6478
+ exeSession,
6479
+ maxAuto,
6480
+ isEmployeeAlive,
6481
+ (s) => idleSet.has(s)
6482
+ );
6327
6483
  if (free === null) {
6328
6484
  releaseSpawnMutexIfOwned();
6329
6485
  return {
@@ -6467,6 +6623,9 @@ function paneShowsRuntimeBanner(pane, runtime) {
6467
6623
  if (runtime === "codex") {
6468
6624
  return pane.includes("codex") || pane.includes("Codex") || pane.includes("exe-start-codex");
6469
6625
  }
6626
+ if (runtime === "opencode") {
6627
+ return pane.includes("opencode") || pane.includes("OpenCode") || pane.includes("exe-start-opencode");
6628
+ }
6470
6629
  return pane.includes("Claude Code") || pane.includes("\u276F");
6471
6630
  }
6472
6631
  function classifySpawnFailurePane(pane) {
@@ -7462,8 +7621,14 @@ export {
7462
7621
  sessionHasPendingInputAsync,
7463
7622
  confirmNudgeSubmitted,
7464
7623
  confirmNudgeSubmittedAsync,
7624
+ classifyNudgeDelivery,
7625
+ verifyNudgeDelivered,
7626
+ verifyNudgeDeliveredAsync,
7465
7627
  isSessionBusy,
7466
7628
  isExeSession,
7629
+ isProvenIntercomDelivery,
7630
+ classifyIntercomHandoff,
7631
+ paneBlockedState,
7467
7632
  paneHasPendingInput,
7468
7633
  isBlockedCodexPrompt,
7469
7634
  sessionHasPendingInput,