@askexenow/exe-os 0.9.312 → 0.9.313

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 (344) hide show
  1. package/deploy/compose/.env.askexe-control-plane.example +1 -1
  2. package/deploy/compose/.env.customer.example +11 -7
  3. package/deploy/compose/.env.default +4 -4
  4. package/deploy/compose/.env.example +7 -7
  5. package/deploy/compose/docker-compose.yml +43 -19
  6. package/deploy/compose/gateway.json +2 -2
  7. package/deploy/compose/init-db.sql +6 -20
  8. package/deploy/compose/setup.sh +74 -132
  9. package/deploy/compose/status.sh +5 -0
  10. package/deploy/stack-manifests/v0.9.json +21 -0
  11. package/dist/{active-agent-ORX47ZKW.js → active-agent-EWF2HJ3W.js} +6 -6
  12. package/dist/{active-agent-S5T2YMOR.js → active-agent-FFN5ARMC.js} +6 -6
  13. package/dist/{agentic-ontology-6KBAXLSJ.js → agentic-ontology-AAUATKUS.js} +1 -1
  14. package/dist/{backfill-metadata-FV7GX6AS.js → backfill-metadata-FBYFDOTH.js} +7 -7
  15. package/dist/{background-jobs-A2LV36UX.js → background-jobs-2QZ5IQKE.js} +5 -3
  16. package/dist/{behaviors-47CPEKJ7.js → behaviors-PQ77IPJR.js} +8 -8
  17. package/dist/bin/age-ontology-load.js +3 -3
  18. package/dist/bin/agentic-ontology-backfill.js +9 -9
  19. package/dist/bin/agentic-reflection-backfill.js +10 -10
  20. package/dist/bin/agentic-semantic-label.js +9 -9
  21. package/dist/bin/backfill-conversations.js +10 -10
  22. package/dist/bin/backfill-responses.js +10 -10
  23. package/dist/bin/backfill-vectors.js +13 -13
  24. package/dist/bin/bulk-sync-postgres.js +16 -16
  25. package/dist/bin/cc-doctor.js +9 -9
  26. package/dist/bin/cleanup-stale-review-tasks.js +15 -15
  27. package/dist/bin/cli.js +21 -21
  28. package/dist/bin/deferred-daemon-restart.js +1 -1
  29. package/dist/bin/exe-agent-config.js +6 -6
  30. package/dist/bin/exe-agent.js +14 -14
  31. package/dist/bin/exe-assign.js +12 -12
  32. package/dist/bin/exe-boot.js +78 -57
  33. package/dist/bin/exe-call.js +7 -7
  34. package/dist/bin/exe-cloud.js +17 -17
  35. package/dist/bin/exe-config-dump.js +7 -7
  36. package/dist/bin/exe-dispatch.js +15 -15
  37. package/dist/bin/exe-doctor.js +11 -2
  38. package/dist/bin/exe-export-behaviors.js +10 -10
  39. package/dist/bin/exe-forget.js +9 -9
  40. package/dist/bin/exe-gateway.js +10 -10
  41. package/dist/bin/exe-healthcheck.js +9 -9
  42. package/dist/bin/exe-heartbeat.js +15 -15
  43. package/dist/bin/exe-kill.js +18 -18
  44. package/dist/bin/exe-launch-agent.js +30 -28
  45. package/dist/bin/exe-new-employee.js +36 -15
  46. package/dist/bin/exe-pending-messages.js +16 -16
  47. package/dist/bin/exe-pending-notifications.js +15 -15
  48. package/dist/bin/exe-pending-reviews.js +15 -15
  49. package/dist/bin/exe-preflight.js +1 -1
  50. package/dist/bin/exe-rename.js +19 -29
  51. package/dist/bin/exe-review.js +17 -17
  52. package/dist/bin/exe-search.js +8 -8
  53. package/dist/bin/exe-session-cleanup.js +41 -20
  54. package/dist/bin/exe-settings.js +18 -18
  55. package/dist/bin/exe-start-codex.js +15 -15
  56. package/dist/bin/exe-start-opencode.js +11 -11
  57. package/dist/bin/exe-status.js +16 -16
  58. package/dist/bin/exe-support.js +5 -5
  59. package/dist/bin/exe-team.js +6 -6
  60. package/dist/bin/exe-watchdog.js +32 -3
  61. package/dist/bin/git-sweep.js +16 -16
  62. package/dist/bin/graph-backfill.js +8 -8
  63. package/dist/bin/graph-export.js +8 -8
  64. package/dist/bin/import-history.js +10 -10
  65. package/dist/bin/install-launchd.js +2 -2
  66. package/dist/bin/install.js +15 -15
  67. package/dist/bin/intercom-check.js +4 -4
  68. package/dist/bin/mcp-sessions.js +2 -2
  69. package/dist/bin/orchestration-metrics.js +7 -7
  70. package/dist/bin/postgres-agentic-reflection-backfill.js +5 -5
  71. package/dist/bin/postgres-agentic-semantic-backfill.js +4 -4
  72. package/dist/bin/pre-build-guard.js +12 -1
  73. package/dist/bin/scan-tasks.js +15 -15
  74. package/dist/bin/setup.js +3 -3
  75. package/dist/bin/shard-migrate.js +8 -8
  76. package/dist/bin/stack-update.js +8 -8
  77. package/dist/bin/verify-stack.js +3 -1
  78. package/dist/bin/vps-health-gate.js +1 -1
  79. package/dist/{branding-SC4BOPUY.js → branding-EDUC7TUP.js} +2 -2
  80. package/dist/{browser-session-store-DV5TDXXD.js → browser-session-store-CXQMOSEC.js} +1 -1
  81. package/dist/{capability-cards-WQVY7WSS.js → capability-cards-2U3XWCDP.js} +5 -5
  82. package/dist/{capacity-monitor-BUKYPSWR.js → capacity-monitor-ZRLW7TVL.js} +16 -16
  83. package/dist/{catchup-brief-X5IVQAOH.js → catchup-brief-FSBZVYPL.js} +18 -18
  84. package/dist/{chunk-PMEOSD6S.js → chunk-24BUDF3J.js} +9 -6
  85. package/dist/{chunk-2NVEKSSP.js → chunk-2FULKRDO.js} +56 -38
  86. package/dist/{chunk-QB5JOGPK.js → chunk-2PI6JBJL.js} +5 -4
  87. package/dist/{chunk-MTIJ2NXY.js → chunk-2PWRUIKZ.js} +1 -1
  88. package/dist/{chunk-NIZQ3CIS.js → chunk-3AMGSCRH.js} +1 -1
  89. package/dist/{chunk-7ODTYODO.js → chunk-3LGID56M.js} +10 -7
  90. package/dist/{chunk-GSY6HL3T.js → chunk-4JI54RHR.js} +5 -5
  91. package/dist/{chunk-ISILDO7P.js → chunk-4THK7IA4.js} +1 -1
  92. package/dist/{chunk-IRIPGGGL.js → chunk-4UHQYBMQ.js} +1 -1
  93. package/dist/{chunk-HQODUV3G.js → chunk-552IGUBB.js} +2 -2
  94. package/dist/{chunk-IRHNV4GY.js → chunk-5KLQCGI5.js} +72 -18
  95. package/dist/{chunk-SOT23KWW.js → chunk-63UEWYM3.js} +4 -4
  96. package/dist/{chunk-QE7UVQDP.js → chunk-6PR2RAKM.js} +1 -1
  97. package/dist/{chunk-ZZXADKAP.js → chunk-6SPUK67A.js} +2 -2
  98. package/dist/{chunk-RVXWGPD3.js → chunk-75TM3APG.js} +29 -6
  99. package/dist/{chunk-IZPO6IOZ.js → chunk-7QSXARI3.js} +1 -1
  100. package/dist/{chunk-A2YZG4AD.js → chunk-AIUXE3ZJ.js} +6 -6
  101. package/dist/{chunk-U63BZI2B.js → chunk-AJERMFD6.js} +3 -3
  102. package/dist/{chunk-BUOMSIXH.js → chunk-BMNX3YWX.js} +2 -2
  103. package/dist/{chunk-YUBTHJVV.js → chunk-BRSMAFBN.js} +1 -1
  104. package/dist/{chunk-JZW5AOWI.js → chunk-BSPALHIR.js} +2 -2
  105. package/dist/{chunk-VDYUKTNS.js → chunk-CLAYNAXC.js} +4 -5
  106. package/dist/{chunk-J3QZPDNH.js → chunk-CNQ25C4C.js} +1 -1
  107. package/dist/{chunk-GWPICNSO.js → chunk-CSTL7BMK.js} +49 -4
  108. package/dist/{chunk-5DPE7B7K.js → chunk-CTYHSVHP.js} +1 -1
  109. package/dist/{chunk-EM4EYF3P.js → chunk-CVTWQZOR.js} +13 -5
  110. package/dist/{chunk-JNARUXDC.js → chunk-CW3FPWUW.js} +2 -2
  111. package/dist/{chunk-V42BSVX6.js → chunk-CWACO2D4.js} +51 -4
  112. package/dist/{chunk-RPBTYQKJ.js → chunk-CWUCD7C7.js} +1 -1
  113. package/dist/{chunk-DFUCFLZH.js → chunk-D4EMVYI7.js} +2 -2
  114. package/dist/{chunk-W2J2RF5N.js → chunk-DIHMGQGV.js} +3 -3
  115. package/dist/{chunk-YB7U4WTY.js → chunk-DJ4RG3RK.js} +2 -2
  116. package/dist/{chunk-KSMITUGY.js → chunk-DR7QPGX4.js} +3 -3
  117. package/dist/{chunk-QNXM2HXW.js → chunk-ELFFRVNL.js} +1 -1
  118. package/dist/{chunk-QEGXNJGR.js → chunk-EV2SMRLF.js} +4 -4
  119. package/dist/{chunk-VFSYVQX4.js → chunk-F3QMXKKJ.js} +8 -2
  120. package/dist/{chunk-NCC3F6GM.js → chunk-F5XPKUPK.js} +2 -2
  121. package/dist/{chunk-43R2GILO.js → chunk-FIBL4JRZ.js} +2 -2
  122. package/dist/{chunk-B2J3BBJC.js → chunk-FQH4R6UG.js} +2 -2
  123. package/dist/{chunk-AC6DKMVS.js → chunk-FSAKWKWU.js} +1 -1
  124. package/dist/{chunk-GL5NU6IK.js → chunk-FXS5OFGH.js} +1 -1
  125. package/dist/{chunk-K7KBAJQL.js → chunk-GHJRLETI.js} +10 -10
  126. package/dist/{chunk-VQRTO7IS.js → chunk-H73TUI4Y.js} +9 -2
  127. package/dist/{chunk-IIHE3FNC.js → chunk-HSXWUZOD.js} +3 -3
  128. package/dist/{chunk-JV225JBX.js → chunk-I6RHLHVW.js} +2 -2
  129. package/dist/{chunk-S6HVQF27.js → chunk-IEDCQRGG.js} +88 -4
  130. package/dist/{chunk-4Q5VNQTV.js → chunk-IFSOVXGN.js} +3 -3
  131. package/dist/{chunk-JMHKK7A5.js → chunk-ITVMRPCQ.js} +1 -1
  132. package/dist/{chunk-VT6P7FV4.js → chunk-IU44MPY3.js} +1 -1
  133. package/dist/{chunk-6OD2RVIA.js → chunk-IXTDBQYU.js} +273 -397
  134. package/dist/{chunk-2NGPZCWX.js → chunk-JB7QUK3D.js} +3 -3
  135. package/dist/{chunk-VT2B5BHM.js → chunk-JBSCL2XT.js} +2 -1
  136. package/dist/{chunk-MPX3TRMQ.js → chunk-JD5S5AAV.js} +1 -1
  137. package/dist/{chunk-XYG722JW.js → chunk-JIJKUZIO.js} +3 -3
  138. package/dist/{chunk-KMIAYKIH.js → chunk-K5C6LC2G.js} +159 -39
  139. package/dist/{chunk-DAOHCXM2.js → chunk-KH6BCYLC.js} +1 -1
  140. package/dist/{chunk-4L4R6AQJ.js → chunk-KMI4TUTW.js} +1 -1
  141. package/dist/{chunk-PHFPIUWU.js → chunk-KWOAM7TA.js} +3 -0
  142. package/dist/{chunk-RZJ6DXVE.js → chunk-L6QI2NNG.js} +1 -1
  143. package/dist/{chunk-HED6D5KR.js → chunk-MMNMQNLD.js} +43 -29
  144. package/dist/{chunk-KAVUTP5G.js → chunk-N3CRJ2VW.js} +3 -3
  145. package/dist/{chunk-OBJXZII2.js → chunk-N7LBAQGK.js} +3 -3
  146. package/dist/{chunk-LMX7UKGX.js → chunk-OUAGTQC4.js} +17 -11
  147. package/dist/{chunk-WZBUKC5N.js → chunk-OUJI2ZTY.js} +2 -2
  148. package/dist/{chunk-YUGLOZOR.js → chunk-OXTZEKVA.js} +1 -1
  149. package/dist/{chunk-OR3TAZL3.js → chunk-P4ULFI2N.js} +1 -1
  150. package/dist/{chunk-6LNSZADA.js → chunk-PVC4RNHQ.js} +50 -11
  151. package/dist/{chunk-FM7XZDZI.js → chunk-R2WP3XIN.js} +1 -1
  152. package/dist/{chunk-IBDPPBFK.js → chunk-R5IPZ5ZC.js} +1 -1
  153. package/dist/{chunk-7WDIGRSO.js → chunk-R5TZ2FC3.js} +1 -1
  154. package/dist/{chunk-2UVN2NBN.js → chunk-RICNNGYH.js} +3 -3
  155. package/dist/{chunk-WBJXJ2R4.js → chunk-RLBVY5FE.js} +17 -14
  156. package/dist/{chunk-XXJRZ75E.js → chunk-RV634O2W.js} +5 -2
  157. package/dist/{chunk-3KH6GXXX.js → chunk-RYPFOZQH.js} +2 -2
  158. package/dist/{chunk-DNFU56ZS.js → chunk-SB7W6XI4.js} +1 -1
  159. package/dist/{chunk-PPXQE7AS.js → chunk-SE6MLUOK.js} +33 -34
  160. package/dist/{chunk-65DBIEM2.js → chunk-SHIICYJW.js} +7 -1
  161. package/dist/{chunk-KPVVTHPK.js → chunk-SRMNWAHN.js} +15 -10
  162. package/dist/chunk-T2DJR7ND.js +367 -0
  163. package/dist/{chunk-Z6H6Y4BS.js → chunk-TA22MGGN.js} +1 -1
  164. package/dist/{chunk-ZOVHXTGC.js → chunk-TN7SC2ZQ.js} +1 -1
  165. package/dist/{chunk-XV5HRIXG.js → chunk-TRPGNCVB.js} +8 -8
  166. package/dist/{chunk-4BANMHJ5.js → chunk-UDZP2SHJ.js} +3 -3
  167. package/dist/{chunk-GMZMBLHT.js → chunk-UM6WUSQ7.js} +2 -2
  168. package/dist/{chunk-2EJ636HI.js → chunk-UST3MKK7.js} +1 -1
  169. package/dist/{chunk-RQ7OVXUZ.js → chunk-V2CZVZUO.js} +2 -2
  170. package/dist/{chunk-4RJJ5FJ2.js → chunk-V4UKBUUA.js} +1 -1
  171. package/dist/{chunk-EOS7VPVT.js → chunk-VA2MDALR.js} +8 -8
  172. package/dist/{chunk-SCYWCWKY.js → chunk-VG4ZH2Z3.js} +24 -10
  173. package/dist/{chunk-255DIG4B.js → chunk-VHLI6CTD.js} +1 -1
  174. package/dist/{chunk-DFIOOK5R.js → chunk-WCES22KG.js} +4 -3
  175. package/dist/{chunk-5A6KTWQL.js → chunk-WOTKNUKK.js} +126 -2
  176. package/dist/{chunk-62UZWGFX.js → chunk-WZZBGGSD.js} +63 -2
  177. package/dist/{chunk-ELXR65AN.js → chunk-X2FHTDIU.js} +6 -3
  178. package/dist/{chunk-V4BW5HFQ.js → chunk-X5I5QRC2.js} +3 -3
  179. package/dist/{chunk-X4AFBL4N.js → chunk-XCORXJ3M.js} +1 -1
  180. package/dist/{chunk-66JPZELX.js → chunk-Y5CNGG4F.js} +24 -16
  181. package/dist/{chunk-SPOXL7HF.js → chunk-YEWNIBNA.js} +9 -9
  182. package/dist/{chunk-WJ2PZGRV.js → chunk-ZAA344BL.js} +29 -2
  183. package/dist/{chunk-TN2YCFQE.js → chunk-ZGLJ2VD7.js} +5 -5
  184. package/dist/{co-activation-WN25AJOC.js → co-activation-RH46OQ3N.js} +5 -5
  185. package/dist/{co-occurrence-YP2Q3OEA.js → co-occurrence-MJWERUWY.js} +5 -5
  186. package/dist/{code-context-index-ZWONKBKX.js → code-context-index-WFUBYGQT.js} +6 -6
  187. package/dist/{content-extractor-EYRVGD6O.js → content-extractor-RHITF2KM.js} +1 -1
  188. package/dist/{conversation-wiki-populator-XFUC7S5P.js → conversation-wiki-populator-SK233TL4.js} +1 -1
  189. package/dist/{crdt-sync-ZFIFL2QM.js → crdt-sync-4R7SXTNB.js} +1 -1
  190. package/dist/{crm-webhook-DGPHULOO.js → crm-webhook-YDXX5FDK.js} +2 -2
  191. package/dist/{cto-delegation-gate-OF2A3TSS.js → cto-delegation-gate-ZJHLPK4Y.js} +14 -14
  192. package/dist/{daemon-auth-N6P2MZAV.js → daemon-auth-5FCYVQIZ.js} +3 -3
  193. package/dist/{daemon-orchestration-G4RRTPP7.js → daemon-orchestration-NBU5RZ2O.js} +18 -18
  194. package/dist/{daemon-ready-signal-3L2MJT7C.js → daemon-ready-signal-KXLL6ZFL.js} +1 -1
  195. package/dist/{db-backup-EORG4LBO.js → db-backup-BTL2FBBL.js} +9 -3
  196. package/dist/{db-restore-events-3R7G4FP4.js → db-restore-events-3A57GMLW.js} +2 -2
  197. package/dist/{doc-graph-extractor-APZS3DFD.js → doc-graph-extractor-ADYRG7DB.js} +5 -5
  198. package/dist/documents-VWPZTDFA.js +56 -0
  199. package/dist/{dreaming-Q4E3WBGY.js → dreaming-76WKGTL6.js} +15 -15
  200. package/dist/embeddings-config-FANLORDH.js +21 -0
  201. package/dist/{exe-drift-CI5R6GUT.js → exe-drift-T3IO2SPX.js} +6 -6
  202. package/dist/{exe-export-HQIQASIT.js → exe-export-6YEHSJMP.js} +9 -9
  203. package/dist/{exe-import-ULZK56WC.js → exe-import-3NERK63O.js} +9 -9
  204. package/dist/{exe-key-ILNSBGRN.js → exe-key-RCMBMLSQ.js} +8 -8
  205. package/dist/{exe-org-WQWQZRLR.js → exe-org-KCOOLUTW.js} +3 -3
  206. package/dist/{exe-snapshot-RUZTWZOF.js → exe-snapshot-JIY7MNRI.js} +18 -18
  207. package/dist/{fast-db-init-KNJRL7T3.js → fast-db-init-PVJ72264.js} +1 -1
  208. package/dist/{founder-context-QCTMEK66.js → founder-context-A4VUEKDH.js} +4 -4
  209. package/dist/gateway/index.js +17 -17
  210. package/dist/{git-staleness-KIA5YI4H.js → git-staleness-IOAHAGBI.js} +5 -5
  211. package/dist/{git-task-sweep-WH6QE7HL.js → git-task-sweep-IGM5RILF.js} +17 -15
  212. package/dist/{global-procedures-SYZZCGDS.js → global-procedures-VZL2X4RK.js} +6 -6
  213. package/dist/{graph-auto-extract-J2TIWZEE.js → graph-auto-extract-TIXRGBC5.js} +5 -5
  214. package/dist/{hook-integrity-I6PWJQER.js → hook-integrity-XNPNCMAS.js} +1 -1
  215. package/dist/hooks/bug-report-worker.js +47 -17
  216. package/dist/hooks/codex-stop-task-finalizer.js +47 -17
  217. package/dist/hooks/commit-complete.js +18 -18
  218. package/dist/hooks/error-recall.js +11 -11
  219. package/dist/hooks/exe-heartbeat-hook.js +7 -7
  220. package/dist/hooks/ingest-worker.js +39 -9
  221. package/dist/hooks/ingest.js +17 -17
  222. package/dist/hooks/instructions-loaded.js +8 -8
  223. package/dist/hooks/manifest.json +20 -20
  224. package/dist/hooks/notification.js +8 -8
  225. package/dist/hooks/post-compact.js +17 -17
  226. package/dist/hooks/post-tool-combined.js +60 -7
  227. package/dist/hooks/pre-compact.js +23 -23
  228. package/dist/hooks/pre-tool-use.js +64 -34
  229. package/dist/hooks/prompt-submit.js +40 -32
  230. package/dist/hooks/session-end.js +29 -29
  231. package/dist/hooks/session-start.js +17 -17
  232. package/dist/hooks/stop.js +24 -24
  233. package/dist/hooks/subagent-stop.js +17 -17
  234. package/dist/hooks/summary-worker.js +55 -25
  235. package/dist/index.js +27 -27
  236. package/dist/{installer-PSDYMGN7.js → installer-D7D5O4KL.js} +10 -10
  237. package/dist/{installer-3NB3IBHF.js → installer-EQP2EMNZ.js} +10 -10
  238. package/dist/{installer-IIJFCTMH.js → installer-IWRYH55Z.js} +10 -10
  239. package/dist/{key-backup-status-FNSN3NXH.js → key-backup-status-ZNGDSPLT.js} +2 -2
  240. package/dist/lib/agent-config.js +3 -3
  241. package/dist/lib/cloud-sync.js +16 -16
  242. package/dist/lib/config.js +2 -2
  243. package/dist/lib/consolidation.js +8 -8
  244. package/dist/lib/database.js +7 -5
  245. package/dist/lib/db-daemon-client.js +6 -6
  246. package/dist/lib/db.js +7 -5
  247. package/dist/lib/device-registry.js +3 -3
  248. package/dist/lib/embed-worker.js +2 -2
  249. package/dist/lib/embedder.js +6 -6
  250. package/dist/lib/employee-templates.js +7 -7
  251. package/dist/lib/employees.js +5 -5
  252. package/dist/lib/exe-daemon-client.js +5 -5
  253. package/dist/lib/exe-daemon.js +449 -89
  254. package/dist/lib/hybrid-search.js +8 -8
  255. package/dist/lib/identity.js +5 -5
  256. package/dist/lib/license.js +4 -4
  257. package/dist/lib/messaging.js +15 -15
  258. package/dist/lib/post-tool-memory.js +2 -2
  259. package/dist/lib/reminders.js +6 -6
  260. package/dist/lib/schedules.js +8 -8
  261. package/dist/lib/session-registry.js +9 -7
  262. package/dist/lib/session-wrappers.js +1 -1
  263. package/dist/lib/skill-learning.js +9 -9
  264. package/dist/lib/store.js +7 -7
  265. package/dist/lib/task-router.js +6 -6
  266. package/dist/lib/tasks.js +16 -16
  267. package/dist/lib/tmux-routing.js +14 -14
  268. package/dist/lib/token-spend.js +6 -6
  269. package/dist/{license-gate-7SDHCJUO.js → license-gate-PZOP7S2S.js} +5 -5
  270. package/dist/mcp/register-tools.js +73 -72
  271. package/dist/mcp/server.js +74 -73
  272. package/dist/mcp/tools/complete-reminder.js +7 -7
  273. package/dist/mcp/tools/create-reminder.js +7 -7
  274. package/dist/mcp/tools/create-task.js +18 -18
  275. package/dist/mcp/tools/deactivate-behavior.js +10 -10
  276. package/dist/mcp/tools/list-reminders.js +7 -7
  277. package/dist/mcp/tools/list-tasks.js +18 -18
  278. package/dist/mcp/tools/send-message.js +17 -17
  279. package/dist/mcp/tools/update-task.js +17 -17
  280. package/dist/{mcp-http-config-QSOVFXHW.js → mcp-http-config-23DHJAU4.js} +7 -7
  281. package/dist/{mcp-port-config-AWWRZA22.js → mcp-port-config-FFAMMLLE.js} +2 -1
  282. package/dist/{memory-cards-II67WFL2.js → memory-cards-CNLMHSZC.js} +5 -5
  283. package/dist/{memory-graph-extractor-PM4Q2KJG.js → memory-graph-extractor-HIXP2BQS.js} +6 -6
  284. package/dist/{memory-poisoning-defense-ECXSX7HK.js → memory-poisoning-defense-YL53IBBF.js} +5 -5
  285. package/dist/{memory-queue-VAE6WMSS.js → memory-queue-3Q5P43AM.js} +3 -3
  286. package/dist/memory-queue-client-YP2QKX6J.js +16 -0
  287. package/dist/{memory-reflection-PXF6YFDU.js → memory-reflection-VHQRUZWK.js} +5 -5
  288. package/dist/{notifications-UP7WQGG4.js → notifications-Q5NEAP6K.js} +14 -14
  289. package/dist/{orchestration-events-PZLLPCKY.js → orchestration-events-7SNWRJYE.js} +6 -6
  290. package/dist/{orchestration-phase-SJOXDB7X.js → orchestration-phase-U45T4VG3.js} +3 -3
  291. package/dist/{orchestrator-PUT45J4O.js → orchestrator-XWLKNWUG.js} +16 -16
  292. package/dist/{pipeline-router-5CRWKESM.js → pipeline-router-5IBJBH7P.js} +6 -6
  293. package/dist/{plan-limits-SH2NDFNX.js → plan-limits-PBEZVHRQ.js} +8 -8
  294. package/dist/{preferences-YWBTKW3M.js → preferences-TYTGDXQZ.js} +2 -2
  295. package/dist/{project-boot-2TCPDZ4S.js → project-boot-OHEGJD2L.js} +2 -2
  296. package/dist/{projection-worker-HWY37MNC.js → projection-worker-HELRBNDR.js} +5 -5
  297. package/dist/{prospective-memory-FQSVMCGG.js → prospective-memory-N55XRGJP.js} +5 -5
  298. package/dist/{push-notifications-DK6XA5B3.js → push-notifications-PAFNP3EC.js} +3 -3
  299. package/dist/{reranker-AALRMGMM.js → reranker-MNJSTOPR.js} +3 -3
  300. package/dist/{retrieval-health-PNWJSJNG.js → retrieval-health-W4HNR3WX.js} +1 -1
  301. package/dist/{review-polling-65JZUE3T.js → review-polling-SRYZU2PI.js} +15 -15
  302. package/dist/runtime/index.js +22 -22
  303. package/dist/{session-events-EJ3OSAA6.js → session-events-L4DK5J6J.js} +15 -15
  304. package/dist/{session-kill-telemetry-3HGM7SNQ.js → session-kill-telemetry-U2YHKHCB.js} +15 -15
  305. package/dist/{session-scope-JGDYAMJO.js → session-scope-JTPHECAU.js} +14 -14
  306. package/dist/{setup-wizard-44LMFM2C.js → setup-wizard-IP5R66LR.js} +3 -3
  307. package/dist/{shard-manager-KUCJPLC6.js → shard-manager-RASGFMGS.js} +3 -3
  308. package/dist/{skill-refinement-DUOO6B7V.js → skill-refinement-VTYL4OMJ.js} +5 -5
  309. package/dist/{stack-release-XYMKU7NT.js → stack-release-TOCCJQOF.js} +244 -45
  310. package/dist/{stack-update-TUBZTY7Z.js → stack-update-MRNVHUZZ.js} +11 -5
  311. package/dist/{steward-gate-6NWRDLX2.js → steward-gate-JEVUDTBI.js} +6 -6
  312. package/dist/{task-enforcement-UOULTGFB.js → task-enforcement-VFSAAZUN.js} +14 -14
  313. package/dist/{task-scope-P5STKYAC.js → task-scope-P4VLIQNP.js} +14 -14
  314. package/dist/{tasks-crud-24HMTULR.js → tasks-crud-SC3ERIUR.js} +14 -14
  315. package/dist/{tasks-notify-LAIU7UUI.js → tasks-notify-WJYBUCIB.js} +15 -15
  316. package/dist/{tasks-review-AFJAU2DY.js → tasks-review-XPVPHCGD.js} +14 -14
  317. package/dist/{telemetry-upload-DWFGC2XJ.js → telemetry-upload-4QEYQROW.js} +10 -10
  318. package/dist/{token-budget-4RFZKWGH.js → token-budget-UBOP3HVE.js} +6 -6
  319. package/dist/{tool-capability-index-ZEXBWKUZ.js → tool-capability-index-SHYCBE2Z.js} +1 -1
  320. package/dist/{tool-telemetry-BS5JXM5M.js → tool-telemetry-CDNPES5B.js} +1 -1
  321. package/dist/tui/App.js +27 -27
  322. package/dist/{tui-data-UNO5B7PU.js → tui-data-HVYY7GRK.js} +14 -14
  323. package/dist/{worker-gate-C6CTTYMD.js → worker-gate-KQTODSUQ.js} +3 -3
  324. package/dist/{workflow-engine-4W2KYCDV.js → workflow-engine-OP2DQISD.js} +2 -2
  325. package/dist/{working-memory-FXHQCJJE.js → working-memory-PY4AG577.js} +22 -2
  326. package/dist/{worktree-2CXY6NEB.js → worktree-Z2G4CP4Z.js} +7 -7
  327. package/dist/{worktree-sweep-K3CJFSUL.js → worktree-sweep-LWSCAZW6.js} +8 -8
  328. package/package.json +2 -2
  329. package/release-notes.json +56 -113
  330. package/stack.release.json +7 -7
  331. package/dist/memory-queue-client-HLURQEV6.js +0 -16
  332. /package/dist/{chunk-J3SR5MGG.js → chunk-GIS4GBZE.js} +0 -0
  333. /package/dist/{chunk-AE74NOE6.js → chunk-NAPBIDGH.js} +0 -0
  334. /package/dist/{chunk-I3DPCSDG.js → chunk-OJS2H5HR.js} +0 -0
  335. /package/dist/{chunk-K4BKJJ4F.js → chunk-PCRRDXGL.js} +0 -0
  336. /package/dist/{chunk-MQCTK6EF.js → chunk-RRYJTPVW.js} +0 -0
  337. /package/dist/{chunk-2NS3QRMJ.js → chunk-ZIVUMDHA.js} +0 -0
  338. /package/dist/{core-memory-OC5ITKKV.js → core-memory-4JWCAGJI.js} +0 -0
  339. /package/dist/{entity-boost-NF3LE6OJ.js → entity-boost-AU342QRK.js} +0 -0
  340. /package/dist/{message-queue-client-4VDU6BZY.js → message-queue-client-IXYLJJVJ.js} +0 -0
  341. /package/dist/{oauth-server-EWUL7DMD.js → oauth-server-F4QWESK2.js} +0 -0
  342. /package/dist/{webhook-pipe-DHIGZHPW.js → webhook-pipe-S4CWK6H5.js} +0 -0
  343. /package/dist/{wiki-acl-CONNF6ES.js → wiki-acl-6GZHUA44.js} +0 -0
  344. /package/dist/{wiki-client-N6PT5P7W.js → wiki-client-CIJXRMKL.js} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  isExeSession
3
- } from "./chunk-HED6D5KR.js";
3
+ } from "./chunk-MMNMQNLD.js";
4
4
  import {
5
5
  recordOrchestrationEventBestEffort
6
- } from "./chunk-OR3TAZL3.js";
6
+ } from "./chunk-P4ULFI2N.js";
7
7
  import {
8
8
  getClient,
9
9
  isCoordinatorName
10
- } from "./chunk-SCYWCWKY.js";
10
+ } from "./chunk-VG4ZH2Z3.js";
11
11
  import {
12
12
  isDaemonAlive
13
13
  } from "./chunk-7HLWBYH7.js";
@@ -128,11 +128,14 @@ async function recordSessionKill(input) {
128
128
  }
129
129
  async function countKillsSince(sinceISO) {
130
130
  try {
131
+ const { offloadReadIfMain } = await import("./lib/database.js");
131
132
  const client = getClient();
132
- const result = await client.execute({
133
- sql: `SELECT COUNT(*) AS n FROM session_kills WHERE killed_at >= ?`,
134
- args: [sinceISO]
135
- });
133
+ const result = await offloadReadIfMain(
134
+ client,
135
+ `SELECT COUNT(*) AS n FROM session_kills WHERE killed_at >= ?`,
136
+ [sinceISO],
137
+ true
138
+ );
136
139
  const row = result.rows[0];
137
140
  return row ? Number(row.n) : 0;
138
141
  } catch {
@@ -169,13 +172,16 @@ function computeIdleKillSuspectStreak(prev, killsToday, liveSessions, todayDate)
169
172
  }
170
173
  async function sumTokensSavedSince(sinceISO) {
171
174
  try {
175
+ const { offloadReadIfMain } = await import("./lib/database.js");
172
176
  const client = getClient();
173
- const result = await client.execute({
174
- sql: `SELECT COALESCE(SUM(estimated_tokens_saved), 0) AS total
177
+ const result = await offloadReadIfMain(
178
+ client,
179
+ `SELECT COALESCE(SUM(estimated_tokens_saved), 0) AS total
175
180
  FROM session_kills
176
181
  WHERE killed_at >= ?`,
177
- args: [sinceISO]
178
- });
182
+ [sinceISO],
183
+ true
184
+ );
179
185
  const row = result.rows[0];
180
186
  return row ? Number(row.total) : 0;
181
187
  } catch {
@@ -7,10 +7,10 @@ import {
7
7
  import {
8
8
  connectEmbedDaemon,
9
9
  embedBatchViaClient
10
- } from "./chunk-PPXQE7AS.js";
10
+ } from "./chunk-SE6MLUOK.js";
11
11
  import {
12
12
  EXE_AI_DIR
13
- } from "./chunk-DFIOOK5R.js";
13
+ } from "./chunk-WCES22KG.js";
14
14
 
15
15
  // src/lib/code-context-index.ts
16
16
  import crypto from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EXE_AI_DIR
3
- } from "./chunk-DFIOOK5R.js";
3
+ } from "./chunk-WCES22KG.js";
4
4
 
5
5
  // src/lib/memory-queue.ts
6
6
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-SCYWCWKY.js";
3
+ } from "./chunk-VG4ZH2Z3.js";
4
4
 
5
5
  // src/lib/orchestration-events.ts
6
6
  import crypto from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  recordSessionKill
3
- } from "./chunk-LMX7UKGX.js";
3
+ } from "./chunk-OUAGTQC4.js";
4
4
  import {
5
5
  updateTask
6
- } from "./chunk-EOS7VPVT.js";
6
+ } from "./chunk-VA2MDALR.js";
7
7
  import {
8
8
  ensureEmployeeAsync,
9
9
  extractRootExe,
@@ -14,7 +14,7 @@ import {
14
14
  sessionScopeFilter,
15
15
  strictSessionScopeFilter,
16
16
  writeNotification
17
- } from "./chunk-HED6D5KR.js";
17
+ } from "./chunk-MMNMQNLD.js";
18
18
  import {
19
19
  queueIntercom
20
20
  } from "./chunk-4FVVJ7ME.js";
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-E23LNUWJ.js";
24
24
  import {
25
25
  listSessions
26
- } from "./chunk-WJ2PZGRV.js";
26
+ } from "./chunk-ZAA344BL.js";
27
27
  import {
28
28
  listTmuxSessions,
29
29
  parseContextPercentage
@@ -33,19 +33,19 @@ import {
33
33
  } from "./chunk-KOO3J5PV.js";
34
34
  import {
35
35
  recordOrchestrationEventBestEffort
36
- } from "./chunk-OR3TAZL3.js";
36
+ } from "./chunk-P4ULFI2N.js";
37
37
  import {
38
38
  getAgentRuntime
39
- } from "./chunk-QB5JOGPK.js";
39
+ } from "./chunk-2PI6JBJL.js";
40
40
  import {
41
41
  baseAgentName,
42
42
  getCoordinatorName,
43
43
  isCoordinatorName,
44
44
  shouldAutoInstance
45
- } from "./chunk-SCYWCWKY.js";
45
+ } from "./chunk-VG4ZH2Z3.js";
46
46
  import {
47
47
  loadConfigSync
48
- } from "./chunk-DFIOOK5R.js";
48
+ } from "./chunk-WCES22KG.js";
49
49
 
50
50
  // src/lib/daemon-orchestration.ts
51
51
  import { execFile, execFileSync, execSync } from "child_process";
@@ -669,10 +669,11 @@ function _resetAutoWakeState() {
669
669
  }
670
670
  function checkAutoWakeGates(key, nowMs) {
671
671
  try {
672
+ const blockWindowMs = parseInt(process.env.EXE_AUTOWAKE_BLOCK_WINDOW_MS ?? "", 10) || 15e3;
672
673
  const lagMarker = join(homedir(), ".exe-os", "session-cache", "event-loop-blocked.marker");
673
674
  if (existsSync2(lagMarker)) {
674
675
  const age = nowMs - statSync2(lagMarker).mtimeMs;
675
- if (age < 6e4) return "daemon_event_loop_blocked";
676
+ if (age < blockWindowMs && age > -blockWindowMs) return "daemon_event_loop_blocked";
676
677
  }
677
678
  } catch {
678
679
  }
@@ -856,6 +857,25 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
856
857
  `[auto-wake] Failed to spawn ${agentId}: ${result.error ?? "unknown"}
857
858
  `
858
859
  );
860
+ recordOrchestrationEventBestEffort({
861
+ eventType: "auto_wake.spawn_failed",
862
+ source: "daemon-orchestration.pollOrphanedTasks",
863
+ severity: "warn",
864
+ agentId,
865
+ sessionScope,
866
+ payload: { error: result.error ?? "unknown", taskId: topTask.taskId, attempt: retries + 1 }
867
+ });
868
+ try {
869
+ await writeNotification({
870
+ agentId,
871
+ agentRole: "employee",
872
+ event: "error_spike",
873
+ project: String(topTask.sessionScope ?? ""),
874
+ summary: `Auto-wake spawn failed for ${agentId} (attempt ${retries + 1}): ${(result.error ?? "unknown").slice(0, 200)}`,
875
+ sessionScope
876
+ });
877
+ } catch {
878
+ }
859
879
  continue;
860
880
  }
861
881
  _autoWakeLastSpawn.set(key, nowMs);
@@ -871,6 +891,25 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
871
891
  `[auto-wake] Error spawning ${agentId}: ${err instanceof Error ? err.message : String(err)}
872
892
  `
873
893
  );
894
+ recordOrchestrationEventBestEffort({
895
+ eventType: "auto_wake.spawn_error",
896
+ source: "daemon-orchestration.pollOrphanedTasks",
897
+ severity: "error",
898
+ agentId,
899
+ sessionScope,
900
+ payload: { error: err instanceof Error ? err.message : String(err), taskId: topTask.taskId, attempt: retries + 1 }
901
+ });
902
+ try {
903
+ await writeNotification({
904
+ agentId,
905
+ agentRole: "employee",
906
+ event: "error_spike",
907
+ project: String(topTask.sessionScope ?? ""),
908
+ summary: `Auto-wake spawn error for ${agentId} (attempt ${retries + 1}): ${(err instanceof Error ? err.message : String(err)).slice(0, 200)}`,
909
+ sessionScope
910
+ });
911
+ } catch {
912
+ }
874
913
  }
875
914
  }
876
915
  return woken;
@@ -1900,7 +1939,7 @@ async function reapOrphanedWorktrees(deps, nowMs = Date.now()) {
1900
1939
  }
1901
1940
  async function createWorktreeReaperRealDeps() {
1902
1941
  const { getPaneCwdAsync } = await import("./lib/tmux-status.js");
1903
- const { getGitRoot, isWorktreeDirty: isDirty } = await import("./worktree-2CXY6NEB.js");
1942
+ const { getGitRoot, isWorktreeDirty: isDirty } = await import("./worktree-Z2G4CP4Z.js");
1904
1943
  const { statSync: statSync3 } = await import("fs");
1905
1944
  const { basename } = await import("path");
1906
1945
  const { promisify: promisify2 } = await import("util");
@@ -2084,7 +2123,7 @@ async function gcStaleCheckpoints() {
2084
2123
  }
2085
2124
  async function pollTaskGroupBarriers() {
2086
2125
  try {
2087
- const { checkAndFireBarriers } = await import("./tasks-crud-24HMTULR.js");
2126
+ const { checkAndFireBarriers } = await import("./tasks-crud-SC3ERIUR.js");
2088
2127
  const firedGroupIds = await checkAndFireBarriers();
2089
2128
  if (firedGroupIds.length === 0) return 0;
2090
2129
  const { getClient } = await import("./lib/database.js");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  writeMemoryViaDaemon
3
- } from "./chunk-NCC3F6GM.js";
3
+ } from "./chunk-F5XPKUPK.js";
4
4
 
5
5
  // src/lib/auto-checkpoint.ts
6
6
  var FILE_RE = /(?:^|\s)([\w./-]+\.(?:ts|tsx|js|jsx|json|md|yml|yaml|sql|go|py|css|scss|html|sh))(?:\b|$)/g;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadConfigSync
3
- } from "./chunk-DFIOOK5R.js";
3
+ } from "./chunk-WCES22KG.js";
4
4
 
5
5
  // src/lib/push-notifications.ts
6
6
  import { execSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  clean,
3
3
  stableId
4
- } from "./chunk-AE74NOE6.js";
4
+ } from "./chunk-NAPBIDGH.js";
5
5
 
6
6
  // src/lib/reflection-checkpoints.ts
7
7
  function parsePayload(payload) {
@@ -9,13 +9,13 @@ import {
9
9
  import {
10
10
  readMcpHttpEvents,
11
11
  summarizeMcpTransport
12
- } from "./chunk-5A6KTWQL.js";
12
+ } from "./chunk-WOTKNUKK.js";
13
13
  import {
14
14
  mcpHttpPort
15
- } from "./chunk-JZW5AOWI.js";
15
+ } from "./chunk-BSPALHIR.js";
16
16
  import {
17
17
  EXE_AI_DIR
18
- } from "./chunk-DFIOOK5R.js";
18
+ } from "./chunk-WCES22KG.js";
19
19
  import {
20
20
  isMainModule
21
21
  } from "./chunk-6Y4B3QF6.js";
@@ -9,7 +9,7 @@ import {
9
9
  findScopedDuplicate,
10
10
  governMemoryRecord,
11
11
  schedulePostWriteMemoryHygiene
12
- } from "./chunk-MQCTK6EF.js";
12
+ } from "./chunk-RRYJTPVW.js";
13
13
  import {
14
14
  orgBus
15
15
  } from "./chunk-MP2AFCGL.js";
@@ -18,7 +18,7 @@ import {
18
18
  ensureSchema,
19
19
  getClient,
20
20
  initTurso
21
- } from "./chunk-SCYWCWKY.js";
21
+ } from "./chunk-VG4ZH2Z3.js";
22
22
  import {
23
23
  EMBEDDING_DIM
24
24
  } from "./chunk-FXU7JOXK.js";
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-Z42MXYWW.js";
28
28
  import {
29
29
  loadConfig
30
- } from "./chunk-DFIOOK5R.js";
30
+ } from "./chunk-WCES22KG.js";
31
31
 
32
32
  // src/lib/store.ts
33
33
  var _debugStore = process.env.EXE_DEBUG === "1";
@@ -68,7 +68,7 @@ function recordShardFailure(project, error) {
68
68
  `[store] Shard circuit OPEN for "${project}" after ${state.failures} consecutive failures. Will retry in ${SHARD_CB_COOLDOWN_MS / 6e4}min. Last error: ${error}
69
69
  `
70
70
  );
71
- void import("./orchestration-events-PZLLPCKY.js").then(({ recordOrchestrationEventBestEffort }) => {
71
+ void import("./orchestration-events-7SNWRJYE.js").then(({ recordOrchestrationEventBestEffort }) => {
72
72
  recordOrchestrationEventBestEffort({
73
73
  eventType: "shard.circuit_open",
74
74
  source: "store.recordShardFailure",
@@ -152,7 +152,7 @@ async function initStore(options) {
152
152
  if (!options?.lightweight) {
153
153
  try {
154
154
  if (process.env.EXE_DISABLE_SHARDING !== "1") {
155
- const { initShardManager } = await import("./shard-manager-KUCJPLC6.js");
155
+ const { initShardManager } = await import("./shard-manager-RASGFMGS.js");
156
156
  initShardManager(hexKey);
157
157
  }
158
158
  } catch (e) {
@@ -165,7 +165,7 @@ async function initStore(options) {
165
165
  );
166
166
  _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
167
167
  try {
168
- const { loadGlobalProcedures } = await import("./global-procedures-SYZZCGDS.js");
168
+ const { loadGlobalProcedures } = await import("./global-procedures-VZL2X4RK.js");
169
169
  await loadGlobalProcedures();
170
170
  } catch (e) {
171
171
  logStoreWarn("catch", e);
@@ -293,7 +293,7 @@ async function writeMemory(record) {
293
293
  founder_id: record.founder_id ?? null
294
294
  };
295
295
  try {
296
- const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-ECXSX7HK.js");
296
+ const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-YL53IBBF.js");
297
297
  const poisonResult = await checkMemoryPoisoning({
298
298
  memoryId: dbRow.id,
299
299
  vector: Array.isArray(dbRow.vector) ? dbRow.vector : void 0,
@@ -486,19 +486,19 @@ async function flushBatch() {
486
486
  }
487
487
  _nextVersion = baseVersion;
488
488
  try {
489
- const { insertMemoryCardsForBatch } = await import("./memory-cards-II67WFL2.js");
489
+ const { insertMemoryCardsForBatch } = await import("./memory-cards-CNLMHSZC.js");
490
490
  await insertMemoryCardsForBatch(batch);
491
491
  } catch (e) {
492
492
  logStoreWarn("catch", e);
493
493
  }
494
494
  try {
495
- const { insertOntologyForBatch } = await import("./agentic-ontology-6KBAXLSJ.js");
495
+ const { insertOntologyForBatch } = await import("./agentic-ontology-AAUATKUS.js");
496
496
  await insertOntologyForBatch(batch);
497
497
  } catch (e) {
498
498
  logStoreWarn("catch", e);
499
499
  }
500
500
  try {
501
- const { extractGraphForBatch } = await import("./memory-graph-extractor-PM4Q2KJG.js");
501
+ const { extractGraphForBatch } = await import("./memory-graph-extractor-HIXP2BQS.js");
502
502
  await extractGraphForBatch(batch);
503
503
  } catch (e) {
504
504
  logStoreWarn("catch", e);
@@ -506,7 +506,7 @@ async function flushBatch() {
506
506
  schedulePostWriteMemoryHygiene(batch.map((row) => row.id));
507
507
  _pendingRecords.splice(0, batch.length);
508
508
  try {
509
- const { isShardingEnabled, getReadyShardClient } = await import("./shard-manager-KUCJPLC6.js");
509
+ const { isShardingEnabled, getReadyShardClient } = await import("./shard-manager-RASGFMGS.js");
510
510
  if (process.env.EXE_DISABLE_SHARDING !== "1" && isShardingEnabled()) {
511
511
  const byProject = /* @__PURE__ */ new Map();
512
512
  let skippedUnknown = 0;
@@ -588,10 +588,12 @@ function buildRawVisibilityFilter(options, columnPrefix) {
588
588
  }
589
589
  async function searchMemories(queryVector, agentId, options) {
590
590
  let client;
591
+ let isMainDb = true;
591
592
  try {
592
- const { isShardingEnabled, shardExists, getReadyShardClient } = await import("./shard-manager-KUCJPLC6.js");
593
+ const { isShardingEnabled, shardExists, getReadyShardClient } = await import("./shard-manager-RASGFMGS.js");
593
594
  if (isShardingEnabled() && options?.projectName && shardExists(options.projectName)) {
594
595
  client = await getReadyShardClient(options.projectName);
596
+ isMainDb = false;
595
597
  } else {
596
598
  client = getClient();
597
599
  }
@@ -627,7 +629,7 @@ async function searchMemories(queryVector, agentId, options) {
627
629
  args.push(activeEmbeddingModel);
628
630
  }
629
631
  try {
630
- const { founderScopeFilter } = await import("./founder-context-QCTMEK66.js");
632
+ const { founderScopeFilter } = await import("./founder-context-A4VUEKDH.js");
631
633
  const founderFilter = founderScopeFilter(options?.founderId);
632
634
  sql += founderFilter.sql;
633
635
  args.push(...founderFilter.args.filter((a) => a !== null));
@@ -677,7 +679,8 @@ async function searchMemories(queryVector, agentId, options) {
677
679
  args.push(vectorToBlob(queryVector));
678
680
  sql += ` LIMIT ?`;
679
681
  args.push(limit);
680
- const result = await client.execute({ sql, args });
682
+ const { offloadReadIfMain } = await import("./lib/database.js");
683
+ const result = await offloadReadIfMain(client, sql, args, isMainDb);
681
684
  return result.rows.map((row) => ({
682
685
  id: row.id,
683
686
  agent_id: row.agent_id,
@@ -2,11 +2,14 @@
2
2
  import { writeFileSync, statSync, existsSync, unlinkSync } from "fs";
3
3
  import { homedir } from "os";
4
4
  import { join } from "path";
5
+ function exeDir() {
6
+ return process.env.EXE_OS_DIR ?? process.env.EXE_MEM_DIR ?? join(homedir(), ".exe-os");
7
+ }
5
8
  function daemonReadyPath() {
6
- return join(homedir(), ".exe-os", "daemon.ready");
9
+ return join(exeDir(), "daemon.ready");
7
10
  }
8
11
  function eventLoopBlockedMarkerPath() {
9
- return join(homedir(), ".exe-os", "session-cache", "event-loop-blocked.marker");
12
+ return join(exeDir(), "session-cache", "event-loop-blocked.marker");
10
13
  }
11
14
  function writeDaemonReady(info) {
12
15
  try {
@@ -2,10 +2,10 @@ import {
2
2
  listWorkflowDefinitions,
3
3
  runWorkflow,
4
4
  startWorkflow
5
- } from "./chunk-X4AFBL4N.js";
5
+ } from "./chunk-XCORXJ3M.js";
6
6
  import {
7
7
  ingest
8
- } from "./chunk-SOT23KWW.js";
8
+ } from "./chunk-63UEWYM3.js";
9
9
  import {
10
10
  initCRMBridge
11
11
  } from "./chunk-ONKIWA3R.js";
@@ -6,7 +6,7 @@ import {
6
6
  connectEmbedDaemon,
7
7
  isClientConnected,
8
8
  sendDaemonRequest
9
- } from "./chunk-PPXQE7AS.js";
9
+ } from "./chunk-SE6MLUOK.js";
10
10
 
11
11
  // src/lib/db-daemon-client.ts
12
12
  function normalizeStatement(stmt) {
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  ensureDaemonToken,
3
3
  readDaemonToken
4
- } from "./chunk-RQ7OVXUZ.js";
4
+ } from "./chunk-V2CZVZUO.js";
5
5
  import {
6
6
  requestRestart
7
- } from "./chunk-RVXWGPD3.js";
7
+ } from "./chunk-75TM3APG.js";
8
8
  import {
9
9
  computeDaemonHeapCapMb
10
10
  } from "./chunk-7XGDTKHX.js";
11
11
  import {
12
12
  EXE_AI_DIR
13
- } from "./chunk-DFIOOK5R.js";
13
+ } from "./chunk-WCES22KG.js";
14
14
 
15
15
  // src/lib/exe-daemon-client.ts
16
16
  import net from "net";
@@ -20,6 +20,15 @@ import { randomUUID } from "crypto";
20
20
  import { existsSync, unlinkSync, readFileSync, openSync, closeSync, statSync, writeSync } from "fs";
21
21
  import path from "path";
22
22
  import { fileURLToPath } from "url";
23
+ function isDebug() {
24
+ return process.env.EXE_DEBUG === "1" || process.env.DEBUG === "1";
25
+ }
26
+ function debugLog(msg) {
27
+ if (isDebug()) process.stderr.write(msg.endsWith("\n") ? msg : msg + "\n");
28
+ }
29
+ function criticalLog(msg) {
30
+ process.stderr.write(msg.endsWith("\n") ? msg : msg + "\n");
31
+ }
23
32
  var SOCKET_PATH = process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path.join(EXE_AI_DIR, "exed.sock");
24
33
  var PID_PATH = process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path.join(EXE_AI_DIR, "exed.pid");
25
34
  var SPAWN_LOCK_PATH = path.join(EXE_AI_DIR, "exed-spawn.lock");
@@ -97,8 +106,7 @@ function cleanupStaleFiles() {
97
106
  if (!isZombie(pid)) {
98
107
  return;
99
108
  }
100
- process.stderr.write(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files
101
- `);
109
+ debugLog(`[exed-client] PID ${pid} is a zombie \u2014 cleaning up stale files`);
102
110
  } catch {
103
111
  }
104
112
  }
@@ -138,8 +146,7 @@ function warnAliveSocketUnresponsive(message) {
138
146
  const now = Date.now();
139
147
  if (now - _lastAliveSocketWarningAt < ALIVE_SOCKET_WARNING_INTERVAL_MS) return;
140
148
  _lastAliveSocketWarningAt = now;
141
- process.stderr.write(`${message}
142
- `);
149
+ debugLog(message);
143
150
  }
144
151
  function shouldRecoverMissingSocket() {
145
152
  if (existsSync(SOCKET_PATH)) return false;
@@ -162,27 +169,25 @@ function spawnDaemon() {
162
169
  try {
163
170
  const result = execSync("launchctl list com.askexe.exed 2>/dev/null", { encoding: "utf8", timeout: 3e3 });
164
171
  if (result.includes("com.askexe.exed")) {
165
- process.stderr.write("[exed-client] Daemon not responding \u2014 launchd will restart it. Waiting...\n");
172
+ debugLog("[exed-client] Daemon not responding \u2014 launchd will restart it. Waiting...");
166
173
  return;
167
174
  }
168
175
  } catch {
169
176
  }
170
- process.stderr.write("[exed-client] No launchd supervisor \u2014 spawning daemon directly (dev mode)\n");
177
+ debugLog("[exed-client] No launchd supervisor \u2014 spawning daemon directly (dev mode)");
171
178
  const totalGB = os.totalmem() / (1024 * 1024 * 1024);
172
179
  if (totalGB <= 8) {
173
- process.stderr.write(`[exed-client] SKIP: ${totalGB.toFixed(0)}GB system \u2014 daemon disabled.
174
- `);
180
+ debugLog(`[exed-client] SKIP: ${totalGB.toFixed(0)}GB system \u2014 daemon disabled.`);
175
181
  return;
176
182
  }
177
183
  const pkgRoot = findPackageRoot();
178
184
  if (!pkgRoot) {
179
- process.stderr.write("[exed-client] WARN: cannot find package root\n");
185
+ debugLog("[exed-client] WARN: cannot find package root");
180
186
  return;
181
187
  }
182
188
  const daemonPath = path.join(pkgRoot, "dist", "lib", "exe-daemon.js");
183
189
  if (!existsSync(daemonPath)) {
184
- process.stderr.write(`[exed-client] WARN: daemon not found at ${daemonPath}
185
- `);
190
+ debugLog(`[exed-client] WARN: daemon not found at ${daemonPath}`);
186
191
  return;
187
192
  }
188
193
  const daemonToken = ensureDaemonToken(process.env[DAEMON_TOKEN_ENV] ?? null);
@@ -286,7 +291,7 @@ function connectToSocket() {
286
291
  let attempt = 0;
287
292
  const daemonDead = !isDaemonPidAlive();
288
293
  if (daemonDead) {
289
- process.stderr.write("[daemon-client] Daemon PID dead \u2014 fast-path respawn (skipping jitter)\n");
294
+ debugLog("[daemon-client] Daemon PID dead \u2014 fast-path respawn (skipping jitter)");
290
295
  try {
291
296
  cleanupStaleFiles();
292
297
  if (acquireSpawnLock()) {
@@ -307,16 +312,14 @@ function connectToSocket() {
307
312
  if (attempt > maxRetries) {
308
313
  clearInterval(retryTimer);
309
314
  _autoReconnecting = false;
310
- process.stderr.write(`[daemon-client] Auto-reconnect failed after ${maxRetries} attempts
311
- `);
315
+ criticalLog(`[exed-client] Auto-reconnect failed after ${maxRetries} attempts`);
312
316
  return;
313
317
  }
314
318
  const ok = await connectToSocket();
315
319
  if (ok) {
316
320
  clearInterval(retryTimer);
317
321
  _autoReconnecting = false;
318
- if (attempt > 1) process.stderr.write(`[daemon-client] Auto-reconnected to daemon (attempt ${attempt})
319
- `);
322
+ if (attempt > 1) debugLog(`[exed-client] Auto-reconnected to daemon (attempt ${attempt})`);
320
323
  }
321
324
  }, jitter());
322
325
  }, initialDelay);
@@ -352,9 +355,8 @@ async function connectEmbedDaemon() {
352
355
  }
353
356
  if (shouldRecoverMissingSocket()) {
354
357
  const pid = readDaemonPid();
355
- process.stderr.write(
356
- `[exed-client] Daemon socket missing while PID ${pid ?? "unknown"} is alive \u2014 requesting supervised recovery
357
- `
358
+ debugLog(
359
+ `[exed-client] Daemon socket missing while PID ${pid ?? "unknown"} is alive \u2014 requesting supervised recovery`
358
360
  );
359
361
  killAndRespawnDaemon("daemon socket missing while PID alive", { forceMissingSocket: true });
360
362
  }
@@ -387,9 +389,10 @@ function sendRequest(texts, priority) {
387
389
  function sendDaemonRequest(payload, timeoutMs = REQUEST_TIMEOUT_MS) {
388
390
  return new Promise(async (resolve) => {
389
391
  if ((!_socket || !_connected) && _autoReconnecting) {
392
+ const reconnectWaitMs = Math.min(3e3, timeoutMs);
390
393
  const waitStart = Date.now();
391
- while (!_connected && Date.now() - waitStart < 15e3) {
392
- await new Promise((r) => setTimeout(r, 1e3));
394
+ while (!_connected && Date.now() - waitStart < reconnectWaitMs) {
395
+ await new Promise((r) => setTimeout(r, 500));
393
396
  }
394
397
  }
395
398
  if (!_socket || !_connected) {
@@ -425,9 +428,8 @@ function canClientRequestDaemonRestart() {
425
428
  }
426
429
  function killAndRespawnDaemon(reason, opts) {
427
430
  if (!opts?.forceMissingSocket && !canClientRequestDaemonRestart()) {
428
- process.stderr.write(
429
- `[exed-client] Restart suppressed (${reason ?? "consecutive failures"}) \u2014 client-side daemon restarts are disabled; degrading gracefully.
430
- `
431
+ debugLog(
432
+ `[exed-client] Restart suppressed (${reason ?? "consecutive failures"}) \u2014 degrading gracefully`
431
433
  );
432
434
  if (_socket) {
433
435
  _socket.destroy();
@@ -450,7 +452,7 @@ function killAndRespawnDaemon(reason, opts) {
450
452
  if (!isDaemonPidAlive()) {
451
453
  spawnDaemon();
452
454
  } else {
453
- process.stderr.write("[exed-client] Daemon PID alive after kill \u2014 launchd will restart when it exits\n");
455
+ debugLog("[exed-client] Daemon PID alive after kill \u2014 launchd will restart when it exits");
454
456
  }
455
457
  return true;
456
458
  }
@@ -466,8 +468,7 @@ async function retryThenRestart(doRequest, label) {
466
468
  _consecutiveFailures++;
467
469
  for (let i = 0; i < MAX_RETRIES_BEFORE_RESTART; i++) {
468
470
  const delayMs = RETRY_DELAYS_MS[i] ?? 5e3;
469
- process.stderr.write(`[exed-client] ${label} failed (${result.error}), retry ${i + 1}/${MAX_RETRIES_BEFORE_RESTART} in ${delayMs}ms
470
- `);
471
+ debugLog(`[exed-client] ${label} failed (${result.error}), retry ${i + 1}/${MAX_RETRIES_BEFORE_RESTART} in ${delayMs}ms`);
471
472
  await new Promise((r) => setTimeout(r, delayMs));
472
473
  if (!_connected) {
473
474
  if (!await connectToSocket()) continue;
@@ -480,8 +481,7 @@ async function retryThenRestart(doRequest, label) {
480
481
  _consecutiveFailures++;
481
482
  }
482
483
  const isEmbed = label.toLowerCase().includes("embed");
483
- process.stderr.write(`[exed-client] ${label}: ${_consecutiveFailures} consecutive failures \u2014 handling daemon failure
484
- `);
484
+ criticalLog(`[exed-client] ${label}: ${_consecutiveFailures} consecutive failures \u2014 restarting daemon`);
485
485
  const restartRequested = killAndRespawnDaemon(`${label}: ${_consecutiveFailures} consecutive failures`, { isEmbedRelated: isEmbed });
486
486
  if (!restartRequested) {
487
487
  return result;
@@ -506,8 +506,7 @@ async function embedViaClient(text, priority = "high") {
506
506
  if (_requestCount % HEALTH_CHECK_INTERVAL === 0) {
507
507
  const health = await pingDaemon();
508
508
  if (!health) {
509
- process.stderr.write(`[exed-client] Periodic health check failed at request ${_requestCount} \u2014 handling daemon failure
510
- `);
509
+ debugLog(`[exed-client] Periodic health check failed at request ${_requestCount} \u2014 restarting daemon`);
511
510
  const restartRequested = killAndRespawnDaemon(`Embed health check failed at request ${_requestCount}`, { isEmbedRelated: true });
512
511
  if (!restartRequested) return null;
513
512
  const start = Date.now();
@@ -102,6 +102,11 @@ function atomicWriteSync(filePath, content, encoding = "utf-8") {
102
102
  writeFileSync(tmpPath, content, { encoding, mode: PRIVATE_FILE_MODE });
103
103
  renameSync(tmpPath, filePath);
104
104
  }
105
+ async function atomicWrite(filePath, content, encoding = "utf-8") {
106
+ const tmpPath = filePath + ".tmp." + process.pid;
107
+ await fsWriteFile(tmpPath, content, { encoding, mode: PRIVATE_FILE_MODE });
108
+ await fsRename(tmpPath, filePath);
109
+ }
105
110
 
106
111
  export {
107
112
  ensurePrivateDir,
@@ -109,5 +114,6 @@ export {
109
114
  enforcePrivateFileSync,
110
115
  atomicWriteJson,
111
116
  atomicWriteJsonSync,
112
- atomicWriteSync
117
+ atomicWriteSync,
118
+ atomicWrite
113
119
  };