@askexenow/exe-os 0.9.414 → 0.9.416

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 (427) hide show
  1. package/deploy/compose/.env.customer.example +1 -1
  2. package/deploy/compose/.env.default +1 -1
  3. package/deploy/compose/.env.example +1 -1
  4. package/deploy/compose/docker-compose.yml +1 -1
  5. package/deploy/stack-manifests/v0.9.json +399 -2
  6. package/dist/.dist-verified.json +3 -3
  7. package/dist/{active-agent-3YCLS7GB.js → active-agent-JWICRWAA.js} +7 -6
  8. package/dist/{active-agent-MHWQDMML.js → active-agent-RPMMKZIG.js} +7 -6
  9. package/dist/{agent-defs-generator-DNXMO34I.js → agent-defs-generator-2Y5YFAS2.js} +6 -5
  10. package/dist/{agentic-ontology-RA6CMND6.js → agentic-ontology-C7G2MB5M.js} +1 -1
  11. package/dist/{artifact-backup-EETHNFFP.js → artifact-backup-EQVE4ROK.js} +3 -3
  12. package/dist/{backfill-metadata-WYT257VG.js → backfill-metadata-RC2WERVZ.js} +9 -8
  13. package/dist/{backup-verify-AG54CYGR.js → backup-verify-LPCD7ETV.js} +3 -2
  14. package/dist/{behavior-injection-G7GAUHGO.js → behavior-injection-LXWODFAO.js} +12 -11
  15. package/dist/{behavior-promotion-I2DIUFUR.js → behavior-promotion-2NNDBZE7.js} +11 -10
  16. package/dist/{behaviors-SKVKPCRW.js → behaviors-Q7SJG54Y.js} +10 -9
  17. package/dist/bin/agentic-ontology-backfill.js +10 -9
  18. package/dist/bin/agentic-reflection-backfill.js +11 -10
  19. package/dist/bin/agentic-semantic-label.js +10 -9
  20. package/dist/bin/backfill-conversations.js +9 -8
  21. package/dist/bin/backfill-responses.js +9 -8
  22. package/dist/bin/backfill-vectors.js +9 -8
  23. package/dist/bin/bulk-sync-postgres.js +18 -17
  24. package/dist/bin/cc-doctor.js +11 -10
  25. package/dist/bin/cleanup-stale-review-tasks.js +18 -17
  26. package/dist/bin/cli.js +60 -36
  27. package/dist/bin/deferred-daemon-restart.js +106 -105
  28. package/dist/bin/exe-actions.js +1 -1
  29. package/dist/bin/exe-agent-config.js +5 -4
  30. package/dist/bin/exe-agent.js +17 -16
  31. package/dist/bin/exe-assign.js +10 -9
  32. package/dist/bin/exe-boot.js +39 -38
  33. package/dist/bin/exe-call.js +10 -9
  34. package/dist/bin/exe-cloud.js +19 -18
  35. package/dist/bin/exe-config-dump.js +5 -4
  36. package/dist/bin/exe-dispatch.js +19 -18
  37. package/dist/bin/exe-doctor.js +9 -8
  38. package/dist/bin/exe-export-behaviors.js +14 -13
  39. package/dist/bin/exe-forget.js +12 -11
  40. package/dist/bin/exe-gateway.js +11 -10
  41. package/dist/bin/exe-grant.js +6 -6
  42. package/dist/bin/exe-healthcheck.js +11 -10
  43. package/dist/bin/exe-heartbeat.js +24 -23
  44. package/dist/bin/exe-kill.js +23 -22
  45. package/dist/bin/exe-launch-agent.js +66 -33
  46. package/dist/bin/exe-mcp.js +8 -7
  47. package/dist/bin/exe-memory-reads.js +9 -8
  48. package/dist/bin/exe-new-employee.js +14 -13
  49. package/dist/bin/exe-os-mcp-proxy.js +8 -7
  50. package/dist/bin/exe-pending-messages.js +19 -18
  51. package/dist/bin/exe-pending-notifications.js +18 -17
  52. package/dist/bin/exe-pending-reviews.js +19 -18
  53. package/dist/bin/exe-rename.js +9 -8
  54. package/dist/bin/exe-review.js +22 -21
  55. package/dist/bin/exe-search.js +11 -10
  56. package/dist/bin/exe-session-cleanup.js +23 -22
  57. package/dist/bin/exe-settings.js +18 -17
  58. package/dist/bin/exe-start-codex.js +21 -20
  59. package/dist/bin/exe-start-opencode.js +19 -18
  60. package/dist/bin/exe-start.sh +10 -1
  61. package/dist/bin/exe-status.js +20 -19
  62. package/dist/bin/exe-support.js +3 -3
  63. package/dist/bin/exe-team.js +7 -6
  64. package/dist/bin/exe-telemetry.js +88 -0
  65. package/dist/bin/exe-watchdog.js +62 -23
  66. package/dist/bin/git-sweep.js +20 -19
  67. package/dist/bin/graph-backfill.js +10 -9
  68. package/dist/bin/graph-export.js +10 -9
  69. package/dist/bin/hooks-cli.js +1 -1
  70. package/dist/bin/import-history.js +14 -13
  71. package/dist/bin/install.js +109 -108
  72. package/dist/bin/intercom-check.js +5 -5
  73. package/dist/bin/mcp-sessions.js +2 -2
  74. package/dist/bin/orchestration-metrics.js +7 -6
  75. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  76. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  77. package/dist/bin/reconcile-backlog.js +2 -2
  78. package/dist/bin/registry-proxy.js +1 -1
  79. package/dist/bin/repair-document-chunks.js +9 -8
  80. package/dist/bin/scan-tasks.js +19 -18
  81. package/dist/bin/setup.js +4 -3
  82. package/dist/bin/shard-migrate.js +10 -9
  83. package/dist/bin/stack-update.js +4 -4
  84. package/dist/bin/vps-health-gate.js +1 -1
  85. package/dist/{boot-generation-RPJVFAQJ.js → boot-generation-TT4BOFXY.js} +6 -5
  86. package/dist/{boot-review-sections-FOPPZTJI.js → boot-review-sections-SSWOKMOO.js} +17 -16
  87. package/dist/{bug-landed-reconciler-FN5KPBRK.js → bug-landed-reconciler-NEL6KXHE.js} +8 -7
  88. package/dist/build-info.json +3 -3
  89. package/dist/build-manifest.json +1167 -1142
  90. package/dist/{capability-cards-YQWBEG7A.js → capability-cards-MKCOJ5S6.js} +5 -4
  91. package/dist/{capacity-monitor-7SMEJHYG.js → capacity-monitor-5KMDVKVR.js} +19 -18
  92. package/dist/{catchup-brief-IBQ26LEB.js → catchup-brief-POOPRVFD.js} +24 -23
  93. package/dist/{chunk-FPF2PJFK.js → chunk-2NGXGHPI.js} +3 -3
  94. package/dist/{chunk-O3BLL6MY.js → chunk-2WUBVHON.js} +1 -1
  95. package/dist/{chunk-GL5ZG72X.js → chunk-34GBZEGQ.js} +2 -2
  96. package/dist/{chunk-XC5OASHV.js → chunk-3IHWQZYF.js} +1 -1
  97. package/dist/{chunk-HDV2V25K.js → chunk-3NMNSVTE.js} +1 -1
  98. package/dist/{chunk-W4H2MZAS.js → chunk-3W6D3XED.js} +1 -1
  99. package/dist/{chunk-A5I2GYVQ.js → chunk-43J5Z6IO.js} +3 -3
  100. package/dist/{chunk-CRW63CDI.js → chunk-45JIJNHH.js} +1 -1
  101. package/dist/{chunk-SINIRUYZ.js → chunk-4LCZYKVK.js} +122 -40
  102. package/dist/{chunk-TS4LSNRI.js → chunk-4W7PBI5U.js} +1 -1
  103. package/dist/{chunk-X4FHT6ST.js → chunk-552CGKS7.js} +9 -9
  104. package/dist/{chunk-FSXMKIDO.js → chunk-56T2OSOE.js} +1 -1
  105. package/dist/{chunk-VAHQOIQY.js → chunk-62KEZOFN.js} +1 -1
  106. package/dist/{chunk-2BOLFLAU.js → chunk-6A74345E.js} +2 -2
  107. package/dist/{chunk-XEAZJXMZ.js → chunk-6CJYOPQW.js} +2 -2
  108. package/dist/{chunk-3N24FV22.js → chunk-6ZBOARHX.js} +1 -1
  109. package/dist/{chunk-6L4VIYLZ.js → chunk-7MCEYNWK.js} +15 -1
  110. package/dist/{chunk-4J77TCTX.js → chunk-7TWRCBEN.js} +1 -1
  111. package/dist/{chunk-L5JFVK5T.js → chunk-7VQ2OCZG.js} +68 -11
  112. package/dist/{chunk-VS7V5HNO.js → chunk-AH7TTPES.js} +1 -1
  113. package/dist/{chunk-XQ7BIVLI.js → chunk-AJTNEIFI.js} +9 -9
  114. package/dist/{chunk-7YX73K2R.js → chunk-ALA7WYZZ.js} +6 -1
  115. package/dist/{chunk-K2HIXAIF.js → chunk-ALTBD27V.js} +14 -14
  116. package/dist/{chunk-IHAXXDBH.js → chunk-AROCCYCK.js} +3 -3
  117. package/dist/{chunk-ZJQ56DZZ.js → chunk-B3W5R5OE.js} +18 -0
  118. package/dist/{chunk-5DLZJ3MY.js → chunk-B4YW6GSE.js} +1 -1
  119. package/dist/{chunk-FUDXITKX.js → chunk-BKCQR55G.js} +1 -1
  120. package/dist/{chunk-CWHTUNJX.js → chunk-BXLNHKVK.js} +2 -2
  121. package/dist/{chunk-7SHU5MOD.js → chunk-C5FURQRA.js} +1 -1
  122. package/dist/{chunk-RMC2A6EE.js → chunk-CBNU7ZIP.js} +1 -1
  123. package/dist/chunk-CCFWKW2D.js +92 -0
  124. package/dist/{chunk-NCNT2C2P.js → chunk-COJHDMQ4.js} +2 -2
  125. package/dist/{chunk-N7POJZJT.js → chunk-CRRZAIBC.js} +13 -13
  126. package/dist/{telemetry-upload-6DR6AL3V.js → chunk-D3IKDHK6.js} +53 -28
  127. package/dist/{chunk-Z3LGAFMG.js → chunk-DJCUZ65C.js} +1 -1
  128. package/dist/{chunk-JW5NUXPN.js → chunk-DQSLSKF7.js} +14 -14
  129. package/dist/{chunk-VBYSAQJD.js → chunk-E3NN4TGB.js} +1 -1
  130. package/dist/{chunk-DWRULKB3.js → chunk-EKZ5MGJK.js} +2 -2
  131. package/dist/{chunk-CFFSHBQF.js → chunk-EWKNMFS6.js} +1 -1
  132. package/dist/{chunk-ZJ6AMC4Y.js → chunk-FRNG2SFK.js} +7 -7
  133. package/dist/{chunk-HTFM7ZDD.js → chunk-G6E4NA6V.js} +2 -2
  134. package/dist/{chunk-5BWDUUMH.js → chunk-GRA3UHGQ.js} +3 -3
  135. package/dist/{chunk-KN5GAVCG.js → chunk-GYRAI7PP.js} +2 -2
  136. package/dist/{chunk-GM4UEZDE.js → chunk-H372DQD2.js} +43 -30
  137. package/dist/{chunk-ZZR2WRNW.js → chunk-HETFNI2L.js} +4 -4
  138. package/dist/{chunk-RIKFXHLE.js → chunk-HJLYDWEM.js} +1 -1
  139. package/dist/{chunk-LLZUL7M2.js → chunk-HPB5Y6FZ.js} +4 -2
  140. package/dist/{chunk-EOWJXCYC.js → chunk-HPCCYWDP.js} +1 -1
  141. package/dist/{chunk-3DXAJVXE.js → chunk-HPUTFKC6.js} +6 -6
  142. package/dist/{chunk-KEDZRQI3.js → chunk-HVTLHDGA.js} +2 -2
  143. package/dist/{chunk-Q6KUBP6R.js → chunk-I2T3ZOFM.js} +5 -5
  144. package/dist/{chunk-2EYVXUGA.js → chunk-IH6YW55P.js} +4 -4
  145. package/dist/{chunk-7KPZQ65I.js → chunk-IJRHWGOI.js} +3 -3
  146. package/dist/{chunk-2YFMBXUU.js → chunk-IT4AGRFX.js} +4 -4
  147. package/dist/{chunk-JTJP4JK7.js → chunk-IXWH4TKR.js} +3 -3
  148. package/dist/{chunk-GZVFHFO3.js → chunk-IZYGY3ZV.js} +10 -10
  149. package/dist/{chunk-GATAYYAF.js → chunk-J43YFUSQ.js} +3 -3
  150. package/dist/{chunk-IPUDXR67.js → chunk-JB5CIPO4.js} +12 -3
  151. package/dist/{chunk-6PXFF6IV.js → chunk-JF36BVSK.js} +1 -1
  152. package/dist/{chunk-SO7KTH3Q.js → chunk-JJYL2K7E.js} +1 -1
  153. package/dist/{chunk-353XF4LU.js → chunk-JTANX2NA.js} +2 -2
  154. package/dist/{chunk-QOFQY7BJ.js → chunk-JVFXB46L.js} +1 -1
  155. package/dist/{chunk-QV26G2BF.js → chunk-JYTB2RS4.js} +1 -1
  156. package/dist/{chunk-T3AM52YT.js → chunk-KDAUJDHM.js} +4 -4
  157. package/dist/{chunk-OHHZNNUD.js → chunk-KKABI3X6.js} +1 -1
  158. package/dist/{chunk-5ZMNFSHV.js → chunk-KPWQQVKA.js} +1 -1
  159. package/dist/{chunk-GHYHNHDL.js → chunk-KRGHRFGA.js} +1 -1
  160. package/dist/{chunk-BIPTWAEO.js → chunk-KXGAS45V.js} +1 -1
  161. package/dist/{chunk-PTF5TB6O.js → chunk-LHMBUQX2.js} +9 -9
  162. package/dist/chunk-LP5USONU.js +125 -0
  163. package/dist/{chunk-CJ6CS2IH.js → chunk-LXDNPWX7.js} +5 -5
  164. package/dist/{chunk-HA6BIZ6L.js → chunk-M46ZFCQT.js} +8 -8
  165. package/dist/{chunk-BE3UETW6.js → chunk-M4AS43GS.js} +3 -3
  166. package/dist/{chunk-M6SUJLNP.js → chunk-MHUPOTUV.js} +2 -2
  167. package/dist/{chunk-X2ZHCNNB.js → chunk-MIXW35ES.js} +5 -5
  168. package/dist/{chunk-PDQGR5LZ.js → chunk-MJOWO352.js} +1 -1
  169. package/dist/{chunk-JNULO6I5.js → chunk-MQEV5FL6.js} +3 -3
  170. package/dist/{chunk-VQQPYI4X.js → chunk-NAWW4EKM.js} +2 -2
  171. package/dist/{chunk-JGBYZTWH.js → chunk-NFTTBVL2.js} +1 -1
  172. package/dist/{chunk-W7VKGB42.js → chunk-NM4MWWA4.js} +1 -1
  173. package/dist/{chunk-657I6PUF.js → chunk-NSVBDUZK.js} +3 -3
  174. package/dist/{chunk-D6NZNUVH.js → chunk-NTKZ47FA.js} +1 -1
  175. package/dist/{chunk-6777GNWI.js → chunk-OFC5SIIT.js} +19 -8
  176. package/dist/{chunk-7PDZBPGW.js → chunk-OGWQMQOM.js} +1 -1
  177. package/dist/{chunk-LBSCOP25.js → chunk-OI4DPXBK.js} +1 -1
  178. package/dist/{chunk-RHHEYC6H.js → chunk-OVEID5F6.js} +3 -3
  179. package/dist/{chunk-HUHR5CKJ.js → chunk-OZ6E4FKM.js} +4 -4
  180. package/dist/{chunk-6HJF7IA3.js → chunk-PGVFGFK7.js} +227 -198
  181. package/dist/{chunk-RHJOTGEU.js → chunk-PKEZ3JG4.js} +1 -1
  182. package/dist/{chunk-MZNLQC6W.js → chunk-PWJLLXGK.js} +1 -1
  183. package/dist/{chunk-7HLAYQRG.js → chunk-PY2E5ZL6.js} +5 -5
  184. package/dist/{chunk-DHLJZDWI.js → chunk-QEJ2ZX2O.js} +6 -6
  185. package/dist/{chunk-IC2AONBH.js → chunk-QXKE7T3L.js} +9 -9
  186. package/dist/chunk-R3ZU4F7M.js +359 -0
  187. package/dist/{chunk-QSW5DHMZ.js → chunk-R6Q3MB2F.js} +1 -1
  188. package/dist/{chunk-47YGEM4N.js → chunk-RZUXD47X.js} +1 -1
  189. package/dist/{chunk-A75TAU2I.js → chunk-SL3T3LY3.js} +141 -17
  190. package/dist/{chunk-W3ABSZ6G.js → chunk-SW26QLZQ.js} +2 -2
  191. package/dist/{chunk-FYV2CTKP.js → chunk-TPYGTRYK.js} +1 -1
  192. package/dist/{chunk-BLTXAUP6.js → chunk-TXWIBXPR.js} +2 -2
  193. package/dist/{chunk-JAIZCE6W.js → chunk-U6BHVMOM.js} +3 -3
  194. package/dist/{chunk-O6KQAJCC.js → chunk-U74M7XSZ.js} +3 -3
  195. package/dist/{chunk-J6U4ZR77.js → chunk-UFZIURF6.js} +2 -2
  196. package/dist/{chunk-TCBWHLKH.js → chunk-UO5U5AOS.js} +9 -9
  197. package/dist/{chunk-XDOCXKHW.js → chunk-UXBGEKL6.js} +1 -1
  198. package/dist/{chunk-TVWYMOZ4.js → chunk-V3RGMCCP.js} +15 -4
  199. package/dist/{chunk-27NG2NTG.js → chunk-V3Y45JIY.js} +2 -2
  200. package/dist/{chunk-RYMXD2NT.js → chunk-W375ZRNM.js} +1 -1
  201. package/dist/{chunk-6DMURUBY.js → chunk-WTNIAVVK.js} +4 -4
  202. package/dist/{chunk-2YGBJHC2.js → chunk-WZNW66XJ.js} +3 -3
  203. package/dist/{chunk-6BD6JYR2.js → chunk-XDLC3NRR.js} +3 -3
  204. package/dist/{chunk-FS7XF7SE.js → chunk-XHJO7XFR.js} +1 -1
  205. package/dist/{chunk-LQGLGSBY.js → chunk-XJVKDVQN.js} +2 -2
  206. package/dist/{chunk-JJZZXEAN.js → chunk-XKTCQTDP.js} +2 -2
  207. package/dist/{chunk-RYYFFCJG.js → chunk-XL7OO7MD.js} +1 -1
  208. package/dist/{chunk-RJIH7JXM.js → chunk-XUX3EJ3U.js} +4 -4
  209. package/dist/{chunk-3GGMHSY2.js → chunk-XWDI6NVG.js} +3 -3
  210. package/dist/{chunk-6J2J3VJS.js → chunk-XZRCLK2N.js} +10 -10
  211. package/dist/{chunk-SXUABANK.js → chunk-Y5GPRRW2.js} +3 -3
  212. package/dist/{chunk-CYUUNIEL.js → chunk-Y6LOT7GS.js} +1 -1
  213. package/dist/{chunk-PYXXL7N7.js → chunk-YQT3JC27.js} +1 -1
  214. package/dist/{chunk-QJWLQXR7.js → chunk-YX7QSOBB.js} +1 -1
  215. package/dist/{chunk-M6AX64J2.js → chunk-Z7T7JMBU.js} +20 -8
  216. package/dist/{chunk-BG6RAOCJ.js → chunk-ZDPOCUBX.js} +3 -3
  217. package/dist/{chunk-HDQAVAV6.js → chunk-ZHT3SXBU.js} +2 -2
  218. package/dist/{chunk-EWDBWOCX.js → chunk-ZQSQJ53P.js} +1 -1
  219. package/dist/{chunk-LSHUX7P4.js → chunk-ZUE3ADBF.js} +16 -16
  220. package/dist/{cleanup-graph-garbage-SYGPMPUM.js → cleanup-graph-garbage-X4XP3E5O.js} +10 -9
  221. package/dist/{cli-shutdown-JI7CASE4.js → cli-shutdown-E2YG5CSE.js} +1 -1
  222. package/dist/{cloud-sync-command-ZV3P5FP6.js → cloud-sync-command-AKTDHKCI.js} +2 -2
  223. package/dist/{cloud-sync-db-init-RQIHWKV4.js → cloud-sync-db-init-U6IL6YAP.js} +1 -1
  224. package/dist/{cloud-sync-shutdown-V2N7VLD3.js → cloud-sync-shutdown-BCIU6U3A.js} +5 -4
  225. package/dist/{co-activation-SRE6DIRX.js → co-activation-HIOU7VAV.js} +5 -4
  226. package/dist/{co-occurrence-F5TMSEQZ.js → co-occurrence-GW6Z6WAJ.js} +8 -7
  227. package/dist/{consent-passphrase-MWZRHJRC.js → consent-passphrase-EARJEBUA.js} +2 -2
  228. package/dist/{conversation-entity-extractor-XMOUHGMT.js → conversation-entity-extractor-VPOH26FG.js} +3 -3
  229. package/dist/{conversations-retention-XTBFJBUM.js → conversations-retention-HFM2K6ND.js} +33 -12
  230. package/dist/{crdt-sync-FXEKABM7.js → crdt-sync-5ASUMUPX.js} +4 -4
  231. package/dist/{crm-webhook-D6IJOPRQ.js → crm-webhook-7PYD36EA.js} +2 -2
  232. package/dist/{cto-delegation-gate-BU3JRCYN.js → cto-delegation-gate-5RABUXBR.js} +18 -17
  233. package/dist/{daemon-orchestration-K4NKFYXO.js → daemon-orchestration-2SROQ2N4.js} +24 -23
  234. package/dist/{doc-graph-extractor-TVK2NGAR.js → doc-graph-extractor-XWLDPVO4.js} +8 -7
  235. package/dist/{documents-MDZ4VB5X.js → documents-SKJ6XYMW.js} +10 -9
  236. package/dist/{dreaming-L24PSS35.js → dreaming-7DTEPB4M.js} +22 -21
  237. package/dist/{employee-boot-brief-GQVL3FQC.js → employee-boot-brief-VJD3F4OB.js} +26 -25
  238. package/dist/{entity-boost-OMFA5QCG.js → entity-boost-4M7BE7C7.js} +1 -1
  239. package/dist/{exe-drift-JDDG3OPT.js → exe-drift-7A3GZEUE.js} +6 -5
  240. package/dist/{exe-export-EEGIE3JP.js → exe-export-3JVH5YIV.js} +11 -10
  241. package/dist/{exe-import-UJNC5Q2L.js → exe-import-DQ6UEYHN.js} +11 -10
  242. package/dist/{exe-key-TYEY4W4E.js → exe-key-G5V3HUTJ.js} +106 -105
  243. package/dist/{exe-org-B3ICTTEV.js → exe-org-NG3ZYJXK.js} +40 -40
  244. package/dist/{exe-snapshot-VBFBONYN.js → exe-snapshot-IKYR55CZ.js} +25 -24
  245. package/dist/{fast-db-init-TFRTK6EH.js → fast-db-init-QYF42NZP.js} +1 -1
  246. package/dist/{founder-context-3X4QUWKD.js → founder-context-XJ6O43OF.js} +2 -2
  247. package/dist/{founder-monitor-envelope-54UNZNY4.js → founder-monitor-envelope-XT6U5L6M.js} +4 -4
  248. package/dist/gateway/index.js +19 -18
  249. package/dist/{gateway-client-OUDO5GGV.js → gateway-client-ARBQBLRK.js} +1 -1
  250. package/dist/{git-staleness-73YZ5PGU.js → git-staleness-2C2XYDLJ.js} +5 -4
  251. package/dist/{global-procedures-PYNE2BQG.js → global-procedures-DI4KFCVA.js} +7 -6
  252. package/dist/{graph-auto-extract-PGUMEEQB.js → graph-auto-extract-F6OKIHQQ.js} +8 -7
  253. package/dist/{graph-query-7YA3YNKL.js → graph-query-IY7QR2UR.js} +1 -1
  254. package/dist/{graph-rag-UWOTK4AQ.js → graph-rag-HB5X6YAF.js} +3 -3
  255. package/dist/{hook-integrity-6MNEPT6W.js → hook-integrity-T3DIELFF.js} +1 -1
  256. package/dist/{hook-prefetch-JOF6YZSR.js → hook-prefetch-SNDJ2G7Q.js} +18 -17
  257. package/dist/{hook-tamper-log-HTWEP37U.js → hook-tamper-log-SWQVRDDV.js} +6 -1
  258. package/dist/hooks/bug-report-worker.js +22 -21
  259. package/dist/hooks/codex-stop-task-finalizer.js +24 -23
  260. package/dist/hooks/commit-complete.js +21 -20
  261. package/dist/hooks/error-recall.js +14 -13
  262. package/dist/hooks/exe-heartbeat-hook.js +8 -7
  263. package/dist/hooks/ingest-worker.js +20 -19
  264. package/dist/hooks/ingest.js +16 -15
  265. package/dist/hooks/instructions-loaded.js +10 -9
  266. package/dist/hooks/manifest.json +20 -20
  267. package/dist/hooks/notification.js +9 -8
  268. package/dist/hooks/post-compact.js +8 -7
  269. package/dist/hooks/post-tool-combined.js +13 -13
  270. package/dist/hooks/pre-compact.js +22 -21
  271. package/dist/hooks/pre-tool-use.js +2 -2
  272. package/dist/hooks/prompt-submit.js +40 -39
  273. package/dist/hooks/session-end.js +27 -26
  274. package/dist/hooks/session-start.js +18 -18
  275. package/dist/hooks/stop.js +25 -24
  276. package/dist/hooks/subagent-stop.js +25 -24
  277. package/dist/hooks/summary-worker.js +25 -24
  278. package/dist/index.js +32 -31
  279. package/dist/{installer-7TN36Z7T.js → installer-7QUGM3RZ.js} +9 -8
  280. package/dist/{installer-356RMQ2K.js → installer-CCINS5Z7.js} +9 -8
  281. package/dist/{installer-34XZ7JMW.js → installer-Z7ZF2UZL.js} +9 -8
  282. package/dist/{intercom-queue-ZJ3MNULM.js → intercom-queue-A24ARSCV.js} +17 -16
  283. package/dist/lib/backup-verify-worker.js +3 -2
  284. package/dist/lib/cloud-sync.js +18 -17
  285. package/dist/lib/consolidation.js +11 -10
  286. package/dist/lib/crypto.js +3 -3
  287. package/dist/lib/database.js +9 -4
  288. package/dist/lib/db-backup.js +12 -1
  289. package/dist/lib/db-checkpoint-worker.js +25 -0
  290. package/dist/lib/db-read-worker-client.js +155 -26
  291. package/dist/lib/db-write-worker-client.js +5 -1
  292. package/dist/lib/db-write-worker.js +9 -8
  293. package/dist/lib/db.js +9 -4
  294. package/dist/lib/device-registry.js +1 -1
  295. package/dist/lib/employee-templates.js +8 -7
  296. package/dist/lib/employees.js +5 -4
  297. package/dist/lib/exe-daemon.js +162 -111
  298. package/dist/lib/file-grep.js +14 -1
  299. package/dist/lib/hybrid-search.js +11 -10
  300. package/dist/lib/identity.js +5 -4
  301. package/dist/lib/keychain.js +1 -1
  302. package/dist/lib/license.js +2 -2
  303. package/dist/lib/messaging.js +18 -17
  304. package/dist/lib/post-tool-memory.js +18 -17
  305. package/dist/lib/registry-proxy.js +1 -1
  306. package/dist/lib/reminders.js +6 -5
  307. package/dist/lib/schedules.js +10 -9
  308. package/dist/lib/session-registry.js +7 -6
  309. package/dist/lib/session-wrappers.js +1 -1
  310. package/dist/lib/skill-learning.js +11 -10
  311. package/dist/lib/store.js +9 -8
  312. package/dist/lib/task-router.js +6 -5
  313. package/dist/lib/tasks.js +19 -18
  314. package/dist/lib/telemetry-consent.js +29 -0
  315. package/dist/lib/tmux-routing.js +17 -16
  316. package/dist/lib/tmux-status.js +5 -1
  317. package/dist/lib/token-spend.js +6 -5
  318. package/dist/lib/ws-client.js +1 -1
  319. package/dist/{license-gate-4BXUTHLB.js → license-gate-KGSD5NV5.js} +3 -3
  320. package/dist/{license-recheck-QFPUKISQ.js → license-recheck-M674BGZZ.js} +1 -1
  321. package/dist/{license-sync-FDEDT4AC.js → license-sync-LV53TSOT.js} +2 -2
  322. package/dist/{maintenance-worker-OY2E4BM5.js → maintenance-worker-R5N3A2KM.js} +3 -3
  323. package/dist/mcp/register-tools.js +105 -104
  324. package/dist/mcp/server.js +107 -106
  325. package/dist/mcp/tools/complete-reminder.js +7 -6
  326. package/dist/mcp/tools/create-reminder.js +7 -6
  327. package/dist/mcp/tools/create-task.js +22 -21
  328. package/dist/mcp/tools/deactivate-behavior.js +13 -12
  329. package/dist/mcp/tools/list-reminders.js +7 -6
  330. package/dist/mcp/tools/list-tasks.js +22 -21
  331. package/dist/mcp/tools/send-message.js +21 -20
  332. package/dist/mcp/tools/update-task.js +20 -19
  333. package/dist/{mcp-http-config-GKP5QGAO.js → mcp-http-config-NLKZQHV6.js} +8 -7
  334. package/dist/{mcp-session-identity-JHAGRB7B.js → mcp-session-identity-AEYKQELS.js} +17 -16
  335. package/dist/{memory-cards-O377ETAM.js → memory-cards-3ITTLHOY.js} +9 -8
  336. package/dist/{memory-graph-extractor-4KJCCUOP.js → memory-graph-extractor-FM7Q4VV6.js} +9 -8
  337. package/dist/{memory-maintenance-RR5UPRW3.js → memory-maintenance-OYSA36EJ.js} +1 -1
  338. package/dist/{memory-poisoning-defense-Y5TTKGOP.js → memory-poisoning-defense-7JFJUCKU.js} +5 -4
  339. package/dist/{memory-pressure-watchdog-NGXTI4HR.js → memory-pressure-watchdog-FROXPH3U.js} +18 -17
  340. package/dist/{memory-reflection-EXNHRZL7.js → memory-reflection-CTGRQAPC.js} +9 -8
  341. package/dist/{memory-write-repository-S4TX7WQB.js → memory-write-repository-D2WU2WFY.js} +5 -3
  342. package/dist/{monitor-grants-57Q4NL25.js → monitor-grants-TYGR4SSC.js} +3 -3
  343. package/dist/{monitor-identity-3FQ52SYU.js → monitor-identity-P54TAJBA.js} +2 -2
  344. package/dist/{notification-ledger-O6KQYYGK.js → notification-ledger-MIYYFMHL.js} +18 -17
  345. package/dist/{notifications-6FCQCJ4P.js → notifications-E7ZUVBUS.js} +17 -16
  346. package/dist/{orchestration-events-2Z2BMMA5.js → orchestration-events-U6DT373C.js} +6 -5
  347. package/dist/{orchestrator-AGOSKPHD.js → orchestrator-JUIMX24X.js} +19 -18
  348. package/dist/{org-brief-session-WJHZVXXJ.js → org-brief-session-YRIV2QSB.js} +17 -16
  349. package/dist/{org-consent-policy-X43UGTHI.js → org-consent-policy-NQ2KDQDG.js} +5 -5
  350. package/dist/{org-join-M3UTBMHC.js → org-join-II6F2VJH.js} +11 -11
  351. package/dist/{org-key-admin-AA2DRHB2.js → org-key-admin-JH6KJB4J.js} +13 -13
  352. package/dist/{org-key-epoch-Z5UIVUHT.js → org-key-epoch-G6XN6IJM.js} +5 -5
  353. package/dist/{org-key-pin-FE6YHEZ3.js → org-key-pin-WW5CHAQL.js} +3 -3
  354. package/dist/{org-membership-3J2MIGE4.js → org-membership-ROYVH7I7.js} +4 -4
  355. package/dist/{org-partner-config-5HATZYG4.js → org-partner-config-SQULMRXG.js} +8 -8
  356. package/dist/{org-partner-runtime-UI35IHUC.js → org-partner-runtime-PCGVG3M2.js} +17 -16
  357. package/dist/{org-row-visibility-TRJERVYP.js → org-row-visibility-USZO6GXN.js} +1 -1
  358. package/dist/{pipeline-router-EKQ6D7ZA.js → pipeline-router-2UJV527K.js} +6 -5
  359. package/dist/{plan-limits-3BGHIHX6.js → plan-limits-HBD2B77I.js} +8 -7
  360. package/dist/{pre-tool-use-impl-7BT5TJVM.js → pre-tool-use-impl-WEZ76RLG.js} +35 -34
  361. package/dist/{project-name-PGJGUEJY.js → project-name-O37JG2BV.js} +10 -5
  362. package/dist/{projection-worker-3GEVFPAI.js → projection-worker-HHEYDVMY.js} +2 -2
  363. package/dist/{prospective-memory-GEN7CN7H.js → prospective-memory-LNZTVL5G.js} +5 -4
  364. package/dist/{push-notifications-QW4BWRC7.js → push-notifications-QT2KL3GR.js} +18 -17
  365. package/dist/{reproject-worktree-memories-DIULBEBD.js → reproject-worktree-memories-CYQLKU2R.js} +17 -16
  366. package/dist/{reranker-LQ6OPJOI.js → reranker-MJUCNQ3B.js} +1 -1
  367. package/dist/{retrieval-health-XDFYFEOP.js → retrieval-health-MO36P7O3.js} +1 -1
  368. package/dist/{review-polling-ED33YLFT.js → review-polling-OU7JLEKI.js} +18 -17
  369. package/dist/runtime/index.js +25 -24
  370. package/dist/{seat-benefit-YEUQBNCS.js → seat-benefit-SBVGAMMY.js} +2 -2
  371. package/dist/{session-events-7IJGTBVH.js → session-events-KB7A2PIL.js} +26 -19
  372. package/dist/{session-kill-telemetry-RUTEARJ3.js → session-kill-telemetry-UNS3QI2G.js} +18 -17
  373. package/dist/{session-scope-SSYA64L3.js → session-scope-QOR7CVGI.js} +17 -16
  374. package/dist/{setup-wizard-XD7FZVLJ.js → setup-wizard-MMKIRDM5.js} +4 -3
  375. package/dist/{shard-manager-FH5JZRSE.js → shard-manager-UM3UYDLV.js} +3 -3
  376. package/dist/{skill-refinement-UHD4E6GV.js → skill-refinement-4ZND3EZF.js} +6 -5
  377. package/dist/{skill-retrieval-F6PAJ3I5.js → skill-retrieval-U5F2ZPL6.js} +13 -12
  378. package/dist/{skill-usage-2MBTF7Y4.js → skill-usage-ECYWEKQG.js} +6 -5
  379. package/dist/{stack-generate-manifest-MVJDTU4F.js → stack-generate-manifest-HL7QJ5XC.js} +4 -4
  380. package/dist/{stack-promote-BMGEY6SQ.js → stack-promote-CINVLY2J.js} +4 -4
  381. package/dist/{stack-release-64UJ6Y4W.js → stack-release-PNGTKMW6.js} +5 -5
  382. package/dist/{stack-update-EBATTQPP.js → stack-update-QXABQSHS.js} +3 -3
  383. package/dist/{steward-gate-EWG2BHYQ.js → steward-gate-VBZXP4HY.js} +6 -5
  384. package/dist/{subagent-brief-injection-YZGSWUEY.js → subagent-brief-injection-63LZHTT3.js} +29 -28
  385. package/dist/{subagent-spawn-ledger-PDICC43I.js → subagent-spawn-ledger-2XSOIL35.js} +3 -1
  386. package/dist/{support-bug-actions-RU6WZ3UV.js → support-bug-actions-IPFJ5WEZ.js} +3 -3
  387. package/dist/{support-inbox-A3S52SPS.js → support-inbox-TUMS347S.js} +15 -14
  388. package/dist/{task-enforcement-LVAS55AR.js → task-enforcement-ESAMX2ML.js} +18 -17
  389. package/dist/{task-request-inbox-2TN4ZUH2.js → task-request-inbox-ILFRNPZA.js} +5 -5
  390. package/dist/{task-scope-NLKUVCP5.js → task-scope-6LIHTVCC.js} +17 -16
  391. package/dist/{tasks-crud-NQDPLHNZ.js → tasks-crud-NWNW7RDH.js} +21 -16
  392. package/dist/{tasks-notify-BDM2NEHP.js → tasks-notify-H4CUL7RM.js} +18 -17
  393. package/dist/{tasks-review-3G7CAW2O.js → tasks-review-F4VW7NOI.js} +17 -16
  394. package/dist/telemetry-upload-MUIZKQDT.js +42 -0
  395. package/dist/{token-budget-KNC2WGR7.js → token-budget-H53P6O6O.js} +6 -5
  396. package/dist/{tool-telemetry-I3SEU5M5.js → tool-telemetry-A7NUFJI4.js} +1 -1
  397. package/dist/tui/App.js +27 -26
  398. package/dist/{tui-data-KJDWP4CB.js → tui-data-4TWYXEEA.js} +21 -20
  399. package/dist/{update-support-UYDYMHVR.js → update-support-4B7GQLUI.js} +14 -13
  400. package/dist/{whatsapp-5EMPZHF5.js → whatsapp-JHB2BHJE.js} +2 -2
  401. package/dist/{wiki-acl-M7BTQJBZ.js → wiki-acl-OFOKEUJS.js} +1 -1
  402. package/dist/{work-claims-5CFMZTML.js → work-claims-36IKRNK6.js} +6 -5
  403. package/dist/{work-state-heartbeat-7IA2DZ2E.js → work-state-heartbeat-RXQKS4GL.js} +1 -1
  404. package/dist/{workflow-engine-S5JOE2YR.js → workflow-engine-SJHROL46.js} +2 -2
  405. package/dist/{worktree-7V4ZMF3D.js → worktree-YIUDLMNS.js} +7 -6
  406. package/dist/{worktree-sweep-34MXJ7S6.js → worktree-sweep-2MZ7PKEG.js} +8 -7
  407. package/package.json +2 -1
  408. package/release-notes.json +25 -21
  409. package/stack.release.json +3 -3
  410. package/dist/chunk-PEYQ6MWO.js +0 -175
  411. /package/dist/{chunk-542FBM5U.js → chunk-2CKQEW4W.js} +0 -0
  412. /package/dist/{chunk-MOBZTIJQ.js → chunk-43WD6UKN.js} +0 -0
  413. /package/dist/{chunk-N45FAI6D.js → chunk-4ULAH65G.js} +0 -0
  414. /package/dist/{chunk-YVWXI2HM.js → chunk-5ZVDEGES.js} +0 -0
  415. /package/dist/{chunk-QDSNEGJE.js → chunk-ISNY2BGX.js} +0 -0
  416. /package/dist/{chunk-6D2O5SAH.js → chunk-KM3S64VS.js} +0 -0
  417. /package/dist/{chunk-J4B4M5PH.js → chunk-LGSXXCE2.js} +0 -0
  418. /package/dist/{chunk-J635FA7T.js → chunk-N4PRTLUX.js} +0 -0
  419. /package/dist/{chunk-EULAP6L6.js → chunk-QC3AU6NX.js} +0 -0
  420. /package/dist/{chunk-CFO47VW4.js → chunk-U6FWH2KA.js} +0 -0
  421. /package/dist/{chunk-SKSXROKP.js → chunk-UMIELGF2.js} +0 -0
  422. /package/dist/{chunk-FYSKQPTE.js → chunk-W7A44LSP.js} +0 -0
  423. /package/dist/{chunk-6NRZLVK3.js → chunk-WKXEOVSN.js} +0 -0
  424. /package/dist/{core-memory-PZEO3OWH.js → core-memory-EGE6W24K.js} +0 -0
  425. /package/dist/{memory-isolation-MFNT2ITE.js → memory-isolation-HX6XSKZM.js} +0 -0
  426. /package/dist/{oauth-server-CBGEWD6H.js → oauth-server-6TE2NW74.js} +0 -0
  427. /package/dist/{project-boot-VESAYDIH.js → project-boot-2GNHDNUH.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  processCRMEvent
3
- } from "./chunk-CFO47VW4.js";
3
+ } from "./chunk-U6FWH2KA.js";
4
4
 
5
5
  // src/gateway/adapters/crm-webhook.ts
6
6
  function parseTwentyWebhook(payload) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getMasterKey
3
- } from "./chunk-4J77TCTX.js";
3
+ } from "./chunk-7TWRCBEN.js";
4
4
 
5
5
  // src/lib/partner-sign-identity.ts
6
6
  import crypto from "crypto";
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  shutdownCli
3
- } from "./chunk-542FBM5U.js";
3
+ } from "./chunk-2CKQEW4W.js";
4
4
  import {
5
5
  fastDbInit
6
- } from "./chunk-N45FAI6D.js";
6
+ } from "./chunk-4ULAH65G.js";
7
7
  import {
8
8
  sessionScopeFilter
9
- } from "./chunk-GM4UEZDE.js";
9
+ } from "./chunk-H372DQD2.js";
10
10
  import {
11
11
  formatStatusAll,
12
12
  formatStatusDeep,
13
13
  getEmployeeStatuses,
14
14
  inTmux
15
- } from "./chunk-6L4VIYLZ.js";
15
+ } from "./chunk-7MCEYNWK.js";
16
16
  import {
17
17
  getClient,
18
18
  isCoordinatorRole,
19
19
  loadEmployees
20
- } from "./chunk-L5JFVK5T.js";
20
+ } from "./chunk-7VQ2OCZG.js";
21
21
  import {
22
22
  isMainModule
23
23
  } from "./chunk-6Y4B3QF6.js";
@@ -8,13 +8,10 @@ import {
8
8
  queryTaskRows,
9
9
  resolveExeSession,
10
10
  sendIntercom
11
- } from "./chunk-GM4UEZDE.js";
11
+ } from "./chunk-H372DQD2.js";
12
12
  import {
13
13
  getTransport
14
14
  } from "./chunk-VI4ATC6I.js";
15
- import {
16
- recordOrchestrationEventBestEffort
17
- } from "./chunk-JGBYZTWH.js";
18
15
  import {
19
16
  releaseDispatchClaim,
20
17
  tryAcquireDispatchClaim
@@ -22,6 +19,9 @@ import {
22
19
  import {
23
20
  getAgentRuntime
24
21
  } from "./chunk-IVXELUEQ.js";
22
+ import {
23
+ recordOrchestrationEventBestEffort
24
+ } from "./chunk-NFTTBVL2.js";
25
25
  import {
26
26
  getSessionKey
27
27
  } from "./chunk-CVYC6DUW.js";
@@ -29,7 +29,7 @@ import {
29
29
  isCoordinatorName,
30
30
  isMultiInstance,
31
31
  shouldAutoInstance
32
- } from "./chunk-L5JFVK5T.js";
32
+ } from "./chunk-7VQ2OCZG.js";
33
33
 
34
34
  // src/lib/tasks-notify.ts
35
35
  var VERIFY_DELAY_MS = 1e4;
@@ -91,7 +91,7 @@ async function dispatchTaskToEmployee(input) {
91
91
  let crossProject = false;
92
92
  if (input.projectName) {
93
93
  try {
94
- const { assertSessionScope } = await import("./session-scope-SSYA64L3.js");
94
+ const { assertSessionScope } = await import("./session-scope-QOR7CVGI.js");
95
95
  const check = assertSessionScope("dispatch_task", input.projectName);
96
96
  if (check.reason === "cross_session_denied") {
97
97
  crossProject = true;
@@ -2,7 +2,7 @@ import {
2
2
  dispatchTaskToEmployee,
3
3
  markTaskNotificationsRead,
4
4
  notifyTaskDone
5
- } from "./chunk-DHLJZDWI.js";
5
+ } from "./chunk-QEJ2ZX2O.js";
6
6
  import {
7
7
  clearCurrentTask,
8
8
  writeCurrentTask
@@ -19,7 +19,7 @@ import {
19
19
  strictSessionScopeFilter,
20
20
  updateTaskStatus,
21
21
  writeNotification
22
- } from "./chunk-GM4UEZDE.js";
22
+ } from "./chunk-H372DQD2.js";
23
23
  import {
24
24
  getAgentContext
25
25
  } from "./chunk-GJV3WDWM.js";
@@ -30,7 +30,7 @@ import {
30
30
  getClient,
31
31
  getCoordinatorName,
32
32
  isCoordinatorName
33
- } from "./chunk-L5JFVK5T.js";
33
+ } from "./chunk-7VQ2OCZG.js";
34
34
  import {
35
35
  isAutonomousTmuxSpawnEnabled
36
36
  } from "./chunk-MMS2HBRT.js";
@@ -85,7 +85,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
85
85
  if (unblockedRows.rows.length > 0 && !process.env.VITEST) {
86
86
  const autonomousSpawnAllowed = isAutonomousTmuxSpawnEnabled();
87
87
  try {
88
- const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-BDM2NEHP.js");
88
+ const { dispatchTaskToEmployee: dispatchTaskToEmployee2 } = await import("./tasks-notify-H4CUL7RM.js");
89
89
  const dispatched = /* @__PURE__ */ new Set();
90
90
  for (const ur of unblockedRows.rows) {
91
91
  if (!unblockedRowMayAutoDispatch(ur, autonomousSpawnAllowed)) continue;
@@ -97,7 +97,7 @@ async function cascadeUnblock(taskId, baseDir, now) {
97
97
  }
98
98
  } catch {
99
99
  try {
100
- const { queueIntercom } = await import("./intercom-queue-ZJ3MNULM.js");
100
+ const { queueIntercom } = await import("./intercom-queue-A24ARSCV.js");
101
101
  const dispatched = /* @__PURE__ */ new Set();
102
102
  for (const ur of unblockedRows.rows) {
103
103
  if (!unblockedRowIsDurableTmux(ur)) continue;
@@ -313,7 +313,7 @@ async function updateTask(input, deps = {}) {
313
313
  try {
314
314
  process.stderr.write(`[tasks] EVENT: tmux delivery failed for reviewer="${reviewer}". Queueing for daemon delivery.
315
315
  `);
316
- const { queueIntercom } = await import("./intercom-queue-ZJ3MNULM.js");
316
+ const { queueIntercom } = await import("./intercom-queue-A24ARSCV.js");
317
317
  const { resolveExeSession } = await import("./lib/tmux-routing.js");
318
318
  const exeSession = row.session_scope ? String(row.session_scope) : resolveExeSession();
319
319
  if (exeSession) {
@@ -330,7 +330,7 @@ async function updateTask(input, deps = {}) {
330
330
  }
331
331
  }
332
332
  try {
333
- const { pushNotifyAsync } = await import("./push-notifications-QW4BWRC7.js");
333
+ const { pushNotifyAsync } = await import("./push-notifications-QT2KL3GR.js");
334
334
  pushNotifyAsync({
335
335
  event: "review_ready",
336
336
  title: `Review ready: ${taskTitle.slice(0, 50)}`,
@@ -342,7 +342,7 @@ async function updateTask(input, deps = {}) {
342
342
  }
343
343
  if (isLegacyExecution && !isCoordinator && isCompletionReviewTransition) {
344
344
  try {
345
- const { pushNotifyAsync } = await import("./push-notifications-QW4BWRC7.js");
345
+ const { pushNotifyAsync } = await import("./push-notifications-QT2KL3GR.js");
346
346
  const event = input.status === "needs_review" ? "review_ready" : "task_complete";
347
347
  pushNotifyAsync({
348
348
  event,
@@ -357,7 +357,7 @@ async function updateTask(input, deps = {}) {
357
357
  await markTaskNotificationsRead(taskFile);
358
358
  if (isLegacyExecution && isCompletionReviewTransition && !isCoordinator && row.reviewer) {
359
359
  try {
360
- const { writeNotification: writeNotification2 } = await import("./notifications-6FCQCJ4P.js");
360
+ const { writeNotification: writeNotification2 } = await import("./notifications-E7ZUVBUS.js");
361
361
  const reviewer = String(row.reviewer);
362
362
  await writeNotification2({
363
363
  agentId: reviewer,
@@ -0,0 +1,359 @@
1
+ import {
2
+ isPostgresBackendEnabled
3
+ } from "./chunk-YYB5PMTK.js";
4
+
5
+ // src/lib/db-write-worker-client.ts
6
+ import { fork } from "child_process";
7
+ import { existsSync } from "fs";
8
+ import path from "path";
9
+ import { fileURLToPath } from "url";
10
+ import { randomUUID } from "crypto";
11
+ var _worker = null;
12
+ var _workerReady = false;
13
+ var _spawnAttempts = 0;
14
+ var MAX_SPAWN_ATTEMPTS = 5;
15
+ var _respawning = false;
16
+ var _killReason = null;
17
+ var _retryAfterExit = false;
18
+ var _readyDeadline = null;
19
+ var _lastSpawnArgs = null;
20
+ var _pending = /* @__PURE__ */ new Map();
21
+ var _queue = [];
22
+ var _inFlightId = null;
23
+ function writeTimeoutMs() {
24
+ return Number(process.env.EXE_DB_WRITE_WORKER_TIMEOUT_MS) || 6e4;
25
+ }
26
+ function sweepBatchTimeoutMs() {
27
+ return Number(process.env.EXE_DB_WRITE_WORKER_SWEEP_BATCH_TIMEOUT_MS) || 9e4;
28
+ }
29
+ function respawnReadyTimeoutMs() {
30
+ return Number(process.env.EXE_DB_WRITE_WORKER_READY_TIMEOUT_MS) || 3e4;
31
+ }
32
+ function memoryWriteBehindSweepBoundMs() {
33
+ return sweepBatchTimeoutMs() + respawnReadyTimeoutMs() + writeTimeoutMs();
34
+ }
35
+ var SWEEP_MAX_BATCHES_PER_TICK = 200;
36
+ function sweepTickBudgetMs() {
37
+ return Number(process.env.EXE_DB_WRITE_WORKER_SWEEP_TICK_BUDGET_MS) || 30 * 6e4;
38
+ }
39
+ function buildDbWriteWorkerEnv(dbPath, encryptionKey, source = process.env) {
40
+ const env = {
41
+ ...source,
42
+ EXE_IS_DAEMON: "",
43
+ EXE_DB_DIRECT: "1",
44
+ EXE_BOOT_FAST: "1",
45
+ EXE_DB_NO_CHECKPOINT_TIMER: "1"
46
+ };
47
+ if (dbPath) env.EXE_DB_WRITE_WORKER_PATH = dbPath;
48
+ if (encryptionKey) env.EXE_DB_WRITE_WORKER_KEY = encryptionKey;
49
+ return env;
50
+ }
51
+ function rejectAllPending(reason) {
52
+ for (const [id, cb] of _pending) {
53
+ if (cb.timer) clearTimeout(cb.timer);
54
+ cb.reject(new Error(reason));
55
+ _pending.delete(id);
56
+ }
57
+ _queue.length = 0;
58
+ _inFlightId = null;
59
+ }
60
+ function rejectInFlight(reason) {
61
+ const id = _inFlightId;
62
+ _inFlightId = null;
63
+ if (!id) return;
64
+ const cb = _pending.get(id);
65
+ if (!cb) return;
66
+ _pending.delete(id);
67
+ if (cb.timer) clearTimeout(cb.timer);
68
+ cb.reject(new Error(reason));
69
+ }
70
+ function clearReadyDeadline() {
71
+ if (_readyDeadline) clearTimeout(_readyDeadline);
72
+ _readyDeadline = null;
73
+ }
74
+ function armReadyDeadline(child) {
75
+ clearReadyDeadline();
76
+ const ms = respawnReadyTimeoutMs();
77
+ _readyDeadline = setTimeout(() => {
78
+ _readyDeadline = null;
79
+ if (_worker !== child || _workerReady) return;
80
+ process.stderr.write(
81
+ `[exed] DB write worker respawn (pid=${child.pid}) not ready after ${ms}ms \u2014 marking it unavailable and retrying the spawn.
82
+ `
83
+ );
84
+ _respawning = false;
85
+ rejectAllPending(`db write worker not available (respawn not ready after ${ms}ms)`);
86
+ _retryAfterExit = true;
87
+ try {
88
+ child.kill("SIGKILL");
89
+ } catch {
90
+ }
91
+ }, ms);
92
+ _readyDeadline.unref?.();
93
+ }
94
+ function isWriteWorkerEnabled(env = process.env) {
95
+ return env.EXE_WRITE_WORKER !== "0";
96
+ }
97
+ function resolveDbWriteWorkerPath(selfUrl, exists = existsSync) {
98
+ let selfDir;
99
+ try {
100
+ selfDir = path.dirname(fileURLToPath(selfUrl));
101
+ } catch {
102
+ return null;
103
+ }
104
+ for (const candidate of [
105
+ path.join(selfDir, "db-write-worker.js"),
106
+ path.join(selfDir, "lib", "db-write-worker.js")
107
+ ]) {
108
+ if (exists(candidate)) return candidate;
109
+ }
110
+ return null;
111
+ }
112
+ function spawnDbWriteWorker(dbPath, encryptionKey, opts) {
113
+ if (!opts?.forMaintenance && !isWriteWorkerEnabled()) return;
114
+ if (_worker) return;
115
+ _lastSpawnArgs = { dbPath, encryptionKey, opts };
116
+ if (_spawnAttempts >= MAX_SPAWN_ATTEMPTS) return;
117
+ _spawnAttempts++;
118
+ const workerPath = process.env.EXE_DB_WRITE_WORKER_BIN ?? resolveDbWriteWorkerPath(import.meta.url);
119
+ if (!workerPath || !existsSync(workerPath)) {
120
+ process.stderr.write(
121
+ `[db-write-worker-client] worker not found (${workerPath ?? "checked ./db-write-worker.js and ./lib/db-write-worker.js next to this module"}) - memory writes will run on the event loop.
122
+ `
123
+ );
124
+ return;
125
+ }
126
+ const env = buildDbWriteWorkerEnv(dbPath, encryptionKey);
127
+ if (!isPostgresBackendEnabled(env) && !env.EXE_DB_WRITE_WORKER_PATH) {
128
+ process.stderr.write("[db-write-worker-client] no SQLite db path for write worker - memory writes will run on the event loop.\n");
129
+ _spawnAttempts = Math.max(0, _spawnAttempts - 1);
130
+ return;
131
+ }
132
+ try {
133
+ _worker = fork(workerPath, [], { stdio: ["ignore", "ignore", "inherit", "ipc"], env });
134
+ } catch (err) {
135
+ process.stderr.write(`[db-write-worker-client] fork failed: ${err instanceof Error ? err.message : String(err)}
136
+ `);
137
+ _worker = null;
138
+ return;
139
+ }
140
+ const child = _worker;
141
+ if (_respawning || _retryAfterExit) armReadyDeadline(child);
142
+ _retryAfterExit = false;
143
+ _worker.on("message", (msg) => {
144
+ if (msg.type === "ready") {
145
+ if (_worker !== child) return;
146
+ clearReadyDeadline();
147
+ _workerReady = !msg.error;
148
+ _spawnAttempts = 0;
149
+ process.stderr.write(`[exed] DB write worker ${msg.error ? `failed: ${msg.error}` : `ready (pid=${child.pid})`}
150
+ `);
151
+ if (_respawning) {
152
+ _respawning = false;
153
+ if (!_workerReady) rejectAllPending("db write worker not available (respawn failed)");
154
+ }
155
+ pumpQueue();
156
+ return;
157
+ }
158
+ if (_worker !== child) return;
159
+ if (!msg.id) return;
160
+ if (msg.id === _inFlightId) _inFlightId = null;
161
+ const cb = _pending.get(msg.id);
162
+ if (cb) {
163
+ _pending.delete(msg.id);
164
+ if (cb.timer) clearTimeout(cb.timer);
165
+ if (msg.error) cb.reject(new Error(msg.error));
166
+ else if (msg.memoryId) cb.resolve({ memoryId: msg.memoryId, version: msg.version, deduped: msg.deduped });
167
+ else if (typeof msg.deleted === "number") {
168
+ cb.resolve({ deleted: msg.deleted, archived: msg.archived, purged: msg.purged, mode: msg.mode, drained: msg.drained });
169
+ } else if (msg.ok) cb.resolve({ ok: true, result: msg.result });
170
+ else cb.reject(new Error("invalid write-worker response"));
171
+ }
172
+ pumpQueue();
173
+ });
174
+ _worker.on("error", (err) => {
175
+ process.stderr.write(`[exed] DB write worker error: ${err.message}
176
+ `);
177
+ if (_worker !== child) return;
178
+ _workerReady = false;
179
+ if (!_respawning) rejectAllPending("write worker crashed");
180
+ });
181
+ _worker.on("exit", (code, signal) => {
182
+ process.stderr.write(`[exed] DB write worker exited (code=${code}, signal=${signal ?? "none"}).
183
+ `);
184
+ if (_worker !== child) return;
185
+ clearReadyDeadline();
186
+ _workerReady = false;
187
+ _worker = null;
188
+ const respawnArgs = _lastSpawnArgs;
189
+ if (_retryAfterExit) {
190
+ if (respawnArgs) spawnDbWriteWorker(respawnArgs.dbPath, respawnArgs.encryptionKey, respawnArgs.opts);
191
+ _retryAfterExit = false;
192
+ return;
193
+ }
194
+ if (!_respawning) {
195
+ rejectAllPending("write worker exited");
196
+ return;
197
+ }
198
+ rejectInFlight(_killReason ?? "db write worker request timed out (worker killed before reporting)");
199
+ _killReason = null;
200
+ if (respawnArgs) spawnDbWriteWorker(respawnArgs.dbPath, respawnArgs.encryptionKey, respawnArgs.opts);
201
+ if (!_worker) {
202
+ _respawning = false;
203
+ rejectAllPending("db write worker not available (respawn failed)");
204
+ }
205
+ });
206
+ }
207
+ function isDbWriteWorkerReady() {
208
+ return _worker !== null && (_workerReady || _respawning);
209
+ }
210
+ async function writeMemoryInWorker(payload) {
211
+ const result = await sendWriteWorkerRequest({ type: "write-memory", ...payload }, "memory-write");
212
+ if (!result.memoryId) throw new Error("invalid write-worker response");
213
+ return result;
214
+ }
215
+ async function runSweepBatches(message, opts, onBatch) {
216
+ const now = opts.now ?? Date.now;
217
+ const maxBatches = opts.maxBatches ?? SWEEP_MAX_BATCHES_PER_TICK;
218
+ const budgetMs = opts.budgetMs ?? sweepTickBudgetMs();
219
+ const started = now();
220
+ const out = { deleted: 0, batches: 0, drained: false };
221
+ while (out.batches < maxBatches && now() - started < budgetMs) {
222
+ let result;
223
+ try {
224
+ result = await sendWriteWorkerRequest({ ...message, maxBatches: 1 }, "sweep");
225
+ } catch (err) {
226
+ if (out.batches === 0) throw err;
227
+ out.error = err instanceof Error ? err.message : String(err);
228
+ return out;
229
+ }
230
+ out.batches++;
231
+ out.deleted += Number(result.deleted ?? 0);
232
+ onBatch(result);
233
+ if (result.drained !== false) {
234
+ out.drained = true;
235
+ break;
236
+ }
237
+ }
238
+ return out;
239
+ }
240
+ async function sweepSessionEventsRetentionInWorker(retentionDays, opts = {}) {
241
+ return runSweepBatches({ type: "sweep-session-events-retention", retentionDays }, opts, () => {
242
+ });
243
+ }
244
+ async function sweepConversationsRetentionInWorker(retentionDays, retentionMode, opts = {}) {
245
+ let archived = 0;
246
+ let purged = 0;
247
+ let mode = "archive";
248
+ const res = await runSweepBatches(
249
+ { type: "sweep-conversations-retention", retentionDays, retentionMode },
250
+ opts,
251
+ (r) => {
252
+ archived += Number(r.archived ?? 0);
253
+ purged += Number(r.purged ?? 0);
254
+ if (r.mode) mode = String(r.mode);
255
+ }
256
+ );
257
+ return { ...res, archived, purged, mode };
258
+ }
259
+ async function requestMaintenanceWrite(jobId, jobName, kind, payload) {
260
+ const result = await sendWriteWorkerRequest(
261
+ { type: "maintenance-job-write", jobId, jobName, kind, payload },
262
+ "maintenance"
263
+ );
264
+ return result.result;
265
+ }
266
+ function sendWriteWorkerRequest(payload, kind) {
267
+ if (!_worker || !_workerReady && !_respawning) {
268
+ return Promise.reject(new Error("db write worker not available"));
269
+ }
270
+ const id = randomUUID();
271
+ const timeoutMs = kind === "sweep" ? sweepBatchTimeoutMs() : writeTimeoutMs();
272
+ return new Promise((resolve, reject) => {
273
+ _pending.set(id, { kind, message: { id, ...payload }, timeoutMs, resolve, reject, timer: null });
274
+ _queue.push(id);
275
+ pumpQueue();
276
+ });
277
+ }
278
+ function pumpQueue() {
279
+ while (_inFlightId === null && _queue.length > 0 && _worker && _workerReady) {
280
+ const id = _queue.shift();
281
+ const req = _pending.get(id);
282
+ if (!req) continue;
283
+ _inFlightId = id;
284
+ req.timer = setTimeout(() => onRequestTimeout(id), req.timeoutMs);
285
+ try {
286
+ _worker.send(req.message);
287
+ } catch (err) {
288
+ clearTimeout(req.timer);
289
+ _pending.delete(id);
290
+ _inFlightId = null;
291
+ req.reject(err instanceof Error ? err : new Error(String(err)));
292
+ }
293
+ }
294
+ }
295
+ function onRequestTimeout(requestId) {
296
+ const req = _pending.get(requestId);
297
+ if (!req) return;
298
+ if (req.kind === "memory-write" || req.kind === "sweep") {
299
+ abortWorkerAfterTimeout(requestId, req);
300
+ return;
301
+ }
302
+ process.stderr.write(
303
+ `[exed] DB write worker ${req.kind} request ${requestId.slice(0, 8)} exceeded ${req.timeoutMs}ms \u2014 rejecting it without killing the worker.
304
+ `
305
+ );
306
+ _pending.delete(requestId);
307
+ if (_inFlightId === requestId) _inFlightId = null;
308
+ req.reject(new Error(`db write worker ${req.kind} request timed out after ${req.timeoutMs}ms (worker not killed)`));
309
+ pumpQueue();
310
+ }
311
+ function abortWorkerAfterTimeout(requestId, req) {
312
+ const timeoutMs = req.timeoutMs;
313
+ const worker = _worker;
314
+ if (!worker || !_pending.has(requestId) || _respawning) return;
315
+ process.stderr.write(
316
+ `[exed] DB write worker ${req.kind} request ${requestId.slice(0, 8)} exceeded ${timeoutMs}ms \u2014 killing the worker so the request cannot commit after it is reported failed; respawning (${_queue.length} queued request(s) kept for the new worker).
317
+ `
318
+ );
319
+ _workerReady = false;
320
+ _respawning = true;
321
+ _killReason = req.kind === "sweep" ? `db write worker sweep request timed out after ${timeoutMs}ms (worker killed, batch rolled back)` : "db write worker write timed out (worker killed before reporting)";
322
+ try {
323
+ worker.kill("SIGKILL");
324
+ } catch {
325
+ }
326
+ }
327
+ function _getDbWriteWorkerForTests() {
328
+ return _worker;
329
+ }
330
+ function disposeDbWriteWorker() {
331
+ _respawning = false;
332
+ _retryAfterExit = false;
333
+ _killReason = null;
334
+ clearReadyDeadline();
335
+ rejectAllPending("write worker disposed");
336
+ if (_worker) {
337
+ try {
338
+ _worker.kill("SIGTERM");
339
+ } catch {
340
+ }
341
+ _worker = null;
342
+ }
343
+ _workerReady = false;
344
+ }
345
+
346
+ export {
347
+ memoryWriteBehindSweepBoundMs,
348
+ buildDbWriteWorkerEnv,
349
+ isWriteWorkerEnabled,
350
+ resolveDbWriteWorkerPath,
351
+ spawnDbWriteWorker,
352
+ isDbWriteWorkerReady,
353
+ writeMemoryInWorker,
354
+ sweepSessionEventsRetentionInWorker,
355
+ sweepConversationsRetentionInWorker,
356
+ requestMaintenanceWrite,
357
+ _getDbWriteWorkerForTests,
358
+ disposeDbWriteWorker
359
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recordOrchestrationEventBestEffort
3
- } from "./chunk-JGBYZTWH.js";
3
+ } from "./chunk-NFTTBVL2.js";
4
4
  import {
5
5
  atomicWriteJsonSync
6
6
  } from "./chunk-HSGBZSCA.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  clean,
3
3
  stableId
4
- } from "./chunk-YVWXI2HM.js";
4
+ } from "./chunk-5ZVDEGES.js";
5
5
 
6
6
  // src/lib/reflection-checkpoints.ts
7
7
  function parsePayload(payload) {