@askexenow/exe-os 0.9.347 → 0.9.349

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 (316) hide show
  1. package/deploy/compose/cloudflared/config.yml.example +9 -6
  2. package/deploy/compose/docker-compose.yml +31 -15
  3. package/deploy/compose/erp-nginx/nginx.conf +17 -10
  4. package/deploy/compose/sso-edge/default.conf.template +26 -0
  5. package/deploy/stack-manifests/v0.9.30-apps.json +81 -0
  6. package/deploy/stack-manifests/v0.9.json +112 -3
  7. package/dist/{active-agent-CMY7WTJL.js → active-agent-PX6KAEEQ.js} +4 -3
  8. package/dist/{active-agent-US4KO4LV.js → active-agent-QVLZKWR2.js} +4 -3
  9. package/dist/{agentic-ontology-3Y37SQYR.js → agentic-ontology-6MEXY5L7.js} +1 -1
  10. package/dist/{backfill-metadata-GK66TYQE.js → backfill-metadata-TUUT3QII.js} +6 -5
  11. package/dist/{backup-verify-72XBKKHL.js → backup-verify-RGB3KKD4.js} +2 -1
  12. package/dist/{behaviors-G7TR6LBM.js → behaviors-3DQM4PSA.js} +7 -6
  13. package/dist/bin/agentic-ontology-backfill.js +7 -6
  14. package/dist/bin/agentic-reflection-backfill.js +8 -7
  15. package/dist/bin/agentic-semantic-label.js +7 -6
  16. package/dist/bin/backfill-conversations.js +6 -5
  17. package/dist/bin/backfill-responses.js +6 -5
  18. package/dist/bin/backfill-vectors.js +7 -6
  19. package/dist/bin/bulk-sync-postgres.js +11 -10
  20. package/dist/bin/cc-doctor.js +5 -4
  21. package/dist/bin/cleanup-stale-review-tasks.js +14 -13
  22. package/dist/bin/cli.js +18 -18
  23. package/dist/bin/deferred-daemon-restart.js +105 -91
  24. package/dist/bin/exe-agent-config.js +4 -3
  25. package/dist/bin/exe-agent.js +6 -5
  26. package/dist/bin/exe-assign.js +7 -6
  27. package/dist/bin/exe-boot.js +29 -28
  28. package/dist/bin/exe-call.js +6 -5
  29. package/dist/bin/exe-cloud.js +26 -15
  30. package/dist/bin/exe-config-dump.js +4 -3
  31. package/dist/bin/exe-dispatch.js +14 -13
  32. package/dist/bin/exe-doctor.js +5 -4
  33. package/dist/bin/exe-export-behaviors.js +9 -8
  34. package/dist/bin/exe-forget.js +8 -7
  35. package/dist/bin/exe-gateway.js +8 -7
  36. package/dist/bin/exe-healthcheck.js +5 -4
  37. package/dist/bin/exe-heartbeat.js +16 -15
  38. package/dist/bin/exe-kill.js +18 -17
  39. package/dist/bin/exe-launch-agent.js +24 -23
  40. package/dist/bin/exe-memory-reads.js +6 -5
  41. package/dist/bin/exe-new-employee.js +10 -9
  42. package/dist/bin/exe-os-mcp-proxy.js +4 -3
  43. package/dist/bin/exe-pending-messages.js +15 -14
  44. package/dist/bin/exe-pending-notifications.js +14 -13
  45. package/dist/bin/exe-pending-reviews.js +14 -13
  46. package/dist/bin/exe-rename.js +6 -5
  47. package/dist/bin/exe-review.js +17 -16
  48. package/dist/bin/exe-search.js +7 -6
  49. package/dist/bin/exe-session-cleanup.js +18 -17
  50. package/dist/bin/exe-settings.js +12 -11
  51. package/dist/bin/exe-start-codex.js +97 -15
  52. package/dist/bin/exe-start-opencode.js +10 -9
  53. package/dist/bin/exe-status.js +15 -14
  54. package/dist/bin/exe-support.js +3 -3
  55. package/dist/bin/exe-team.js +4 -3
  56. package/dist/bin/git-sweep.js +15 -14
  57. package/dist/bin/graph-backfill.js +7 -6
  58. package/dist/bin/graph-export.js +7 -6
  59. package/dist/bin/import-history.js +10 -9
  60. package/dist/bin/install.js +71 -70
  61. package/dist/bin/intercom-check.js +4 -4
  62. package/dist/bin/mcp-sessions.js +2 -2
  63. package/dist/bin/orchestration-metrics.js +5 -4
  64. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  65. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  66. package/dist/bin/pre-publish.js +1 -1
  67. package/dist/bin/reconcile-backlog.js +2 -2
  68. package/dist/bin/registry-proxy.js +1 -1
  69. package/dist/bin/scan-tasks.js +14 -13
  70. package/dist/bin/setup.js +1 -1
  71. package/dist/bin/shard-migrate.js +6 -5
  72. package/dist/bin/stack-update.js +7 -6
  73. package/dist/bin/vps-health-gate.js +1 -1
  74. package/dist/{boot-generation-KG43UYL4.js → boot-generation-FB2J53IG.js} +4 -3
  75. package/dist/{boot-review-sections-56BRURLM.js → boot-review-sections-UTOPAQQJ.js} +13 -12
  76. package/dist/{capability-cards-4MN3IVJO.js → capability-cards-YADEM2KN.js} +3 -2
  77. package/dist/{capacity-monitor-4NJTN5QQ.js → capacity-monitor-IO6JHLXV.js} +15 -14
  78. package/dist/{catchup-brief-AMBXLHXU.js → catchup-brief-QCKB32YC.js} +18 -17
  79. package/dist/{chunk-PYNWGP72.js → chunk-23O6LHII.js} +1 -1
  80. package/dist/{chunk-VDJUATQJ.js → chunk-27REQ7KR.js} +1 -1
  81. package/dist/{chunk-G4HOMQY7.js → chunk-2AD2GAPC.js} +1 -1
  82. package/dist/{chunk-K3ZHVW26.js → chunk-2N5MLJLM.js} +4 -4
  83. package/dist/{chunk-VALVWYAK.js → chunk-2T6NZLMO.js} +5 -5
  84. package/dist/{chunk-M3NSYVE3.js → chunk-3QLWBLS3.js} +5 -5
  85. package/dist/{chunk-FBSAXAXQ.js → chunk-453QJHGW.js} +3 -3
  86. package/dist/{chunk-QZA5NG6Z.js → chunk-4DZDXS5N.js} +1 -1
  87. package/dist/{chunk-OE6D2IJI.js → chunk-4FHBXWSA.js} +4 -4
  88. package/dist/{chunk-LJGHAZYU.js → chunk-4HMZQRQD.js} +7 -7
  89. package/dist/{chunk-WOKPKILI.js → chunk-5C46Y4AK.js} +1 -1
  90. package/dist/{chunk-DZJL775P.js → chunk-5TBGZK55.js} +1 -1
  91. package/dist/{chunk-I3XN3G3H.js → chunk-5YDNNUZ6.js} +113 -113
  92. package/dist/{chunk-VDKDW5IA.js → chunk-5YXC7GF5.js} +29 -9
  93. package/dist/{chunk-UMK7TNCF.js → chunk-6JQTSKDR.js} +157 -65
  94. package/dist/{chunk-PO64LWTM.js → chunk-6NRY3CFI.js} +9 -9
  95. package/dist/{chunk-3HGAAWNZ.js → chunk-7HO5VMDR.js} +2 -2
  96. package/dist/{chunk-JYFBQH5O.js → chunk-7OPIIYF2.js} +5 -5
  97. package/dist/{chunk-LUQ57SRM.js → chunk-7QRMFYOV.js} +23 -9
  98. package/dist/{chunk-3EMAJBBN.js → chunk-A3YHWWE6.js} +1 -1
  99. package/dist/{chunk-QFGUAJ6T.js → chunk-ADRZXHUB.js} +2 -2
  100. package/dist/{chunk-MT6YGWJ6.js → chunk-AMC2OPYP.js} +1 -1
  101. package/dist/{chunk-CQN4IKRB.js → chunk-BHDOPDPY.js} +8 -2
  102. package/dist/{chunk-F6NABQJ4.js → chunk-CIKFGNES.js} +2 -2
  103. package/dist/{chunk-IMHERTUL.js → chunk-D3DCRA3H.js} +2 -2
  104. package/dist/{chunk-YSTIPPZK.js → chunk-DAODOSH4.js} +1 -1
  105. package/dist/{chunk-IRMJHC23.js → chunk-E3BNUQHW.js} +2 -2
  106. package/dist/{chunk-EYWB6526.js → chunk-E76MXORZ.js} +3 -3
  107. package/dist/{chunk-CNIAEIWV.js → chunk-EFHGK6JP.js} +1 -1
  108. package/dist/{chunk-FM4ZI5ZP.js → chunk-FE6WBI2M.js} +5 -1
  109. package/dist/{chunk-DBDMZTU5.js → chunk-FENYNW52.js} +1 -1
  110. package/dist/{chunk-SUG5P42S.js → chunk-FXE56MAI.js} +4 -4
  111. package/dist/{chunk-2ESYTX6F.js → chunk-GKNWKQFY.js} +1 -1
  112. package/dist/{chunk-DNN27P35.js → chunk-GTZKETSS.js} +4 -4
  113. package/dist/{chunk-FDOURKUO.js → chunk-HYZE3MNS.js} +1 -1
  114. package/dist/{chunk-EWWCMMES.js → chunk-IFSKL5QW.js} +16 -16
  115. package/dist/{chunk-AHR3F7HW.js → chunk-IKYQ2HSH.js} +1 -1
  116. package/dist/{chunk-3T4BRBSH.js → chunk-JORPYG4O.js} +1 -1
  117. package/dist/{chunk-3LQMUO5D.js → chunk-KIMAQNSM.js} +3 -3
  118. package/dist/{chunk-UO56K55W.js → chunk-M7PBRIRH.js} +1 -1
  119. package/dist/{chunk-MESFJRIT.js → chunk-MH5HWMVH.js} +1 -1
  120. package/dist/{chunk-ZK53K7OR.js → chunk-MMOONM6D.js} +1 -1
  121. package/dist/{chunk-VA3ZUIWG.js → chunk-MOZY4IQO.js} +1 -1
  122. package/dist/{chunk-VTMSGELG.js → chunk-MVZLF27P.js} +2 -2
  123. package/dist/{chunk-KWRO4RMT.js → chunk-NAHDJLLB.js} +3 -3
  124. package/dist/{chunk-M722B4DA.js → chunk-NBTSUPTB.js} +1 -1
  125. package/dist/{chunk-2LZMDOC6.js → chunk-NUWAB2ZB.js} +5 -5
  126. package/dist/{chunk-H44V3Y6D.js → chunk-NY6DU5RB.js} +1 -1
  127. package/dist/{chunk-F4ZW76IX.js → chunk-O522M4YZ.js} +1 -1
  128. package/dist/{chunk-PRUZNNEF.js → chunk-O5RXPXDD.js} +3 -3
  129. package/dist/{chunk-7667KFAG.js → chunk-OBWIVRD6.js} +1 -1
  130. package/dist/{chunk-XRX7F7XW.js → chunk-OYEBUJ5W.js} +1 -1
  131. package/dist/{chunk-TQSAPNFW.js → chunk-P3JQDXY6.js} +18 -10
  132. package/dist/{chunk-D74XYSA3.js → chunk-QCQT5RXR.js} +5 -1
  133. package/dist/{chunk-ZY2ABBVR.js → chunk-QNKR7WEL.js} +20 -6
  134. package/dist/{chunk-FJPZ7KHN.js → chunk-R6POL63K.js} +1 -1
  135. package/dist/{chunk-XOVHWGPV.js → chunk-RBRGSOK5.js} +1 -1
  136. package/dist/{chunk-ZYNQXN73.js → chunk-RFKWETK3.js} +4 -4
  137. package/dist/{chunk-Y7637VDZ.js → chunk-RFRUDXOI.js} +2 -2
  138. package/dist/{chunk-4K2PLZKF.js → chunk-SQ4WACH4.js} +1 -1
  139. package/dist/{chunk-ILLBFFY6.js → chunk-SRK5AWVS.js} +2 -2
  140. package/dist/{chunk-VMTKHDFM.js → chunk-SUJFXYMQ.js} +3 -3
  141. package/dist/{chunk-HWK5GKE6.js → chunk-TF5E6O5Q.js} +1 -1
  142. package/dist/{chunk-YJK4JZ35.js → chunk-TIWFOWL6.js} +3 -3
  143. package/dist/{chunk-FAH7JUNS.js → chunk-TRIK7MXS.js} +10 -10
  144. package/dist/{chunk-XDVLCS64.js → chunk-UAKGNQWE.js} +1 -1
  145. package/dist/{chunk-G6IANQKD.js → chunk-UG2R4LHI.js} +1 -1
  146. package/dist/{chunk-4VLRGKNY.js → chunk-UPZQLFRJ.js} +2 -2
  147. package/dist/{chunk-T7ZLJZAO.js → chunk-UUJZAOF3.js} +2 -2
  148. package/dist/{chunk-W7HKGDJO.js → chunk-UXPMDQHP.js} +3 -3
  149. package/dist/{chunk-BRVDGE7N.js → chunk-VC2OE37S.js} +4 -4
  150. package/dist/{chunk-Z7DWUHDP.js → chunk-VRQTOLRH.js} +1 -1
  151. package/dist/{chunk-2BOEUPL6.js → chunk-W3T76WFH.js} +1 -1
  152. package/dist/{chunk-BMTUSSHV.js → chunk-WUMWXU6B.js} +1 -1
  153. package/dist/{chunk-7AD4GSRT.js → chunk-WUNXNNJL.js} +3 -3
  154. package/dist/{chunk-QIALRZZG.js → chunk-X6VEQ7MC.js} +1 -1
  155. package/dist/{chunk-PEVOVM3W.js → chunk-XF2G47JS.js} +3 -3
  156. package/dist/{chunk-W666YWFU.js → chunk-Y6IP4R5M.js} +3 -3
  157. package/dist/{chunk-53VXPGZ2.js → chunk-YF3B3NQF.js} +2 -2
  158. package/dist/chunk-YFLHS7GV.js +58 -0
  159. package/dist/chunk-YMUZWC33.js +8 -0
  160. package/dist/{chunk-7DAJHBFH.js → chunk-YTPCJLEL.js} +1 -1
  161. package/dist/{chunk-JLYQD2XF.js → chunk-ZFR4A5W4.js} +1 -1
  162. package/dist/{cleanup-graph-garbage-5HKGGUS3.js → cleanup-graph-garbage-ON45J7RR.js} +8 -7
  163. package/dist/{cloud-sync-shutdown-2JAEIAW6.js → cloud-sync-shutdown-A2QB74YM.js} +3 -2
  164. package/dist/{co-activation-SYSIFY66.js → co-activation-S2FVGMQP.js} +3 -2
  165. package/dist/{co-occurrence-QZFT5ORJ.js → co-occurrence-VQB6U5ME.js} +6 -5
  166. package/dist/{conversation-entity-extractor-YC3A2ODD.js → conversation-entity-extractor-YF3ZLTEJ.js} +3 -3
  167. package/dist/{crdt-sync-W45AKWCU.js → crdt-sync-2SGCDWC3.js} +1 -1
  168. package/dist/{crm-webhook-ZAGDYWB3.js → crm-webhook-OJFVII6G.js} +2 -2
  169. package/dist/{cto-delegation-gate-PLSICYEK.js → cto-delegation-gate-KNH5TRUS.js} +13 -12
  170. package/dist/{daemon-orchestration-QX3FS4L2.js → daemon-orchestration-VFM2FKGY.js} +18 -17
  171. package/dist/{doc-graph-extractor-NK6CP4LE.js → doc-graph-extractor-DCJMATVZ.js} +6 -5
  172. package/dist/{documents-FGXV6BDL.js → documents-253FGKPI.js} +7 -6
  173. package/dist/{dreaming-YIESEME7.js → dreaming-EFRFVQDZ.js} +17 -16
  174. package/dist/{exe-drift-TLY7MCXW.js → exe-drift-ED7FBS2C.js} +4 -3
  175. package/dist/{exe-export-32J4WPS6.js → exe-export-AVGUGDMJ.js} +9 -8
  176. package/dist/{exe-import-MDEWE325.js → exe-import-ALYVE4XT.js} +9 -8
  177. package/dist/{exe-key-NW42YUA3.js → exe-key-5MDOPRDS.js} +69 -68
  178. package/dist/{exe-snapshot-NNEEAGYI.js → exe-snapshot-ZN523QP6.js} +18 -17
  179. package/dist/{fast-db-init-O7AECNTB.js → fast-db-init-GJGO22F5.js} +1 -1
  180. package/dist/{founder-context-3WDZ6LIS.js → founder-context-JHHFM4GF.js} +2 -2
  181. package/dist/gateway/index.js +9 -8
  182. package/dist/{git-main-guard-UZP3KXYI.js → git-main-guard-TGK3RQY3.js} +1 -1
  183. package/dist/{git-staleness-GEJ7U4MW.js → git-staleness-YPHGWE3B.js} +3 -2
  184. package/dist/{global-procedures-HY3BJXY4.js → global-procedures-HZFQ3WJB.js} +5 -4
  185. package/dist/{graph-auto-extract-DBAIFNDK.js → graph-auto-extract-7OJYYV4G.js} +6 -5
  186. package/dist/{graph-rag-LWKKHY72.js → graph-rag-YFITUAVO.js} +3 -3
  187. package/dist/{hook-prefetch-KNHZNI4L.js → hook-prefetch-ITWBE3XZ.js} +14 -13
  188. package/dist/hooks/bug-report-worker.js +16 -15
  189. package/dist/hooks/codex-stop-task-finalizer.js +17 -16
  190. package/dist/hooks/commit-complete.js +16 -15
  191. package/dist/hooks/error-recall.js +8 -7
  192. package/dist/hooks/exe-heartbeat-hook.js +4 -3
  193. package/dist/hooks/ingest.js +7 -6
  194. package/dist/hooks/instructions-loaded.js +5 -4
  195. package/dist/hooks/manifest.json +19 -19
  196. package/dist/hooks/notification.js +5 -4
  197. package/dist/hooks/post-compact.js +15 -14
  198. package/dist/hooks/post-tool-combined.js +9 -9
  199. package/dist/hooks/pre-compact.js +16 -15
  200. package/dist/hooks/pre-tool-use.js +36 -38
  201. package/dist/hooks/prompt-submit.js +28 -27
  202. package/dist/hooks/session-end.js +20 -19
  203. package/dist/hooks/session-start.js +13 -13
  204. package/dist/hooks/stop.js +19 -18
  205. package/dist/hooks/subagent-stop.js +17 -16
  206. package/dist/hooks/summary-worker.js +20 -19
  207. package/dist/index.js +23 -22
  208. package/dist/{installer-R2S64Q6T.js → installer-3ONNP5JV.js} +6 -5
  209. package/dist/{installer-AWALPCAX.js → installer-CY5PN7TN.js} +6 -5
  210. package/dist/{installer-SQF5I6YS.js → installer-N4QXGINR.js} +6 -5
  211. package/dist/{intercom-queue-SJL4G3J5.js → intercom-queue-RLWMSZHB.js} +13 -12
  212. package/dist/lib/agent-config.js +1 -1
  213. package/dist/lib/cloud-sync.js +11 -10
  214. package/dist/lib/consolidation.js +8 -7
  215. package/dist/lib/database.js +5 -2
  216. package/dist/lib/db-backup.js +2 -1
  217. package/dist/lib/db-checkpoint-worker.js +9 -0
  218. package/dist/lib/db-read-worker-client.js +21 -8
  219. package/dist/lib/db-read-worker.js +15 -0
  220. package/dist/lib/db-write-worker-client.js +4 -1
  221. package/dist/lib/db-write-worker.js +21 -6
  222. package/dist/lib/db.js +5 -2
  223. package/dist/lib/device-registry.js +1 -1
  224. package/dist/lib/employee-templates.js +6 -5
  225. package/dist/lib/employees.js +3 -2
  226. package/dist/lib/exe-daemon.js +211 -71
  227. package/dist/lib/hybrid-search.js +7 -6
  228. package/dist/lib/identity.js +3 -2
  229. package/dist/lib/license.js +2 -2
  230. package/dist/lib/messaging.js +14 -13
  231. package/dist/lib/registry-proxy.js +1 -1
  232. package/dist/lib/reminders.js +4 -3
  233. package/dist/lib/schedules.js +7 -6
  234. package/dist/lib/session-registry.js +5 -4
  235. package/dist/lib/skill-learning.js +8 -7
  236. package/dist/lib/store.js +6 -5
  237. package/dist/lib/task-router.js +4 -3
  238. package/dist/lib/tasks.js +15 -14
  239. package/dist/lib/tmux-routing.js +13 -12
  240. package/dist/lib/token-spend.js +4 -3
  241. package/dist/{license-gate-ZYZQGPKW.js → license-gate-ZRORTAQ2.js} +3 -3
  242. package/dist/{license-sync-GU3L66JR.js → license-sync-CQHBDUQE.js} +2 -2
  243. package/dist/mcp/register-tools.js +68 -67
  244. package/dist/mcp/server.js +69 -68
  245. package/dist/mcp/tools/complete-reminder.js +5 -4
  246. package/dist/mcp/tools/create-reminder.js +5 -4
  247. package/dist/mcp/tools/create-task.js +17 -16
  248. package/dist/mcp/tools/deactivate-behavior.js +9 -8
  249. package/dist/mcp/tools/list-reminders.js +5 -4
  250. package/dist/mcp/tools/list-tasks.js +17 -16
  251. package/dist/mcp/tools/send-message.js +16 -15
  252. package/dist/mcp/tools/update-task.js +16 -15
  253. package/dist/{mcp-http-config-BV2GO7P4.js → mcp-http-config-2A6HKQP5.js} +4 -3
  254. package/dist/{mcp-session-identity-3QQPOGNI.js → mcp-session-identity-YTXFSOWN.js} +13 -12
  255. package/dist/{memory-cards-NISTO4EP.js → memory-cards-CJJJ2EP6.js} +6 -5
  256. package/dist/{memory-graph-extractor-CO3R5K7L.js → memory-graph-extractor-2Z72HN5P.js} +7 -6
  257. package/dist/{memory-poisoning-defense-QZCG3BMC.js → memory-poisoning-defense-WZJ52KXT.js} +3 -2
  258. package/dist/{memory-pressure-watchdog-VWQM3GXR.js → memory-pressure-watchdog-VNKYRODT.js} +14 -13
  259. package/dist/{memory-reflection-G32OQ3X3.js → memory-reflection-LTRHDGUL.js} +3 -2
  260. package/dist/{notification-ledger-C3J4HFMM.js → notification-ledger-OE4XNOAY.js} +14 -13
  261. package/dist/{notifications-JIARMDZ5.js → notifications-DU4WVNET.js} +13 -12
  262. package/dist/{orchestration-events-AL7AWHBX.js → orchestration-events-HAFDPTLV.js} +4 -3
  263. package/dist/{orchestrator-LWVALDUO.js → orchestrator-JRSVEKLB.js} +15 -14
  264. package/dist/{pipeline-router-HK5BI3LQ.js → pipeline-router-4RRX65W7.js} +4 -3
  265. package/dist/{plan-limits-4LMRHOUW.js → plan-limits-5QYYPIPT.js} +6 -5
  266. package/dist/{platform-procedures-G44IYUM2.js → platform-procedures-NBKHO33A.js} +1 -1
  267. package/dist/{projection-worker-Z5U6UWCE.js → projection-worker-PXJZEKFK.js} +2 -2
  268. package/dist/{prospective-memory-UDQWFP5Y.js → prospective-memory-V7LFCPU4.js} +3 -2
  269. package/dist/{reranker-FX4QOK2G.js → reranker-DWNE7KUB.js} +1 -1
  270. package/dist/{retrieval-health-2LIKKDMW.js → retrieval-health-4NCBHUUS.js} +1 -1
  271. package/dist/{review-polling-B2EP4KGE.js → review-polling-K2V34KEA.js} +14 -13
  272. package/dist/runtime/index.js +17 -16
  273. package/dist/{session-events-HVYX42HD.js → session-events-R3WL7J7D.js} +14 -13
  274. package/dist/{session-kill-telemetry-BHKUHSK2.js → session-kill-telemetry-BQSJZ2A7.js} +14 -13
  275. package/dist/{session-scope-TXCBVOSN.js → session-scope-SMYECIDA.js} +13 -12
  276. package/dist/{setup-wizard-QMKBAK6B.js → setup-wizard-BUFVAFWP.js} +1 -1
  277. package/dist/{skill-refinement-G6BPD6QK.js → skill-refinement-VG3UU7MU.js} +4 -3
  278. package/dist/{stack-promote-RSOWO6EY.js → stack-promote-RARBN276.js} +13 -3
  279. package/dist/{stack-release-HGFFFCGC.js → stack-release-OTVTLA6B.js} +464 -169
  280. package/dist/{stack-update-CBP5S5BG.js → stack-update-WBDTJJEF.js} +7 -3
  281. package/dist/{steward-gate-CGP6U7KC.js → steward-gate-CWPD4HEK.js} +4 -3
  282. package/dist/{support-inbox-3ATAP7KN.js → support-inbox-HRIHHKPU.js} +3 -3
  283. package/dist/{task-enforcement-YINAK3T6.js → task-enforcement-RNSASE3R.js} +14 -13
  284. package/dist/{task-scope-5OSP2MUP.js → task-scope-TW3BWFVJ.js} +13 -12
  285. package/dist/{tasks-crud-PTN36B5F.js → tasks-crud-VXCTTSB5.js} +13 -12
  286. package/dist/{tasks-notify-QCJXVZCJ.js → tasks-notify-ETPCCUXG.js} +14 -13
  287. package/dist/{tasks-review-ZY3S65OV.js → tasks-review-TY7OZBAT.js} +13 -12
  288. package/dist/{telemetry-upload-Z47OEELW.js → telemetry-upload-ABCUA2WS.js} +8 -7
  289. package/dist/{token-budget-B3OKOYDA.js → token-budget-SK32GKFZ.js} +4 -3
  290. package/dist/{tool-telemetry-KIHAHUPT.js → tool-telemetry-QJGJAHOC.js} +1 -1
  291. package/dist/tui/App.js +22 -21
  292. package/dist/{tui-data-YIFXHE2D.js → tui-data-XZX7VSG4.js} +13 -12
  293. package/dist/{update-support-IZUWVU2U.js → update-support-Q5HFD4IN.js} +10 -9
  294. package/dist/{work-state-heartbeat-WIURKX3N.js → work-state-heartbeat-MQQOCU54.js} +1 -1
  295. package/dist/{worker-gate-NZRA426F.js → worker-gate-RKHQLE4F.js} +1 -1
  296. package/dist/{workflow-engine-LAB6TGBZ.js → workflow-engine-CXUJIH3R.js} +2 -2
  297. package/dist/{worktree-TBUUZJHY.js → worktree-FJZXHDCJ.js} +5 -4
  298. package/dist/{worktree-sweep-LXDNIZPM.js → worktree-sweep-SW4AG6JR.js} +6 -5
  299. package/package.json +3 -2
  300. package/release-notes.json +46 -65
  301. /package/dist/{chunk-UVPLZ6AK.js → chunk-4N3NTBGJ.js} +0 -0
  302. /package/dist/{chunk-QPNXYGWG.js → chunk-A4X7SCDG.js} +0 -0
  303. /package/dist/{chunk-G4JZ22KK.js → chunk-E42D2E5F.js} +0 -0
  304. /package/dist/{chunk-OG2RT4IY.js → chunk-E77V5MTE.js} +0 -0
  305. /package/dist/{chunk-MDK7E653.js → chunk-ELJSXKYA.js} +0 -0
  306. /package/dist/{chunk-MA22RV3T.js → chunk-FXZRJT3H.js} +0 -0
  307. /package/dist/{chunk-D4UCBR4O.js → chunk-GFIWADEH.js} +0 -0
  308. /package/dist/{chunk-4P7NUL4D.js → chunk-GI3O5MGF.js} +0 -0
  309. /package/dist/{chunk-VBHLE3TR.js → chunk-GPZQZTJB.js} +0 -0
  310. /package/dist/{chunk-FFUEDKYK.js → chunk-H4JKOLXU.js} +0 -0
  311. /package/dist/{chunk-CYI2YR56.js → chunk-QUOMJKVF.js} +0 -0
  312. /package/dist/{chunk-SJLZ53ZR.js → chunk-XF2D4CDA.js} +0 -0
  313. /package/dist/{core-memory-FOW4BCPN.js → core-memory-PCKGCUZU.js} +0 -0
  314. /package/dist/{oauth-server-OR4RAQYM.js → oauth-server-FSKABATB.js} +0 -0
  315. /package/dist/{project-boot-WP54EOAG.js → project-boot-FVSC4VQC.js} +0 -0
  316. /package/dist/{wiki-acl-4DQQCP4V.js → wiki-acl-CW2UALTJ.js} +0 -0
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  createTask
3
- } from "./chunk-LJGHAZYU.js";
3
+ } from "./chunk-4HMZQRQD.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-HWK5GKE6.js";
6
+ } from "./chunk-TF5E6O5Q.js";
7
7
  import {
8
8
  ensureEmployeeAsync,
9
9
  isValidSessionScope,
10
10
  logTaskDispatch,
11
11
  resolveExeSession
12
- } from "./chunk-EWWCMMES.js";
12
+ } from "./chunk-IFSKL5QW.js";
13
13
  import {
14
14
  recordOrchestrationEventBestEffort
15
- } from "./chunk-MT6YGWJ6.js";
15
+ } from "./chunk-AMC2OPYP.js";
16
16
  import {
17
17
  releaseDispatchClaim,
18
18
  tryAcquireDispatchClaim,
@@ -22,16 +22,16 @@ import {
22
22
  import {
23
23
  getAgentRuntime,
24
24
  validateRuntimeModel
25
- } from "./chunk-3EMAJBBN.js";
25
+ } from "./chunk-A3YHWWE6.js";
26
26
  import {
27
27
  getLicenseSync
28
- } from "./chunk-Y7637VDZ.js";
28
+ } from "./chunk-RFRUDXOI.js";
29
29
  import {
30
30
  getAgentContext
31
31
  } from "./chunk-GJV3WDWM.js";
32
32
  import {
33
33
  isCoordinatorName
34
- } from "./chunk-ZY2ABBVR.js";
34
+ } from "./chunk-QNKR7WEL.js";
35
35
 
36
36
  // src/mcp/tools/create-task.ts
37
37
  import { z } from "zod";
@@ -206,6 +206,9 @@ async function inferCoordinatorRootForProject(projectName) {
206
206
  return "";
207
207
  }
208
208
  }
209
+ function sessionBelongsToCoordinator(session, coordName, callerSession) {
210
+ return session.windowName === coordName || session.windowName === callerSession || session.parentExe === coordName || rootFromSessionName(session.windowName) === coordName;
211
+ }
209
212
  var DISPATCH_JOURNAL_ORPHAN_AGE_MS = 6e4;
210
213
  function dispatchJournalDir() {
211
214
  const base = process.env.EXE_OS_DIR || process.env.EXE_MEM_DIR || join(homedir(), ".exe-os");
@@ -296,6 +299,23 @@ async function resolveProjectDir(projectName, callerSession) {
296
299
  if (projectDirMatches(coordDir, projectName)) {
297
300
  return coordDir;
298
301
  }
302
+ const sameScopeCandidates = /* @__PURE__ */ new Set();
303
+ for (const session of sessions) {
304
+ if (!sessionBelongsToCoordinator(session, coordName, callerSession)) continue;
305
+ if (!session.projectDir || !existsSync(session.projectDir)) continue;
306
+ if (registeredProjectDirMatches(session.projectDir, projectName)) {
307
+ sameScopeCandidates.add(session.projectDir);
308
+ }
309
+ }
310
+ const sortedSameScope = [...sameScopeCandidates].sort();
311
+ if (sortedSameScope.length === 1) return sortedSameScope[0];
312
+ if (sortedSameScope.length > 1) {
313
+ process.stderr.write(
314
+ `[create-task] ambiguous same-session project resolution for "${projectName}" in caller scope "${callerSession}": ${sortedSameScope.join(", ")}. Returning null.
315
+ `
316
+ );
317
+ return null;
318
+ }
299
319
  const childUnderCoord = findProjectChildDir(coordDir, projectName);
300
320
  if (childUnderCoord) return childUnderCoord;
301
321
  const workspaceRoot = dirname(coordDir);
@@ -682,7 +702,7 @@ function registerCreateTask(server) {
682
702
  session_scope: sessionScope,
683
703
  created_at: (/* @__PURE__ */ new Date()).toISOString()
684
704
  }), "utf-8");
685
- const { recordOrchestrationEventBestEffort: recordOE } = await import("./orchestration-events-AL7AWHBX.js");
705
+ const { recordOrchestrationEventBestEffort: recordOE } = await import("./orchestration-events-HAFDPTLV.js");
686
706
  recordOE({
687
707
  eventType: "signal.created",
688
708
  source: "create-task.mcp",
@@ -714,7 +734,7 @@ function registerCreateTask(server) {
714
734
  let projectConflictOpts = {};
715
735
  try {
716
736
  const { getClient } = await import("./lib/database.js");
717
- const { sessionScopeFilter } = await import("./task-scope-5OSP2MUP.js");
737
+ const { sessionScopeFilter } = await import("./task-scope-TW3BWFVJ.js");
718
738
  const client = getClient();
719
739
  const scope = sessionScopeFilter(task.sessionScope || callerRoot || exeSession || null);
720
740
  const existing = await client.execute({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadLicense
3
- } from "./chunk-ZK53K7OR.js";
3
+ } from "./chunk-MMOONM6D.js";
4
4
 
5
5
  // src/lib/stack-update.ts
6
6
  import { execFileSync, spawnSync } from "child_process";
@@ -299,6 +299,8 @@ async function rollbackStackUpdate(options) {
299
299
  } catch {
300
300
  }
301
301
  const backupComposeFile = lockData?.backupComposeFile;
302
+ const backupComposeOverrideFile = lockData?.backupComposeOverrideFile;
303
+ const composeOverrideFile = composeOverrideFileFor(options.composeFile);
302
304
  if (!options.serviceName) {
303
305
  try {
304
306
  if (existsSync(options.composeFile)) {
@@ -307,27 +309,41 @@ async function rollbackStackUpdate(options) {
307
309
  } catch {
308
310
  }
309
311
  if (backupComposeFile && existsSync(backupComposeFile)) {
310
- console.log(
311
- `[stack-update] Keeping current (superset) docker-compose.yml for recovery so newly-added services are not dropped; rolling back image tags via .env. Previous compose preserved at ${backupComposeFile}.`
312
- );
312
+ copyFileSync(backupComposeFile, options.composeFile);
313
+ console.log(`[stack-update] Restored docker-compose.yml from ${backupComposeFile}`);
313
314
  } else {
314
315
  console.log("[stack-update] No backed-up docker-compose.yml in lock \u2014 rolling back image tags via .env on the current compose.");
315
316
  }
317
+ try {
318
+ if (backupComposeOverrideFile && existsSync(backupComposeOverrideFile)) {
319
+ copyFileSync(backupComposeOverrideFile, composeOverrideFile);
320
+ console.log(`[stack-update] Restored docker-compose.override.yml from ${backupComposeOverrideFile}`);
321
+ } else if (lockData?.hadComposeOverrideFile === false && existsSync(composeOverrideFile)) {
322
+ rmSync(composeOverrideFile, { force: true });
323
+ console.log("[stack-update] Removed docker-compose.override.yml because it was absent from the pre-update snapshot.");
324
+ }
325
+ } catch (overrideErr) {
326
+ const reason = overrideErr instanceof Error ? overrideErr.message : String(overrideErr);
327
+ console.warn(`[stack-update] Could not restore docker-compose.override.yml (${reason}); continuing rollback.`);
328
+ }
316
329
  }
317
330
  const scopedServiceNames = options.serviceName ? Object.entries(lockData?.services ?? {}).filter(([name, service]) => name === options.serviceName || (service.composeService ?? name) === options.serviceName).map(([name]) => name) : [];
318
331
  const rollbackEnvRaw = readFileSync(rollbackEnv, "utf8");
319
332
  if (scopedServiceNames.length > 0 && lockData?.services) {
320
333
  const rollbackEnvMap = parseEnv(rollbackEnvRaw);
334
+ const scopedEnvKeys = scopedServiceNames.map((serviceName) => lockData.services[serviceName].env).filter((key) => Boolean(key));
335
+ const mutatedEnvKeys = lockData.mutatedEnvKeys ?? [];
336
+ const restoreEnvKeys = [.../* @__PURE__ */ new Set([...scopedEnvKeys, ...mutatedEnvKeys])];
321
337
  const scopedUpdates = Object.fromEntries(
322
- scopedServiceNames.map((serviceName) => lockData.services[serviceName].env).filter((key) => Boolean(key)).map((key) => [key, rollbackEnvMap.get(key) ?? ""])
338
+ restoreEnvKeys.map((key) => [key, rollbackEnvMap.get(key) ?? ""])
323
339
  );
324
- console.log(`[stack-update] Restoring env keys for service ${scopedServiceNames.join(", ")} from ${rollbackEnv}`);
340
+ console.log(`[stack-update] Restoring env keys for service ${scopedServiceNames.join(", ")} from ${rollbackEnv}: ${restoreEnvKeys.join(", ")}`);
325
341
  writeSecretFile(options.envFile, patchEnv(readFileSync(options.envFile, "utf8"), scopedUpdates));
326
342
  } else {
327
343
  console.log(`[stack-update] Restoring env from ${rollbackEnv}`);
328
344
  writeSecretFile(options.envFile, rollbackEnvRaw);
329
345
  }
330
- const composeArgs = ["compose", "--file", options.composeFile, "--env-file", options.envFile];
346
+ const composeArgs = composeArgsForStack(options.composeFile, options.envFile);
331
347
  if (lockData?.services) {
332
348
  for (const [serviceName, service] of Object.entries(lockData.services)) {
333
349
  if (scopedServiceNames.length > 0 && !scopedServiceNames.includes(serviceName)) continue;
@@ -440,6 +456,22 @@ function manifestImagesForPull(release) {
440
456
  Object.values(release.services).map((service) => imagePullRef(service.image.trim())).filter(Boolean)
441
457
  ));
442
458
  }
459
+ var COMPOSE_SIDECARS = {
460
+ // exe-crm-worker uses the same CRM_IMAGE_TAG as exe-crm but is a distinct
461
+ // compose service. Pull/restart it whenever the CRM API image changes so the
462
+ // API and worker cannot drift to different versions. (bug 9e324fd2)
463
+ "exe-crm": ["exe-crm-worker"],
464
+ "exe-erp": ["exe-erp-nginx", "exe-erp-websocket", "exe-erp-queue", "exe-erp-scheduler"]
465
+ };
466
+ function expandComposeServicesWithSidecars(primaryComposeServices) {
467
+ const expanded = [...primaryComposeServices];
468
+ for (const primary of primaryComposeServices) {
469
+ for (const sidecar of COMPOSE_SIDECARS[primary] ?? []) {
470
+ if (!expanded.includes(sidecar)) expanded.push(sidecar);
471
+ }
472
+ }
473
+ return expanded;
474
+ }
443
475
  function cloneReleaseWithServices(release, serviceNames) {
444
476
  const wanted = new Set(serviceNames);
445
477
  const services = {};
@@ -463,6 +495,18 @@ function readStackUpdateLock(lockFile) {
463
495
  function writeStackUpdateLock(lockFile, data) {
464
496
  writeFileSync(lockFile, JSON.stringify(data, null, 2) + "\n");
465
497
  }
498
+ function composeOverrideFileFor(composeFile) {
499
+ return path.join(path.dirname(composeFile), "docker-compose.override.yml");
500
+ }
501
+ function composeArgsForStack(composeFile, envFile, includeOverride = true) {
502
+ const args = ["compose", "--file", composeFile];
503
+ const overrideFile = composeOverrideFileFor(composeFile);
504
+ if (includeOverride && existsSync(overrideFile)) {
505
+ args.push("--file", overrideFile);
506
+ }
507
+ args.push("--env-file", envFile);
508
+ return args;
509
+ }
466
510
  function buildInitialServiceStatus(plan, envRaw, now, activeServices) {
467
511
  const env = parseEnv(envRaw);
468
512
  const at = now().toISOString();
@@ -1017,6 +1061,8 @@ async function resolveStackImageCredentials(options, release) {
1017
1061
  async function verifyManifestImagesAvailable(plan, options) {
1018
1062
  const exec = options.exec ?? defaultExec;
1019
1063
  const images = manifestImagesForPull(plan.release);
1064
+ const maxAttempts = Math.max(1, Math.floor(options.verifyImageMaxAttempts ?? 3));
1065
+ const baseDelayMs = Math.max(0, Math.floor(options.verifyImageRetryBaseDelayMs ?? 1e3));
1020
1066
  let registryForLogout;
1021
1067
  const creds = await resolveStackImageCredentials(options, plan.release);
1022
1068
  if (creds) {
@@ -1024,15 +1070,29 @@ async function verifyManifestImagesAvailable(plan, options) {
1024
1070
  registryForLogout = creds.registry;
1025
1071
  }
1026
1072
  try {
1027
- return images.map((image) => {
1028
- try {
1029
- exec("docker", ["manifest", "inspect", image]);
1030
- return { image, ok: true };
1031
- } catch (err) {
1032
- const reason = err instanceof Error ? err.message : String(err);
1033
- return { image, ok: false, error: reason };
1073
+ const results = [];
1074
+ for (const image of images) {
1075
+ let lastError = "";
1076
+ let ok = false;
1077
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
1078
+ try {
1079
+ exec("docker", ["manifest", "inspect", image]);
1080
+ ok = true;
1081
+ break;
1082
+ } catch (err) {
1083
+ lastError = err instanceof Error ? err.message : String(err);
1084
+ if (attempt < maxAttempts) {
1085
+ const delayMs = baseDelayMs * Math.pow(2, attempt - 1);
1086
+ console.warn(
1087
+ `[stack-update] manifest inspect failed for ${image} (attempt ${attempt}/${maxAttempts}): ${lastError}. Retrying in ${delayMs}ms.`
1088
+ );
1089
+ if (delayMs > 0) await new Promise((resolve) => setTimeout(resolve, delayMs));
1090
+ }
1091
+ }
1034
1092
  }
1035
- });
1093
+ results.push(ok ? { image, ok: true } : { image, ok: false, error: `manifest inspect failed after ${maxAttempts} attempt(s): ${lastError}` });
1094
+ }
1095
+ return results;
1036
1096
  } finally {
1037
1097
  if (registryForLogout) {
1038
1098
  try {
@@ -1058,6 +1118,17 @@ function allServiceList(release) {
1058
1118
  function errorMessage(err) {
1059
1119
  return err instanceof Error ? err.message : String(err);
1060
1120
  }
1121
+ function packagedComposeTemplatePath(options) {
1122
+ return options.composeTemplateFileForUpdate ?? path.join(resolvePackageRoot(), "deploy", "compose", "docker-compose.yml");
1123
+ }
1124
+ function readStagedComposeTemplate(options, currentComposeRaw) {
1125
+ const templatePath = packagedComposeTemplatePath(options);
1126
+ if (!existsSync(templatePath)) {
1127
+ return { raw: currentComposeRaw, templatePath, templateFound: false, shouldRefresh: false };
1128
+ }
1129
+ const raw = readFileSync(templatePath, "utf8");
1130
+ return { raw, templatePath, templateFound: true, shouldRefresh: raw !== currentComposeRaw };
1131
+ }
1061
1132
  async function assertPreDeployImagesPullable(plan, options) {
1062
1133
  let results;
1063
1134
  try {
@@ -1238,6 +1309,18 @@ function backupStackConfig(stackDir, composeFile, envRaw, now = () => /* @__PURE
1238
1309
  } catch {
1239
1310
  backupComposeFile = void 0;
1240
1311
  }
1312
+ const composeOverrideFile = composeOverrideFileFor(composeFile);
1313
+ const hadComposeOverrideFile = existsSync(composeOverrideFile);
1314
+ let backupComposeOverrideFile;
1315
+ try {
1316
+ if (hadComposeOverrideFile) {
1317
+ backupComposeOverrideFile = path.join(updateBackupDir, "docker-compose.override.yml.bak");
1318
+ copyFileSync(composeOverrideFile, backupComposeOverrideFile);
1319
+ copyFileSync(composeOverrideFile, path.join(updateBackupDir, "docker-compose.override.yml"));
1320
+ }
1321
+ } catch {
1322
+ backupComposeOverrideFile = void 0;
1323
+ }
1241
1324
  for (const f of [...PROTECTED_CONFIG_FILES, ...BOOTSTRAP_OVERWRITTEN_CONFIG_FILES]) {
1242
1325
  const src = path.join(stackDir, f);
1243
1326
  try {
@@ -1271,7 +1354,7 @@ function backupStackConfig(stackDir, composeFile, envRaw, now = () => /* @__PURE
1271
1354
  } catch {
1272
1355
  }
1273
1356
  console.log(`[stack-update] Config backed up to ${updateBackupDir}`);
1274
- return { updateBackupDir, backupEnvFile, backupComposeFile };
1357
+ return { updateBackupDir, backupEnvFile, backupComposeFile, backupComposeOverrideFile, hadComposeOverrideFile };
1275
1358
  }
1276
1359
  function installDockerUbuntu(exec) {
1277
1360
  if (process.platform !== "linux") throw new Error("Docker auto-install is only supported on Linux. Install Docker manually, then retry.");
@@ -1643,7 +1726,7 @@ function hardenSsh(exec, result) {
1643
1726
  }
1644
1727
  function areStackContainersRunning(composeFile, envFile) {
1645
1728
  try {
1646
- const result = spawnSync("docker", ["compose", "--file", composeFile, "--env-file", envFile, "ps", "-q"], {
1729
+ const result = spawnSync("docker", [...composeArgsForStack(composeFile, envFile), "ps", "-q"], {
1647
1730
  stdio: ["pipe", "pipe", "pipe"],
1648
1731
  timeout: 15e3
1649
1732
  });
@@ -1854,6 +1937,7 @@ async function runStackUpdate(options) {
1854
1937
  const scopedServiceNames = options.serviceName ? [options.serviceName] : resumeServices;
1855
1938
  const effectiveTargetVersion = options.targetVersion ?? resumeLock?.stackVersion;
1856
1939
  const composeRaw = readFileSync(options.composeFile, "utf8");
1940
+ const stagedCompose = readStagedComposeTemplate(options, composeRaw);
1857
1941
  const plan = createStackUpdatePlan(manifest, envRaw, effectiveTargetVersion, scopedServiceNames, serviceSelection, composeRaw);
1858
1942
  const fullTargetPlan = scopedServiceNames.length > 0 ? createStackUpdatePlan(manifest, envRaw, effectiveTargetVersion, void 0, serviceSelection, composeRaw) : plan;
1859
1943
  assertRolloutStageAllowed(plan, {
@@ -1862,7 +1946,20 @@ async function runStackUpdate(options) {
1862
1946
  });
1863
1947
  assertBreakingChangesAllowed(plan, options.allowedBreakingChangeIds ?? []);
1864
1948
  assertDeploymentScopeAllowed(plan, options.deploymentPersona ?? "customer");
1865
- const plannedEnvRaw = patchEnv(envRaw, Object.fromEntries(plan.changes.map((c) => [c.key, c.after])));
1949
+ const requiredEnvValidation = options.dryRun ? { derived: {}, unresolvable: [] } : detectMissingRequiredEnvVars(stagedCompose.raw, envRaw);
1950
+ const migratedEnvVars = requiredEnvValidation.derived;
1951
+ if (requiredEnvValidation.unresolvable.length > 0) {
1952
+ const lines = requiredEnvValidation.unresolvable.map((r) => ` - ${r.key}${r.message ? ` (${r.message})` : ""}`);
1953
+ throw new Error(
1954
+ `Stack update aborted before any changes: the updated compose template requires env vars that are missing from ${options.envFile} and cannot be derived automatically.
1955
+ Set these in ${options.envFile}, then re-run stack-update:
1956
+ ${lines.join("\n")}`
1957
+ );
1958
+ }
1959
+ const plannedEnvRaw = patchEnv(envRaw, {
1960
+ ...migratedEnvVars,
1961
+ ...Object.fromEntries(plan.changes.map((c) => [c.key, c.after]))
1962
+ });
1866
1963
  assertProductionDeployGate(plan, plannedEnvRaw, composeRaw, {
1867
1964
  breakGlassReason: options.breakGlassReason,
1868
1965
  breakGlassAuditFile: options.breakGlassAuditFile,
@@ -1907,13 +2004,13 @@ async function runStackUpdate(options) {
1907
2004
  const updateBackupDir = configBackup.updateBackupDir;
1908
2005
  const backupEnvFile = configBackup.backupEnvFile;
1909
2006
  const backupComposeFile = configBackup.backupComposeFile;
2007
+ const backupComposeOverrideFile = configBackup.backupComposeOverrideFile;
2008
+ const hadComposeOverrideFile = configBackup.hadComposeOverrideFile;
1910
2009
  try {
1911
- const templateCompose = path.join(resolvePackageRoot(), "deploy", "compose", "docker-compose.yml");
1912
- if (existsSync(templateCompose)) {
1913
- const templateRaw = readFileSync(templateCompose, "utf8");
1914
- if (templateRaw !== composeRaw) {
2010
+ if (stagedCompose.templateFound) {
2011
+ if (stagedCompose.shouldRefresh) {
1915
2012
  const tmpCompose = `${options.composeFile}.tmp-${process.pid}`;
1916
- writeFileSync(tmpCompose, templateRaw, { mode: 420 });
2013
+ writeFileSync(tmpCompose, stagedCompose.raw, { mode: 420 });
1917
2014
  renameSync(tmpCompose, options.composeFile);
1918
2015
  console.log(
1919
2016
  `[stack-update] Refreshed docker-compose.yml from packaged template (old saved to ${path.join(updateBackupDir, "docker-compose.yml")}). Customer overrides should live in docker-compose.override.yml.`
@@ -1921,44 +2018,19 @@ async function runStackUpdate(options) {
1921
2018
  }
1922
2019
  } else {
1923
2020
  console.warn(
1924
- `[stack-update] Packaged compose template not found at ${templateCompose}; keeping existing docker-compose.yml. Shipped compose fixes will not apply.`
2021
+ `[stack-update] Packaged compose template not found at ${stagedCompose.templatePath}; keeping existing docker-compose.yml. Shipped compose fixes will not apply.`
1925
2022
  );
1926
2023
  }
1927
2024
  } catch (err) {
1928
2025
  const reason = err instanceof Error ? err.message : String(err);
1929
2026
  console.warn(`[stack-update] Could not refresh docker-compose.yml (${reason}); using existing compose.`);
1930
2027
  }
1931
- let migratedEnvVars = {};
1932
- try {
1933
- const refreshedComposeRaw = readFileSync(options.composeFile, "utf8");
1934
- const { derived, unresolvable } = detectMissingRequiredEnvVars(refreshedComposeRaw, envRaw);
1935
- if (unresolvable.length > 0) {
1936
- const lines = unresolvable.map((r) => ` - ${r.key}${r.message ? ` (${r.message})` : ""}`);
1937
- throw new Error(
1938
- `Stack update aborted before any changes: the updated compose template requires env vars that are missing from ${options.envFile} and cannot be derived automatically.
1939
- Set these in ${options.envFile}, then re-run stack-update:
1940
- ${lines.join("\n")}`
1941
- );
1942
- }
1943
- migratedEnvVars = derived;
1944
- if (Object.keys(derived).length > 0) {
1945
- console.log(
1946
- `[stack-update] Migrating ${Object.keys(derived).length} newly-required env var(s) into ${options.envFile} with derived defaults: ${Object.keys(derived).join(", ")}`
1947
- );
1948
- }
1949
- } catch (err) {
1950
- throw err instanceof Error ? err : new Error(String(err));
2028
+ if (Object.keys(migratedEnvVars).length > 0) {
2029
+ console.log(
2030
+ `[stack-update] Migrating ${Object.keys(migratedEnvVars).length} newly-required env var(s) into ${options.envFile} with derived defaults: ${Object.keys(migratedEnvVars).join(", ")}`
2031
+ );
1951
2032
  }
1952
2033
  const initialServiceStatus = options.resume && resumeLock?.serviceStatus ? resumeLock.serviceStatus : buildInitialServiceStatus(fullTargetPlan, envRaw, now, new Set(Object.keys(plan.release.services)));
1953
- writeStackUpdateLock(lockFile, {
1954
- stackVersion: plan.targetVersion,
1955
- previousVersion,
1956
- updatedAt: now().toISOString(),
1957
- backupEnvFile: resumeLock?.backupEnvFile ?? backupEnvFile,
1958
- backupComposeFile: resumeLock?.backupComposeFile ?? backupComposeFile,
1959
- services: { ...fullTargetPlan.release.services, ...resumeLock?.services ?? {}, ...plan.release.services },
1960
- serviceStatus: initialServiceStatus
1961
- });
1962
2034
  try {
1963
2035
  const { spawnSync: sp } = await import("child_process");
1964
2036
  const backupSh = path.join(stackDir, "backup.sh");
@@ -2003,6 +2075,19 @@ ${lines.join("\n")}`
2003
2075
  if (overrideResolution.warn) console.warn(overrideResolution.notice);
2004
2076
  else console.log(overrideResolution.notice);
2005
2077
  }
2078
+ const mutatedEnvKeys = Object.keys(updates);
2079
+ writeStackUpdateLock(lockFile, {
2080
+ stackVersion: plan.targetVersion,
2081
+ previousVersion,
2082
+ updatedAt: now().toISOString(),
2083
+ backupEnvFile: resumeLock?.backupEnvFile ?? backupEnvFile,
2084
+ backupComposeFile: resumeLock?.backupComposeFile ?? backupComposeFile,
2085
+ backupComposeOverrideFile: resumeLock?.backupComposeOverrideFile ?? backupComposeOverrideFile,
2086
+ hadComposeOverrideFile: resumeLock?.hadComposeOverrideFile ?? hadComposeOverrideFile,
2087
+ mutatedEnvKeys: [.../* @__PURE__ */ new Set([...resumeLock?.mutatedEnvKeys ?? [], ...mutatedEnvKeys])],
2088
+ services: { ...fullTargetPlan.release.services, ...resumeLock?.services ?? {}, ...plan.release.services },
2089
+ serviceStatus: initialServiceStatus
2090
+ });
2006
2091
  const patched = patchEnv(envRaw, updates);
2007
2092
  const tmp = `${options.envFile}.tmp-${process.pid}`;
2008
2093
  writeSecretFile(tmp, patched);
@@ -2010,7 +2095,7 @@ ${lines.join("\n")}`
2010
2095
  for (const serviceName of Object.keys(plan.release.services)) {
2011
2096
  updateServiceStatus(lockFile, serviceName, "env_patched", now);
2012
2097
  }
2013
- const composeArgs = ["compose", "--file", options.composeFile, "--env-file", options.envFile];
2098
+ const composeArgs = composeArgsForStack(options.composeFile, options.envFile);
2014
2099
  let registryForLogout;
2015
2100
  try {
2016
2101
  let credsLogged = false;
@@ -2102,7 +2187,9 @@ Push the missing image(s) to the registry, or re-run with --break-glass <reason>
2102
2187
  );
2103
2188
  }
2104
2189
  }
2105
- const composePullTargets = Object.entries(plan.release.services).map(([name, svc]) => svc.composeService ?? name);
2190
+ const composePullTargets = expandComposeServicesWithSidecars(
2191
+ Object.entries(plan.release.services).map(([name, svc]) => svc.composeService ?? name)
2192
+ );
2106
2193
  try {
2107
2194
  if (composePullTargets.length > 0) {
2108
2195
  exec("docker", [...composeArgs, "pull", ...composePullTargets]);
@@ -2214,16 +2301,8 @@ Push the missing image(s) to the registry, or re-run with --break-glass <reason>
2214
2301
  "cloudflared"
2215
2302
  // tunnel — restarted last so services are healthy before it connects
2216
2303
  ];
2217
- const COMPOSE_SIDECARS = {
2218
- "exe-erp": ["exe-erp-nginx", "exe-erp-websocket", "exe-erp-queue", "exe-erp-scheduler"]
2219
- };
2220
2304
  const primaryComposeServices = Object.entries(plan.release.services).map(([serviceName, service]) => service.composeService ?? serviceName);
2221
- const scopedComposeServices = [...primaryComposeServices];
2222
- for (const primary of primaryComposeServices) {
2223
- for (const sidecar of COMPOSE_SIDECARS[primary] ?? []) {
2224
- if (!scopedComposeServices.includes(sidecar)) scopedComposeServices.push(sidecar);
2225
- }
2226
- }
2305
+ const scopedComposeServices = expandComposeServicesWithSidecars(primaryComposeServices);
2227
2306
  const restartOrder = [
2228
2307
  ...RESTART_ORDER.filter((service) => scopedComposeServices.includes(service)),
2229
2308
  ...scopedComposeServices.filter((service) => !RESTART_ORDER.includes(service))
@@ -2389,7 +2468,18 @@ Fix these before the stack is safe to operate.`);
2389
2468
  progress.logOverallSummary();
2390
2469
  printPhaseSummary();
2391
2470
  const finalLock = readStackUpdateLock(lockFile) ?? {};
2392
- writeStackUpdateLock(lockFile, { ...finalLock, stackVersion: plan.targetVersion, previousVersion, updatedAt: now().toISOString(), backupEnvFile: finalLock.backupEnvFile ?? backupEnvFile, services: { ...fullTargetPlan.release.services, ...finalLock.services ?? {}, ...plan.release.services } });
2471
+ writeStackUpdateLock(lockFile, {
2472
+ ...finalLock,
2473
+ stackVersion: plan.targetVersion,
2474
+ previousVersion,
2475
+ updatedAt: now().toISOString(),
2476
+ backupEnvFile: finalLock.backupEnvFile ?? backupEnvFile,
2477
+ backupComposeFile: finalLock.backupComposeFile ?? backupComposeFile,
2478
+ backupComposeOverrideFile: finalLock.backupComposeOverrideFile ?? backupComposeOverrideFile,
2479
+ hadComposeOverrideFile: finalLock.hadComposeOverrideFile ?? hadComposeOverrideFile,
2480
+ mutatedEnvKeys: finalLock.mutatedEnvKeys ?? mutatedEnvKeys,
2481
+ services: { ...fullTargetPlan.release.services, ...finalLock.services ?? {}, ...plan.release.services }
2482
+ });
2393
2483
  await postDeployAudit(options, "success", plan.targetVersion, previousVersion, void 0, { changes: plan.changes.length });
2394
2484
  return { status: "updated", targetVersion: plan.targetVersion, changes: plan.changes, backupEnvFile, lockFile, serviceStatus: readStackUpdateLock(lockFile)?.serviceStatus };
2395
2485
  } catch (err) {
@@ -2926,6 +3016,8 @@ export {
2926
3016
  buildReleaseMigrationArgs,
2927
3017
  runReleaseMigrations,
2928
3018
  isExecFormMigration,
3019
+ expandComposeServicesWithSidecars,
3020
+ composeArgsForStack,
2929
3021
  parseStackManifest,
2930
3022
  loadStackManifest,
2931
3023
  parseEnv,
@@ -9,7 +9,7 @@ import {
9
9
  buildSystemStateExclusionFilter,
10
10
  buildWikiScopeFilter,
11
11
  searchMemories
12
- } from "./chunk-TQSAPNFW.js";
12
+ } from "./chunk-P3JQDXY6.js";
13
13
  import {
14
14
  blobToVector
15
15
  } from "./chunk-OTVEIJUQ.js";
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-GJV3WDWM.js";
23
23
  import {
24
24
  getClient
25
- } from "./chunk-ZY2ABBVR.js";
25
+ } from "./chunk-QNKR7WEL.js";
26
26
 
27
27
  // src/lib/memory-reads.ts
28
28
  import crypto from "crypto";
@@ -564,7 +564,7 @@ async function hybridSearch(queryText, agentId, options) {
564
564
  let rerankerAvailable = false;
565
565
  if (process.env.EXE_IS_DAEMON === "1") {
566
566
  try {
567
- const { isRerankerAvailable } = await import("./reranker-FX4QOK2G.js");
567
+ const { isRerankerAvailable } = await import("./reranker-DWNE7KUB.js");
568
568
  rerankerAvailable = isRerankerAvailable();
569
569
  } catch {
570
570
  }
@@ -633,7 +633,7 @@ async function hybridSearch(queryText, agentId, options) {
633
633
  ]).catch(() => []),
634
634
  includeStructuredCards ? (async () => {
635
635
  try {
636
- const { searchMemoryCards } = await import("./memory-cards-NISTO4EP.js");
636
+ const { searchMemoryCards } = await import("./memory-cards-CJJJ2EP6.js");
637
637
  return await searchMemoryCards(effectiveQuery, agentId, fetchOptions);
638
638
  } catch {
639
639
  return [];
@@ -642,7 +642,7 @@ async function hybridSearch(queryText, agentId, options) {
642
642
  // Reflection insights: patterns, contradictions, summaries across sessions
643
643
  includeStructuredCards ? (async () => {
644
644
  try {
645
- const { searchReflections } = await import("./memory-reflection-G32OQ3X3.js");
645
+ const { searchReflections } = await import("./memory-reflection-LTRHDGUL.js");
646
646
  const insights = await searchReflections(effectiveQuery, agentId, 5, {
647
647
  includeArchived: options?.includeArchived
648
648
  });
@@ -767,7 +767,7 @@ async function hybridSearch(queryText, agentId, options) {
767
767
  try {
768
768
  let rerankedRecords;
769
769
  if (graphContextMap.size > 0) {
770
- const { rerankWithContext } = await import("./reranker-FX4QOK2G.js");
770
+ const { rerankWithContext } = await import("./reranker-DWNE7KUB.js");
771
771
  const candidates = merged.map((m) => ({
772
772
  text: m.raw_text,
773
773
  context: graphContextMap.get(m.id)
@@ -775,7 +775,7 @@ async function hybridSearch(queryText, agentId, options) {
775
775
  const scored = await rerankWithContext(effectiveQuery, candidates, rerankReturnLimit);
776
776
  rerankedRecords = scored.map((s) => merged[s.index]);
777
777
  } else {
778
- const { rerank } = await import("./reranker-FX4QOK2G.js");
778
+ const { rerank } = await import("./reranker-DWNE7KUB.js");
779
779
  rerankedRecords = await rerank(effectiveQuery, merged, rerankReturnLimit);
780
780
  }
781
781
  if (rerankedRecords.length > 0) {
@@ -1169,7 +1169,7 @@ async function lightweightSearch(queryText, agentId, options) {
1169
1169
  }
1170
1170
  if (results.length >= 2) {
1171
1171
  try {
1172
- const { recordCoActivations } = await import("./co-activation-SYSIFY66.js");
1172
+ const { recordCoActivations } = await import("./co-activation-S2FVGMQP.js");
1173
1173
  const ids = results.slice(0, 10).map((r) => r.id);
1174
1174
  void recordCoActivations(ids).catch((e) => {
1175
1175
  try {
@@ -1185,7 +1185,7 @@ async function lightweightSearch(queryText, agentId, options) {
1185
1185
  }
1186
1186
  if (options?.includeStructuredCards !== true) return results;
1187
1187
  try {
1188
- const { searchMemoryCards } = await import("./memory-cards-NISTO4EP.js");
1188
+ const { searchMemoryCards } = await import("./memory-cards-CJJJ2EP6.js");
1189
1189
  const cardResults = await searchMemoryCards(queryText, agentId, options);
1190
1190
  if (cardResults.length > 0) {
1191
1191
  return rrfMergeMulti([results, cardResults], limit, RRF_K, [1, 0.85]);
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  createCRMWebhookHandler,
12
12
  parseTwentyWebhook
13
- } from "./chunk-Z7DWUHDP.js";
13
+ } from "./chunk-VRQTOLRH.js";
14
14
  import {
15
15
  WhatsAppAdapter
16
16
  } from "./chunk-WSOA3WMC.js";
@@ -42,7 +42,7 @@ import {
42
42
  retryWithBackoff,
43
43
  routeMessage,
44
44
  validateGatewayConfig
45
- } from "./chunk-53VXPGZ2.js";
45
+ } from "./chunk-YF3B3NQF.js";
46
46
  import {
47
47
  OllamaProvider
48
48
  } from "./chunk-FWFFZGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MultiAgentOrchestrator
3
- } from "./chunk-PEVOVM3W.js";
3
+ } from "./chunk-XF2G47JS.js";
4
4
  import {
5
5
  createTokenBudgetMiddleware
6
- } from "./chunk-BMTUSSHV.js";
6
+ } from "./chunk-WUMWXU6B.js";
7
7
  import {
8
8
  createQuietRenderer,
9
9
  createTerminalRenderer,
@@ -209,7 +209,7 @@ function createExeOSHooks(config) {
209
209
  );
210
210
  }
211
211
  try {
212
- const { listBehaviors } = await import("./behaviors-G7TR6LBM.js");
212
+ const { listBehaviors } = await import("./behaviors-3DQM4PSA.js");
213
213
  const behaviors = await listBehaviors(config.agentId, config.projectName, 12);
214
214
  if (behaviors.length > 0) {
215
215
  process.stderr.write(
@@ -330,7 +330,7 @@ function createExeOSHooks(config) {
330
330
  async onSubagentStop(_reason) {
331
331
  try {
332
332
  const { getClient } = await import("./lib/database.js");
333
- const { sessionScopeFilter } = await import("./task-scope-5OSP2MUP.js");
333
+ const { sessionScopeFilter } = await import("./task-scope-TW3BWFVJ.js");
334
334
  const client = getClient();
335
335
  const ehScope = sessionScopeFilter();
336
336
  const tasks = await client.execute({
@@ -422,7 +422,7 @@ function createExeOSHooks(config) {
422
422
  try {
423
423
  const { writeMemory, flushBatch } = await import("./lib/store.js");
424
424
  const { getClient } = await import("./lib/database.js");
425
- const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-5OSP2MUP.js");
425
+ const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-TW3BWFVJ.js");
426
426
  const client = getClient();
427
427
  const cpScope = cpScopeFilter();
428
428
  const tasks = await client.execute({