@askexenow/exe-os 0.9.413 → 0.9.415

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 (422) 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-MHWQDMML.js → active-agent-LB7T3TLZ.js} +7 -6
  8. package/dist/{active-agent-3YCLS7GB.js → active-agent-NUV4ZSZV.js} +7 -6
  9. package/dist/{agent-defs-generator-DNXMO34I.js → agent-defs-generator-GMN7JLNZ.js} +6 -5
  10. package/dist/{agentic-ontology-RA6CMND6.js → agentic-ontology-ARQVAAYP.js} +1 -1
  11. package/dist/{artifact-backup-EETHNFFP.js → artifact-backup-C6CYTX4E.js} +3 -3
  12. package/dist/{backfill-metadata-WYT257VG.js → backfill-metadata-OLMSQBJF.js} +9 -8
  13. package/dist/{backup-verify-AG54CYGR.js → backup-verify-TPKH64MK.js} +3 -2
  14. package/dist/{behavior-injection-G7GAUHGO.js → behavior-injection-UJ6CW5K7.js} +12 -11
  15. package/dist/{behavior-promotion-I2DIUFUR.js → behavior-promotion-QSVT4WGD.js} +11 -10
  16. package/dist/{behaviors-SKVKPCRW.js → behaviors-6HWTCOTR.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-agent-config.js +5 -4
  29. package/dist/bin/exe-agent.js +17 -16
  30. package/dist/bin/exe-assign.js +10 -9
  31. package/dist/bin/exe-boot.js +39 -38
  32. package/dist/bin/exe-call.js +10 -9
  33. package/dist/bin/exe-cloud.js +19 -18
  34. package/dist/bin/exe-config-dump.js +5 -4
  35. package/dist/bin/exe-dispatch.js +19 -18
  36. package/dist/bin/exe-doctor.js +9 -8
  37. package/dist/bin/exe-export-behaviors.js +14 -13
  38. package/dist/bin/exe-forget.js +12 -11
  39. package/dist/bin/exe-gateway.js +11 -10
  40. package/dist/bin/exe-grant.js +6 -6
  41. package/dist/bin/exe-healthcheck.js +11 -10
  42. package/dist/bin/exe-heartbeat.js +24 -23
  43. package/dist/bin/exe-kill.js +23 -22
  44. package/dist/bin/exe-launch-agent.js +66 -33
  45. package/dist/bin/exe-mcp.js +8 -7
  46. package/dist/bin/exe-memory-reads.js +9 -8
  47. package/dist/bin/exe-new-employee.js +14 -13
  48. package/dist/bin/exe-os-mcp-proxy.js +8 -7
  49. package/dist/bin/exe-pending-messages.js +19 -18
  50. package/dist/bin/exe-pending-notifications.js +18 -17
  51. package/dist/bin/exe-pending-reviews.js +19 -18
  52. package/dist/bin/exe-rename.js +9 -8
  53. package/dist/bin/exe-review.js +22 -21
  54. package/dist/bin/exe-search.js +11 -10
  55. package/dist/bin/exe-session-cleanup.js +23 -22
  56. package/dist/bin/exe-settings.js +18 -17
  57. package/dist/bin/exe-start-codex.js +21 -20
  58. package/dist/bin/exe-start-opencode.js +19 -18
  59. package/dist/bin/exe-start.sh +10 -1
  60. package/dist/bin/exe-status.js +20 -19
  61. package/dist/bin/exe-support.js +3 -3
  62. package/dist/bin/exe-team.js +7 -6
  63. package/dist/bin/exe-telemetry.js +88 -0
  64. package/dist/bin/git-sweep.js +20 -19
  65. package/dist/bin/graph-backfill.js +10 -9
  66. package/dist/bin/graph-export.js +10 -9
  67. package/dist/bin/hooks-cli.js +1 -1
  68. package/dist/bin/import-history.js +14 -13
  69. package/dist/bin/install.js +109 -108
  70. package/dist/bin/intercom-check.js +5 -5
  71. package/dist/bin/mcp-sessions.js +2 -2
  72. package/dist/bin/orchestration-metrics.js +7 -6
  73. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  74. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  75. package/dist/bin/reconcile-backlog.js +2 -2
  76. package/dist/bin/registry-proxy.js +1 -1
  77. package/dist/bin/repair-document-chunks.js +9 -8
  78. package/dist/bin/scan-tasks.js +19 -18
  79. package/dist/bin/setup.js +4 -3
  80. package/dist/bin/shard-migrate.js +10 -9
  81. package/dist/bin/stack-update.js +4 -4
  82. package/dist/bin/vps-health-gate.js +1 -1
  83. package/dist/{boot-generation-RPJVFAQJ.js → boot-generation-UGKTVJQW.js} +6 -5
  84. package/dist/{boot-review-sections-FOPPZTJI.js → boot-review-sections-EW5FJU3N.js} +17 -16
  85. package/dist/{bug-landed-reconciler-FN5KPBRK.js → bug-landed-reconciler-7DLU65MM.js} +8 -7
  86. package/dist/build-info.json +3 -3
  87. package/dist/build-manifest.json +1157 -1132
  88. package/dist/{capability-cards-YQWBEG7A.js → capability-cards-EC7FLCFF.js} +5 -4
  89. package/dist/{capacity-monitor-7SMEJHYG.js → capacity-monitor-2TQMIGQV.js} +19 -18
  90. package/dist/{catchup-brief-IBQ26LEB.js → catchup-brief-Q2CEZ5LV.js} +24 -23
  91. package/dist/{chunk-M6SUJLNP.js → chunk-2PNEZSFH.js} +2 -2
  92. package/dist/{chunk-NCNT2C2P.js → chunk-2S3H4TRY.js} +2 -2
  93. package/dist/{chunk-27NG2NTG.js → chunk-2UAILEAO.js} +2 -2
  94. package/dist/{chunk-RHHEYC6H.js → chunk-3PMAZKLF.js} +3 -3
  95. package/dist/{chunk-W4H2MZAS.js → chunk-3W6D3XED.js} +1 -1
  96. package/dist/{chunk-JAIZCE6W.js → chunk-43BBN2ZV.js} +3 -3
  97. package/dist/{chunk-IPUDXR67.js → chunk-4FURM6R5.js} +12 -3
  98. package/dist/{chunk-JW5NUXPN.js → chunk-5GUSZMFP.js} +14 -14
  99. package/dist/{chunk-RHJOTGEU.js → chunk-5HCHK52F.js} +1 -1
  100. package/dist/{chunk-7HLAYQRG.js → chunk-5PNYCWYF.js} +5 -5
  101. package/dist/{chunk-HUHR5CKJ.js → chunk-5X5BOCLS.js} +4 -4
  102. package/dist/{chunk-2EYVXUGA.js → chunk-6DFP2ZMF.js} +4 -4
  103. package/dist/{chunk-6HJF7IA3.js → chunk-6QVWL7ZX.js} +227 -198
  104. package/dist/{chunk-TS4LSNRI.js → chunk-745M4HPM.js} +1 -1
  105. package/dist/{chunk-HDV2V25K.js → chunk-7BMIJMFY.js} +1 -1
  106. package/dist/{chunk-Z3LGAFMG.js → chunk-7D6432GR.js} +1 -1
  107. package/dist/{chunk-6L4VIYLZ.js → chunk-7MCEYNWK.js} +15 -1
  108. package/dist/{chunk-XDOCXKHW.js → chunk-7ZEIFHRE.js} +1 -1
  109. package/dist/{chunk-ZZR2WRNW.js → chunk-AAVLHB5A.js} +4 -4
  110. package/dist/{chunk-7YX73K2R.js → chunk-ALA7WYZZ.js} +6 -1
  111. package/dist/{chunk-CJ6CS2IH.js → chunk-BHIMHRRI.js} +5 -5
  112. package/dist/{chunk-CRW63CDI.js → chunk-BSSVSBHE.js} +1 -1
  113. package/dist/chunk-CCFWKW2D.js +92 -0
  114. package/dist/{chunk-FYV2CTKP.js → chunk-CL7P4RW3.js} +1 -1
  115. package/dist/{chunk-SXUABANK.js → chunk-CRO66YJ2.js} +3 -3
  116. package/dist/{chunk-GL5ZG72X.js → chunk-CTZTOAHJ.js} +2 -2
  117. package/dist/{chunk-LSHUX7P4.js → chunk-D4RU4Y57.js} +16 -16
  118. package/dist/{chunk-JGBYZTWH.js → chunk-D6D7LCMR.js} +1 -1
  119. package/dist/{chunk-HDQAVAV6.js → chunk-D6ORFO5E.js} +2 -2
  120. package/dist/{chunk-RIKFXHLE.js → chunk-DJZ4EAZ7.js} +1 -1
  121. package/dist/{chunk-3DXAJVXE.js → chunk-DNWWDHJM.js} +6 -6
  122. package/dist/{chunk-MZNLQC6W.js → chunk-E3TNFXWQ.js} +1 -1
  123. package/dist/{chunk-6PXFF6IV.js → chunk-EVSJUMO3.js} +1 -1
  124. package/dist/{chunk-CWHTUNJX.js → chunk-EXKT3GID.js} +2 -2
  125. package/dist/{chunk-J6U4ZR77.js → chunk-FDMZOLB3.js} +2 -2
  126. package/dist/{chunk-DHLJZDWI.js → chunk-FIAMVZ5I.js} +6 -6
  127. package/dist/{chunk-O3BLL6MY.js → chunk-FNRVCDFM.js} +1 -1
  128. package/dist/{chunk-BLTXAUP6.js → chunk-G32NPOUR.js} +2 -2
  129. package/dist/{chunk-QSW5DHMZ.js → chunk-GCMKH2PM.js} +1 -1
  130. package/dist/{chunk-BIPTWAEO.js → chunk-GDUQ3UQR.js} +1 -1
  131. package/dist/{chunk-L5JFVK5T.js → chunk-GDZJL5GQ.js} +15 -10
  132. package/dist/{chunk-RYMXD2NT.js → chunk-GELNQI77.js} +1 -1
  133. package/dist/{chunk-5ZMNFSHV.js → chunk-H3MFCDKR.js} +1 -1
  134. package/dist/{chunk-657I6PUF.js → chunk-H3ORS4N7.js} +3 -3
  135. package/dist/{chunk-W3ABSZ6G.js → chunk-H7ZVQUU2.js} +2 -2
  136. package/dist/{chunk-2YGBJHC2.js → chunk-HMEXSII5.js} +3 -3
  137. package/dist/{chunk-EWDBWOCX.js → chunk-HPCISMTN.js} +1 -1
  138. package/dist/{chunk-HA6BIZ6L.js → chunk-I2IG5GKQ.js} +8 -8
  139. package/dist/{chunk-SINIRUYZ.js → chunk-I4N7F54M.js} +117 -39
  140. package/dist/{chunk-XEAZJXMZ.js → chunk-IM2KTXBB.js} +2 -2
  141. package/dist/{chunk-XC5OASHV.js → chunk-IVPVCTXX.js} +1 -1
  142. package/dist/{chunk-CFFSHBQF.js → chunk-J56UXB2X.js} +1 -1
  143. package/dist/{chunk-6J2J3VJS.js → chunk-JHVRXXEB.js} +10 -10
  144. package/dist/{chunk-SO7KTH3Q.js → chunk-JJYL2K7E.js} +1 -1
  145. package/dist/{chunk-2BOLFLAU.js → chunk-JKDYZZGD.js} +2 -2
  146. package/dist/{chunk-VS7V5HNO.js → chunk-JOOWL33C.js} +1 -1
  147. package/dist/{chunk-7KPZQ65I.js → chunk-KAJC6L7D.js} +3 -3
  148. package/dist/{chunk-KN5GAVCG.js → chunk-KBJHOC6E.js} +2 -2
  149. package/dist/{chunk-KEDZRQI3.js → chunk-KKJ3BLYL.js} +2 -2
  150. package/dist/{chunk-QJWLQXR7.js → chunk-KYQ623IB.js} +1 -1
  151. package/dist/{chunk-W7VKGB42.js → chunk-L2IJM337.js} +1 -1
  152. package/dist/{chunk-IHAXXDBH.js → chunk-LCGQGYY6.js} +3 -3
  153. package/dist/{chunk-HTFM7ZDD.js → chunk-LFIDYVYE.js} +2 -2
  154. package/dist/chunk-LP5USONU.js +125 -0
  155. package/dist/{chunk-JJZZXEAN.js → chunk-LUB5P63H.js} +2 -2
  156. package/dist/{chunk-GATAYYAF.js → chunk-MLVDB65S.js} +3 -3
  157. package/dist/{chunk-2YFMBXUU.js → chunk-MSOPRLKE.js} +4 -4
  158. package/dist/{chunk-Q6KUBP6R.js → chunk-MXY47DBC.js} +5 -5
  159. package/dist/{chunk-PDQGR5LZ.js → chunk-N7PW2MXQ.js} +1 -1
  160. package/dist/{chunk-6DMURUBY.js → chunk-NLFYDDFL.js} +4 -4
  161. package/dist/{chunk-JNULO6I5.js → chunk-NPA3GSDP.js} +3 -3
  162. package/dist/{chunk-ZJ6AMC4Y.js → chunk-NXVVJE6C.js} +7 -7
  163. package/dist/{chunk-TVWYMOZ4.js → chunk-O3HLDFKY.js} +15 -4
  164. package/dist/{chunk-PYXXL7N7.js → chunk-OEH4DGFQ.js} +1 -1
  165. package/dist/{chunk-VBYSAQJD.js → chunk-OEJZFRT4.js} +1 -1
  166. package/dist/{chunk-VQQPYI4X.js → chunk-OJMM2CBY.js} +2 -2
  167. package/dist/{chunk-X2ZHCNNB.js → chunk-OL7KB6AV.js} +5 -5
  168. package/dist/{chunk-FSXMKIDO.js → chunk-OSAIUYF5.js} +1 -1
  169. package/dist/{chunk-GZVFHFO3.js → chunk-OVN35JFJ.js} +10 -10
  170. package/dist/{chunk-4J77TCTX.js → chunk-PMGEC42V.js} +1 -1
  171. package/dist/{chunk-LBSCOP25.js → chunk-PV5OGJYV.js} +1 -1
  172. package/dist/{chunk-M6AX64J2.js → chunk-QNFR7ZKH.js} +20 -8
  173. package/dist/{chunk-DWRULKB3.js → chunk-R32D6TBB.js} +2 -2
  174. package/dist/chunk-R3ZU4F7M.js +359 -0
  175. package/dist/{chunk-3N24FV22.js → chunk-REMAJEVA.js} +1 -1
  176. package/dist/{chunk-7SHU5MOD.js → chunk-RJ7RN5GE.js} +1 -1
  177. package/dist/{chunk-5BWDUUMH.js → chunk-RMXIDLAZ.js} +3 -3
  178. package/dist/{chunk-PTF5TB6O.js → chunk-RNFYJ7EQ.js} +9 -9
  179. package/dist/{chunk-RJIH7JXM.js → chunk-RV4DRCSF.js} +4 -4
  180. package/dist/{chunk-QOFQY7BJ.js → chunk-RYJTPWKV.js} +1 -1
  181. package/dist/{telemetry-upload-6DR6AL3V.js → chunk-SBHJ6YVB.js} +53 -28
  182. package/dist/{chunk-XQ7BIVLI.js → chunk-SOKGCUCF.js} +9 -9
  183. package/dist/{chunk-K2HIXAIF.js → chunk-SWU43K5E.js} +14 -14
  184. package/dist/{chunk-BE3UETW6.js → chunk-T4X35SUY.js} +3 -3
  185. package/dist/{chunk-LLZUL7M2.js → chunk-TDPDKE4M.js} +4 -2
  186. package/dist/{chunk-TCBWHLKH.js → chunk-TH3P7D7J.js} +9 -9
  187. package/dist/{chunk-47YGEM4N.js → chunk-TRH4DPXR.js} +1 -1
  188. package/dist/{chunk-EOWJXCYC.js → chunk-TSZ3JCQB.js} +1 -1
  189. package/dist/{chunk-FPF2PJFK.js → chunk-U34HVNLK.js} +3 -3
  190. package/dist/{chunk-OHHZNNUD.js → chunk-UC45TUAV.js} +1 -1
  191. package/dist/{chunk-IC2AONBH.js → chunk-UCXX7XZS.js} +9 -9
  192. package/dist/{chunk-N7POJZJT.js → chunk-UJRBX44K.js} +13 -13
  193. package/dist/{chunk-RYYFFCJG.js → chunk-UMBKEPUP.js} +1 -1
  194. package/dist/{chunk-GHYHNHDL.js → chunk-UOLIA6N6.js} +1 -1
  195. package/dist/{chunk-VAHQOIQY.js → chunk-UOPCGIEE.js} +1 -1
  196. package/dist/{chunk-5DLZJ3MY.js → chunk-UWIL3LFL.js} +1 -1
  197. package/dist/{chunk-BG6RAOCJ.js → chunk-UYK7NOJD.js} +3 -3
  198. package/dist/{chunk-LQGLGSBY.js → chunk-UYOWEAZB.js} +2 -2
  199. package/dist/{chunk-T3AM52YT.js → chunk-V4Q5FU7M.js} +4 -4
  200. package/dist/{chunk-A5I2GYVQ.js → chunk-VPXSW6MC.js} +3 -3
  201. package/dist/{chunk-7PDZBPGW.js → chunk-WECEOYOY.js} +1 -1
  202. package/dist/{chunk-GM4UEZDE.js → chunk-WEG7URND.js} +43 -30
  203. package/dist/{chunk-JTJP4JK7.js → chunk-X537FLO2.js} +3 -3
  204. package/dist/{chunk-RMC2A6EE.js → chunk-X6UH3DQE.js} +1 -1
  205. package/dist/{chunk-353XF4LU.js → chunk-XGQCOI3X.js} +2 -2
  206. package/dist/{chunk-FS7XF7SE.js → chunk-XHJO7XFR.js} +1 -1
  207. package/dist/{chunk-3GGMHSY2.js → chunk-XLUEY3SP.js} +3 -3
  208. package/dist/{chunk-D6NZNUVH.js → chunk-YAV55Y4U.js} +1 -1
  209. package/dist/{chunk-6777GNWI.js → chunk-YBVSVB6C.js} +19 -8
  210. package/dist/{chunk-6BD6JYR2.js → chunk-YV3AVQJW.js} +3 -3
  211. package/dist/{chunk-X4FHT6ST.js → chunk-YXGSP2MH.js} +9 -9
  212. package/dist/{chunk-O6KQAJCC.js → chunk-Z46GUZSY.js} +3 -3
  213. package/dist/{chunk-FUDXITKX.js → chunk-ZDD6IQGV.js} +1 -1
  214. package/dist/{chunk-QV26G2BF.js → chunk-ZO5S6T64.js} +1 -1
  215. package/dist/{cleanup-graph-garbage-SYGPMPUM.js → cleanup-graph-garbage-CNUIX5CD.js} +10 -9
  216. package/dist/{cli-shutdown-JI7CASE4.js → cli-shutdown-5PBVKPZJ.js} +1 -1
  217. package/dist/{cloud-sync-command-ZV3P5FP6.js → cloud-sync-command-3E4HKL3N.js} +2 -2
  218. package/dist/{cloud-sync-db-init-RQIHWKV4.js → cloud-sync-db-init-ASBDBYCS.js} +1 -1
  219. package/dist/{cloud-sync-shutdown-V2N7VLD3.js → cloud-sync-shutdown-P6ZT3O6P.js} +5 -4
  220. package/dist/{co-activation-SRE6DIRX.js → co-activation-7ZJFM3YK.js} +5 -4
  221. package/dist/{co-occurrence-F5TMSEQZ.js → co-occurrence-O7ON7AP3.js} +8 -7
  222. package/dist/{consent-passphrase-MWZRHJRC.js → consent-passphrase-ITU47UWT.js} +2 -2
  223. package/dist/{conversation-entity-extractor-XMOUHGMT.js → conversation-entity-extractor-JZNP4UGE.js} +3 -3
  224. package/dist/{conversations-retention-XTBFJBUM.js → conversations-retention-HFM2K6ND.js} +33 -12
  225. package/dist/{crdt-sync-FXEKABM7.js → crdt-sync-B2E3G5YE.js} +4 -4
  226. package/dist/{crm-webhook-D6IJOPRQ.js → crm-webhook-P543266X.js} +2 -2
  227. package/dist/{cto-delegation-gate-BU3JRCYN.js → cto-delegation-gate-ASFPC6L4.js} +18 -17
  228. package/dist/{daemon-orchestration-K4NKFYXO.js → daemon-orchestration-ZPUEHXRM.js} +24 -23
  229. package/dist/{doc-graph-extractor-TVK2NGAR.js → doc-graph-extractor-IADQDUXA.js} +8 -7
  230. package/dist/{documents-MDZ4VB5X.js → documents-MZ5N44EK.js} +10 -9
  231. package/dist/{dreaming-L24PSS35.js → dreaming-OXHEGMGQ.js} +22 -21
  232. package/dist/{employee-boot-brief-GQVL3FQC.js → employee-boot-brief-PMN4STQZ.js} +26 -25
  233. package/dist/{entity-boost-OMFA5QCG.js → entity-boost-5J6OOB4P.js} +1 -1
  234. package/dist/{exe-drift-JDDG3OPT.js → exe-drift-JPD3DP7R.js} +6 -5
  235. package/dist/{exe-export-EEGIE3JP.js → exe-export-TWJ2E235.js} +11 -10
  236. package/dist/{exe-import-UJNC5Q2L.js → exe-import-JTFPCMXG.js} +11 -10
  237. package/dist/{exe-key-TYEY4W4E.js → exe-key-47FOEEFU.js} +106 -105
  238. package/dist/{exe-org-B3ICTTEV.js → exe-org-SDLU427Y.js} +40 -40
  239. package/dist/{exe-snapshot-VBFBONYN.js → exe-snapshot-G6JSOA3W.js} +25 -24
  240. package/dist/{fast-db-init-TFRTK6EH.js → fast-db-init-BWZOVVBH.js} +1 -1
  241. package/dist/{founder-context-3X4QUWKD.js → founder-context-UMNCOSKR.js} +2 -2
  242. package/dist/{founder-monitor-envelope-54UNZNY4.js → founder-monitor-envelope-I4535R5I.js} +4 -4
  243. package/dist/gateway/index.js +19 -18
  244. package/dist/{gateway-client-OUDO5GGV.js → gateway-client-YD24RN7P.js} +1 -1
  245. package/dist/{git-staleness-73YZ5PGU.js → git-staleness-B4H3EE72.js} +5 -4
  246. package/dist/{global-procedures-PYNE2BQG.js → global-procedures-TTBNXTRS.js} +7 -6
  247. package/dist/{graph-auto-extract-PGUMEEQB.js → graph-auto-extract-E4RSCUEO.js} +8 -7
  248. package/dist/{graph-query-7YA3YNKL.js → graph-query-U4WIQNFV.js} +1 -1
  249. package/dist/{graph-rag-UWOTK4AQ.js → graph-rag-WPSWFLOX.js} +3 -3
  250. package/dist/{hook-integrity-6MNEPT6W.js → hook-integrity-G6L3XFGO.js} +1 -1
  251. package/dist/{hook-prefetch-JOF6YZSR.js → hook-prefetch-5AOLNRCY.js} +18 -17
  252. package/dist/{hook-tamper-log-HTWEP37U.js → hook-tamper-log-SWQVRDDV.js} +6 -1
  253. package/dist/hooks/bug-report-worker.js +22 -21
  254. package/dist/hooks/codex-stop-task-finalizer.js +24 -23
  255. package/dist/hooks/commit-complete.js +21 -20
  256. package/dist/hooks/error-recall.js +14 -13
  257. package/dist/hooks/exe-heartbeat-hook.js +8 -7
  258. package/dist/hooks/ingest-worker.js +20 -19
  259. package/dist/hooks/ingest.js +16 -15
  260. package/dist/hooks/instructions-loaded.js +10 -9
  261. package/dist/hooks/manifest.json +20 -20
  262. package/dist/hooks/notification.js +9 -8
  263. package/dist/hooks/post-compact.js +8 -7
  264. package/dist/hooks/post-tool-combined.js +13 -13
  265. package/dist/hooks/pre-compact.js +22 -21
  266. package/dist/hooks/pre-tool-use.js +2 -2
  267. package/dist/hooks/prompt-submit.js +40 -39
  268. package/dist/hooks/session-end.js +27 -26
  269. package/dist/hooks/session-start.js +18 -18
  270. package/dist/hooks/stop.js +25 -24
  271. package/dist/hooks/subagent-stop.js +25 -24
  272. package/dist/hooks/summary-worker.js +25 -24
  273. package/dist/index.js +32 -31
  274. package/dist/{installer-34XZ7JMW.js → installer-KQPRRYWJ.js} +9 -8
  275. package/dist/{installer-356RMQ2K.js → installer-NDH3XNBJ.js} +9 -8
  276. package/dist/{installer-7TN36Z7T.js → installer-SQXH44SB.js} +9 -8
  277. package/dist/{intercom-queue-ZJ3MNULM.js → intercom-queue-NKPPTIL4.js} +17 -16
  278. package/dist/lib/backup-verify-worker.js +3 -2
  279. package/dist/lib/cloud-sync.js +18 -17
  280. package/dist/lib/consolidation.js +11 -10
  281. package/dist/lib/crypto.js +3 -3
  282. package/dist/lib/database.js +5 -4
  283. package/dist/lib/db-backup.js +12 -1
  284. package/dist/lib/db-checkpoint-worker.js +25 -0
  285. package/dist/lib/db-read-worker-client.js +155 -26
  286. package/dist/lib/db-write-worker-client.js +5 -1
  287. package/dist/lib/db-write-worker.js +9 -8
  288. package/dist/lib/db.js +5 -4
  289. package/dist/lib/device-registry.js +1 -1
  290. package/dist/lib/employee-templates.js +8 -7
  291. package/dist/lib/employees.js +5 -4
  292. package/dist/lib/exe-daemon.js +127 -106
  293. package/dist/lib/file-grep.js +14 -1
  294. package/dist/lib/hybrid-search.js +11 -10
  295. package/dist/lib/identity.js +5 -4
  296. package/dist/lib/keychain.js +1 -1
  297. package/dist/lib/license.js +2 -2
  298. package/dist/lib/messaging.js +18 -17
  299. package/dist/lib/post-tool-memory.js +18 -17
  300. package/dist/lib/registry-proxy.js +1 -1
  301. package/dist/lib/reminders.js +6 -5
  302. package/dist/lib/schedules.js +10 -9
  303. package/dist/lib/session-registry.js +7 -6
  304. package/dist/lib/session-wrappers.js +1 -1
  305. package/dist/lib/skill-learning.js +11 -10
  306. package/dist/lib/store.js +9 -8
  307. package/dist/lib/task-router.js +6 -5
  308. package/dist/lib/tasks.js +19 -18
  309. package/dist/lib/telemetry-consent.js +29 -0
  310. package/dist/lib/tmux-routing.js +17 -16
  311. package/dist/lib/tmux-status.js +5 -1
  312. package/dist/lib/token-spend.js +6 -5
  313. package/dist/lib/ws-client.js +1 -1
  314. package/dist/{license-gate-4BXUTHLB.js → license-gate-Q37UDDE5.js} +3 -3
  315. package/dist/{license-recheck-QFPUKISQ.js → license-recheck-AJ7VHKXK.js} +1 -1
  316. package/dist/{license-sync-FDEDT4AC.js → license-sync-H7EMEVUL.js} +2 -2
  317. package/dist/{maintenance-worker-OY2E4BM5.js → maintenance-worker-3FNF2GA5.js} +1 -1
  318. package/dist/mcp/register-tools.js +105 -104
  319. package/dist/mcp/server.js +107 -106
  320. package/dist/mcp/tools/complete-reminder.js +7 -6
  321. package/dist/mcp/tools/create-reminder.js +7 -6
  322. package/dist/mcp/tools/create-task.js +22 -21
  323. package/dist/mcp/tools/deactivate-behavior.js +13 -12
  324. package/dist/mcp/tools/list-reminders.js +7 -6
  325. package/dist/mcp/tools/list-tasks.js +22 -21
  326. package/dist/mcp/tools/send-message.js +21 -20
  327. package/dist/mcp/tools/update-task.js +20 -19
  328. package/dist/{mcp-http-config-GKP5QGAO.js → mcp-http-config-4355SP7A.js} +8 -7
  329. package/dist/{mcp-session-identity-JHAGRB7B.js → mcp-session-identity-JKOJLE7C.js} +17 -16
  330. package/dist/{memory-cards-O377ETAM.js → memory-cards-WTRVBRVV.js} +9 -8
  331. package/dist/{memory-graph-extractor-4KJCCUOP.js → memory-graph-extractor-4T33LWJU.js} +9 -8
  332. package/dist/{memory-maintenance-RR5UPRW3.js → memory-maintenance-JGNZK33G.js} +1 -1
  333. package/dist/{memory-poisoning-defense-Y5TTKGOP.js → memory-poisoning-defense-AHMMXW44.js} +5 -4
  334. package/dist/{memory-pressure-watchdog-NGXTI4HR.js → memory-pressure-watchdog-L3Z4VEPV.js} +18 -17
  335. package/dist/{memory-reflection-EXNHRZL7.js → memory-reflection-4775DTOT.js} +9 -8
  336. package/dist/{memory-write-repository-S4TX7WQB.js → memory-write-repository-AQ7RXJVQ.js} +5 -3
  337. package/dist/{monitor-grants-57Q4NL25.js → monitor-grants-YCKRRH65.js} +3 -3
  338. package/dist/{monitor-identity-3FQ52SYU.js → monitor-identity-RC5HSDKY.js} +2 -2
  339. package/dist/{notification-ledger-O6KQYYGK.js → notification-ledger-EMZ676N7.js} +18 -17
  340. package/dist/{notifications-6FCQCJ4P.js → notifications-UITENQFG.js} +17 -16
  341. package/dist/{orchestration-events-2Z2BMMA5.js → orchestration-events-TXMCSNWZ.js} +6 -5
  342. package/dist/{orchestrator-AGOSKPHD.js → orchestrator-WJ55ZFL5.js} +19 -18
  343. package/dist/{org-brief-session-WJHZVXXJ.js → org-brief-session-YXCBRVSI.js} +17 -16
  344. package/dist/{org-consent-policy-X43UGTHI.js → org-consent-policy-ZVT2Y22K.js} +5 -5
  345. package/dist/{org-join-M3UTBMHC.js → org-join-PRWU2OBZ.js} +11 -11
  346. package/dist/{org-key-admin-AA2DRHB2.js → org-key-admin-FTGOH7RU.js} +13 -13
  347. package/dist/{org-key-epoch-Z5UIVUHT.js → org-key-epoch-IHN3UVUM.js} +5 -5
  348. package/dist/{org-key-pin-FE6YHEZ3.js → org-key-pin-TAL5ISYT.js} +3 -3
  349. package/dist/{org-membership-3J2MIGE4.js → org-membership-FZ7DUCZX.js} +4 -4
  350. package/dist/{org-partner-config-5HATZYG4.js → org-partner-config-Z45CGHE7.js} +8 -8
  351. package/dist/{org-partner-runtime-UI35IHUC.js → org-partner-runtime-J64U2Z7X.js} +17 -16
  352. package/dist/{org-row-visibility-TRJERVYP.js → org-row-visibility-JO2Z5XVO.js} +1 -1
  353. package/dist/{pipeline-router-EKQ6D7ZA.js → pipeline-router-ARYK3UAA.js} +6 -5
  354. package/dist/{plan-limits-3BGHIHX6.js → plan-limits-BA6ZSEQ2.js} +8 -7
  355. package/dist/{pre-tool-use-impl-7BT5TJVM.js → pre-tool-use-impl-NSPKU7SW.js} +34 -33
  356. package/dist/{project-name-PGJGUEJY.js → project-name-3WEMIXD6.js} +10 -5
  357. package/dist/{projection-worker-3GEVFPAI.js → projection-worker-OD7SCQVL.js} +2 -2
  358. package/dist/{prospective-memory-GEN7CN7H.js → prospective-memory-7M5EOED6.js} +5 -4
  359. package/dist/{push-notifications-QW4BWRC7.js → push-notifications-CT452G6K.js} +18 -17
  360. package/dist/{reproject-worktree-memories-DIULBEBD.js → reproject-worktree-memories-4X4FTVPN.js} +17 -16
  361. package/dist/{reranker-LQ6OPJOI.js → reranker-CZUA64BW.js} +1 -1
  362. package/dist/{retrieval-health-XDFYFEOP.js → retrieval-health-5K3EF7WW.js} +1 -1
  363. package/dist/{review-polling-ED33YLFT.js → review-polling-5W6HLGKH.js} +18 -17
  364. package/dist/runtime/index.js +25 -24
  365. package/dist/{seat-benefit-YEUQBNCS.js → seat-benefit-SBVGAMMY.js} +2 -2
  366. package/dist/{session-events-7IJGTBVH.js → session-events-OOYSDWTW.js} +26 -19
  367. package/dist/{session-kill-telemetry-RUTEARJ3.js → session-kill-telemetry-WTL757YS.js} +18 -17
  368. package/dist/{session-scope-SSYA64L3.js → session-scope-QNS6V4QZ.js} +17 -16
  369. package/dist/{setup-wizard-XD7FZVLJ.js → setup-wizard-2SPD7JW5.js} +4 -3
  370. package/dist/{shard-manager-FH5JZRSE.js → shard-manager-YZXA6L3J.js} +3 -3
  371. package/dist/{skill-refinement-UHD4E6GV.js → skill-refinement-XAL2VK7I.js} +6 -5
  372. package/dist/{skill-retrieval-F6PAJ3I5.js → skill-retrieval-H45FGACU.js} +13 -12
  373. package/dist/{skill-usage-2MBTF7Y4.js → skill-usage-Z4PY5DYL.js} +6 -5
  374. package/dist/{stack-generate-manifest-MVJDTU4F.js → stack-generate-manifest-ZWGGIXOW.js} +4 -4
  375. package/dist/{stack-promote-BMGEY6SQ.js → stack-promote-U34DKI2R.js} +4 -4
  376. package/dist/{stack-release-64UJ6Y4W.js → stack-release-IGZDQ2EA.js} +5 -5
  377. package/dist/{stack-update-EBATTQPP.js → stack-update-3MADKNUJ.js} +3 -3
  378. package/dist/{steward-gate-EWG2BHYQ.js → steward-gate-GXHJ3LLV.js} +6 -5
  379. package/dist/{subagent-brief-injection-YZGSWUEY.js → subagent-brief-injection-CONZI6JP.js} +29 -28
  380. package/dist/{subagent-spawn-ledger-PDICC43I.js → subagent-spawn-ledger-2XSOIL35.js} +3 -1
  381. package/dist/{support-bug-actions-RU6WZ3UV.js → support-bug-actions-GHMGOVQX.js} +3 -3
  382. package/dist/{support-inbox-A3S52SPS.js → support-inbox-3EDSKPUK.js} +15 -14
  383. package/dist/{task-enforcement-LVAS55AR.js → task-enforcement-DPOVUD2H.js} +18 -17
  384. package/dist/{task-request-inbox-2TN4ZUH2.js → task-request-inbox-6CCLPLZF.js} +5 -5
  385. package/dist/{task-scope-NLKUVCP5.js → task-scope-5OTHET2J.js} +17 -16
  386. package/dist/{tasks-crud-NQDPLHNZ.js → tasks-crud-ZPUVDX7W.js} +21 -16
  387. package/dist/{tasks-notify-BDM2NEHP.js → tasks-notify-3RODHYLI.js} +18 -17
  388. package/dist/{tasks-review-3G7CAW2O.js → tasks-review-H43CSMNK.js} +17 -16
  389. package/dist/telemetry-upload-4ZYZNO5R.js +42 -0
  390. package/dist/{token-budget-KNC2WGR7.js → token-budget-QGQRMS47.js} +6 -5
  391. package/dist/{tool-telemetry-I3SEU5M5.js → tool-telemetry-HPOHW2Y2.js} +1 -1
  392. package/dist/tui/App.js +27 -26
  393. package/dist/{tui-data-KJDWP4CB.js → tui-data-3E66SZPC.js} +21 -20
  394. package/dist/{update-support-UYDYMHVR.js → update-support-6PQDY3IQ.js} +14 -13
  395. package/dist/{whatsapp-5EMPZHF5.js → whatsapp-5YLHZDFB.js} +2 -2
  396. package/dist/{wiki-acl-M7BTQJBZ.js → wiki-acl-O4EOHWXE.js} +1 -1
  397. package/dist/{work-claims-5CFMZTML.js → work-claims-XGC47NTW.js} +6 -5
  398. package/dist/{work-state-heartbeat-7IA2DZ2E.js → work-state-heartbeat-WAVGL6QG.js} +1 -1
  399. package/dist/{workflow-engine-S5JOE2YR.js → workflow-engine-E7R4STX2.js} +2 -2
  400. package/dist/{worktree-7V4ZMF3D.js → worktree-GYH7OEVR.js} +7 -6
  401. package/dist/{worktree-sweep-34MXJ7S6.js → worktree-sweep-KMZ2KPSO.js} +8 -7
  402. package/package.json +2 -1
  403. package/release-notes.json +44 -36
  404. package/stack.release.json +3 -3
  405. package/dist/chunk-PEYQ6MWO.js +0 -175
  406. /package/dist/{chunk-EULAP6L6.js → chunk-2KBPXG43.js} +0 -0
  407. /package/dist/{chunk-J635FA7T.js → chunk-2WHPS3AR.js} +0 -0
  408. /package/dist/{chunk-QDSNEGJE.js → chunk-4ZWYHHUJ.js} +0 -0
  409. /package/dist/{chunk-J4B4M5PH.js → chunk-5LKFIUH3.js} +0 -0
  410. /package/dist/{chunk-542FBM5U.js → chunk-5TOYYGBC.js} +0 -0
  411. /package/dist/{chunk-CFO47VW4.js → chunk-BYNXKQG2.js} +0 -0
  412. /package/dist/{chunk-N45FAI6D.js → chunk-EORDC4BQ.js} +0 -0
  413. /package/dist/{chunk-6D2O5SAH.js → chunk-GTGXFYYI.js} +0 -0
  414. /package/dist/{chunk-YVWXI2HM.js → chunk-H6HWBMJ3.js} +0 -0
  415. /package/dist/{chunk-FYSKQPTE.js → chunk-QD3YZKZR.js} +0 -0
  416. /package/dist/{chunk-MOBZTIJQ.js → chunk-QTWQGGSP.js} +0 -0
  417. /package/dist/{chunk-SKSXROKP.js → chunk-TMJKP6WP.js} +0 -0
  418. /package/dist/{chunk-6NRZLVK3.js → chunk-YEUGS6CI.js} +0 -0
  419. /package/dist/{core-memory-PZEO3OWH.js → core-memory-RHW5ZX36.js} +0 -0
  420. /package/dist/{memory-isolation-MFNT2ITE.js → memory-isolation-J3KHDCE7.js} +0 -0
  421. /package/dist/{oauth-server-CBGEWD6H.js → oauth-server-WAR3PJOX.js} +0 -0
  422. /package/dist/{project-boot-VESAYDIH.js → project-boot-3BTM3FJ2.js} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getCurrentSessionScope,
3
3
  strictSessionScopeFilter
4
- } from "./chunk-GM4UEZDE.js";
4
+ } from "./chunk-WEG7URND.js";
5
5
  import {
6
6
  getProjectName
7
- } from "./chunk-TVWYMOZ4.js";
7
+ } from "./chunk-O3HLDFKY.js";
8
8
 
9
9
  // src/lib/session-events.ts
10
10
  import { randomUUID } from "crypto";
@@ -59,12 +59,18 @@ function sessionEventsRetentionMode(workerEnabled, workerReady) {
59
59
  };
60
60
  }
61
61
  async function sweepExpiredSessionEvents(client, retentionDays = DEFAULT_SESSION_EVENTS_RETENTION_DAYS) {
62
+ return (await sweepExpiredSessionEventsBatches(client, retentionDays, SESSION_EVENTS_SWEEP_MAX_BATCHES)).deleted;
63
+ }
64
+ var SESSION_EVENTS_SWEEP_BATCH_SIZE = 500;
65
+ var SESSION_EVENTS_SWEEP_MAX_BATCHES = 200;
66
+ async function sweepExpiredSessionEventsBatches(client, retentionDays = DEFAULT_SESSION_EVENTS_RETENTION_DAYS, maxBatches = SESSION_EVENTS_SWEEP_MAX_BATCHES) {
62
67
  const days = Number.isFinite(retentionDays) && retentionDays > 0 ? Math.floor(retentionDays) : DEFAULT_SESSION_EVENTS_RETENTION_DAYS;
68
+ const batches = Number.isFinite(maxBatches) && maxBatches > 0 ? Math.min(Math.floor(maxBatches), SESSION_EVENTS_SWEEP_MAX_BATCHES) : 1;
63
69
  const cutoff = `-${days} days`;
64
- const BATCH_SIZE = 500;
65
- const MAX_BATCHES = 200;
70
+ const BATCH_SIZE = SESSION_EVENTS_SWEEP_BATCH_SIZE;
66
71
  let total = 0;
67
- for (let i = 0; i < MAX_BATCHES; i++) {
72
+ let drained = false;
73
+ for (let i = 0; i < batches; i++) {
68
74
  const result = await client.execute({
69
75
  sql: `DELETE FROM session_events
70
76
  WHERE id IN (
@@ -77,10 +83,13 @@ async function sweepExpiredSessionEvents(client, retentionDays = DEFAULT_SESSION
77
83
  });
78
84
  const affected = Number(result.rowsAffected ?? 0);
79
85
  total += affected;
80
- if (affected < BATCH_SIZE) break;
81
- await new Promise((resolve) => setImmediate(resolve));
86
+ if (affected < BATCH_SIZE) {
87
+ drained = true;
88
+ break;
89
+ }
90
+ if (i + 1 < batches) await new Promise((resolve) => setImmediate(resolve));
82
91
  }
83
- return total;
92
+ return { deleted: total, drained };
84
93
  }
85
94
  async function recordSessionEvent(client, input) {
86
95
  if (!input.content || input.content.trim().length === 0) return;
@@ -168,6 +177,9 @@ export {
168
177
  DEFAULT_SESSION_EVENTS_RETENTION_DAYS,
169
178
  sessionEventsRetentionMode,
170
179
  sweepExpiredSessionEvents,
180
+ SESSION_EVENTS_SWEEP_BATCH_SIZE,
181
+ SESSION_EVENTS_SWEEP_MAX_BATCHES,
182
+ sweepExpiredSessionEventsBatches,
171
183
  recordSessionEvent,
172
184
  listRecentSessionEvents
173
185
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  sessionScopeFilter
3
- } from "./chunk-GM4UEZDE.js";
3
+ } from "./chunk-WEG7URND.js";
4
4
  import {
5
5
  leaseExpiryIso
6
6
  } from "./chunk-E23LNUWJ.js";
7
7
  import {
8
8
  getProjectName
9
- } from "./chunk-TVWYMOZ4.js";
9
+ } from "./chunk-O3HLDFKY.js";
10
10
 
11
11
  // src/lib/subagent-observability.ts
12
12
  var MAX_RESULT_DIGEST_CHARS = 200;
@@ -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
  getMasterKey
3
- } from "./chunk-4J77TCTX.js";
3
+ } from "./chunk-PMGEC42V.js";
4
4
  import {
5
5
  PRIVATE_DIR_MODE,
6
6
  PRIVATE_FILE_MODE,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getMasterKey
3
- } from "./chunk-4J77TCTX.js";
3
+ } from "./chunk-PMGEC42V.js";
4
4
 
5
5
  // src/lib/monitor-identity.ts
6
6
  import crypto from "crypto";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  cleanupCardsForMemories,
3
3
  cleanupGraphLinksForMemories
4
- } from "./chunk-HTFM7ZDD.js";
4
+ } from "./chunk-LFIDYVYE.js";
5
5
  import {
6
6
  resolveAnthropicAuth
7
7
  } from "./chunk-VGMACSEV.js";
8
8
  import {
9
9
  buildSystemStateExclusionFilter,
10
10
  vectorToBlob
11
- } from "./chunk-LSHUX7P4.js";
11
+ } from "./chunk-D4RU4Y57.js";
12
12
  import {
13
13
  extractKeywords,
14
14
  keywordsToString
15
15
  } from "./chunk-CHCA3ZM2.js";
16
16
  import {
17
17
  isCoordinatorName
18
- } from "./chunk-L5JFVK5T.js";
18
+ } from "./chunk-GDZJL5GQ.js";
19
19
 
20
20
  // src/lib/consolidation.ts
21
21
  import { randomUUID } from "crypto";
@@ -1,3 +1,9 @@
1
+ import {
2
+ TelegramAdapter
3
+ } from "./chunk-Q3V7K4ME.js";
4
+ import {
5
+ DiscordAdapter
6
+ } from "./chunk-N5RRQOAC.js";
1
7
  import {
2
8
  SlackAdapter
3
9
  } from "./chunk-ORCCI2VV.js";
@@ -7,19 +13,13 @@ import {
7
13
  import {
8
14
  createCRMWebhookHandler,
9
15
  parseTwentyWebhook
10
- } from "./chunk-RHJOTGEU.js";
16
+ } from "./chunk-5HCHK52F.js";
11
17
  import {
12
18
  WhatsAppAdapter
13
- } from "./chunk-3N24FV22.js";
19
+ } from "./chunk-REMAJEVA.js";
14
20
  import {
15
21
  SignalAdapter
16
22
  } from "./chunk-RJT7H2KR.js";
17
- import {
18
- TelegramAdapter
19
- } from "./chunk-Q3V7K4ME.js";
20
- import {
21
- DiscordAdapter
22
- } from "./chunk-N5RRQOAC.js";
23
23
  import {
24
24
  BotRegistry,
25
25
  BotRuntime,
@@ -42,7 +42,7 @@ import {
42
42
  retryWithBackoff,
43
43
  routeMessage,
44
44
  validateGatewayConfig
45
- } from "./chunk-XEAZJXMZ.js";
45
+ } from "./chunk-IM2KTXBB.js";
46
46
  import {
47
47
  OllamaProvider
48
48
  } from "./chunk-FWFFZGSC.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  sendMessage
3
- } from "./chunk-7KPZQ65I.js";
3
+ } from "./chunk-KAJC6L7D.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-GL5ZG72X.js";
6
+ } from "./chunk-CTZTOAHJ.js";
7
7
  import {
8
8
  resolveExeSession
9
- } from "./chunk-GM4UEZDE.js";
9
+ } from "./chunk-WEG7URND.js";
10
10
  import {
11
11
  getDispatcherSession
12
12
  } from "./chunk-PCV52RYM.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  getCoordinatorName,
18
18
  isCoordinatorName
19
- } from "./chunk-L5JFVK5T.js";
19
+ } from "./chunk-GDZJL5GQ.js";
20
20
 
21
21
  // src/mcp/tools/send-message.ts
22
22
  import { z } from "zod";
@@ -85,7 +85,7 @@ async function getRetrievalHealth() {
85
85
  totalMemories = Number(totalRes.rows[0]?.cnt ?? 0);
86
86
  memoriesWithVectors = Number(vectorRes.rows[0]?.cnt ?? 0);
87
87
  try {
88
- const { getGraphStats } = await import("./graph-query-7YA3YNKL.js");
88
+ const { getGraphStats } = await import("./graph-query-U4WIQNFV.js");
89
89
  const stats = await getGraphStats(client);
90
90
  entities = stats.entities;
91
91
  relationships = stats.relationships;