@askexenow/exe-os 0.9.341 → 0.9.342

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 (419) hide show
  1. package/README.md +159 -196
  2. package/deploy/compose/.env.customer.example +1 -0
  3. package/deploy/compose/.env.example +1 -0
  4. package/deploy/compose/docker-compose.yml +13 -4
  5. package/deploy/compose/generate-env.ts +4 -0
  6. package/dist/{active-agent-AIQP4DFL.js → active-agent-PVGE57FY.js} +5 -5
  7. package/dist/{active-agent-LW45DSJ4.js → active-agent-TNIO6IY3.js} +5 -5
  8. package/dist/{agentic-ontology-RVUNRCQY.js → agentic-ontology-3FXYMHKW.js} +1 -1
  9. package/dist/{backfill-gate-J7UXFNXU.js → backfill-gate-65LSYVE5.js} +3 -3
  10. package/dist/{backfill-metadata-ZSDJ4O2T.js → backfill-metadata-ZSMZC45J.js} +8 -8
  11. package/dist/{background-jobs-STURKDCS.js → background-jobs-EXR5RVGG.js} +3 -3
  12. package/dist/{backup-verify-ZAJLEL4X.js → backup-verify-3Y2FHGZU.js} +4 -4
  13. package/dist/{behaviors-EO7KCP3H.js → behaviors-KYRB3NGJ.js} +9 -9
  14. package/dist/bin/age-ontology-load.js +3 -3
  15. package/dist/bin/agentic-ontology-backfill.js +10 -10
  16. package/dist/bin/agentic-reflection-backfill.js +11 -11
  17. package/dist/bin/agentic-semantic-label.js +10 -10
  18. package/dist/bin/backfill-conversations.js +10 -10
  19. package/dist/bin/backfill-responses.js +10 -10
  20. package/dist/bin/backfill-vectors.js +14 -14
  21. package/dist/bin/bulk-sync-postgres.js +19 -19
  22. package/dist/bin/cc-doctor.js +10 -8
  23. package/dist/bin/cleanup-stale-review-tasks.js +25 -23
  24. package/dist/bin/cli.js +79 -25
  25. package/dist/bin/customer-readiness.js +1 -1
  26. package/dist/bin/deferred-daemon-restart.js +98 -92
  27. package/dist/bin/exe-agent-config.js +9 -8
  28. package/dist/bin/exe-agent.js +17 -17
  29. package/dist/bin/exe-assign.js +12 -12
  30. package/dist/bin/exe-boot.js +200 -67
  31. package/dist/bin/exe-call.js +7 -7
  32. package/dist/bin/exe-cloud.js +20 -20
  33. package/dist/bin/exe-config-dump.js +9 -8
  34. package/dist/bin/exe-dispatch.js +25 -23
  35. package/dist/bin/exe-doctor.js +10 -6
  36. package/dist/bin/exe-export-behaviors.js +11 -11
  37. package/dist/bin/exe-forget.js +12 -10
  38. package/dist/bin/exe-gateway.js +15 -10
  39. package/dist/bin/exe-grant.js +5 -5
  40. package/dist/bin/exe-healthcheck.js +14 -8
  41. package/dist/bin/exe-heartbeat.js +28 -27
  42. package/dist/bin/exe-kill.js +30 -28
  43. package/dist/bin/exe-launch-agent.js +128 -67
  44. package/dist/bin/exe-memory-reads.js +257 -0
  45. package/dist/bin/exe-new-employee.js +12 -11
  46. package/dist/bin/exe-pending-messages.js +26 -24
  47. package/dist/bin/exe-pending-notifications.js +25 -23
  48. package/dist/bin/exe-pending-reviews.js +25 -23
  49. package/dist/bin/exe-rename.js +7 -7
  50. package/dist/bin/exe-review.js +29 -27
  51. package/dist/bin/exe-search.js +11 -9
  52. package/dist/bin/exe-session-cleanup.js +115 -85
  53. package/dist/bin/exe-settings.js +24 -23
  54. package/dist/bin/exe-start-codex.js +163 -41
  55. package/dist/bin/exe-start-opencode.js +15 -15
  56. package/dist/bin/exe-status.js +26 -24
  57. package/dist/bin/exe-support.js +5 -5
  58. package/dist/bin/exe-team.js +5 -5
  59. package/dist/bin/exe-timers.js +32 -213
  60. package/dist/bin/exe-watchdog.js +6 -5
  61. package/dist/bin/git-sweep.js +26 -24
  62. package/dist/bin/graph-backfill.js +11 -11
  63. package/dist/bin/graph-export.js +9 -9
  64. package/dist/bin/import-history.js +13 -13
  65. package/dist/bin/install.js +103 -97
  66. package/dist/bin/intercom-check.js +4 -4
  67. package/dist/bin/mcp-sessions.js +2 -2
  68. package/dist/bin/orchestration-metrics.js +6 -6
  69. package/dist/bin/postgres-agentic-reflection-backfill.js +5 -5
  70. package/dist/bin/postgres-agentic-semantic-backfill.js +7 -7
  71. package/dist/bin/pre-publish.js +5 -3
  72. package/dist/bin/reconcile-backlog.js +2 -2
  73. package/dist/bin/registry-proxy.js +1 -1
  74. package/dist/bin/scan-tasks.js +25 -23
  75. package/dist/bin/setup.js +6 -5
  76. package/dist/bin/shard-migrate.js +9 -9
  77. package/dist/bin/stack-update.js +6 -6
  78. package/dist/bin/update.js +1 -1
  79. package/dist/bin/vps-health-gate.js +1 -1
  80. package/dist/{boot-generation-GSMPJOWM.js → boot-generation-BL2ISK4U.js} +5 -5
  81. package/dist/boot-review-sections-DBMQJT5N.js +107 -0
  82. package/dist/branch-hygiene-TZWK6QCF.js +224 -0
  83. package/dist/{branding-JTEOF4ZV.js → branding-DVXBGVDH.js} +3 -3
  84. package/dist/{browser-session-store-CXQMOSEC.js → browser-session-store-B2NR3LIX.js} +2 -1
  85. package/dist/{capability-cards-OBYQNAKZ.js → capability-cards-DN5UIKVN.js} +4 -4
  86. package/dist/{capacity-monitor-MG3FTUD5.js → capacity-monitor-ZG5GGFR2.js} +26 -24
  87. package/dist/{catchup-brief-BVJOF3GL.js → catchup-brief-D6HH6DWS.js} +31 -28
  88. package/dist/{chunk-Q5AIPSSC.js → chunk-25X4JD2V.js} +10 -6
  89. package/dist/{chunk-6MVI4QH2.js → chunk-2KZNGDSW.js} +1 -1
  90. package/dist/{chunk-WH7XN5ER.js → chunk-2WAVZ5UJ.js} +1 -1
  91. package/dist/{chunk-PTJBWC77.js → chunk-2ZYO73KO.js} +4 -3
  92. package/dist/{chunk-CLAYNAXC.js → chunk-3EUMUSLE.js} +1 -1
  93. package/dist/{chunk-BVV6NHKQ.js → chunk-3SW4OEHB.js} +5 -5
  94. package/dist/{task-enforcement-X5QVL6RE.js → chunk-4CMVFVFC.js} +173 -69
  95. package/dist/{chunk-2YCFNBC4.js → chunk-4J4PMPXZ.js} +3 -2
  96. package/dist/{chunk-EDOO23B2.js → chunk-4N2NRGCM.js} +2 -2
  97. package/dist/chunk-4QCFFW2H.js +378 -0
  98. package/dist/{chunk-6MVC43X7.js → chunk-4VSV5P4D.js} +2 -2
  99. package/dist/{chunk-HJX6NCJF.js → chunk-4ZCD2UWW.js} +39 -10
  100. package/dist/{chunk-C445WRUX.js → chunk-5ERDIOV3.js} +2 -2
  101. package/dist/chunk-5H47VHB7.js +30 -0
  102. package/dist/{chunk-BJ23BNED.js → chunk-5TY4FPH6.js} +1 -1
  103. package/dist/{chunk-WD55PEBM.js → chunk-6CH3TPHR.js} +3 -3
  104. package/dist/{chunk-TIXTHUVJ.js → chunk-6WQ3NNCE.js} +3 -3
  105. package/dist/{chunk-7LF5DS3A.js → chunk-6XWTQUO4.js} +1 -1
  106. package/dist/chunk-76CJBM36.js +88 -0
  107. package/dist/{chunk-NFBW7N4D.js → chunk-7CTRGNLW.js} +2 -2
  108. package/dist/{chunk-ITMEE7PQ.js → chunk-7V4JADD6.js} +3 -3
  109. package/dist/{chunk-RMOBQ6A5.js → chunk-AD2VCHSS.js} +1 -1
  110. package/dist/{chunk-DNVFWFYF.js → chunk-AJYCFKJR.js} +1 -1
  111. package/dist/chunk-AM7S2TY6.js +54 -0
  112. package/dist/{chunk-RWSLVYTE.js → chunk-AOHXREB7.js} +295 -67
  113. package/dist/{chunk-DGGDUKH6.js → chunk-ASAFVDVR.js} +1 -1
  114. package/dist/{chunk-NTI22F3R.js → chunk-BUCXNV32.js} +1 -1
  115. package/dist/{chunk-SHIICYJW.js → chunk-BYTDMAGB.js} +4 -2
  116. package/dist/{chunk-32SXNM3G.js → chunk-C5QAPURN.js} +1 -1
  117. package/dist/{chunk-BMHQPIJ2.js → chunk-CE7F6RHG.js} +585 -75
  118. package/dist/{chunk-YWQMWFYR.js → chunk-CNVBKDEY.js} +21 -15
  119. package/dist/{chunk-KPIN44GZ.js → chunk-CWXVH7WV.js} +1 -1
  120. package/dist/chunk-D74XYSA3.js +621 -0
  121. package/dist/{chunk-A47MXY2I.js → chunk-EQHQF5IM.js} +50 -32
  122. package/dist/{chunk-YHUNDGVV.js → chunk-EUS4QUKP.js} +1 -1
  123. package/dist/{chunk-6D2PI4QD.js → chunk-EV46QTD3.js} +1 -1
  124. package/dist/{chunk-N7A5D25S.js → chunk-F27XXN6C.js} +1 -1
  125. package/dist/{chunk-XQNNB5GY.js → chunk-F55P3H4S.js} +37 -2
  126. package/dist/{chunk-MWZFF3Q7.js → chunk-F5O7V7UK.js} +1 -1
  127. package/dist/{chunk-MC4ATFJV.js → chunk-FPFPLPUY.js} +6 -6
  128. package/dist/{chunk-UU4UINUX.js → chunk-G4RGKBCA.js} +2 -2
  129. package/dist/{chunk-HAZO7TRD.js → chunk-G5T6KDG4.js} +1 -1
  130. package/dist/{chunk-TWXZM34M.js → chunk-GBTTBXAF.js} +6 -6
  131. package/dist/{chunk-LA2Z6RMS.js → chunk-GDIJE6D7.js} +1 -1
  132. package/dist/{chunk-4QSJVMMT.js → chunk-GG5NDQNN.js} +2 -2
  133. package/dist/{chunk-6BQG7EKO.js → chunk-GJ26DULE.js} +2 -2
  134. package/dist/chunk-GL57PO3K.js +104 -0
  135. package/dist/chunk-GWDSB25T.js +6 -0
  136. package/dist/{chunk-HSYJ6DZ2.js → chunk-H6BV5TKD.js} +39 -24
  137. package/dist/{chunk-HCJCW7X4.js → chunk-H7I47RS5.js} +34 -1
  138. package/dist/{chunk-GFDGDFBF.js → chunk-HA5R6USD.js} +22 -5
  139. package/dist/{chunk-L2YGXJGF.js → chunk-HAF2DJYV.js} +3 -3
  140. package/dist/chunk-HJ447YER.js +224 -0
  141. package/dist/{chunk-6QW6JHRE.js → chunk-HV4KESRY.js} +59 -32
  142. package/dist/{chunk-BJOBR6P2.js → chunk-I26FWCSP.js} +216 -9
  143. package/dist/{chunk-X2FHTDIU.js → chunk-IBYL4DHM.js} +1 -1
  144. package/dist/{chunk-JCBKARSK.js → chunk-IOEUAQWP.js} +1 -1
  145. package/dist/{chunk-2UGGBIDL.js → chunk-JGIPOUIK.js} +3 -3
  146. package/dist/{chunk-LLU6WZLK.js → chunk-JLZ4RYSD.js} +2 -2
  147. package/dist/{chunk-WWNQFOSP.js → chunk-JMYHW3AL.js} +2 -2
  148. package/dist/{chunk-KP4PY2Z2.js → chunk-JPUZPAAF.js} +4 -4
  149. package/dist/{chunk-4LWV633D.js → chunk-JTBIS4R5.js} +1 -1
  150. package/dist/{chunk-PPZOWQHP.js → chunk-K7KFGDWF.js} +1 -1
  151. package/dist/{chunk-HNLXMD2V.js → chunk-KGWRTRKC.js} +2 -2
  152. package/dist/{chunk-IB336P52.js → chunk-KP3U5QGJ.js} +1 -1
  153. package/dist/{chunk-OUEFW4RK.js → chunk-KW2SD2FL.js} +2 -2
  154. package/dist/{chunk-2P4WJNN5.js → chunk-KWZMQACA.js} +11 -7
  155. package/dist/{chunk-ATKW3SYL.js → chunk-L2R3LN2P.js} +1 -1
  156. package/dist/{chunk-IELUDZAA.js → chunk-L4A5DL6Z.js} +3 -3
  157. package/dist/{chunk-2C455MU3.js → chunk-LU2FALL6.js} +3 -3
  158. package/dist/{chunk-LOBCQXV5.js → chunk-MKYFAKDW.js} +4 -4
  159. package/dist/{chunk-3BRVLPPA.js → chunk-MOPUCPXK.js} +4 -0
  160. package/dist/{chunk-BR4423AS.js → chunk-MR6LHP4F.js} +1 -1
  161. package/dist/chunk-MVYB76QG.js +341 -0
  162. package/dist/{chunk-ZNE6H2JO.js → chunk-MZM6EJCU.js} +4 -4
  163. package/dist/{chunk-FOV57K47.js → chunk-N7QJKQMX.js} +258 -14
  164. package/dist/{chunk-AYLNJGCS.js → chunk-NBZL5CGA.js} +93 -12
  165. package/dist/{chunk-YLQXP7T7.js → chunk-NN2B2QKU.js} +1 -1
  166. package/dist/chunk-NX5INHHG.js +40 -0
  167. package/dist/{chunk-B75BOKEI.js → chunk-NXUSDL37.js} +2 -2
  168. package/dist/{chunk-TPHCZDE3.js → chunk-O5V57XYE.js} +1 -1
  169. package/dist/chunk-O7LWR36Z.js +269 -0
  170. package/dist/{chunk-BV6GBSRP.js → chunk-OLMQ4UOF.js} +42 -10
  171. package/dist/{chunk-UIU2DGRV.js → chunk-OTF44GXL.js} +4 -4
  172. package/dist/{chunk-GOGSWXNZ.js → chunk-OZEBAGKR.js} +277 -137
  173. package/dist/{chunk-NDSNM5OH.js → chunk-P5HIWY2E.js} +1 -1
  174. package/dist/{chunk-MJB5ZFQM.js → chunk-PDWS3E22.js} +55 -4
  175. package/dist/{chunk-4FJZ6SO7.js → chunk-PPCDBE6Z.js} +1 -1
  176. package/dist/{chunk-7SEC2AG5.js → chunk-PQIDGXSG.js} +13 -4
  177. package/dist/chunk-PWUFMX75.js +186 -0
  178. package/dist/{chunk-GPW32HVB.js → chunk-QDGZJ653.js} +3 -3
  179. package/dist/{chunk-CYA5S5OD.js → chunk-QOO5RW3K.js} +6 -5
  180. package/dist/{chunk-IXBIVKWZ.js → chunk-QQ4E2RYW.js} +95 -18
  181. package/dist/{chunk-2WMTTIAZ.js → chunk-QRYVCDWS.js} +2 -2
  182. package/dist/{chunk-Z42MXYWW.js → chunk-QWVXN224.js} +110 -28
  183. package/dist/{chunk-XSMRR4IW.js → chunk-QYZJHTNE.js} +26 -27
  184. package/dist/{chunk-I7ECEP3W.js → chunk-R2NN3JKH.js} +43 -6
  185. package/dist/{chunk-B7CUBLF7.js → chunk-RACAOE2Z.js} +13 -13
  186. package/dist/{chunk-5RACW3LX.js → chunk-RAXVPNMR.js} +1 -1
  187. package/dist/{chunk-CMR64RYM.js → chunk-RHWZUUS4.js} +17 -17
  188. package/dist/{chunk-RNAYCUNM.js → chunk-S3THSOWV.js} +1 -1
  189. package/dist/{chunk-U2MREVXQ.js → chunk-S7QUM2UK.js} +2 -2
  190. package/dist/{chunk-SSTLTIF3.js → chunk-SKGMF2SO.js} +25 -2
  191. package/dist/{chunk-J6SEDDOR.js → chunk-SQKXKV2Y.js} +2 -2
  192. package/dist/{chunk-DPFQ2WQX.js → chunk-TLT7NZCW.js} +4 -4
  193. package/dist/chunk-TTCUG2CF.js +91 -0
  194. package/dist/{chunk-W6K4XB6G.js → chunk-UEA3LXOB.js} +1 -1
  195. package/dist/{chunk-WNKVKNOM.js → chunk-UNXQBELK.js} +1 -1
  196. package/dist/{chunk-KKOLHBNC.js → chunk-UP75Z5X7.js} +904 -167
  197. package/dist/{chunk-Y3S4H77G.js → chunk-USSB56WK.js} +1 -1
  198. package/dist/{chunk-PVIH3ZGV.js → chunk-UUEKJDK6.js} +90 -10
  199. package/dist/{chunk-T2PYVVZ5.js → chunk-UUQBZPJJ.js} +1 -1
  200. package/dist/{chunk-32YHCHWW.js → chunk-V3EEVY4L.js} +1 -1
  201. package/dist/{chunk-2IWBY7XK.js → chunk-VPZHJCKW.js} +2 -2
  202. package/dist/chunk-VRAQTFD6.js +265 -0
  203. package/dist/{chunk-EDH54E5A.js → chunk-VSRPS3J7.js} +14 -14
  204. package/dist/{chunk-5ZNY7IZI.js → chunk-WMESXBJM.js} +37 -3
  205. package/dist/{chunk-54QCG45Y.js → chunk-WOYADZF5.js} +56 -5
  206. package/dist/{chunk-7Y5UDEVM.js → chunk-WZHZCDDO.js} +6 -5
  207. package/dist/{chunk-3NGZ4PL7.js → chunk-X2Q5NLUL.js} +11 -2
  208. package/dist/{chunk-CCIEIRV2.js → chunk-X33NYQYJ.js} +2 -2
  209. package/dist/{chunk-K6KRBXQP.js → chunk-XHK3FS3W.js} +3 -2
  210. package/dist/{chunk-AP455LBW.js → chunk-XZXBB3TN.js} +2 -2
  211. package/dist/{chunk-JSKBHUR7.js → chunk-YCANDMI2.js} +2 -2
  212. package/dist/{chunk-YIIME2OW.js → chunk-YLXTKI6M.js} +1 -1
  213. package/dist/{chunk-LEJ25726.js → chunk-YTCFACP4.js} +650 -434
  214. package/dist/{chunk-HUSVERE6.js → chunk-Z6RSN7KS.js} +7 -6
  215. package/dist/{cleanup-graph-garbage-MXQ4Q2MA.js → cleanup-graph-garbage-XWUFAMFO.js} +8 -8
  216. package/dist/{co-activation-QI5BK4RT.js → co-activation-ZCHPLLP6.js} +4 -4
  217. package/dist/{co-occurrence-BYSQNZSV.js → co-occurrence-KG3LKALN.js} +6 -6
  218. package/dist/{code-context-index-BNBHDXHW.js → code-context-index-WSOJQ72R.js} +5 -5
  219. package/dist/{content-extractor-JRJDNIHP.js → content-extractor-NXYNEF5K.js} +2 -2
  220. package/dist/{conversation-entity-extractor-FPAMTL3C.js → conversation-entity-extractor-D3EFTLT4.js} +2 -2
  221. package/dist/{conversation-wiki-populator-WU4HEQ7C.js → conversation-wiki-populator-WQN3IUU6.js} +1 -1
  222. package/dist/{crdt-sync-ETPKNBCU.js → crdt-sync-4PFGPZXV.js} +8 -1
  223. package/dist/{crm-webhook-M566ZMZS.js → crm-webhook-II7Z45Q6.js} +2 -2
  224. package/dist/cto-delegation-gate-JWWOJPNC.js +669 -0
  225. package/dist/{daemon-auth-7IFSV5FG.js → daemon-auth-3FEAHFWC.js} +5 -3
  226. package/dist/{daemon-orchestration-XV5GN73R.js → daemon-orchestration-FX4XZDR5.js} +45 -26
  227. package/dist/{daemon-ready-RKKB4P6K.js → daemon-ready-4JTSFKAY.js} +1 -1
  228. package/dist/{daemon-ready-signal-WKEJQNRA.js → daemon-ready-signal-LPAZWQOV.js} +3 -1
  229. package/dist/daemon-restart-circuit-breaker-PEGEIP6H.js +35 -0
  230. package/dist/daemon-timer-report-NM44WQRH.js +25 -0
  231. package/dist/{db-backup-MX2G3CEK.js → db-backup-W2QFSYQC.js} +15 -5
  232. package/dist/{db-restore-events-JVEEP52Z.js → db-restore-events-MQ2DBGEQ.js} +2 -2
  233. package/dist/dispatch-ack-VYH3ONSS.js +27 -0
  234. package/dist/{doc-graph-extractor-LR5KMPH7.js → doc-graph-extractor-F6ODFIID.js} +6 -6
  235. package/dist/{documents-FA6N7QDA.js → documents-23WX2FPQ.js} +12 -12
  236. package/dist/dreaming-NWD22UQ5.js +46 -0
  237. package/dist/{exe-drift-TUKTCXZE.js → exe-drift-CW72FBGE.js} +5 -5
  238. package/dist/{exe-export-ZLHBXMZC.js → exe-export-AUJ7CV7G.js} +11 -11
  239. package/dist/{exe-import-VVKBZWSA.js → exe-import-JX4I52VE.js} +11 -11
  240. package/dist/{exe-key-QJXFBF6G.js → exe-key-2N6LY2BU.js} +242 -228
  241. package/dist/{exe-org-BGZNNE4H.js → exe-org-X4CSNCKS.js} +3 -3
  242. package/dist/{exe-snapshot-JRLUO645.js → exe-snapshot-XZ7FVCYZ.js} +30 -28
  243. package/dist/{fast-db-init-JKJEEHUI.js → fast-db-init-4CWHSOOR.js} +1 -1
  244. package/dist/{founder-context-HWPLMZVR.js → founder-context-7L3CFPYN.js} +4 -4
  245. package/dist/gateway/index.js +25 -25
  246. package/dist/{gateway-client-GRBOJQYC.js → gateway-client-7LMZKHTH.js} +1 -1
  247. package/dist/git-main-guard-UZP3KXYI.js +39 -0
  248. package/dist/{git-staleness-X5XZONX3.js → git-staleness-CI2R4QOJ.js} +4 -4
  249. package/dist/{global-procedures-VIIVWB6R.js → global-procedures-XQX3LUH6.js} +6 -6
  250. package/dist/{graph-auto-extract-HCQQF5AG.js → graph-auto-extract-OURWMGBS.js} +6 -6
  251. package/dist/{graph-rag-WAK2BRJH.js → graph-rag-JZZAB7PC.js} +2 -2
  252. package/dist/{hook-integrity-WURH6DS3.js → hook-integrity-XY47IM7G.js} +1 -1
  253. package/dist/hook-prefetch-PHRRKY4C.js +137 -0
  254. package/dist/hooks/bug-report-worker.js +31 -27
  255. package/dist/hooks/codex-stop-task-finalizer.js +31 -27
  256. package/dist/hooks/commit-complete.js +28 -26
  257. package/dist/hooks/error-recall.js +12 -11
  258. package/dist/hooks/exe-heartbeat-hook.js +6 -6
  259. package/dist/hooks/ingest-worker.js +11 -11
  260. package/dist/hooks/ingest.js +18 -18
  261. package/dist/hooks/instructions-loaded.js +7 -7
  262. package/dist/hooks/manifest.json +20 -20
  263. package/dist/hooks/notification.js +7 -7
  264. package/dist/hooks/post-compact.js +27 -25
  265. package/dist/hooks/post-tool-combined.js +12 -12
  266. package/dist/hooks/pre-compact.js +28 -26
  267. package/dist/hooks/pre-tool-use.js +179 -46
  268. package/dist/hooks/prompt-submit.js +323 -272
  269. package/dist/hooks/session-end.js +34 -32
  270. package/dist/hooks/session-start.js +28 -21
  271. package/dist/hooks/stop.js +34 -32
  272. package/dist/hooks/subagent-stop.js +27 -25
  273. package/dist/hooks/summary-worker.js +35 -33
  274. package/dist/index.js +40 -38
  275. package/dist/{installer-6IFVEQI4.js → installer-G3JAO3NT.js} +9 -9
  276. package/dist/{installer-NX2CLNV5.js → installer-JND3RJ6Q.js} +9 -9
  277. package/dist/{installer-T2LGHZKL.js → installer-L7EVH5U5.js} +9 -9
  278. package/dist/{intercom-queue-KYHXXZCQ.js → intercom-queue-ZFEQALR3.js} +24 -22
  279. package/dist/{key-backup-status-TNEHXA2X.js → key-backup-status-LOSMVATJ.js} +2 -2
  280. package/dist/lib/agent-config.js +4 -3
  281. package/dist/lib/cloud-sync.js +19 -19
  282. package/dist/lib/config.js +2 -2
  283. package/dist/lib/consolidation.js +11 -11
  284. package/dist/lib/crypto.js +3 -3
  285. package/dist/lib/database.js +6 -4
  286. package/dist/lib/db-daemon-client.js +5 -5
  287. package/dist/lib/db-read-worker-client.js +9 -3
  288. package/dist/lib/db.js +6 -4
  289. package/dist/lib/device-registry.js +3 -3
  290. package/dist/lib/embed-worker.js +2 -2
  291. package/dist/lib/embedder.js +5 -5
  292. package/dist/lib/employee-templates.js +7 -7
  293. package/dist/lib/employees.js +10 -4
  294. package/dist/lib/exe-daemon-client.js +4 -4
  295. package/dist/lib/exe-daemon.js +588 -164
  296. package/dist/lib/hybrid-search.js +11 -9
  297. package/dist/lib/identity.js +4 -4
  298. package/dist/lib/keychain.js +1 -1
  299. package/dist/lib/license.js +4 -4
  300. package/dist/lib/messaging.js +27 -23
  301. package/dist/lib/post-tool-memory.js +3 -3
  302. package/dist/lib/registry-proxy.js +1 -1
  303. package/dist/lib/reminders.js +15 -7
  304. package/dist/lib/schedules.js +9 -9
  305. package/dist/lib/session-registry.js +6 -6
  306. package/dist/lib/skill-learning.js +10 -10
  307. package/dist/lib/status-brief.js +4 -4
  308. package/dist/lib/store.js +8 -8
  309. package/dist/lib/task-router.js +5 -5
  310. package/dist/lib/tasks.js +28 -24
  311. package/dist/lib/tmux-routing.js +55 -24
  312. package/dist/lib/tmux-status.js +9 -3
  313. package/dist/lib/tmux-transport.js +1 -1
  314. package/dist/lib/token-spend.js +5 -5
  315. package/dist/lib/transport.js +2 -2
  316. package/dist/lib/ws-client.js +1 -1
  317. package/dist/{license-gate-MGDR4YNI.js → license-gate-QTRQHV4F.js} +5 -5
  318. package/dist/{license-sync-UWE6GEB4.js → license-sync-N3UJFWAW.js} +4 -4
  319. package/dist/mcp/register-tools.js +97 -91
  320. package/dist/mcp/server.js +99 -93
  321. package/dist/mcp/tools/complete-reminder.js +6 -6
  322. package/dist/mcp/tools/create-reminder.js +6 -6
  323. package/dist/mcp/tools/create-task.js +36 -27
  324. package/dist/mcp/tools/deactivate-behavior.js +11 -11
  325. package/dist/mcp/tools/list-reminders.js +6 -6
  326. package/dist/mcp/tools/list-tasks.js +34 -28
  327. package/dist/mcp/tools/send-message.js +27 -25
  328. package/dist/mcp/tools/update-task.js +33 -27
  329. package/dist/{mcp-http-config-RQLYEPTL.js → mcp-http-config-BDL36JZ3.js} +6 -6
  330. package/dist/{mcp-port-config-FFAMMLLE.js → mcp-port-config-6HYY6J7K.js} +2 -2
  331. package/dist/mcp-session-identity-T7H2EKFQ.js +177 -0
  332. package/dist/{memory-cards-VYQ5DPMR.js → memory-cards-ZRDW7QBX.js} +8 -8
  333. package/dist/{memory-graph-extractor-GX2HNYLU.js → memory-graph-extractor-QLXDMHRS.js} +7 -7
  334. package/dist/{memory-poisoning-defense-TX7627BD.js → memory-poisoning-defense-HJTXYCWH.js} +4 -4
  335. package/dist/{memory-pressure-watchdog-MLNNH26B.js → memory-pressure-watchdog-HN5X7AVN.js} +75 -36
  336. package/dist/{memory-queue-X2CSEAKE.js → memory-queue-2UOOF27L.js} +5 -3
  337. package/dist/{memory-queue-client-YRL6XTGU.js → memory-queue-client-O5U6F6XP.js} +6 -6
  338. package/dist/{memory-reflection-KIGEFSI4.js → memory-reflection-WVNFBJAA.js} +4 -4
  339. package/dist/{monitor-grants-RZOVSYVO.js → monitor-grants-E3ELDEWD.js} +5 -5
  340. package/dist/{monitor-identity-MOXISYNG.js → monitor-identity-GLFZSEAH.js} +2 -2
  341. package/dist/{notification-ledger-B6AVEGMV.js → notification-ledger-SZEPGJQ7.js} +25 -23
  342. package/dist/{notifications-DWXV7SVL.js → notifications-4UT53CDG.js} +24 -22
  343. package/dist/{orchestration-events-ZG7O4HRY.js → orchestration-events-WV4NWKZH.js} +5 -5
  344. package/dist/{orchestration-phase-CXRCBCK7.js → orchestration-phase-AWBXPO52.js} +3 -3
  345. package/dist/orchestrator-UAC3RW2T.js +47 -0
  346. package/dist/{pipeline-router-RTLAGZTA.js → pipeline-router-LM53NMWJ.js} +5 -5
  347. package/dist/{plan-limits-WLQZTCSF.js → plan-limits-2FEY2GOS.js} +7 -7
  348. package/dist/platform-procedures-X5DFJFV7.js +13 -0
  349. package/dist/{preferences-TYTGDXQZ.js → preferences-TWIXZBKS.js} +2 -2
  350. package/dist/{project-boot-6CGQ3EAH.js → project-boot-4NUH5FRU.js} +2 -2
  351. package/dist/{projection-worker-44SEKTZ5.js → projection-worker-FZ7YSN3G.js} +5 -5
  352. package/dist/{prospective-memory-UACFTYXK.js → prospective-memory-6D2ASWM3.js} +4 -4
  353. package/dist/{push-notifications-W5JRXLKJ.js → push-notifications-U6FIBQRW.js} +3 -3
  354. package/dist/{reranker-NL4YAV6R.js → reranker-GYYRPANK.js} +3 -3
  355. package/dist/{retrieval-health-4C2PO6HH.js → retrieval-health-4Z242P3B.js} +1 -1
  356. package/dist/{review-polling-W5AMHNLT.js → review-polling-HXAFJZDA.js} +25 -23
  357. package/dist/runtime/index.js +35 -33
  358. package/dist/{session-events-PGL5GJEB.js → session-events-O3BV56ZX.js} +25 -23
  359. package/dist/{session-kill-telemetry-6YDGEF27.js → session-kill-telemetry-AELE4JDK.js} +25 -23
  360. package/dist/session-mcp-config-YKNXG5DW.js +50 -0
  361. package/dist/{session-scope-3MEOO557.js → session-scope-5EAPUT45.js} +24 -22
  362. package/dist/setup-wizard-NB6R4QVS.js +14 -0
  363. package/dist/{shard-manager-MBWQEYNG.js → shard-manager-35PWFR3B.js} +3 -3
  364. package/dist/{skill-refinement-EOROTBPX.js → skill-refinement-DVSYXBBP.js} +5 -5
  365. package/dist/{stack-release-PR2XKJ4Q.js → stack-release-HGFFFCGC.js} +90 -15
  366. package/dist/{stack-update-LMDM27ZW.js → stack-update-ATCJFOEK.js} +5 -5
  367. package/dist/{steward-gate-4A2XHYFD.js → steward-gate-3GQ5XKMJ.js} +5 -5
  368. package/dist/{support-inbox-Z77ACQUY.js → support-inbox-4L62P4EP.js} +7 -6
  369. package/dist/{support-outbox-GB5SQFRJ.js → support-outbox-WHGPUYL2.js} +2 -2
  370. package/dist/task-enforcement-IPIZX2MM.js +90 -0
  371. package/dist/{task-scope-EKYDCVUF.js → task-scope-FOIW25HR.js} +26 -22
  372. package/dist/{tasks-crud-6LBNU43G.js → tasks-crud-HBDKE6C5.js} +34 -22
  373. package/dist/tasks-notify-G2U2U2YA.js +53 -0
  374. package/dist/{tasks-review-PBIUYXAL.js → tasks-review-27SFX5XN.js} +26 -22
  375. package/dist/{telemetry-upload-WQDFABTF.js → telemetry-upload-ZOXHRWR5.js} +9 -9
  376. package/dist/tmux-command-guard-KSJKIX3C.js +117 -0
  377. package/dist/{token-budget-KWGL5DY7.js → token-budget-5Y4YPDO3.js} +5 -5
  378. package/dist/{tool-capability-index-EH3HQVHU.js → tool-capability-index-VYF5GNJ2.js} +1 -1
  379. package/dist/{tool-telemetry-UC55LSIH.js → tool-telemetry-KBXSBDTK.js} +1 -1
  380. package/dist/tui/App.js +39 -37
  381. package/dist/{tui-data-M3RBSJL3.js → tui-data-NLFMBIQI.js} +24 -22
  382. package/dist/{update-check-HFO4VHO4.js → update-check-3FHAWIG2.js} +7 -3
  383. package/dist/{update-support-VPBD5SD2.js → update-support-UVUSZG7R.js} +93 -93
  384. package/dist/{whatsapp-accounts-BWRZUY23.js → whatsapp-accounts-BFIOXYW5.js} +1 -1
  385. package/dist/{whatsapp-config-GOSELKTE.js → whatsapp-config-FAX6EA5K.js} +20 -13
  386. package/dist/{worker-gate-4QLLMXZM.js → worker-gate-3KUBAU32.js} +3 -3
  387. package/dist/{workflow-engine-MMEHKUN4.js → workflow-engine-YITHXZR5.js} +2 -2
  388. package/dist/{working-memory-PY4AG577.js → working-memory-NUVB5SFV.js} +1 -1
  389. package/dist/worktree-LL62PLQB.js +47 -0
  390. package/dist/{worktree-sweep-5WKBU7E6.js → worktree-sweep-WTK3MTKH.js} +7 -7
  391. package/package.json +3 -2
  392. package/release-notes.json +75 -43
  393. package/dist/branch-hygiene-R5NVTRAY.js +0 -138
  394. package/dist/chunk-7YORGTXC.js +0 -138
  395. package/dist/chunk-CCPHEPLU.js +0 -30
  396. package/dist/chunk-HMP5VT6A.js +0 -118
  397. package/dist/chunk-PVYR4FCQ.js +0 -113
  398. package/dist/chunk-RP5GETX5.js +0 -140
  399. package/dist/chunk-YGAAZN3E.js +0 -47
  400. package/dist/cto-delegation-gate-S734XDXT.js +0 -290
  401. package/dist/dispatch-ack-4S44HBWB.js +0 -15
  402. package/dist/dreaming-UKGTQT6I.js +0 -44
  403. package/dist/orchestrator-PGHJDUUT.js +0 -45
  404. package/dist/setup-wizard-CJIYDSSP.js +0 -13
  405. package/dist/tasks-notify-TFJLSQ3B.js +0 -50
  406. package/dist/worktree-YXBDRYOC.js +0 -31
  407. package/dist/{chunk-7UMCQQWS.js → chunk-A4DVMPYB.js} +3 -3
  408. /package/dist/{chunk-2KLAYDFB.js → chunk-GIBYNT6W.js} +0 -0
  409. /package/dist/{chunk-MC6VPZKS.js → chunk-JRM4TAGS.js} +0 -0
  410. /package/dist/{chunk-3NCZKWPO.js → chunk-MGGOSFCR.js} +0 -0
  411. /package/dist/{chunk-C2SRRCRK.js → chunk-QIFYLIUF.js} +0 -0
  412. /package/dist/{chunk-OADURIIN.js → chunk-WTH4CSAP.js} +0 -0
  413. /package/dist/{core-memory-3IBWM4WR.js → core-memory-GAC6EWOQ.js} +0 -0
  414. /package/dist/{entity-boost-DWAWXFKN.js → entity-boost-NT6UO2Z3.js} +0 -0
  415. /package/dist/{message-queue-client-3PTHPG5Q.js → message-queue-client-4EOQRUXW.js} +0 -0
  416. /package/dist/{oauth-server-M5TGXT6D.js → oauth-server-67YBDP32.js} +0 -0
  417. /package/dist/{webhook-pipe-FZYLO6RR.js → webhook-pipe-LEXMUQ5B.js} +0 -0
  418. /package/dist/{wiki-acl-7CROE3MJ.js → wiki-acl-74BLWG6J.js} +0 -0
  419. /package/dist/{wiki-client-VNDOBK63.js → wiki-client-EAN7F5LV.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EXE_AI_DIR
3
- } from "./chunk-7Y5UDEVM.js";
3
+ } from "./chunk-WZHZCDDO.js";
4
4
 
5
5
  // src/lib/memory-queue.ts
6
6
  import {
@@ -73,6 +73,38 @@ function retryQueueEntries(leasePath, entries) {
73
73
  }
74
74
  writeFileSync(leasePath, entries.map((entry) => JSON.stringify(entry)).join("\n") + "\n");
75
75
  }
76
+ async function processQueueEntries(entries, writeEntry, options = {}) {
77
+ const batchSize = Math.max(1, options.batchSize ?? 1);
78
+ const yieldFn = options.yieldFn ?? (() => new Promise((resolve) => setImmediate(resolve)));
79
+ const isDraining = options.isDraining ?? (() => false);
80
+ const retryEntries = [];
81
+ let processed = 0;
82
+ let preserved = 0;
83
+ let sinceYield = 0;
84
+ for (let i = 0; i < entries.length; i++) {
85
+ if (isDraining()) {
86
+ const remaining = entries.slice(i).filter((e) => e.raw_text && e.raw_text.length >= 10);
87
+ retryEntries.push(...remaining);
88
+ preserved = remaining.length;
89
+ if (preserved > 0) options.onShutdownPreserve?.(preserved);
90
+ break;
91
+ }
92
+ const entry = entries[i];
93
+ if (!entry.raw_text || entry.raw_text.length < 10) continue;
94
+ try {
95
+ await writeEntry(entry);
96
+ processed++;
97
+ } catch (err) {
98
+ retryEntries.push(entry);
99
+ options.onWriteError?.(entry, err);
100
+ }
101
+ if (++sinceYield >= batchSize) {
102
+ sinceYield = 0;
103
+ await yieldFn();
104
+ }
105
+ }
106
+ return { processed, retryEntries, preserved };
107
+ }
76
108
  function drainQueue() {
77
109
  const entries = [];
78
110
  while (true) {
@@ -185,6 +217,7 @@ export {
185
217
  claimQueue,
186
218
  ackQueue,
187
219
  retryQueueEntries,
220
+ processQueueEntries,
188
221
  drainQueue,
189
222
  queueDepth
190
223
  };
@@ -1,14 +1,19 @@
1
+ import {
2
+ assertCodexModelForAuth,
3
+ describeCodexModelAvailability,
4
+ detectCodexAuthType
5
+ } from "./chunk-AM7S2TY6.js";
1
6
  import {
2
7
  DEFAULT_RUNTIME,
3
8
  RUNTIME_TABLE
4
9
  } from "./chunk-NGP6LSV2.js";
5
10
  import {
6
11
  EXE_AI_DIR
7
- } from "./chunk-7Y5UDEVM.js";
12
+ } from "./chunk-WZHZCDDO.js";
8
13
  import {
9
14
  atomicWriteJsonSync,
10
15
  ensurePrivateDirSync
11
- } from "./chunk-SHIICYJW.js";
16
+ } from "./chunk-BYTDMAGB.js";
12
17
 
13
18
  // src/lib/agent-config.ts
14
19
  import { readFileSync, existsSync } from "fs";
@@ -16,6 +21,14 @@ import path from "path";
16
21
  var AGENT_CONFIG_PATH = path.join(EXE_AI_DIR, "agent-config.json");
17
22
  var KNOWN_RUNTIMES = {
18
23
  claude: ["claude-opus-4.8", "claude-opus-4.8-1m", "claude-opus-4.6", "claude-sonnet-4.8", "claude-sonnet-4.6", "claude-haiku-4.5", "claude-fable-5"],
24
+ // Bug fbf99272: this list MUST contain RUNTIME_TABLE.codex.defaultModel — the
25
+ // adapter's own default — or a default codex spawn boots an unlisted model that
26
+ // 400s and idles (asserted by an agent-config-models test so they cannot drift).
27
+ // Codex model availability also depends on AUTH TYPE (ChatGPT account vs OpenAI
28
+ // API key); see codex-auth.ts for the auth-aware preflight. Do NOT add
29
+ // "gpt-5.6" here: VERIFIED 2026-07-10 to 400 ("not supported … with a ChatGPT
30
+ // account"). "gpt-5.3-codex" (the Codex CLI's own default) is likewise NOT
31
+ // whitelisted for the same reason — exe-start-codex pins a listed model instead.
19
32
  codex: ["gpt-5.4", "gpt-5.5", "gpt-5.3-codex-spark", "o3", "o4-mini"],
20
33
  opencode: ["anthropic/claude-opus-4-8", "anthropic/claude-sonnet-4-8", "anthropic/claude-sonnet-4-6", "openai/gpt-5.4", "google/gemini-2.5-pro", "deepseek/deepseek-r3", "minimax/minimax-m2.5", "xai/grok-4", "xai/grok-3", "xai/grok-2-latest", "xai/grok-2-1212", "xai/grok-beta"]
21
34
  };
@@ -125,7 +138,7 @@ function resolveSpawnRuntimeConfig(agentId, runtimeOverride, modelOverride) {
125
138
  ...modelOverride ? { model: modelOverride } : {}
126
139
  };
127
140
  }
128
- function assertRuntimeModelCompatible(runtime, model) {
141
+ function assertRuntimeModelCompatible(runtime, model, opts) {
129
142
  const replacement = retiredModelReplacement(model);
130
143
  if (replacement) {
131
144
  return {
@@ -134,12 +147,16 @@ function assertRuntimeModelCompatible(runtime, model) {
134
147
  };
135
148
  }
136
149
  if (runtime === "codex" && model && isClaudeModel(model)) {
137
- const codexModels = KNOWN_RUNTIMES.codex?.join(", ") ?? "gpt-* models";
138
150
  return {
139
151
  ok: false,
140
- error: `Runtime/model mismatch: runtime "codex" cannot run Claude model "${model}". Codex (ChatGPT account) only supports OpenAI models (${codexModels}). Pass a Codex spawn_model, or set the agent's runtime to "claude". Rejected before spawn to avoid a silently dead session (bug a403e1f4).`
152
+ error: `Runtime/model mismatch: runtime "codex" cannot run Claude model "${model}". Codex needs an OpenAI model (${describeCodexModelAvailability(KNOWN_RUNTIMES.codex ?? [])}). Pass a Codex spawn_model, or set the agent's runtime to "claude". Rejected before spawn to avoid a silently dead session (bug a403e1f4).`
141
153
  };
142
154
  }
155
+ if (runtime === "codex" && model) {
156
+ const authType = opts?.codexAuthType ?? detectCodexAuthType();
157
+ const authCheck = assertCodexModelForAuth(model, authType, KNOWN_RUNTIMES.codex ?? []);
158
+ if (!authCheck.ok) return authCheck;
159
+ }
143
160
  if (model && KNOWN_RUNTIMES[runtime]) {
144
161
  const validated = validateRuntimeModel(runtime, model);
145
162
  if (!validated.ok) {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  sessionScopeFilter
3
- } from "./chunk-KKOLHBNC.js";
3
+ } from "./chunk-UP75Z5X7.js";
4
4
  import {
5
5
  getClient,
6
6
  getIdentity
7
- } from "./chunk-RWSLVYTE.js";
7
+ } from "./chunk-AOHXREB7.js";
8
8
  import {
9
9
  getEmotionalBaseline
10
10
  } from "./chunk-PNQDP3OA.js";
@@ -643,7 +643,7 @@ var DreamingEngine = class {
643
643
  }
644
644
  let overdueProspective = [];
645
645
  try {
646
- const { getOverdueProspective, completeProspective } = await import("./prospective-memory-UACFTYXK.js");
646
+ const { getOverdueProspective, completeProspective } = await import("./prospective-memory-6D2ASWM3.js");
647
647
  const overdue = await getOverdueProspective(agentId);
648
648
  overdueProspective = overdue.map((o) => ({
649
649
  id: o.id,
@@ -0,0 +1,224 @@
1
+ // src/lib/daemon-restart-circuit-breaker.ts
2
+ import { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync, renameSync } from "fs";
3
+ import path from "path";
4
+ import os from "os";
5
+ var RESTART_BREAKER_THRESHOLD = (() => {
6
+ const raw = Number(process.env.EXE_RESTART_BREAKER_THRESHOLD);
7
+ return Number.isFinite(raw) && raw >= 2 ? Math.floor(raw) : 5;
8
+ })();
9
+ var RESTART_BREAKER_WINDOW_MS = (() => {
10
+ const raw = Number(process.env.EXE_RESTART_BREAKER_WINDOW_MS);
11
+ return Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : 60 * 60 * 1e3;
12
+ })();
13
+ var EXE_DIR = path.join(os.homedir(), ".exe-os");
14
+ var STATE_PATH = path.join(EXE_DIR, "daemon-restart-breaker.json");
15
+ var ALERT_PATH = path.join(EXE_DIR, "daemon-restart-breaker.ALERT.json");
16
+ var LAST_EXIT_PATH = path.join(EXE_DIR, "daemon-last-exit.json");
17
+ var DELIBERATE_REASON_SUBSTRINGS = ["deploy", "update", "install", "manual", "key-rotation", "config-reload"];
18
+ var SELF_HEAL_REASON_SUBSTRINGS = ["self_heal", "self-heal", "event_loop", "event-loop", "lag", "rss", "stale-dist", "watchdog"];
19
+ function writeStateAtomic(p, data) {
20
+ if (!existsSync(EXE_DIR)) mkdirSync(EXE_DIR, { recursive: true });
21
+ const tmp = `${p}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
22
+ writeFileSync(tmp, data, { mode: 384 });
23
+ renameSync(tmp, p);
24
+ }
25
+ var REAL_DEPS = {
26
+ statePath: STATE_PATH,
27
+ alertPath: ALERT_PATH,
28
+ lastExitPath: LAST_EXIT_PATH,
29
+ exists: existsSync,
30
+ read: (p) => readFileSync(p, "utf8"),
31
+ write: writeStateAtomic,
32
+ remove: (p) => {
33
+ if (existsSync(p)) unlinkSync(p);
34
+ },
35
+ now: () => Date.now()
36
+ };
37
+ function classifyBoot(lastExit) {
38
+ if (!lastExit) return { bootClass: "crash", label: "no-breadcrumb (SIGKILL/OOM/panic)" };
39
+ const reason = (lastExit.reason ?? "").toLowerCase();
40
+ const kind = (lastExit.kind ?? "").toLowerCase();
41
+ if (reason && DELIBERATE_REASON_SUBSTRINGS.some((s) => reason.includes(s))) {
42
+ return { bootClass: "deliberate", label: `deliberate:${reason}` };
43
+ }
44
+ if (kind === "self_heal" || SELF_HEAL_REASON_SUBSTRINGS.some((s) => reason.includes(s))) {
45
+ return { bootClass: "self_heal", label: `self_heal:${reason || kind}` };
46
+ }
47
+ if (kind === "clean" || lastExit.exitCode === 0 && !reason) {
48
+ return { bootClass: "deliberate", label: "clean-exit" };
49
+ }
50
+ return { bootClass: "crash", label: `crash:${kind}${reason ? `:${reason}` : ""}` };
51
+ }
52
+ function evaluateRestartBreaker(prev, now, bootClass, windowMs = RESTART_BREAKER_WINDOW_MS, threshold = RESTART_BREAKER_THRESHOLD) {
53
+ const recent = (Array.isArray(prev) ? prev : []).filter((e) => e && typeof e.t === "number" && Number.isFinite(e.t) && now - e.t < windowMs);
54
+ if (bootClass === "crash") recent.push({ t: now, c: "x" });
55
+ else if (bootClass === "self_heal") recent.push({ t: now, c: "s" });
56
+ recent.sort((a, b) => a.t - b.t);
57
+ const crashInWindow = recent.filter((e) => e.c === "x").length;
58
+ return { trip: crashInWindow >= threshold, crashInWindow, restartsInWindow: recent.length, entries: recent };
59
+ }
60
+ function loadStateEntries(deps) {
61
+ try {
62
+ if (!deps.exists(deps.statePath)) return [];
63
+ const parsed = JSON.parse(deps.read(deps.statePath));
64
+ if (!Array.isArray(parsed.restarts)) throw new Error("restarts is not an array");
65
+ return parsed.restarts.map((e) => {
66
+ if (typeof e === "number" && Number.isFinite(e)) return { t: e, c: "x" };
67
+ if (e && typeof e.t === "number") {
68
+ const c = e.c === "s" ? "s" : "x";
69
+ return { t: e.t, c };
70
+ }
71
+ return null;
72
+ }).filter((e) => e !== null);
73
+ } catch (err) {
74
+ process.stderr.write(
75
+ `[exed] Restart-breaker state file unreadable \u2014 FAILING OPEN (treating as empty, will not trip): ${err instanceof Error ? err.message : String(err)}
76
+ `
77
+ );
78
+ return [];
79
+ }
80
+ }
81
+ function readLastExit(deps) {
82
+ try {
83
+ if (!deps.exists(deps.lastExitPath)) return null;
84
+ const p = JSON.parse(deps.read(deps.lastExitPath));
85
+ if (typeof p.exitCode !== "number" || typeof p.kind !== "string") return null;
86
+ return {
87
+ exitCode: p.exitCode,
88
+ reason: typeof p.reason === "string" ? p.reason : null,
89
+ kind: p.kind,
90
+ ts: typeof p.ts === "number" ? p.ts : 0,
91
+ ...typeof p.uptimeMs === "number" ? { uptimeMs: p.uptimeMs } : {},
92
+ ...typeof p.lagMs === "number" ? { lagMs: p.lagMs } : {},
93
+ ...typeof p.timerName === "string" ? { timerName: p.timerName } : {},
94
+ ...typeof p.timerDurationMs === "number" ? { timerDurationMs: p.timerDurationMs } : {},
95
+ ...typeof p.rssBytes === "number" ? { rssBytes: p.rssBytes } : {}
96
+ };
97
+ } catch {
98
+ return null;
99
+ }
100
+ }
101
+ function recordDaemonRestart(deps = REAL_DEPS) {
102
+ const lastExit = readLastExit(deps);
103
+ const { bootClass, label } = classifyBoot(lastExit);
104
+ try {
105
+ deps.remove(deps.lastExitPath);
106
+ } catch {
107
+ }
108
+ const now = deps.now();
109
+ const ev = evaluateRestartBreaker(loadStateEntries(deps), now, bootClass);
110
+ try {
111
+ deps.write(deps.statePath, JSON.stringify({ restarts: ev.entries }));
112
+ } catch {
113
+ }
114
+ const decision = {
115
+ trip: ev.trip,
116
+ bootClass,
117
+ crashInWindow: ev.crashInWindow,
118
+ restartsInWindow: ev.restartsInWindow,
119
+ reasonLabel: label,
120
+ entries: ev.entries
121
+ };
122
+ if (decision.trip) writeBreakerAlert(decision, lastExit, deps);
123
+ return decision;
124
+ }
125
+ function crashBootsInWindow(deps = REAL_DEPS, windowMs = RESTART_BREAKER_WINDOW_MS) {
126
+ const now = deps.now();
127
+ return loadStateEntries(deps).filter((e) => e.c === "x" && now - e.t < windowMs).length;
128
+ }
129
+ function restartBootsInWindow(deps = REAL_DEPS, windowMs = RESTART_BREAKER_WINDOW_MS) {
130
+ const now = deps.now();
131
+ return loadStateEntries(deps).filter((e) => now - e.t < windowMs).length;
132
+ }
133
+ function writeBreakerAlert(decision, lastExit, deps = REAL_DEPS) {
134
+ const windowMin = Math.round(RESTART_BREAKER_WINDOW_MS / 6e4);
135
+ const alert = {
136
+ trippedAt: new Date(deps.now()).toISOString(),
137
+ crashRestartsInWindow: decision.crashInWindow,
138
+ totalRestartsInWindow: decision.restartsInWindow,
139
+ windowMs: RESTART_BREAKER_WINDOW_MS,
140
+ threshold: RESTART_BREAKER_THRESHOLD,
141
+ restartTimestamps: decision.entries.map((e) => ({ at: new Date(e.t).toISOString(), class: e.c === "x" ? "crash" : "self_heal" })),
142
+ lastBootClassification: decision.reasonLabel,
143
+ lastExit: lastExit ?? "none (SIGKILL/OOM left no breadcrumb)",
144
+ reason: `Daemon suffered ${decision.crashInWindow} CRASH restarts within ${windowMin}min \u2014 crash-loop circuit breaker OPEN. The daemon is now in DEGRADED mode (health endpoint only, no heavy work) to protect system memory (bug 2fee6110).`,
145
+ recovery: {
146
+ automatic: `Self-clears once ${windowMin}min pass with no further crashes.`,
147
+ manual: `Run 'exe-os daemon reset-breaker' (clears state + alert), then relaunch the daemon.`,
148
+ inspect: `'exe-os daemon status' shows the crash timestamps and last exit.`
149
+ }
150
+ };
151
+ try {
152
+ deps.write(deps.alertPath, JSON.stringify(alert, null, 2));
153
+ } catch {
154
+ }
155
+ process.stderr.write(
156
+ `
157
+ [exed] ========================================================================
158
+ [exed] RESTART CIRCUIT BREAKER TRIPPED \u2014 ${decision.crashInWindow} CRASH restarts in ${windowMin}min.
159
+ [exed] Entering DEGRADED mode (no backups/DB/embeddings) to avoid an OOM machine crash (bug 2fee6110).
160
+ [exed] Alert: ${deps.alertPath}
161
+ [exed] Recover: 'exe-os daemon reset-breaker' then relaunch. Inspect: 'exe-os daemon status'.
162
+ [exed] ========================================================================
163
+
164
+ `
165
+ );
166
+ }
167
+ function isRestartBreakerTripped(deps = REAL_DEPS) {
168
+ try {
169
+ return deps.exists(deps.alertPath);
170
+ } catch {
171
+ return false;
172
+ }
173
+ }
174
+ function readBreakerAlert(deps = REAL_DEPS) {
175
+ try {
176
+ if (!deps.exists(deps.alertPath)) return null;
177
+ return JSON.parse(deps.read(deps.alertPath));
178
+ } catch {
179
+ return null;
180
+ }
181
+ }
182
+ function restartBreakerAlertPath() {
183
+ return ALERT_PATH;
184
+ }
185
+ function restartBreakerStatePath() {
186
+ return STATE_PATH;
187
+ }
188
+ function daemonLastExitPath() {
189
+ return LAST_EXIT_PATH;
190
+ }
191
+ function resetRestartBreaker(deps = REAL_DEPS) {
192
+ try {
193
+ deps.remove(deps.statePath);
194
+ } catch {
195
+ }
196
+ try {
197
+ deps.remove(deps.alertPath);
198
+ } catch {
199
+ }
200
+ }
201
+ function writeDaemonExitBreadcrumb(info, deps = REAL_DEPS) {
202
+ try {
203
+ deps.write(deps.lastExitPath, JSON.stringify(info));
204
+ } catch {
205
+ }
206
+ }
207
+
208
+ export {
209
+ RESTART_BREAKER_THRESHOLD,
210
+ RESTART_BREAKER_WINDOW_MS,
211
+ classifyBoot,
212
+ evaluateRestartBreaker,
213
+ recordDaemonRestart,
214
+ crashBootsInWindow,
215
+ restartBootsInWindow,
216
+ writeBreakerAlert,
217
+ isRestartBreakerTripped,
218
+ readBreakerAlert,
219
+ restartBreakerAlertPath,
220
+ restartBreakerStatePath,
221
+ daemonLastExitPath,
222
+ resetRestartBreaker,
223
+ writeDaemonExitBreadcrumb
224
+ };
@@ -1,10 +1,20 @@
1
1
  import {
2
+ supportCommitSchema,
3
+ supportIdSchema,
4
+ supportProductSchema,
5
+ supportTaskIdSchema,
6
+ supportVersionSchema
7
+ } from "./chunk-5H47VHB7.js";
8
+ import {
9
+ SUPPORT_PRODUCTS,
10
+ sanitizeProductFilter,
11
+ sanitizeUpstreamId,
2
12
  sanitizedUpstreamBody
3
- } from "./chunk-RP5GETX5.js";
13
+ } from "./chunk-4QCFFW2H.js";
4
14
  import {
5
15
  loadLicense,
6
16
  readCachedLicenseToken
7
- } from "./chunk-7SEC2AG5.js";
17
+ } from "./chunk-PQIDGXSG.js";
8
18
 
9
19
  // src/mcp/tools/support-inbox.ts
10
20
  import { z } from "zod";
@@ -101,7 +111,7 @@ async function fetchJson(url, headers, init) {
101
111
  async function commentRequestJson(bugId, init) {
102
112
  const token = adminToken();
103
113
  if (token) {
104
- const url2 = `${endpoint()}/${encodeURIComponent(bugId)}/comments`;
114
+ const url2 = `${endpoint()}/${encodeURIComponent(sanitizeUpstreamId(bugId))}/comments`;
105
115
  return fetchJson(url2, { authorization: `Bearer ${token}` }, init);
106
116
  }
107
117
  const ownerHeaders = ownerAuthHeaders();
@@ -110,7 +120,7 @@ async function commentRequestJson(bugId, init) {
110
120
  "Not authenticated for support comments. Run `exe-os login` (GoTrue) or set a license key, or configure an AskExe admin token (ASKEXE_SUPPORT_ADMIN_TOKEN)."
111
121
  );
112
122
  }
113
- const url = `${ownerEndpoint()}/${encodeURIComponent(bugId)}/comments`;
123
+ const url = `${ownerEndpoint()}/${encodeURIComponent(sanitizeUpstreamId(bugId))}/comments`;
114
124
  return fetchJson(url, ownerHeaders, init);
115
125
  }
116
126
  function registerListBugReports(server) {
@@ -122,14 +132,21 @@ function registerListBugReports(server) {
122
132
  inputSchema: {
123
133
  status: z.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("open"),
124
134
  severity: z.enum(["p0", "p1", "p2", "p3"]).optional(),
125
- limit: z.number().int().min(1).max(100).default(25)
135
+ // Round 8: constrain to the known enum at the schema — a `product` filter is
136
+ // NOT free text, and it was sent raw as a query param.
137
+ product: z.enum(SUPPORT_PRODUCTS).optional().describe("Filter by product"),
138
+ limit: z.number().int().min(1).max(500).default(25),
139
+ offset: z.number().int().min(0).default(0).describe("Number of results to skip for pagination. Use next_offset from a prior response.")
126
140
  }
127
141
  },
128
- async ({ status, severity, limit }) => {
142
+ async ({ status, severity, product, limit, offset }) => {
129
143
  const url = new URL(endpoint());
130
144
  url.searchParams.set("status", status);
131
145
  url.searchParams.set("limit", String(limit));
146
+ url.searchParams.set("offset", String(offset));
132
147
  if (severity) url.searchParams.set("severity", severity);
148
+ const safeProduct = sanitizeProductFilter(product);
149
+ if (safeProduct) url.searchParams.set("product", safeProduct);
133
150
  const data = await requestJson(url.toString());
134
151
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
135
152
  }
@@ -152,10 +169,10 @@ function registerGetBugReport(server) {
152
169
  {
153
170
  title: "Get Bug Report",
154
171
  description: "AskExe-internal only: fetch one customer bug report with full markdown payload and comments thread.",
155
- inputSchema: { id: z.string().min(8) }
172
+ inputSchema: { id: supportIdSchema }
156
173
  },
157
174
  async ({ id }) => {
158
- const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`);
175
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`);
159
176
  const comments = parseComments(data);
160
177
  const enriched = data && typeof data === "object" ? { ...data, comments } : { id, comments };
161
178
  return { content: [{ type: "text", text: JSON.stringify(enriched, null, 2) }] };
@@ -169,7 +186,7 @@ function registerAddBugReportComment(server) {
169
186
  title: "Add Bug Report Comment",
170
187
  description: "AskExe-internal only: append a comment to a bug report's thread (POST /comments). Non-destructive \u2014 does not touch triage_notes or status.",
171
188
  inputSchema: {
172
- id: z.string().min(8),
189
+ id: supportIdSchema,
173
190
  comment: z.string().min(1).describe("Comment text to append to the bug report thread")
174
191
  }
175
192
  },
@@ -188,7 +205,7 @@ function registerGetBugReportComments(server) {
188
205
  {
189
206
  title: "Get Bug Report Comments",
190
207
  description: "AskExe-internal only: list the comments thread on a bug report (GET /comments).",
191
- inputSchema: { id: z.string().min(8) }
208
+ inputSchema: { id: supportIdSchema }
192
209
  },
193
210
  async ({ id }) => {
194
211
  const data = await commentRequestJson(id);
@@ -203,19 +220,19 @@ function registerTriageBugReport(server) {
203
220
  title: "Triage Bug Report",
204
221
  description: "AskExe-internal only: update bug report status and link task/commit/release metadata.",
205
222
  inputSchema: {
206
- id: z.string().min(8),
223
+ id: supportIdSchema,
207
224
  status: STATUS.optional(),
208
225
  triage_notes: z.string().optional(),
209
226
  add_note: z.string().optional().describe("Append a timestamped progress note without changing status or replacing triage_notes"),
210
- linked_task_id: z.string().optional(),
211
- linked_commit: z.string().optional(),
212
- fixed_version: z.string().optional(),
213
- product: z.string().optional().describe("Re-label this bug's product: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp")
227
+ linked_task_id: supportTaskIdSchema.optional(),
228
+ linked_commit: supportCommitSchema.optional(),
229
+ fixed_version: supportVersionSchema.optional(),
230
+ product: supportProductSchema.optional().describe("Re-label this bug's product: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp")
214
231
  }
215
232
  },
216
233
  async ({ id, status, triage_notes, add_note, linked_task_id, linked_commit, fixed_version, product }) => {
217
234
  const effectiveStatus = fixed_version && !status ? "closed" : status;
218
- const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`, {
235
+ const data = await requestJson(`${endpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`, {
219
236
  method: "PATCH",
220
237
  body: sanitizedUpstreamBody({ status: effectiveStatus, triage_notes, add_note, linked_task_id, linked_commit, fixed_version, product }, "support-inbox:triage_bug")
221
238
  });
@@ -236,14 +253,19 @@ function registerListFeatureRequests(server) {
236
253
  inputSchema: {
237
254
  status: z.enum(["all", "open", "planned", "in_progress", "shipped", "closed", "wontdo"]).default("open"),
238
255
  priority: z.enum(["p0", "p1", "p2", "p3"]).optional(),
239
- limit: z.number().int().min(1).max(100).default(25)
256
+ product: z.string().optional().describe("Filter by product: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp"),
257
+ limit: z.number().int().min(1).max(500).default(25),
258
+ offset: z.number().int().min(0).default(0).describe("Number of results to skip for pagination. Use next_offset from a prior response.")
240
259
  }
241
260
  },
242
- async ({ status, priority, limit }) => {
261
+ async ({ status, priority, product, limit, offset }) => {
243
262
  const url = new URL(featureEndpoint());
244
263
  url.searchParams.set("status", status);
245
264
  url.searchParams.set("limit", String(limit));
265
+ url.searchParams.set("offset", String(offset));
246
266
  if (priority) url.searchParams.set("priority", priority);
267
+ const safeProduct = sanitizeProductFilter(product);
268
+ if (safeProduct) url.searchParams.set("product", safeProduct);
247
269
  const data = await requestJson(url.toString());
248
270
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
249
271
  }
@@ -255,10 +277,10 @@ function registerGetFeatureRequest(server) {
255
277
  {
256
278
  title: "Get Feature Request",
257
279
  description: "AskExe-internal only: fetch one customer feature request with full payload.",
258
- inputSchema: { id: z.string().min(8) }
280
+ inputSchema: { id: supportIdSchema }
259
281
  },
260
282
  async ({ id }) => {
261
- const data = await requestJson(`${featureEndpoint()}/${encodeURIComponent(id)}`);
283
+ const data = await requestJson(`${featureEndpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`);
262
284
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
263
285
  }
264
286
  );
@@ -270,19 +292,22 @@ function registerTriageFeatureRequest(server) {
270
292
  title: "Triage Feature Request",
271
293
  description: "AskExe-internal only: update feature request status, response notes, and version metadata.",
272
294
  inputSchema: {
273
- id: z.string().min(8),
295
+ id: supportIdSchema,
274
296
  status: FEATURE_STATUS.optional(),
275
297
  response_notes: z.string().optional(),
276
298
  add_note: z.string().optional().describe("Append a timestamped progress note without changing status or replacing response_notes"),
277
- target_version: z.string().optional(),
278
- shipped_version: z.string().optional()
299
+ target_version: supportVersionSchema.optional(),
300
+ shipped_version: supportVersionSchema.optional(),
301
+ // bug b8e990ed: allow admin re-label of a feature's product. Typed with the
302
+ // strict product schema (round 10 ingress validation), not a loose string.
303
+ product: supportProductSchema.optional().describe("Re-label this feature's product: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build, exe-chat, exe-auth, exe-monitor, exe-db, exe-erp")
279
304
  }
280
305
  },
281
- async ({ id, status, response_notes, add_note, target_version, shipped_version }) => {
306
+ async ({ id, status, response_notes, add_note, target_version, shipped_version, product }) => {
282
307
  const effectiveStatus = shipped_version && !status ? "shipped" : status;
283
- const data = await requestJson(`${featureEndpoint()}/${encodeURIComponent(id)}`, {
308
+ const data = await requestJson(`${featureEndpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`, {
284
309
  method: "PATCH",
285
- body: sanitizedUpstreamBody({ status: effectiveStatus, response_notes, add_note, target_version, shipped_version }, "support-inbox:triage_feature")
310
+ body: sanitizedUpstreamBody({ status: effectiveStatus, response_notes, add_note, target_version, shipped_version, product }, "support-inbox:triage_feature")
286
311
  });
287
312
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
288
313
  }
@@ -301,13 +326,15 @@ function registerListReviews(server) {
301
326
  inputSchema: {
302
327
  status: z.enum(["all", "open", "in_review", "approved", "merged", "closed", "rejected"]).default("open"),
303
328
  priority: z.enum(["p0", "p1", "p2", "p3"]).optional(),
304
- limit: z.number().int().min(1).max(100).default(25)
329
+ limit: z.number().int().min(1).max(500).default(25),
330
+ offset: z.number().int().min(0).default(0).describe("Number of results to skip for pagination. Use next_offset from a prior response.")
305
331
  }
306
332
  },
307
- async ({ status, priority, limit }) => {
333
+ async ({ status, priority, limit, offset }) => {
308
334
  const url = new URL(reviewEndpoint());
309
335
  url.searchParams.set("status", status);
310
336
  url.searchParams.set("limit", String(limit));
337
+ url.searchParams.set("offset", String(offset));
311
338
  if (priority) url.searchParams.set("priority", priority);
312
339
  const data = await requestJson(url.toString());
313
340
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
@@ -320,10 +347,10 @@ function registerGetReview(server) {
320
347
  {
321
348
  title: "Get Review",
322
349
  description: "AskExe-internal only: fetch one review with full payload.",
323
- inputSchema: { id: z.string().min(8) }
350
+ inputSchema: { id: supportIdSchema }
324
351
  },
325
352
  async ({ id }) => {
326
- const data = await requestJson(`${reviewEndpoint()}/${encodeURIComponent(id)}`);
353
+ const data = await requestJson(`${reviewEndpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`);
327
354
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
328
355
  }
329
356
  );
@@ -335,7 +362,7 @@ function registerTriageReview(server) {
335
362
  title: "Triage Review",
336
363
  description: "AskExe-internal only: update review status, response notes, and resolution.",
337
364
  inputSchema: {
338
- id: z.string().min(8),
365
+ id: supportIdSchema,
339
366
  status: REVIEW_STATUS.optional(),
340
367
  response_notes: z.string().optional(),
341
368
  add_note: z.string().optional().describe("Append a timestamped progress note without changing status or replacing response_notes"),
@@ -344,7 +371,7 @@ function registerTriageReview(server) {
344
371
  }
345
372
  },
346
373
  async ({ id, status, response_notes, add_note, resolution, pr_url }) => {
347
- const data = await requestJson(`${reviewEndpoint()}/${encodeURIComponent(id)}`, {
374
+ const data = await requestJson(`${reviewEndpoint()}/${encodeURIComponent(sanitizeUpstreamId(id))}`, {
348
375
  method: "PATCH",
349
376
  body: sanitizedUpstreamBody({ status, response_notes, add_note, resolution, pr_url }, "support-inbox:triage_review")
350
377
  });