@askexenow/exe-os 0.9.302 → 0.9.310

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 (311) hide show
  1. package/deploy/compose/.env.example +8 -2
  2. package/deploy/compose/README.md +7 -3
  3. package/deploy/compose/add-routes.sh +107 -0
  4. package/deploy/compose/docker-compose.yml +91 -18
  5. package/deploy/compose/gateway-watchdog.sh +223 -0
  6. package/deploy/compose/generate-env.ts +16 -4
  7. package/deploy/compose/setup.sh +7 -8
  8. package/deploy/stack-manifests/v0.9.json +125 -4
  9. package/dist/{active-agent-ODI6GGVD.js → active-agent-ORX47ZKW.js} +4 -3
  10. package/dist/{active-agent-GGQAP4QE.js → active-agent-S5T2YMOR.js} +4 -3
  11. package/dist/{agentic-ontology-M7T72M6V.js → agentic-ontology-6KBAXLSJ.js} +1 -1
  12. package/dist/{backfill-metadata-GSZP2BEW.js → backfill-metadata-FV7GX6AS.js} +5 -4
  13. package/dist/{behaviors-JM6KFSXL.js → behaviors-47CPEKJ7.js} +6 -5
  14. package/dist/bin/agentic-ontology-backfill.js +6 -5
  15. package/dist/bin/agentic-reflection-backfill.js +7 -6
  16. package/dist/bin/agentic-semantic-label.js +6 -5
  17. package/dist/bin/backfill-conversations.js +8 -7
  18. package/dist/bin/backfill-responses.js +8 -7
  19. package/dist/bin/backfill-vectors.js +10 -9
  20. package/dist/bin/bulk-sync-postgres.js +14 -13
  21. package/dist/bin/cc-doctor.js +5 -4
  22. package/dist/bin/cleanup-stale-review-tasks.js +13 -12
  23. package/dist/bin/cli.js +20 -17
  24. package/dist/bin/deferred-daemon-restart.js +4 -4
  25. package/dist/bin/exe-agent-config.js +3 -2
  26. package/dist/bin/exe-agent.js +12 -11
  27. package/dist/bin/exe-assign.js +10 -9
  28. package/dist/bin/exe-boot.js +21 -20
  29. package/dist/bin/exe-call.js +5 -4
  30. package/dist/bin/exe-cloud.js +14 -13
  31. package/dist/bin/exe-config-dump.js +525 -0
  32. package/dist/bin/exe-dispatch.js +13 -12
  33. package/dist/bin/exe-doctor.js +2 -2
  34. package/dist/bin/exe-export-behaviors.js +8 -7
  35. package/dist/bin/exe-forget.js +7 -6
  36. package/dist/bin/exe-gateway.js +22 -11
  37. package/dist/bin/exe-healthcheck.js +7 -4
  38. package/dist/bin/exe-heartbeat.js +13 -12
  39. package/dist/bin/exe-kill.js +16 -15
  40. package/dist/bin/exe-launch-agent.js +41 -25
  41. package/dist/bin/exe-new-employee.js +9 -8
  42. package/dist/bin/exe-pending-messages.js +14 -13
  43. package/dist/bin/exe-pending-notifications.js +13 -12
  44. package/dist/bin/exe-pending-reviews.js +13 -12
  45. package/dist/bin/exe-preflight.js +108 -0
  46. package/dist/bin/exe-rename.js +5 -4
  47. package/dist/bin/exe-review.js +15 -14
  48. package/dist/bin/exe-search-quality.js +282 -0
  49. package/dist/bin/exe-search.js +6 -5
  50. package/dist/bin/exe-session-cleanup.js +18 -17
  51. package/dist/bin/exe-settings.js +15 -14
  52. package/dist/bin/exe-start-codex.js +13 -12
  53. package/dist/bin/exe-start-opencode.js +9 -8
  54. package/dist/bin/exe-status.js +14 -13
  55. package/dist/bin/exe-support.js +4 -4
  56. package/dist/bin/exe-team.js +4 -3
  57. package/dist/bin/exe-timers.js +237 -0
  58. package/dist/bin/git-sweep.js +14 -13
  59. package/dist/bin/graph-backfill.js +7 -6
  60. package/dist/bin/graph-export.js +6 -5
  61. package/dist/bin/import-history.js +10 -9
  62. package/dist/bin/install-launchd.js +5 -2
  63. package/dist/bin/install.js +16 -15
  64. package/dist/bin/intercom-check.js +4 -4
  65. package/dist/bin/mcp-sessions.js +2 -2
  66. package/dist/bin/orchestration-metrics.js +5 -4
  67. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  68. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  69. package/dist/bin/prune-orphan-chunks.js +43 -10
  70. package/dist/bin/scan-tasks.js +13 -12
  71. package/dist/bin/setup.js +1 -1
  72. package/dist/bin/shard-migrate.js +5 -4
  73. package/dist/bin/stack-update.js +30 -5
  74. package/dist/bin/vps-health-gate.js +1 -1
  75. package/dist/{capability-cards-BCTFKT4G.js → capability-cards-WQVY7WSS.js} +3 -2
  76. package/dist/{capacity-monitor-B4S3XEDO.js → capacity-monitor-BUKYPSWR.js} +14 -13
  77. package/dist/{catchup-brief-I35KHK62.js → catchup-brief-X5IVQAOH.js} +16 -15
  78. package/dist/{chunk-74TUYU5A.js → chunk-255DIG4B.js} +1 -1
  79. package/dist/{chunk-CXKR5Z5F.js → chunk-2EJ636HI.js} +4 -0
  80. package/dist/{chunk-ST3X3YMZ.js → chunk-2NGPZCWX.js} +4 -4
  81. package/dist/{chunk-LD2JKEJT.js → chunk-2NVEKSSP.js} +7 -7
  82. package/dist/{chunk-V6P7TPPA.js → chunk-2UVN2NBN.js} +148 -2
  83. package/dist/{chunk-OZRO37JW.js → chunk-3KH6GXXX.js} +2 -2
  84. package/dist/{chunk-IMJNYREY.js → chunk-43R2GILO.js} +1 -1
  85. package/dist/{chunk-6X2YNVLB.js → chunk-4BANMHJ5.js} +3 -3
  86. package/dist/{chunk-QNJPDIWY.js → chunk-4L4R6AQJ.js} +1 -1
  87. package/dist/{chunk-QWLPAEG5.js → chunk-4Q5VNQTV.js} +3 -3
  88. package/dist/{chunk-VLSYKMCJ.js → chunk-4RJJ5FJ2.js} +14 -2
  89. package/dist/{chunk-4AN6KMVG.js → chunk-5DPE7B7K.js} +1 -1
  90. package/dist/{chunk-H7ZNSQ2E.js → chunk-62UZWGFX.js} +2 -2
  91. package/dist/{chunk-ZQ2QHGWE.js → chunk-66JPZELX.js} +20 -24
  92. package/dist/{chunk-BUGMW7YF.js → chunk-6LNSZADA.js} +11 -11
  93. package/dist/{chunk-PBCRUNIK.js → chunk-6OD2RVIA.js} +492 -157
  94. package/dist/chunk-7ODTYODO.js +350 -0
  95. package/dist/{chunk-5YL4Y27D.js → chunk-7WDIGRSO.js} +1 -1
  96. package/dist/{chunk-WIL6LXNG.js → chunk-AC6DKMVS.js} +1 -1
  97. package/dist/{chunk-HZEAAKCR.js → chunk-B2J3BBJC.js} +3 -3
  98. package/dist/{chunk-LE7CDIOA.js → chunk-BUOMSIXH.js} +1 -1
  99. package/dist/{chunk-XKGNKH6V.js → chunk-DFUCFLZH.js} +1 -1
  100. package/dist/{chunk-U724Z3S3.js → chunk-DKHBMIVE.js} +100 -37
  101. package/dist/{chunk-MY36XDUK.js → chunk-DNFU56ZS.js} +1 -1
  102. package/dist/{chunk-GSWGOGP5.js → chunk-EOS7VPVT.js} +5 -5
  103. package/dist/{chunk-P33JVGSP.js → chunk-FM7XZDZI.js} +1 -1
  104. package/dist/chunk-G6EJKYK3.js +33 -0
  105. package/dist/{chunk-OMCNFTSI.js → chunk-GMZMBLHT.js} +1 -1
  106. package/dist/{chunk-4LZ54YGA.js → chunk-GSY6HL3T.js} +5 -5
  107. package/dist/{chunk-OVKNFTCL.js → chunk-HED6D5KR.js} +132 -21
  108. package/dist/{chunk-ALH6QLYF.js → chunk-HQODUV3G.js} +2 -2
  109. package/dist/{chunk-US64UR5O.js → chunk-IIHE3FNC.js} +3 -3
  110. package/dist/{chunk-H2ISTRWU.js → chunk-IRIPGGGL.js} +1 -1
  111. package/dist/{chunk-Z3EXECOX.js → chunk-ISILDO7P.js} +1 -1
  112. package/dist/{chunk-6ERZFDBS.js → chunk-IZPO6IOZ.js} +1 -1
  113. package/dist/{chunk-W65Z4SJS.js → chunk-J3QZPDNH.js} +1 -1
  114. package/dist/{chunk-3IJCP6ZH.js → chunk-JDYO76PI.js} +1 -1
  115. package/dist/{chunk-ORNKGGFX.js → chunk-JNARUXDC.js} +1 -1
  116. package/dist/{chunk-VME3UH4D.js → chunk-JV225JBX.js} +1 -1
  117. package/dist/{chunk-EI7PBUIA.js → chunk-JZW5AOWI.js} +1 -1
  118. package/dist/{chunk-TLOILHSL.js → chunk-K7KBAJQL.js} +36 -18
  119. package/dist/{chunk-RHMWSUJB.js → chunk-KAVUTP5G.js} +2 -2
  120. package/dist/{chunk-7FNELLMX.js → chunk-KPVVTHPK.js} +8 -8
  121. package/dist/{chunk-35U72CD2.js → chunk-KSMITUGY.js} +3 -3
  122. package/dist/{chunk-D6UICP3C.js → chunk-LMX7UKGX.js} +81 -3
  123. package/dist/{chunk-7ZWC5HVG.js → chunk-MTIJ2NXY.js} +1 -1
  124. package/dist/{chunk-KVHPBQV4.js → chunk-NCC3F6GM.js} +1 -1
  125. package/dist/{chunk-AYMSIV7X.js → chunk-NIZQ3CIS.js} +1 -1
  126. package/dist/{chunk-LTI2DLHY.js → chunk-OBJXZII2.js} +2 -2
  127. package/dist/{chunk-WHOT5NZ7.js → chunk-OR3TAZL3.js} +14 -2
  128. package/dist/{chunk-RQUHAXMM.js → chunk-PHFPIUWU.js} +2 -0
  129. package/dist/{chunk-N76VTMMF.js → chunk-PMEOSD6S.js} +2 -2
  130. package/dist/{chunk-TCJEFW5V.js → chunk-PPXQE7AS.js} +4 -4
  131. package/dist/{chunk-KHZQVLNZ.js → chunk-QE7UVQDP.js} +46 -0
  132. package/dist/{chunk-SXJACGQ5.js → chunk-QEGXNJGR.js} +4 -4
  133. package/dist/{chunk-W3E4VEEJ.js → chunk-RPBTYQKJ.js} +1 -1
  134. package/dist/chunk-RQ7OVXUZ.js +81 -0
  135. package/dist/{chunk-7L2EV3XX.js → chunk-RVXWGPD3.js} +39 -6
  136. package/dist/{chunk-YNALY3SX.js → chunk-RZJ6DXVE.js} +1 -1
  137. package/dist/{chunk-P3SIFDES.js → chunk-SCYWCWKY.js} +16 -4
  138. package/dist/{chunk-7I43GVER.js → chunk-SOT23KWW.js} +3 -3
  139. package/dist/{chunk-T62GAN7I.js → chunk-SPOXL7HF.js} +7 -7
  140. package/dist/{chunk-3YJMI422.js → chunk-TN2YCFQE.js} +4 -4
  141. package/dist/{chunk-YMSWCERY.js → chunk-U63BZI2B.js} +3 -3
  142. package/dist/{chunk-KA5RK5HZ.js → chunk-V42BSVX6.js} +2 -2
  143. package/dist/{chunk-PJTRAFL4.js → chunk-V4BW5HFQ.js} +3 -3
  144. package/dist/{chunk-4FG6IX7U.js → chunk-VFSYVQX4.js} +1 -1
  145. package/dist/chunk-VQRTO7IS.js +290 -0
  146. package/dist/{chunk-OR7J7TIA.js → chunk-VT6P7FV4.js} +1 -1
  147. package/dist/{chunk-BEIYF4NS.js → chunk-W2J2RF5N.js} +3 -3
  148. package/dist/{chunk-Y5ASPRP7.js → chunk-WBJXJ2R4.js} +17 -13
  149. package/dist/chunk-WCGNCH3Q.js +72 -0
  150. package/dist/{chunk-2LJDLQNO.js → chunk-WJ2PZGRV.js} +1 -1
  151. package/dist/{chunk-AAPPSMPH.js → chunk-WZBUKC5N.js} +1 -1
  152. package/dist/{chunk-RO7EXVSJ.js → chunk-X4AFBL4N.js} +1 -1
  153. package/dist/{chunk-BR74NYEF.js → chunk-XV5HRIXG.js} +5 -5
  154. package/dist/chunk-XXJRZ75E.js +43 -0
  155. package/dist/{chunk-VDHUHXFF.js → chunk-XYG722JW.js} +2 -2
  156. package/dist/{chunk-MM7SWUQ4.js → chunk-YB7U4WTY.js} +4 -4
  157. package/dist/{chunk-RMRZXPUU.js → chunk-Z6H6Y4BS.js} +1 -1
  158. package/dist/{token-budget-UMHRRDBT.js → chunk-ZOVHXTGC.js} +2 -9
  159. package/dist/{chunk-HNLBHP6P.js → chunk-ZZXADKAP.js} +3 -3
  160. package/dist/{co-activation-OKAHEMPE.js → co-activation-WN25AJOC.js} +3 -2
  161. package/dist/{co-occurrence-IHSPB53O.js → co-occurrence-YP2Q3OEA.js} +5 -4
  162. package/dist/{code-context-index-KGY4LKCA.js → code-context-index-ZWONKBKX.js} +4 -4
  163. package/dist/{conversation-entity-extractor-KXJSHRGJ.js → conversation-entity-extractor-KYOBXNID.js} +2 -2
  164. package/dist/{crdt-sync-K2G3C6XY.js → crdt-sync-ZFIFL2QM.js} +1 -1
  165. package/dist/{crm-webhook-ERZSQ3CW.js → crm-webhook-DGPHULOO.js} +2 -2
  166. package/dist/{cto-delegation-gate-ZCJ53LBQ.js → cto-delegation-gate-OF2A3TSS.js} +12 -11
  167. package/dist/daemon-auth-N6P2MZAV.js +17 -0
  168. package/dist/{daemon-orchestration-V6HALVDS.js → daemon-orchestration-G4RRTPP7.js} +16 -15
  169. package/dist/daemon-ready-signal-3L2MJT7C.js +13 -0
  170. package/dist/{db-backup-VZHSFUVA.js → db-backup-EORG4LBO.js} +1 -1
  171. package/dist/{doc-graph-extractor-LQ2IFND2.js → doc-graph-extractor-APZS3DFD.js} +5 -4
  172. package/dist/{dreaming-QAKUASYV.js → dreaming-Q4E3WBGY.js} +13 -12
  173. package/dist/{exe-drift-H3UWNFFY.js → exe-drift-CI5R6GUT.js} +4 -3
  174. package/dist/{exe-export-MN5D4JMT.js → exe-export-HQIQASIT.js} +7 -6
  175. package/dist/{exe-import-IFFMEVD7.js → exe-import-ULZK56WC.js} +7 -6
  176. package/dist/{exe-key-RSZC72QK.js → exe-key-ILNSBGRN.js} +5 -4
  177. package/dist/{exe-snapshot-I622MPLS.js → exe-snapshot-RUZTWZOF.js} +16 -15
  178. package/dist/{factory-CTFAGZUA.js → factory-YHQZ6RZZ.js} +14 -6
  179. package/dist/{fast-db-init-QEFVT7Q3.js → fast-db-init-KNJRL7T3.js} +1 -1
  180. package/dist/{founder-context-3SOKEW76.js → founder-context-QCTMEK66.js} +2 -2
  181. package/dist/gateway/index.js +12 -11
  182. package/dist/{git-staleness-E7RPQA5U.js → git-staleness-KIA5YI4H.js} +3 -2
  183. package/dist/{git-task-sweep-D3A2C5BW.js → git-task-sweep-WH6QE7HL.js} +13 -12
  184. package/dist/{global-procedures-POG4V6IK.js → global-procedures-SYZZCGDS.js} +4 -3
  185. package/dist/{graph-auto-extract-E7KALNWA.js → graph-auto-extract-J2TIWZEE.js} +5 -4
  186. package/dist/{graph-rag-3RZN7JR3.js → graph-rag-HITZZ63L.js} +2 -2
  187. package/dist/hooks/bug-report-worker.js +15 -14
  188. package/dist/hooks/codex-stop-task-finalizer.js +15 -14
  189. package/dist/hooks/commit-complete.js +15 -14
  190. package/dist/hooks/error-recall.js +8 -7
  191. package/dist/hooks/exe-heartbeat-hook.js +4 -3
  192. package/dist/hooks/ingest-worker.js +4 -4
  193. package/dist/hooks/ingest.js +8 -7
  194. package/dist/hooks/instructions-loaded.js +5 -4
  195. package/dist/hooks/manifest.json +20 -20
  196. package/dist/hooks/notification.js +5 -4
  197. package/dist/hooks/post-compact.js +14 -13
  198. package/dist/hooks/post-tool-combined.js +7 -7
  199. package/dist/hooks/pre-compact.js +19 -18
  200. package/dist/hooks/pre-tool-use.js +18 -17
  201. package/dist/hooks/prompt-submit.js +28 -27
  202. package/dist/hooks/session-end.js +24 -23
  203. package/dist/hooks/session-start.js +46 -22
  204. package/dist/hooks/stop.js +22 -21
  205. package/dist/hooks/subagent-stop.js +14 -13
  206. package/dist/hooks/summary-worker.js +22 -21
  207. package/dist/index.js +25 -23
  208. package/dist/{installer-IXUX73JN.js → installer-3NB3IBHF.js} +10 -9
  209. package/dist/{installer-RCUPPZ7Y.js → installer-IIJFCTMH.js} +10 -9
  210. package/dist/{installer-HDD6OH5Z.js → installer-PSDYMGN7.js} +7 -6
  211. package/dist/lib/cloud-sync.js +14 -13
  212. package/dist/lib/consolidation.js +8 -7
  213. package/dist/lib/database.js +3 -2
  214. package/dist/lib/db-daemon-client.js +4 -4
  215. package/dist/lib/db.js +3 -2
  216. package/dist/lib/device-registry.js +3 -1
  217. package/dist/lib/embedder.js +4 -4
  218. package/dist/lib/employee-templates.js +5 -4
  219. package/dist/lib/employees.js +3 -2
  220. package/dist/lib/exe-daemon-client.js +3 -3
  221. package/dist/lib/exe-daemon.js +256 -406
  222. package/dist/lib/hybrid-search.js +6 -5
  223. package/dist/lib/identity.js +3 -2
  224. package/dist/lib/license.js +2 -2
  225. package/dist/lib/messaging.js +13 -12
  226. package/dist/lib/reminders.js +4 -3
  227. package/dist/lib/schedules.js +6 -5
  228. package/dist/lib/session-registry.js +5 -4
  229. package/dist/lib/skill-learning.js +7 -6
  230. package/dist/lib/store.js +7 -4
  231. package/dist/lib/task-router.js +4 -3
  232. package/dist/lib/tasks.js +14 -13
  233. package/dist/lib/tmux-routing.js +16 -11
  234. package/dist/lib/token-spend.js +4 -3
  235. package/dist/{license-gate-V2UCK4KJ.js → license-gate-7SDHCJUO.js} +3 -3
  236. package/dist/mcp/register-tools.js +74 -73
  237. package/dist/mcp/server.js +97 -79
  238. package/dist/mcp/tools/complete-reminder.js +5 -4
  239. package/dist/mcp/tools/create-reminder.js +5 -4
  240. package/dist/mcp/tools/create-task.js +16 -15
  241. package/dist/mcp/tools/deactivate-behavior.js +8 -7
  242. package/dist/mcp/tools/list-reminders.js +5 -4
  243. package/dist/mcp/tools/list-tasks.js +16 -15
  244. package/dist/mcp/tools/send-message.js +15 -14
  245. package/dist/mcp/tools/update-task.js +15 -14
  246. package/dist/{mcp-http-config-7LFFPNGV.js → mcp-http-config-QSOVFXHW.js} +4 -3
  247. package/dist/mcp-tool-surface-CSPFXL3F.js +15 -0
  248. package/dist/{memory-cards-BGI6MJRN.js → memory-cards-II67WFL2.js} +3 -2
  249. package/dist/{memory-graph-extractor-DTRRNWHZ.js → memory-graph-extractor-PM4Q2KJG.js} +6 -5
  250. package/dist/{memory-poisoning-defense-MOCWJK6S.js → memory-poisoning-defense-ECXSX7HK.js} +3 -2
  251. package/dist/{memory-queue-client-DD4E5SIZ.js → memory-queue-client-HLURQEV6.js} +4 -4
  252. package/dist/{memory-reflection-UKKTGZYR.js → memory-reflection-PXF6YFDU.js} +3 -2
  253. package/dist/{notifications-AMJ2K3MM.js → notifications-UP7WQGG4.js} +12 -11
  254. package/dist/{orchestration-events-MB4QVHTD.js → orchestration-events-PZLLPCKY.js} +4 -3
  255. package/dist/orchestration-health-read-EJWVUARG.js +191 -0
  256. package/dist/{orchestrator-M7DJH6TN.js → orchestrator-PUT45J4O.js} +14 -13
  257. package/dist/{pipeline-router-4LT5YG5P.js → pipeline-router-5CRWKESM.js} +4 -3
  258. package/dist/{plan-limits-ENS7OJWP.js → plan-limits-SH2NDFNX.js} +6 -5
  259. package/dist/{project-boot-6W5JPGSB.js → project-boot-2TCPDZ4S.js} +25 -1
  260. package/dist/{projection-worker-WWXZK7QD.js → projection-worker-HWY37MNC.js} +2 -2
  261. package/dist/{prospective-memory-VNGLPMS6.js → prospective-memory-FQSVMCGG.js} +3 -2
  262. package/dist/{reranker-6XBS55FA.js → reranker-AALRMGMM.js} +1 -1
  263. package/dist/{retrieval-health-ATX5TIQ2.js → retrieval-health-PNWJSJNG.js} +1 -1
  264. package/dist/{review-polling-E4ALHTQE.js → review-polling-65JZUE3T.js} +13 -12
  265. package/dist/runtime/index.js +24 -22
  266. package/dist/{session-events-3J6APMKN.js → session-events-EJ3OSAA6.js} +13 -12
  267. package/dist/session-kill-telemetry-3HGM7SNQ.js +63 -0
  268. package/dist/{session-scope-E54VIYTJ.js → session-scope-JGDYAMJO.js} +12 -11
  269. package/dist/{setup-wizard-XV736U5D.js → setup-wizard-44LMFM2C.js} +1 -1
  270. package/dist/shared-rate-limit-store-QZPQEVE2.js +80 -0
  271. package/dist/{skill-refinement-FTURVWFN.js → skill-refinement-DUOO6B7V.js} +3 -2
  272. package/dist/{stack-release-JZVTSBJJ.js → stack-release-XYMKU7NT.js} +53 -4
  273. package/dist/{stack-update-BIK2QHOE.js → stack-update-XHQJRJEP.js} +5 -3
  274. package/dist/{steward-gate-YGU4VXPP.js → steward-gate-6NWRDLX2.js} +4 -3
  275. package/dist/{task-enforcement-GY3VTY6L.js → task-enforcement-UOULTGFB.js} +12 -11
  276. package/dist/{task-scope-PYOK7OQ6.js → task-scope-P5STKYAC.js} +12 -11
  277. package/dist/{tasks-crud-HLJEJ2UU.js → tasks-crud-24HMTULR.js} +12 -11
  278. package/dist/{tasks-notify-NGS3DWUJ.js → tasks-notify-LAIU7UUI.js} +13 -12
  279. package/dist/{tasks-review-BP5V2X34.js → tasks-review-AFJAU2DY.js} +12 -11
  280. package/dist/{telemetry-upload-AXYPFAPS.js → telemetry-upload-DWFGC2XJ.js} +8 -7
  281. package/dist/token-budget-4RFZKWGH.js +16 -0
  282. package/dist/{tool-capability-index-RHPVMMDD.js → tool-capability-index-ZEXBWKUZ.js} +1 -1
  283. package/dist/{tool-telemetry-BLSVABFJ.js → tool-telemetry-BS5JXM5M.js} +1 -1
  284. package/dist/tui/App.js +21 -20
  285. package/dist/{tui-data-EYPOFYLS.js → tui-data-UNO5B7PU.js} +12 -11
  286. package/dist/{worker-gate-SMFOBMMX.js → worker-gate-C6CTTYMD.js} +1 -1
  287. package/dist/{workflow-engine-TDJZ3TXB.js → workflow-engine-4W2KYCDV.js} +2 -2
  288. package/dist/{worktree-XISIYRM4.js → worktree-2CXY6NEB.js} +5 -4
  289. package/dist/{worktree-sweep-AS6GAR6X.js → worktree-sweep-K3CJFSUL.js} +6 -5
  290. package/package.json +9 -4
  291. package/release-notes.json +17 -88
  292. package/stack.release.json +51 -4
  293. package/dist/chunk-PHOQAVTK.js +0 -42
  294. package/dist/daemon-auth-BK7ON5ZH.js +0 -13
  295. package/dist/session-kill-telemetry-KOAHLRBT.js +0 -31
  296. package/dist/{chunk-XDE5IGBX.js → chunk-2NS3QRMJ.js} +0 -0
  297. package/dist/{chunk-JTMKRUX6.js → chunk-A2YZG4AD.js} +0 -0
  298. package/dist/{chunk-UZATXREL.js → chunk-AE74NOE6.js} +0 -0
  299. package/dist/{chunk-LUGWK6QB.js → chunk-FF5DA4XP.js} +3 -3
  300. /package/dist/{chunk-BGOMFGSW.js → chunk-GWPICNSO.js} +0 -0
  301. /package/dist/{chunk-NLHUA3YB.js → chunk-I3DPCSDG.js} +0 -0
  302. /package/dist/{chunk-YM3367VC.js → chunk-J3SR5MGG.js} +0 -0
  303. /package/dist/{chunk-FKFVNV7X.js → chunk-K4BKJJ4F.js} +0 -0
  304. /package/dist/{chunk-PTDBHQX7.js → chunk-MQCTK6EF.js} +0 -0
  305. /package/dist/{chunk-GBV5PV5T.js → chunk-QNXM2HXW.js} +0 -0
  306. /package/dist/{chunk-GZSG2ZOX.js → chunk-YUBTHJVV.js} +0 -0
  307. /package/dist/{core-memory-4OM7LR77.js → core-memory-OC5ITKKV.js} +0 -0
  308. /package/dist/{entity-boost-SFHIRXT5.js → entity-boost-NF3LE6OJ.js} +0 -0
  309. /package/dist/{message-queue-client-QTC3VHJT.js → message-queue-client-4VDU6BZY.js} +0 -0
  310. /package/dist/{oauth-server-BPN55EJM.js → oauth-server-EWUL7DMD.js} +0 -0
  311. /package/dist/{wiki-acl-45SIGG4O.js → wiki-acl-CONNF6ES.js} +0 -0
@@ -5,13 +5,13 @@ import {
5
5
  notifyParentExe,
6
6
  resolveExeSession,
7
7
  sendIntercom
8
- } from "./chunk-OVKNFTCL.js";
8
+ } from "./chunk-HED6D5KR.js";
9
9
  import {
10
10
  getTransport
11
11
  } from "./chunk-KOO3J5PV.js";
12
12
  import {
13
13
  recordOrchestrationEventBestEffort
14
- } from "./chunk-WHOT5NZ7.js";
14
+ } from "./chunk-OR3TAZL3.js";
15
15
  import {
16
16
  getAgentRuntime
17
17
  } from "./chunk-QB5JOGPK.js";
@@ -22,7 +22,7 @@ import {
22
22
  isCoordinatorName,
23
23
  isMultiInstance,
24
24
  shouldAutoInstance
25
- } from "./chunk-P3SIFDES.js";
25
+ } from "./chunk-SCYWCWKY.js";
26
26
 
27
27
  // src/lib/tasks-notify.ts
28
28
  var VERIFY_DELAY_MS = 1e4;
@@ -68,7 +68,7 @@ async function dispatchTaskToEmployee(input) {
68
68
  let crossProject = false;
69
69
  if (input.projectName) {
70
70
  try {
71
- const { assertSessionScope } = await import("./session-scope-E54VIYTJ.js");
71
+ const { assertSessionScope } = await import("./session-scope-JGDYAMJO.js");
72
72
  const check = assertSessionScope("dispatch_task", input.projectName);
73
73
  if (check.reason === "cross_session_denied") {
74
74
  crossProject = true;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  fastDbInit
3
- } from "./chunk-KHZQVLNZ.js";
3
+ } from "./chunk-QE7UVQDP.js";
4
4
  import {
5
5
  sessionScopeFilter
6
- } from "./chunk-OVKNFTCL.js";
6
+ } from "./chunk-HED6D5KR.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-P3SIFDES.js";
17
+ } from "./chunk-SCYWCWKY.js";
18
18
  import {
19
19
  isMainModule
20
20
  } from "./chunk-6Y4B3QF6.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  initStore
3
- } from "./chunk-Y5ASPRP7.js";
3
+ } from "./chunk-WBJXJ2R4.js";
4
4
  import {
5
5
  getClient,
6
6
  isInitialized
7
- } from "./chunk-P3SIFDES.js";
7
+ } from "./chunk-SCYWCWKY.js";
8
8
 
9
9
  // src/lib/schedules.ts
10
10
  import crypto from "crypto";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  extractMemoryGraph
3
- } from "./chunk-HNLBHP6P.js";
3
+ } from "./chunk-ZZXADKAP.js";
4
4
  import {
5
5
  flushBatch,
6
6
  writeMemory
7
- } from "./chunk-Y5ASPRP7.js";
7
+ } from "./chunk-WBJXJ2R4.js";
8
8
  import {
9
9
  extractKeywords
10
10
  } from "./chunk-CHCA3ZM2.js";
11
11
  import {
12
12
  getActiveAgent
13
- } from "./chunk-LE7CDIOA.js";
13
+ } from "./chunk-BUOMSIXH.js";
14
14
 
15
15
  // src/mcp/tools/import-conversations.ts
16
16
  import { z } from "zod";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCurrentSessionScope,
3
3
  strictSessionScopeFilter
4
- } from "./chunk-OVKNFTCL.js";
4
+ } from "./chunk-HED6D5KR.js";
5
5
  import {
6
6
  getProjectName
7
7
  } from "./chunk-OPU3NYOO.js";
@@ -0,0 +1,290 @@
1
+ // src/lib/daemon-health-log.ts
2
+ import { appendFileSync, mkdirSync, existsSync, statSync, renameSync } from "fs";
3
+ import path from "path";
4
+ import os from "os";
5
+
6
+ // src/lib/process-monitor.ts
7
+ import { execFile } from "child_process";
8
+ import { promisify } from "util";
9
+ import v8 from "v8";
10
+ var execFileAsync = promisify(execFile);
11
+ var _lastCpuUsage = null;
12
+ var _lastCpuTime = 0;
13
+ function getDaemonCpuPercent() {
14
+ const now = Date.now();
15
+ const usage = process.cpuUsage(_lastCpuUsage ?? void 0);
16
+ if (_lastCpuTime === 0) {
17
+ _lastCpuUsage = process.cpuUsage();
18
+ _lastCpuTime = now;
19
+ return 0;
20
+ }
21
+ const elapsedMs = now - _lastCpuTime;
22
+ if (elapsedMs === 0) return 0;
23
+ const cpuMs = (usage.user + usage.system) / 1e3;
24
+ const percent = cpuMs / elapsedMs * 100;
25
+ _lastCpuUsage = process.cpuUsage();
26
+ _lastCpuTime = now;
27
+ return Math.round(percent * 10) / 10;
28
+ }
29
+ async function getProcessStats(pid) {
30
+ try {
31
+ const { stdout } = await execFileAsync(
32
+ "ps",
33
+ ["-p", String(pid), "-o", "pid=,ppid=,%cpu=,rss=,vsz=,etime=,args="],
34
+ { encoding: "utf8", timeout: 3e3 }
35
+ );
36
+ const output = stdout.trim();
37
+ if (!output) return null;
38
+ return parseProcessLine(output);
39
+ } catch {
40
+ return null;
41
+ }
42
+ }
43
+ async function getChildProcesses(parentPid) {
44
+ let output;
45
+ try {
46
+ const { stdout } = await execFileAsync(
47
+ "pgrep",
48
+ ["-P", String(parentPid)],
49
+ { encoding: "utf8", timeout: 3e3 }
50
+ );
51
+ output = stdout.trim();
52
+ } catch {
53
+ return [];
54
+ }
55
+ if (!output) return [];
56
+ const childPids = output.split("\n").map(Number).filter(Boolean);
57
+ const children = [];
58
+ for (const pid of childPids) {
59
+ const stats = await getProcessStats(pid);
60
+ if (stats) children.push(stats);
61
+ children.push(...await getChildProcesses(pid));
62
+ }
63
+ return children;
64
+ }
65
+ async function getOrphanedProcesses() {
66
+ const EXE_PATTERNS = [
67
+ "exe-os/dist",
68
+ "exe-mem/dist",
69
+ "@askexenow/exe-os"
70
+ ];
71
+ try {
72
+ const { stdout: output } = await execFileAsync(
73
+ "ps",
74
+ ["-eo", "pid,ppid,%cpu,rss,vsz,etime,args"],
75
+ { encoding: "utf8", timeout: 5e3, maxBuffer: 8 * 1024 * 1024 }
76
+ );
77
+ const orphans = [];
78
+ for (const line of output.split("\n").slice(1)) {
79
+ const stats = parseProcessLine(line.trim());
80
+ if (!stats) continue;
81
+ if (stats.ppid !== 1) continue;
82
+ if (stats.pid === process.pid) continue;
83
+ if (!EXE_PATTERNS.some((p) => stats.command.includes(p))) continue;
84
+ orphans.push(stats);
85
+ }
86
+ return orphans;
87
+ } catch {
88
+ return [];
89
+ }
90
+ }
91
+ function parseProcessLine(line) {
92
+ const match = line.match(/^\s*(\d+)\s+(\d+)\s+([\d.]+)\s+(\d+)\s+(\d+)\s+([\d:-]+)\s+(.+)$/);
93
+ if (!match) return null;
94
+ return {
95
+ pid: parseInt(match[1], 10),
96
+ ppid: parseInt(match[2], 10),
97
+ cpu: parseFloat(match[3]),
98
+ mem: Math.round(parseInt(match[4], 10) / 1024),
99
+ // RSS KB → MB
100
+ rss: Math.round(parseInt(match[4], 10) / 1024),
101
+ vsz: Math.round(parseInt(match[5], 10) / 1024),
102
+ elapsed: match[6],
103
+ command: match[7].slice(0, 200)
104
+ };
105
+ }
106
+ async function takeProcessSnapshot() {
107
+ const [daemon, children, orphans] = await Promise.all([
108
+ getProcessStats(process.pid),
109
+ getChildProcesses(process.pid),
110
+ getOrphanedProcesses()
111
+ ]);
112
+ const allProcs = [daemon, ...children].filter(Boolean);
113
+ const totalCpu = allProcs.reduce((sum, p) => sum + p.cpu, 0);
114
+ const totalMemMb = allProcs.reduce((sum, p) => sum + p.rss, 0);
115
+ return {
116
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
117
+ daemon,
118
+ children,
119
+ orphans,
120
+ totalCpu: Math.round(totalCpu * 10) / 10,
121
+ totalMemMb
122
+ };
123
+ }
124
+ function formatSnapshotSummary(snap) {
125
+ return {
126
+ daemonCpu: snap.daemon?.cpu ?? 0,
127
+ daemonRssMb: snap.daemon?.rss ?? 0,
128
+ childCount: snap.children.length,
129
+ childTotalCpu: Math.round(snap.children.reduce((s, c) => s + c.cpu, 0) * 10) / 10,
130
+ childTotalRssMb: snap.children.reduce((s, c) => s + c.rss, 0),
131
+ orphanCount: snap.orphans.length,
132
+ orphanPids: snap.orphans.map((o) => o.pid),
133
+ totalCpu: snap.totalCpu,
134
+ totalMemMb: snap.totalMemMb
135
+ };
136
+ }
137
+ var CPU_ALERT_THRESHOLD_PCT = 80;
138
+ var CPU_ALERT_SUSTAINED_SAMPLES = 3;
139
+ var _highCpuSamples = 0;
140
+ function checkCpuAlert(cpuPercent) {
141
+ if (cpuPercent >= CPU_ALERT_THRESHOLD_PCT) {
142
+ _highCpuSamples++;
143
+ if (_highCpuSamples >= CPU_ALERT_SUSTAINED_SAMPLES) {
144
+ return `Daemon CPU sustained at ${cpuPercent}% for ${_highCpuSamples} samples`;
145
+ }
146
+ } else {
147
+ _highCpuSamples = 0;
148
+ }
149
+ return null;
150
+ }
151
+ var HEAP_ALERT_THRESHOLD_PCT = 80;
152
+ var HEAP_ALERT_SUSTAINED_SAMPLES = 6;
153
+ var _highHeapSamples = 0;
154
+ var _heapSizeLimit = null;
155
+ function getHeapSizeLimit() {
156
+ if (_heapSizeLimit !== null) return _heapSizeLimit;
157
+ try {
158
+ _heapSizeLimit = v8.getHeapStatistics().heap_size_limit;
159
+ } catch {
160
+ _heapSizeLimit = 4 * 1024 * 1024 * 1024;
161
+ }
162
+ return _heapSizeLimit;
163
+ }
164
+ function checkHeapAlert() {
165
+ const mem = process.memoryUsage();
166
+ const limit = getHeapSizeLimit();
167
+ const usedPct = limit > 0 ? mem.heapUsed / limit * 100 : 0;
168
+ if (usedPct >= HEAP_ALERT_THRESHOLD_PCT) {
169
+ _highHeapSamples++;
170
+ if (_highHeapSamples >= HEAP_ALERT_SUSTAINED_SAMPLES) {
171
+ return `V8 heap pressure: ${Math.round(usedPct)}% of limit (${Math.round(mem.heapUsed / 1024 / 1024)}MB / ${Math.round(limit / 1024 / 1024)}MB) for ${_highHeapSamples} samples \u2014 OOM risk`;
172
+ }
173
+ } else {
174
+ _highHeapSamples = 0;
175
+ }
176
+ return null;
177
+ }
178
+
179
+ // src/lib/daemon-health-log.ts
180
+ var LOG_DIR = path.join(os.homedir(), ".exe-os", "logs");
181
+ var LOG_FILE = path.join(LOG_DIR, "daemon-health.log");
182
+ var MAX_LOG_SIZE = 5 * 1024 * 1024;
183
+ var dirChecked = false;
184
+ function ensureDir() {
185
+ if (dirChecked) return;
186
+ if (!existsSync(LOG_DIR)) mkdirSync(LOG_DIR, { recursive: true });
187
+ dirChecked = true;
188
+ }
189
+ function maybeRotate() {
190
+ try {
191
+ if (!existsSync(LOG_FILE)) return;
192
+ const stat = statSync(LOG_FILE);
193
+ if (stat.size > MAX_LOG_SIZE) {
194
+ const rotated = `${LOG_FILE}.1`;
195
+ try {
196
+ renameSync(LOG_FILE, rotated);
197
+ } catch {
198
+ }
199
+ }
200
+ } catch {
201
+ }
202
+ }
203
+ function logDaemonHealth(entry) {
204
+ try {
205
+ ensureDir();
206
+ maybeRotate();
207
+ const record = {
208
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
209
+ event: entry.event,
210
+ pid: entry.pid,
211
+ msg: entry.message,
212
+ ...entry.data && { data: entry.data },
213
+ ...entry.stack && { stack: entry.stack }
214
+ };
215
+ appendFileSync(LOG_FILE, JSON.stringify(record) + "\n");
216
+ } catch {
217
+ }
218
+ }
219
+ function logBoot(extra) {
220
+ logDaemonHealth({
221
+ event: "boot",
222
+ pid: process.pid,
223
+ message: "Daemon starting",
224
+ data: {
225
+ nodeVersion: process.version,
226
+ platform: process.platform,
227
+ arch: process.arch,
228
+ totalMem: `${Math.round(os.totalmem() / 1024 / 1024 / 1024)}GB`,
229
+ freeMem: `${Math.round(os.freemem() / 1024 / 1024 / 1024)}GB`,
230
+ uptime: `${Math.round(os.uptime() / 3600)}h`,
231
+ ...extra
232
+ }
233
+ });
234
+ }
235
+ function logShutdown(reason, signal) {
236
+ logDaemonHealth({
237
+ event: signal ? "signal" : "shutdown",
238
+ pid: process.pid,
239
+ message: `Daemon shutting down: ${reason}`,
240
+ data: { reason, ...signal && { signal } }
241
+ });
242
+ }
243
+ function logCrash(error, event = "crash") {
244
+ const err = error instanceof Error ? error : new Error(String(error));
245
+ logDaemonHealth({
246
+ event,
247
+ pid: process.pid,
248
+ message: `FATAL: ${err.message}`,
249
+ stack: err.stack
250
+ });
251
+ }
252
+ async function logHeartbeat(data) {
253
+ const mem = process.memoryUsage();
254
+ let processData = {};
255
+ try {
256
+ const cpuPct = getDaemonCpuPercent();
257
+ const snapshot = await takeProcessSnapshot();
258
+ processData = formatSnapshotSummary(snapshot);
259
+ const cpuAlertMsg = checkCpuAlert(cpuPct);
260
+ if (cpuAlertMsg) {
261
+ logDaemonHealth({ event: "cpu_pressure", pid: process.pid, message: cpuAlertMsg, data: processData });
262
+ }
263
+ const heapAlertMsg = checkHeapAlert();
264
+ if (heapAlertMsg) {
265
+ logDaemonHealth({ event: "memory_pressure", pid: process.pid, message: heapAlertMsg, data: processData });
266
+ }
267
+ } catch {
268
+ }
269
+ logDaemonHealth({
270
+ event: "heartbeat",
271
+ pid: process.pid,
272
+ message: "alive",
273
+ data: {
274
+ rss: `${Math.round(mem.rss / 1024 / 1024)}MB`,
275
+ heapUsed: `${Math.round(mem.heapUsed / 1024 / 1024)}MB`,
276
+ heapTotal: `${Math.round(mem.heapTotal / 1024 / 1024)}MB`,
277
+ uptimeSec: Math.round(process.uptime()),
278
+ ...processData,
279
+ ...data
280
+ }
281
+ });
282
+ }
283
+
284
+ export {
285
+ logDaemonHealth,
286
+ logBoot,
287
+ logShutdown,
288
+ logCrash,
289
+ logHeartbeat
290
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createReminder
3
- } from "./chunk-ORNKGGFX.js";
3
+ } from "./chunk-JNARUXDC.js";
4
4
 
5
5
  // src/mcp/tools/create-reminder.ts
6
6
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeTask
3
- } from "./chunk-QNJPDIWY.js";
3
+ } from "./chunk-4L4R6AQJ.js";
4
4
  import {
5
5
  createTaskCore,
6
6
  employeeSessionName,
@@ -9,11 +9,11 @@ import {
9
9
  isEmployeeAlive,
10
10
  sessionScopeFilter,
11
11
  updateTaskStatus
12
- } from "./chunk-OVKNFTCL.js";
12
+ } from "./chunk-HED6D5KR.js";
13
13
  import {
14
14
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
15
15
  getCoordinatorName
16
- } from "./chunk-P3SIFDES.js";
16
+ } from "./chunk-SCYWCWKY.js";
17
17
 
18
18
  // src/runtime/orchestrator.ts
19
19
  var STALE_THRESHOLD_MS = 2 * 60 * 60 * 1e3;
@@ -9,7 +9,7 @@ import {
9
9
  findScopedDuplicate,
10
10
  governMemoryRecord,
11
11
  schedulePostWriteMemoryHygiene
12
- } from "./chunk-PTDBHQX7.js";
12
+ } from "./chunk-MQCTK6EF.js";
13
13
  import {
14
14
  orgBus
15
15
  } from "./chunk-MP2AFCGL.js";
@@ -18,7 +18,7 @@ import {
18
18
  ensureSchema,
19
19
  getClient,
20
20
  initTurso
21
- } from "./chunk-P3SIFDES.js";
21
+ } from "./chunk-SCYWCWKY.js";
22
22
  import {
23
23
  EMBEDDING_DIM
24
24
  } from "./chunk-FXU7JOXK.js";
@@ -68,7 +68,7 @@ function recordShardFailure(project, error) {
68
68
  `[store] Shard circuit OPEN for "${project}" after ${state.failures} consecutive failures. Will retry in ${SHARD_CB_COOLDOWN_MS / 6e4}min. Last error: ${error}
69
69
  `
70
70
  );
71
- void import("./orchestration-events-MB4QVHTD.js").then(({ recordOrchestrationEventBestEffort }) => {
71
+ void import("./orchestration-events-PZLLPCKY.js").then(({ recordOrchestrationEventBestEffort }) => {
72
72
  recordOrchestrationEventBestEffort({
73
73
  eventType: "shard.circuit_open",
74
74
  source: "store.recordShardFailure",
@@ -165,7 +165,7 @@ async function initStore(options) {
165
165
  );
166
166
  _nextVersion = (Number(vResult.rows[0]?.max_v) || 0) + 1;
167
167
  try {
168
- const { loadGlobalProcedures } = await import("./global-procedures-POG4V6IK.js");
168
+ const { loadGlobalProcedures } = await import("./global-procedures-SYZZCGDS.js");
169
169
  await loadGlobalProcedures();
170
170
  } catch (e) {
171
171
  logStoreWarn("catch", e);
@@ -293,7 +293,7 @@ async function writeMemory(record) {
293
293
  founder_id: record.founder_id ?? null
294
294
  };
295
295
  try {
296
- const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-MOCWJK6S.js");
296
+ const { checkMemoryPoisoning } = await import("./memory-poisoning-defense-ECXSX7HK.js");
297
297
  const poisonResult = await checkMemoryPoisoning({
298
298
  memoryId: dbRow.id,
299
299
  vector: Array.isArray(dbRow.vector) ? dbRow.vector : void 0,
@@ -486,19 +486,19 @@ async function flushBatch() {
486
486
  }
487
487
  _nextVersion = baseVersion;
488
488
  try {
489
- const { insertMemoryCardsForBatch } = await import("./memory-cards-BGI6MJRN.js");
489
+ const { insertMemoryCardsForBatch } = await import("./memory-cards-II67WFL2.js");
490
490
  await insertMemoryCardsForBatch(batch);
491
491
  } catch (e) {
492
492
  logStoreWarn("catch", e);
493
493
  }
494
494
  try {
495
- const { insertOntologyForBatch } = await import("./agentic-ontology-M7T72M6V.js");
495
+ const { insertOntologyForBatch } = await import("./agentic-ontology-6KBAXLSJ.js");
496
496
  await insertOntologyForBatch(batch);
497
497
  } catch (e) {
498
498
  logStoreWarn("catch", e);
499
499
  }
500
500
  try {
501
- const { extractGraphForBatch } = await import("./memory-graph-extractor-DTRRNWHZ.js");
501
+ const { extractGraphForBatch } = await import("./memory-graph-extractor-PM4Q2KJG.js");
502
502
  await extractGraphForBatch(batch);
503
503
  } catch (e) {
504
504
  logStoreWarn("catch", e);
@@ -554,6 +554,12 @@ ${err.stack.split("\n").slice(1, 3).join("\n")}` : ""}` : String(err);
554
554
  _flushing = false;
555
555
  }
556
556
  }
557
+ function buildStatusFilter(options, columnPrefix, indent, opts) {
558
+ const statusClause = options?.includeArchived ? "" : `${indent}AND COALESCE(${columnPrefix}status, 'active') = 'active'`;
559
+ const withDrafts = opts?.withDrafts ?? true;
560
+ const draftClause = !withDrafts || options?.includeDrafts ? "" : `${indent}AND (${columnPrefix}draft = 0 OR ${columnPrefix}draft IS NULL)`;
561
+ return { statusClause, draftClause, clause: statusClause + draftClause };
562
+ }
557
563
  function buildWikiScopeFilter(options, columnPrefix) {
558
564
  const args = [];
559
565
  let clause = "";
@@ -602,10 +608,7 @@ async function searchMemories(queryVector, agentId, options) {
602
608
  } catch (e) {
603
609
  logStoreDebug("embedding_model column check failed", e);
604
610
  }
605
- const statusFilter = options?.includeArchived ? "" : `
606
- AND COALESCE(status, 'active') = 'active'`;
607
- const draftFilter = options?.includeDrafts ? "" : `
608
- AND (draft = 0 OR draft IS NULL)`;
611
+ const { statusClause: statusFilter, draftClause: draftFilter } = buildStatusFilter(options, "", "\n ");
609
612
  let sql = `SELECT id, agent_id, agent_role, session_id, timestamp,
610
613
  tool_name, project_name,
611
614
  has_error, raw_text, vector, importance, status,
@@ -624,7 +627,7 @@ async function searchMemories(queryVector, agentId, options) {
624
627
  args.push(activeEmbeddingModel);
625
628
  }
626
629
  try {
627
- const { founderScopeFilter } = await import("./founder-context-3SOKEW76.js");
630
+ const { founderScopeFilter } = await import("./founder-context-QCTMEK66.js");
628
631
  const founderFilter = founderScopeFilter(options?.founderId);
629
632
  sql += founderFilter.sql;
630
633
  args.push(...founderFilter.args.filter((a) => a !== null));
@@ -822,6 +825,7 @@ export {
822
825
  classifyTier,
823
826
  writeMemory,
824
827
  flushBatch,
828
+ buildStatusFilter,
825
829
  buildWikiScopeFilter,
826
830
  buildRawVisibilityFilter,
827
831
  searchMemories,
@@ -0,0 +1,72 @@
1
+ // src/lib/mcp-tool-surface.ts
2
+ import { createHash } from "crypto";
3
+ var SURFACE_MARKER_PREFIX = "surface-";
4
+ function canonicalize(value, depth = 0) {
5
+ if (depth > 8) return "\u2026";
6
+ if (value === null || typeof value !== "object") {
7
+ return typeof value === "function" ? "fn" : value;
8
+ }
9
+ if (Array.isArray(value)) return value.map((v) => canonicalize(v, depth + 1));
10
+ const obj = value;
11
+ const out = {};
12
+ for (const key of Object.keys(obj).sort()) {
13
+ out[key] = canonicalize(obj[key], depth + 1);
14
+ }
15
+ return out;
16
+ }
17
+ function fingerprintSchema(inputSchema) {
18
+ if (!inputSchema || typeof inputSchema !== "object") return "";
19
+ const keys = Object.keys(inputSchema).sort();
20
+ let canonLen = 0;
21
+ try {
22
+ canonLen = JSON.stringify(canonicalize(inputSchema)).length;
23
+ } catch {
24
+ canonLen = 0;
25
+ }
26
+ return `${keys.join(",")}|${canonLen}`;
27
+ }
28
+ function computeToolSurfaceHash(registerFn) {
29
+ try {
30
+ const captured = [];
31
+ const fakeServer = {
32
+ registerTool(name, config, _handler) {
33
+ captured.push({ name, fp: fingerprintSchema(config?.inputSchema) });
34
+ }
35
+ };
36
+ registerFn(fakeServer);
37
+ if (captured.length === 0) return null;
38
+ captured.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
39
+ const canonical = captured.map((t) => `${t.name} ${t.fp}`).join("\n");
40
+ return createHash("sha256").update(canonical).digest("hex");
41
+ } catch {
42
+ return null;
43
+ }
44
+ }
45
+ var RELOAD_DEBOUNCE_MS = 5 * 60 * 1e3;
46
+ function decideReload(baseline, disk, state, now, debounceMs = RELOAD_DEBOUNCE_MS) {
47
+ if (!baseline || !disk) {
48
+ return { reload: false, state: { firstChangeAt: null } };
49
+ }
50
+ if (disk === baseline) {
51
+ return { reload: false, state: { firstChangeAt: null } };
52
+ }
53
+ if (state.firstChangeAt === null) {
54
+ return { reload: false, state: { firstChangeAt: now } };
55
+ }
56
+ if (now - state.firstChangeAt >= debounceMs) {
57
+ return { reload: true, state: { firstChangeAt: null } };
58
+ }
59
+ return { reload: false, state };
60
+ }
61
+ function buildMcpVersionMarker(surfaceHash) {
62
+ if (surfaceHash) return `${SURFACE_MARKER_PREFIX}${surfaceHash}`;
63
+ return `deploy-${Date.now()}`;
64
+ }
65
+
66
+ export {
67
+ SURFACE_MARKER_PREFIX,
68
+ computeToolSurfaceHash,
69
+ RELOAD_DEBOUNCE_MS,
70
+ decideReload,
71
+ buildMcpVersionMarker
72
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recordOrchestrationEventBestEffort
3
- } from "./chunk-WHOT5NZ7.js";
3
+ } from "./chunk-OR3TAZL3.js";
4
4
  import {
5
5
  atomicWriteJsonSync
6
6
  } from "./chunk-65DBIEM2.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  connectEmbedDaemon,
9
9
  embedBatchViaClient
10
- } from "./chunk-TCJEFW5V.js";
10
+ } from "./chunk-PPXQE7AS.js";
11
11
  import {
12
12
  EXE_AI_DIR
13
13
  } from "./chunk-DFIOOK5R.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  executeAction,
3
3
  substituteTemplate
4
- } from "./chunk-XDE5IGBX.js";
4
+ } from "./chunk-2NS3QRMJ.js";
5
5
 
6
6
  // src/automation/workflow-engine.ts
7
7
  import { randomUUID } from "crypto";
@@ -1,7 +1,10 @@
1
+ import {
2
+ IMessageAdapter
3
+ } from "./chunk-FLSASUV3.js";
1
4
  import {
2
5
  createCRMWebhookHandler,
3
6
  parseTwentyWebhook
4
- } from "./chunk-WIL6LXNG.js";
7
+ } from "./chunk-AC6DKMVS.js";
5
8
  import {
6
9
  WhatsAppAdapter
7
10
  } from "./chunk-ECSNSHZ7.js";
@@ -17,9 +20,6 @@ import {
17
20
  import {
18
21
  SlackAdapter
19
22
  } from "./chunk-ORCCI2VV.js";
20
- import {
21
- IMessageAdapter
22
- } from "./chunk-FLSASUV3.js";
23
23
  import {
24
24
  BotRegistry,
25
25
  BotRuntime,
@@ -42,7 +42,7 @@ import {
42
42
  retryWithBackoff,
43
43
  routeMessage,
44
44
  validateGatewayConfig
45
- } from "./chunk-OZRO37JW.js";
45
+ } from "./chunk-3KH6GXXX.js";
46
46
  import {
47
47
  OllamaProvider
48
48
  } from "./chunk-FWFFZGSC.js";