@askexenow/exe-os 0.9.359 → 0.9.362

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 (451) hide show
  1. package/deploy/compose/docker-compose.yml +7 -1
  2. package/deploy/compose/generate-env.ts +23 -4
  3. package/deploy/compose/sso-edge/default.conf.template +35 -0
  4. package/deploy/compose/sso-edge/sso-redirect.conf +23 -2
  5. package/deploy/stack-manifests/v0.9.json +228 -2
  6. package/dist/.dist-verified.json +3 -3
  7. package/dist/{active-agent-DMKNHGSG.js → active-agent-3FV5V7SS.js} +9 -8
  8. package/dist/{active-agent-Y3DCBD7J.js → active-agent-BPNEBKHI.js} +9 -8
  9. package/dist/{agentic-ontology-3233PNKV.js → agentic-ontology-RCVCJ6WB.js} +1 -1
  10. package/dist/{backfill-gate-DA7UT6UD.js → backfill-gate-LRX77SUD.js} +3 -2
  11. package/dist/{backfill-metadata-4DS4A5U3.js → backfill-metadata-Y3DGVCK5.js} +12 -11
  12. package/dist/{background-jobs-XGTLESKM.js → background-jobs-Z6KHCWES.js} +3 -2
  13. package/dist/{backup-verify-JNYKXIU2.js → backup-verify-TZPPUCLU.js} +5 -4
  14. package/dist/{behavior-injection-CGAMI552.js → behavior-injection-JMGGWCWG.js} +21 -13
  15. package/dist/{behaviors-57AMN5IP.js → behaviors-TT6CMEKC.js} +20 -12
  16. package/dist/bin/age-ontology-load.js +3 -2
  17. package/dist/bin/agentic-ontology-backfill.js +14 -13
  18. package/dist/bin/agentic-reflection-backfill.js +15 -14
  19. package/dist/bin/agentic-semantic-label.js +14 -13
  20. package/dist/bin/backfill-conversations.js +16 -14
  21. package/dist/bin/backfill-responses.js +16 -14
  22. package/dist/bin/backfill-vectors.js +20 -18
  23. package/dist/bin/bulk-sync-postgres.js +27 -24
  24. package/dist/bin/cc-doctor.js +13 -11
  25. package/dist/bin/cleanup-stale-review-tasks.js +31 -28
  26. package/dist/bin/cli.js +157 -47
  27. package/dist/bin/customer-readiness.js +10 -1
  28. package/dist/bin/deferred-daemon-restart.js +127 -104
  29. package/dist/bin/exe-agent-config.js +9 -8
  30. package/dist/bin/exe-agent.js +17 -16
  31. package/dist/bin/exe-assign.js +18 -16
  32. package/dist/bin/exe-boot.js +62 -49
  33. package/dist/bin/exe-call.js +10 -9
  34. package/dist/bin/exe-cloud.js +29 -26
  35. package/dist/bin/exe-config-dump.js +9 -8
  36. package/dist/bin/exe-dispatch.js +31 -28
  37. package/dist/bin/exe-doctor.js +14 -10
  38. package/dist/bin/exe-export-behaviors.js +22 -14
  39. package/dist/bin/exe-forget.js +14 -13
  40. package/dist/bin/exe-gateway.js +13 -12
  41. package/dist/bin/exe-grant.js +6 -6
  42. package/dist/bin/exe-healthcheck.js +13 -11
  43. package/dist/bin/exe-heartbeat.js +33 -30
  44. package/dist/bin/exe-kill.js +36 -33
  45. package/dist/bin/exe-launch-agent.js +126 -44
  46. package/dist/bin/exe-mcp.js +165 -1
  47. package/dist/bin/exe-memory-reads.js +12 -11
  48. package/dist/bin/exe-new-employee.js +20 -17
  49. package/dist/bin/exe-os-mcp-proxy.js +9 -8
  50. package/dist/bin/exe-pending-messages.js +32 -29
  51. package/dist/bin/exe-pending-notifications.js +31 -28
  52. package/dist/bin/exe-pending-reviews.js +31 -28
  53. package/dist/bin/exe-preflight.js +1 -1
  54. package/dist/bin/exe-rename.js +10 -9
  55. package/dist/bin/exe-review.js +35 -32
  56. package/dist/bin/exe-search.js +13 -12
  57. package/dist/bin/exe-session-cleanup.js +36 -33
  58. package/dist/bin/exe-settings.js +28 -25
  59. package/dist/bin/exe-start-codex.js +27 -19
  60. package/dist/bin/exe-start-opencode.js +23 -15
  61. package/dist/bin/exe-start.sh +11 -7
  62. package/dist/bin/exe-status.js +32 -29
  63. package/dist/bin/exe-support.js +5 -4
  64. package/dist/bin/exe-team.js +9 -8
  65. package/dist/bin/exe-watchdog.js +115 -30
  66. package/dist/bin/git-sweep.js +32 -29
  67. package/dist/bin/graph-backfill.js +14 -13
  68. package/dist/bin/graph-export.js +13 -12
  69. package/dist/bin/import-history.js +16 -15
  70. package/dist/bin/install.js +392 -201
  71. package/dist/bin/intercom-check.js +4 -4
  72. package/dist/bin/mcp-sessions.js +2 -2
  73. package/dist/bin/orchestration-metrics.js +10 -9
  74. package/dist/bin/postgres-agentic-reflection-backfill.js +5 -4
  75. package/dist/bin/postgres-agentic-semantic-backfill.js +4 -3
  76. package/dist/bin/reconcile-backlog.js +2 -2
  77. package/dist/bin/registry-proxy.js +1 -1
  78. package/dist/bin/scan-tasks.js +31 -28
  79. package/dist/bin/setup.js +7 -4
  80. package/dist/bin/shard-migrate.js +13 -12
  81. package/dist/bin/stack-update.js +45 -14
  82. package/dist/bin/update.js +4 -3
  83. package/dist/bin/vps-health-gate.js +1 -1
  84. package/dist/{boot-generation-4D3CTT7X.js → boot-generation-XABYKF5P.js} +9 -8
  85. package/dist/{boot-review-sections-NDFE5443.js → boot-review-sections-2X5TFIGU.js} +30 -27
  86. package/dist/{branch-hygiene-HNSOUDJE.js → branch-hygiene-Z4IBWAOX.js} +2 -1
  87. package/dist/{branding-6FHWZQYQ.js → branding-7MZDHTKN.js} +3 -2
  88. package/dist/build-manifest.json +1249 -1069
  89. package/dist/{capability-cards-OBB7BMMX.js → capability-cards-O5UXDOOA.js} +8 -7
  90. package/dist/{capacity-monitor-QLPEL6S5.js → capacity-monitor-IPXM726A.js} +32 -29
  91. package/dist/{catchup-brief-EN7QR6MP.js → catchup-brief-EBIGDXOK.js} +36 -33
  92. package/dist/{chunk-WRP5AG4D.js → chunk-23KWUA7Z.js} +2 -2
  93. package/dist/{chunk-PDRIIEFV.js → chunk-2FA4PYYX.js} +1 -1
  94. package/dist/chunk-2PRAXZWM.js +261 -0
  95. package/dist/{chunk-R6LNQAUG.js → chunk-327Q53AS.js} +34 -1
  96. package/dist/{chunk-MBULOZJF.js → chunk-32FEF5BW.js} +2 -2
  97. package/dist/{chunk-2YGAKBRG.js → chunk-35FD67ZB.js} +3 -3
  98. package/dist/{chunk-R62ITJDQ.js → chunk-3C7NE4JE.js} +1 -1
  99. package/dist/{chunk-YBX3G5OP.js → chunk-3ICF4IAZ.js} +1 -1
  100. package/dist/{chunk-CVTWQZOR.js → chunk-3L2QU5ZF.js} +14 -2
  101. package/dist/{chunk-I5AVZOL2.js → chunk-3YBJ36UX.js} +2 -2
  102. package/dist/{chunk-NKDKB2RT.js → chunk-465RCKVI.js} +6 -6
  103. package/dist/{chunk-QROIFRKI.js → chunk-4AFD4R35.js} +5 -5
  104. package/dist/{chunk-OSID72CN.js → chunk-4L33OFU4.js} +25 -1
  105. package/dist/{chunk-A6VIK3SS.js → chunk-4P2BFNSB.js} +2 -2
  106. package/dist/{chunk-SIGAQQHW.js → chunk-4R2WD6T3.js} +2 -2
  107. package/dist/{chunk-HPHF5VTT.js → chunk-4U56FZ7B.js} +4 -4
  108. package/dist/{chunk-2KLVTRY2.js → chunk-54USDN5Q.js} +1 -1
  109. package/dist/{chunk-CAEWPEBA.js → chunk-5C6ZIJ7J.js} +1 -1
  110. package/dist/{chunk-46RPEWTH.js → chunk-5H3RHWRE.js} +1 -1
  111. package/dist/chunk-5OPAUFLP.js +126 -0
  112. package/dist/{chunk-EHM4E62N.js → chunk-6DTALXOA.js} +1 -1
  113. package/dist/chunk-6EM6USV7.js +1332 -0
  114. package/dist/{chunk-JE34CB5H.js → chunk-6N3HUOV3.js} +2 -2
  115. package/dist/{chunk-6KREY2Q7.js → chunk-6QJXFLNN.js} +5 -5
  116. package/dist/{chunk-G37RG543.js → chunk-6UZDGEGQ.js} +1 -1
  117. package/dist/{chunk-APR556TY.js → chunk-6Y3KUO7Q.js} +190 -29
  118. package/dist/{chunk-2EAYZ3BK.js → chunk-7H3AZNQ7.js} +9 -9
  119. package/dist/{chunk-C5YZMYQH.js → chunk-7SY2NOMQ.js} +1 -1
  120. package/dist/{chunk-OAYTQ4RY.js → chunk-AL4HXKDJ.js} +55 -12
  121. package/dist/{chunk-VY5VU7SX.js → chunk-AOMFYUPT.js} +2 -2
  122. package/dist/{chunk-EX2SSLNU.js → chunk-AQO3BT3I.js} +12 -12
  123. package/dist/chunk-ARX6TAGN.js +102 -0
  124. package/dist/chunk-B6PFGUYJ.js +159 -0
  125. package/dist/{chunk-FASR2WLT.js → chunk-BDLRTLXY.js} +1 -1
  126. package/dist/chunk-BJEQBKGH.js +218 -0
  127. package/dist/{chunk-BCZF3AGJ.js → chunk-BRIZ6OZ3.js} +34 -44
  128. package/dist/{chunk-OMXJMOBD.js → chunk-BRZR76TS.js} +66 -0
  129. package/dist/{chunk-XV42EAVK.js → chunk-BT2PUK3S.js} +1 -1
  130. package/dist/{chunk-6EOLGE7T.js → chunk-CVYDJ2TW.js} +1 -1
  131. package/dist/{chunk-WCP4OQUL.js → chunk-CXQ724WH.js} +2 -2
  132. package/dist/{chunk-F3QTF4T7.js → chunk-CY5NVDTH.js} +3 -3
  133. package/dist/{chunk-3ODATKWH.js → chunk-D5CY4E7I.js} +1 -1
  134. package/dist/{chunk-W5YV2PZE.js → chunk-DKRDU2AX.js} +16 -16
  135. package/dist/{chunk-SNWV44E5.js → chunk-DSKEYEL2.js} +12 -5
  136. package/dist/{chunk-VXL7PJ56.js → chunk-E3YI6FVJ.js} +5 -24
  137. package/dist/{chunk-6SK4MM5B.js → chunk-E7PL3T2U.js} +1 -1
  138. package/dist/{chunk-IOEUAQWP.js → chunk-EEZOBN6X.js} +1 -1
  139. package/dist/{chunk-AHMUF6RO.js → chunk-G2M7WQ2M.js} +0 -2
  140. package/dist/{chunk-SKGMF2SO.js → chunk-GBNB4EWD.js} +22 -1
  141. package/dist/{chunk-UZ5RJYL3.js → chunk-HAXCUCJC.js} +1 -1
  142. package/dist/{chunk-VMR6M6GN.js → chunk-HISFWAAK.js} +1 -1
  143. package/dist/{chunk-DKRSKC5R.js → chunk-HKQ7UTSE.js} +1 -1
  144. package/dist/chunk-HLQ4MS42.js +257 -0
  145. package/dist/{chunk-EA5FVACM.js → chunk-HLU52KTO.js} +29 -18
  146. package/dist/{chunk-QWVXN224.js → chunk-HPXFKUGU.js} +350 -65
  147. package/dist/{chunk-2OVTGZYH.js → chunk-HSKABJE6.js} +46 -3
  148. package/dist/{chunk-NE57GONM.js → chunk-I3SF6QGV.js} +1 -1
  149. package/dist/chunk-J6KMGEJW.js +238 -0
  150. package/dist/chunk-JKKZGDLP.js +182 -0
  151. package/dist/{chunk-3ZEVMZ4G.js → chunk-JYKZVAS6.js} +1 -1
  152. package/dist/{chunk-4DYJ6NOK.js → chunk-KA4WVDLX.js} +2 -2
  153. package/dist/{chunk-QH2XAUZ5.js → chunk-KBI4FVBZ.js} +1 -1
  154. package/dist/{chunk-VAY6IXWY.js → chunk-KDMVVHZH.js} +1 -1
  155. package/dist/{chunk-4FQIWAXA.js → chunk-KID6T2A4.js} +10 -10
  156. package/dist/{chunk-HNPHPGGF.js → chunk-KIKB6FY3.js} +2 -2
  157. package/dist/{chunk-STFR72YH.js → chunk-LCDW2HUL.js} +1 -1
  158. package/dist/{chunk-RFUTLZ2U.js → chunk-LG37UBBE.js} +4 -4
  159. package/dist/{chunk-3QWOO74G.js → chunk-LLZNPOGB.js} +97 -3
  160. package/dist/chunk-M67ARGXY.js +175 -0
  161. package/dist/chunk-MPVXHYD5.js +85 -0
  162. package/dist/{chunk-RXL7A7JH.js → chunk-MZYNW5OY.js} +1 -1
  163. package/dist/{chunk-DQ75MEPU.js → chunk-MZZN5GFC.js} +1 -1
  164. package/dist/{chunk-X2F6Q7TW.js → chunk-NAHCSQWT.js} +1 -1
  165. package/dist/{chunk-AL7JMA54.js → chunk-NE4QI2GX.js} +2 -2
  166. package/dist/chunk-NGDXBN3M.js +254 -0
  167. package/dist/{chunk-HDSDXGLV.js → chunk-NO5KHKKB.js} +1 -1
  168. package/dist/chunk-NOKJCF27.js +437 -0
  169. package/dist/{chunk-PLOEFBFW.js → chunk-O32HTNRX.js} +3 -3
  170. package/dist/{chunk-UPM5JP6G.js → chunk-OZNCAMS3.js} +47 -4
  171. package/dist/{chunk-XLEYCOHX.js → chunk-P7CV4SHQ.js} +398 -58
  172. package/dist/{chunk-G2KK64UB.js → chunk-PDJWHL63.js} +101 -19
  173. package/dist/{chunk-W3XUU36X.js → chunk-PF7EQSE5.js} +5 -5
  174. package/dist/{chunk-QX7RWICL.js → chunk-PU7UYQRC.js} +1 -1
  175. package/dist/{chunk-A5WEEND7.js → chunk-PUMH7JSB.js} +3 -3
  176. package/dist/{chunk-POZGQQEZ.js → chunk-PV5BIXT6.js} +1 -1
  177. package/dist/{chunk-TG7JYSEA.js → chunk-Q2VQNAPU.js} +5 -2
  178. package/dist/{chunk-Z2PAVJJ4.js → chunk-Q7J2SQJ6.js} +127 -29
  179. package/dist/{chunk-4JERP7NT.js → chunk-QAEWWYHL.js} +29 -1
  180. package/dist/{chunk-6JTKIXLU.js → chunk-QCJT265O.js} +1 -1
  181. package/dist/{chunk-OY2PWHYR.js → chunk-QI25QRUP.js} +2 -2
  182. package/dist/chunk-QILQ5FCG.js +198 -0
  183. package/dist/{chunk-LRETL4I3.js → chunk-QJBX3MBV.js} +3 -3
  184. package/dist/{chunk-57GRYGDU.js → chunk-QP53XLC5.js} +1 -1
  185. package/dist/{chunk-JBAMYKBL.js → chunk-QQMYD4M7.js} +1 -1
  186. package/dist/{chunk-SHEWTDPC.js → chunk-QY3TM2T3.js} +4 -4
  187. package/dist/{chunk-WA2MJGPT.js → chunk-QYRI25IP.js} +3 -3
  188. package/dist/{chunk-QLFN3MUW.js → chunk-RCOIKTHM.js} +1 -1
  189. package/dist/{chunk-ITRKRKS7.js → chunk-RFKRCVGW.js} +1 -1
  190. package/dist/{chunk-HK7SQDKJ.js → chunk-RNSAVQEU.js} +2 -2
  191. package/dist/{chunk-44WFVMZ5.js → chunk-RUUX2ZST.js} +1 -1
  192. package/dist/{chunk-DWKH2H7W.js → chunk-RWKX2TK5.js} +1 -1
  193. package/dist/{chunk-MCNDZU5W.js → chunk-RYRNY6IF.js} +2 -2
  194. package/dist/{chunk-5I3YC7ER.js → chunk-SC6WDF3Q.js} +2 -2
  195. package/dist/chunk-SLBOKYYQ.js +197 -0
  196. package/dist/{chunk-74R44E4S.js → chunk-SQM4ZTL2.js} +246 -96
  197. package/dist/{chunk-KIXNMTGC.js → chunk-SRFRUN66.js} +5 -5
  198. package/dist/chunk-SXKIGBNF.js +61 -0
  199. package/dist/chunk-T2RZU7JA.js +2607 -0
  200. package/dist/{chunk-2I23RPSI.js → chunk-TKDITWDN.js} +9 -0
  201. package/dist/{chunk-5UAMBMNR.js → chunk-TN2E6ZCM.js} +44 -34
  202. package/dist/{chunk-SQBNN44X.js → chunk-TP7RXGMP.js} +49 -15
  203. package/dist/{chunk-GSVQBBE5.js → chunk-TY4JLBFO.js} +2 -2
  204. package/dist/{chunk-7QRMFYOV.js → chunk-UHPMK6QZ.js} +17 -3
  205. package/dist/{chunk-LPKTGK7L.js → chunk-UO5QJ2RX.js} +4 -4
  206. package/dist/{chunk-VCCZQDCU.js → chunk-URNVIZXU.js} +3 -3
  207. package/dist/{chunk-OIS5VIAH.js → chunk-UWEFIIEG.js} +6 -2
  208. package/dist/{chunk-IQWAYXVF.js → chunk-V5I5N7NC.js} +3 -3
  209. package/dist/{chunk-GD7VXXW6.js → chunk-V6YLIDLK.js} +801 -180
  210. package/dist/chunk-VAOUB2TK.js +23 -0
  211. package/dist/{chunk-XVTKJEI2.js → chunk-VDMFVUSY.js} +3 -3
  212. package/dist/{chunk-RJ67HG2P.js → chunk-VWTUKKUF.js} +4 -4
  213. package/dist/{chunk-4WSUP4CC.js → chunk-W3LKIQJ2.js} +43 -17
  214. package/dist/{chunk-EUQF3JOH.js → chunk-WBG7XYVR.js} +1 -1
  215. package/dist/{chunk-YKRNH5LU.js → chunk-WH2VVEGD.js} +1 -1
  216. package/dist/{chunk-NP2Y7P3I.js → chunk-WP2TGH5R.js} +1 -1
  217. package/dist/chunk-WT4RI36X.js +23 -0
  218. package/dist/{chunk-LXG37RB2.js → chunk-XJIRUTGJ.js} +1 -1
  219. package/dist/chunk-XRCX6R5S.js +57 -0
  220. package/dist/{chunk-XWWNRFRF.js → chunk-XSYQ5EPE.js} +11 -11
  221. package/dist/{chunk-HKK7LLS5.js → chunk-XTGR3LMF.js} +34 -3
  222. package/dist/{chunk-HLEZ5O5P.js → chunk-XUB4GFPN.js} +17 -15
  223. package/dist/chunk-YZUHSV24.js +277 -0
  224. package/dist/{chunk-6WHYSLGF.js → chunk-Z67DIJKT.js} +1 -1
  225. package/dist/{chunk-6LY3QSJA.js → chunk-ZI3HA3XW.js} +11 -6
  226. package/dist/{chunk-YEOIPUFO.js → chunk-ZR4CQBAP.js} +1 -1
  227. package/dist/{chunk-VNK3MNZE.js → chunk-ZZEKOI2M.js} +1 -1
  228. package/dist/{cleanup-graph-garbage-XFGY4EEE.js → cleanup-graph-garbage-6F22Y5SD.js} +13 -12
  229. package/dist/{cloud-sync-shutdown-XCOATIJW.js → cloud-sync-shutdown-FWERMZB5.js} +8 -7
  230. package/dist/{co-activation-XNBLOGK3.js → co-activation-UEEDCM5U.js} +8 -7
  231. package/dist/{co-occurrence-HO4PGQC4.js → co-occurrence-W6OPFRSY.js} +11 -10
  232. package/dist/{code-context-index-5RY66SWZ.js → code-context-index-DWR6HS35.js} +7 -5
  233. package/dist/consent-passphrase-Z64GFJXK.js +23 -0
  234. package/dist/{conversation-entity-extractor-5G5DGRJU.js → conversation-entity-extractor-LWUIH3UB.js} +3 -3
  235. package/dist/{conversation-wiki-populator-RZKG6PK4.js → conversation-wiki-populator-5EGRW2UZ.js} +1 -1
  236. package/dist/{crdt-sync-6TD7LSZW.js → crdt-sync-NHJX3ZJD.js} +5 -4
  237. package/dist/{crm-webhook-WZAV5776.js → crm-webhook-OY467ATC.js} +2 -2
  238. package/dist/{cto-delegation-gate-UHMYFM4D.js → cto-delegation-gate-XH4YSQVC.js} +30 -27
  239. package/dist/{daemon-auth-SXZHLUYS.js → daemon-auth-OCHW2U6B.js} +3 -2
  240. package/dist/{daemon-orchestration-DT5M2ZAR.js → daemon-orchestration-7425ZVNH.js} +35 -32
  241. package/dist/{daemon-ready-56VAPZU6.js → daemon-ready-VGPSRI3Z.js} +1 -1
  242. package/dist/{daemon-restart-circuit-breaker-5V6B6NLS.js → daemon-restart-circuit-breaker-SMTWFX27.js} +25 -3
  243. package/dist/db-backend-ODVJ3Q3D.js +7 -0
  244. package/dist/{db-restore-events-ZLD2HRQV.js → db-restore-events-TFCZ4CPM.js} +2 -1
  245. package/dist/{doc-graph-extractor-FNCYPFKY.js → doc-graph-extractor-RR2VSO4W.js} +11 -10
  246. package/dist/{documents-GKDZDUED.js → documents-TRZ4R2ZW.js} +18 -16
  247. package/dist/dreaming-MAMZAPYW.js +63 -0
  248. package/dist/{exe-drift-QTKD2FHT.js → exe-drift-VBWB5E6S.js} +9 -8
  249. package/dist/{exe-export-ESJ6KP6J.js → exe-export-XJJTVVT7.js} +21 -13
  250. package/dist/{exe-import-N4X3GEQB.js → exe-import-G6O7JFNZ.js} +21 -13
  251. package/dist/{exe-key-KZCCHX3W.js → exe-key-A2WJLLTM.js} +116 -99
  252. package/dist/exe-org-HXF4XBB3.js +672 -0
  253. package/dist/{exe-snapshot-SCRPHCPZ.js → exe-snapshot-TL3TLKLR.js} +38 -33
  254. package/dist/{fast-db-init-6H67K76Q.js → fast-db-init-SO2XUQ7T.js} +1 -1
  255. package/dist/{founder-context-C7X7IRDA.js → founder-context-IOCADC66.js} +4 -3
  256. package/dist/{founder-monitor-envelope-DHSUMBWU.js → founder-monitor-envelope-SMILO4BT.js} +7 -5
  257. package/dist/gateway/index.js +23 -22
  258. package/dist/{gateway-client-7LMZKHTH.js → gateway-client-JA2BH7QO.js} +1 -1
  259. package/dist/{git-staleness-JCKVMWPO.js → git-staleness-I6WT7EXV.js} +8 -7
  260. package/dist/{global-procedures-BR7WGSE7.js → global-procedures-3RMO6C3C.js} +9 -8
  261. package/dist/{graph-auto-extract-EOXWQRBZ.js → graph-auto-extract-NKTYPD2I.js} +11 -10
  262. package/dist/{graph-rag-5FVC5JXH.js → graph-rag-EOGPZOYI.js} +3 -3
  263. package/dist/{hook-integrity-TYGDD7OE.js → hook-integrity-RTBF2BL2.js} +1 -1
  264. package/dist/{hook-prefetch-2CN3MK4H.js → hook-prefetch-V5KCGW2N.js} +31 -28
  265. package/dist/hooks/bug-report-worker.js +35 -32
  266. package/dist/hooks/codex-stop-task-finalizer.js +36 -33
  267. package/dist/hooks/commit-complete.js +34 -31
  268. package/dist/hooks/error-recall.js +16 -15
  269. package/dist/hooks/exe-heartbeat-hook.js +10 -9
  270. package/dist/hooks/ingest-worker.js +12 -10
  271. package/dist/hooks/ingest.js +19 -18
  272. package/dist/hooks/instructions-loaded.js +11 -10
  273. package/dist/hooks/manifest.json +20 -20
  274. package/dist/hooks/notification.js +11 -10
  275. package/dist/hooks/post-compact.js +11 -115
  276. package/dist/hooks/post-tool-combined.js +11 -11
  277. package/dist/hooks/pre-compact.js +38 -64
  278. package/dist/hooks/pre-tool-use.js +95 -36
  279. package/dist/hooks/prompt-submit.js +50 -47
  280. package/dist/hooks/session-end.js +39 -36
  281. package/dist/hooks/session-start.js +64 -18
  282. package/dist/hooks/stop.js +40 -37
  283. package/dist/hooks/subagent-stop.js +35 -32
  284. package/dist/hooks/summary-worker.js +41 -38
  285. package/dist/index.js +45 -42
  286. package/dist/inrun-inbox-DRKVDPLY.js +29 -0
  287. package/dist/{installer-VPNTM3X6.js → installer-G67M3DME.js} +11 -10
  288. package/dist/{installer-YDLSXGD2.js → installer-L3ZKMOPU.js} +11 -10
  289. package/dist/{installer-7UV3CNWZ.js → installer-QBWZSYDG.js} +11 -10
  290. package/dist/{intercom-queue-KHKJJYCQ.js → intercom-queue-R5LSXD3V.js} +30 -27
  291. package/dist/{key-backup-status-YMS7YGWO.js → key-backup-status-3RC6XTUX.js} +2 -1
  292. package/dist/lib/agent-config.js +3 -2
  293. package/dist/lib/cloud-sync.js +27 -24
  294. package/dist/lib/config.js +6 -1
  295. package/dist/lib/consolidation.js +14 -13
  296. package/dist/lib/crypto.js +4 -3
  297. package/dist/lib/database.js +8 -7
  298. package/dist/lib/db-backup.js +4 -3
  299. package/dist/lib/db-checkpoint-worker.js +1 -1
  300. package/dist/lib/db-daemon-client.js +7 -5
  301. package/dist/lib/db-read-worker-client.js +1 -1
  302. package/dist/lib/db-read-worker.js +1 -1
  303. package/dist/lib/db-write-worker-client.js +4 -2
  304. package/dist/lib/db-write-worker.js +21 -3
  305. package/dist/lib/db.js +8 -7
  306. package/dist/lib/device-registry.js +3 -2
  307. package/dist/lib/embed-worker.js +2 -1
  308. package/dist/lib/embedder.js +7 -5
  309. package/dist/lib/employee-templates.js +10 -9
  310. package/dist/lib/employees.js +8 -7
  311. package/dist/lib/error-detector.js +1 -1
  312. package/dist/lib/exe-daemon-client.js +16 -6
  313. package/dist/lib/exe-daemon.js +342 -168
  314. package/dist/lib/hybrid-search.js +13 -12
  315. package/dist/lib/identity-templates.js +3 -1
  316. package/dist/lib/identity.js +8 -7
  317. package/dist/lib/keychain.js +41 -3
  318. package/dist/lib/license.js +12 -3
  319. package/dist/lib/messaging.js +31 -28
  320. package/dist/lib/platform-support.js +25 -0
  321. package/dist/lib/post-tool-memory.js +6 -4
  322. package/dist/lib/preflight.js +29 -0
  323. package/dist/lib/registry-proxy.js +1 -1
  324. package/dist/lib/reminders.js +9 -8
  325. package/dist/lib/schedules.js +13 -12
  326. package/dist/lib/session-registry.js +10 -9
  327. package/dist/lib/session-wrappers.js +7 -3
  328. package/dist/lib/skill-learning.js +21 -13
  329. package/dist/lib/status-brief.js +8 -3
  330. package/dist/lib/store.js +12 -11
  331. package/dist/lib/task-router.js +9 -8
  332. package/dist/lib/tasks.js +32 -29
  333. package/dist/lib/tmux-routing.js +45 -29
  334. package/dist/lib/tmux-status.js +7 -3
  335. package/dist/lib/token-spend.js +9 -8
  336. package/dist/lib/ws-client.js +1 -1
  337. package/dist/{license-gate-YXUSNA2I.js → license-gate-6R3F3NQR.js} +5 -4
  338. package/dist/{license-sync-XFDOXL3Z.js → license-sync-VBJCXBAP.js} +4 -3
  339. package/dist/linux-systemd-LRW3BYSS.js +38 -0
  340. package/dist/mailbox-inbox-CP2VRBXZ.js +10 -0
  341. package/dist/mailbox-outbox-HXI7DYNC.js +19 -0
  342. package/dist/mcp/register-tools.js +110 -94
  343. package/dist/mcp/server.js +113 -97
  344. package/dist/mcp/tools/complete-reminder.js +10 -9
  345. package/dist/mcp/tools/create-reminder.js +10 -9
  346. package/dist/mcp/tools/create-task.js +38 -31
  347. package/dist/mcp/tools/deactivate-behavior.js +22 -14
  348. package/dist/mcp/tools/list-reminders.js +10 -9
  349. package/dist/mcp/tools/list-tasks.js +34 -31
  350. package/dist/mcp/tools/send-message.js +33 -30
  351. package/dist/mcp/tools/update-task.js +33 -30
  352. package/dist/{mcp-http-config-HIP5CEDV.js → mcp-http-config-BWX7AMAZ.js} +9 -8
  353. package/dist/{mcp-session-identity-RTNZ2ZLW.js → mcp-session-identity-GOBGICLI.js} +30 -27
  354. package/dist/{memory-cards-KG4TPNKK.js → memory-cards-4EXX3BQS.js} +12 -11
  355. package/dist/{memory-graph-extractor-6HTBLO2N.js → memory-graph-extractor-OYVZIJ3R.js} +12 -11
  356. package/dist/{memory-poisoning-defense-3ZT57RSJ.js → memory-poisoning-defense-AHOD2EBX.js} +8 -7
  357. package/dist/{memory-pressure-watchdog-ZOZBIMKC.js → memory-pressure-watchdog-COJC3OYS.js} +31 -28
  358. package/dist/{memory-queue-W54BYW7V.js → memory-queue-4VN3DTOE.js} +3 -2
  359. package/dist/memory-queue-client-OI4LDT4W.js +18 -0
  360. package/dist/{memory-reflection-EQC4FXSW.js → memory-reflection-V2SNAUIB.js} +8 -7
  361. package/dist/{monitor-grants-BDLVFVDR.js → monitor-grants-W3ISOLMC.js} +6 -4
  362. package/dist/{monitor-identity-GLFZSEAH.js → monitor-identity-AN3B5QIN.js} +3 -2
  363. package/dist/{notification-ledger-NZ4HO3M5.js → notification-ledger-J6Q2GAYU.js} +117 -53
  364. package/dist/{notifications-74YECZ4V.js → notifications-56TP36IK.js} +30 -27
  365. package/dist/{orchestration-events-KRQI4ED5.js → orchestration-events-CKQ756NA.js} +9 -8
  366. package/dist/{orchestration-phase-KVF42ZKU.js → orchestration-phase-ZJ4XVNFO.js} +3 -2
  367. package/dist/orchestrator-ERSQ3KNT.js +55 -0
  368. package/dist/org-brief-session-FSZ3QJDN.js +45 -0
  369. package/dist/org-consent-policy-BN7MKCZ2.js +68 -0
  370. package/dist/org-join-HTQ57JYH.js +35 -0
  371. package/dist/org-key-admin-4W6LZ5KZ.js +242 -0
  372. package/dist/org-key-pin-OTOKAELD.js +37 -0
  373. package/dist/{org-membership-B32NS5NI.js → org-membership-SML6GCHP.js} +11 -7
  374. package/dist/org-partner-config-XQGOB7EJ.js +25 -0
  375. package/dist/org-partner-runtime-RNNUL5IN.js +44 -0
  376. package/dist/org-row-visibility-JZFJ3YRJ.js +18 -0
  377. package/dist/{pipeline-router-6ZZV7JMA.js → pipeline-router-IUENNTAY.js} +9 -8
  378. package/dist/{plan-limits-B7AZKZ6U.js → plan-limits-ZUII366B.js} +11 -10
  379. package/dist/postinstall-failure-A7WTAXD6.js +20 -0
  380. package/dist/{project-boot-WEQSKDD7.js → project-boot-3DFY5F35.js} +7 -2
  381. package/dist/{projection-worker-LRFFQ6JB.js → projection-worker-MBWUPB5O.js} +5 -4
  382. package/dist/{prospective-memory-A4GDTIWG.js → prospective-memory-GHE5ORN4.js} +8 -7
  383. package/dist/push-notifications-PTQ5DHCD.js +60 -0
  384. package/dist/{reranker-YVTLJCFC.js → reranker-NUIGAPA3.js} +3 -2
  385. package/dist/{retrieval-health-PK2ODTXM.js → retrieval-health-XHCERQPG.js} +1 -1
  386. package/dist/{review-polling-JFWRNQF6.js → review-polling-CYBCBHZA.js} +31 -28
  387. package/dist/runtime/index.js +41 -38
  388. package/dist/{session-events-VMQBCUH3.js → session-events-X33W4JNA.js} +31 -28
  389. package/dist/{session-kill-telemetry-Z3W256T5.js → session-kill-telemetry-I2F5PUIW.js} +31 -28
  390. package/dist/session-lineage-AGOHSXIS.js +66 -0
  391. package/dist/{session-scope-2ADEVY3C.js → session-scope-WXP4F7OF.js} +30 -27
  392. package/dist/setup-wizard-2CTVITIX.js +35 -0
  393. package/dist/{shard-manager-DFLCDZT5.js → shard-manager-YEOHEOHL.js} +4 -3
  394. package/dist/{skill-refinement-APBYOSGX.js → skill-refinement-VDR5OT4V.js} +9 -8
  395. package/dist/{stack-promote-SZYIPTFT.js → stack-promote-XVC7FRJW.js} +6 -5
  396. package/dist/{stack-release-EYRDEGPD.js → stack-release-6PWAACRM.js} +101 -80
  397. package/dist/{stack-update-YWK2YXP6.js → stack-update-24VRBQ3U.js} +9 -4
  398. package/dist/{steward-gate-CIOBPNX6.js → steward-gate-2ZNYDVFO.js} +9 -8
  399. package/dist/{support-inbox-OAWGFRKW.js → support-inbox-ZHKLDETT.js} +5 -4
  400. package/dist/{task-enforcement-YAU6ZGDC.js → task-enforcement-GQDUTIFY.js} +37 -28
  401. package/dist/task-request-inbox-BFXNUU44.js +64 -0
  402. package/dist/{task-scope-44N7XP5N.js → task-scope-ERHPHLUM.js} +30 -27
  403. package/dist/{tasks-crud-IWVDREXG.js → tasks-crud-NVNF3NRA.js} +30 -27
  404. package/dist/tasks-notify-DXLU5VCT.js +60 -0
  405. package/dist/{tasks-review-VDFWFETP.js → tasks-review-BST6N34P.js} +30 -27
  406. package/dist/{telemetry-upload-3X5ESEKM.js → telemetry-upload-NY3EKOGY.js} +13 -12
  407. package/dist/{token-budget-WZGO22ME.js → token-budget-CLB3GUIX.js} +9 -8
  408. package/dist/{tool-capability-index-IFNZ6QUS.js → tool-capability-index-WZWVBI2R.js} +1 -1
  409. package/dist/{tool-telemetry-F7RWUNVK.js → tool-telemetry-PALAZUXT.js} +1 -1
  410. package/dist/tui/App.js +44 -41
  411. package/dist/{tui-data-KT7YGVQS.js → tui-data-CNFSRZP7.js} +30 -27
  412. package/dist/{typed-messages-TKDGVPHS.js → typed-messages-RCMPEKJN.js} +1 -1
  413. package/dist/{update-support-ZVRMECNQ.js → update-support-ZVB3CNGY.js} +24 -22
  414. package/dist/{work-state-heartbeat-CA4CN7DQ.js → work-state-heartbeat-O7UMB6SE.js} +1 -1
  415. package/dist/{worker-gate-52MVKYGZ.js → worker-gate-6DQQWDNB.js} +3 -2
  416. package/dist/{workflow-engine-ZAFBPVUP.js → workflow-engine-5ZULFH7O.js} +2 -2
  417. package/dist/{worktree-NNVXVV6A.js → worktree-ZWA35PKW.js} +10 -9
  418. package/dist/{worktree-sweep-IM2ZQG6Z.js → worktree-sweep-5LCVT46V.js} +11 -10
  419. package/package.json +8 -20
  420. package/postinstall.mjs +124 -0
  421. package/release-notes.json +18 -16
  422. package/stack.release.schema.json +4 -0
  423. package/dist/chunk-AFNRE2RV.js +0 -408
  424. package/dist/chunk-OSKWCKUC.js +0 -6
  425. package/dist/chunk-S3FIQCSM.js +0 -232
  426. package/dist/chunk-W6UB2AWP.js +0 -656
  427. package/dist/dreaming-WPMQJAXW.js +0 -60
  428. package/dist/exe-org-UK77DUU4.js +0 -73
  429. package/dist/memory-queue-client-RRNW2IFZ.js +0 -16
  430. package/dist/orchestrator-WV2YCHTK.js +0 -52
  431. package/dist/push-notifications-GOFTDDWW.js +0 -15
  432. package/dist/setup-wizard-26B36FMC.js +0 -14
  433. package/dist/tasks-notify-WK5HA77D.js +0 -57
  434. /package/dist/{chunk-YL2JH3XV.js → chunk-6C4UAKMS.js} +0 -0
  435. /package/dist/{chunk-YMCIZCNK.js → chunk-BN26LSME.js} +0 -0
  436. /package/dist/{chunk-WTH4CSAP.js → chunk-DFQEUZSI.js} +0 -0
  437. /package/dist/{chunk-FVWI2AR4.js → chunk-FIPUVCKC.js} +0 -0
  438. /package/dist/{chunk-ZMYXQU4L.js → chunk-L4LPJMPV.js} +0 -0
  439. /package/dist/{chunk-COHHVCFA.js → chunk-UELGUVNL.js} +0 -0
  440. /package/dist/{chunk-U7RZIY74.js → chunk-X7LY3IOB.js} +0 -0
  441. /package/dist/{chunk-BGYCUZYK.js → chunk-YAZ5ECEG.js} +0 -0
  442. /package/dist/{chunk-DSGFX3RT.js → chunk-YWN3XMPU.js} +0 -0
  443. /package/dist/{chunk-YMUZWC33.js → chunk-YYB5PMTK.js} +0 -0
  444. /package/dist/{core-memory-AATZRQEY.js → core-memory-BZFPVS43.js} +0 -0
  445. /package/dist/{entity-boost-HLFG2CH3.js → entity-boost-VXXED26D.js} +0 -0
  446. /package/dist/{memory-isolation-CF6FYSXD.js → memory-isolation-3PIOWLYP.js} +0 -0
  447. /package/dist/{message-queue-client-AX6KQK7T.js → message-queue-client-5XW7ZOK2.js} +0 -0
  448. /package/dist/{oauth-server-VE5ELXTF.js → oauth-server-KW5M437C.js} +0 -0
  449. /package/dist/{webhook-pipe-A4X4SCMW.js → webhook-pipe-QJRFZVKA.js} +0 -0
  450. /package/dist/{wiki-acl-GNIXYWHJ.js → wiki-acl-RXFV5OEU.js} +0 -0
  451. /package/dist/{wiki-client-7RRYRSPS.js → wiki-client-57QWZIHQ.js} +0 -0
@@ -0,0 +1,198 @@
1
+ import {
2
+ detectWSL,
3
+ probeContainer,
4
+ wslSystemdFixLines,
5
+ wslSystemdUnavailableDetail
6
+ } from "./chunk-ARX6TAGN.js";
7
+
8
+ // src/lib/linux-systemd.ts
9
+ import { spawnSync } from "child_process";
10
+ import { readFileSync } from "fs";
11
+ function readPid1Comm() {
12
+ try {
13
+ return readFileSync("/proc/1/comm", "utf8").trim();
14
+ } catch {
15
+ return void 0;
16
+ }
17
+ }
18
+ var SYSTEMD_DAEMON_UNIT = "exe-os.service";
19
+ var SYSTEMD_WATCHDOG_UNIT = "exe-os-watchdog.service";
20
+ var SYSTEMD_USER_UNIT_DIR = [".config", "systemd", "user"];
21
+ function assessSystemdUserEnv(input) {
22
+ const platform = input.platform ?? process.platform;
23
+ if (platform !== "linux") {
24
+ return { available: false, reason: "not-linux", wsl: false, detail: `systemd user units are Linux-only (platform: ${platform})` };
25
+ }
26
+ const env = input.env ?? process.env;
27
+ const wsl = input.isWsl ?? detectWSL({ platform, env });
28
+ const containerized = input.containerized ?? probeContainer();
29
+ const wslAdvice = wsl && !containerized;
30
+ if (!input.hasSystemctl) {
31
+ return {
32
+ available: false,
33
+ reason: "no-systemctl",
34
+ wsl,
35
+ detail: wslAdvice ? "systemctl not found in this WSL distro \u2014 WSL does not run systemd unless the distro opts in, so the daemon will run UNSUPERVISED (nothing restarts it if it crashes).\n" + wslSystemdFixLines().join("\n") + "\n If systemctl is still missing afterwards, install it: sudo apt install -y systemd" : "systemctl not found \u2014 this host does not run systemd (Alpine/OpenRC, minimal container, WSL1). The daemon will run UNSUPERVISED: nothing restarts it if it crashes."
36
+ };
37
+ }
38
+ if (!env.XDG_RUNTIME_DIR && !env.DBUS_SESSION_BUS_ADDRESS) {
39
+ if (wslAdvice) {
40
+ return { available: false, reason: "wsl-no-systemd", wsl: true, detail: wslSystemdUnavailableDetail() };
41
+ }
42
+ return {
43
+ available: false,
44
+ reason: "no-user-bus",
45
+ wsl,
46
+ detail: 'no systemd user bus in this session (XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS are both unset) \u2014 `systemctl --user` will fail with "Failed to connect to bus". This is the normal state for a plain `ssh host <command>` or `su` session. Fix: log in with `ssh -t host` / `machinectl shell $USER@`, or run `sudo loginctl enable-linger $USER` and re-run the installer from a full login session.'
47
+ };
48
+ }
49
+ if (wslAdvice && input.pid1Comm !== void 0 && input.pid1Comm.trim() !== "systemd") {
50
+ return { available: false, reason: "wsl-no-systemd", wsl: true, detail: wslSystemdUnavailableDetail() };
51
+ }
52
+ return { available: true, reason: "ok", wsl, detail: "" };
53
+ }
54
+ function hasSystemctl(run = runCommand) {
55
+ return run("systemctl", ["--version"], 5e3).code === 0;
56
+ }
57
+ var runCommand = (cmd, args, timeoutMs) => {
58
+ try {
59
+ const r = spawnSync(cmd, args, { encoding: "utf8", timeout: timeoutMs });
60
+ return {
61
+ code: r.status,
62
+ stdout: (r.stdout ?? "").toString(),
63
+ stderr: (r.stderr ?? "").toString() + (r.error ? String(r.error.message) : "")
64
+ };
65
+ } catch (err) {
66
+ return { code: null, stdout: "", stderr: err instanceof Error ? err.message : String(err) };
67
+ }
68
+ };
69
+ function isActiveOutput(stdout) {
70
+ const s = stdout.trim();
71
+ return s === "active" || s === "activating" || s === "reloading";
72
+ }
73
+ function isUnitActive(unit, run = runCommand) {
74
+ return isActiveOutput(run("systemctl", ["--user", "is-active", unit], 5e3).stdout);
75
+ }
76
+ function isUnitEnabled(unit, run = runCommand) {
77
+ const r = run("systemctl", ["--user", "is-enabled", unit], 5e3);
78
+ const s = r.stdout.trim();
79
+ return r.code === 0 || s === "enabled" || s === "enabled-runtime" || s === "linked" || s === "static";
80
+ }
81
+ function buildDaemonUnit(opts) {
82
+ return `[Unit]
83
+ Description=exe-os daemon
84
+ After=network.target
85
+ # The DEFAULT limit (5 starts / 10s) is too tight: a legitimate restart burst
86
+ # would park the unit in "failed" and end supervision. Disabling the limiter
87
+ # entirely (StartLimitIntervalSec=0) is the opposite mistake \u2014 the daemon's own
88
+ # circuit breaker only covers crashes AFTER recordDaemonRestart(), so anything
89
+ # earlier (module-load failure, corrupt dist, a libsql native-binding ABI
90
+ # mismatch after a node upgrade) would loop at 6 restarts/minute forever while
91
+ # "systemctl --user status" never says "failed". So: a GENEROUS bound. Normal
92
+ # self-heal and update churn never reaches 20 starts in 5 minutes; a hard boot
93
+ # failure does, and surfaces as a failed unit.
94
+ # (StartLimit* belongs in [Unit] since systemd 230.)
95
+ StartLimitIntervalSec=300
96
+ StartLimitBurst=20
97
+
98
+ [Service]
99
+ Type=simple
100
+ ExecStart=${opts.nodePath} --max-old-space-size=${opts.heapCapMB} --expose-gc ${opts.daemonPath}
101
+ Restart=on-failure
102
+ # RestartSec is LOAD-BEARING for the watchdog's successor-adoption logic: the
103
+ # watchdog waits SUCCESSOR_WAIT_MS (15s, src/bin/exe-watchdog.ts) for systemd to
104
+ # produce a replacement before it kickstarts one itself. That margin \u2014 15s wait
105
+ # vs 10s restart delay \u2014 is the only thing preventing a double restart per
106
+ # incident (the failure documented at length for launchd in exe-watchdog.ts).
107
+ # Do not raise this above SUCCESSOR_WAIT_MS without raising that constant first.
108
+ RestartSec=10
109
+ Environment=HOME=${opts.home}
110
+ Environment=PATH=${opts.pathEnv}
111
+ WorkingDirectory=${opts.home}
112
+
113
+ [Install]
114
+ WantedBy=default.target
115
+ `;
116
+ }
117
+ function buildWatchdogUnit(opts) {
118
+ return `[Unit]
119
+ Description=exe-os daemon watchdog (health monitor)
120
+ After=network.target
121
+ # Bounded, not disabled: the watchdog has NO circuit breaker of its own, so an
122
+ # unlimited Restart=always is an unbounded loop if the watchdog itself cannot
123
+ # boot. 20 starts / 5 min is far above the self-update cadence (exit 0 when a
124
+ # newer dist lands, a handful of times per day at most).
125
+ StartLimitIntervalSec=300
126
+ StartLimitBurst=20
127
+
128
+ [Service]
129
+ Type=simple
130
+ ExecStart=${opts.nodePath} ${opts.watchdogPath}
131
+ Restart=always
132
+ RestartSec=10
133
+ Environment=HOME=${opts.home}
134
+ Environment=PATH=${opts.pathEnv}
135
+ WorkingDirectory=${opts.home}
136
+
137
+ [Install]
138
+ WantedBy=default.target
139
+ `;
140
+ }
141
+ function isUnitAbsentResult(r) {
142
+ if (r.code === 5) return true;
143
+ const text = `${r.stderr} ${r.stdout}`.toLowerCase();
144
+ return text.includes("not loaded") || text.includes("could not be found") || text.includes("no such file") || // No systemctl binary at all (Alpine/OpenRC, minimal container): there is no
145
+ // unit to stop, and treating that as a refusal would make `daemon stop`
146
+ // report failure on every systemd-less host.
147
+ text.includes("enoent");
148
+ }
149
+ function stopLinuxSupervisorUnits(run = runCommand) {
150
+ const order = [SYSTEMD_WATCHDOG_UNIT, SYSTEMD_DAEMON_UNIT];
151
+ const stopped = [];
152
+ const absent = [];
153
+ const failed = [];
154
+ for (const unit of order) {
155
+ const r = run("systemctl", ["--user", "stop", unit], 1e4);
156
+ if (r.code === 0) stopped.push(unit);
157
+ else if (isUnitAbsentResult(r)) absent.push(unit);
158
+ else failed.push({ unit, detail: (r.stderr || r.stdout).trim() || `exit ${String(r.code)}` });
159
+ }
160
+ const ok = failed.length === 0;
161
+ const detail = ok ? stopped.length ? `stopped ${stopped.join(" + ")}` : "no systemd units installed" : failed.map((f) => `${f.unit} refused to stop (${f.detail})`).join("; ");
162
+ return { ok, order, stopped, absent, failed, detail };
163
+ }
164
+ function startWatchdogUnit(run = runCommand) {
165
+ const r = run("systemctl", ["--user", "start", SYSTEMD_WATCHDOG_UNIT], 1e4);
166
+ if (r.code === 0) return { ok: true, detail: `${SYSTEMD_WATCHDOG_UNIT} started` };
167
+ if (isUnitAbsentResult(r)) return { ok: true, detail: `${SYSTEMD_WATCHDOG_UNIT} not installed \u2014 nothing to start` };
168
+ return { ok: false, detail: (r.stderr || r.stdout).trim() || `exit ${String(r.code)}` };
169
+ }
170
+ function enableLinger(user, run = runCommand) {
171
+ const already = run("loginctl", ["show-user", user, "--property=Linger"], 5e3);
172
+ if (already.stdout.trim() === "Linger=yes") return { ok: true, detail: "already enabled" };
173
+ const r = run("loginctl", ["enable-linger", user], 5e3);
174
+ if (r.code === 0) return { ok: true, detail: "enabled" };
175
+ return {
176
+ ok: false,
177
+ detail: `${(r.stderr || r.stdout).trim() || `exit ${String(r.code)}`} \u2014 the daemon will stop at logout. Fix: sudo loginctl enable-linger ${user}`
178
+ };
179
+ }
180
+
181
+ export {
182
+ readPid1Comm,
183
+ SYSTEMD_DAEMON_UNIT,
184
+ SYSTEMD_WATCHDOG_UNIT,
185
+ SYSTEMD_USER_UNIT_DIR,
186
+ assessSystemdUserEnv,
187
+ hasSystemctl,
188
+ runCommand,
189
+ isActiveOutput,
190
+ isUnitActive,
191
+ isUnitEnabled,
192
+ buildDaemonUnit,
193
+ buildWatchdogUnit,
194
+ isUnitAbsentResult,
195
+ stopLinuxSupervisorUnits,
196
+ startWatchdogUnit,
197
+ enableLinger
198
+ };
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  extractMemoryGraph
3
- } from "./chunk-2YGAKBRG.js";
3
+ } from "./chunk-35FD67ZB.js";
4
4
  import {
5
5
  flushBatch,
6
6
  writeMemory
7
- } from "./chunk-W5YV2PZE.js";
7
+ } from "./chunk-DKRDU2AX.js";
8
8
  import {
9
9
  extractKeywords
10
10
  } from "./chunk-CHCA3ZM2.js";
11
11
  import {
12
12
  getActiveAgent
13
- } from "./chunk-WRP5AG4D.js";
13
+ } from "./chunk-23KWUA7Z.js";
14
14
 
15
15
  // src/mcp/tools/import-conversations.ts
16
16
  import { z } from "zod";
@@ -2,7 +2,7 @@ import {
2
2
  getClient,
3
3
  isCoordinatorName,
4
4
  loadEmployeesSync
5
- } from "./chunk-EA5FVACM.js";
5
+ } from "./chunk-HLU52KTO.js";
6
6
 
7
7
  // src/lib/steward-gate.ts
8
8
  import crypto from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-EA5FVACM.js";
3
+ } from "./chunk-HLU52KTO.js";
4
4
 
5
5
  // src/lib/boot-generation.ts
6
6
  var SYNC_META_KEY = "daemon_boot_generation";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  deactivateBehavior
3
- } from "./chunk-6LY3QSJA.js";
3
+ } from "./chunk-ZI3HA3XW.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-WRP5AG4D.js";
6
+ } from "./chunk-23KWUA7Z.js";
7
7
  import {
8
8
  canCoordinate,
9
9
  getClient
10
- } from "./chunk-EA5FVACM.js";
10
+ } from "./chunk-HLU52KTO.js";
11
11
 
12
12
  // src/mcp/tools/deactivate-behavior.ts
13
13
  import { z } from "zod";
@@ -24,7 +24,7 @@ function registerDeactivateBehavior(server) {
24
24
  async ({ behavior_id }) => {
25
25
  const caller = getActiveAgent();
26
26
  try {
27
- const { StewardGate } = await import("./steward-gate-CIOBPNX6.js");
27
+ const { StewardGate } = await import("./steward-gate-2ZNYDVFO.js");
28
28
  const steward = new StewardGate();
29
29
  const gateDecision = await steward.checkAuthority(caller.agentId || "unknown", "deactivate_behavior", behavior_id);
30
30
  if (!gateDecision.allowed) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCurrentSessionScope,
3
3
  strictSessionScopeFilter
4
- } from "./chunk-74R44E4S.js";
4
+ } from "./chunk-SQM4ZTL2.js";
5
5
  import {
6
6
  getProjectName
7
7
  } from "./chunk-OPU3NYOO.js";
@@ -53,9 +53,8 @@ async function ensureSessionEventsTable(client) {
53
53
  var DEFAULT_SESSION_EVENTS_RETENTION_DAYS = 14;
54
54
  async function sweepExpiredSessionEvents(client, retentionDays = DEFAULT_SESSION_EVENTS_RETENTION_DAYS) {
55
55
  const days = Number.isFinite(retentionDays) && retentionDays > 0 ? Math.floor(retentionDays) : DEFAULT_SESSION_EVENTS_RETENTION_DAYS;
56
- await ensureSessionEventsTable(client);
57
56
  const cutoff = `-${days} days`;
58
- const BATCH_SIZE = 5e3;
57
+ const BATCH_SIZE = 500;
59
58
  const MAX_BATCHES = 200;
60
59
  let total = 0;
61
60
  for (let i = 0; i < MAX_BATCHES; i++) {
@@ -72,6 +71,7 @@ async function sweepExpiredSessionEvents(client, retentionDays = DEFAULT_SESSION
72
71
  const affected = Number(result.rowsAffected ?? 0);
73
72
  total += affected;
74
73
  if (affected < BATCH_SIZE) break;
74
+ await new Promise((resolve) => setImmediate(resolve));
75
75
  }
76
76
  return total;
77
77
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadConfig,
3
3
  saveConfig
4
- } from "./chunk-BCZF3AGJ.js";
4
+ } from "./chunk-BRIZ6OZ3.js";
5
5
 
6
6
  // src/lib/orchestration-phase.ts
7
7
  var ORCHESTRATION_PHASES = [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EXE_AI_DIR
3
- } from "./chunk-BCZF3AGJ.js";
3
+ } from "./chunk-BRIZ6OZ3.js";
4
4
 
5
5
  // src/lib/mcp-transport-health.ts
6
6
  import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, statSync, writeFileSync } from "fs";
@@ -7,10 +7,10 @@ import {
7
7
  } from "./chunk-Z6BZQHP5.js";
8
8
  import {
9
9
  WORK_STATE_HEARTBEAT_TOOL
10
- } from "./chunk-ZMYXQU4L.js";
10
+ } from "./chunk-L4LPJMPV.js";
11
11
  import {
12
12
  hashMemoryContent
13
- } from "./chunk-FVWI2AR4.js";
13
+ } from "./chunk-FIPUVCKC.js";
14
14
 
15
15
  // src/lib/graph-rag.ts
16
16
  import crypto from "crypto";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeAction,
3
3
  substituteTemplate
4
- } from "./chunk-COHHVCFA.js";
4
+ } from "./chunk-UELGUVNL.js";
5
5
 
6
6
  // src/automation/workflow-engine.ts
7
7
  import { randomUUID } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-EA5FVACM.js";
3
+ } from "./chunk-HLU52KTO.js";
4
4
 
5
5
  // src/lib/token-budget.ts
6
6
  var WARN_THRESHOLD = 0.8;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  embed
3
- } from "./chunk-I5AVZOL2.js";
3
+ } from "./chunk-3YBJ36UX.js";
4
4
  import {
5
5
  flushBatch,
6
6
  writeMemory
7
- } from "./chunk-W5YV2PZE.js";
7
+ } from "./chunk-DKRDU2AX.js";
8
8
  import {
9
9
  redactSecrets
10
10
  } from "./chunk-4QCFFW2H.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionScopeFilter
3
- } from "./chunk-74R44E4S.js";
3
+ } from "./chunk-SQM4ZTL2.js";
4
4
 
5
5
  // src/lib/git-task-sweep.ts
6
6
  import { execSync } from "child_process";
@@ -238,7 +238,7 @@ async function sweepTasks(projectName, options = {}) {
238
238
  }
239
239
  if (!dryRun) {
240
240
  try {
241
- const { updateTaskStatus } = await import("./tasks-crud-IWVDREXG.js");
241
+ const { updateTaskStatus } = await import("./tasks-crud-NVNF3NRA.js");
242
242
  await updateTaskStatus({
243
243
  taskId: task.id,
244
244
  status: "needs_review",
@@ -0,0 +1,197 @@
1
+ import {
2
+ registerScopedQueryChokepoint,
3
+ scopedQueryChokepointStatus
4
+ } from "./chunk-T2RZU7JA.js";
5
+ import {
6
+ getClient
7
+ } from "./chunk-HLU52KTO.js";
8
+
9
+ // src/lib/org-scoped-rows.ts
10
+ var SCOPED_QUERY_MAX_LIMIT = 200;
11
+ var SCOPED_QUERY_DEFAULT_LIMIT = 50;
12
+ var ScopedReadWindowError = class extends Error {
13
+ constructor(message) {
14
+ super(message);
15
+ this.name = "ScopedReadWindowError";
16
+ }
17
+ };
18
+ function scopedQueryKey(orgId, q, structured) {
19
+ return JSON.stringify([
20
+ orgId,
21
+ structured ? "s" : "t",
22
+ [...q.kinds ?? []].sort(),
23
+ [...q.ids ?? []].sort(),
24
+ [...q.visibility ?? []].sort(),
25
+ q.tag ?? null,
26
+ normaliseLimit(q.limit)
27
+ ]);
28
+ }
29
+ function normaliseLimit(limit) {
30
+ if (typeof limit !== "number" || !Number.isFinite(limit) || limit <= 0) return SCOPED_QUERY_DEFAULT_LIMIT;
31
+ return Math.min(Math.floor(limit), SCOPED_QUERY_MAX_LIMIT);
32
+ }
33
+ var _window = null;
34
+ function createDaemonScopedRowReader() {
35
+ const serve = (which, orgId, query) => {
36
+ const win = _window;
37
+ if (!win) {
38
+ throw new ScopedReadWindowError(
39
+ "A scoped row read was attempted outside a read window. Rows for a brief must be resolved by withScopedReadWindow() before the (synchronous) draft runs \u2014 there is no synchronous path to the database, and answering from stale state would mislabel provenance."
40
+ );
41
+ }
42
+ if (win.orgId !== orgId) {
43
+ throw new ScopedReadWindowError(
44
+ `A scoped row read for org "${orgId}" was attempted inside a read window opened for "${win.orgId}". Cross-org reads during drafting are excluded at the query layer (\xA71.5).`
45
+ );
46
+ }
47
+ const key = scopedQueryKey(orgId, query, which === "structured");
48
+ const rows = win[which].get(key);
49
+ if (!rows) {
50
+ throw new ScopedReadWindowError(
51
+ `No rows were prefetched for this ${which} query in the open read window. Declare every query in the plan passed to withScopedReadWindow(); an undeclared read cannot be answered and must not be answered with an empty result, which would look like a clean zero-source draft.`
52
+ );
53
+ }
54
+ return rows.map((r) => ({ ...r }));
55
+ };
56
+ return {
57
+ readTextRows: (orgId, query) => serve("text", orgId, query),
58
+ readStructuredRows: (orgId, query) => serve("structured", orgId, query)
59
+ };
60
+ }
61
+ function registerDaemonScopedQueryChokepoint(origin = "daemon") {
62
+ const before = scopedQueryChokepointStatus();
63
+ if (before.registered) {
64
+ if (before.origin === origin) return false;
65
+ throw new Error(
66
+ `Refusing to proceed: the scoped-query chokepoint was already registered by "${before.origin}", not by "${origin}". Whoever registers first defines what visibility means for this process, so a foreign registration is a correctness incident, not a warning.`
67
+ );
68
+ }
69
+ registerScopedQueryChokepoint(createDaemonScopedRowReader(), origin);
70
+ return true;
71
+ }
72
+ function str(v) {
73
+ return typeof v === "string" && v.length > 0 ? v : null;
74
+ }
75
+ function wantsKind(query, kind) {
76
+ return !query.kinds || query.kinds.length === 0 || query.kinds.includes(kind);
77
+ }
78
+ function visibilityFilter(query) {
79
+ const wanted = query.visibility?.filter((v) => typeof v === "string") ?? [];
80
+ if (wanted.length === 0) return { sql: "", args: [] };
81
+ return {
82
+ sql: ` AND COALESCE(visibility, 'private') IN (${wanted.map(() => "?").join(", ")})`,
83
+ args: [...wanted]
84
+ };
85
+ }
86
+ async function fetchMemoryRows(orgId, query) {
87
+ const client = getClient();
88
+ const limit = normaliseLimit(query.limit);
89
+ const vis = visibilityFilter(query);
90
+ const args = [];
91
+ let sql = "SELECT id, content, category, visibility, origin_org_id FROM memories WHERE (deleted_at IS NULL OR deleted_at = '')";
92
+ if (query.ids?.length) {
93
+ sql += ` AND id IN (${query.ids.map(() => "?").join(", ")})`;
94
+ args.push(...query.ids);
95
+ }
96
+ sql += vis.sql;
97
+ args.push(...vis.args);
98
+ sql += " AND (COALESCE(visibility, 'private') = 'private' OR origin_org_id IS NULL OR origin_org_id = ?)";
99
+ args.push(orgId);
100
+ if (query.tag) {
101
+ sql += " AND (category = ? OR content LIKE ?)";
102
+ args.push(query.tag, `%${query.tag}%`);
103
+ }
104
+ sql += " ORDER BY created_at DESC LIMIT ?";
105
+ args.push(limit);
106
+ const res = await client.execute({ sql, args });
107
+ return res.rows.map((r) => ({
108
+ id: String(r.id),
109
+ kind: "memory",
110
+ visibility: str(r.visibility),
111
+ origin_org_id: str(r.origin_org_id),
112
+ label: str(r.category),
113
+ text: typeof r.content === "string" ? r.content : ""
114
+ }));
115
+ }
116
+ async function fetchTaskRows(orgId, query) {
117
+ const client = getClient();
118
+ const limit = normaliseLimit(query.limit);
119
+ const vis = visibilityFilter(query);
120
+ const args = [];
121
+ let sql = "SELECT id, title, description, result, status, visibility, origin_org_id FROM tasks WHERE 1=1";
122
+ if (query.ids?.length) {
123
+ sql += ` AND id IN (${query.ids.map(() => "?").join(", ")})`;
124
+ args.push(...query.ids);
125
+ }
126
+ sql += vis.sql;
127
+ args.push(...vis.args);
128
+ sql += " AND (COALESCE(visibility, 'private') = 'private' OR origin_org_id IS NULL OR origin_org_id = ?)";
129
+ args.push(orgId);
130
+ if (query.tag) {
131
+ sql += " AND status = ?";
132
+ args.push(query.tag);
133
+ }
134
+ sql += " ORDER BY created_at DESC LIMIT ?";
135
+ args.push(limit);
136
+ const res = await client.execute({ sql, args });
137
+ return res.rows.map((r) => {
138
+ const structured = {
139
+ task_id: String(r.id),
140
+ summary: (str(r.result) ?? str(r.description) ?? str(r.title) ?? "").slice(0, 2e3),
141
+ files_changed: [],
142
+ decisions: [],
143
+ open_questions: [],
144
+ commits: [],
145
+ tests: "none",
146
+ build: "skip"
147
+ };
148
+ return {
149
+ id: String(r.id),
150
+ kind: "task",
151
+ visibility: str(r.visibility),
152
+ origin_org_id: str(r.origin_org_id),
153
+ label: str(r.title),
154
+ text: `${str(r.title) ?? ""}${r.result ? `: ${String(r.result)}` : ""}`,
155
+ structured
156
+ };
157
+ });
158
+ }
159
+ async function resolveQuery(orgId, query, structured) {
160
+ const out = [];
161
+ if (!structured && wantsKind(query, "memory")) out.push(...await fetchMemoryRows(orgId, query));
162
+ if (wantsKind(query, "task")) out.push(...await fetchTaskRows(orgId, query));
163
+ return out;
164
+ }
165
+ async function withScopedReadWindow(orgId, plan, fn) {
166
+ if (!orgId) throw new Error("A scoped read window requires a non-empty org_id (\xA71.5)");
167
+ if (_window) {
168
+ throw new ScopedReadWindowError(
169
+ `A scoped read window is already open for "${_window.orgId}". Windows do not nest: the no-interleaving property that makes a synchronous reader safe depends on exactly one being open.`
170
+ );
171
+ }
172
+ const text = /* @__PURE__ */ new Map();
173
+ const structured = /* @__PURE__ */ new Map();
174
+ for (const q of plan.text ?? []) {
175
+ text.set(scopedQueryKey(orgId, q, false), await resolveQuery(orgId, q, false));
176
+ }
177
+ for (const q of plan.structured ?? []) {
178
+ structured.set(scopedQueryKey(orgId, q, true), await resolveQuery(orgId, q, true));
179
+ }
180
+ _window = { orgId, text, structured };
181
+ try {
182
+ const result = fn();
183
+ if (result && typeof result.then === "function") {
184
+ throw new ScopedReadWindowError(
185
+ "withScopedReadWindow() was handed an async function. The window closes when the call returns, so an async body would read rows after the window it declared had gone."
186
+ );
187
+ }
188
+ return result;
189
+ } finally {
190
+ _window = null;
191
+ }
192
+ }
193
+
194
+ export {
195
+ registerDaemonScopedQueryChokepoint,
196
+ withScopedReadWindow
197
+ };