@askexenow/exe-os 0.9.239 → 0.9.244

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 (319) hide show
  1. package/deploy/compose/.env.customer.example +12 -0
  2. package/deploy/compose/.env.example +13 -1
  3. package/deploy/compose/cloudflared/config.yml.example +29 -5
  4. package/deploy/compose/docker-compose.yml +27 -7
  5. package/deploy/compose/generate-env.ts +49 -1
  6. package/deploy/compose/init-db.sql +10 -2
  7. package/deploy/stack-manifests/v0.9.json +113 -9
  8. package/dist/{active-agent-7MIVNARP.js → active-agent-KO4ZWDXE.js} +4 -4
  9. package/dist/{active-agent-55C5Y3XL.js → active-agent-KP2O52HA.js} +4 -4
  10. package/dist/{agentic-ontology-NCAQIQQI.js → agentic-ontology-DXE5J6I5.js} +1 -1
  11. package/dist/{backfill-metadata-3JP7EZ2U.js → backfill-metadata-DFTIGPXP.js} +7 -7
  12. package/dist/{background-jobs-RWL46VRD.js → background-jobs-CRXY7T4Y.js} +2 -2
  13. package/dist/{behaviors-6BGALYGW.js → behaviors-BL3QCHBT.js} +4 -4
  14. package/dist/bin/age-ontology-load.js +2 -2
  15. package/dist/bin/agentic-ontology-backfill.js +9 -9
  16. package/dist/bin/agentic-reflection-backfill.js +10 -10
  17. package/dist/bin/agentic-semantic-label.js +9 -9
  18. package/dist/bin/backfill-conversations.js +9 -9
  19. package/dist/bin/backfill-responses.js +9 -9
  20. package/dist/bin/backfill-vectors.js +11 -11
  21. package/dist/bin/bulk-sync-postgres.js +10 -10
  22. package/dist/bin/cc-doctor.js +3 -3
  23. package/dist/bin/cleanup-stale-review-tasks.js +13 -13
  24. package/dist/bin/cli.js +27 -22
  25. package/dist/bin/exe-agent-config.js +4 -4
  26. package/dist/bin/exe-agent.js +8 -8
  27. package/dist/bin/exe-assign.js +11 -11
  28. package/dist/bin/exe-boot.js +22 -22
  29. package/dist/bin/exe-call.js +5 -5
  30. package/dist/bin/exe-cloud.js +8 -8
  31. package/dist/bin/exe-dispatch.js +13 -13
  32. package/dist/bin/exe-doctor.js +1 -1
  33. package/dist/bin/exe-export-behaviors.js +10 -10
  34. package/dist/bin/exe-forget.js +9 -9
  35. package/dist/bin/exe-gateway.js +8 -8
  36. package/dist/bin/exe-healthcheck.js +3 -3
  37. package/dist/bin/exe-heartbeat.js +13 -13
  38. package/dist/bin/exe-kill.js +18 -18
  39. package/dist/bin/exe-launch-agent.js +22 -22
  40. package/dist/bin/exe-new-employee.js +8 -8
  41. package/dist/bin/exe-pending-messages.js +14 -14
  42. package/dist/bin/exe-pending-notifications.js +13 -13
  43. package/dist/bin/exe-pending-reviews.js +13 -13
  44. package/dist/bin/exe-rename.js +5 -5
  45. package/dist/bin/exe-review.js +17 -17
  46. package/dist/bin/exe-search.js +8 -8
  47. package/dist/bin/exe-session-cleanup.js +20 -20
  48. package/dist/bin/exe-settings.js +7 -7
  49. package/dist/bin/exe-start-codex.js +14 -14
  50. package/dist/bin/exe-start-opencode.js +11 -11
  51. package/dist/bin/exe-status.js +14 -14
  52. package/dist/bin/exe-support.js +3 -3
  53. package/dist/bin/exe-team.js +4 -4
  54. package/dist/bin/git-sweep.js +13 -13
  55. package/dist/bin/graph-backfill.js +8 -8
  56. package/dist/bin/graph-export.js +8 -8
  57. package/dist/bin/import-history.js +10 -10
  58. package/dist/bin/install.js +7 -7
  59. package/dist/bin/intercom-check.js +4 -4
  60. package/dist/bin/mcp-sessions.js +2 -2
  61. package/dist/bin/orchestration-metrics.js +5 -5
  62. package/dist/bin/postgres-agentic-reflection-backfill.js +4 -4
  63. package/dist/bin/postgres-agentic-semantic-backfill.js +3 -3
  64. package/dist/bin/registry-proxy.js +1 -1
  65. package/dist/bin/scan-tasks.js +13 -13
  66. package/dist/bin/setup.js +3 -3
  67. package/dist/bin/shard-migrate.js +8 -8
  68. package/dist/bin/stack-update.js +348 -20
  69. package/dist/bin/verify-stack.js +3 -383
  70. package/dist/bin/vps-backup.js +8 -160
  71. package/dist/bin/vps-health-gate.js +10 -220
  72. package/dist/{branding-I7YYX4FM.js → branding-XWMO5EDR.js} +1 -1
  73. package/dist/{capacity-monitor-IFCZKRPG.js → capacity-monitor-4CSBC7AP.js} +14 -14
  74. package/dist/{catchup-brief-PIDRWXOW.js → catchup-brief-LF5Z6Q6E.js} +17 -17
  75. package/dist/{chunk-FGJUGDNM.js → chunk-222SI7QC.js} +14 -14
  76. package/dist/{chunk-JZMVLAZ2.js → chunk-2WBBVEIB.js} +1 -1
  77. package/dist/{chunk-JDOE33C2.js → chunk-3V53HH5T.js} +4 -4
  78. package/dist/{chunk-2KZSKURT.js → chunk-57SULZJ2.js} +3 -3
  79. package/dist/{chunk-QI4IXJN7.js → chunk-5CHYEKMH.js} +7 -4
  80. package/dist/chunk-5DMAMQNU.js +168 -0
  81. package/dist/{chunk-PLQAFB3Z.js → chunk-5JIG2FP2.js} +1 -1
  82. package/dist/{chunk-UWQ3XCDG.js → chunk-5WK7X5CF.js} +2 -2
  83. package/dist/{chunk-DDPAQ4LT.js → chunk-6JAGJN77.js} +2 -2
  84. package/dist/{chunk-7F37NMKB.js → chunk-73UE2PHT.js} +1 -1
  85. package/dist/{chunk-JL3K5OTS.js → chunk-7IZWLMTP.js} +1 -1
  86. package/dist/{chunk-ELRRL2NC.js → chunk-A4K2ZT6N.js} +4 -4
  87. package/dist/{chunk-GWYADLIW.js → chunk-AHXEU5XB.js} +1 -1
  88. package/dist/{chunk-WSHMBME6.js → chunk-AWRL5FGM.js} +19 -78
  89. package/dist/{chunk-OMPCFLWA.js → chunk-BSPOEYAO.js} +1 -1
  90. package/dist/{chunk-F4TCKCKK.js → chunk-BYCNUKII.js} +47 -12
  91. package/dist/{chunk-DHVC4RN7.js → chunk-CBDPEJOR.js} +5 -5
  92. package/dist/{chunk-2H55BIV2.js → chunk-CEJO7244.js} +2 -2
  93. package/dist/{chunk-FKWZVO2T.js → chunk-CPXGLSIL.js} +3 -3
  94. package/dist/{chunk-HX5G4AS4.js → chunk-CWITU7DW.js} +2 -2
  95. package/dist/{chunk-5GG7MTRJ.js → chunk-DGBGIXCC.js} +4 -4
  96. package/dist/{chunk-IQXPMK46.js → chunk-DLZYAYVM.js} +60 -14
  97. package/dist/{chunk-PPYWQV2M.js → chunk-DR5BGWFR.js} +2 -2
  98. package/dist/{chunk-BZWKTFEB.js → chunk-ENVRFBTB.js} +2 -2
  99. package/dist/{chunk-DUVO2PUJ.js → chunk-F3GM6OOP.js} +4 -4
  100. package/dist/{chunk-HNLPLLE6.js → chunk-F7JLZXHC.js} +60 -26
  101. package/dist/{chunk-AL4DRC5H.js → chunk-FFLILAG6.js} +1 -1
  102. package/dist/{chunk-BZNI4OK5.js → chunk-GHEWRYMY.js} +18 -2
  103. package/dist/{chunk-C7SFJO5F.js → chunk-GHT4REOS.js} +5 -5
  104. package/dist/{chunk-FBWUJEXS.js → chunk-HANG6NLF.js} +4 -6
  105. package/dist/{chunk-5NJ4A4ZA.js → chunk-HCBMPZDT.js} +1 -1
  106. package/dist/chunk-HOGTZLVU.js +244 -0
  107. package/dist/{chunk-IQSCZDBQ.js → chunk-I5PIBL56.js} +3 -3
  108. package/dist/chunk-IRHNV4GY.js +388 -0
  109. package/dist/{chunk-4HROS3GJ.js → chunk-IZVKWBIP.js} +1 -1
  110. package/dist/{chunk-DKI5BTBC.js → chunk-J7V7LPPX.js} +2 -2
  111. package/dist/{chunk-TOZ5NN5V.js → chunk-JLKUVK5J.js} +1 -1
  112. package/dist/{chunk-4SC65UBG.js → chunk-JLNXKG3K.js} +1 -1
  113. package/dist/{chunk-KVSQOG3W.js → chunk-K2BDE2B5.js} +4 -4
  114. package/dist/{chunk-KDJRFJDL.js → chunk-K333WOW4.js} +30 -2
  115. package/dist/{chunk-6LBCUA2A.js → chunk-KEZXW3RP.js} +1 -1
  116. package/dist/{chunk-W7G3GY4I.js → chunk-KLQI7QY4.js} +3 -3
  117. package/dist/{chunk-UODVZGBQ.js → chunk-KN7LPTIB.js} +1 -1
  118. package/dist/{chunk-ESKBZN4Q.js → chunk-L4WRH3DL.js} +1 -1
  119. package/dist/{chunk-VFQKKMKE.js → chunk-LAOB5BKV.js} +2 -2
  120. package/dist/{chunk-MAN5LZQ4.js → chunk-LQSFP2BV.js} +1 -1
  121. package/dist/{chunk-EJ7LOTV2.js → chunk-LSFHEMVI.js} +9 -9
  122. package/dist/{chunk-RA2RO27E.js → chunk-MCESA5UW.js} +2 -2
  123. package/dist/{chunk-UPMHG7ET.js → chunk-MEIHREPM.js} +1 -1
  124. package/dist/{chunk-D5C56WO3.js → chunk-MOZ2YQ54.js} +1 -1
  125. package/dist/{chunk-CLGB3FGL.js → chunk-MPX3TRMQ.js} +2 -2
  126. package/dist/{chunk-5R75ODPS.js → chunk-NBY6R37W.js} +61 -232
  127. package/dist/{chunk-RWFGXC35.js → chunk-NEYQAEYU.js} +7 -7
  128. package/dist/{chunk-MBHZDXGN.js → chunk-NL35XNLI.js} +1 -1
  129. package/dist/{chunk-TPQVLYSV.js → chunk-NLGMHPEN.js} +1 -1
  130. package/dist/{chunk-5LMH4YHG.js → chunk-NRVV4Y5V.js} +4 -4
  131. package/dist/{chunk-GN5VHPPR.js → chunk-NVZR7T4E.js} +1 -1
  132. package/dist/{chunk-Y2L7RMGH.js → chunk-NWBHL5PI.js} +1 -1
  133. package/dist/{chunk-YPYDLW75.js → chunk-OEMX65EA.js} +1 -1
  134. package/dist/{chunk-UAFUGPKO.js → chunk-ONAQAL3O.js} +1 -1
  135. package/dist/{chunk-AVM7XZE4.js → chunk-OWQ3CCYJ.js} +7 -6
  136. package/dist/{chunk-K525WLL7.js → chunk-PI6V23GF.js} +5 -4
  137. package/dist/{chunk-AURM7FOT.js → chunk-Q2OAQPWY.js} +1 -1
  138. package/dist/{chunk-FB5VRO5S.js → chunk-QLDWASTX.js} +28 -32
  139. package/dist/{chunk-EPWDTS2Q.js → chunk-QMTGMCWB.js} +1 -1
  140. package/dist/{chunk-VI2FJY2M.js → chunk-QP4FHME2.js} +2 -2
  141. package/dist/{chunk-NJWK6J4N.js → chunk-QUNKPR6Y.js} +5 -5
  142. package/dist/{chunk-O6DAF2TY.js → chunk-QUZVAHO7.js} +2 -2
  143. package/dist/{chunk-VHKL4S4T.js → chunk-RRHSONV5.js} +2 -2
  144. package/dist/{chunk-GPF6X6HE.js → chunk-RYDHEWYY.js} +2 -2
  145. package/dist/{chunk-SVXDCELZ.js → chunk-SHN5O73O.js} +32 -4
  146. package/dist/chunk-TD5CADZ5.js +230 -0
  147. package/dist/{chunk-C2YS2AA6.js → chunk-U7WOVXBB.js} +2 -2
  148. package/dist/{chunk-FE45RXGC.js → chunk-V2GZMY6O.js} +1 -1
  149. package/dist/{chunk-PATCHPNY.js → chunk-VHALWCUO.js} +1 -1
  150. package/dist/{chunk-HLZSC5WK.js → chunk-VQAP35DA.js} +20 -18
  151. package/dist/{chunk-452XB7OZ.js → chunk-VRIMTCX2.js} +1 -1
  152. package/dist/{chunk-SUNYJ6YE.js → chunk-VT2B5BHM.js} +1 -1
  153. package/dist/{chunk-UZIJDYDA.js → chunk-VWVJVQDH.js} +2 -2
  154. package/dist/{chunk-TRZ5KA2R.js → chunk-VXIMSRTO.js} +2 -2
  155. package/dist/{chunk-DAZIV4QZ.js → chunk-WCXZF42W.js} +1 -1
  156. package/dist/{chunk-6OJJF4WP.js → chunk-XJUUWHVN.js} +1 -1
  157. package/dist/{chunk-F7LU65PQ.js → chunk-Y25OJWOQ.js} +14 -2
  158. package/dist/{chunk-2ORPA23Y.js → chunk-YMXXD2GW.js} +36 -8
  159. package/dist/{chunk-5WLMF6PL.js → chunk-YMZHTTOQ.js} +1 -1
  160. package/dist/{chunk-7DIDOQCX.js → chunk-YRVW57UW.js} +139 -125
  161. package/dist/{chunk-BRFH5X7G.js → chunk-Z7VDUS6L.js} +1 -1
  162. package/dist/{chunk-YFE6W75D.js → chunk-ZKFPHJIJ.js} +1 -1
  163. package/dist/{chunk-5WUTKDH6.js → chunk-ZVXJSQOR.js} +1 -1
  164. package/dist/{co-activation-VB4CJQZB.js → co-activation-L6I2LSJO.js} +3 -3
  165. package/dist/{co-occurrence-XZQJJIBM.js → co-occurrence-QARWYUAY.js} +3 -3
  166. package/dist/{code-context-index-FCQOPUEA.js → code-context-index-UIYQRDHD.js} +4 -4
  167. package/dist/{content-extractor-SPSH5X33.js → content-extractor-EYRVGD6O.js} +2 -2
  168. package/dist/{conversation-wiki-populator-YU35LNRK.js → conversation-wiki-populator-L7O6F3BB.js} +1 -1
  169. package/dist/{crdt-sync-KXETGV45.js → crdt-sync-R6YROKDH.js} +1 -1
  170. package/dist/{crm-webhook-JMOAHTJ6.js → crm-webhook-WK3PYJJK.js} +2 -2
  171. package/dist/{cto-delegation-gate-IJ3KQIKF.js → cto-delegation-gate-5JZORQIT.js} +12 -12
  172. package/dist/{daemon-auth-2IZACWSG.js → daemon-auth-2HEOL6VG.js} +2 -2
  173. package/dist/{daemon-orchestration-ZCY4GEI3.js → daemon-orchestration-BJ3T5MMF.js} +16 -15
  174. package/dist/{db-backup-HLX5OLIV.js → db-backup-EWS52P2W.js} +2 -2
  175. package/dist/{dreaming-2CJML3TU.js → dreaming-BOSBDRI3.js} +13 -13
  176. package/dist/{entity-boost-T5IYWWDZ.js → entity-boost-6ZVX7DFB.js} +26 -2
  177. package/dist/{exe-drift-P5OIRNSH.js → exe-drift-WRE6RADZ.js} +4 -4
  178. package/dist/{exe-export-QQL2H322.js → exe-export-7N5PBCMK.js} +8 -8
  179. package/dist/{exe-import-V4RJCUEP.js → exe-import-YOOE7S3H.js} +8 -8
  180. package/dist/{exe-key-MENJGDD7.js → exe-key-GXJSTCX2.js} +4 -4
  181. package/dist/{exe-org-3FNET2J7.js → exe-org-42YMQL75.js} +2 -2
  182. package/dist/{exe-snapshot-YRARQE7F.js → exe-snapshot-ODUCFW7G.js} +18 -18
  183. package/dist/{fast-db-init-HIJWWKAO.js → fast-db-init-YSR7RMVZ.js} +1 -1
  184. package/dist/{founder-context-BQ5NBDUV.js → founder-context-Q2HUCZX4.js} +2 -2
  185. package/dist/gateway/index.js +9 -9
  186. package/dist/{gateway-client-YGSA5QMC.js → gateway-client-4QXHKN5C.js} +1 -1
  187. package/dist/{git-staleness-IHTKCUMN.js → git-staleness-BJDTCDPC.js} +3 -3
  188. package/dist/{git-task-sweep-5ZPNQS7Y.js → git-task-sweep-L3U3T5HM.js} +13 -13
  189. package/dist/{global-procedures-XHDIZRJU.js → global-procedures-HCHEHKY2.js} +4 -4
  190. package/dist/{graph-auto-extract-5TPT67GP.js → graph-auto-extract-FP5C76LS.js} +3 -3
  191. package/dist/{hook-integrity-SB53Y7UK.js → hook-integrity-2OU3T6UC.js} +1 -1
  192. package/dist/hooks/bug-report-worker.js +15 -14
  193. package/dist/hooks/codex-stop-task-finalizer.js +15 -14
  194. package/dist/hooks/commit-complete.js +16 -16
  195. package/dist/hooks/error-recall.js +10 -10
  196. package/dist/hooks/exe-heartbeat-hook.js +5 -5
  197. package/dist/hooks/ingest-worker.js +8 -8
  198. package/dist/hooks/ingest.js +13 -13
  199. package/dist/hooks/instructions-loaded.js +7 -7
  200. package/dist/hooks/manifest.json +20 -20
  201. package/dist/hooks/notification.js +6 -6
  202. package/dist/hooks/post-compact.js +15 -15
  203. package/dist/hooks/post-tool-combined.js +7 -7
  204. package/dist/hooks/pre-compact.js +20 -20
  205. package/dist/hooks/pre-tool-use.js +28 -25
  206. package/dist/hooks/prompt-submit.js +62 -31
  207. package/dist/hooks/session-end.js +26 -26
  208. package/dist/hooks/session-start.js +39 -15
  209. package/dist/hooks/stop.js +22 -22
  210. package/dist/hooks/subagent-stop.js +15 -15
  211. package/dist/hooks/summary-worker.js +32 -27
  212. package/dist/index.js +21 -21
  213. package/dist/{installer-AMZM4MLS.js → installer-AWMUCRN4.js} +7 -7
  214. package/dist/{installer-KT5FW4CN.js → installer-HB3NH6FG.js} +9 -9
  215. package/dist/{installer-HW74W3IT.js → installer-RU6EVOBL.js} +6 -6
  216. package/dist/{intercom-queue-RNM6EPGA.js → intercom-queue-A6UJEFIF.js} +1 -1
  217. package/dist/{key-backup-status-OZ2CXUDW.js → key-backup-status-4YKCV4ZV.js} +1 -1
  218. package/dist/lib/agent-config.js +2 -2
  219. package/dist/lib/cloud-sync.js +10 -8
  220. package/dist/lib/config.js +1 -1
  221. package/dist/lib/consolidation.js +8 -8
  222. package/dist/lib/database.js +3 -3
  223. package/dist/lib/db-daemon-client.js +3 -3
  224. package/dist/lib/db.js +3 -3
  225. package/dist/lib/device-registry.js +1 -1
  226. package/dist/lib/embedder.js +4 -4
  227. package/dist/lib/employee-templates.js +5 -5
  228. package/dist/lib/employees.js +3 -3
  229. package/dist/lib/exe-daemon-client.js +3 -3
  230. package/dist/lib/exe-daemon.js +105 -74
  231. package/dist/lib/hybrid-search.js +8 -8
  232. package/dist/lib/identity.js +3 -3
  233. package/dist/lib/keychain.js +1 -1
  234. package/dist/lib/license.js +2 -2
  235. package/dist/lib/messaging.js +13 -13
  236. package/dist/lib/post-tool-memory.js +3 -3
  237. package/dist/lib/registry-proxy.js +1 -1
  238. package/dist/lib/reminders.js +4 -4
  239. package/dist/lib/schedules.js +8 -8
  240. package/dist/lib/session-registry.js +5 -5
  241. package/dist/lib/skill-learning.js +5 -5
  242. package/dist/lib/store.js +7 -7
  243. package/dist/lib/task-router.js +4 -4
  244. package/dist/lib/tasks.js +14 -13
  245. package/dist/lib/tmux-routing.js +12 -12
  246. package/dist/lib/token-spend.js +4 -4
  247. package/dist/lib/ws-client.js +1 -1
  248. package/dist/{license-gate-XJDIL6OZ.js → license-gate-6JQQFBHS.js} +3 -3
  249. package/dist/mcp/register-tools.js +68 -67
  250. package/dist/mcp/server.js +70 -69
  251. package/dist/mcp/tools/complete-reminder.js +5 -5
  252. package/dist/mcp/tools/create-reminder.js +5 -5
  253. package/dist/mcp/tools/create-task.js +16 -15
  254. package/dist/mcp/tools/deactivate-behavior.js +6 -6
  255. package/dist/mcp/tools/list-reminders.js +5 -5
  256. package/dist/mcp/tools/list-tasks.js +16 -15
  257. package/dist/mcp/tools/send-message.js +15 -15
  258. package/dist/mcp/tools/update-task.js +15 -14
  259. package/dist/{mcp-http-config-BXX3RZPR.js → mcp-http-config-XIJR5P2Z.js} +4 -4
  260. package/dist/{memory-cards-KRTP5GFM.js → memory-cards-H4BJJ5OK.js} +3 -3
  261. package/dist/{memory-graph-extractor-G532PUHC.js → memory-graph-extractor-SDGM3GVR.js} +4 -4
  262. package/dist/{memory-poisoning-defense-HJM3FQA3.js → memory-poisoning-defense-UVU67DGJ.js} +3 -3
  263. package/dist/{memory-queue-FTNBWLS4.js → memory-queue-FNT5WHXP.js} +2 -2
  264. package/dist/{memory-queue-client-DHSHEIHQ.js → memory-queue-client-JZCFYTWQ.js} +5 -5
  265. package/dist/{memory-reflection-RANRFUQL.js → memory-reflection-GGB5K35L.js} +3 -3
  266. package/dist/{notifications-4P2PVEOT.js → notifications-P3XQZDTH.js} +12 -12
  267. package/dist/{orchestration-events-IYTASMSN.js → orchestration-events-25WEKUKH.js} +4 -4
  268. package/dist/{orchestration-phase-SGA7PJ5G.js → orchestration-phase-C26XVKLZ.js} +2 -2
  269. package/dist/{orchestrator-VKVHZ4MV.js → orchestrator-VIXTY4E4.js} +14 -14
  270. package/dist/{pipeline-router-E4L5BDXN.js → pipeline-router-S5PE5U6B.js} +4 -4
  271. package/dist/{plan-limits-5O5QG55H.js → plan-limits-DGIVM42H.js} +5 -5
  272. package/dist/{prediction-log-OMWHW7FL.js → prediction-log-DOEOHDHS.js} +1 -1
  273. package/dist/{project-boot-WMI6CWRX.js → project-boot-4ZL2W7DN.js} +12 -2
  274. package/dist/{projection-worker-54KRNQSO.js → projection-worker-GG2W5OM3.js} +3 -3
  275. package/dist/{push-notifications-E2XXEWJZ.js → push-notifications-AMHVR6DF.js} +2 -2
  276. package/dist/{reranker-4NTUFNYT.js → reranker-UCPLQZE2.js} +2 -2
  277. package/dist/{review-polling-BFRJDLUA.js → review-polling-P2MWEXLR.js} +13 -13
  278. package/dist/runtime/index.js +15 -15
  279. package/dist/{session-events-KCZCWGE4.js → session-events-5CD66R6U.js} +13 -13
  280. package/dist/{session-kill-telemetry-TMNIDYWY.js → session-kill-telemetry-7FBHTEDN.js} +4 -4
  281. package/dist/{session-scope-DRZBQ32Y.js → session-scope-VMIPAZU7.js} +12 -12
  282. package/dist/{setup-wizard-TQKGDAHO.js → setup-wizard-BNR47URR.js} +3 -3
  283. package/dist/{shard-manager-G6MHCO7X.js → shard-manager-VGA2TYHM.js} +2 -2
  284. package/dist/{skill-refinement-Z5SWD3AM.js → skill-refinement-NRG4WWRW.js} +3 -3
  285. package/dist/stack-release-PFZI22WC.js +521 -0
  286. package/dist/{stack-update-NO5MNARG.js → stack-update-7F2E2MBJ.js} +3 -3
  287. package/dist/{steward-gate-7DWYS5AT.js → steward-gate-L7DJMF4C.js} +4 -4
  288. package/dist/{task-enforcement-2VL5J6JJ.js → task-enforcement-XQL77PZH.js} +52 -12
  289. package/dist/{task-scope-YHALISIB.js → task-scope-R3XKBIHL.js} +12 -12
  290. package/dist/{tasks-crud-JXZEBZFR.js → tasks-crud-DQOG2NPG.js} +12 -12
  291. package/dist/tasks-notify-4EQYG52H.js +37 -0
  292. package/dist/{tasks-review-PGPYJQF5.js → tasks-review-XPFJ4DSJ.js} +12 -12
  293. package/dist/{telemetry-upload-H7OJNBIF.js → telemetry-upload-OT5B5HUY.js} +7 -7
  294. package/dist/{token-budget-JJ7JQIA2.js → token-budget-D2LQKCAV.js} +3 -3
  295. package/dist/{tool-capability-index-WIV4K3FB.js → tool-capability-index-FAJ5ZHDF.js} +1 -1
  296. package/dist/{tool-telemetry-W4LFCHFT.js → tool-telemetry-QIF5BCLF.js} +1 -1
  297. package/dist/tui/App.js +26 -26
  298. package/dist/{tui-data-72U6N2DC.js → tui-data-UEV2QOR3.js} +108 -12
  299. package/dist/{whatsapp-config-W63RQ3AU.js → whatsapp-config-GOSELKTE.js} +7 -0
  300. package/dist/{worker-gate-SCSN6IHI.js → worker-gate-PRCKA23W.js} +2 -2
  301. package/dist/{workflow-engine-OICYBE4F.js → workflow-engine-7X6LLH3M.js} +2 -2
  302. package/dist/{worktree-JXN4RCWC.js → worktree-RICSCT2S.js} +5 -5
  303. package/package.json +1 -1
  304. package/release-notes.json +210 -298
  305. package/stack.release.json +4 -3
  306. package/dist/preflight-EAH2MI76.js +0 -287
  307. /package/dist/{chunk-H42LEGLB.js → chunk-AQBEG33D.js} +0 -0
  308. /package/dist/{chunk-AU5426YP.js → chunk-B7JGEDVE.js} +0 -0
  309. /package/dist/{chunk-YFDDTHNM.js → chunk-JXI4XUTV.js} +0 -0
  310. /package/dist/{chunk-SNYDRHV3.js → chunk-U3DUFHOT.js} +0 -0
  311. /package/dist/{chunk-N2XUH2HQ.js → chunk-VBPC7IC7.js} +0 -0
  312. /package/dist/{chunk-HTUJBTBM.js → chunk-VUS6WXQ3.js} +0 -0
  313. /package/dist/{chunk-NOLIN2YI.js → chunk-XAYRZHLV.js} +0 -0
  314. /package/dist/{core-memory-VOBGGB2Q.js → core-memory-4KAIKQRQ.js} +0 -0
  315. /package/dist/{message-queue-client-KAJN6TIJ.js → message-queue-client-S6W5VMJV.js} +0 -0
  316. /package/dist/{oauth-server-QEXRSXEP.js → oauth-server-2ESBZB7F.js} +0 -0
  317. /package/dist/{webhook-pipe-LY4XEDL7.js → webhook-pipe-ZRUVOG5H.js} +0 -0
  318. /package/dist/{wiki-acl-M3OR547L.js → wiki-acl-MFLSS6DE.js} +0 -0
  319. /package/dist/{wiki-client-MAFYBXCQ.js → wiki-client-GBPR45BQ.js} +0 -0
@@ -0,0 +1,168 @@
1
+ // src/bin/vps-backup.ts
2
+ import { spawnSync } from "child_process";
3
+ import { existsSync, mkdirSync, readdirSync, statSync, unlinkSync } from "fs";
4
+ import path from "path";
5
+ var BACKUP_DIR = "/opt/exe-stack/backups";
6
+ var DEFAULT_DATABASE_URL = "postgres://exe@localhost:5432/exedb";
7
+ var MAX_SNAPSHOTS = 28;
8
+ var KEEP_DAYS = 7;
9
+ function runPgBackup(tag) {
10
+ mkdirSync(BACKUP_DIR, { recursive: true });
11
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
12
+ const filename = tag ? `pg-${tag}-${timestamp}.dump` : `pg-${timestamp}.dump`;
13
+ const filepath = path.join(BACKUP_DIR, filename);
14
+ const databaseUrl = process.env.DATABASE_URL || DEFAULT_DATABASE_URL;
15
+ const result = spawnSync("pg_dump", ["-Fc", "-d", databaseUrl, "-f", filepath], {
16
+ stdio: ["pipe", "pipe", "pipe"],
17
+ timeout: 3e5,
18
+ // 5 minutes max
19
+ env: { ...process.env }
20
+ });
21
+ if (result.status !== 0) {
22
+ const stderr = result.stderr?.toString() || "";
23
+ throw new Error(`pg_dump failed (exit ${result.status}): ${stderr}`);
24
+ }
25
+ const size = existsSync(filepath) ? statSync(filepath).size : 0;
26
+ console.log(`[vps-backup] \u2713 Backup created: ${filepath} (${formatBytes(size)})`);
27
+ return filepath;
28
+ }
29
+ function cleanOldBackups(keepDays = KEEP_DAYS) {
30
+ if (!existsSync(BACKUP_DIR)) return 0;
31
+ const files = readdirSync(BACKUP_DIR).filter((f) => f.startsWith("pg-") && f.endsWith(".dump")).map((f) => ({
32
+ name: f,
33
+ path: path.join(BACKUP_DIR, f),
34
+ mtime: statSync(path.join(BACKUP_DIR, f)).mtimeMs
35
+ })).sort((a, b) => b.mtime - a.mtime);
36
+ const cutoff = Date.now() - keepDays * 24 * 60 * 60 * 1e3;
37
+ let removed = 0;
38
+ for (let i = 0; i < files.length; i++) {
39
+ const file = files[i];
40
+ if (file.mtime >= cutoff && i < MAX_SNAPSHOTS) continue;
41
+ if (file.name.includes("pre-deploy-") && file.mtime >= cutoff) continue;
42
+ try {
43
+ unlinkSync(file.path);
44
+ removed++;
45
+ console.log(`[vps-backup] Removed old backup: ${file.name}`);
46
+ } catch (err) {
47
+ console.warn(`[vps-backup] Failed to remove ${file.name}: ${err instanceof Error ? err.message : err}`);
48
+ }
49
+ }
50
+ if (removed > 0) {
51
+ console.log(`[vps-backup] \u2713 Cleaned ${removed} old backup(s)`);
52
+ } else {
53
+ console.log("[vps-backup] \u2713 No old backups to clean");
54
+ }
55
+ return removed;
56
+ }
57
+ function preDeployBackup(version) {
58
+ const sanitized = version.replace(/[^a-zA-Z0-9._-]/g, "_");
59
+ console.log(`[vps-backup] Creating pre-deploy backup for version ${version}...`);
60
+ return runPgBackup(`pre-deploy-${sanitized}`);
61
+ }
62
+ function setupCron() {
63
+ const which = spawnSync("which", ["exe-os"], { encoding: "utf8", timeout: 5e3 });
64
+ const exeOsBin = which.stdout?.trim() || "/usr/local/bin/exe-os";
65
+ const cronLine = `0 */6 * * * ${exeOsBin} vps-backup --clean 2>&1 | tail -5 >> /var/log/exe-backup.log`;
66
+ const cronComment = "# exe-os automated postgres backup (every 6 hours)";
67
+ const current = spawnSync("crontab", ["-l"], {
68
+ encoding: "utf8",
69
+ stdio: ["pipe", "pipe", "pipe"]
70
+ });
71
+ const existingCron = current.status === 0 ? current.stdout : "";
72
+ if (existingCron.includes("exe-os vps-backup") || existingCron.includes("exe-os vps-backup")) {
73
+ console.log("[vps-backup] \u2713 Cron job already installed");
74
+ return;
75
+ }
76
+ const newCron = existingCron.trimEnd() + "\n\n" + cronComment + "\n" + cronLine + "\n";
77
+ const install = spawnSync("crontab", ["-"], {
78
+ input: newCron,
79
+ encoding: "utf8",
80
+ stdio: ["pipe", "pipe", "pipe"]
81
+ });
82
+ if (install.status !== 0) {
83
+ throw new Error(`Failed to install cron: ${install.stderr}`);
84
+ }
85
+ console.log("[vps-backup] \u2713 Cron job installed (every 6 hours)");
86
+ console.log(`[vps-backup] ${cronLine}`);
87
+ }
88
+ function listBackups() {
89
+ if (!existsSync(BACKUP_DIR)) {
90
+ console.log("[vps-backup] No backups directory found");
91
+ return;
92
+ }
93
+ const files = readdirSync(BACKUP_DIR).filter((f) => f.startsWith("pg-") && f.endsWith(".dump")).map((f) => {
94
+ const stat = statSync(path.join(BACKUP_DIR, f));
95
+ return { name: f, size: stat.size, mtime: stat.mtimeMs };
96
+ }).sort((a, b) => b.mtime - a.mtime);
97
+ if (files.length === 0) {
98
+ console.log("[vps-backup] No backups found");
99
+ return;
100
+ }
101
+ console.log(`
102
+ Backups in ${BACKUP_DIR} (${files.length} total):
103
+ `);
104
+ for (const f of files) {
105
+ const age = formatAge(Date.now() - f.mtime);
106
+ console.log(` ${f.name} ${formatBytes(f.size).padStart(10)} ${age} ago`);
107
+ }
108
+ console.log("");
109
+ }
110
+ function formatBytes(bytes) {
111
+ if (bytes < 1024) return `${bytes} B`;
112
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
113
+ if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
114
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
115
+ }
116
+ function formatAge(ms) {
117
+ const hours = Math.floor(ms / (1e3 * 60 * 60));
118
+ if (hours < 1) return `${Math.floor(ms / (1e3 * 60))}m`;
119
+ if (hours < 48) return `${hours}h`;
120
+ return `${Math.floor(hours / 24)}d`;
121
+ }
122
+ async function main(args) {
123
+ if (args.includes("--help") || args.includes("-h")) {
124
+ console.log(`
125
+ exe-os vps-backup \u2014 Postgres backup manager
126
+
127
+ Usage:
128
+ exe-os vps-backup Run backup now
129
+ exe-os vps-backup --setup Install cron job (every 6 hours)
130
+ exe-os vps-backup --clean Run backup + clean old backups
131
+ exe-os vps-backup --list List current backups
132
+ exe-os vps-backup --pre-deploy <version> Pre-deploy snapshot
133
+ `);
134
+ return;
135
+ }
136
+ if (args.includes("--setup")) {
137
+ setupCron();
138
+ return;
139
+ }
140
+ if (args.includes("--list")) {
141
+ listBackups();
142
+ return;
143
+ }
144
+ const preDeployIdx = args.indexOf("--pre-deploy");
145
+ if (preDeployIdx !== -1) {
146
+ const version = args[preDeployIdx + 1];
147
+ if (!version) {
148
+ console.error("[vps-backup] --pre-deploy requires a version argument");
149
+ process.exitCode = 1;
150
+ return;
151
+ }
152
+ preDeployBackup(version);
153
+ return;
154
+ }
155
+ runPgBackup();
156
+ if (args.includes("--clean")) {
157
+ cleanOldBackups();
158
+ }
159
+ }
160
+
161
+ export {
162
+ runPgBackup,
163
+ cleanOldBackups,
164
+ preDeployBackup,
165
+ setupCron,
166
+ listBackups,
167
+ main
168
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isCoordinatorRole
3
- } from "./chunk-2H55BIV2.js";
3
+ } from "./chunk-CEJO7244.js";
4
4
 
5
5
  // src/lib/task-router.ts
6
6
  import { randomUUID } from "crypto";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  readMcpHttpEvents,
3
3
  summarizeMcpTransport
4
- } from "./chunk-UODVZGBQ.js";
4
+ } from "./chunk-KN7LPTIB.js";
5
5
  import {
6
6
  EXE_AI_DIR
7
- } from "./chunk-TRZ5KA2R.js";
7
+ } from "./chunk-VXIMSRTO.js";
8
8
  import {
9
9
  isMainModule
10
10
  } from "./chunk-6Y4B3QF6.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  sendMessage
3
- } from "./chunk-5GG7MTRJ.js";
3
+ } from "./chunk-DGBGIXCC.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-RA2RO27E.js";
6
+ } from "./chunk-MCESA5UW.js";
7
7
 
8
8
  // src/mcp/tools/send-message.ts
9
9
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-2H55BIV2.js";
3
+ } from "./chunk-CEJO7244.js";
4
4
 
5
5
  // src/lib/token-spend.ts
6
6
  import { readdir, stat } from "fs/promises";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EXE_AI_DIR
3
- } from "./chunk-TRZ5KA2R.js";
3
+ } from "./chunk-VXIMSRTO.js";
4
4
  import {
5
5
  enforcePrivateFileSync,
6
6
  ensurePrivateDirSync
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-2H55BIV2.js";
3
+ } from "./chunk-CEJO7244.js";
4
4
 
5
5
  // src/lib/pipeline-router.ts
6
6
  import crypto from "crypto";
@@ -116,12 +116,12 @@ async function sinkCRM(msg, agentResponse, agentName) {
116
116
  }
117
117
  async function sinkWiki(msg, agentResponse) {
118
118
  try {
119
- const { createWikiClient } = await import("./wiki-client-MAFYBXCQ.js");
119
+ const { createWikiClient } = await import("./wiki-client-GBPR45BQ.js");
120
120
  const client = await createWikiClient();
121
121
  if (!client) return false;
122
122
  const content = msg.text ?? "";
123
123
  if (content.length < 50) return false;
124
- const { chatInWorkspace } = await import("./wiki-client-MAFYBXCQ.js");
124
+ const { chatInWorkspace } = await import("./wiki-client-GBPR45BQ.js");
125
125
  const ingestText = [
126
126
  `[${msg.platform}] Message from ${msg.senderName ?? msg.senderId} (${msg.timestamp}):`,
127
127
  content,
@@ -149,7 +149,7 @@ async function sinkEntityExtraction(msg, agentResponse, agentName) {
149
149
  const client = getClient();
150
150
  const memoryId = `conv:${msg.messageId}`;
151
151
  await storeExtraction(client, extraction, memoryId, msg.timestamp);
152
- import("./conversation-wiki-populator-YU35LNRK.js").then(
152
+ import("./conversation-wiki-populator-L7O6F3BB.js").then(
153
153
  ({ populateWikiFromExtraction }) => populateWikiFromExtraction(extraction, msg, agentResponse, agentName)
154
154
  ).catch((err) => {
155
155
  process.stderr.write(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MODELS_DIR
3
- } from "./chunk-TRZ5KA2R.js";
3
+ } from "./chunk-VXIMSRTO.js";
4
4
 
5
5
  // src/lib/reranker.ts
6
6
  import path from "path";
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  EXE_AI_DIR
3
- } from "./chunk-TRZ5KA2R.js";
3
+ } from "./chunk-VXIMSRTO.js";
4
4
 
5
5
  // src/lib/db-backup.ts
6
- import { copyFileSync, existsSync, mkdirSync, readdirSync, unlinkSync, statSync } from "fs";
6
+ import { existsSync, readdirSync, unlinkSync, statSync } from "fs";
7
7
  import { copyFile, mkdir, unlink } from "fs/promises";
8
- import { execFileSync } from "child_process";
9
8
  import path from "path";
10
9
  var BACKUP_DIR = path.join(EXE_AI_DIR, "backups");
11
10
  var DEFAULT_KEEP_DAYS = 3;
@@ -17,60 +16,8 @@ function findActiveDb() {
17
16
  }
18
17
  return null;
19
18
  }
20
- function createBackup(reason = "manual") {
21
- const dbPath = findActiveDb();
22
- if (!dbPath) return null;
23
- mkdirSync(BACKUP_DIR, { recursive: true });
24
- const dbName = path.basename(dbPath, ".db");
25
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
26
- const backupName = `${dbName}-${reason}-${timestamp}.db`;
27
- const backupPath = path.join(BACKUP_DIR, backupName);
28
- try {
29
- execFileSync("sqlite3", [dbPath, "PRAGMA wal_checkpoint(TRUNCATE);"], {
30
- timeout: 3e4,
31
- stdio: ["pipe", "pipe", "pipe"]
32
- });
33
- } catch {
34
- process.stderr.write(`[db-backup] WAL checkpoint skipped (sqlite3 CLI unavailable or encrypted DB)
35
- `);
36
- }
37
- copyFileSync(dbPath, backupPath);
38
- try {
39
- const result = execFileSync("sqlite3", [backupPath, "PRAGMA quick_check;"], {
40
- encoding: "utf8",
41
- timeout: 1e4,
42
- stdio: ["pipe", "pipe", "pipe"]
43
- }).trim();
44
- if (result !== "ok") {
45
- process.stderr.write(`[db-backup] WARNING: backup failed quick_check (${reason}): ${result}
46
- `);
47
- try {
48
- unlinkSync(backupPath);
49
- } catch {
50
- }
51
- return null;
52
- }
53
- } catch (err) {
54
- process.stderr.write(
55
- `[db-backup] Backup validation skipped: ${err instanceof Error ? err.message : String(err)}
56
- `
57
- );
58
- }
59
- const walPath = dbPath + "-wal";
60
- if (existsSync(walPath)) {
61
- try {
62
- copyFileSync(walPath, backupPath + "-wal");
63
- } catch {
64
- }
65
- }
66
- const shmPath = dbPath + "-shm";
67
- if (existsSync(shmPath)) {
68
- try {
69
- copyFileSync(shmPath, backupPath + "-shm");
70
- } catch {
71
- }
72
- }
73
- return backupPath;
19
+ async function createBackup(reason = "manual") {
20
+ return createBackupAsync(reason);
74
21
  }
75
22
  async function createBackupAsync(reason = "manual") {
76
23
  const dbPath = findActiveDb();
@@ -97,16 +44,12 @@ async function createBackupAsync(reason = "manual") {
97
44
  }
98
45
  await copyFile(dbPath, backupPath);
99
46
  try {
100
- const { execFile } = await import("child_process");
101
- const { promisify } = await import("util");
102
- const execFileAsync = promisify(execFile);
103
- const { stdout } = await execFileAsync("sqlite3", [backupPath, "PRAGMA quick_check;"], {
104
- encoding: "utf8",
105
- timeout: 1e4
106
- });
107
- const result = String(stdout ?? "").trim();
108
- if (result !== "ok") {
109
- process.stderr.write(`[db-backup] WARNING: backup failed quick_check (${reason}): ${result}
47
+ const { getClient } = await import("./lib/database.js");
48
+ const client = getClient();
49
+ const chk = await client.execute("PRAGMA quick_check;");
50
+ const result = String(chk.rows[0]?.quick_check ?? chk.rows[0]?.[0] ?? "").trim();
51
+ if (result && result !== "ok") {
52
+ process.stderr.write(`[db-backup] WARNING: backup source failed quick_check (${reason}): ${result}
110
53
  `);
111
54
  try {
112
55
  await unlink(backupPath);
@@ -114,11 +57,9 @@ async function createBackupAsync(reason = "manual") {
114
57
  }
115
58
  return null;
116
59
  }
117
- } catch (err) {
118
- process.stderr.write(
119
- `[db-backup] Backup validation skipped: ${err instanceof Error ? err.message : String(err)}
120
- `
121
- );
60
+ } catch {
61
+ process.stderr.write(`[db-backup] Backup validation skipped (encrypted DB or CLI context) \u2014 proceeding with checkpoint-consistent copy.
62
+ `);
122
63
  }
123
64
  const walPath = dbPath + "-wal";
124
65
  if (existsSync(walPath)) {
@@ -180,25 +121,25 @@ function getLatestBackup() {
180
121
  const backups = listBackups();
181
122
  return backups.length > 0 ? backups[0].path : null;
182
123
  }
183
- function restoreBackup(backupPath) {
124
+ async function restoreBackup(backupPath) {
184
125
  const dbPath = findActiveDb();
185
126
  if (!dbPath) {
186
127
  const target = path.join(EXE_AI_DIR, DB_NAMES[0]);
187
128
  const source2 = backupPath ?? getLatestBackup();
188
129
  if (!source2 || !existsSync(source2)) return null;
189
- copyFileSync(source2, target);
130
+ await copyFile(source2, target);
190
131
  return { restored: path.basename(source2), preRestoreBackup: null };
191
132
  }
192
133
  const source = backupPath ?? getLatestBackup();
193
134
  if (!source || !existsSync(source)) return null;
194
135
  if (path.resolve(source) === path.resolve(dbPath)) return null;
195
- const preRestoreBackup = createBackup("pre-restore");
196
- copyFileSync(source, dbPath);
136
+ const preRestoreBackup = await createBackup("pre-restore");
137
+ await copyFile(source, dbPath);
197
138
  const walPath = source + "-wal";
198
139
  const shmPath = source + "-shm";
199
140
  if (existsSync(walPath)) {
200
141
  try {
201
- copyFileSync(walPath, dbPath + "-wal");
142
+ await copyFile(walPath, dbPath + "-wal");
202
143
  } catch {
203
144
  }
204
145
  } else {
@@ -209,7 +150,7 @@ function restoreBackup(backupPath) {
209
150
  }
210
151
  if (existsSync(shmPath)) {
211
152
  try {
212
- copyFileSync(shmPath, dbPath + "-shm");
153
+ await copyFile(shmPath, dbPath + "-shm");
213
154
  } catch {
214
155
  }
215
156
  } else {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeReminder
3
- } from "./chunk-5WLMF6PL.js";
3
+ } from "./chunk-YMZHTTOQ.js";
4
4
 
5
5
  // src/mcp/tools/complete-reminder.ts
6
6
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadLicense
3
- } from "./chunk-D5C56WO3.js";
3
+ } from "./chunk-MOZ2YQ54.js";
4
4
 
5
5
  // src/lib/stack-update.ts
6
6
  import { execFileSync, spawnSync } from "child_process";
@@ -350,6 +350,7 @@ function hydrateEnv(raw, opts) {
350
350
  if (!/CHANGEME/.test(value)) continue;
351
351
  if (key === "EXE_LICENSE_KEY" && license) replacements[key] = license;
352
352
  else if (key === "MONITOR_AGENT_TOKEN" || key === "MONITOR_AGENT_KEY") continue;
353
+ else if (key === "CLOUDFLARE_TUNNEL_TOKEN") continue;
353
354
  else if (key === "EXE_GATEWAY_WS_RELAY_AUTH_TOKEN") replacements[key] = randomHexSecret(24);
354
355
  else if (key.endsWith("_PASSWORD")) replacements[key] = randomSecret(24);
355
356
  else if (key.endsWith("_TOKEN")) replacements[key] = randomHexSecret(32);
@@ -414,6 +415,11 @@ function bootstrapStackHost(options) {
414
415
  }
415
416
  copyTemplateIfMissing("deploy/compose/docker-compose.yml", options.composeFile, createdFiles);
416
417
  copyTemplateIfMissing("deploy/compose/.env.customer.example", options.envFile, createdFiles);
418
+ copyTemplateIfMissing(
419
+ "deploy/compose/init-db.sql",
420
+ path.join(path.dirname(options.composeFile), "init-db.sql"),
421
+ createdFiles
422
+ );
417
423
  copyTemplateIfMissing(
418
424
  "deploy/compose/clickhouse-config.xml",
419
425
  path.join(path.dirname(options.envFile), "clickhouse-config.xml"),
@@ -422,6 +428,11 @@ function bootstrapStackHost(options) {
422
428
  const brandingDest = path.join(path.dirname(options.envFile), "branding.json");
423
429
  copyTemplateIfMissing("deploy/compose/gateway.json", path.join(path.dirname(options.envFile), "gateway.json"), createdFiles);
424
430
  if (!existsSync(brandingDest)) writeFileSync(brandingDest, JSON.stringify({ brandName: "Hygo", productName: "Hygo OS" }, null, 2) + "\n", { mode: 384 });
431
+ copyTemplateIfMissing(
432
+ "deploy/compose/cloudflared/config.yml.example",
433
+ path.join(path.dirname(options.composeFile), "cloudflared", "config.yml.example"),
434
+ createdFiles
435
+ );
425
436
  let envHadPlaceholders = false;
426
437
  let envRemainingPlaceholders = [];
427
438
  if (existsSync(options.envFile)) {
@@ -458,7 +469,7 @@ function assertHostReadyForApply(report) {
458
469
  if (!report.composeFileExists) blockers.push("docker-compose.yml is missing and could not be created.");
459
470
  if (!report.envFileExists) blockers.push(".env is missing and could not be created.");
460
471
  if (!report.licensePresent) blockers.push("Exe OS license key is missing. Run `exe-os setup`, `exe-os --activate <key>`, or pass --license-key.");
461
- const hardPlaceholders = report.envRemainingPlaceholders.filter((p) => !/WHATSAPP|API_ROUTER|MONITOR_AGENT/.test(p));
472
+ const hardPlaceholders = report.envRemainingPlaceholders.filter((p) => !/WHATSAPP|API_ROUTER|MONITOR_AGENT|CLOUDFLARE_TUNNEL_TOKEN/.test(p));
462
473
  if (hardPlaceholders.length > 0) blockers.push(`Required .env placeholders remain: ${hardPlaceholders.join(", ")}`);
463
474
  if (blockers.length > 0) throw new Error(`Stack host is not ready:
464
475
  - ${blockers.join("\n- ")}`);
@@ -565,8 +576,10 @@ async function runStackUpdate(options) {
565
576
  warnLegacyDaemonVolume();
566
577
  if (!options.dryRun) {
567
578
  try {
568
- const { runPreflight } = await import("./preflight-EAH2MI76.js");
569
- const preflightReport = runPreflight({
579
+ if (!options.preflight) {
580
+ throw new Error("preflight hook not provided");
581
+ }
582
+ const preflightReport = options.preflight({
570
583
  composeFile: options.composeFile,
571
584
  envFile: options.envFile
572
585
  });
@@ -620,8 +633,10 @@ async function runStackUpdate(options) {
620
633
  }
621
634
  await postDeployAudit(options, "started", plan.targetVersion, previousVersion);
622
635
  try {
623
- const { preDeployBackup } = await import("./bin/vps-backup.js");
624
- preDeployBackup(plan.targetVersion);
636
+ if (!options.preDeployBackup) {
637
+ throw new Error("preDeployBackup hook not provided");
638
+ }
639
+ options.preDeployBackup(plan.targetVersion);
625
640
  } catch {
626
641
  }
627
642
  const stackDir = path.dirname(options.envFile);
@@ -696,6 +711,20 @@ async function runStackUpdate(options) {
696
711
  }
697
712
  }
698
713
  }
714
+ if (!creds) {
715
+ const sampleImage = Object.values(plan.release.services)[0]?.image ?? "";
716
+ if (sampleImage.startsWith("update.askexe.com")) {
717
+ const stackEnvPullTokensRaw = process.env.EXE_REGISTRY_PROXY_PULL_TOKENS || (existsSync(options.envFile) ? (() => {
718
+ const envMap = parseEnv(readFileSync(options.envFile, "utf8"));
719
+ return envMap.get("EXE_REGISTRY_PROXY_PULL_TOKENS") ?? "";
720
+ })() : "");
721
+ const firstPullToken = stackEnvPullTokensRaw.split(/[\n,]/).map((s) => s.trim()).find(Boolean);
722
+ if (firstPullToken) {
723
+ creds = { registry: "update.askexe.com", username: "token", password: firstPullToken };
724
+ console.log("[stack-update] Using EXE_REGISTRY_PROXY_PULL_TOKENS for update.askexe.com registry auth.");
725
+ }
726
+ }
727
+ }
699
728
  if (!creds) {
700
729
  const sampleImage = Object.values(plan.release.services)[0]?.image ?? "";
701
730
  if (sampleImage.startsWith("update.askexe.com")) {
@@ -755,8 +784,10 @@ async function runStackUpdate(options) {
755
784
  // ERP WebSocket (Socket.io)
756
785
  "exe-erp-queue",
757
786
  // ERP background workers (RQ)
758
- "exe-erp-scheduler"
787
+ "exe-erp-scheduler",
759
788
  // ERP scheduled tasks
789
+ "cloudflared"
790
+ // tunnel — restarted last so services are healthy before it connects
760
791
  ];
761
792
  const preSnapshot = spawnSync("docker", ["ps", "--format", "json"], { encoding: "utf8", timeout: 1e4 });
762
793
  const preContainerCount = preSnapshot.stdout?.split("\n").filter(Boolean).length ?? 0;
@@ -809,9 +840,11 @@ async function runStackUpdate(options) {
809
840
  }
810
841
  await verifyReleaseHealth(plan.release, options.healthRetries ?? 12, options.healthDelayMs ?? 5e3);
811
842
  try {
812
- const { runHealthGate, logResult } = await import("./bin/vps-health-gate.js");
813
- const gateResult = await runHealthGate();
814
- logResult(gateResult);
843
+ if (!options.healthGate) {
844
+ throw new Error("healthGate hook not provided");
845
+ }
846
+ const gateResult = await options.healthGate();
847
+ options.logHealthGateResult?.(gateResult);
815
848
  if (!gateResult.passed) {
816
849
  const failed = gateResult.results.filter((r) => r.status === "fail").map((r) => r.check);
817
850
  throw new Error(`Health gate failed: ${failed.join(", ")}`);
@@ -825,8 +858,10 @@ async function runStackUpdate(options) {
825
858
  }
826
859
  assertVolumesIntact();
827
860
  try {
828
- const { runVerifyStack } = await import("./bin/verify-stack.js");
829
- const verifyReport = await runVerifyStack({ composeFile: options.composeFile, envFile: options.envFile });
861
+ if (!options.verifyStack) {
862
+ throw new Error("verifyStack hook not provided");
863
+ }
864
+ const verifyReport = await options.verifyStack({ composeFile: options.composeFile, envFile: options.envFile });
830
865
  for (const r of verifyReport.results) {
831
866
  if (r.status === "fail") console.warn(`[verify-stack] FAIL: ${r.check}: ${r.message}`);
832
867
  }
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getMasterKey,
3
3
  setMasterKey
4
- } from "./chunk-KDJRFJDL.js";
4
+ } from "./chunk-K333WOW4.js";
5
5
  import {
6
6
  LEGACY_LANCE_PATH,
7
7
  MODELS_DIR,
8
8
  loadConfig,
9
9
  saveConfig
10
- } from "./chunk-TRZ5KA2R.js";
10
+ } from "./chunk-VXIMSRTO.js";
11
11
  import {
12
12
  atomicWriteJsonSync,
13
13
  atomicWriteSync
@@ -380,7 +380,7 @@ async function runSetupWizard(opts = {}) {
380
380
  "Setup cancelled: recovery phrase was not confirmed. Save the 24-word phrase before continuing \u2014 it is required to recover encrypted memories."
381
381
  );
382
382
  }
383
- const { markKeyBackupConfirmed } = await import("./key-backup-status-OZ2CXUDW.js");
383
+ const { markKeyBackupConfirmed } = await import("./key-backup-status-4YKCV4ZV.js");
384
384
  markKeyBackupConfirmed("setup-wizard");
385
385
  }
386
386
  state.completedSteps.push(1);
@@ -534,7 +534,7 @@ async function runSetupWizard(opts = {}) {
534
534
  if (cloudConfig) {
535
535
  config.cloud = cloudConfig;
536
536
  }
537
- const { applyDefaultOrchestrationPhase } = await import("./orchestration-phase-SGA7PJ5G.js");
537
+ const { applyDefaultOrchestrationPhase } = await import("./orchestration-phase-C26XVKLZ.js");
538
538
  applyDefaultOrchestrationPhase(config);
539
539
  await saveConfig(config);
540
540
  log("");
@@ -863,7 +863,7 @@ async function runSetupWizard(opts = {}) {
863
863
  log(" Phase 3: Parallel org \u2014 specialists execute in parallel with reviews");
864
864
  log("");
865
865
  const unlockExecutives = (await askOrEnv("Unlock Phase 2 executives now? (y/N): ", void 0, "n")).toLowerCase() === "y";
866
- const { setOrchestrationPhase } = await import("./orchestration-phase-SGA7PJ5G.js");
866
+ const { setOrchestrationPhase } = await import("./orchestration-phase-C26XVKLZ.js");
867
867
  if (!unlockExecutives) {
868
868
  await setOrchestrationPhase("phase_1_coo", "setup-wizard");
869
869
  log("");
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  listBackups
3
- } from "./chunk-WSHMBME6.js";
3
+ } from "./chunk-AWRL5FGM.js";
4
4
  import {
5
5
  EMBEDDING_DIM
6
6
  } from "./chunk-FXU7JOXK.js";
7
7
  import {
8
8
  EXE_AI_DIR,
9
9
  loadConfigSync
10
- } from "./chunk-TRZ5KA2R.js";
10
+ } from "./chunk-VXIMSRTO.js";
11
11
  import {
12
12
  atomicWriteJson
13
13
  } from "./chunk-LYH5HE24.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeTask
3
- } from "./chunk-PLQAFB3Z.js";
3
+ } from "./chunk-5JIG2FP2.js";
4
4
  import {
5
5
  createTaskCore,
6
6
  employeeSessionName,
@@ -9,11 +9,11 @@ import {
9
9
  isEmployeeAlive,
10
10
  sessionScopeFilter,
11
11
  updateTaskStatus
12
- } from "./chunk-HNLPLLE6.js";
12
+ } from "./chunk-F7JLZXHC.js";
13
13
  import {
14
14
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
15
15
  getCoordinatorName
16
- } from "./chunk-2H55BIV2.js";
16
+ } from "./chunk-CEJO7244.js";
17
17
 
18
18
  // src/runtime/orchestrator.ts
19
19
  var STALE_THRESHOLD_MS = 2 * 60 * 60 * 1e3;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  vectorToBlob
3
- } from "./chunk-FGJUGDNM.js";
3
+ } from "./chunk-222SI7QC.js";
4
4
  import {
5
5
  extractKeywords,
6
6
  keywordsToString
7
7
  } from "./chunk-CHCA3ZM2.js";
8
8
  import {
9
9
  isCoordinatorName
10
- } from "./chunk-2H55BIV2.js";
10
+ } from "./chunk-CEJO7244.js";
11
11
 
12
12
  // src/lib/consolidation.ts
13
13
  import { randomUUID } from "crypto";