@askexenow/exe-os 0.9.357 → 0.9.359

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 (334) hide show
  1. package/deploy/stack-manifests/v0.9.json +3 -3
  2. package/dist/.dist-verified.json +6 -0
  3. package/dist/{active-agent-PYMOMGQ7.js → active-agent-DMKNHGSG.js} +6 -4
  4. package/dist/{active-agent-LCRV3HVS.js → active-agent-Y3DCBD7J.js} +6 -4
  5. package/dist/{agentic-ontology-TNKI4FOM.js → agentic-ontology-3233PNKV.js} +1 -1
  6. package/dist/{backfill-metadata-SFS4ARNR.js → backfill-metadata-4DS4A5U3.js} +8 -6
  7. package/dist/{backup-verify-7NLKR4S6.js → backup-verify-JNYKXIU2.js} +6 -1
  8. package/dist/{behavior-injection-OT7VX7M6.js → behavior-injection-CGAMI552.js} +10 -8
  9. package/dist/{behaviors-6GW5AFG4.js → behaviors-57AMN5IP.js} +9 -7
  10. package/dist/bin/agentic-ontology-backfill.js +9 -7
  11. package/dist/bin/agentic-reflection-backfill.js +10 -8
  12. package/dist/bin/agentic-semantic-label.js +9 -7
  13. package/dist/bin/backfill-conversations.js +8 -6
  14. package/dist/bin/backfill-responses.js +8 -6
  15. package/dist/bin/backfill-vectors.js +9 -7
  16. package/dist/bin/bulk-sync-postgres.js +18 -14
  17. package/dist/bin/cc-doctor.js +7 -5
  18. package/dist/bin/cleanup-stale-review-tasks.js +16 -14
  19. package/dist/bin/cli.js +19 -19
  20. package/dist/bin/deferred-daemon-restart.js +81 -77
  21. package/dist/bin/exe-agent-config.js +5 -3
  22. package/dist/bin/exe-agent.js +14 -12
  23. package/dist/bin/exe-assign.js +9 -7
  24. package/dist/bin/exe-boot.js +62 -28
  25. package/dist/bin/exe-call.js +8 -6
  26. package/dist/bin/exe-cloud.js +20 -16
  27. package/dist/bin/exe-config-dump.js +5 -3
  28. package/dist/bin/exe-dispatch.js +16 -14
  29. package/dist/bin/exe-doctor.js +9 -6
  30. package/dist/bin/exe-export-behaviors.js +11 -9
  31. package/dist/bin/exe-forget.js +10 -8
  32. package/dist/bin/exe-gateway.js +10 -8
  33. package/dist/bin/exe-grant.js +17 -4
  34. package/dist/bin/exe-healthcheck.js +7 -5
  35. package/dist/bin/exe-heartbeat.js +18 -16
  36. package/dist/bin/exe-kill.js +20 -18
  37. package/dist/bin/exe-launch-agent.js +27 -25
  38. package/dist/bin/exe-memory-reads.js +8 -6
  39. package/dist/bin/exe-new-employee.js +12 -10
  40. package/dist/bin/exe-os-mcp-proxy.js +6 -4
  41. package/dist/bin/exe-pending-messages.js +17 -15
  42. package/dist/bin/exe-pending-notifications.js +16 -14
  43. package/dist/bin/exe-pending-reviews.js +16 -14
  44. package/dist/bin/exe-rename.js +8 -6
  45. package/dist/bin/exe-review.js +19 -17
  46. package/dist/bin/exe-search.js +9 -7
  47. package/dist/bin/exe-session-cleanup.js +20 -18
  48. package/dist/bin/exe-settings.js +18 -14
  49. package/dist/bin/exe-start-codex.js +16 -14
  50. package/dist/bin/exe-start-opencode.js +12 -10
  51. package/dist/bin/exe-status.js +17 -15
  52. package/dist/bin/exe-support.js +3 -3
  53. package/dist/bin/exe-team.js +6 -4
  54. package/dist/bin/exe-timers.js +2 -1
  55. package/dist/bin/git-sweep.js +17 -15
  56. package/dist/bin/graph-backfill.js +10 -8
  57. package/dist/bin/graph-export.js +9 -7
  58. package/dist/bin/import-history.js +13 -11
  59. package/dist/bin/install.js +83 -79
  60. package/dist/bin/intercom-check.js +4 -4
  61. package/dist/bin/mcp-sessions.js +2 -2
  62. package/dist/bin/orchestration-metrics.js +7 -5
  63. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  64. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  65. package/dist/bin/pre-publish.js +1 -1
  66. package/dist/bin/reconcile-backlog.js +2 -2
  67. package/dist/bin/registry-proxy.js +1 -1
  68. package/dist/bin/scan-tasks.js +16 -14
  69. package/dist/bin/setup.js +1 -1
  70. package/dist/bin/shard-migrate.js +9 -7
  71. package/dist/bin/stack-update.js +4 -4
  72. package/dist/bin/vps-health-gate.js +1 -1
  73. package/dist/{boot-generation-7ZI7JYGR.js → boot-generation-4D3CTT7X.js} +6 -4
  74. package/dist/{boot-review-sections-3MSXM6V7.js → boot-review-sections-NDFE5443.js} +15 -13
  75. package/dist/build-manifest.json +2961 -0
  76. package/dist/{capability-cards-4RD2SB2K.js → capability-cards-OBB7BMMX.js} +5 -3
  77. package/dist/{capacity-monitor-5XUR3JTN.js → capacity-monitor-QLPEL6S5.js} +17 -15
  78. package/dist/{catchup-brief-AYJWMQUZ.js → catchup-brief-EN7QR6MP.js} +20 -18
  79. package/dist/{chunk-ZMVVKOOS.js → chunk-2EAYZ3BK.js} +7 -7
  80. package/dist/{chunk-4KCLB4TY.js → chunk-2KLVTRY2.js} +1 -1
  81. package/dist/{chunk-4VU2VCEU.js → chunk-2OVTGZYH.js} +1 -1
  82. package/dist/{chunk-5Q2J6P4T.js → chunk-2YGAKBRG.js} +3 -3
  83. package/dist/{chunk-2TL5RKMC.js → chunk-3BAGFZFN.js} +1 -1
  84. package/dist/{chunk-PM4TIRCR.js → chunk-3ODATKWH.js} +1 -1
  85. package/dist/{chunk-RUBXKPOT.js → chunk-3ZEVMZ4G.js} +1 -1
  86. package/dist/{chunk-H4ZSOAP6.js → chunk-44WFVMZ5.js} +1 -1
  87. package/dist/{chunk-Y4JA5V22.js → chunk-46RPEWTH.js} +1 -1
  88. package/dist/{chunk-EHL4RCND.js → chunk-4DYJ6NOK.js} +6 -5
  89. package/dist/{chunk-ZWXSO4FN.js → chunk-4FQIWAXA.js} +9 -9
  90. package/dist/{chunk-YG4LS7TI.js → chunk-4WSUP4CC.js} +8 -8
  91. package/dist/{chunk-EWOMZLR6.js → chunk-57GRYGDU.js} +1 -1
  92. package/dist/{chunk-VCKIV5WG.js → chunk-5I3YC7ER.js} +2 -2
  93. package/dist/{chunk-UQCYG6EI.js → chunk-5UAMBMNR.js} +1 -1
  94. package/dist/chunk-5YEUPUV4.js +53 -0
  95. package/dist/{chunk-34MIJGQS.js → chunk-6EOLGE7T.js} +1 -1
  96. package/dist/{chunk-AWB7M62V.js → chunk-6KREY2Q7.js} +4 -4
  97. package/dist/{chunk-FWJFKWYA.js → chunk-6LY3QSJA.js} +2 -2
  98. package/dist/{chunk-7FKC2TIB.js → chunk-6SK4MM5B.js} +1 -1
  99. package/dist/{chunk-P7EUKYSQ.js → chunk-6WHYSLGF.js} +1 -1
  100. package/dist/{chunk-YSUHXDQU.js → chunk-74R44E4S.js} +21 -19
  101. package/dist/{chunk-DF5K4JJL.js → chunk-A5WEEND7.js} +3 -3
  102. package/dist/{chunk-OBWTTM7E.js → chunk-AL7JMA54.js} +2 -2
  103. package/dist/{chunk-JZXHLDQN.js → chunk-APR556TY.js} +1 -1
  104. package/dist/{chunk-G2MXTLOD.js → chunk-C5YZMYQH.js} +1 -1
  105. package/dist/{chunk-X7CWCQ5S.js → chunk-CAEWPEBA.js} +1 -1
  106. package/dist/{chunk-SFSB64NK.js → chunk-DKRSKC5R.js} +1 -1
  107. package/dist/{chunk-IIHFSNL4.js → chunk-DQ75MEPU.js} +1 -1
  108. package/dist/{chunk-H4IZKSOY.js → chunk-DWKH2H7W.js} +1 -1
  109. package/dist/{chunk-M5DPPJLS.js → chunk-EA5FVACM.js} +39 -7
  110. package/dist/{chunk-S3THSOWV.js → chunk-EUQF3JOH.js} +28 -100
  111. package/dist/{chunk-2LM5GO5R.js → chunk-EX2SSLNU.js} +5 -5
  112. package/dist/{chunk-4GGP4Q5N.js → chunk-F3QTF4T7.js} +2 -2
  113. package/dist/{chunk-EQQYCP6D.js → chunk-FASR2WLT.js} +1 -1
  114. package/dist/{chunk-NT4GET5B.js → chunk-G2KK64UB.js} +4 -4
  115. package/dist/{chunk-ABM3DZF3.js → chunk-G37RG543.js} +1 -1
  116. package/dist/{chunk-AW3WT3TJ.js → chunk-GD7VXXW6.js} +141 -140
  117. package/dist/{chunk-IT4TFJTK.js → chunk-GSVQBBE5.js} +3 -3
  118. package/dist/{chunk-LVZZ7YS3.js → chunk-HK7SQDKJ.js} +5 -5
  119. package/dist/chunk-HKK7LLS5.js +408 -0
  120. package/dist/{chunk-W3IXTUCL.js → chunk-HLEZ5O5P.js} +77 -37
  121. package/dist/{chunk-A5P2MMII.js → chunk-HNPHPGGF.js} +2 -2
  122. package/dist/{chunk-QGLAMWQJ.js → chunk-HPHF5VTT.js} +3 -3
  123. package/dist/{chunk-IO5FR7BZ.js → chunk-IQWAYXVF.js} +3 -3
  124. package/dist/{chunk-PNTRRXAN.js → chunk-JBAMYKBL.js} +1 -1
  125. package/dist/{chunk-2WWGTOVP.js → chunk-JE34CB5H.js} +19 -1
  126. package/dist/{chunk-APRVAUOR.js → chunk-JY5GAZYC.js} +1 -0
  127. package/dist/{chunk-PUAA3P47.js → chunk-KIXNMTGC.js} +4 -4
  128. package/dist/{chunk-ES4XE6AU.js → chunk-LPKTGK7L.js} +4 -4
  129. package/dist/{chunk-KT4RUFYO.js → chunk-LRETL4I3.js} +3 -3
  130. package/dist/{chunk-JO6TS75M.js → chunk-LXG37RB2.js} +1 -1
  131. package/dist/{chunk-CI3YVCUY.js → chunk-MCNDZU5W.js} +1 -1
  132. package/dist/{chunk-JLXJMDKG.js → chunk-NE57GONM.js} +1 -1
  133. package/dist/{chunk-72GUU6Z4.js → chunk-NKDKB2RT.js} +3 -3
  134. package/dist/{chunk-KP3PLOGC.js → chunk-NP2Y7P3I.js} +2 -2
  135. package/dist/{chunk-ES6PDSEK.js → chunk-OAYTQ4RY.js} +8 -8
  136. package/dist/{chunk-Z5DTZ464.js → chunk-OIS5VIAH.js} +6 -0
  137. package/dist/{chunk-VPMAC5VB.js → chunk-OY2PWHYR.js} +1 -1
  138. package/dist/{chunk-YQ7IZPVC.js → chunk-PDRIIEFV.js} +1 -1
  139. package/dist/{chunk-W3REQ37P.js → chunk-PLOEFBFW.js} +2 -2
  140. package/dist/{chunk-X4EDW3FH.js → chunk-POZGQQEZ.js} +1 -1
  141. package/dist/{chunk-AJGTBW3N.js → chunk-QH2XAUZ5.js} +1 -1
  142. package/dist/{chunk-6CZXY5BD.js → chunk-QROIFRKI.js} +5 -5
  143. package/dist/{chunk-P2Y6S53G.js → chunk-R6LNQAUG.js} +1 -1
  144. package/dist/{chunk-JKOEOHOD.js → chunk-R7F6HKTH.js} +6 -21
  145. package/dist/{chunk-6WAJJN5W.js → chunk-RFUTLZ2U.js} +3 -3
  146. package/dist/{chunk-CQPFNVWY.js → chunk-RJ67HG2P.js} +3 -3
  147. package/dist/{chunk-6H4ZEU7P.js → chunk-SHEWTDPC.js} +4 -4
  148. package/dist/{chunk-XPGUSSG7.js → chunk-SIGAQQHW.js} +1 -1
  149. package/dist/{chunk-PUNCHUEX.js → chunk-SNWV44E5.js} +3 -3
  150. package/dist/{chunk-WJIGSNJM.js → chunk-SQBNN44X.js} +12 -12
  151. package/dist/{chunk-6UTP7AIH.js → chunk-STFR72YH.js} +1 -1
  152. package/dist/chunk-TWMWHDOY.js +79 -0
  153. package/dist/{chunk-RZSPCNLY.js → chunk-UZ5RJYL3.js} +1 -1
  154. package/dist/chunk-V3W3SATA.js +135 -0
  155. package/dist/{chunk-WL3CT5KX.js → chunk-VCCZQDCU.js} +2 -2
  156. package/dist/{chunk-VU2MZ7BP.js → chunk-VNK3MNZE.js} +40 -3
  157. package/dist/{chunk-MVYB76QG.js → chunk-VRTCVZND.js} +16 -20
  158. package/dist/{chunk-UEXJYSJX.js → chunk-VXL7PJ56.js} +39 -2
  159. package/dist/{chunk-4OMIENRX.js → chunk-VY5VU7SX.js} +1 -1
  160. package/dist/{chunk-JUE37LOD.js → chunk-W3XUU36X.js} +4 -4
  161. package/dist/{chunk-WHQYVFE2.js → chunk-W5YV2PZE.js} +22 -15
  162. package/dist/{chunk-DZNXWCJN.js → chunk-WA2MJGPT.js} +1 -1
  163. package/dist/{chunk-LDRMNJJJ.js → chunk-WCP4OQUL.js} +2 -2
  164. package/dist/{chunk-25X4JD2V.js → chunk-WDA2KAV7.js} +20 -3
  165. package/dist/{chunk-YNYISUMW.js → chunk-WRP5AG4D.js} +1 -1
  166. package/dist/{chunk-HAOZB4W6.js → chunk-X2F6Q7TW.js} +1 -1
  167. package/dist/{chunk-TQ4O5A4S.js → chunk-XV42EAVK.js} +1 -1
  168. package/dist/{chunk-TAR5J7WI.js → chunk-XVTKJEI2.js} +4 -4
  169. package/dist/{chunk-XQAELSOQ.js → chunk-XWWNRFRF.js} +2 -2
  170. package/dist/{chunk-6SAQSXT2.js → chunk-YKRNH5LU.js} +1 -1
  171. package/dist/{chunk-QXAE6S3A.js → chunk-YMCIZCNK.js} +3 -3
  172. package/dist/chunk-YQGMSXT5.js +33 -0
  173. package/dist/{chunk-LLXYWNCH.js → chunk-Z2PAVJJ4.js} +1 -1
  174. package/dist/{cleanup-graph-garbage-XUNHVCRR.js → cleanup-graph-garbage-XFGY4EEE.js} +11 -9
  175. package/dist/{cloud-sync-shutdown-JRAERBUO.js → cloud-sync-shutdown-XCOATIJW.js} +5 -3
  176. package/dist/{co-activation-5AN2CF23.js → co-activation-XNBLOGK3.js} +5 -3
  177. package/dist/{co-occurrence-A7E774ZX.js → co-occurrence-HO4PGQC4.js} +9 -7
  178. package/dist/{conversation-entity-extractor-2XI2GC4N.js → conversation-entity-extractor-5G5DGRJU.js} +4 -4
  179. package/dist/{crdt-sync-2IUU6GZ6.js → crdt-sync-6TD7LSZW.js} +3 -2
  180. package/dist/{crm-webhook-BQCP77TI.js → crm-webhook-WZAV5776.js} +2 -2
  181. package/dist/{cto-delegation-gate-UHHNMWCL.js → cto-delegation-gate-UHMYFM4D.js} +15 -13
  182. package/dist/{daemon-orchestration-7WS3X5DQ.js → daemon-orchestration-DT5M2ZAR.js} +20 -19
  183. package/dist/{daemon-ready-signal-TVCPSG7J.js → daemon-ready-signal-CKXPUMJ2.js} +3 -1
  184. package/dist/{daemon-restart-report-QDRGKLL6.js → daemon-restart-report-HZU5LWXN.js} +2 -1
  185. package/dist/{daemon-timer-report-NM44WQRH.js → daemon-timer-report-TNJH5SFY.js} +2 -1
  186. package/dist/{doc-graph-extractor-NFERAJNP.js → doc-graph-extractor-FNCYPFKY.js} +9 -7
  187. package/dist/{documents-SW2MJUXY.js → documents-GKDZDUED.js} +9 -7
  188. package/dist/{dreaming-KSNJVNFH.js → dreaming-WPMQJAXW.js} +19 -17
  189. package/dist/{exe-drift-NBLYKQBQ.js → exe-drift-QTKD2FHT.js} +6 -4
  190. package/dist/{exe-export-44IWTJHL.js → exe-export-ESJ6KP6J.js} +11 -9
  191. package/dist/{exe-import-PPECH3KO.js → exe-import-N4X3GEQB.js} +11 -9
  192. package/dist/{exe-key-ZCRJQYA7.js → exe-key-KZCCHX3W.js} +84 -77
  193. package/dist/{exe-snapshot-OVINJ6MC.js → exe-snapshot-SCRPHCPZ.js} +20 -18
  194. package/dist/{fast-db-init-B5Q3SJQG.js → fast-db-init-6H67K76Q.js} +1 -1
  195. package/dist/{founder-context-5OFTZNDO.js → founder-context-C7X7IRDA.js} +2 -2
  196. package/dist/founder-monitor-envelope-DHSUMBWU.js +83 -0
  197. package/dist/gateway/index.js +11 -9
  198. package/dist/{git-staleness-XQJTOSGZ.js → git-staleness-JCKVMWPO.js} +5 -3
  199. package/dist/{global-procedures-YCJ3JPAP.js → global-procedures-BR7WGSE7.js} +7 -5
  200. package/dist/{graph-auto-extract-XJN6PQH3.js → graph-auto-extract-EOXWQRBZ.js} +9 -7
  201. package/dist/{graph-rag-HCQCZ2W7.js → graph-rag-5FVC5JXH.js} +4 -4
  202. package/dist/{hook-prefetch-FKXDTCDS.js → hook-prefetch-2CN3MK4H.js} +16 -14
  203. package/dist/hooks/bug-report-worker.js +18 -16
  204. package/dist/hooks/codex-stop-task-finalizer.js +19 -17
  205. package/dist/hooks/commit-complete.js +18 -16
  206. package/dist/hooks/error-recall.js +10 -8
  207. package/dist/hooks/exe-heartbeat-hook.js +6 -4
  208. package/dist/hooks/ingest.js +14 -102
  209. package/dist/hooks/instructions-loaded.js +7 -5
  210. package/dist/hooks/manifest.json +19 -19
  211. package/dist/hooks/notification.js +7 -5
  212. package/dist/hooks/post-compact.js +17 -15
  213. package/dist/hooks/post-tool-combined.js +10 -10
  214. package/dist/hooks/pre-compact.js +18 -16
  215. package/dist/hooks/pre-tool-use.js +23 -21
  216. package/dist/hooks/prompt-submit.js +34 -38
  217. package/dist/hooks/session-end.js +22 -20
  218. package/dist/hooks/session-start.js +13 -18
  219. package/dist/hooks/stop.js +21 -19
  220. package/dist/hooks/subagent-stop.js +19 -17
  221. package/dist/hooks/summary-worker.js +22 -25
  222. package/dist/index.js +25 -23
  223. package/dist/{installer-YSCUE6MT.js → installer-7UV3CNWZ.js} +8 -6
  224. package/dist/{installer-YTT5OSRL.js → installer-VPNTM3X6.js} +8 -6
  225. package/dist/{installer-G3DVMNC6.js → installer-YDLSXGD2.js} +8 -6
  226. package/dist/{intercom-queue-5D52JF3Q.js → intercom-queue-KHKJJYCQ.js} +15 -13
  227. package/dist/lib/cloud-sync.js +18 -14
  228. package/dist/lib/consolidation.js +11 -9
  229. package/dist/lib/crypto.js +2 -1
  230. package/dist/lib/database.js +9 -3
  231. package/dist/lib/db-backup.js +1 -1
  232. package/dist/lib/db-checkpoint-worker.js +4 -0
  233. package/dist/lib/db-daemon-client.js +3 -1
  234. package/dist/lib/db-read-worker.js +4 -0
  235. package/dist/lib/db-write-worker.js +3 -3
  236. package/dist/lib/db.js +9 -3
  237. package/dist/lib/device-registry.js +1 -1
  238. package/dist/lib/employee-templates.js +8 -6
  239. package/dist/lib/employees.js +5 -3
  240. package/dist/lib/exe-daemon.js +202 -93
  241. package/dist/lib/hybrid-search.js +9 -7
  242. package/dist/lib/identity.js +5 -3
  243. package/dist/lib/license.js +2 -2
  244. package/dist/lib/messaging.js +16 -14
  245. package/dist/lib/registry-proxy.js +1 -1
  246. package/dist/lib/reminders.js +6 -4
  247. package/dist/lib/schedules.js +9 -7
  248. package/dist/lib/session-registry.js +7 -5
  249. package/dist/lib/skill-learning.js +10 -8
  250. package/dist/lib/store.js +8 -6
  251. package/dist/lib/task-router.js +6 -4
  252. package/dist/lib/tasks.js +17 -15
  253. package/dist/lib/tmux-routing.js +15 -13
  254. package/dist/lib/token-spend.js +8 -4
  255. package/dist/{license-gate-DKYHCAMN.js → license-gate-YXUSNA2I.js} +3 -3
  256. package/dist/{license-sync-JVEXPDHN.js → license-sync-XFDOXL3Z.js} +2 -2
  257. package/dist/mcp/register-tools.js +80 -76
  258. package/dist/mcp/server.js +81 -77
  259. package/dist/mcp/tools/complete-reminder.js +7 -5
  260. package/dist/mcp/tools/create-reminder.js +7 -5
  261. package/dist/mcp/tools/create-task.js +19 -17
  262. package/dist/mcp/tools/deactivate-behavior.js +11 -9
  263. package/dist/mcp/tools/list-reminders.js +7 -5
  264. package/dist/mcp/tools/list-tasks.js +19 -17
  265. package/dist/mcp/tools/send-message.js +18 -16
  266. package/dist/mcp/tools/update-task.js +18 -16
  267. package/dist/{mcp-health-WDOB6XUB.js → mcp-health-HNVSWKFA.js} +6 -1
  268. package/dist/{mcp-http-config-L5RDDU6P.js → mcp-http-config-HIP5CEDV.js} +6 -4
  269. package/dist/{mcp-session-identity-S6UCHBER.js → mcp-session-identity-RTNZ2ZLW.js} +15 -13
  270. package/dist/{memory-cards-65RGFT5M.js → memory-cards-KG4TPNKK.js} +8 -6
  271. package/dist/{memory-graph-extractor-ZDZ5VQUX.js → memory-graph-extractor-6HTBLO2N.js} +10 -8
  272. package/dist/{memory-poisoning-defense-EQUQNXRE.js → memory-poisoning-defense-3ZT57RSJ.js} +5 -3
  273. package/dist/{memory-pressure-watchdog-CC344JBH.js → memory-pressure-watchdog-ZOZBIMKC.js} +16 -14
  274. package/dist/{memory-reflection-Q4OT4V55.js → memory-reflection-EQC4FXSW.js} +5 -3
  275. package/dist/{monitor-grants-NWSQ7ZCQ.js → monitor-grants-BDLVFVDR.js} +3 -1
  276. package/dist/{notification-ledger-GL3ZPZNR.js → notification-ledger-NZ4HO3M5.js} +16 -14
  277. package/dist/{notifications-FGYNO2FY.js → notifications-74YECZ4V.js} +15 -13
  278. package/dist/{orchestration-events-N5FQ4SKU.js → orchestration-events-KRQI4ED5.js} +6 -4
  279. package/dist/{orchestrator-XUJDK4EW.js → orchestrator-WV2YCHTK.js} +17 -15
  280. package/dist/org-membership-B32NS5NI.js +34 -0
  281. package/dist/{pipeline-router-YQOZ4M62.js → pipeline-router-6ZZV7JMA.js} +6 -4
  282. package/dist/{plan-limits-VBHKYKSK.js → plan-limits-B7AZKZ6U.js} +8 -6
  283. package/dist/{platform-procedures-F3XB6WWM.js → platform-procedures-2VQGBJU7.js} +1 -1
  284. package/dist/{projection-worker-NJUNGEXE.js → projection-worker-LRFFQ6JB.js} +2 -2
  285. package/dist/{prospective-memory-3MKUPDVI.js → prospective-memory-A4GDTIWG.js} +5 -3
  286. package/dist/{reranker-LGSIL6TX.js → reranker-YVTLJCFC.js} +1 -1
  287. package/dist/{retrieval-health-AEEQ5IO6.js → retrieval-health-PK2ODTXM.js} +1 -1
  288. package/dist/{review-polling-2RMEZ5QO.js → review-polling-JFWRNQF6.js} +16 -14
  289. package/dist/runtime/index.js +19 -17
  290. package/dist/{session-events-5XSYCV4I.js → session-events-VMQBCUH3.js} +16 -14
  291. package/dist/{session-kill-telemetry-QJUHG3IG.js → session-kill-telemetry-Z3W256T5.js} +16 -14
  292. package/dist/{session-scope-LIJ746K2.js → session-scope-2ADEVY3C.js} +15 -13
  293. package/dist/{setup-wizard-RLUCGGA7.js → setup-wizard-26B36FMC.js} +1 -1
  294. package/dist/{shard-manager-3L2NMJVJ.js → shard-manager-DFLCDZT5.js} +2 -1
  295. package/dist/{skill-refinement-FMN3WFSG.js → skill-refinement-APBYOSGX.js} +6 -4
  296. package/dist/{stack-promote-BGDGAYKG.js → stack-promote-SZYIPTFT.js} +29 -4
  297. package/dist/{stack-release-SOIHMI3I.js → stack-release-EYRDEGPD.js} +4 -4
  298. package/dist/{stack-update-AXFHJRK5.js → stack-update-YWK2YXP6.js} +3 -3
  299. package/dist/{steward-gate-R2XWABMV.js → steward-gate-CIOBPNX6.js} +6 -4
  300. package/dist/{support-inbox-IITW66TG.js → support-inbox-OAWGFRKW.js} +3 -3
  301. package/dist/{support-outbox-WHGPUYL2.js → support-outbox-DSWU3IXH.js} +1 -1
  302. package/dist/{task-enforcement-SFZGBY27.js → task-enforcement-YAU6ZGDC.js} +16 -14
  303. package/dist/{task-scope-74ZIFQRH.js → task-scope-44N7XP5N.js} +15 -13
  304. package/dist/{tasks-crud-N54JZCXU.js → tasks-crud-IWVDREXG.js} +15 -13
  305. package/dist/{tasks-notify-62IJZW55.js → tasks-notify-WK5HA77D.js} +16 -14
  306. package/dist/{tasks-review-3LHBE6ZJ.js → tasks-review-VDFWFETP.js} +15 -13
  307. package/dist/{telemetry-upload-HR3QIWZV.js → telemetry-upload-3X5ESEKM.js} +20 -180
  308. package/dist/{token-budget-DBXHLCMN.js → token-budget-WZGO22ME.js} +6 -4
  309. package/dist/{tool-telemetry-UFUTCNE3.js → tool-telemetry-F7RWUNVK.js} +1 -1
  310. package/dist/tui/App.js +24 -22
  311. package/dist/{tui-data-BPXEJKRQ.js → tui-data-KT7YGVQS.js} +15 -13
  312. package/dist/{update-support-HLZ7KMVM.js → update-support-ZVRMECNQ.js} +13 -11
  313. package/dist/{work-state-heartbeat-IQI3LCHN.js → work-state-heartbeat-CA4CN7DQ.js} +1 -1
  314. package/dist/{worker-gate-5ABYGLC2.js → worker-gate-52MVKYGZ.js} +1 -1
  315. package/dist/{workflow-engine-XSUWZK6I.js → workflow-engine-ZAFBPVUP.js} +2 -2
  316. package/dist/{worktree-EUYBBABA.js → worktree-NNVXVV6A.js} +7 -5
  317. package/dist/{worktree-sweep-LSKFA2PK.js → worktree-sweep-IM2ZQG6Z.js} +8 -6
  318. package/package.json +14 -4
  319. package/release-notes.json +34 -30
  320. package/dist/chunk-7HLWBYH7.js +0 -60
  321. /package/dist/{chunk-AK77MITT.js → chunk-6JTKIXLU.js} +0 -0
  322. /package/dist/{chunk-HABPXFHZ.js → chunk-BGYCUZYK.js} +0 -0
  323. /package/dist/{chunk-GVU3BW6N.js → chunk-COHHVCFA.js} +0 -0
  324. /package/dist/{chunk-VML2UQK7.js → chunk-FVWI2AR4.js} +0 -0
  325. /package/dist/{chunk-2267TRAO.js → chunk-R62ITJDQ.js} +0 -0
  326. /package/dist/{chunk-HMBMHZ3S.js → chunk-U7RZIY74.js} +0 -0
  327. /package/dist/{chunk-7GOSAV25.js → chunk-XLEYCOHX.js} +0 -0
  328. /package/dist/{chunk-A627QFOE.js → chunk-YBX3G5OP.js} +0 -0
  329. /package/dist/{chunk-IHKRHGKT.js → chunk-ZMYXQU4L.js} +0 -0
  330. /package/dist/{core-memory-KXE4QMOA.js → core-memory-AATZRQEY.js} +0 -0
  331. /package/dist/{memory-isolation-VSKUKTN4.js → memory-isolation-CF6FYSXD.js} +0 -0
  332. /package/dist/{oauth-server-JELOVN5D.js → oauth-server-VE5ELXTF.js} +0 -0
  333. /package/dist/{project-boot-LQ4CF6BI.js → project-boot-WEQSKDD7.js} +0 -0
  334. /package/dist/{wiki-acl-VR4AFJ3T.js → wiki-acl-GNIXYWHJ.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  canonicalizeStackManifest
3
- } from "./chunk-JZXHLDQN.js";
3
+ } from "./chunk-APR556TY.js";
4
4
 
5
5
  // src/lib/stack-manifest-write.ts
6
6
  import { readFileSync, writeFileSync } from "fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  storeBehavior
3
- } from "./chunk-FWJFKWYA.js";
3
+ } from "./chunk-6LY3QSJA.js";
4
4
  import {
5
5
  getClient
6
- } from "./chunk-M5DPPJLS.js";
6
+ } from "./chunk-EA5FVACM.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-BCZF3AGJ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-M5DPPJLS.js";
3
+ } from "./chunk-EA5FVACM.js";
4
4
 
5
5
  // src/lib/orchestration-events.ts
6
6
  import crypto from "crypto";
@@ -263,7 +263,7 @@ async function runRegistryProxy(options = registryProxyOptionsFromEnv()) {
263
263
  await new Promise((resolve) => server.listen(options.port, options.host, resolve));
264
264
  console.log(`exe-registry-proxy listening on ${options.host ?? "0.0.0.0"}:${options.port}`);
265
265
  console.log(`proxying /v2/${options.allowedNamespace ?? "askexe"}/* -> ${options.upstream ?? "https://ghcr.io"}`);
266
- const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-JVEXPDHN.js");
266
+ const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-XFDOXL3Z.js");
267
267
  const syncConfig = licenseSyncConfigFromEnv();
268
268
  if (syncConfig) {
269
269
  startLicenseSyncScheduler(syncConfig);
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  recordSessionKill
3
- } from "./chunk-TAR5J7WI.js";
3
+ } from "./chunk-XVTKJEI2.js";
4
4
  import {
5
5
  sessionScopeFilter,
6
6
  verifyPaneAtCapacity,
7
7
  writeNotification
8
- } from "./chunk-YSUHXDQU.js";
8
+ } from "./chunk-74R44E4S.js";
9
9
  import {
10
10
  listSessions
11
- } from "./chunk-PM4TIRCR.js";
11
+ } from "./chunk-3ODATKWH.js";
12
12
  import {
13
13
  getTransport
14
14
  } from "./chunk-UXLO7VHX.js";
15
15
  import {
16
16
  recordOrchestrationEventBestEffort
17
- } from "./chunk-X4EDW3FH.js";
17
+ } from "./chunk-POZGQQEZ.js";
18
18
  import {
19
19
  getClient,
20
20
  isCoordinatorName
21
- } from "./chunk-M5DPPJLS.js";
21
+ } from "./chunk-EA5FVACM.js";
22
22
 
23
23
  // src/lib/capacity-monitor.ts
24
24
  var CAPACITY_PATTERNS = [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getGlobalProceduresBlock
3
- } from "./chunk-KP3PLOGC.js";
3
+ } from "./chunk-NP2Y7P3I.js";
4
4
 
5
5
  // src/lib/employee-templates.ts
6
6
  var BASE_OPERATING_PROCEDURES = `
@@ -1,10 +1,11 @@
1
+ import {
2
+ filterTimerWakeClusterArtifacts
3
+ } from "./chunk-YQGMSXT5.js";
4
+
1
5
  // src/lib/daemon-restart-report.ts
2
6
  import { existsSync, readFileSync, statSync, openSync, readSync, closeSync } from "fs";
3
7
  import path from "path";
4
8
  import os from "os";
5
- var SUSPEND_CLUSTER_MIN_MS = 6e4;
6
- var SUSPEND_CLUSTER_WINDOW_MS = 2e3;
7
- var SUSPEND_CLUSTER_MIN_TIMERS = 2;
8
9
  function logDir() {
9
10
  return path.join(os.homedir(), ".exe-os", "logs");
10
11
  }
@@ -84,23 +85,6 @@ function parseTsMs(ts) {
84
85
  const parsed = Date.parse(ts);
85
86
  return Number.isFinite(parsed) ? parsed : null;
86
87
  }
87
- function filterTimerSleepArtifacts(samples) {
88
- const clockClean = samples.filter((sample) => sample.durationMs >= 0);
89
- const candidates = clockClean.filter((sample) => sample.atMs !== null && sample.durationMs >= SUSPEND_CLUSTER_MIN_MS).sort((a, b) => a.atMs - b.atMs);
90
- const suspendArtifacts = /* @__PURE__ */ new Set();
91
- let start = 0;
92
- for (let end = 0; end < candidates.length; end++) {
93
- while (candidates[end].atMs - candidates[start].atMs > SUSPEND_CLUSTER_WINDOW_MS) {
94
- start++;
95
- }
96
- const window = candidates.slice(start, end + 1);
97
- const distinctTimers = new Set(window.map((sample) => sample.timer));
98
- if (distinctTimers.size >= SUSPEND_CLUSTER_MIN_TIMERS) {
99
- for (const sample of window) suspendArtifacts.add(sample);
100
- }
101
- }
102
- return clockClean.filter((sample) => !suspendArtifacts.has(sample));
103
- }
104
88
  function maxIso(a, b) {
105
89
  if (!b) return a;
106
90
  if (!a) return b;
@@ -153,8 +137,9 @@ function buildRestartReport(opts = {}) {
153
137
  if (data.clockJump === true || sleptMs > 1e3) continue;
154
138
  rawTimerSamples.push({ timer, durationMs, atMs: parseTsMs(rec.ts) });
155
139
  }
140
+ const clockCleanTimerSamples = rawTimerSamples.filter((sample) => sample.durationMs >= 0);
156
141
  const timerSamples = /* @__PURE__ */ new Map();
157
- for (const { timer, durationMs } of filterTimerSleepArtifacts(rawTimerSamples)) {
142
+ for (const { timer, durationMs } of filterTimerWakeClusterArtifacts(clockCleanTimerSamples)) {
158
143
  const arr = timerSamples.get(timer) ?? [];
159
144
  arr.push(durationMs);
160
145
  timerSamples.set(timer, arr);
@@ -4,10 +4,10 @@ import {
4
4
  import {
5
5
  reserveVersions,
6
6
  vectorToBlob
7
- } from "./chunk-WHQYVFE2.js";
7
+ } from "./chunk-W5YV2PZE.js";
8
8
  import {
9
9
  getClient
10
- } from "./chunk-M5DPPJLS.js";
10
+ } from "./chunk-EA5FVACM.js";
11
11
 
12
12
  // src/lib/documents.ts
13
13
  import crypto from "crypto";
@@ -270,7 +270,7 @@ async function ingestDocument(input) {
270
270
  await client.batch([documentStmt, ...chunkStmts], "write");
271
271
  const embedded = vectors.filter((v) => v !== null).length;
272
272
  const originalTexts = input.chunks.map((c) => c.text);
273
- import("./doc-graph-extractor-NFERAJNP.js").then(
273
+ import("./doc-graph-extractor-FNCYPFKY.js").then(
274
274
  ({ extractAndStoreDocumentGraph }) => extractAndStoreDocumentGraph(documentId, originalTexts)
275
275
  ).catch((err) => {
276
276
  process.stderr.write(
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  fastDbInit
3
- } from "./chunk-QXAE6S3A.js";
3
+ } from "./chunk-YMCIZCNK.js";
4
4
  import {
5
5
  sessionScopeFilter
6
- } from "./chunk-YSUHXDQU.js";
6
+ } from "./chunk-74R44E4S.js";
7
7
  import {
8
8
  formatStatusAll,
9
9
  formatStatusDeep,
@@ -14,7 +14,7 @@ import {
14
14
  getClient,
15
15
  isCoordinatorRole,
16
16
  loadEmployees
17
- } from "./chunk-M5DPPJLS.js";
17
+ } from "./chunk-EA5FVACM.js";
18
18
  import {
19
19
  isMainModule
20
20
  } from "./chunk-6Y4B3QF6.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  deactivateBehavior
3
- } from "./chunk-FWJFKWYA.js";
3
+ } from "./chunk-6LY3QSJA.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-YNYISUMW.js";
6
+ } from "./chunk-WRP5AG4D.js";
7
7
  import {
8
8
  canCoordinate,
9
9
  getClient
10
- } from "./chunk-M5DPPJLS.js";
10
+ } from "./chunk-EA5FVACM.js";
11
11
 
12
12
  // src/mcp/tools/deactivate-behavior.ts
13
13
  import { z } from "zod";
@@ -24,7 +24,7 @@ function registerDeactivateBehavior(server) {
24
24
  async ({ behavior_id }) => {
25
25
  const caller = getActiveAgent();
26
26
  try {
27
- const { StewardGate } = await import("./steward-gate-R2XWABMV.js");
27
+ const { StewardGate } = await import("./steward-gate-CIOBPNX6.js");
28
28
  const steward = new StewardGate();
29
29
  const gateDecision = await steward.checkAuthority(caller.agentId || "unknown", "deactivate_behavior", behavior_id);
30
30
  if (!gateDecision.allowed) {
@@ -119,7 +119,7 @@ function releaseBackfillLock() {
119
119
  }
120
120
  async function getTaskAwareCapacity() {
121
121
  const { getClient } = await import("./lib/database.js");
122
- const { sessionScopeFilter } = await import("./task-scope-74ZIFQRH.js");
122
+ const { sessionScopeFilter } = await import("./task-scope-44N7XP5N.js");
123
123
  const client = getClient();
124
124
  const scope = sessionScopeFilter();
125
125
  const result = await client.execute({
@@ -4,17 +4,17 @@ import {
4
4
  resolveExeSession,
5
5
  sendIntercom,
6
6
  strictSessionScopeFilter
7
- } from "./chunk-YSUHXDQU.js";
7
+ } from "./chunk-74R44E4S.js";
8
8
  import {
9
9
  parseMessage,
10
10
  serializeMessage
11
11
  } from "./chunk-4JERP7NT.js";
12
12
  import {
13
13
  recordOrchestrationEventBestEffort
14
- } from "./chunk-X4EDW3FH.js";
14
+ } from "./chunk-POZGQQEZ.js";
15
15
  import {
16
16
  getClient
17
- } from "./chunk-M5DPPJLS.js";
17
+ } from "./chunk-EA5FVACM.js";
18
18
 
19
19
  // src/lib/messaging.ts
20
20
  import crypto from "crypto";
@@ -1,15 +1,12 @@
1
1
  import {
2
2
  isPaneBusy
3
- } from "./chunk-NT4GET5B.js";
3
+ } from "./chunk-G2KK64UB.js";
4
4
  import {
5
5
  recordSessionKill
6
- } from "./chunk-TAR5J7WI.js";
7
- import {
8
- eventLoopBlockedMarkerPath
9
- } from "./chunk-APRVAUOR.js";
6
+ } from "./chunk-XVTKJEI2.js";
10
7
  import {
11
8
  updateTask
12
- } from "./chunk-ZMVVKOOS.js";
9
+ } from "./chunk-2EAYZ3BK.js";
13
10
  import {
14
11
  countPendingReviews,
15
12
  ensureEmployeeAsync,
@@ -25,14 +22,14 @@ import {
25
22
  sessionScopeFilter,
26
23
  strictSessionScopeFilter,
27
24
  writeNotification
28
- } from "./chunk-YSUHXDQU.js";
25
+ } from "./chunk-74R44E4S.js";
29
26
  import {
30
27
  LEASE_MINUTES,
31
28
  isLeaseExpired
32
29
  } from "./chunk-E23LNUWJ.js";
33
30
  import {
34
31
  listSessions
35
- } from "./chunk-PM4TIRCR.js";
32
+ } from "./chunk-3ODATKWH.js";
36
33
  import {
37
34
  getTransport
38
35
  } from "./chunk-UXLO7VHX.js";
@@ -44,7 +41,7 @@ import {
44
41
  } from "./chunk-SKGMF2SO.js";
45
42
  import {
46
43
  recordOrchestrationEventBestEffort
47
- } from "./chunk-X4EDW3FH.js";
44
+ } from "./chunk-POZGQQEZ.js";
48
45
  import {
49
46
  checkDispatchStatus,
50
47
  readTerminalLauncherFailure,
@@ -62,7 +59,10 @@ import {
62
59
  getCoordinatorName,
63
60
  isCoordinatorName,
64
61
  shouldAutoInstance
65
- } from "./chunk-M5DPPJLS.js";
62
+ } from "./chunk-EA5FVACM.js";
63
+ import {
64
+ eventLoopBlockedMarkerPath
65
+ } from "./chunk-JY5GAZYC.js";
66
66
  import {
67
67
  loadConfigSync
68
68
  } from "./chunk-BCZF3AGJ.js";
@@ -3194,7 +3194,7 @@ async function reapOrphanedWorktrees(deps, nowMs = Date.now()) {
3194
3194
  }
3195
3195
  async function createWorktreeReaperRealDeps() {
3196
3196
  const { getPaneCwdAsync } = await import("./lib/tmux-status.js");
3197
- const { getGitRootAsync, isWorktreeDirtyAsync } = await import("./worktree-EUYBBABA.js");
3197
+ const { getGitRootAsync, isWorktreeDirtyAsync } = await import("./worktree-NNVXVV6A.js");
3198
3198
  const { statSync: statSync3 } = await import("fs");
3199
3199
  const { basename: basename2 } = await import("path");
3200
3200
  const { promisify: promisify2 } = await import("util");
@@ -3425,7 +3425,7 @@ async function gcStaleCheckpoints() {
3425
3425
  }
3426
3426
  async function pollTaskGroupBarriers() {
3427
3427
  try {
3428
- const { checkAndFireBarriers } = await import("./tasks-crud-N54JZCXU.js");
3428
+ const { checkAndFireBarriers } = await import("./tasks-crud-IWVDREXG.js");
3429
3429
  const firedGroupIds = await checkAndFireBarriers();
3430
3430
  if (firedGroupIds.length === 0) return 0;
3431
3431
  const { getClient } = await import("./lib/database.js");
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getIdentity,
3
3
  loadEmployeesSync
4
- } from "./chunk-M5DPPJLS.js";
4
+ } from "./chunk-EA5FVACM.js";
5
5
 
6
6
  // src/lib/drift-probes.ts
7
7
  var DRIFT_THRESHOLD = 80;
@@ -0,0 +1,79 @@
1
+ // src/internal/sync-key-store.ts
2
+ import crypto from "crypto";
3
+ var ALGORITHM = "aes-256-gcm";
4
+ var IV_LENGTH = 12;
5
+ var TAG_LENGTH = 16;
6
+ var DEK_LENGTH = 32;
7
+ var PK_HASH_LENGTH = 8;
8
+ var X25519_PUB_LENGTH = 32;
9
+ var SYNC_HKDF_INFO = "exe-mem-sync-v2";
10
+ var SYNC_BLOB_VERSION = 1;
11
+ var ENVELOPE_BLOB_VERSION = 2;
12
+ var CURRENT_KEY_ID = 0;
13
+ var VERSIONED_HEADER_LENGTH = 2;
14
+ var RECIPIENT_SYMMETRIC = 0;
15
+ var RECIPIENT_X25519 = 1;
16
+ var SYM_RECIPIENT_LENGTH = 1 + IV_LENGTH + DEK_LENGTH + TAG_LENGTH;
17
+ var X25519_RECIPIENT_LENGTH = 1 + PK_HASH_LENGTH + X25519_PUB_LENGTH + IV_LENGTH + DEK_LENGTH + TAG_LENGTH;
18
+ var _syncKey = null;
19
+ function initSyncKey(masterKey) {
20
+ if (masterKey.length !== 32) {
21
+ throw new Error(`Master key must be 32 bytes, got ${masterKey.length}`);
22
+ }
23
+ _syncKey = Buffer.from(crypto.hkdfSync("sha256", masterKey, "", SYNC_HKDF_INFO, 32));
24
+ }
25
+ function isSyncKeyInitialized() {
26
+ return _syncKey !== null;
27
+ }
28
+ function requireSyncKey() {
29
+ if (!_syncKey) {
30
+ throw new Error("Sync crypto not initialized. Call initSyncCrypto(masterKey) first.");
31
+ }
32
+ return _syncKey;
33
+ }
34
+ function wrapDek(dek, wrapKey, aad) {
35
+ const iv = crypto.randomBytes(IV_LENGTH);
36
+ const cipher = crypto.createCipheriv(ALGORITHM, wrapKey, iv);
37
+ cipher.setAAD(aad);
38
+ const wrapped = Buffer.concat([cipher.update(dek), cipher.final()]);
39
+ const tag = cipher.getAuthTag();
40
+ return Buffer.concat([iv, wrapped, tag]);
41
+ }
42
+ function unwrapDek(iv, wrapped, tag, wrapKey, aad) {
43
+ const decipher = crypto.createDecipheriv(ALGORITHM, wrapKey, iv);
44
+ decipher.setAAD(aad);
45
+ decipher.setAuthTag(tag);
46
+ return Buffer.concat([decipher.update(wrapped), decipher.final()]);
47
+ }
48
+ function wrapDekForCurrentDevice(dek) {
49
+ const sym = wrapDek(dek, requireSyncKey(), Buffer.from([RECIPIENT_SYMMETRIC]));
50
+ return Buffer.concat([Buffer.from([RECIPIENT_SYMMETRIC]), sym]);
51
+ }
52
+ function v2PayloadAad(keyId, recipientCount, recipientBytes) {
53
+ const digest = crypto.createHash("sha256").update(recipientBytes).digest();
54
+ return Buffer.concat([Buffer.from([ENVELOPE_BLOB_VERSION, keyId, recipientCount]), digest]);
55
+ }
56
+
57
+ export {
58
+ ALGORITHM,
59
+ IV_LENGTH,
60
+ TAG_LENGTH,
61
+ DEK_LENGTH,
62
+ PK_HASH_LENGTH,
63
+ X25519_PUB_LENGTH,
64
+ SYNC_BLOB_VERSION,
65
+ ENVELOPE_BLOB_VERSION,
66
+ CURRENT_KEY_ID,
67
+ VERSIONED_HEADER_LENGTH,
68
+ RECIPIENT_SYMMETRIC,
69
+ RECIPIENT_X25519,
70
+ SYM_RECIPIENT_LENGTH,
71
+ X25519_RECIPIENT_LENGTH,
72
+ initSyncKey,
73
+ isSyncKeyInitialized,
74
+ requireSyncKey,
75
+ wrapDek,
76
+ unwrapDek,
77
+ wrapDekForCurrentDevice,
78
+ v2PayloadAad
79
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeReminder
3
- } from "./chunk-VPMAC5VB.js";
3
+ } from "./chunk-OY2PWHYR.js";
4
4
 
5
5
  // src/mcp/tools/complete-reminder.ts
6
6
  import { z } from "zod";
@@ -0,0 +1,135 @@
1
+ import {
2
+ eventLoopHeartbeatPath,
3
+ exeDir
4
+ } from "./chunk-JY5GAZYC.js";
5
+
6
+ // src/lib/mcp-health.ts
7
+ import { existsSync, readFileSync, statSync } from "fs";
8
+ import net from "net";
9
+ import path from "path";
10
+ function daemonPidPath() {
11
+ return process.env.EXE_DAEMON_PID ?? process.env.EXE_EMBED_PID ?? path.join(exeDir(), "exed.pid");
12
+ }
13
+ function daemonSockPath() {
14
+ return process.env.EXE_DAEMON_SOCK ?? process.env.EXE_EMBED_SOCK ?? path.join(exeDir(), "exed.sock");
15
+ }
16
+ var SOCKET_PING_TIMEOUT_MS = 300;
17
+ var HEARTBEAT_FRESH_MS = 6e4;
18
+ function isDaemonAlive() {
19
+ if (_isDaemonProcess) {
20
+ return { alive: true, pid: process.pid };
21
+ }
22
+ try {
23
+ const pidPath = daemonPidPath();
24
+ if (!existsSync(pidPath)) {
25
+ if (existsSync(daemonSockPath())) return { alive: true, pid: null };
26
+ return { alive: false, pid: null };
27
+ }
28
+ const pid = parseInt(readFileSync(pidPath, "utf8").trim(), 10);
29
+ if (!Number.isFinite(pid) || pid <= 0) return { alive: false, pid: null };
30
+ process.kill(pid, 0);
31
+ return { alive: true, pid };
32
+ } catch {
33
+ return { alive: false, pid: null };
34
+ }
35
+ }
36
+ function pingUnixSocket(socketPath, timeoutMs) {
37
+ return new Promise((resolve) => {
38
+ let settled = false;
39
+ const finish = (result) => {
40
+ if (settled) return;
41
+ settled = true;
42
+ try {
43
+ sock.destroy();
44
+ } catch {
45
+ }
46
+ resolve(result);
47
+ };
48
+ const sock = net.connect(socketPath);
49
+ sock.once("connect", () => finish("alive"));
50
+ sock.once("error", (err) => {
51
+ const code = err?.code;
52
+ finish(
53
+ code === "ECONNREFUSED" || code === "ENOENT" || code === "ENOTSOCK" || code === "ENOTDIR" ? "dead" : "indeterminate"
54
+ );
55
+ });
56
+ sock.setTimeout(timeoutMs, () => finish("indeterminate"));
57
+ });
58
+ }
59
+ function livePidWithFreshHeartbeat() {
60
+ let pidAlive = false;
61
+ try {
62
+ const pidPath = daemonPidPath();
63
+ if (existsSync(pidPath)) {
64
+ const pid = parseInt(readFileSync(pidPath, "utf8").trim(), 10);
65
+ if (Number.isFinite(pid) && pid > 0) {
66
+ try {
67
+ process.kill(pid, 0);
68
+ pidAlive = true;
69
+ } catch {
70
+ pidAlive = false;
71
+ }
72
+ }
73
+ }
74
+ } catch {
75
+ pidAlive = false;
76
+ }
77
+ if (!pidAlive) return false;
78
+ try {
79
+ const st = statSync(eventLoopHeartbeatPath());
80
+ return Date.now() - st.mtimeMs <= HEARTBEAT_FRESH_MS;
81
+ } catch {
82
+ return false;
83
+ }
84
+ }
85
+ async function isDaemonWriterAuthority() {
86
+ if (_isDaemonProcess) return true;
87
+ const socketPath = daemonSockPath();
88
+ const ping = await pingUnixSocket(socketPath, SOCKET_PING_TIMEOUT_MS);
89
+ if (ping !== "dead") return true;
90
+ return livePidWithFreshHeartbeat();
91
+ }
92
+ async function directWriterAllowed() {
93
+ if (process.env.VITEST) return true;
94
+ if (process.env.EXE_IS_DAEMON === "1" || _isDaemonProcess) return true;
95
+ if (process.env.EXE_DB_DIRECT === "1") return true;
96
+ return !await isDaemonWriterAuthority();
97
+ }
98
+ function isMcpHealthy(_timeoutMs = 2e3) {
99
+ if (_isDaemonProcess) return true;
100
+ const { alive } = isDaemonAlive();
101
+ if (!alive) return false;
102
+ return existsSync(daemonSockPath());
103
+ }
104
+ var _isDaemonProcess = false;
105
+ function markAsDaemonProcess() {
106
+ _isDaemonProcess = true;
107
+ }
108
+ var EVENT_LOOP_DEGRADED_THRESHOLD_MS = 5e3;
109
+ var _eventLoopLagMs = 0;
110
+ var _eventLoopLagUpdatedAt = 0;
111
+ function setEventLoopLagMs(lagMs) {
112
+ _eventLoopLagMs = lagMs;
113
+ _eventLoopLagUpdatedAt = Date.now();
114
+ }
115
+ function getEventLoopLagMs() {
116
+ return _eventLoopLagMs;
117
+ }
118
+ function getEventLoopLagUpdatedAt() {
119
+ return _eventLoopLagUpdatedAt;
120
+ }
121
+ function isEventLoopDegraded() {
122
+ return _eventLoopLagMs > EVENT_LOOP_DEGRADED_THRESHOLD_MS;
123
+ }
124
+
125
+ export {
126
+ isDaemonAlive,
127
+ isDaemonWriterAuthority,
128
+ directWriterAllowed,
129
+ isMcpHealthy,
130
+ markAsDaemonProcess,
131
+ setEventLoopLagMs,
132
+ getEventLoopLagMs,
133
+ getEventLoopLagUpdatedAt,
134
+ isEventLoopDegraded
135
+ };
@@ -9,10 +9,10 @@ import {
9
9
  import {
10
10
  buildClaudeHttpMcpEntry,
11
11
  buildClaudeStdioProxyMcpEntry
12
- } from "./chunk-34MIJGQS.js";
12
+ } from "./chunk-6EOLGE7T.js";
13
13
  import {
14
14
  ensureAllAgentSymlinks
15
- } from "./chunk-X7CWCQ5S.js";
15
+ } from "./chunk-CAEWPEBA.js";
16
16
  import {
17
17
  MCP_LEGACY_KEY,
18
18
  MCP_PRIMARY_KEY
@@ -7,6 +7,9 @@ import {
7
7
  isClientConnected,
8
8
  sendDaemonRequest
9
9
  } from "./chunk-W6UB2AWP.js";
10
+ import {
11
+ directWriterAllowed
12
+ } from "./chunk-V3W3SATA.js";
10
13
 
11
14
  // src/lib/db-daemon-client.ts
12
15
  function normalizeStatement(stmt) {
@@ -92,6 +95,9 @@ function createDaemonDbClient(fallbackClient) {
92
95
  return false;
93
96
  }
94
97
  const unavailableForMcp = (errMsg) => daemonMcpOpError(errMsg);
98
+ const daemonAliveNoWriterError = (context) => new Error(
99
+ `Daemon is alive but its socket was unavailable for a ${context}; refusing a direct SQLite WRITER fallback to preserve the single-writer gate (bug 4a6f8aaf). Retry \u2014 the daemon socket typically re-handshakes within a moment.`
100
+ );
95
101
  const client = {
96
102
  // Daemon-routed clients cannot span a transaction across requests —
97
103
  // BEGIN/COMMIT via execute() is rejected by the daemon SQL guard.
@@ -103,6 +109,10 @@ function createDaemonDbClient(fallbackClient) {
103
109
  const daemonReady = await ensureDaemonRoute();
104
110
  if (!daemonReady) {
105
111
  if (isMcpProcess()) throw unavailableForMcp();
112
+ const stmtSql = typeof stmt === "string" ? stmt : stmt.sql;
113
+ if (!isReadOnlySql(stmtSql) && !await directWriterAllowed()) {
114
+ throw daemonAliveNoWriterError("direct DB write");
115
+ }
106
116
  return fallbackClient.execute(stmt);
107
117
  }
108
118
  const { sql, args } = normalizeStatement(stmt);
@@ -146,6 +156,12 @@ function createDaemonDbClient(fallbackClient) {
146
156
  const daemonReady = await ensureDaemonRoute();
147
157
  if (!daemonReady) {
148
158
  if (isMcpProcess()) throw unavailableForMcp();
159
+ const readOnlyBatch = stmts.every(
160
+ (s) => isReadOnlySql(typeof s === "string" ? s : s.sql)
161
+ );
162
+ if (!readOnlyBatch && !await directWriterAllowed()) {
163
+ throw daemonAliveNoWriterError("direct DB batch write");
164
+ }
149
165
  return fallbackClient.batch(stmts, mode);
150
166
  }
151
167
  const statements = stmts.map(normalizeStatement);
@@ -192,16 +208,37 @@ function createDaemonDbClient(fallbackClient) {
192
208
  process.stderr.write("[db-daemon] Unexpected batch response shape, falling back to direct\n");
193
209
  return fallbackClient.batch(stmts, mode);
194
210
  },
195
- // Transaction support — delegate to fallback (transactions need direct connection)
211
+ // Transaction support — needs a direct connection. Single-writer gate (bug
212
+ // 4a6f8aaf / df26c896, ADR-016): these escape hatches must NOT open a direct
213
+ // WRITER while the daemon holds writer authority (including the boot window —
214
+ // an alive-but-slow daemon), or an external CLI holding this client could
215
+ // corrupt FTS5 under the live daemon. Authority is the STRONG async
216
+ // directWriterAllowed() (isDaemonWriterAuthority), not a stale sync flag. Fail
217
+ // closed exactly like execute()/batch(); daemonless / EXE_DB_DIRECT keep direct
218
+ // access. Multi-statement writes should use batch() (atomic, daemon-side).
219
+ // S1 (df26c896): an MCP process is refused UNCONDITIONALLY — even during a
220
+ // daemon outage (directWriterAllowed() === true) — mirroring execute()/batch().
221
+ // Otherwise N MCP agents in an outage could each open a direct writer and race
222
+ // FTS5. MCP work always funnels through the daemon; it never writes directly.
196
223
  async transaction(mode) {
224
+ if (isMcpProcess()) throw unavailableForMcp("direct DB transaction");
225
+ if (!await directWriterAllowed()) throw daemonAliveNoWriterError("direct DB transaction");
197
226
  return fallbackClient.transaction(mode);
198
227
  },
199
- // executeMultiple — delegate to fallback (used only for schema migrations)
228
+ // executeMultiple — delegate to fallback (used only for schema migrations).
229
+ // Same single-writer gate: DDL via a second direct writer is refused while
230
+ // the daemon holds writer authority. Schema is the daemon's responsibility
231
+ // (its own boot ensureSchema). S1: MCP refused unconditionally (see above).
200
232
  async executeMultiple(sql) {
233
+ if (isMcpProcess()) throw unavailableForMcp("direct DB executeMultiple");
234
+ if (!await directWriterAllowed()) throw daemonAliveNoWriterError("direct DB executeMultiple");
201
235
  return fallbackClient.executeMultiple(sql);
202
236
  },
203
- // migrate — delegate to fallback
237
+ // migrate — delegate to fallback. Same single-writer gate. S1: MCP refused
238
+ // unconditionally (see transaction()).
204
239
  async migrate(stmts) {
240
+ if (isMcpProcess()) throw unavailableForMcp("direct DB migrate");
241
+ if (!await directWriterAllowed()) throw daemonAliveNoWriterError("direct DB migrate");
205
242
  return fallbackClient.migrate(stmts);
206
243
  },
207
244
  // Sync mode — delegate to fallback