@askexenow/exe-os 0.9.410 → 0.9.412

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 (408) hide show
  1. package/delivery/catalog.json +29 -38
  2. package/deploy/compose/.env.customer.example +5 -5
  3. package/deploy/compose/.env.default +4 -4
  4. package/deploy/compose/.env.example +5 -5
  5. package/deploy/compose/docker-compose.yml +1 -1
  6. package/deploy/stack-manifests/v0.9.json +263 -2
  7. package/dist/.dist-verified.json +3 -3
  8. package/dist/{active-agent-2ELFTYNT.js → active-agent-3YCLS7GB.js} +4 -4
  9. package/dist/{active-agent-SS4SRXYZ.js → active-agent-MHWQDMML.js} +4 -4
  10. package/dist/{agent-defs-generator-6S2BSYCP.js → agent-defs-generator-DNXMO34I.js} +4 -4
  11. package/dist/{agentic-ontology-TJOAUAPD.js → agentic-ontology-RA6CMND6.js} +1 -1
  12. package/dist/{artifact-backup-STQQZDZ5.js → artifact-backup-EETHNFFP.js} +3 -3
  13. package/dist/{backfill-metadata-I2FVENKJ.js → backfill-metadata-WYT257VG.js} +7 -7
  14. package/dist/backup-verify-AG54CYGR.js +62 -0
  15. package/dist/{behavior-injection-CTSIKHTH.js → behavior-injection-G7GAUHGO.js} +10 -10
  16. package/dist/{behavior-promotion-NZMTTFHK.js → behavior-promotion-I2DIUFUR.js} +9 -9
  17. package/dist/{behaviors-RUNSC5WI.js → behaviors-SKVKPCRW.js} +8 -8
  18. package/dist/bin/agentic-ontology-backfill.js +8 -8
  19. package/dist/bin/agentic-reflection-backfill.js +9 -9
  20. package/dist/bin/agentic-semantic-label.js +8 -8
  21. package/dist/bin/backfill-conversations.js +7 -7
  22. package/dist/bin/backfill-responses.js +7 -7
  23. package/dist/bin/backfill-vectors.js +7 -7
  24. package/dist/bin/bulk-sync-postgres.js +16 -16
  25. package/dist/bin/cc-doctor.js +8 -8
  26. package/dist/bin/cleanup-stale-review-tasks.js +13 -13
  27. package/dist/bin/cli.js +24 -24
  28. package/dist/bin/deferred-daemon-restart.js +95 -95
  29. package/dist/bin/exe-actions.js +1 -1
  30. package/dist/bin/exe-agent-config.js +3 -3
  31. package/dist/bin/exe-agent.js +15 -15
  32. package/dist/bin/exe-assign.js +8 -8
  33. package/dist/bin/exe-boot.js +35 -35
  34. package/dist/bin/exe-call.js +9 -9
  35. package/dist/bin/exe-cloud.js +17 -17
  36. package/dist/bin/exe-config-dump.js +3 -3
  37. package/dist/bin/exe-dispatch.js +14 -14
  38. package/dist/bin/exe-doctor.js +5 -5
  39. package/dist/bin/exe-export-behaviors.js +12 -12
  40. package/dist/bin/exe-forget.js +10 -10
  41. package/dist/bin/exe-gateway.js +9 -9
  42. package/dist/bin/exe-grant.js +6 -6
  43. package/dist/bin/exe-healthcheck.js +8 -8
  44. package/dist/bin/exe-heartbeat.js +19 -19
  45. package/dist/bin/exe-kill.js +18 -18
  46. package/dist/bin/exe-launch-agent.js +75 -36
  47. package/dist/bin/exe-mcp.js +5 -5
  48. package/dist/bin/exe-memory-reads.js +7 -7
  49. package/dist/bin/exe-new-employee.js +11 -11
  50. package/dist/bin/exe-os-mcp-proxy.js +5 -5
  51. package/dist/bin/exe-pending-messages.js +14 -14
  52. package/dist/bin/exe-pending-notifications.js +13 -13
  53. package/dist/bin/exe-pending-reviews.js +14 -14
  54. package/dist/bin/exe-rename.js +7 -7
  55. package/dist/bin/exe-review.js +17 -17
  56. package/dist/bin/exe-search.js +9 -9
  57. package/dist/bin/exe-session-cleanup.js +18 -18
  58. package/dist/bin/exe-settings.js +16 -16
  59. package/dist/bin/exe-start-codex.js +37 -19
  60. package/dist/bin/exe-start-opencode.js +35 -17
  61. package/dist/bin/exe-status.js +15 -15
  62. package/dist/bin/exe-support.js +3 -3
  63. package/dist/bin/exe-team.js +5 -5
  64. package/dist/bin/git-sweep.js +15 -15
  65. package/dist/bin/graph-backfill.js +8 -8
  66. package/dist/bin/graph-export.js +8 -8
  67. package/dist/bin/hooks-cli.js +1 -1
  68. package/dist/bin/import-history.js +11 -11
  69. package/dist/bin/install.js +97 -97
  70. package/dist/bin/intercom-check.js +5 -5
  71. package/dist/bin/mcp-sessions.js +2 -2
  72. package/dist/bin/orchestration-metrics.js +5 -5
  73. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  74. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  75. package/dist/bin/pre-publish.js +1 -1
  76. package/dist/bin/reconcile-backlog.js +2 -2
  77. package/dist/bin/registry-proxy.js +1 -1
  78. package/dist/bin/repair-document-chunks.js +7 -7
  79. package/dist/bin/scan-tasks.js +14 -14
  80. package/dist/bin/setup.js +2 -2
  81. package/dist/bin/shard-migrate.js +8 -8
  82. package/dist/bin/stack-update.js +41 -16
  83. package/dist/bin/verify-stack.js +1 -1
  84. package/dist/bin/vps-health-gate.js +1 -1
  85. package/dist/{boot-generation-4W4CDJSX.js → boot-generation-RPJVFAQJ.js} +4 -4
  86. package/dist/{boot-review-sections-HJN25GMU.js → boot-review-sections-FOPPZTJI.js} +12 -12
  87. package/dist/{bug-landed-reconciler-GGQU6G2L.js → bug-landed-reconciler-FN5KPBRK.js} +6 -6
  88. package/dist/build-info.json +3 -3
  89. package/dist/build-manifest.json +936 -926
  90. package/dist/{capability-cards-EV7VHL3W.js → capability-cards-YQWBEG7A.js} +3 -3
  91. package/dist/{capacity-monitor-YO3WRSRY.js → capacity-monitor-7SMEJHYG.js} +14 -14
  92. package/dist/{catchup-brief-4XFFW3H2.js → catchup-brief-IBQ26LEB.js} +19 -19
  93. package/dist/{chunk-YJ7MCZSY.js → chunk-27NG2NTG.js} +2 -2
  94. package/dist/{chunk-2AXJRXA6.js → chunk-2BOLFLAU.js} +4 -2
  95. package/dist/{chunk-AGXV5HLA.js → chunk-2EYVXUGA.js} +4 -4
  96. package/dist/{chunk-2YZZR2BW.js → chunk-2YFMBXUU.js} +4 -4
  97. package/dist/{chunk-ZBXZFOIF.js → chunk-2YGBJHC2.js} +3 -3
  98. package/dist/{chunk-I35OMCL3.js → chunk-353XF4LU.js} +2 -2
  99. package/dist/{chunk-UF5BDAF6.js → chunk-3DXAJVXE.js} +6 -6
  100. package/dist/{chunk-AEOB4JCJ.js → chunk-3GGMHSY2.js} +3 -3
  101. package/dist/{chunk-K6XWIJN7.js → chunk-3N24FV22.js} +1 -1
  102. package/dist/{chunk-7WCYJXOF.js → chunk-47YGEM4N.js} +1 -1
  103. package/dist/{chunk-NVM3SKJ4.js → chunk-4CN3EE6U.js} +27 -21
  104. package/dist/{chunk-IQCC6WFI.js → chunk-4J77TCTX.js} +1 -1
  105. package/dist/{chunk-H5H2LGVE.js → chunk-5BWDUUMH.js} +3 -3
  106. package/dist/{chunk-O5RKAXCG.js → chunk-5DLZJ3MY.js} +1 -1
  107. package/dist/{chunk-E3ZO4EL3.js → chunk-5ZMNFSHV.js} +1 -1
  108. package/dist/{chunk-7QFRZT4H.js → chunk-657I6PUF.js} +3 -3
  109. package/dist/{chunk-IXRYS5X3.js → chunk-6777GNWI.js} +1 -1
  110. package/dist/{chunk-4THJIDJE.js → chunk-6BD6JYR2.js} +1 -1
  111. package/dist/{chunk-JTXXLNYD.js → chunk-6DMURUBY.js} +4 -4
  112. package/dist/{chunk-47UBJKS3.js → chunk-6HJF7IA3.js} +168 -205
  113. package/dist/{chunk-PONGX3YG.js → chunk-6J2J3VJS.js} +10 -10
  114. package/dist/{chunk-XBCIRNNU.js → chunk-6PXFF6IV.js} +1 -1
  115. package/dist/{chunk-DWK5HEKY.js → chunk-7HLAYQRG.js} +4 -4
  116. package/dist/{chunk-RWM6TZH6.js → chunk-7KPZQ65I.js} +3 -3
  117. package/dist/{chunk-BPXWWD7P.js → chunk-7PDZBPGW.js} +1 -1
  118. package/dist/{chunk-2K7IKLBL.js → chunk-7SHU5MOD.js} +1 -1
  119. package/dist/{chunk-APKEGWFB.js → chunk-A5I2GYVQ.js} +3 -3
  120. package/dist/{chunk-X4V5ZLNX.js → chunk-A75TAU2I.js} +628 -4
  121. package/dist/{chunk-T7W75LII.js → chunk-BE3UETW6.js} +3 -3
  122. package/dist/{chunk-575FWHQJ.js → chunk-BG6RAOCJ.js} +63 -9
  123. package/dist/{chunk-YSDSQRE2.js → chunk-BIPTWAEO.js} +1 -1
  124. package/dist/{chunk-FYKEL2L6.js → chunk-BLTXAUP6.js} +2 -2
  125. package/dist/{chunk-ASA2UJDH.js → chunk-CFFSHBQF.js} +1 -1
  126. package/dist/{chunk-XCKTCOK3.js → chunk-CJ6CS2IH.js} +5 -5
  127. package/dist/{chunk-V7AID6MC.js → chunk-CRW63CDI.js} +1 -1
  128. package/dist/{chunk-B34RSIUP.js → chunk-CWHTUNJX.js} +2 -2
  129. package/dist/{chunk-HKAWEIB2.js → chunk-D6NZNUVH.js} +1 -1
  130. package/dist/{chunk-CEHGXPMO.js → chunk-DHLJZDWI.js} +4 -4
  131. package/dist/{chunk-FCX2XHIC.js → chunk-DWRULKB3.js} +2 -2
  132. package/dist/{chunk-KNEEOZWN.js → chunk-EOWJXCYC.js} +25 -7
  133. package/dist/{chunk-5BWN6A5E.js → chunk-EWDBWOCX.js} +1 -1
  134. package/dist/{chunk-IUAW7FVX.js → chunk-FPF2PJFK.js} +3 -3
  135. package/dist/{chunk-B55U5BKF.js → chunk-FSXMKIDO.js} +1 -1
  136. package/dist/{chunk-2A556FNI.js → chunk-FUDXITKX.js} +1 -1
  137. package/dist/{chunk-FZT7CBXB.js → chunk-FYV2CTKP.js} +1 -1
  138. package/dist/{chunk-R2ZHPVF2.js → chunk-GATAYYAF.js} +3 -3
  139. package/dist/{chunk-CKRZBQ2K.js → chunk-GHYHNHDL.js} +1 -1
  140. package/dist/{chunk-IHBYJG7N.js → chunk-GL5ZG72X.js} +1 -1
  141. package/dist/{chunk-WSYIQKZ6.js → chunk-GM4UEZDE.js} +20 -20
  142. package/dist/{chunk-QKHQTHE6.js → chunk-GZVFHFO3.js} +10 -135
  143. package/dist/{chunk-XC2KAJK4.js → chunk-HA6BIZ6L.js} +5 -5
  144. package/dist/chunk-HDQAVAV6.js +248 -0
  145. package/dist/{chunk-5Q64Q5ZD.js → chunk-HDV2V25K.js} +1 -1
  146. package/dist/{chunk-26CY4EAR.js → chunk-HTFM7ZDD.js} +2 -2
  147. package/dist/{chunk-NUEDA2US.js → chunk-HUHR5CKJ.js} +4 -4
  148. package/dist/{chunk-BIHPY7JW.js → chunk-IC2AONBH.js} +9 -9
  149. package/dist/{chunk-2YK5HP2B.js → chunk-IHAXXDBH.js} +3 -3
  150. package/dist/{chunk-5JHIAGZY.js → chunk-IPUDXR67.js} +1 -1
  151. package/dist/{chunk-BBTNF72N.js → chunk-J6U4ZR77.js} +2 -2
  152. package/dist/{chunk-2OIVIPU7.js → chunk-JAIZCE6W.js} +3 -3
  153. package/dist/{chunk-WLV27PAO.js → chunk-JGBYZTWH.js} +1 -1
  154. package/dist/{chunk-4XY33GRO.js → chunk-JJZZXEAN.js} +3 -3
  155. package/dist/{chunk-3UEDFBDE.js → chunk-JNULO6I5.js} +3 -3
  156. package/dist/{chunk-JZ23D5YF.js → chunk-JTJP4JK7.js} +3 -3
  157. package/dist/{chunk-JDZNGC4O.js → chunk-JW5NUXPN.js} +11 -11
  158. package/dist/{chunk-GGT6Y5AN.js → chunk-K2HIXAIF.js} +12 -12
  159. package/dist/{chunk-NYV4A5IG.js → chunk-KEDZRQI3.js} +2 -2
  160. package/dist/{chunk-S2DTXCV6.js → chunk-KN5GAVCG.js} +2 -2
  161. package/dist/{chunk-LBEBSXZA.js → chunk-L5JFVK5T.js} +4 -4
  162. package/dist/{chunk-HNJLAMD3.js → chunk-LBSCOP25.js} +1 -1
  163. package/dist/{chunk-FOZSHNET.js → chunk-LLZUL7M2.js} +1 -1
  164. package/dist/{chunk-53GNYXNR.js → chunk-LQGLGSBY.js} +2 -2
  165. package/dist/{chunk-X2EBM5BQ.js → chunk-LSHUX7P4.js} +16 -16
  166. package/dist/{chunk-AWTLUJZL.js → chunk-M6AX64J2.js} +2 -2
  167. package/dist/{chunk-7RVTQXST.js → chunk-M6SUJLNP.js} +2 -2
  168. package/dist/{chunk-OUUNFTS4.js → chunk-MZNLQC6W.js} +1 -1
  169. package/dist/{chunk-PCF4QMJS.js → chunk-N7POJZJT.js} +10 -10
  170. package/dist/{chunk-2CG3LHI6.js → chunk-NCNT2C2P.js} +2 -2
  171. package/dist/{chunk-R3N5BCMM.js → chunk-O3BLL6MY.js} +1 -1
  172. package/dist/{chunk-SLG3T26A.js → chunk-O6KQAJCC.js} +3 -3
  173. package/dist/{chunk-2WOHFX4Z.js → chunk-OHHZNNUD.js} +1 -1
  174. package/dist/{chunk-HWP3WCLC.js → chunk-OPG237ZQ.js} +154 -50
  175. package/dist/{chunk-2LJ2GZEE.js → chunk-PDQGR5LZ.js} +1 -1
  176. package/dist/{chunk-UBTKHJCB.js → chunk-PTF5TB6O.js} +6 -6
  177. package/dist/{chunk-5F3E57TQ.js → chunk-PYXXL7N7.js} +1 -1
  178. package/dist/{chunk-HLNRLXUS.js → chunk-Q6KUBP6R.js} +5 -5
  179. package/dist/{chunk-AGY2KUQ6.js → chunk-QJWLQXR7.js} +1 -1
  180. package/dist/{chunk-ZEDLED43.js → chunk-QOFQY7BJ.js} +1 -1
  181. package/dist/{chunk-6T5RC3L4.js → chunk-QSW5DHMZ.js} +1 -1
  182. package/dist/{chunk-54Q7M2AG.js → chunk-QV26G2BF.js} +1 -1
  183. package/dist/{chunk-5WNZGNQL.js → chunk-RHHEYC6H.js} +3 -3
  184. package/dist/{chunk-K464YYT5.js → chunk-RHJOTGEU.js} +1 -1
  185. package/dist/{chunk-LZS2B2JT.js → chunk-RIKFXHLE.js} +247 -31
  186. package/dist/{chunk-6TOV7UVU.js → chunk-RJIH7JXM.js} +4 -4
  187. package/dist/{chunk-2Q2U3NB2.js → chunk-RMC2A6EE.js} +1 -1
  188. package/dist/{chunk-FUEKSCTN.js → chunk-RYMXD2NT.js} +1 -1
  189. package/dist/{chunk-MNWN3SQ3.js → chunk-RYYFFCJG.js} +1 -1
  190. package/dist/{chunk-E2346GKI.js → chunk-SINIRUYZ.js} +101 -9
  191. package/dist/{chunk-22XJWSWN.js → chunk-SXUABANK.js} +3 -3
  192. package/dist/{backup-verify-AOTKX5DA.js → chunk-T3AM52YT.js} +345 -89
  193. package/dist/{chunk-LCXWQVOD.js → chunk-TCBWHLKH.js} +4 -4
  194. package/dist/{chunk-YWZGDFAL.js → chunk-TS4LSNRI.js} +2 -2
  195. package/dist/{chunk-J6RTX7XT.js → chunk-TVWYMOZ4.js} +1 -1
  196. package/dist/{chunk-3WNDI5KT.js → chunk-VAHQOIQY.js} +1 -1
  197. package/dist/{chunk-QH2V67NX.js → chunk-VBYSAQJD.js} +1 -1
  198. package/dist/{chunk-MQD3JJCO.js → chunk-VQQPYI4X.js} +1 -1
  199. package/dist/{chunk-XJQGS4IM.js → chunk-VS7V5HNO.js} +1 -1
  200. package/dist/{chunk-CPC75PXE.js → chunk-W3ABSZ6G.js} +2 -2
  201. package/dist/{chunk-SUGAHHVR.js → chunk-W7VKGB42.js} +1 -1
  202. package/dist/{chunk-UG3YOQAC.js → chunk-X2ZHCNNB.js} +5 -5
  203. package/dist/{chunk-YC6SZFVD.js → chunk-X4FHT6ST.js} +5 -5
  204. package/dist/{chunk-RXICR3D7.js → chunk-XC5OASHV.js} +1 -1
  205. package/dist/{chunk-TU5Y5ZNC.js → chunk-XDOCXKHW.js} +58 -1
  206. package/dist/{chunk-DLHE4PCM.js → chunk-XEAZJXMZ.js} +4 -4
  207. package/dist/{chunk-XMMWBLQK.js → chunk-XQ7BIVLI.js} +6 -6
  208. package/dist/{chunk-FRJICRED.js → chunk-Z3LGAFMG.js} +1 -1
  209. package/dist/{chunk-HCBISGUU.js → chunk-ZJ6AMC4Y.js} +7 -7
  210. package/dist/{chunk-AEEAQZ3E.js → chunk-ZZR2WRNW.js} +4 -4
  211. package/dist/{cleanup-graph-garbage-N7FTWU6C.js → cleanup-graph-garbage-SYGPMPUM.js} +8 -8
  212. package/dist/{cli-shutdown-NCBQTN7G.js → cli-shutdown-JI7CASE4.js} +1 -1
  213. package/dist/{cloud-sync-command-UL7GNN3J.js → cloud-sync-command-ZV3P5FP6.js} +2 -2
  214. package/dist/{cloud-sync-db-init-ASM7ZXBH.js → cloud-sync-db-init-RQIHWKV4.js} +1 -1
  215. package/dist/{cloud-sync-shutdown-HER4ISBU.js → cloud-sync-shutdown-V2N7VLD3.js} +3 -3
  216. package/dist/{co-activation-V5XXR327.js → co-activation-SRE6DIRX.js} +3 -3
  217. package/dist/{co-occurrence-MKZ6YWSQ.js → co-occurrence-F5TMSEQZ.js} +6 -6
  218. package/dist/{consent-passphrase-YI3J4UEL.js → consent-passphrase-MWZRHJRC.js} +2 -2
  219. package/dist/{conversation-entity-extractor-66G7ROQ3.js → conversation-entity-extractor-XMOUHGMT.js} +3 -3
  220. package/dist/{crdt-sync-Z62SWOKD.js → crdt-sync-FXEKABM7.js} +4 -4
  221. package/dist/{crm-webhook-6GBACWJX.js → crm-webhook-D6IJOPRQ.js} +2 -2
  222. package/dist/{cto-delegation-gate-FUKPBFCM.js → cto-delegation-gate-BU3JRCYN.js} +12 -12
  223. package/dist/{daemon-orchestration-O3QPSJEP.js → daemon-orchestration-K4NKFYXO.js} +19 -19
  224. package/dist/{destructive-data-guard-JDUJ2ULM.js → destructive-data-guard-3TGAAE7K.js} +77 -23
  225. package/dist/{doc-graph-extractor-BBPKLIVM.js → doc-graph-extractor-TVK2NGAR.js} +6 -6
  226. package/dist/{documents-NILTWYSQ.js → documents-MDZ4VB5X.js} +8 -8
  227. package/dist/{dreaming-KMDGPIFY.js → dreaming-L24PSS35.js} +17 -17
  228. package/dist/{employee-boot-brief-KSH3MWIF.js → employee-boot-brief-GQVL3FQC.js} +21 -21
  229. package/dist/{entity-boost-XETN7C2S.js → entity-boost-OMFA5QCG.js} +1 -1
  230. package/dist/{exe-drift-SFD7SHXC.js → exe-drift-JDDG3OPT.js} +4 -4
  231. package/dist/{exe-export-NHWKEZL4.js → exe-export-EEGIE3JP.js} +10 -10
  232. package/dist/{exe-import-SPI5HJBU.js → exe-import-UJNC5Q2L.js} +10 -10
  233. package/dist/{exe-key-TY5LFUEM.js → exe-key-TYEY4W4E.js} +95 -95
  234. package/dist/{exe-org-LVQLXA7C.js → exe-org-B3ICTTEV.js} +32 -32
  235. package/dist/{exe-snapshot-WH2DSRZW.js → exe-snapshot-VBFBONYN.js} +20 -20
  236. package/dist/{fast-db-init-UN225WS7.js → fast-db-init-TFRTK6EH.js} +1 -1
  237. package/dist/{founder-context-DVHSVBM5.js → founder-context-3X4QUWKD.js} +2 -2
  238. package/dist/{founder-monitor-envelope-HMPPUBUT.js → founder-monitor-envelope-54UNZNY4.js} +4 -4
  239. package/dist/gateway/index.js +14 -14
  240. package/dist/{gateway-client-TXHCHOVM.js → gateway-client-OUDO5GGV.js} +1 -1
  241. package/dist/{git-staleness-CUVLXQOJ.js → git-staleness-73YZ5PGU.js} +3 -3
  242. package/dist/{global-procedures-T5W3S6OU.js → global-procedures-PYNE2BQG.js} +20 -6
  243. package/dist/{graph-auto-extract-S7OIZXYP.js → graph-auto-extract-PGUMEEQB.js} +6 -6
  244. package/dist/{graph-query-CRIH4DXF.js → graph-query-7YA3YNKL.js} +1 -1
  245. package/dist/{graph-rag-LH34CEGC.js → graph-rag-UWOTK4AQ.js} +3 -3
  246. package/dist/{hook-integrity-TSJYZFZ6.js → hook-integrity-6MNEPT6W.js} +1 -1
  247. package/dist/{hook-prefetch-SNW5DFCZ.js → hook-prefetch-JOF6YZSR.js} +13 -13
  248. package/dist/hooks/bug-report-worker.js +17 -17
  249. package/dist/hooks/codex-stop-task-finalizer.js +19 -19
  250. package/dist/hooks/commit-complete.js +16 -16
  251. package/dist/hooks/error-recall.js +11 -11
  252. package/dist/hooks/exe-heartbeat-hook.js +5 -5
  253. package/dist/hooks/ingest-worker.js +15 -15
  254. package/dist/hooks/ingest.js +13 -13
  255. package/dist/hooks/instructions-loaded.js +7 -7
  256. package/dist/hooks/manifest.json +20 -20
  257. package/dist/hooks/notification.js +6 -6
  258. package/dist/hooks/post-compact.js +5 -5
  259. package/dist/hooks/post-tool-combined.js +13 -13
  260. package/dist/hooks/pre-compact.js +16 -16
  261. package/dist/hooks/pre-tool-use.js +2 -2
  262. package/dist/hooks/prompt-submit.js +34 -34
  263. package/dist/hooks/session-end.js +21 -21
  264. package/dist/hooks/session-start.js +18 -18
  265. package/dist/hooks/stop.js +19 -19
  266. package/dist/hooks/subagent-stop.js +18 -18
  267. package/dist/hooks/summary-worker.js +20 -20
  268. package/dist/index.js +26 -26
  269. package/dist/{installer-4IVP2PTX.js → installer-34XZ7JMW.js} +6 -6
  270. package/dist/{installer-UFRZHMX5.js → installer-356RMQ2K.js} +6 -6
  271. package/dist/{installer-CJWNUASI.js → installer-7TN36Z7T.js} +112 -28
  272. package/dist/{intercom-queue-II6RRK3J.js → intercom-queue-ZJ3MNULM.js} +12 -12
  273. package/dist/lib/backup-verify-worker.js +157 -0
  274. package/dist/lib/cloud-sync.js +16 -20
  275. package/dist/lib/consolidation.js +9 -9
  276. package/dist/lib/crypto.js +3 -3
  277. package/dist/lib/database.js +3 -3
  278. package/dist/lib/db-backup.js +7 -3
  279. package/dist/lib/db-write-worker.js +3 -3
  280. package/dist/lib/db.js +3 -3
  281. package/dist/lib/device-registry.js +1 -1
  282. package/dist/lib/employee-templates.js +7 -7
  283. package/dist/lib/employees.js +3 -3
  284. package/dist/lib/exe-daemon.js +89 -84
  285. package/dist/lib/hybrid-search.js +9 -9
  286. package/dist/lib/identity.js +3 -3
  287. package/dist/lib/keychain.js +1 -1
  288. package/dist/lib/license.js +2 -2
  289. package/dist/lib/messaging.js +13 -13
  290. package/dist/lib/post-tool-memory.js +13 -13
  291. package/dist/lib/registry-proxy.js +1 -1
  292. package/dist/lib/reminders.js +4 -4
  293. package/dist/lib/schedules.js +8 -8
  294. package/dist/lib/session-registry.js +5 -5
  295. package/dist/lib/skill-learning.js +9 -9
  296. package/dist/lib/store.js +7 -7
  297. package/dist/lib/task-router.js +4 -4
  298. package/dist/lib/tasks.js +14 -14
  299. package/dist/lib/tmux-routing.js +12 -12
  300. package/dist/lib/token-spend.js +4 -4
  301. package/dist/lib/ws-client.js +1 -1
  302. package/dist/{license-gate-M7EDJLAA.js → license-gate-4BXUTHLB.js} +3 -3
  303. package/dist/{license-recheck-DLTOHAH2.js → license-recheck-QFPUKISQ.js} +1 -1
  304. package/dist/{license-sync-YTDCUN3S.js → license-sync-FDEDT4AC.js} +2 -2
  305. package/dist/mcp/register-tools.js +94 -94
  306. package/dist/mcp/server.js +97 -97
  307. package/dist/mcp/tools/complete-reminder.js +5 -5
  308. package/dist/mcp/tools/create-reminder.js +5 -5
  309. package/dist/mcp/tools/create-task.js +16 -16
  310. package/dist/mcp/tools/deactivate-behavior.js +10 -10
  311. package/dist/mcp/tools/list-reminders.js +5 -5
  312. package/dist/mcp/tools/list-tasks.js +16 -16
  313. package/dist/mcp/tools/send-message.js +15 -15
  314. package/dist/mcp/tools/update-task.js +15 -15
  315. package/dist/{mcp-http-config-652YK3CI.js → mcp-http-config-GKP5QGAO.js} +5 -5
  316. package/dist/{mcp-session-identity-6QGXD52Y.js → mcp-session-identity-JHAGRB7B.js} +12 -12
  317. package/dist/{memory-cards-FOPSLULE.js → memory-cards-O377ETAM.js} +7 -7
  318. package/dist/{memory-graph-extractor-7G3CIGN7.js → memory-graph-extractor-4KJCCUOP.js} +7 -7
  319. package/dist/{memory-maintenance-5XIGUPYL.js → memory-maintenance-RR5UPRW3.js} +1 -1
  320. package/dist/{memory-poisoning-defense-MI7Y5XBP.js → memory-poisoning-defense-Y5TTKGOP.js} +3 -3
  321. package/dist/{memory-pressure-watchdog-SPIDPGU2.js → memory-pressure-watchdog-NGXTI4HR.js} +13 -13
  322. package/dist/{memory-reflection-DVAT4QKS.js → memory-reflection-EXNHRZL7.js} +7 -7
  323. package/dist/{memory-write-repository-YC7HJTV5.js → memory-write-repository-S4TX7WQB.js} +1 -1
  324. package/dist/{monitor-grants-3A77O6XK.js → monitor-grants-57Q4NL25.js} +3 -3
  325. package/dist/{monitor-identity-BTFFMFEX.js → monitor-identity-3FQ52SYU.js} +2 -2
  326. package/dist/{notification-ledger-AV5242RM.js → notification-ledger-O6KQYYGK.js} +13 -13
  327. package/dist/{notifications-75FVPJLY.js → notifications-6FCQCJ4P.js} +12 -12
  328. package/dist/{orchestration-events-ARGZU6KS.js → orchestration-events-2Z2BMMA5.js} +4 -4
  329. package/dist/{orchestrator-TCXZMLSB.js → orchestrator-AGOSKPHD.js} +14 -14
  330. package/dist/{org-brief-session-B455POUI.js → org-brief-session-WJHZVXXJ.js} +15 -15
  331. package/dist/{org-consent-policy-7K5H6FOB.js → org-consent-policy-X43UGTHI.js} +5 -5
  332. package/dist/{org-join-ETR5KO27.js → org-join-M3UTBMHC.js} +9 -9
  333. package/dist/{org-key-admin-IRC6H3TL.js → org-key-admin-AA2DRHB2.js} +11 -11
  334. package/dist/{org-key-epoch-EG4YQ47A.js → org-key-epoch-Z5UIVUHT.js} +5 -5
  335. package/dist/{org-key-pin-GLQEU3P3.js → org-key-pin-FE6YHEZ3.js} +3 -3
  336. package/dist/{org-membership-JC5YVU6N.js → org-membership-3J2MIGE4.js} +4 -4
  337. package/dist/{org-partner-config-QFSVGHEA.js → org-partner-config-5HATZYG4.js} +8 -8
  338. package/dist/{org-partner-runtime-7AD7WY3Y.js → org-partner-runtime-UI35IHUC.js} +15 -15
  339. package/dist/{org-row-visibility-AXZKVOA6.js → org-row-visibility-TRJERVYP.js} +1 -1
  340. package/dist/{pipeline-router-2KY4X6PO.js → pipeline-router-EKQ6D7ZA.js} +4 -4
  341. package/dist/{plan-limits-PG6HG2DT.js → plan-limits-3BGHIHX6.js} +6 -6
  342. package/dist/{platform-procedures-QP3W2NLH.js → platform-procedures-RXW46WNY.js} +1 -1
  343. package/dist/{pre-tool-use-impl-45B4NFIF.js → pre-tool-use-impl-7BT5TJVM.js} +28 -28
  344. package/dist/{project-name-LHYHR4VN.js → project-name-PGJGUEJY.js} +4 -4
  345. package/dist/{projection-worker-POT2AOR5.js → projection-worker-3GEVFPAI.js} +2 -2
  346. package/dist/{prospective-memory-ECXSAEAW.js → prospective-memory-GEN7CN7H.js} +3 -3
  347. package/dist/{push-notifications-W3UNHDC5.js → push-notifications-QW4BWRC7.js} +13 -13
  348. package/dist/{reproject-worktree-memories-PIXMJBHG.js → reproject-worktree-memories-DIULBEBD.js} +12 -12
  349. package/dist/{reranker-ZBPYIRBB.js → reranker-LQ6OPJOI.js} +1 -1
  350. package/dist/{retrieval-health-42MFLOEP.js → retrieval-health-XDFYFEOP.js} +1 -1
  351. package/dist/{review-polling-V4CSK4TZ.js → review-polling-ED33YLFT.js} +13 -13
  352. package/dist/runtime/index.js +20 -20
  353. package/dist/{session-events-C3NUY6MR.js → session-events-7IJGTBVH.js} +13 -13
  354. package/dist/{session-kill-telemetry-ZOSAIYU2.js → session-kill-telemetry-RUTEARJ3.js} +13 -13
  355. package/dist/{session-scope-BZALGKYZ.js → session-scope-SSYA64L3.js} +12 -12
  356. package/dist/{setup-wizard-DNA2UT4J.js → setup-wizard-XD7FZVLJ.js} +2 -2
  357. package/dist/{shard-manager-NG4SXV7L.js → shard-manager-FH5JZRSE.js} +2 -2
  358. package/dist/{skill-refinement-Y3M7XBRE.js → skill-refinement-UHD4E6GV.js} +4 -4
  359. package/dist/{skill-retrieval-XDY352AS.js → skill-retrieval-F6PAJ3I5.js} +11 -11
  360. package/dist/{skill-usage-QOLIJQJC.js → skill-usage-2MBTF7Y4.js} +4 -4
  361. package/dist/{stack-generate-manifest-VFHCOLAD.js → stack-generate-manifest-MVJDTU4F.js} +13 -37
  362. package/dist/{stack-promote-24BY6AXF.js → stack-promote-BMGEY6SQ.js} +4 -4
  363. package/dist/{stack-release-AXH7ZIOR.js → stack-release-64UJ6Y4W.js} +17 -34
  364. package/dist/{stack-update-7ET7S3ED.js → stack-update-EBATTQPP.js} +5 -3
  365. package/dist/{steward-gate-2MUESY3V.js → steward-gate-EWG2BHYQ.js} +4 -4
  366. package/dist/{subagent-brief-injection-6PM3WMMR.js → subagent-brief-injection-YZGSWUEY.js} +23 -23
  367. package/dist/{support-bug-actions-WWKDXT74.js → support-bug-actions-RU6WZ3UV.js} +3 -3
  368. package/dist/{support-inbox-AN44HIOG.js → support-inbox-A3S52SPS.js} +12 -12
  369. package/dist/{task-enforcement-QO7RXYK2.js → task-enforcement-LVAS55AR.js} +13 -13
  370. package/dist/{task-request-inbox-RXAT2QJF.js → task-request-inbox-2TN4ZUH2.js} +5 -5
  371. package/dist/{task-scope-4EKZBTTM.js → task-scope-NLKUVCP5.js} +12 -12
  372. package/dist/{tasks-crud-MB7WXGPW.js → tasks-crud-NQDPLHNZ.js} +12 -12
  373. package/dist/{tasks-notify-BCWO7AP6.js → tasks-notify-BDM2NEHP.js} +13 -13
  374. package/dist/{tasks-review-HXHYA76X.js → tasks-review-3G7CAW2O.js} +12 -12
  375. package/dist/{telemetry-upload-Q7DLE5I3.js → telemetry-upload-6DR6AL3V.js} +8 -8
  376. package/dist/{token-budget-EL6BEBDP.js → token-budget-KNC2WGR7.js} +4 -4
  377. package/dist/{tool-telemetry-SNWF4WDH.js → tool-telemetry-I3SEU5M5.js} +1 -1
  378. package/dist/tui/App.js +23 -23
  379. package/dist/{tui-data-ZMSBEPJT.js → tui-data-KJDWP4CB.js} +16 -16
  380. package/dist/{update-support-QY7WALUZ.js → update-support-UYDYMHVR.js} +11 -11
  381. package/dist/{whatsapp-NCZ43BB3.js → whatsapp-5EMPZHF5.js} +2 -2
  382. package/dist/{wiki-acl-3L7BRJUV.js → wiki-acl-M7BTQJBZ.js} +1 -1
  383. package/dist/{work-claims-XQXT2VWJ.js → work-claims-5CFMZTML.js} +4 -4
  384. package/dist/{work-state-heartbeat-GAIQ7M73.js → work-state-heartbeat-7IA2DZ2E.js} +1 -1
  385. package/dist/{workflow-engine-FCOOI5M6.js → workflow-engine-S5JOE2YR.js} +2 -2
  386. package/dist/{worktree-GS4ODQ4C.js → worktree-7V4ZMF3D.js} +5 -5
  387. package/dist/{worktree-sweep-6LMC7H5Y.js → worktree-sweep-34MXJ7S6.js} +6 -6
  388. package/package.json +2 -1
  389. package/release-notes.json +21 -25
  390. package/stack.release.json +5 -5
  391. package/dist/chunk-WZPD4QSE.js +0 -113
  392. /package/dist/{chunk-IKJUZ3VO.js → chunk-542FBM5U.js} +0 -0
  393. /package/dist/{chunk-XJDSTA2C.js → chunk-6D2O5SAH.js} +0 -0
  394. /package/dist/{chunk-FDQXQBBC.js → chunk-6NRZLVK3.js} +0 -0
  395. /package/dist/{chunk-XDWIJBTY.js → chunk-CFO47VW4.js} +0 -0
  396. /package/dist/{chunk-R6H2IRCF.js → chunk-EULAP6L6.js} +0 -0
  397. /package/dist/{chunk-LK6OG47X.js → chunk-FYSKQPTE.js} +0 -0
  398. /package/dist/{chunk-LAWI42NC.js → chunk-J4B4M5PH.js} +0 -0
  399. /package/dist/{chunk-AC36VWNB.js → chunk-J635FA7T.js} +0 -0
  400. /package/dist/{chunk-UQKGV6SX.js → chunk-MOBZTIJQ.js} +0 -0
  401. /package/dist/{chunk-7ZP2PAW3.js → chunk-N45FAI6D.js} +0 -0
  402. /package/dist/{chunk-ZQS4S4AX.js → chunk-QDSNEGJE.js} +0 -0
  403. /package/dist/{chunk-CS4SHHLY.js → chunk-SKSXROKP.js} +0 -0
  404. /package/dist/{chunk-JXGOO53U.js → chunk-YVWXI2HM.js} +0 -0
  405. /package/dist/{core-memory-3TZV3ZDW.js → core-memory-PZEO3OWH.js} +0 -0
  406. /package/dist/{memory-isolation-TE4AOMQX.js → memory-isolation-MFNT2ITE.js} +0 -0
  407. /package/dist/{oauth-server-CWQ6EBGQ.js → oauth-server-CBGEWD6H.js} +0 -0
  408. /package/dist/{project-boot-MX2FNKTJ.js → project-boot-VESAYDIH.js} +0 -0
@@ -1,24 +1,19 @@
1
1
  import {
2
2
  getLatestBackup,
3
3
  reasonFromBackupName
4
- } from "./chunk-E2346GKI.js";
4
+ } from "./chunk-SINIRUYZ.js";
5
5
  import {
6
6
  recordDbOpen
7
7
  } from "./chunk-5YEUPUV4.js";
8
- import "./chunk-YYB5PMTK.js";
9
- import "./chunk-MMS2HBRT.js";
10
- import "./chunk-RH4AH3YB.js";
11
- import "./chunk-HSGBZSCA.js";
12
- import "./chunk-JKKZGDLP.js";
13
- import "./chunk-MLKGABMK.js";
14
8
 
15
9
  // src/lib/backup-verify.ts
16
10
  import { createClient } from "@libsql/client";
17
11
  import { existsSync, realpathSync } from "fs";
18
- import { copyFile, mkdtemp, readdir, lstat, rm, writeFile, readFile } from "fs/promises";
19
- import { createHash } from "crypto";
12
+ import { copyFile, mkdtemp, readdir, lstat, rm, writeFile, readFile, rename } from "fs/promises";
13
+ import { createHash, randomBytes } from "crypto";
20
14
  import { tmpdir } from "os";
21
15
  import path from "path";
16
+ import { fileURLToPath } from "url";
22
17
  var MANIFEST_SCHEMA_VERSION = 1;
23
18
  var DEFAULT_DRIFT_ALLOWANCE = 1e5;
24
19
  var BACKUP_OPEN_PROBE_SQL = "SELECT name FROM sqlite_master LIMIT 1";
@@ -134,6 +129,213 @@ async function runQuickCheckOnArtifact(client) {
134
129
  return { status: "failed", detail: `quick_check could not run: ${errMsg(err)}` };
135
130
  }
136
131
  }
132
+ async function runArtifactChecks(client) {
133
+ try {
134
+ await client.execute(BACKUP_OPEN_PROBE_SQL);
135
+ const quickCheck = await runQuickCheckOnArtifact(client);
136
+ if (quickCheck.status !== "ok") {
137
+ return { kind: "unreadable", detail: `the COPIED artifact FAILED PRAGMA quick_check: ${quickCheck.detail}` };
138
+ }
139
+ const schemaTables = await collectSchemaTables(client);
140
+ const tables = await collectCounts(client, schemaTables.map((t) => t.name));
141
+ return { kind: "ok", schemaTables, tables };
142
+ } catch (err) {
143
+ return { kind: "unreadable", detail: `the COPIED artifact could not be read back: ${errMsg(err)}` };
144
+ }
145
+ }
146
+ async function runVerifyChecks(client) {
147
+ try {
148
+ await client.execute(BACKUP_OPEN_PROBE_SQL);
149
+ } catch (err) {
150
+ return { kind: "open-failed", detail: errMsg(err) };
151
+ }
152
+ const integrity = await runIntegrityCheck(client);
153
+ if (integrity.status !== "ok") {
154
+ return {
155
+ kind: "integrity",
156
+ status: integrity.status,
157
+ quickCheck: integrity.quickCheck,
158
+ cipherIntegrityCheck: integrity.cipherIntegrityCheck
159
+ };
160
+ }
161
+ try {
162
+ const schemaTables = await collectSchemaTables(client);
163
+ const tables = await collectCounts(client, schemaTables.map((t) => t.name));
164
+ return {
165
+ kind: "ok",
166
+ quickCheck: integrity.quickCheck,
167
+ cipherIntegrityCheck: integrity.cipherIntegrityCheck,
168
+ schemaTables,
169
+ tables
170
+ };
171
+ } catch (err) {
172
+ return { kind: "error", detail: errMsg(err) };
173
+ }
174
+ }
175
+ var BACKUP_VERIFY_WORKER_TIMEOUT_MS = 20 * 60 * 1e3;
176
+ var BACKUP_VERIFY_WORKER_MISSING_TAG = "[backup-verify] WORKER MISSING \u2014 verification running on main thread";
177
+ var BACKUP_VERIFY_WORKER_REPLY_REJECTED_TAG = "[backup-verify] WORKER REPLY REJECTED \u2014 verdict not-checked";
178
+ function reportBackupVerifyWorkerMissing(context, reason) {
179
+ try {
180
+ process.stderr.write(
181
+ `${BACKUP_VERIFY_WORKER_MISSING_TAG} (${context}): ${reason} \u2014 check tsup entry lib/backup-verify-worker
182
+ `
183
+ );
184
+ } catch {
185
+ }
186
+ }
187
+ function isRecord(v) {
188
+ return typeof v === "object" && v !== null && !Array.isArray(v);
189
+ }
190
+ function isStrOrNull(v) {
191
+ return v === null || typeof v === "string";
192
+ }
193
+ function tableSetProblem(schemaTables, tables) {
194
+ if (!Array.isArray(schemaTables) || schemaTables.length === 0) return "schemaTables missing or empty";
195
+ const names = /* @__PURE__ */ new Set();
196
+ for (const t of schemaTables) {
197
+ if (!isRecord(t) || typeof t.name !== "string" || !t.name || typeof t.sql !== "string") {
198
+ return "schemaTables entry malformed";
199
+ }
200
+ if (names.has(t.name)) return `schemaTables lists ${t.name} twice`;
201
+ names.add(t.name);
202
+ }
203
+ if (!isRecord(tables)) return "tables missing";
204
+ const keys = Object.keys(tables);
205
+ if (keys.length !== names.size || keys.some((k) => !names.has(k))) return "tables keys do not match schemaTables";
206
+ for (const k of keys) {
207
+ const n = tables[k];
208
+ if (typeof n !== "number" || !Number.isInteger(n) || n < 0) return `tables.${k} is not a non-negative integer`;
209
+ }
210
+ return null;
211
+ }
212
+ function artifactOutcomeProblem(o) {
213
+ if (!isRecord(o)) return "outcome missing";
214
+ if (o.kind === "unreadable") return typeof o.detail === "string" ? null : "unreadable outcome without detail";
215
+ if (o.kind === "ok") return tableSetProblem(o.schemaTables, o.tables);
216
+ return `outcome.kind=${String(o.kind)} is not ok|unreadable`;
217
+ }
218
+ function verifyOutcomeProblem(o) {
219
+ if (!isRecord(o)) return "outcome missing";
220
+ switch (o.kind) {
221
+ case "open-failed":
222
+ case "error":
223
+ return typeof o.detail === "string" ? null : `${o.kind} outcome without detail`;
224
+ case "integrity":
225
+ if (o.status !== "failed" && o.status !== "unreadable") return "integrity outcome with bad status";
226
+ return isStrOrNull(o.quickCheck) && isStrOrNull(o.cipherIntegrityCheck) ? null : "integrity outcome fields malformed";
227
+ case "ok":
228
+ if (typeof o.quickCheck !== "string" || o.quickCheck.toLowerCase() !== "ok") return "ok outcome without quick_check=ok";
229
+ if (o.cipherIntegrityCheck !== null && (typeof o.cipherIntegrityCheck !== "string" || o.cipherIntegrityCheck.toLowerCase() !== "ok")) {
230
+ return "ok outcome with a non-ok cipher_integrity_check";
231
+ }
232
+ return tableSetProblem(o.schemaTables, o.tables);
233
+ default:
234
+ return `outcome.kind=${String(o.kind)} is not a verify outcome`;
235
+ }
236
+ }
237
+ function validateBackupVerifyWorkerReply(req, msg) {
238
+ if (!isRecord(msg)) return { ok: false, reason: "reply is not an object" };
239
+ if (typeof msg.op !== "string") return { ok: false, reason: "reply has no op" };
240
+ if (typeof msg.pid !== "number" || !Number.isInteger(msg.pid)) return { ok: false, reason: "reply has no pid" };
241
+ if (msg.op === "error") {
242
+ return typeof msg.error === "string" ? { ok: true, response: msg } : { ok: false, reason: "error reply without an error string" };
243
+ }
244
+ if (msg.op !== req.op) return { ok: false, reason: `worker answered op=${msg.op} for op=${req.op}` };
245
+ let problem;
246
+ if (msg.op === "source") problem = typeof msg.verdict === "string" ? null : "source reply without a verdict string";
247
+ else if (msg.op === "artifact") problem = artifactOutcomeProblem(msg.outcome);
248
+ else if (msg.op === "verify") problem = verifyOutcomeProblem(msg.outcome);
249
+ else problem = `unknown op ${msg.op}`;
250
+ return problem ? { ok: false, reason: problem } : { ok: true, response: msg };
251
+ }
252
+ function backupVerifyOffloadEnabled(env = process.env) {
253
+ const raw = env.EXE_BACKUP_VERIFY_OFFLOAD;
254
+ if (raw === "1") return true;
255
+ if (raw === "0") return false;
256
+ return env.EXE_IS_DAEMON === "1";
257
+ }
258
+ function resolveBackupVerifyWorker(selfUrl, exists = existsSync) {
259
+ let selfDir;
260
+ try {
261
+ selfDir = path.dirname(fileURLToPath(selfUrl));
262
+ } catch {
263
+ return null;
264
+ }
265
+ for (const candidate of [
266
+ path.join(selfDir, "backup-verify-worker.js"),
267
+ path.join(selfDir, "lib", "backup-verify-worker.js")
268
+ ]) {
269
+ if (exists(candidate)) return { path: candidate, execArgv: [] };
270
+ }
271
+ const tsEntry = path.join(selfDir, "backup-verify-worker.ts");
272
+ if (exists(tsEntry)) return { path: tsEntry, execArgv: ["--import", "tsx"] };
273
+ return null;
274
+ }
275
+ async function runInBackupVerifyWorker(req, opts = {}) {
276
+ const worker = resolveBackupVerifyWorker(opts.selfUrl ?? import.meta.url);
277
+ if (!worker) return { ok: false, unavailable: true, reason: "backup-verify-worker entry not found" };
278
+ let child;
279
+ try {
280
+ const { fork } = await import("child_process");
281
+ child = fork(worker.path, [], {
282
+ execArgv: worker.execArgv,
283
+ stdio: ["ignore", "ignore", "inherit", "ipc"],
284
+ // EXE_IS_DAEMON cleared: the child must never act as the daemon.
285
+ env: { ...process.env, EXE_IS_DAEMON: "" }
286
+ });
287
+ } catch (err) {
288
+ return { ok: false, unavailable: true, reason: `fork failed: ${errMsg(err)}` };
289
+ }
290
+ return await new Promise((resolve) => {
291
+ let settled = false;
292
+ const finish = (run) => {
293
+ if (settled) return;
294
+ settled = true;
295
+ clearTimeout(timer);
296
+ try {
297
+ child.kill("SIGKILL");
298
+ } catch {
299
+ }
300
+ resolve(run);
301
+ };
302
+ const timeoutMs = opts.timeoutMs ?? BACKUP_VERIFY_WORKER_TIMEOUT_MS;
303
+ const timer = setTimeout(
304
+ () => finish({ ok: false, unavailable: false, reason: `timed out after ${timeoutMs}ms` }),
305
+ timeoutMs
306
+ );
307
+ child.once("error", (err) => {
308
+ finish({ ok: false, unavailable: child.pid === void 0, reason: `worker error: ${errMsg(err)}` });
309
+ });
310
+ child.once("close", (code, signal) => {
311
+ finish({ ok: false, unavailable: false, reason: `worker exited without a result (code=${code}, signal=${signal})` });
312
+ });
313
+ child.on("message", (msg) => {
314
+ if (settled) return;
315
+ const checked = validateBackupVerifyWorkerReply(req, msg);
316
+ if (!checked.ok) {
317
+ try {
318
+ process.stderr.write(`${BACKUP_VERIFY_WORKER_REPLY_REJECTED_TAG} (op=${req.op}): ${checked.reason}
319
+ `);
320
+ } catch {
321
+ }
322
+ finish({ ok: false, unavailable: false, reason: `worker sent a malformed reply: ${checked.reason}` });
323
+ return;
324
+ }
325
+ const res = checked.response;
326
+ if (res.op === "error") {
327
+ finish({ ok: false, unavailable: false, reason: `worker error: ${res.error}` });
328
+ return;
329
+ }
330
+ finish({ ok: true, response: res });
331
+ });
332
+ try {
333
+ child.send({ ...req, parentPid: process.pid });
334
+ } catch (err) {
335
+ finish({ ok: false, unavailable: false, reason: `could not send the request: ${errMsg(err)}` });
336
+ }
337
+ });
338
+ }
137
339
  var SCRATCH_DIR_PREFIX = "exe-bkmanifest-";
138
340
  var SCRATCH_DIR_ORPHAN_AGE_MS = 6 * 60 * 60 * 1e3;
139
341
  async function sweepOrphanScratchDirs(base = tmpdir(), opts = {}) {
@@ -190,9 +392,23 @@ async function sweepOrphanScratchDirs(base = tmpdir(), opts = {}) {
190
392
  }
191
393
  return { removed, errors };
192
394
  }
395
+ async function writeManifestAtomic(manifestPath, contents) {
396
+ const tmpPath = `${manifestPath}.${process.pid}-${randomBytes(4).toString("hex")}.tmp`;
397
+ try {
398
+ await writeFile(tmpPath, contents, "utf-8");
399
+ await rename(tmpPath, manifestPath);
400
+ } catch (err) {
401
+ try {
402
+ await rm(tmpPath, { force: true });
403
+ } catch {
404
+ }
405
+ throw err;
406
+ }
407
+ }
193
408
  async function readBackBackupArtifact(backupPath, dbName, opts = {}) {
194
409
  let scratch = null;
195
410
  let ownedClient = null;
411
+ let proof = null;
196
412
  try {
197
413
  let client = opts.client;
198
414
  if (!client) {
@@ -226,36 +442,36 @@ async function readBackBackupArtifact(backupPath, dbName, opts = {}) {
226
442
  }
227
443
  }
228
444
  const keyHex = opts.keyHex === void 0 ? await resolveBackupKeyHex() : opts.keyHex;
229
- ownedClient = createClient(
230
- keyHex ? { url: `file:${scratchDb}`, encryptionKey: keyHex } : { url: `file:${scratchDb}` }
231
- );
232
- recordDbOpen({ dbPath: scratchDb, source: "backup-verify-scratch", writeCapable: true, checkpointTimer: false });
233
- client = ownedClient;
234
- }
235
- let schemaHash;
236
- let tables;
237
- try {
238
- await client.execute(BACKUP_OPEN_PROBE_SQL);
239
- const quickCheck = await runQuickCheckOnArtifact(client);
240
- if (quickCheck.status !== "ok") {
241
- return {
242
- artifact: "unreadable",
243
- manifestWritten: false,
244
- manifest: null,
245
- detail: `the COPIED artifact FAILED PRAGMA quick_check: ${quickCheck.detail}`
246
- };
445
+ const offload = opts.offload ?? backupVerifyOffloadEnabled();
446
+ if (offload) {
447
+ const run = await runInBackupVerifyWorker({ op: "artifact", dbPath: scratchDb, keyHex: keyHex ?? null });
448
+ if (run.ok && run.response.op === "artifact") {
449
+ proof = run.response.outcome;
450
+ } else if (!run.ok && run.unavailable) {
451
+ reportBackupVerifyWorkerMissing("artifact read-back", run.reason);
452
+ } else {
453
+ return {
454
+ artifact: "not-checked",
455
+ manifestWritten: false,
456
+ manifest: null,
457
+ detail: `artifact read-back worker did not complete: ${run.ok ? `unexpected reply op=${run.response.op}` : run.reason}`
458
+ };
459
+ }
247
460
  }
248
- const schemaTables = await collectSchemaTables(client);
249
- schemaHash = computeSchemaHash(schemaTables);
250
- tables = await collectCounts(client, schemaTables.map((t) => t.name));
251
- } catch (err) {
252
- return {
253
- artifact: "unreadable",
254
- manifestWritten: false,
255
- manifest: null,
256
- detail: `the COPIED artifact could not be read back: ${errMsg(err)}`
257
- };
461
+ if (!proof) {
462
+ ownedClient = createClient(
463
+ keyHex ? { url: `file:${scratchDb}`, encryptionKey: keyHex } : { url: `file:${scratchDb}` }
464
+ );
465
+ recordDbOpen({ dbPath: scratchDb, source: "backup-verify-scratch", writeCapable: true, checkpointTimer: false });
466
+ client = ownedClient;
467
+ }
468
+ }
469
+ if (!proof) proof = await runArtifactChecks(client);
470
+ if (proof.kind !== "ok") {
471
+ return { artifact: "unreadable", manifestWritten: false, manifest: null, detail: proof.detail };
258
472
  }
473
+ const schemaHash = computeSchemaHash(proof.schemaTables);
474
+ const tables = proof.tables;
259
475
  const manifest = {
260
476
  schemaVersion: MANIFEST_SCHEMA_VERSION,
261
477
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -267,7 +483,7 @@ async function readBackBackupArtifact(backupPath, dbName, opts = {}) {
267
483
  const rows = Object.values(tables).reduce((n, c) => n + c, 0);
268
484
  const readDetail = `artifact read back: ${Object.keys(tables).length} table(s), ${rows} row(s)`;
269
485
  try {
270
- await writeFile(manifestPathFor(backupPath), JSON.stringify(manifest, null, 2), "utf-8");
486
+ await writeManifestAtomic(manifestPathFor(backupPath), JSON.stringify(manifest, null, 2));
271
487
  } catch (err) {
272
488
  return {
273
489
  artifact: "readable",
@@ -542,14 +758,50 @@ async function verifyBackup(backupPath, opts = {}) {
542
758
  }
543
759
  }
544
760
  }
545
- let client;
546
- try {
547
- client = createClient(
548
- keyHex ? { url: `file:${scratchDb}`, encryptionKey: keyHex } : { url: `file:${scratchDb}` }
549
- );
550
- recordDbOpen({ dbPath: scratchDb, source: "backup-verify-copy", writeCapable: true, checkpointTimer: false });
551
- await client.execute(BACKUP_OPEN_PROBE_SQL);
552
- } catch (err) {
761
+ let outcome = null;
762
+ if (opts.offload ?? backupVerifyOffloadEnabled()) {
763
+ const run = await runInBackupVerifyWorker({ op: "verify", dbPath: scratchDb, keyHex: keyHex ?? null });
764
+ if (run.ok && run.response.op === "verify") {
765
+ outcome = run.response.outcome;
766
+ } else if (!run.ok && run.unavailable) {
767
+ reportBackupVerifyWorkerMissing("verifyBackup", run.reason);
768
+ } else {
769
+ res = {
770
+ ok: false,
771
+ backup: name,
772
+ source: "none",
773
+ integrity: "unreadable",
774
+ tables: [],
775
+ reason: "not-checked",
776
+ detail: `verification worker did not complete; nothing was learned about the backup: ${run.ok ? `unexpected reply op=${run.response.op}` : run.reason}`
777
+ };
778
+ if (record) await recordVerdict(res);
779
+ return res;
780
+ }
781
+ }
782
+ if (!outcome) {
783
+ let client = null;
784
+ try {
785
+ client = createClient(
786
+ keyHex ? { url: `file:${scratchDb}`, encryptionKey: keyHex } : { url: `file:${scratchDb}` }
787
+ );
788
+ recordDbOpen({ dbPath: scratchDb, source: "backup-verify-copy", writeCapable: true, checkpointTimer: false });
789
+ } catch (err) {
790
+ outcome = { kind: "open-failed", detail: errMsg(err) };
791
+ }
792
+ if (client) {
793
+ try {
794
+ outcome = await runVerifyChecks(client);
795
+ } finally {
796
+ try {
797
+ client.close?.();
798
+ } catch {
799
+ }
800
+ }
801
+ }
802
+ }
803
+ if (!outcome) throw new Error("verification produced no outcome");
804
+ if (outcome.kind === "open-failed") {
553
805
  res = {
554
806
  ok: false,
555
807
  backup: name,
@@ -557,48 +809,40 @@ async function verifyBackup(backupPath, opts = {}) {
557
809
  integrity: "unreadable",
558
810
  tables: [],
559
811
  reason: "unreadable",
560
- detail: `cannot read backup with configured key${targetManifest?.keyEpoch ? " (manifest key epoch matched; artifact is unreadable/corrupt)" : ""}: ${errMsg(err)}`
812
+ detail: `cannot read backup with configured key${targetManifest?.keyEpoch ? " (manifest key epoch matched; artifact is unreadable/corrupt)" : ""}: ${outcome.detail}`
561
813
  };
562
814
  if (record) await recordVerdict(res);
563
815
  return res;
564
816
  }
565
- try {
566
- const integrity = await runIntegrityCheck(client);
567
- if (integrity.status !== "ok") {
568
- res = {
569
- ok: false,
570
- backup: name,
571
- source: "none",
572
- integrity: integrity.status,
573
- quickCheck: integrity.quickCheck,
574
- cipherIntegrityCheck: integrity.cipherIntegrityCheck,
575
- tables: [],
576
- reason: integrity.status === "unreadable" ? "unreadable" : "integrity",
577
- detail: `integrity check ${integrity.status}${integrity.quickCheck ? ` (quick_check=${integrity.quickCheck})` : ""}`
578
- };
579
- if (record) await recordVerdict(res);
580
- return res;
581
- }
582
- const schemaTables = await collectSchemaTables(client);
583
- const schemaHash = computeSchemaHash(schemaTables);
584
- const gotCounts = await collectCounts(client, schemaTables.map((t) => t.name));
585
- const wantSource = opts.source ?? "auto";
586
- const manifest = wantSource === "live" ? null : targetManifest;
587
- if (manifest) {
588
- res = compareToManifest(name, manifest, schemaHash, gotCounts);
589
- } else {
590
- res = await compareToLive(name, gotCounts, opts);
591
- }
592
- res.quickCheck = integrity.quickCheck;
593
- res.cipherIntegrityCheck = integrity.cipherIntegrityCheck;
594
- if (record) await recordVerdict(res, target);
817
+ if (outcome.kind === "integrity") {
818
+ res = {
819
+ ok: false,
820
+ backup: name,
821
+ source: "none",
822
+ integrity: outcome.status,
823
+ quickCheck: outcome.quickCheck,
824
+ cipherIntegrityCheck: outcome.cipherIntegrityCheck,
825
+ tables: [],
826
+ reason: outcome.status === "unreadable" ? "unreadable" : "integrity",
827
+ detail: `integrity check ${outcome.status}${outcome.quickCheck ? ` (quick_check=${outcome.quickCheck})` : ""}`
828
+ };
829
+ if (record) await recordVerdict(res);
595
830
  return res;
596
- } finally {
597
- try {
598
- client.close?.();
599
- } catch {
600
- }
601
831
  }
832
+ if (outcome.kind === "error") throw new Error(outcome.detail);
833
+ const schemaHash = computeSchemaHash(outcome.schemaTables);
834
+ const gotCounts = outcome.tables;
835
+ const wantSource = opts.source ?? "auto";
836
+ const manifest = wantSource === "live" ? null : targetManifest;
837
+ if (manifest) {
838
+ res = compareToManifest(name, manifest, schemaHash, gotCounts);
839
+ } else {
840
+ res = await compareToLive(name, gotCounts, opts);
841
+ }
842
+ res.quickCheck = outcome.quickCheck;
843
+ res.cipherIntegrityCheck = outcome.cipherIntegrityCheck;
844
+ if (record) await recordVerdict(res, target);
845
+ return res;
602
846
  } catch (err) {
603
847
  res = {
604
848
  ok: false,
@@ -629,19 +873,31 @@ async function maybeVerifyDailyBackup(backupPath) {
629
873
  return null;
630
874
  }
631
875
  }
876
+
632
877
  export {
633
- computeKeyEpoch,
878
+ manifestWriteEnabled,
634
879
  dailyVerifyEnabled,
635
880
  describeDailyVerifyPosture,
636
- isCrashLoopBackup,
637
881
  liveHardEnabled,
882
+ isCrashLoopBackup,
883
+ computeKeyEpoch,
638
884
  manifestPathFor,
639
- manifestWriteEnabled,
640
- maybeVerifyDailyBackup,
641
- readBackBackupArtifact,
642
- readManifest,
643
885
  runQuickCheckOnArtifact,
886
+ runArtifactChecks,
887
+ runVerifyChecks,
888
+ BACKUP_VERIFY_WORKER_TIMEOUT_MS,
889
+ BACKUP_VERIFY_WORKER_MISSING_TAG,
890
+ BACKUP_VERIFY_WORKER_REPLY_REJECTED_TAG,
891
+ reportBackupVerifyWorkerMissing,
892
+ validateBackupVerifyWorkerReply,
893
+ backupVerifyOffloadEnabled,
894
+ resolveBackupVerifyWorker,
895
+ runInBackupVerifyWorker,
644
896
  sweepOrphanScratchDirs,
897
+ writeManifestAtomic,
898
+ readBackBackupArtifact,
899
+ writeBackupManifest,
900
+ readManifest,
645
901
  verifyBackup,
646
- writeBackupManifest
902
+ maybeVerifyDailyBackup
647
903
  };
@@ -4,21 +4,21 @@ import {
4
4
  assertUsableEpoch,
5
5
  deriveOrgKeyIdentities,
6
6
  describeEpochRemedy
7
- } from "./chunk-APKEGWFB.js";
7
+ } from "./chunk-A5I2GYVQ.js";
8
8
  import {
9
9
  InviteError,
10
10
  resolveAuth,
11
11
  resolveEndpoint
12
- } from "./chunk-XC2KAJK4.js";
12
+ } from "./chunk-HA6BIZ6L.js";
13
13
  import {
14
14
  asOrgBillablePlan
15
15
  } from "./chunk-W4H2MZAS.js";
16
16
  import {
17
17
  orgKeyFingerprintDisplay
18
- } from "./chunk-XBCIRNNU.js";
18
+ } from "./chunk-6PXFF6IV.js";
19
19
  import {
20
20
  ed25519PrivateKeyFromSeed
21
- } from "./chunk-OUUNFTS4.js";
21
+ } from "./chunk-MZNLQC6W.js";
22
22
 
23
23
  // src/lib/org-key-admin.ts
24
24
  import { sign } from "crypto";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getGlobalProceduresBlock
3
- } from "./chunk-WZPD4QSE.js";
3
+ } from "./chunk-HDQAVAV6.js";
4
4
  import {
5
5
  writePlatformReferenceFile
6
- } from "./chunk-NVM3SKJ4.js";
6
+ } from "./chunk-4CN3EE6U.js";
7
7
 
8
8
  // src/lib/employee-templates.ts
9
9
  var BASE_OPERATING_PROCEDURES = `
@@ -6,7 +6,7 @@ import {
6
6
  baseAgentName,
7
7
  getEmployee,
8
8
  loadEmployeesSync
9
- } from "./chunk-LBEBSXZA.js";
9
+ } from "./chunk-L5JFVK5T.js";
10
10
 
11
11
  // src/lib/project-name.ts
12
12
  import { execSync } from "child_process";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  isValidX25519Recipient,
6
6
  pubKeyHash
7
- } from "./chunk-2K7IKLBL.js";
7
+ } from "./chunk-7SHU5MOD.js";
8
8
 
9
9
  // src/lib/monitor-grants.ts
10
10
  import crypto from "crypto";
@@ -212,7 +212,7 @@ async function main(args) {
212
212
  console.log("[health-gate] Starting rollback...");
213
213
  restorePreDeployBackup();
214
214
  try {
215
- const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-7ET7S3ED.js");
215
+ const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-EBATTQPP.js");
216
216
  const paths = defaultStackPaths();
217
217
  await rollbackStackUpdate({
218
218
  manifestRef: paths.manifestRef,
@@ -132,7 +132,7 @@ async function verifyOrBlock(hookPath) {
132
132
  process.stderr.write(`[SECURITY] Hook tamper detected: ${filename} \u2014 ${result.reason}
133
133
  `);
134
134
  try {
135
- const { pushNotifyAsync } = await import("./push-notifications-W3UNHDC5.js");
135
+ const { pushNotifyAsync } = await import("./push-notifications-QW4BWRC7.js");
136
136
  pushNotifyAsync({
137
137
  event: "security_alert",
138
138
  title: "Hook tamper detected",
@@ -4,7 +4,7 @@ import {
4
4
  getGitRootAsync,
5
5
  isWorktreeDirty,
6
6
  isWorktreeDirtyAsync
7
- } from "./chunk-E3ZO4EL3.js";
7
+ } from "./chunk-5ZMNFSHV.js";
8
8
 
9
9
  // src/lib/worktree-sweep.ts
10
10
  import { execFile } from "child_process";
@@ -140,7 +140,7 @@ async function assertManifestSignature(manifest, publicKeyPem) {
140
140
  "manifest carries no `signature`. Fleets that enforce EXE_STACK_PUBLIC_KEY reject unsigned manifests, so publishing one would ship a release no host can install. Re-sign with the custodied key: node scripts/sign-stack-manifest.mjs deploy/stack-manifests/v0.9.json"
141
141
  );
142
142
  }
143
- const { verifyStackManifestSignature } = await import("./stack-update-7ET7S3ED.js");
143
+ const { verifyStackManifestSignature } = await import("./stack-update-EBATTQPP.js");
144
144
  try {
145
145
  verifyStackManifestSignature(manifest, publicKeyPem);
146
146
  } catch (err) {
@@ -1008,7 +1008,7 @@ async function runRegistryProxy(options = registryProxyOptionsFromEnv()) {
1008
1008
  await new Promise((resolve) => server.listen(options.port, options.host, resolve));
1009
1009
  console.log(`exe-registry-proxy listening on ${options.host ?? "0.0.0.0"}:${options.port}`);
1010
1010
  console.log(`proxying /v2/${options.allowedNamespace ?? "askexe"}/* -> ${options.upstream ?? "https://ghcr.io"}`);
1011
- const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-YTDCUN3S.js");
1011
+ const { licenseSyncConfigFromEnv, startLicenseSyncScheduler } = await import("./license-sync-FDEDT4AC.js");
1012
1012
  const syncConfig = licenseSyncConfigFromEnv();
1013
1013
  if (syncConfig) {
1014
1014
  startLicenseSyncScheduler(syncConfig);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isCoordinatorRole
3
- } from "./chunk-LBEBSXZA.js";
3
+ } from "./chunk-L5JFVK5T.js";
4
4
 
5
5
  // src/lib/task-router.ts
6
6
  import { randomUUID } from "crypto";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  isExeSession,
3
3
  strictSessionScopeFilter
4
- } from "./chunk-WSYIQKZ6.js";
4
+ } from "./chunk-GM4UEZDE.js";
5
5
  import {
6
6
  recordOrchestrationEventBestEffort
7
- } from "./chunk-WLV27PAO.js";
7
+ } from "./chunk-JGBYZTWH.js";
8
8
  import {
9
9
  getProjectName
10
- } from "./chunk-J6RTX7XT.js";
10
+ } from "./chunk-TVWYMOZ4.js";
11
11
  import {
12
12
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
13
13
  getCoordinatorName
14
- } from "./chunk-LBEBSXZA.js";
14
+ } from "./chunk-L5JFVK5T.js";
15
15
  import {
16
16
  loadConfigSync
17
17
  } from "./chunk-MMS2HBRT.js";
@@ -260,7 +260,7 @@ function createRealDeps(getClient) {
260
260
  });
261
261
  },
262
262
  createReviewForOrphan: async (task) => {
263
- const { createReviewForCompletedTask } = await import("./tasks-review-HXHYA76X.js");
263
+ const { createReviewForCompletedTask } = await import("./tasks-review-3G7CAW2O.js");
264
264
  const cwd = process.cwd();
265
265
  await createReviewForCompletedTask(
266
266
  task,