@askexenow/exe-os 0.9.144 → 0.9.145

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 (391) hide show
  1. package/deploy/compose/.env.customer.example +2 -2
  2. package/deploy/compose/.env.default +1 -1
  3. package/deploy/compose/.env.example +2 -2
  4. package/deploy/compose/README.md +1 -1
  5. package/deploy/compose/docker-compose.yml +7 -7
  6. package/deploy/compose/generate-env.ts +5 -5
  7. package/deploy/stack-manifests/v0.9.json +31 -31
  8. package/dist/{active-agent-NVYSMA2V.js → active-agent-GJOJUEMF.js} +9 -9
  9. package/dist/{active-agent-Q3IKFOF6.js → active-agent-HUDSZRUG.js} +9 -9
  10. package/dist/agent-context-HH7TL5ZP.js +9 -0
  11. package/dist/{agent-loop-G4VUR5ME.js → agent-loop-OCJFYO72.js} +1 -1
  12. package/dist/{agentic-ontology-Q3OVWKAK.js → agentic-ontology-5PGUVMDP.js} +2 -2
  13. package/dist/{asana-ASFYLGKF.js → asana-BSDR6NW4.js} +1 -1
  14. package/dist/{backfill-metadata-GZIPWZAJ.js → backfill-metadata-ZDJ5B37R.js} +10 -14
  15. package/dist/{background-jobs-LS6PTJKF.js → background-jobs-4N4JSZVZ.js} +4 -4
  16. package/dist/{bash-Y5PEW5UQ.js → bash-X54PZMOG.js} +1 -1
  17. package/dist/behaviors-TXLHEM5J.js +22 -0
  18. package/dist/bin/age-ontology-load.js +4 -4
  19. package/dist/bin/agentic-ontology-backfill.js +13 -15
  20. package/dist/bin/agentic-reflection-backfill.js +13 -13
  21. package/dist/bin/agentic-semantic-label.js +13 -17
  22. package/dist/bin/backfill-conversations.js +14 -19
  23. package/dist/bin/backfill-responses.js +14 -19
  24. package/dist/bin/backfill-vectors.js +17 -20
  25. package/dist/bin/bulk-sync-postgres.js +15 -17
  26. package/dist/bin/cc-doctor.js +5 -5
  27. package/dist/bin/cleanup-stale-review-tasks.js +25 -29
  28. package/dist/bin/cli.js +19 -19
  29. package/dist/bin/exe-agent-config.js +9 -15
  30. package/dist/bin/exe-agent.js +9 -9
  31. package/dist/bin/exe-assign.js +16 -19
  32. package/dist/bin/exe-boot.js +47 -64
  33. package/dist/bin/exe-call.js +10 -12
  34. package/dist/bin/exe-cloud.js +12 -12
  35. package/dist/bin/exe-dispatch.js +25 -31
  36. package/dist/bin/exe-doctor.js +2 -2
  37. package/dist/bin/exe-export-behaviors.js +13 -13
  38. package/dist/bin/exe-forget.js +13 -15
  39. package/dist/bin/exe-gateway.js +21 -23
  40. package/dist/bin/exe-healthcheck.js +5 -5
  41. package/dist/bin/exe-heartbeat.js +25 -35
  42. package/dist/bin/exe-kill.js +13 -17
  43. package/dist/bin/exe-launch-agent.js +55 -54
  44. package/dist/bin/exe-new-employee.js +13 -17
  45. package/dist/bin/exe-pending-messages.js +25 -25
  46. package/dist/bin/exe-pending-notifications.js +29 -29
  47. package/dist/bin/exe-pending-reviews.js +24 -28
  48. package/dist/bin/exe-rename.js +9 -11
  49. package/dist/bin/exe-review.js +27 -33
  50. package/dist/bin/exe-search.js +11 -11
  51. package/dist/bin/exe-session-cleanup.js +94 -41
  52. package/dist/bin/exe-settings.js +13 -19
  53. package/dist/bin/exe-start-codex.js +21 -31
  54. package/dist/bin/exe-start-opencode.js +16 -20
  55. package/dist/bin/exe-start.sh +7 -2
  56. package/dist/bin/exe-status.js +25 -25
  57. package/dist/bin/exe-support.js +5 -5
  58. package/dist/bin/exe-team.js +7 -11
  59. package/dist/bin/git-sweep.js +24 -24
  60. package/dist/bin/graph-backfill.js +13 -15
  61. package/dist/bin/graph-export.js +12 -14
  62. package/dist/bin/graph-layer-benchmark.js +1 -1
  63. package/dist/bin/install.js +54 -23
  64. package/dist/bin/intercom-check.js +12 -8
  65. package/dist/bin/list-providers.js +1 -1
  66. package/dist/bin/postgres-agentic-reflection-backfill.js +6 -6
  67. package/dist/bin/postgres-agentic-semantic-backfill.js +5 -5
  68. package/dist/bin/pre-publish.js +2 -2
  69. package/dist/bin/registry-proxy.js +2 -2
  70. package/dist/bin/scan-tasks.js +26 -30
  71. package/dist/bin/setup.js +5 -5
  72. package/dist/bin/shard-migrate.js +12 -14
  73. package/dist/bin/stack-update.js +4 -6
  74. package/dist/bin/update.js +1 -1
  75. package/dist/{branding-ZOKU45NY.js → branding-52J2ILJX.js} +3 -3
  76. package/dist/capacity-monitor-HWN2JX5W.js +46 -0
  77. package/dist/{catchup-brief-HLGROPH6.js → catchup-brief-UERCIVM5.js} +28 -32
  78. package/dist/{chunk-XSF6G7O2.js → chunk-2R3N4DQY.js} +4 -4
  79. package/dist/{chunk-AV77PUPD.js → chunk-32LFUJVG.js} +1076 -841
  80. package/dist/chunk-3H4VU65X.js +209 -0
  81. package/dist/chunk-3TXOH3SJ.js +20 -0
  82. package/dist/{chunk-GPCQRSAR.js → chunk-4F56OUR7.js} +3 -9
  83. package/dist/{chunk-ZCYQZQTA.js → chunk-53VUIKOE.js} +1 -1
  84. package/dist/{chunk-7YZJUTQ4.js → chunk-56T5TMNK.js} +2 -2
  85. package/dist/{chunk-TBO4RYRU.js → chunk-5F3EXHT7.js} +1 -1
  86. package/dist/{chunk-KKYDUT2Z.js → chunk-5WTYETQO.js} +6 -15
  87. package/dist/{chunk-YSRJHKHL.js → chunk-63UVIM7S.js} +5 -10
  88. package/dist/{chunk-KRLOFIPI.js → chunk-64WZEXXA.js} +2 -21
  89. package/dist/{chunk-DUXNECD3.js → chunk-65UQ7H5U.js} +3 -7
  90. package/dist/{chunk-53JBNNU3.js → chunk-6BUUY7FG.js} +6 -28
  91. package/dist/{chunk-YGHMRSH5.js → chunk-6D23UNXU.js} +3 -9
  92. package/dist/{chunk-MI4RRRX5.js → chunk-7APRWURX.js} +37 -26
  93. package/dist/{chunk-3RT5V3M4.js → chunk-7KR5PV4P.js} +2 -4
  94. package/dist/{chunk-KVM3XRPC.js → chunk-7PEYIW53.js} +2 -4
  95. package/dist/{chunk-VISRYICE.js → chunk-7PTII6F4.js} +2 -4
  96. package/dist/{chunk-CO7XAJJ2.js → chunk-AAVODJ4F.js} +2 -4
  97. package/dist/{chunk-2WGSIVI4.js → chunk-AHMUF6RO.js} +1 -3
  98. package/dist/{chunk-47MZMRQZ.js → chunk-AJ2XDY27.js} +35 -105
  99. package/dist/{chunk-FCNKI3SH.js → chunk-B6Q6WAD7.js} +2 -7
  100. package/dist/{chunk-ZK3WQY7Q.js → chunk-BHV7PX5V.js} +2 -4
  101. package/dist/{chunk-HLYXFVVT.js → chunk-BXCJOACQ.js} +6 -12
  102. package/dist/{chunk-T2WBLUN7.js → chunk-BY4OTURZ.js} +5 -17
  103. package/dist/{chunk-SI5TLMB6.js → chunk-C4EVFN7J.js} +88 -12
  104. package/dist/{chunk-YRLMCI3J.js → chunk-CDDRSIGK.js} +271 -131
  105. package/dist/{chunk-QC34Z6ZI.js → chunk-CQCURHDV.js} +41 -31
  106. package/dist/{chunk-HP43GLZ6.js → chunk-CVYC6DUW.js} +8 -19
  107. package/dist/{chunk-4C3NEI64.js → chunk-CWPE6QVM.js} +1 -1
  108. package/dist/{chunk-DDUIVBH6.js → chunk-DBLBWWFS.js} +4 -6
  109. package/dist/{chunk-HHKKLWAI.js → chunk-DCJ42FEN.js} +1 -1
  110. package/dist/{chunk-52LCN4JK.js → chunk-ER3UJ2VL.js} +3 -5
  111. package/dist/{chunk-XCTQO7TN.js → chunk-F7JVVLGH.js} +1 -1
  112. package/dist/{chunk-VU447UAO.js → chunk-FLSASUV3.js} +6 -2
  113. package/dist/chunk-FXU7JOXK.js +6 -0
  114. package/dist/{chunk-VTQRACP7.js → chunk-G3VR3MJI.js} +23 -50
  115. package/dist/{chunk-VAOAI6DS.js → chunk-GCMT6RWI.js} +1 -1
  116. package/dist/chunk-GJV3WDWM.js +14 -0
  117. package/dist/{chunk-5JIVAJJU.js → chunk-GK5VMHSN.js} +1 -1
  118. package/dist/{chunk-DC4ZD76Y.js → chunk-GZIAQYGI.js} +2 -28
  119. package/dist/{chunk-76HPWZJC.js → chunk-H4KUTL2T.js} +1 -1
  120. package/dist/{chunk-V3YNF3JK.js → chunk-H4YONWQX.js} +218 -253
  121. package/dist/{chunk-OCYP6VU6.js → chunk-H6OEU54G.js} +22 -19
  122. package/dist/{chunk-HJMM4QMY.js → chunk-HOKOOBDL.js} +6 -25
  123. package/dist/{chunk-LXX2UDWL.js → chunk-HV75RBMK.js} +1 -3
  124. package/dist/{chunk-6BFIFI5F.js → chunk-HYZV25LY.js} +7 -18
  125. package/dist/{chunk-TLXIKKEG.js → chunk-I4WAKJ6W.js} +74 -67
  126. package/dist/{chunk-AFEXRICE.js → chunk-I5VJNTDL.js} +34 -45
  127. package/dist/{chunk-LT55GKEK.js → chunk-IBVB2NGY.js} +6 -10
  128. package/dist/{chunk-KX3KLDG7.js → chunk-IPSFAUK5.js} +3 -7
  129. package/dist/{chunk-EVP2WD5S.js → chunk-JUITBJ7J.js} +1 -5
  130. package/dist/{chunk-IUQL3KZV.js → chunk-K3PSCQLK.js} +2 -4
  131. package/dist/{chunk-CNNT4QSN.js → chunk-K6MMN6AW.js} +7 -20
  132. package/dist/{chunk-QASVYG2B.js → chunk-KHV55ME4.js} +4 -3
  133. package/dist/{chunk-EOWQ6DMH.js → chunk-KLRP6ZG3.js} +10 -16
  134. package/dist/{chunk-C54PGWHV.js → chunk-KQTGSD23.js} +11 -14
  135. package/dist/{chunk-V6O4GN5M.js → chunk-LOQCOHEW.js} +2 -12
  136. package/dist/{chunk-OC7FNHGA.js → chunk-LWVZLTMD.js} +3 -7
  137. package/dist/{chunk-YEXCXJRS.js → chunk-MFGARIVE.js} +1 -1
  138. package/dist/chunk-MP2AFCGL.js +53 -0
  139. package/dist/{chunk-WZDI6UJ6.js → chunk-MPXPPKJ4.js} +3 -3
  140. package/dist/{chunk-A46SAHYB.js → chunk-MUVPQCQA.js} +1 -1
  141. package/dist/{chunk-WLW7QV2C.js → chunk-NA3MXUU6.js} +135 -187
  142. package/dist/{chunk-R23EMFJV.js → chunk-NAFWZIP3.js} +2 -7
  143. package/dist/{chunk-AYUYBWGD.js → chunk-NE6RPW5C.js} +7 -32
  144. package/dist/chunk-NGP6LSV2.js +25 -0
  145. package/dist/{chunk-EZY3BNIW.js → chunk-NQAZ2CP7.js} +40 -51
  146. package/dist/{chunk-XMAP37LE.js → chunk-NT6R4ATM.js} +1 -1
  147. package/dist/{chunk-NCVFW4JS.js → chunk-O7CTVDC3.js} +2 -2
  148. package/dist/{chunk-TOR5ZPKF.js → chunk-OPU3NYOO.js} +5 -17
  149. package/dist/{chunk-SRQXDGUO.js → chunk-OYCQ6PFC.js} +6 -6
  150. package/dist/{chunk-KFQGP6VL.js → chunk-PNKVD2UK.js} +0 -7
  151. package/dist/{chunk-MFO7MNSD.js → chunk-QGGH7LOU.js} +1 -10
  152. package/dist/{chunk-3XUWTXNC.js → chunk-QSSABSCM.js} +41 -7
  153. package/dist/chunk-RLCZBSUB.js +123 -0
  154. package/dist/{chunk-37RJAKHZ.js → chunk-RNN4MZDN.js} +4 -12
  155. package/dist/{chunk-BNH4LWKE.js → chunk-RWJY7KMP.js} +34 -13
  156. package/dist/{chunk-VH2CK32C.js → chunk-RWURKLS3.js} +1 -1
  157. package/dist/{chunk-UAAOJHVR.js → chunk-S465RWY7.js} +41 -128
  158. package/dist/{chunk-TGR3H3DM.js → chunk-SR6D65DA.js} +5 -11
  159. package/dist/{chunk-MAA3266Q.js → chunk-TFZZL3QF.js} +1 -1
  160. package/dist/{chunk-NEAHEC5G.js → chunk-TXSJ2L5O.js} +7 -30
  161. package/dist/{chunk-TDIUACZ6.js → chunk-UVH6FA5E.js} +5 -2
  162. package/dist/{chunk-QLQCSJC4.js → chunk-UWBU44UP.js} +1 -1
  163. package/dist/{chunk-ROTT6N5K.js → chunk-UXDQ4ERA.js} +74 -33
  164. package/dist/{chunk-WDN5IY66.js → chunk-V4O2APMI.js} +1 -1
  165. package/dist/{chunk-PNLYLN6K.js → chunk-VRD452MQ.js} +2 -4
  166. package/dist/{chunk-SCP545OR.js → chunk-VX4X2O6J.js} +7 -12
  167. package/dist/{chunk-EHF676BW.js → chunk-VXQDZH5T.js} +5 -13
  168. package/dist/{chunk-2RCYI7O4.js → chunk-W7NQE65M.js} +1 -3
  169. package/dist/{chunk-QBLI377G.js → chunk-WJW564IP.js} +55 -6
  170. package/dist/{chunk-QUPRWJKI.js → chunk-WLEVAIL5.js} +11 -5
  171. package/dist/{chunk-DSVN3QRR.js → chunk-WTJS6PCC.js} +1 -1
  172. package/dist/{chunk-EYRQWVPQ.js → chunk-X7DJ2QZW.js} +3 -5
  173. package/dist/{chunk-76R35J76.js → chunk-XAHIVBTU.js} +7 -15
  174. package/dist/{chunk-67WOKLTZ.js → chunk-XEA6DSLR.js} +12 -27
  175. package/dist/{chunk-AV4RLRM2.js → chunk-XQ2ZBOAD.js} +64 -41
  176. package/dist/{chunk-7PJP3TZV.js → chunk-Y2VVTK2E.js} +2 -13
  177. package/dist/chunk-YSU7JB7H.js +0 -0
  178. package/dist/{chunk-PJHHFJAN.js → chunk-ZQX6UOP6.js} +10 -28
  179. package/dist/{code-context-index-WCJ6RWCY.js → code-context-index-SRTAWCZQ.js} +7 -6
  180. package/dist/content-extractor-H4IPL533.js +8 -0
  181. package/dist/{conversation-entity-extractor-7S4JFUOM.js → conversation-entity-extractor-IZ3ECP4A.js} +2 -2
  182. package/dist/{conversation-wiki-populator-H6WM5SFU.js → conversation-wiki-populator-K4BQXHHO.js} +2 -2
  183. package/dist/{core-memory-N2SN7CF5.js → core-memory-JZ34WT5R.js} +34 -3
  184. package/dist/{crdt-sync-WYAIMNUX.js → crdt-sync-4TOVD4QN.js} +2 -2
  185. package/dist/{crm-bridge-Q5JBVJ6P.js → crm-bridge-27QVOWPI.js} +1 -1
  186. package/dist/{crm-webhook-PIFEQH7A.js → crm-webhook-77XHBWL7.js} +3 -3
  187. package/dist/{cto-delegation-gate-MKIVEDB4.js → cto-delegation-gate-AWENA4VT.js} +23 -29
  188. package/dist/daemon-auth-Z7O3LO23.js +13 -0
  189. package/dist/{daemon-orchestration-RZLIILS6.js → daemon-orchestration-BG4NPWOK.js} +40 -28
  190. package/dist/{daemon-protocol-RLH2XM2K.js → daemon-protocol-N7MOJ4U3.js} +2 -4
  191. package/dist/{db-backup-K2M7HENN.js → db-backup-E34JMBZD.js} +4 -6
  192. package/dist/{devtools-PLJCAU53.js → devtools-ZL5NCINM.js} +1 -1
  193. package/dist/{discord-G4BQJ2VX.js → discord-QOFQKX6S.js} +1 -1
  194. package/dist/{email-XMRNMFXR.js → email-NY5HB4WA.js} +1 -1
  195. package/dist/{entity-boost-62SBVNCD.js → entity-boost-V6KSRGG4.js} +2 -2
  196. package/dist/{exe-drift-2LL7OCRF.js → exe-drift-YFWCC26O.js} +7 -7
  197. package/dist/{exe-export-TQZ6FVKC.js → exe-export-YRACBEUY.js} +12 -12
  198. package/dist/{exe-import-PB3VIFF7.js → exe-import-DY57L2OI.js} +12 -12
  199. package/dist/{exe-key-BZTGYI2O.js → exe-key-U2JJH4MO.js} +8 -10
  200. package/dist/{exe-org-7ZJNIBL2.js → exe-org-45OTYZZJ.js} +4 -4
  201. package/dist/{factory-YTD23AW7.js → factory-2PB537KA.js} +1 -1
  202. package/dist/fast-db-init-67TQTHWT.js +7 -0
  203. package/dist/{file-edit-FJVEO7XZ.js → file-edit-GSXUFUDC.js} +1 -1
  204. package/dist/{file-read-Q2NH3J35.js → file-read-Z3F3PUCK.js} +1 -1
  205. package/dist/{file-write-UNSFXNH4.js → file-write-X77JXZ2C.js} +1 -1
  206. package/dist/gateway/index.js +13 -13
  207. package/dist/{gateway-client-E4UWC45R.js → gateway-client-IPKKEYKY.js} +2 -2
  208. package/dist/{git-staleness-QXWQPH74.js → git-staleness-I662R7RL.js} +7 -9
  209. package/dist/git-task-sweep-XWFCP2HA.js +37 -0
  210. package/dist/{glob-GRMXLDMB.js → glob-2PWAXTZ2.js} +1 -1
  211. package/dist/global-procedures-IEIJBCAH.js +19 -0
  212. package/dist/{graph-query-JBQDJJFP.js → graph-query-NCDYOT4Y.js} +1 -1
  213. package/dist/{graph-rag-73U3RTBB.js → graph-rag-2YLGRBW5.js} +2 -2
  214. package/dist/{grep-NBV6SKYZ.js → grep-GTV6WAZ4.js} +1 -1
  215. package/dist/{hook-integrity-LAWB6YQH.js → hook-integrity-LLPJPAXW.js} +2 -2
  216. package/dist/hooks/bug-report-worker.js +27 -35
  217. package/dist/hooks/codex-stop-task-finalizer.js +26 -32
  218. package/dist/hooks/commit-complete.js +26 -26
  219. package/dist/hooks/error-recall.js +17 -19
  220. package/dist/hooks/exe-heartbeat-hook.js +10 -12
  221. package/dist/hooks/ingest-worker.js +14 -13
  222. package/dist/hooks/ingest.js +23 -25
  223. package/dist/hooks/instructions-loaded.js +11 -13
  224. package/dist/hooks/notification.js +10 -10
  225. package/dist/hooks/post-compact.js +25 -27
  226. package/dist/hooks/post-tool-combined.js +6 -6
  227. package/dist/hooks/pre-compact.js +31 -32
  228. package/dist/hooks/pre-tool-use.js +31 -35
  229. package/dist/hooks/prompt-submit.js +90 -67
  230. package/dist/hooks/session-end.js +40 -42
  231. package/dist/hooks/session-start.js +10 -10
  232. package/dist/hooks/stop.js +36 -44
  233. package/dist/hooks/subagent-stop.js +26 -30
  234. package/dist/hooks/summary-worker.js +36 -43
  235. package/dist/{hooks-KD3N2D7P.js → hooks-UK2AYRCA.js} +1 -1
  236. package/dist/imessage-LINH4V4D.js +7 -0
  237. package/dist/index.js +32 -32
  238. package/dist/{installer-BIDJSBAP.js → installer-PB63JTTG.js} +11 -11
  239. package/dist/{installer-2O362XY7.js → installer-SSR2OOLO.js} +11 -11
  240. package/dist/{installer-OYGB6GAI.js → installer-ZONYB3XK.js} +11 -11
  241. package/dist/{intercom-queue-PEEGAJ33.js → intercom-queue-MMZT2MA2.js} +2 -4
  242. package/dist/{key-backup-status-2CMNBKEM.js → key-backup-status-4WKIQOAS.js} +3 -3
  243. package/dist/lib/agent-config.js +5 -7
  244. package/dist/lib/cloud-sync.js +14 -10
  245. package/dist/lib/cloudflare-dns.js +1 -1
  246. package/dist/lib/config.js +3 -3
  247. package/dist/lib/consolidation.js +17 -13
  248. package/dist/lib/crypto.js +2 -4
  249. package/dist/lib/database.js +6 -8
  250. package/dist/lib/db-daemon-client.js +7 -17
  251. package/dist/lib/db.js +6 -10
  252. package/dist/lib/device-registry.js +3 -3
  253. package/dist/lib/embedder.js +9 -10
  254. package/dist/lib/employee-templates.js +9 -9
  255. package/dist/lib/employees.js +10 -8
  256. package/dist/lib/error-detector.js +3 -3
  257. package/dist/lib/exe-daemon-client.js +6 -7
  258. package/dist/lib/exe-daemon.js +368 -399
  259. package/dist/lib/file-grep.js +1 -1
  260. package/dist/lib/hybrid-search.js +11 -11
  261. package/dist/lib/identity-templates.js +1 -1
  262. package/dist/lib/identity.js +6 -8
  263. package/dist/lib/keychain.js +2 -2
  264. package/dist/lib/license.js +4 -6
  265. package/dist/lib/messaging.js +24 -24
  266. package/dist/lib/post-tool-memory.js +7 -7
  267. package/dist/lib/registry-proxy.js +1 -1
  268. package/dist/lib/reminders.js +7 -7
  269. package/dist/lib/runtime-table.js +3 -5
  270. package/dist/lib/schedules.js +11 -11
  271. package/dist/lib/session-registry.js +2 -4
  272. package/dist/lib/session-wrappers.js +1 -1
  273. package/dist/lib/skill-learning.js +8 -10
  274. package/dist/lib/status-brief.js +2 -2
  275. package/dist/lib/store.js +10 -10
  276. package/dist/lib/task-router.js +7 -7
  277. package/dist/lib/tasks.js +24 -28
  278. package/dist/lib/tmux-routing.js +23 -25
  279. package/dist/lib/tmux-status.js +2 -4
  280. package/dist/lib/tmux-transport.js +3 -5
  281. package/dist/lib/token-spend.js +7 -7
  282. package/dist/lib/transport.js +3 -5
  283. package/dist/lib/ws-auth.js +1 -1
  284. package/dist/lib/ws-client.js +2 -2
  285. package/dist/license-gate-JY2KFIKO.js +14 -0
  286. package/dist/mcp/register-tools.js +77 -77
  287. package/dist/mcp/server.js +92 -86
  288. package/dist/mcp/tools/complete-reminder.js +8 -8
  289. package/dist/mcp/tools/create-reminder.js +8 -8
  290. package/dist/mcp/tools/create-task.js +26 -28
  291. package/dist/mcp/tools/deactivate-behavior.js +11 -11
  292. package/dist/mcp/tools/list-reminders.js +8 -8
  293. package/dist/mcp/tools/list-tasks.js +27 -28
  294. package/dist/mcp/tools/send-message.js +26 -26
  295. package/dist/mcp/tools/update-task.js +25 -27
  296. package/dist/{mcp-diagnostics-OOZ3TDPY.js → mcp-diagnostics-CWMVPHVC.js} +1 -1
  297. package/dist/{mcp-disconnect-tracker-I5WJ4LQ5.js → mcp-disconnect-tracker-RM3GEERR.js} +1 -1
  298. package/dist/{mcp-http-config-GLSLF2OL.js → mcp-http-config-PDGSOYNQ.js} +7 -7
  299. package/dist/{memory-cards-PCZ2KWMN.js → memory-cards-OLE6MGO7.js} +7 -9
  300. package/dist/{memory-poisoning-defense-JY4NU3AY.js → memory-poisoning-defense-OOHJIXIX.js} +7 -9
  301. package/dist/{memory-queue-7N7ZEY2K.js → memory-queue-TGWXMENR.js} +4 -4
  302. package/dist/memory-queue-client-RZP5F4EA.js +15 -0
  303. package/dist/{memory-reflection-IVHZRUQQ.js → memory-reflection-Z7CT6JLY.js} +7 -9
  304. package/dist/{message-queue-client-3RWYNZIR.js → message-queue-client-TWIA2GIH.js} +1 -1
  305. package/dist/notifications-SREXGSAQ.js +42 -0
  306. package/dist/{oauth-server-S45RTRRF.js → oauth-server-NSWGKLLA.js} +1 -1
  307. package/dist/{orchestration-phase-NTQZNPAZ.js → orchestration-phase-WLQMEP4M.js} +4 -4
  308. package/dist/orchestrator-CHQURQSC.js +30 -0
  309. package/dist/{permission-presets-WI524OSE.js → permission-presets-3XKJNM6N.js} +1 -1
  310. package/dist/{permissions-TYT6YMNZ.js → permissions-EZH3ULLD.js} +1 -1
  311. package/dist/{pg-ssl-KFHNJPGO.js → pg-ssl-4ZNXKUNH.js} +1 -1
  312. package/dist/plan-limits-7L75PB33.js +25 -0
  313. package/dist/{preferences-5YRRHGXS.js → preferences-K2GKUQSJ.js} +3 -3
  314. package/dist/project-name-OBIDABHE.js +10 -0
  315. package/dist/{projection-worker-YIJ7Q66A.js → projection-worker-HSGE44JA.js} +5 -5
  316. package/dist/push-notifications-EOTMKJ6B.js +15 -0
  317. package/dist/{reranker-2BSQ2V5M.js → reranker-ME4CK2ZQ.js} +4 -4
  318. package/dist/{review-gate-E6K7QQE5.js → review-gate-M3U2YAW6.js} +1 -1
  319. package/dist/review-polling-DQCN4TNM.js +121 -0
  320. package/dist/runtime/index.js +26 -26
  321. package/dist/{self-query-router-IZANO632.js → self-query-router-TRPHL54X.js} +50 -2
  322. package/dist/session-events-ZZBFYL5Z.js +34 -0
  323. package/dist/{session-kill-telemetry-2IB6IQSS.js → session-kill-telemetry-MUFET632.js} +7 -9
  324. package/dist/{chunk-YPQMQWA2.js → session-scope-QUUDZM2L.js} +27 -32
  325. package/dist/setup-wizard-NXWCEK63.js +12 -0
  326. package/dist/{shard-manager-IIII7AAS.js → shard-manager-VYMJM7NR.js} +4 -4
  327. package/dist/{signal-XN2C7PIG.js → signal-C263RUND.js} +1 -1
  328. package/dist/{slack-Z77TFJCK.js → slack-N7PL6QMX.js} +1 -1
  329. package/dist/{task-enforcement-VDCQ5H3H.js → task-enforcement-WJ3S6JTL.js} +23 -27
  330. package/dist/{task-scanner-IMIR3T7T.js → task-scanner-YHWRG4ZJ.js} +1 -1
  331. package/dist/task-scope-V2CTRHG7.js +32 -0
  332. package/dist/tasks-crud-W2XPUGKK.js +54 -0
  333. package/dist/tasks-review-BR2SBSYG.js +44 -0
  334. package/dist/{telegram-CRPZO7JT.js → telegram-B54FFOXD.js} +1 -1
  335. package/dist/{telemetry-SPVGPKU7.js → telemetry-7IQCPV4Q.js} +1 -1
  336. package/dist/{token-budget-VX5ZTLAG.js → token-budget-H2XSWO4D.js} +7 -9
  337. package/dist/{tool-capability-index-JBS2FDIG.js → tool-capability-index-5X2CCGIK.js} +3 -3
  338. package/dist/{tool-gates-FSNGZNXW.js → tool-gates-3DNTD7G3.js} +1 -1
  339. package/dist/{tool-gates-P6HATVYH.js → tool-gates-SGFMDREY.js} +1 -1
  340. package/dist/{tool-registry-436LVVLY.js → tool-registry-2VUAZXTW.js} +1 -1
  341. package/dist/{tool-telemetry-ASYRVRIY.js → tool-telemetry-NVPSPRYP.js} +2 -2
  342. package/dist/tui/App.js +75 -87
  343. package/dist/{tui-data-UHFRO64P.js → tui-data-QN4O565C.js} +24 -28
  344. package/dist/{update-check-LZGZISRJ.js → update-check-ERUKV2G6.js} +1 -1
  345. package/dist/{webhook-VVP7KQVC.js → webhook-L5FGAUPJ.js} +1 -1
  346. package/dist/{webhook-pipe-B6Z2QMRY.js → webhook-pipe-B7GJCJAI.js} +1 -1
  347. package/dist/{whatsapp-4IDUW46W.js → whatsapp-7FK2PRWO.js} +1 -1
  348. package/dist/{whatsapp-accounts-RTJF3LM6.js → whatsapp-accounts-VIHRSLGB.js} +1 -1
  349. package/dist/{wiki-acl-OSBQJD2E.js → wiki-acl-R4IIHICT.js} +1 -1
  350. package/dist/{wiki-client-TDZ74RHN.js → wiki-client-EUDJA7O2.js} +1 -1
  351. package/dist/{worker-gate-CVWHVSX3.js → worker-gate-3KDXLIJC.js} +6 -4
  352. package/dist/{workflow-engine-2XZK77ZX.js → workflow-engine-GISKRYSO.js} +3 -3
  353. package/dist/{worktree-O2DKCB33.js → worktree-B3FHAHEM.js} +2 -4
  354. package/package.json +4 -3
  355. package/release-notes.json +146 -146
  356. package/src/commands/exe/intercom.md +19 -3
  357. package/stack.release.json +8 -8
  358. package/dist/agent-context-CDWUZEXY.js +0 -11
  359. package/dist/behaviors-A4W3CBE5.js +0 -22
  360. package/dist/capacity-monitor-7VX6NW5J.js +0 -48
  361. package/dist/chunk-4NYQAS33.js +0 -17
  362. package/dist/chunk-57HCNSFO.js +0 -39
  363. package/dist/chunk-ELE2C7L4.js +0 -31
  364. package/dist/chunk-GGTUUI7J.js +0 -6
  365. package/dist/chunk-JT76KRZQ.js +0 -35
  366. package/dist/chunk-MBRLA4E3.js +0 -119
  367. package/dist/chunk-WZQ4CPRG.js +0 -64
  368. package/dist/content-extractor-UVZXRIPC.js +0 -8
  369. package/dist/daemon-auth-5WZWXJWL.js +0 -15
  370. package/dist/fast-db-init-TLDOE64G.js +0 -7
  371. package/dist/git-task-sweep-HELKXKNQ.js +0 -37
  372. package/dist/global-procedures-4BN6BD4N.js +0 -19
  373. package/dist/imessage-L7WKA2WD.js +0 -7
  374. package/dist/license-gate-PAW5WWP6.js +0 -14
  375. package/dist/memory-queue-client-W63JO34U.js +0 -14
  376. package/dist/notifications-FCTKUQAU.js +0 -44
  377. package/dist/orchestrator-VQL47YQP.js +0 -30
  378. package/dist/plan-limits-TK4424RV.js +0 -27
  379. package/dist/project-name-7G6XPXQ6.js +0 -12
  380. package/dist/push-notifications-66EQCPHZ.js +0 -17
  381. package/dist/session-events-JZPK3UUM.js +0 -34
  382. package/dist/session-scope-QPBPO5XV.js +0 -36
  383. package/dist/setup-wizard-UFLDL2QP.js +0 -12
  384. package/dist/task-scope-YIPIPEVK.js +0 -34
  385. package/dist/tasks-crud-E4B3ORQX.js +0 -54
  386. package/dist/tasks-review-6Y7IB572.js +0 -46
  387. /package/dist/{chunk-GGFH5MTN.js → chunk-2HV2EQW2.js} +0 -0
  388. /package/dist/{chunk-V2UBYCSC.js → chunk-APRP5D27.js} +0 -0
  389. /package/dist/{chunk-E3ZIGQH4.js → chunk-D5MPHVWH.js} +0 -0
  390. /package/dist/{chunk-VKFBVBAN.js → chunk-F3ULERRZ.js} +0 -0
  391. /package/dist/{chunk-5OANXJSV.js → chunk-HIQ5RDA7.js} +0 -0
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  getCachedLicenseGate
3
- } from "./chunk-LXX2UDWL.js";
3
+ } from "./chunk-HV75RBMK.js";
4
4
  import {
5
5
  getToolUsageStats
6
- } from "./chunk-VKFBVBAN.js";
6
+ } from "./chunk-F3ULERRZ.js";
7
7
  import {
8
8
  AUTO_WAKE_MAX_RETRIES
9
- } from "./chunk-YRLMCI3J.js";
9
+ } from "./chunk-CDDRSIGK.js";
10
10
  import {
11
11
  getToolCapabilityIndex
12
- } from "./chunk-CO7XAJJ2.js";
12
+ } from "./chunk-AAVODJ4F.js";
13
13
  import {
14
14
  isRerankerAvailable,
15
15
  rerankWithScores
16
- } from "./chunk-TBO4RYRU.js";
16
+ } from "./chunk-5F3EXHT7.js";
17
17
  import {
18
18
  getEntityByName,
19
19
  getEntityNeighbors,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-E6ORBQHP.js";
29
29
  import {
30
30
  listRecentSessionEvents
31
- } from "./chunk-KX3KLDG7.js";
31
+ } from "./chunk-IPSFAUK5.js";
32
32
  import {
33
33
  analyzeBlastRadius,
34
34
  buildCodeContextIndex,
@@ -37,68 +37,66 @@ import {
37
37
  searchCodeContext,
38
38
  searchCodeContextSemantic,
39
39
  traceCodeSymbol
40
- } from "./chunk-EYRQWVPQ.js";
40
+ } from "./chunk-X7DJ2QZW.js";
41
41
  import {
42
42
  runDriftProbes
43
- } from "./chunk-EVP2WD5S.js";
43
+ } from "./chunk-JUITBJ7J.js";
44
44
  import {
45
45
  exportOrchestration,
46
46
  importOrchestration,
47
47
  validatePackage
48
- } from "./chunk-DUXNECD3.js";
48
+ } from "./chunk-65UQ7H5U.js";
49
49
  import {
50
50
  loadOrchestrationPhase,
51
51
  setOrchestrationPhase
52
- } from "./chunk-A46SAHYB.js";
52
+ } from "./chunk-MUVPQCQA.js";
53
53
  import {
54
- createOrRefreshResumeTask,
55
- init_capacity_monitor
56
- } from "./chunk-TLXIKKEG.js";
54
+ createOrRefreshResumeTask
55
+ } from "./chunk-I4WAKJ6W.js";
57
56
  import {
58
57
  registerCompleteReminder
59
- } from "./chunk-XMAP37LE.js";
58
+ } from "./chunk-NT6R4ATM.js";
60
59
  import {
61
60
  registerDeactivateBehavior
62
- } from "./chunk-TGR3H3DM.js";
61
+ } from "./chunk-SR6D65DA.js";
63
62
  import {
64
63
  registerSendMessage
65
- } from "./chunk-7YZJUTQ4.js";
64
+ } from "./chunk-56T5TMNK.js";
66
65
  import {
67
66
  registerCreateTask
68
- } from "./chunk-AV4RLRM2.js";
67
+ } from "./chunk-XQ2ZBOAD.js";
69
68
  import {
70
69
  registerListTasks
71
- } from "./chunk-C54PGWHV.js";
70
+ } from "./chunk-KQTGSD23.js";
72
71
  import {
73
72
  registerUpdateTask
74
- } from "./chunk-76R35J76.js";
73
+ } from "./chunk-XAHIVBTU.js";
75
74
  import {
76
75
  registerCreateReminder
77
- } from "./chunk-5JIVAJJU.js";
76
+ } from "./chunk-GK5VMHSN.js";
78
77
  import {
79
78
  registerListReminders
80
- } from "./chunk-VH2CK32C.js";
79
+ } from "./chunk-RWURKLS3.js";
81
80
  import {
82
81
  completeReminder,
83
82
  createReminder,
84
83
  listReminders
85
- } from "./chunk-VISRYICE.js";
84
+ } from "./chunk-7PTII6F4.js";
86
85
  import {
87
86
  status
88
- } from "./chunk-EHF676BW.js";
87
+ } from "./chunk-VXQDZH5T.js";
89
88
  import {
90
89
  TOKENS_PER_IDLE_MINUTE,
91
90
  countKillsSince,
92
- init_session_kill_telemetry,
93
91
  sumTokensSavedSince
94
- } from "./chunk-AYUYBWGD.js";
92
+ } from "./chunk-NE6RPW5C.js";
95
93
  import {
96
94
  getAgentSpend
97
- } from "./chunk-3RT5V3M4.js";
95
+ } from "./chunk-7KR5PV4P.js";
98
96
  import {
99
97
  createSchedule,
100
98
  parseHumanCron
101
- } from "./chunk-ZK3WQY7Q.js";
99
+ } from "./chunk-BHV7PX5V.js";
102
100
  import {
103
101
  exportGraphHTML,
104
102
  generateGraphReport
@@ -106,90 +104,86 @@ import {
106
104
  import {
107
105
  entityId,
108
106
  mergeEntities
109
- } from "./chunk-QUPRWJKI.js";
107
+ } from "./chunk-WLEVAIL5.js";
110
108
  import {
111
109
  formatReport,
112
110
  runAudit
113
- } from "./chunk-SRQXDGUO.js";
111
+ } from "./chunk-OYCQ6PFC.js";
114
112
  import {
115
113
  runHealthCheck
116
- } from "./chunk-NCVFW4JS.js";
114
+ } from "./chunk-O7CTVDC3.js";
117
115
  import {
118
116
  hasFailures,
119
117
  runHealth,
120
118
  runTest
121
- } from "./chunk-IUQL3KZV.js";
119
+ } from "./chunk-K3PSCQLK.js";
122
120
  import {
123
121
  findSimilarTrajectories,
124
- hashSignature,
125
- init_skill_learning
126
- } from "./chunk-CNNT4QSN.js";
122
+ hashSignature
123
+ } from "./chunk-K6MMN6AW.js";
127
124
  import {
128
125
  deactivateBehavior,
129
- init_behaviors,
130
126
  listBehaviorsByDomain,
127
+ listSharedSkills,
131
128
  storeBehavior
132
- } from "./chunk-BNH4LWKE.js";
129
+ } from "./chunk-RWJY7KMP.js";
133
130
  import {
134
131
  countUnconsolidated,
135
132
  groupMemories,
136
133
  runConsolidation,
137
134
  selectUnconsolidated
138
- } from "./chunk-SI5TLMB6.js";
135
+ } from "./chunk-C4EVFN7J.js";
139
136
  import {
140
137
  renderClientCOOTemplate
141
- } from "./chunk-ZCYQZQTA.js";
138
+ } from "./chunk-53VUIKOE.js";
142
139
  import {
143
140
  deactivateGlobalProcedure,
144
141
  loadGlobalProcedures,
145
142
  storeGlobalProcedure
146
- } from "./chunk-52LCN4JK.js";
143
+ } from "./chunk-ER3UJ2VL.js";
147
144
  import {
148
145
  PLATFORM_PROCEDURES
149
- } from "./chunk-WZDI6UJ6.js";
146
+ } from "./chunk-MPXPPKJ4.js";
150
147
  import {
151
148
  clearCloudReuploadRequired,
152
149
  cloudSync,
153
150
  getCloudReuploadRequired,
154
151
  markCloudReuploadRequired
155
- } from "./chunk-ROTT6N5K.js";
152
+ } from "./chunk-UXDQ4ERA.js";
156
153
  import {
157
- crypto_exports,
158
- init_crypto
159
- } from "./chunk-HJMM4QMY.js";
154
+ encryptSyncBlob,
155
+ isSyncCryptoInitialized
156
+ } from "./chunk-HOKOOBDL.js";
160
157
  import {
161
158
  createARecord
162
159
  } from "./chunk-X2Z5GT3V.js";
163
160
  import {
164
- embed,
165
- init_embedder
166
- } from "./chunk-T2WBLUN7.js";
161
+ embed
162
+ } from "./chunk-BY4OTURZ.js";
167
163
  import {
168
164
  readMcpHttpEvents,
169
165
  summarizeMcpTransport,
170
166
  writeMcpTransportSummary
171
- } from "./chunk-HHKKLWAI.js";
167
+ } from "./chunk-DCJ42FEN.js";
172
168
  import {
173
- init_tasks,
174
169
  updateTask
175
- } from "./chunk-47MZMRQZ.js";
170
+ } from "./chunk-AJ2XDY27.js";
176
171
  import {
177
172
  fastDbInit
178
- } from "./chunk-TDIUACZ6.js";
173
+ } from "./chunk-UVH6FA5E.js";
179
174
  import {
180
175
  MAX_CONCURRENT_WORKERS
181
- } from "./chunk-3XUWTXNC.js";
176
+ } from "./chunk-QSSABSCM.js";
182
177
  import {
183
- getProjectName,
184
- init_project_name
185
- } from "./chunk-TOR5ZPKF.js";
178
+ getProjectName
179
+ } from "./chunk-OPU3NYOO.js";
186
180
  import {
187
181
  hybridSearch,
188
182
  recentRecords
189
- } from "./chunk-EZY3BNIW.js";
183
+ } from "./chunk-NQAZ2CP7.js";
190
184
  import {
191
185
  getActiveAgent
192
- } from "./chunk-HLYXFVVT.js";
186
+ } from "./chunk-BXCJOACQ.js";
193
187
  import {
194
188
  attachDocumentMetadata,
195
189
  flushBatch,
@@ -197,43 +191,35 @@ import {
197
191
  reserveVersions,
198
192
  vectorToBlob,
199
193
  writeMemory
200
- } from "./chunk-MI4RRRX5.js";
194
+ } from "./chunk-7APRWURX.js";
201
195
  import {
202
- init_task_scope,
203
- init_tasks_crud,
204
- init_tmux_routing,
196
+ getMySession,
205
197
  resolveExeSession,
206
198
  resolveTask,
207
199
  sessionScopeFilter,
208
- strictSessionScopeFilter,
209
- tmux_routing_exports,
210
200
  updateTaskStatus,
211
201
  writeCheckpoint
212
- } from "./chunk-V3YNF3JK.js";
202
+ } from "./chunk-H4YONWQX.js";
213
203
  import {
214
- init_session_registry,
215
204
  listSessions
216
- } from "./chunk-KRLOFIPI.js";
205
+ } from "./chunk-64WZEXXA.js";
217
206
  import {
218
207
  DEFAULT_MODELS,
219
208
  KNOWN_RUNTIMES,
220
209
  RUNTIME_LABELS,
221
210
  getAgentRuntime,
222
- init_agent_config,
223
211
  loadAgentConfig,
224
212
  setAgentRuntime
225
- } from "./chunk-VTQRACP7.js";
213
+ } from "./chunk-G3VR3MJI.js";
226
214
  import {
227
- DEFAULT_RUNTIME,
228
- init_runtime_table
229
- } from "./chunk-JT76KRZQ.js";
215
+ DEFAULT_RUNTIME
216
+ } from "./chunk-NGP6LSV2.js";
230
217
  import {
231
218
  PlanLimitError,
232
219
  assertEmployeeLimit,
233
220
  assertFeature,
234
- assertMemoryLimit,
235
- init_plan_limits
236
- } from "./chunk-67WOKLTZ.js";
221
+ assertMemoryLimit
222
+ } from "./chunk-XEA6DSLR.js";
237
223
  import {
238
224
  getAccountByName,
239
225
  getDefaultAccount
@@ -241,22 +227,21 @@ import {
241
227
  import {
242
228
  createNewTrigger,
243
229
  isScheduledTrigger,
244
- loadTriggers
245
- } from "./chunk-QBLI377G.js";
230
+ loadTriggers,
231
+ sanitizeParam
232
+ } from "./chunk-WJW564IP.js";
246
233
  import {
247
234
  pushConversationToCRM
248
235
  } from "./chunk-GCNWCYJI.js";
249
236
  import {
250
237
  EMPLOYEES_PATH,
251
238
  addEmployee,
239
+ baseAgentName,
252
240
  canCoordinate,
253
- employees_exports,
241
+ canManage,
254
242
  getClient,
255
243
  getEmployee,
256
244
  getIdentity,
257
- init_database,
258
- init_employees,
259
- init_identity,
260
245
  isCoordinatorName,
261
246
  isCoordinatorRole,
262
247
  listIdentities,
@@ -264,32 +249,28 @@ import {
264
249
  loadEmployeesSync,
265
250
  saveEmployees,
266
251
  updateIdentity
267
- } from "./chunk-WLW7QV2C.js";
252
+ } from "./chunk-NA3MXUU6.js";
268
253
  import {
269
254
  getMasterKey
270
- } from "./chunk-YGHMRSH5.js";
255
+ } from "./chunk-6D23UNXU.js";
271
256
  import {
272
257
  checkForUpdate
273
258
  } from "./chunk-MZIGUUDQ.js";
274
259
  import {
275
260
  PLAN_LIMITS,
276
261
  checkLicense,
277
- init_license,
278
262
  isFeatureAllowed,
279
263
  loadDeviceId,
280
264
  loadLicense,
281
265
  readCachedLicenseToken,
282
266
  saveLicense,
283
267
  validateLicense
284
- } from "./chunk-AFEXRICE.js";
268
+ } from "./chunk-I5VJNTDL.js";
285
269
  import {
286
270
  EXE_AI_DIR,
287
271
  init_config,
288
272
  loadConfig
289
- } from "./chunk-QASVYG2B.js";
290
- import {
291
- __toCommonJS
292
- } from "./chunk-KFQGP6VL.js";
273
+ } from "./chunk-KHV55ME4.js";
293
274
 
294
275
  // src/mcp/tools/memory.ts
295
276
  import { z as z10 } from "zod";
@@ -399,7 +380,7 @@ function registerRecallMyMemory(server) {
399
380
  include_source: z.boolean().optional().default(false).describe(
400
381
  "When true, attach parent document metadata (filename, mime, source_type) to each result. Default false."
401
382
  ),
402
- retrieval_mode: z.enum(RETRIEVAL_MODES).optional().default("all").describe(`Typed retrieval mode. ${formatRetrievalModes()}`),
383
+ retrieval_mode: z.enum(RETRIEVAL_MODES).optional().default("no_raw").describe(`Typed retrieval mode. ${formatRetrievalModes()}`),
403
384
  kind: z.string().optional().describe(
404
385
  "Filter by memory_type: decision, procedure, observation, raw, conversation, behavior."
405
386
  ),
@@ -504,7 +485,6 @@ ${formatted}`
504
485
 
505
486
  // src/mcp/tools/ask-team-memory.ts
506
487
  import { z as z2 } from "zod";
507
- init_employees();
508
488
  function formatMemoryBody2(rawText, maxChars) {
509
489
  if (rawText.length <= maxChars) return rawText;
510
490
  const marker = ` \u2026 [truncated; +${rawText.length - maxChars} chars \u2014 re-call with max_chars up to 20000 for more]`;
@@ -604,12 +584,10 @@ ${formatted}`
604
584
  }
605
585
 
606
586
  // src/mcp/tools/store-memory.ts
607
- init_embedder();
608
587
  import { z as z3 } from "zod";
609
588
  import crypto from "crypto";
610
589
  import { writeFileSync } from "fs";
611
590
  import path from "path";
612
- init_plan_limits();
613
591
  function registerStoreMemory(server) {
614
592
  server.registerTool(
615
593
  "store_memory",
@@ -699,13 +677,10 @@ function registerStoreMemory(server) {
699
677
  }
700
678
 
701
679
  // src/mcp/tools/commit-memory.ts
702
- init_embedder();
703
680
  import { z as z4 } from "zod";
704
681
  import crypto2 from "crypto";
705
682
  import { writeFileSync as writeFileSync2 } from "fs";
706
683
  import path2 from "path";
707
- init_plan_limits();
708
- init_employees();
709
684
  function registerCommitMemory(server) {
710
685
  server.registerTool(
711
686
  "commit_to_long_term_memory",
@@ -880,7 +855,7 @@ async function searchConversations(query, limit) {
880
855
  }
881
856
  async function searchWiki(query, limit) {
882
857
  try {
883
- const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-TDZ74RHN.js");
858
+ const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-EUDJA7O2.js");
884
859
  const client = await createWikiClient();
885
860
  if (!client) return [];
886
861
  const workspaces = await listWorkspaces(client);
@@ -1043,7 +1018,6 @@ ${formatted.join("\n\n---\n\n")}`
1043
1018
  }
1044
1019
 
1045
1020
  // src/mcp/tools/get-session-context.ts
1046
- init_database();
1047
1021
  import { z as z6 } from "zod";
1048
1022
  function formatMemoryBody3(rawText, maxChars) {
1049
1023
  if (rawText.length <= maxChars) return rawText;
@@ -1134,7 +1108,6 @@ ${formatted}`
1134
1108
  }
1135
1109
 
1136
1110
  // src/mcp/tools/get-memory-by-id.ts
1137
- init_database();
1138
1111
  import { z as z7 } from "zod";
1139
1112
  function asString(value) {
1140
1113
  return value == null ? "" : String(value);
@@ -1206,7 +1179,6 @@ ${asString(row.raw_text)}`
1206
1179
  }
1207
1180
 
1208
1181
  // src/mcp/tools/consolidate-memories.ts
1209
- init_database();
1210
1182
  import { z as z8 } from "zod";
1211
1183
  function registerConsolidateMemories(server) {
1212
1184
  server.registerTool(
@@ -1269,7 +1241,6 @@ Consolidated summaries stored as tier-1 (importance=9) memories.`
1269
1241
  }
1270
1242
 
1271
1243
  // src/mcp/tools/get-memory-cardinality.ts
1272
- init_database();
1273
1244
  import { z as z9 } from "zod";
1274
1245
  function registerGetMemoryCardinality(server) {
1275
1246
  server.registerTool(
@@ -1425,7 +1396,7 @@ async function handleSupersede(input) {
1425
1396
  }
1426
1397
  try {
1427
1398
  const { getClient: getClient2 } = await import("./lib/database.js");
1428
- const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-NVYSMA2V.js");
1399
+ const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-GJOJUEMF.js");
1429
1400
  const { writeMemory: writeMemory2, flushBatch: flushBatch2 } = await import("./lib/store.js");
1430
1401
  const { randomUUID: randomUUID2 } = await import("crypto");
1431
1402
  const client = getClient2();
@@ -1443,7 +1414,7 @@ async function handleSupersede(input) {
1443
1414
  });
1444
1415
  const { agentId, agentRole } = getActiveAgent2();
1445
1416
  const sessionId = process.env.SESSION_ID ?? "manual";
1446
- const { getProjectName: getProjectName2 } = await import("./project-name-7G6XPXQ6.js");
1417
+ const { getProjectName: getProjectName2 } = await import("./project-name-OBIDABHE.js");
1447
1418
  const projectName = input.project_name ?? getProjectName2();
1448
1419
  const newId = randomUUID2();
1449
1420
  await writeMemory2({
@@ -1534,9 +1505,9 @@ function registerMemory(server) {
1534
1505
  return handleSupersede(input);
1535
1506
  }
1536
1507
  if (action === "core_get" || action === "core_set" || action === "core_delete") {
1537
- const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-NVYSMA2V.js");
1508
+ const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-GJOJUEMF.js");
1538
1509
  const { agentId } = getActiveAgent2();
1539
- const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-N2SN7CF5.js");
1510
+ const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-JZ34WT5R.js");
1540
1511
  if (action === "core_get") {
1541
1512
  const entries = await getCoreMemory(agentId);
1542
1513
  const block = formatCoreMemoryBlock(entries);
@@ -1566,7 +1537,7 @@ function registerMemory(server) {
1566
1537
  legacyArgs.limit ??= 10;
1567
1538
  legacyArgs.include_archived ??= false;
1568
1539
  legacyArgs.include_source ??= false;
1569
- legacyArgs.retrieval_mode ??= "all";
1540
+ legacyArgs.retrieval_mode ??= "no_raw";
1570
1541
  if (!legacyArgs.recent && !legacyArgs.query) {
1571
1542
  return errorResult('memory action "recall" requires query unless recent=true');
1572
1543
  }
@@ -1575,7 +1546,7 @@ function registerMemory(server) {
1575
1546
  legacyArgs.limit ??= 10;
1576
1547
  legacyArgs.include_archived ??= false;
1577
1548
  legacyArgs.include_raw ??= false;
1578
- legacyArgs.retrieval_mode ??= "all";
1549
+ legacyArgs.retrieval_mode ??= "no_raw";
1579
1550
  }
1580
1551
  if (action === "store") {
1581
1552
  legacyArgs.tool_name ??= "manual";
@@ -1603,7 +1574,6 @@ function registerMemory(server) {
1603
1574
  }
1604
1575
 
1605
1576
  // src/mcp/tools/query-relationships.ts
1606
- init_database();
1607
1577
  import { z as z11 } from "zod";
1608
1578
  function registerQueryRelationships(server) {
1609
1579
  server.registerTool(
@@ -1716,13 +1686,9 @@ ${typeBreakdown}`
1716
1686
  }
1717
1687
 
1718
1688
  // src/mcp/tools/task.ts
1719
- import { z as z16 } from "zod";
1689
+ import { z as z17 } from "zod";
1720
1690
 
1721
1691
  // src/mcp/tools/get-task.ts
1722
- init_tasks();
1723
- init_database();
1724
- init_task_scope();
1725
- init_employees();
1726
1692
  import { z as z12 } from "zod";
1727
1693
  async function diagnoseMissingTask(client, identifier) {
1728
1694
  const shortUuid = /^[a-f0-9]{7,12}$/i.test(identifier);
@@ -1880,10 +1846,7 @@ function registerGetTask(server) {
1880
1846
  }
1881
1847
 
1882
1848
  // src/mcp/tools/close-task.ts
1883
- init_tasks();
1884
1849
  import { z as z13 } from "zod";
1885
- init_tmux_routing();
1886
- init_employees();
1887
1850
  var CLOSE_TASK_ALLOWED_ROLES = /* @__PURE__ */ new Set(["CTO"]);
1888
1851
  function registerCloseTask(server) {
1889
1852
  server.registerTool(
@@ -2010,27 +1973,38 @@ File: ${task.taskFile}`;
2010
1973
  try {
2011
1974
  const { isMultiInstance } = await import("./lib/employees.js");
2012
1975
  if (isMultiInstance(assignee)) {
2013
- const { resolveExeSession: resolveExeSession2, employeeSessionName, ensureEmployee } = await import("./lib/tmux-routing.js");
2014
- const exeSession = resolveExeSession2();
2015
- if (exeSession) {
2016
- const oldSession = employeeSessionName(assignee, exeSession);
2017
- const { execSync } = await import("child_process");
2018
- try {
2019
- execSync(`tmux kill-session -t ${oldSession} 2>/dev/null`, { timeout: 3e3 });
2020
- } catch {
2021
- }
2022
- const baseName = assignee.replace(/\d+$/, "") || assignee;
1976
+ respawnNote = `
1977
+
1978
+ \u{1F504} Auto-respawn: ${assignee} has ${count} more task(s). Respawn scheduled (deferred to avoid MCP disruption).`;
1979
+ const _assignee = assignee;
1980
+ const _baseDir = baseDir;
1981
+ setTimeout(async () => {
2023
1982
  try {
2024
- execSync(`git worktree remove .worktrees/${baseName} --force 2>/dev/null`, { timeout: 5e3, cwd: baseDir });
2025
- process.stderr.write(`[close-task] Pruned worktree .worktrees/${baseName}
1983
+ const { resolveExeSession: resolveExeSession2, employeeSessionName, ensureEmployee } = await import("./lib/tmux-routing.js");
1984
+ const { shouldAutoInstance } = await import("./lib/employees.js");
1985
+ const exeSession = resolveExeSession2();
1986
+ if (!exeSession) return;
1987
+ const oldSession = employeeSessionName(_assignee, exeSession);
1988
+ const { execSync } = await import("child_process");
1989
+ try {
1990
+ execSync(`tmux kill-session -t ${oldSession} 2>/dev/null`, { timeout: 3e3 });
1991
+ } catch {
1992
+ }
1993
+ const baseName = _assignee.replace(/\d+$/, "") || _assignee;
1994
+ try {
1995
+ execSync(`git worktree remove .worktrees/${baseName} --force 2>/dev/null`, { timeout: 5e3, cwd: _baseDir });
1996
+ process.stderr.write(`[close-task] Pruned worktree .worktrees/${baseName}
1997
+ `);
1998
+ } catch {
1999
+ }
2000
+ const result4 = ensureEmployee(_assignee, exeSession, _baseDir, shouldAutoInstance(_assignee));
2001
+ process.stderr.write(`[close-task] Deferred respawn complete: ${result4.sessionName ?? "fresh instance"}
2002
+ `);
2003
+ } catch (e) {
2004
+ process.stderr.write(`[close-task] Deferred respawn failed: ${e instanceof Error ? e.message : String(e)}
2026
2005
  `);
2027
- } catch {
2028
2006
  }
2029
- const result4 = ensureEmployee(assignee, exeSession, baseDir, { autoInstance: true });
2030
- respawnNote = `
2031
-
2032
- \u{1F504} Auto-respawn: ${assignee} has ${count} more task(s). Killed old session, spawned ${result4.sessionName ?? "fresh instance"} with clean worktree.`;
2033
- }
2007
+ }, 500);
2034
2008
  }
2035
2009
  } catch {
2036
2010
  }
@@ -2068,7 +2042,6 @@ All tasks complete. No more open tasks in your queue.`;
2068
2042
  }
2069
2043
 
2070
2044
  // src/mcp/tools/checkpoint-task.ts
2071
- init_tasks();
2072
2045
  import { z as z14 } from "zod";
2073
2046
  function registerCheckpointTask(server) {
2074
2047
  server.registerTool(
@@ -2103,10 +2076,6 @@ function registerCheckpointTask(server) {
2103
2076
  }
2104
2077
 
2105
2078
  // src/mcp/tools/resume-employee.ts
2106
- init_capacity_monitor();
2107
- init_database();
2108
- init_task_scope();
2109
- init_tasks_crud();
2110
2079
  import { z as z15 } from "zod";
2111
2080
  var RESUME_CONTEXT_TASK_LIMIT = 10;
2112
2081
  function registerResumeEmployee(server) {
@@ -2144,7 +2113,7 @@ function registerResumeEmployee(server) {
2144
2113
  };
2145
2114
  }
2146
2115
  try {
2147
- const { isTmuxSessionAlive } = await import("./tasks-crud-E4B3ORQX.js");
2116
+ const { isTmuxSessionAlive } = await import("./tasks-crud-W2XPUGKK.js");
2148
2117
  const now = (/* @__PURE__ */ new Date()).toISOString();
2149
2118
  for (const row of openTasks.rows) {
2150
2119
  const status2 = String(row.status);
@@ -2180,10 +2149,8 @@ function registerResumeEmployee(server) {
2180
2149
  const { ensureEmployee, resolveExeSession: resolveExeSession2 } = await import("./lib/tmux-routing.js");
2181
2150
  const exeSession = resolveExeSession2();
2182
2151
  if (!exeSession) throw new Error("No coordinator session found");
2183
- const { isMultiInstance } = await import("./lib/employees.js");
2184
- const result3 = ensureEmployee(agent_id, exeSession, process.cwd(), {
2185
- autoInstance: isMultiInstance(agent_id)
2186
- });
2152
+ const { shouldAutoInstance } = await import("./lib/employees.js");
2153
+ const result3 = ensureEmployee(agent_id, exeSession, process.cwd(), shouldAutoInstance(agent_id));
2187
2154
  switch (result3.status) {
2188
2155
  case "intercom_sent":
2189
2156
  dispatchStatus = `
@@ -2216,6 +2183,175 @@ Open tasks surfaced: ${openTasks.rows.length}${dispatchStatus}`;
2216
2183
  );
2217
2184
  }
2218
2185
 
2186
+ // src/mcp/tools/dependency-tree.ts
2187
+ import { z as z16 } from "zod";
2188
+ async function queryDependencyTasks() {
2189
+ const client = getClient();
2190
+ const scope = sessionScopeFilter();
2191
+ const result3 = await client.execute({
2192
+ sql: `SELECT id, title, status, priority, assigned_to, blocked_by, parent_task_id
2193
+ FROM tasks
2194
+ WHERE (blocked_by IS NOT NULL OR id IN (SELECT blocked_by FROM tasks WHERE blocked_by IS NOT NULL))
2195
+ ${scope.sql}
2196
+ ORDER BY priority ASC, created_at DESC
2197
+ LIMIT 5000`,
2198
+ args: [...scope.args]
2199
+ });
2200
+ return result3.rows.map((r) => ({
2201
+ id: String(r.id),
2202
+ title: String(r.title),
2203
+ status: String(r.status),
2204
+ priority: String(r.priority),
2205
+ assignedTo: String(r.assigned_to),
2206
+ blockedBy: r.blocked_by !== null && r.blocked_by !== void 0 ? String(r.blocked_by) : null,
2207
+ parentTaskId: r.parent_task_id !== null && r.parent_task_id !== void 0 ? String(r.parent_task_id) : null
2208
+ }));
2209
+ }
2210
+ function buildAdjacencyList(tasks) {
2211
+ const adj = /* @__PURE__ */ new Map();
2212
+ for (const task of tasks) {
2213
+ if (task.blockedBy) {
2214
+ const children = adj.get(task.blockedBy) ?? [];
2215
+ children.push(task);
2216
+ adj.set(task.blockedBy, children);
2217
+ }
2218
+ }
2219
+ return adj;
2220
+ }
2221
+ function findRoots(tasks, adj) {
2222
+ const taskMap = new Map(tasks.map((t) => [t.id, t]));
2223
+ const blockerIds = new Set(adj.keys());
2224
+ const rootIds = /* @__PURE__ */ new Set();
2225
+ for (const id of blockerIds) {
2226
+ const task = taskMap.get(id);
2227
+ if (task && !task.blockedBy) {
2228
+ rootIds.add(id);
2229
+ }
2230
+ }
2231
+ for (const task of tasks) {
2232
+ if (task.blockedBy && !taskMap.has(task.blockedBy) && !rootIds.has(task.id)) {
2233
+ rootIds.add(task.id);
2234
+ }
2235
+ }
2236
+ return [...rootIds].map((id) => taskMap.get(id)).filter(Boolean);
2237
+ }
2238
+ function renderTree(task, adj, taskMap, prefix, isLast, visited) {
2239
+ if (visited.has(task.id)) {
2240
+ return [`${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}[CYCLE] ${task.title} (${task.id.slice(0, 8)})`];
2241
+ }
2242
+ visited.add(task.id);
2243
+ const shortId = task.id.slice(0, 8);
2244
+ const line = `${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}[${task.priority.toUpperCase()}] ${task.title} (${task.status}) \u2192 ${task.assignedTo} [${shortId}]`;
2245
+ const lines = [line];
2246
+ const children = adj.get(task.id) ?? [];
2247
+ const childPrefix = prefix + (isLast ? " " : "\u2502 ");
2248
+ for (let i = 0; i < children.length; i++) {
2249
+ const child = children[i];
2250
+ const childIsLast = i === children.length - 1;
2251
+ lines.push(...renderTree(child, adj, taskMap, childPrefix, childIsLast, visited));
2252
+ }
2253
+ return lines;
2254
+ }
2255
+ function findDeadBlockers(tasks) {
2256
+ const taskMap = new Map(tasks.map((t) => [t.id, t]));
2257
+ const deadBlockers = [];
2258
+ for (const task of tasks) {
2259
+ if (task.blockedBy && task.status === "blocked") {
2260
+ const blocker = taskMap.get(task.blockedBy);
2261
+ if (blocker && (blocker.status === "done" || blocker.status === "closed" || blocker.status === "cancelled")) {
2262
+ deadBlockers.push({ blocked: task, blocker });
2263
+ }
2264
+ }
2265
+ }
2266
+ return deadBlockers;
2267
+ }
2268
+ function renderSingleTree(rootTask, adj, taskMap) {
2269
+ const visited = /* @__PURE__ */ new Set();
2270
+ const rootLine = `[${rootTask.priority.toUpperCase()}] ${rootTask.title} (${rootTask.status}) \u2192 ${rootTask.assignedTo} [${rootTask.id.slice(0, 8)}]`;
2271
+ const lines = [rootLine];
2272
+ const children = adj.get(rootTask.id) ?? [];
2273
+ for (let i = 0; i < children.length; i++) {
2274
+ const child = children[i];
2275
+ const isLast = i === children.length - 1;
2276
+ visited.add(rootTask.id);
2277
+ lines.push(...renderTree(child, adj, taskMap, "", isLast, visited));
2278
+ }
2279
+ return lines;
2280
+ }
2281
+ function registerDependencyTree(server) {
2282
+ server.registerTool(
2283
+ "dependency_tree",
2284
+ {
2285
+ title: "Task Dependency Tree",
2286
+ description: "Visualize task dependency graph from blocked_by relationships. Shows tree view of task chains. Flags dead blockers (blocker done but blocked task not unblocked). Pass task_id to see tree rooted at one task, or omit for all trees.",
2287
+ inputSchema: {
2288
+ task_id: z16.string().optional().describe("Root task ID to show tree for. Omit for all dependency trees.")
2289
+ }
2290
+ },
2291
+ async ({ task_id }) => {
2292
+ try {
2293
+ const tasks = await queryDependencyTasks();
2294
+ if (tasks.length === 0) {
2295
+ return {
2296
+ content: [{ type: "text", text: "No task dependencies found." }]
2297
+ };
2298
+ }
2299
+ const taskMap = new Map(tasks.map((t) => [t.id, t]));
2300
+ const adj = buildAdjacencyList(tasks);
2301
+ const output = [];
2302
+ if (task_id) {
2303
+ const rootTask = taskMap.get(task_id);
2304
+ if (!rootTask) {
2305
+ const match = tasks.find((t) => t.id.startsWith(task_id) || t.title.toLowerCase().includes(task_id.toLowerCase()));
2306
+ if (!match) {
2307
+ return {
2308
+ content: [{ type: "text", text: `Task not found: ${task_id}` }],
2309
+ isError: true
2310
+ };
2311
+ }
2312
+ output.push("## Dependency Tree", "");
2313
+ output.push(...renderSingleTree(match, adj, taskMap));
2314
+ } else {
2315
+ output.push("## Dependency Tree", "");
2316
+ output.push(...renderSingleTree(rootTask, adj, taskMap));
2317
+ }
2318
+ } else {
2319
+ const roots = findRoots(tasks, adj);
2320
+ if (roots.length === 0) {
2321
+ return {
2322
+ content: [{ type: "text", text: "No dependency trees found (no root tasks)." }]
2323
+ };
2324
+ }
2325
+ output.push(`## Dependency Trees (${roots.length} root(s), ${tasks.length} task(s))`, "");
2326
+ for (const root of roots) {
2327
+ output.push(...renderSingleTree(root, adj, taskMap));
2328
+ output.push("");
2329
+ }
2330
+ }
2331
+ const deadBlockers = findDeadBlockers(tasks);
2332
+ if (deadBlockers.length > 0) {
2333
+ output.push("", "## Dead Blockers (blocker completed but blocked task not unblocked)", "");
2334
+ for (const { blocked, blocker } of deadBlockers) {
2335
+ output.push(
2336
+ `- [${blocked.priority.toUpperCase()}] ${blocked.title} (${blocked.status}) \u2192 ${blocked.assignedTo} [${blocked.id.slice(0, 8)}]`,
2337
+ ` Blocked by: ${blocker.title} (${blocker.status}) [${blocker.id.slice(0, 8)}]`
2338
+ );
2339
+ }
2340
+ }
2341
+ return {
2342
+ content: [{ type: "text", text: output.join("\n") }]
2343
+ };
2344
+ } catch (err) {
2345
+ const msg = err instanceof Error ? err.message : String(err);
2346
+ return {
2347
+ content: [{ type: "text", text: `Failed to build dependency tree: ${msg}` }],
2348
+ isError: true
2349
+ };
2350
+ }
2351
+ }
2352
+ );
2353
+ }
2354
+
2219
2355
  // src/mcp/tools/task.ts
2220
2356
  var ACTION_TO_LEGACY_TOOL2 = {
2221
2357
  create: "create_task",
@@ -2224,7 +2360,8 @@ var ACTION_TO_LEGACY_TOOL2 = {
2224
2360
  update: "update_task",
2225
2361
  close: "close_task",
2226
2362
  checkpoint: "checkpoint_task",
2227
- resume: "resume_employee"
2363
+ resume: "resume_employee",
2364
+ dependency_tree: "dependency_tree"
2228
2365
  };
2229
2366
  var REQUIRED_FIELDS2 = {
2230
2367
  create: ["title", "assigned_to", "project_name", "context"],
@@ -2233,7 +2370,8 @@ var REQUIRED_FIELDS2 = {
2233
2370
  update: ["task_id", "status"],
2234
2371
  close: ["task_id", "result"],
2235
2372
  checkpoint: ["task_id", "step", "context_summary"],
2236
- resume: ["agent_id"]
2373
+ resume: ["agent_id"],
2374
+ dependency_tree: []
2237
2375
  };
2238
2376
  function errorResult2(text3) {
2239
2377
  return {
@@ -2258,6 +2396,7 @@ function buildLegacyTaskHandlers() {
2258
2396
  registerCloseTask(localServer);
2259
2397
  registerCheckpointTask(localServer);
2260
2398
  registerResumeEmployee(localServer);
2399
+ registerDependencyTree(localServer);
2261
2400
  return tools;
2262
2401
  }
2263
2402
  function registerTask(server) {
@@ -2266,29 +2405,30 @@ function registerTask(server) {
2266
2405
  "task",
2267
2406
  {
2268
2407
  title: "Task",
2269
- description: "Consolidated task domain tool. Use action=create/list/get/update/close/checkpoint/resume instead of separate task tools. Legacy task tools remain available during migration.",
2408
+ description: "Consolidated task domain tool. Use action=create/list/get/update/close/checkpoint/resume/dependency_tree instead of separate task tools. Legacy task tools remain available during migration.",
2270
2409
  inputSchema: {
2271
- action: z16.enum(["create", "list", "get", "update", "close", "checkpoint", "resume"]).describe("Task operation to perform"),
2272
- task_id: z16.string().optional().describe("Task identifier \u2014 UUID, slug, filename fragment, or title substring"),
2273
- title: z16.string().optional().describe("Task title for action=create"),
2274
- assigned_to: z16.string().optional().describe("Employee name for action=create/list filter"),
2275
- project_name: z16.string().optional().describe("Project name. Use project_name='all' for action=list across projects."),
2276
- priority: z16.enum(["p0", "p1", "p2"]).optional().describe("Priority for create or list filter"),
2277
- complexity: z16.enum(["routine", "standard", "complex", "critical"]).optional().describe("Task complexity for action=create"),
2278
- context: z16.string().optional().describe("Full task description for action=create"),
2279
- blocked_by: z16.string().optional().describe("Blocking task ID/slug for action=create"),
2280
- parent_task_id: z16.string().optional().describe("Parent task ID/slug for action=create"),
2281
- reviewer: z16.string().optional().describe("Reviewer for action=create"),
2282
- budget_tokens: z16.number().optional().describe("Max token budget for action=create"),
2283
- budget_fallback_model: z16.string().optional().describe("Fallback model for action=create"),
2284
- spawn_runtime: z16.string().optional().describe("Override runtime for spawned session (e.g., 'claude', 'codex', 'opencode') for action=create"),
2285
- spawn_model: z16.string().optional().describe("Override model for spawned session (e.g., 'claude-sonnet-4.6') for action=create"),
2286
- status: z16.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).optional().describe("Status for action=update/list/close"),
2287
- result: z16.string().optional().describe("Result summary for action=update or action=close"),
2288
- step: z16.string().optional().describe("Checkpoint step for action=checkpoint"),
2289
- context_summary: z16.string().optional().describe("Checkpoint summary for action=checkpoint"),
2290
- files_touched: z16.array(z16.string()).optional().describe("Files touched for action=checkpoint"),
2291
- agent_id: z16.string().optional().describe("Employee name for action=resume")
2410
+ action: z17.enum(["create", "list", "get", "update", "close", "checkpoint", "resume", "dependency_tree"]).describe("Task operation to perform"),
2411
+ task_id: z17.string().optional().describe("Task identifier \u2014 UUID, slug, filename fragment, or title substring"),
2412
+ title: z17.string().optional().describe("Task title for action=create"),
2413
+ assigned_to: z17.string().optional().describe("Employee name for action=create/list filter"),
2414
+ project_name: z17.string().optional().describe("Project name. Use project_name='all' for action=list across projects."),
2415
+ priority: z17.enum(["p0", "p1", "p2"]).optional().describe("Priority for create or list filter"),
2416
+ complexity: z17.enum(["routine", "standard", "complex", "critical"]).optional().describe("Task complexity for action=create"),
2417
+ context: z17.string().optional().describe("Full task description for action=create"),
2418
+ blocked_by: z17.string().optional().describe("Blocking task ID/slug for action=create"),
2419
+ parent_task_id: z17.string().optional().describe("Parent task ID/slug for action=create"),
2420
+ reviewer: z17.string().optional().describe("Reviewer for action=create"),
2421
+ budget_tokens: z17.number().optional().describe("Max token budget for action=create"),
2422
+ budget_fallback_model: z17.string().optional().describe("Fallback model for action=create"),
2423
+ spawn_runtime: z17.string().optional().describe("Override runtime for spawned session (e.g., 'claude', 'codex', 'opencode') for action=create"),
2424
+ spawn_model: z17.string().optional().describe("Override model for spawned session (e.g., 'claude-sonnet-4.6') for action=create"),
2425
+ status: z17.enum(["open", "in_progress", "done", "needs_review", "blocked", "cancelled", "closed"]).optional().describe("Status for action=update/list/close"),
2426
+ result: z17.string().optional().describe("Result summary for action=update or action=close"),
2427
+ step: z17.string().optional().describe("Checkpoint step for action=checkpoint"),
2428
+ context_summary: z17.string().optional().describe("Checkpoint summary for action=checkpoint"),
2429
+ files_touched: z17.array(z17.string()).optional().describe("Files touched for action=checkpoint"),
2430
+ agent_id: z17.string().optional().describe("Employee name for action=resume"),
2431
+ cross_session: z17.boolean().optional().describe("When true, action=list returns tasks from ALL coordinator sessions (read-only). Default: false.")
2292
2432
  }
2293
2433
  },
2294
2434
  async (input, extra) => {
@@ -2323,9 +2463,7 @@ function registerTask(server) {
2323
2463
  }
2324
2464
 
2325
2465
  // src/mcp/tools/store-behavior.ts
2326
- init_behaviors();
2327
- import { z as z17 } from "zod";
2328
- init_project_name();
2466
+ import { z as z18 } from "zod";
2329
2467
  function registerStoreBehavior(server) {
2330
2468
  server.registerTool(
2331
2469
  "store_behavior",
@@ -2333,11 +2471,11 @@ function registerStoreBehavior(server) {
2333
2471
  title: "Store Behavior",
2334
2472
  description: "Store a behavioral pattern, correction, or reusable procedure for an employee. Use for corrections ('don't do X'), preferences ('always use Y'), AND procedures ('here is how to do Z step by step'). After completing a complex multi-step task (5+ tool calls), consider storing the successful approach as a reusable procedure. Persists across sessions and projects.",
2335
2473
  inputSchema: {
2336
- content: z17.string().max(500).describe("The behavioral instruction \u2014 one clear sentence"),
2337
- domain: z17.string().optional().describe("Category: workflow, code-style, tool-use, communication, architecture, testing"),
2338
- priority: z17.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always included (orchestration rules, hard gates). p1 = standard (default). p2 = nice-to-have."),
2339
- agent_id: z17.string().optional().describe("Employee name. Defaults to current agent."),
2340
- project_name: z17.string().optional().describe("Defaults to current project. Pass 'global' for a behavior that applies everywhere.")
2474
+ content: z18.string().max(500).describe("The behavioral instruction \u2014 one clear sentence"),
2475
+ domain: z18.string().optional().describe("Category: workflow, code-style, tool-use, communication, architecture, testing"),
2476
+ priority: z18.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always included (orchestration rules, hard gates). p1 = standard (default). p2 = nice-to-have."),
2477
+ agent_id: z18.string().optional().describe("Employee name. Defaults to current agent."),
2478
+ project_name: z18.string().optional().describe("Defaults to current project. Pass 'global' for a behavior that applies everywhere.")
2341
2479
  }
2342
2480
  },
2343
2481
  async ({ content, domain, priority, agent_id, project_name }) => {
@@ -2345,16 +2483,19 @@ function registerStoreBehavior(server) {
2345
2483
  const resolvedAgent = agent_id ?? activeAgent.agentId;
2346
2484
  if (agent_id && agent_id !== activeAgent.agentId) {
2347
2485
  try {
2348
- const { canCoordinate: canCoordinate2 } = await import("./lib/employees.js");
2349
- if (!canCoordinate2(activeAgent.agentId, activeAgent.agentRole ?? "employee")) {
2486
+ const { canManage: canManage2, baseAgentName: baseAgentName2, loadEmployeesSync: loadEmployeesSync2 } = await import("./lib/employees.js");
2487
+ const roster = loadEmployeesSync2();
2488
+ const callerBase = baseAgentName2(activeAgent.agentId, roster);
2489
+ const targetBase = baseAgentName2(agent_id, roster);
2490
+ if (callerBase !== targetBase && !canManage2(callerBase, activeAgent.agentRole ?? "employee", targetBase, roster)) {
2350
2491
  return {
2351
- content: [{ type: "text", text: `Authorization denied: only coordinators can write behaviors for other agents. You (${activeAgent.agentId}) cannot write behaviors for ${agent_id}.` }],
2492
+ content: [{ type: "text", text: `Authorization denied: your role (${activeAgent.agentRole ?? "unknown"}) cannot write behaviors for ${agent_id}. Chain of command: COO \u2192 anyone, CTO \u2192 engineers, CMO \u2192 content.` }],
2352
2493
  isError: true
2353
2494
  };
2354
2495
  }
2355
2496
  } catch {
2356
2497
  return {
2357
- content: [{ type: "text", text: `Authorization denied: unable to verify coordinator role for ${activeAgent.agentId}. Cross-agent behavior writes require roster validation.` }],
2498
+ content: [{ type: "text", text: `Authorization denied: unable to verify role for ${activeAgent.agentId}. Cross-agent behavior writes require roster validation.` }],
2358
2499
  isError: true
2359
2500
  };
2360
2501
  }
@@ -2368,10 +2509,10 @@ function registerStoreBehavior(server) {
2368
2509
  resolvedProject = getProjectName();
2369
2510
  }
2370
2511
  try {
2371
- const { loadEmployeesSync: loadEmployeesSync2, baseAgentName } = await import("./lib/employees.js");
2512
+ const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await import("./lib/employees.js");
2372
2513
  const roster = loadEmployeesSync2();
2373
2514
  if (roster.length > 0) {
2374
- const base = baseAgentName(resolvedAgent, roster);
2515
+ const base = baseAgentName2(resolvedAgent, roster);
2375
2516
  if (!roster.some((e) => e.name === resolvedAgent || e.name === base)) {
2376
2517
  return {
2377
2518
  content: [{
@@ -2418,11 +2559,9 @@ Use /exe-forget to remove any that this supersedes.`;
2418
2559
  }
2419
2560
 
2420
2561
  // src/mcp/tools/message.ts
2421
- import { z as z18 } from "zod";
2562
+ import { z as z19 } from "zod";
2422
2563
 
2423
2564
  // src/mcp/tools/acknowledge-messages.ts
2424
- init_database();
2425
- init_task_scope();
2426
2565
  function registerAcknowledgeMessages(server) {
2427
2566
  server.registerTool(
2428
2567
  "acknowledge_messages",
@@ -2435,7 +2574,7 @@ function registerAcknowledgeMessages(server) {
2435
2574
  const agent = getActiveAgent();
2436
2575
  const agentId = agent.agentId || "default";
2437
2576
  const client = getClient();
2438
- const scope = strictSessionScopeFilter();
2577
+ const scope = sessionScopeFilter();
2439
2578
  const result3 = await client.execute({
2440
2579
  sql: `UPDATE messages SET status = 'acknowledged', processed_at = datetime('now')
2441
2580
  WHERE target_agent = ? AND status IN ('pending', 'delivered')${scope.sql}`,
@@ -2472,12 +2611,12 @@ function registerMessage(server) {
2472
2611
  title: "Message",
2473
2612
  description: "Consolidated inter-agent message tool. Actions: send, acknowledge. Legacy message tools remain available during migration.",
2474
2613
  inputSchema: {
2475
- action: z18.enum(["send", "acknowledge"]).describe("Message operation to perform"),
2476
- target_agent: z18.string().optional().describe("Recipient agent for action=send"),
2477
- content: z18.string().optional().describe("Message content for action=send"),
2478
- target_project: z18.string().optional().describe("Project context for action=send"),
2479
- priority: z18.enum(["normal", "urgent"]).optional().describe("Priority for action=send"),
2480
- target_device: z18.string().optional().describe("Target device ID for action=send")
2614
+ action: z19.enum(["send", "acknowledge"]).describe("Message operation to perform"),
2615
+ target_agent: z19.string().optional().describe("Recipient agent for action=send"),
2616
+ content: z19.string().optional().describe("Message content for action=send"),
2617
+ target_project: z19.string().optional().describe("Project context for action=send"),
2618
+ priority: z19.enum(["normal", "urgent"]).optional().describe("Priority for action=send"),
2619
+ target_device: z19.string().optional().describe("Target device ID for action=send")
2481
2620
  }
2482
2621
  }, async (input, extra) => {
2483
2622
  const action = input.action;
@@ -2494,9 +2633,7 @@ function registerMessage(server) {
2494
2633
  }
2495
2634
 
2496
2635
  // src/mcp/tools/list-behaviors.ts
2497
- init_database();
2498
- import { z as z19 } from "zod";
2499
- init_project_name();
2636
+ import { z as z20 } from "zod";
2500
2637
  function rowToBehavior(r) {
2501
2638
  return {
2502
2639
  id: String(r.id),
@@ -2522,9 +2659,9 @@ function registerListBehaviors(server) {
2522
2659
  title: "List Behaviors",
2523
2660
  description: "Query stored behavioral patterns and corrections. Useful for reviewing what rules are active for an agent mid-session.",
2524
2661
  inputSchema: {
2525
- agent_id: z19.string().optional().describe("Agent name. Defaults to current agent. Pass 'all' to see everyone's."),
2526
- domain: z19.string().optional().describe("Filter by domain: workflow, code-style, tool-use, communication, architecture, testing"),
2527
- project_name: z19.string().optional().describe("Filter by project. Defaults to current project + global behaviors.")
2662
+ agent_id: z20.string().optional().describe("Agent name. Defaults to current agent. Pass 'all' to see everyone's."),
2663
+ domain: z20.string().optional().describe("Filter by domain: workflow, code-style, tool-use, communication, architecture, testing"),
2664
+ project_name: z20.string().optional().describe("Filter by project. Defaults to current project + global behaviors.")
2528
2665
  }
2529
2666
  },
2530
2667
  async ({ agent_id, domain, project_name }) => {
@@ -2583,11 +2720,10 @@ ${lines.join("\n")}`
2583
2720
  }
2584
2721
 
2585
2722
  // src/mcp/tools/identity.ts
2586
- import { z as z22 } from "zod";
2723
+ import { z as z23 } from "zod";
2587
2724
 
2588
2725
  // src/mcp/tools/get-identity.ts
2589
- init_identity();
2590
- import { z as z20 } from "zod";
2726
+ import { z as z21 } from "zod";
2591
2727
  function registerGetIdentity(server) {
2592
2728
  server.registerTool(
2593
2729
  "get_identity",
@@ -2595,7 +2731,7 @@ function registerGetIdentity(server) {
2595
2731
  title: "Get Identity",
2596
2732
  description: "Read an agent's exe.md identity \u2014 their permanent role definition, responsibilities, and non-negotiables. Defaults to your own identity. All agents can read all identities.",
2597
2733
  inputSchema: {
2598
- agent_id: z20.string().optional().describe("Agent to read. Defaults to self. Pass 'all' to list all identities.")
2734
+ agent_id: z21.string().optional().describe("Agent to read. Defaults to self. Pass 'all' to list all identities.")
2599
2735
  }
2600
2736
  },
2601
2737
  async ({ agent_id }) => {
@@ -2637,9 +2773,7 @@ ${identity.body}`
2637
2773
  }
2638
2774
 
2639
2775
  // src/mcp/tools/update-identity.ts
2640
- init_identity();
2641
- import { z as z21 } from "zod";
2642
- init_employees();
2776
+ import { z as z22 } from "zod";
2643
2777
  function registerUpdateIdentity(server) {
2644
2778
  server.registerTool(
2645
2779
  "update_identity",
@@ -2647,8 +2781,8 @@ function registerUpdateIdentity(server) {
2647
2781
  title: "Update Identity",
2648
2782
  description: "Write an agent's exe.md identity. RESTRICTED: only coordinator or founder sessions can use this. Agents cannot rewrite their own identity. Content should be markdown with YAML frontmatter.",
2649
2783
  inputSchema: {
2650
- agent_id: z21.string().describe("Target agent whose identity to write"),
2651
- content: z21.string().describe(
2784
+ agent_id: z22.string().describe("Target agent whose identity to write"),
2785
+ content: z22.string().describe(
2652
2786
  "Full markdown content with YAML frontmatter. Must include ---\\nrole: ...\\ntitle: ...\\n---\\n and body sections."
2653
2787
  )
2654
2788
  }
@@ -2706,9 +2840,9 @@ function registerIdentity(server) {
2706
2840
  title: "Identity",
2707
2841
  description: "Consolidated identity domain tool. Actions: get, update. Legacy identity tools remain available during migration.",
2708
2842
  inputSchema: {
2709
- action: z22.enum(["get", "update"]).describe("Identity operation to perform"),
2710
- agent_id: z22.string().optional().describe("Agent to read/update. For get, omit for self or pass 'all'."),
2711
- content: z22.string().optional().describe("Full exe.md content for action=update")
2843
+ action: z23.enum(["get", "update"]).describe("Identity operation to perform"),
2844
+ agent_id: z23.string().optional().describe("Agent to read/update. For get, omit for self or pass 'all'."),
2845
+ content: z23.string().optional().describe("Full exe.md content for action=update")
2712
2846
  }
2713
2847
  }, async (input, extra) => {
2714
2848
  const action = input.action;
@@ -2724,14 +2858,12 @@ function registerIdentity(server) {
2724
2858
  }
2725
2859
 
2726
2860
  // src/mcp/tools/document.ts
2727
- import { z as z28 } from "zod";
2861
+ import { z as z29 } from "zod";
2728
2862
 
2729
2863
  // src/mcp/tools/ingest-document.ts
2730
- import { z as z23 } from "zod";
2864
+ import { z as z24 } from "zod";
2731
2865
 
2732
2866
  // src/lib/documents.ts
2733
- init_database();
2734
- init_embedder();
2735
2867
  import crypto3 from "crypto";
2736
2868
  var WIKI_AGENT_ID = "wiki";
2737
2869
  var WIKI_AGENT_ROLE = "Knowledge";
@@ -2884,7 +3016,7 @@ async function ingestDocument(input) {
2884
3016
  const userId = input.user_id ?? null;
2885
3017
  const documentMetadata = input.document_metadata != null ? JSON.stringify(input.document_metadata) : null;
2886
3018
  const chunkIds = input.chunks.map(() => crypto3.randomUUID());
2887
- const versions = reserveVersions(input.chunks.length);
3019
+ const versions = await reserveVersions(input.chunks.length);
2888
3020
  const documentStmt = {
2889
3021
  sql: `INSERT INTO documents
2890
3022
  (id, workspace_id, filename, mime, source_type, user_id, uploaded_at, metadata)
@@ -2987,24 +3119,24 @@ function registerIngestDocument(server) {
2987
3119
  title: "Ingest Document",
2988
3120
  description: "Bulk-upload a document and its chunks to wiki memory in a single round-trip. Lazily creates the workspace if missing. Falls back to NULL vectors when the embedding daemon is offline (backfill job will fill them later).",
2989
3121
  inputSchema: {
2990
- workspace_id: z23.string().describe("Workspace UUID or slug \u2014 created lazily if not found"),
2991
- filename: z23.string().describe("Document filename"),
2992
- mime: z23.string().optional().describe("MIME type (e.g. application/pdf)"),
2993
- source_type: z23.enum(["upload", "url", "manual", "paste"]).optional().describe("How the document was added"),
2994
- user_id: z23.string().optional().describe("AnythingLLM User.id (uploader). Null = shared."),
2995
- chunks: z23.array(z23.object({
2996
- text: z23.string(),
2997
- char_offset: z23.number().optional(),
2998
- page_number: z23.number().optional(),
2999
- metadata: z23.record(z23.string(), z23.unknown()).optional()
3122
+ workspace_id: z24.string().describe("Workspace UUID or slug \u2014 created lazily if not found"),
3123
+ filename: z24.string().describe("Document filename"),
3124
+ mime: z24.string().optional().describe("MIME type (e.g. application/pdf)"),
3125
+ source_type: z24.enum(["upload", "url", "manual", "paste"]).optional().describe("How the document was added"),
3126
+ user_id: z24.string().optional().describe("AnythingLLM User.id (uploader). Null = shared."),
3127
+ chunks: z24.array(z24.object({
3128
+ text: z24.string(),
3129
+ char_offset: z24.number().optional(),
3130
+ page_number: z24.number().optional(),
3131
+ metadata: z24.record(z24.string(), z24.unknown()).optional()
3000
3132
  })).describe("Document chunks to ingest"),
3001
- document_metadata: z23.record(z23.string(), z23.unknown()).optional().describe("Optional metadata stored on the document row")
3133
+ document_metadata: z24.record(z24.string(), z24.unknown()).optional().describe("Optional metadata stored on the document row")
3002
3134
  }
3003
3135
  },
3004
3136
  async (input) => {
3005
3137
  try {
3006
- const { assertFeature: assertFeature2 } = await import("./plan-limits-TK4424RV.js");
3007
- const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-TK4424RV.js");
3138
+ const { assertFeature: assertFeature2 } = await import("./plan-limits-7L75PB33.js");
3139
+ const { assertMemoryLimit: assertMemoryLimit2 } = await import("./plan-limits-7L75PB33.js");
3008
3140
  await assertFeature2("wiki");
3009
3141
  await assertMemoryLimit2();
3010
3142
  const result3 = await ingestDocument(input);
@@ -3030,7 +3162,7 @@ function registerIngestDocument(server) {
3030
3162
  }
3031
3163
 
3032
3164
  // src/mcp/tools/list-documents.ts
3033
- import { z as z24 } from "zod";
3165
+ import { z as z25 } from "zod";
3034
3166
  function registerListDocuments(server) {
3035
3167
  server.registerTool(
3036
3168
  "list_documents",
@@ -3038,9 +3170,9 @@ function registerListDocuments(server) {
3038
3170
  title: "List Documents",
3039
3171
  description: "List documents in a wiki workspace, newest first, with chunk counts. Paginated via limit/offset.",
3040
3172
  inputSchema: {
3041
- workspace_id: z24.string().describe("Workspace id (UUID). Use resolveWorkspace / ingest_document to create one."),
3042
- limit: z24.number().int().positive().optional().describe(`Max rows to return (default ${DEFAULT_LIST_LIMIT}).`),
3043
- offset: z24.number().int().nonnegative().optional().describe("Rows to skip (default 0).")
3173
+ workspace_id: z25.string().describe("Workspace id (UUID). Use resolveWorkspace / ingest_document to create one."),
3174
+ limit: z25.number().int().positive().optional().describe(`Max rows to return (default ${DEFAULT_LIST_LIMIT}).`),
3175
+ offset: z25.number().int().nonnegative().optional().describe("Rows to skip (default 0).")
3044
3176
  }
3045
3177
  },
3046
3178
  async ({ workspace_id, limit, offset }) => {
@@ -3062,7 +3194,7 @@ function registerListDocuments(server) {
3062
3194
  }
3063
3195
 
3064
3196
  // src/mcp/tools/purge-document.ts
3065
- import { z as z25 } from "zod";
3197
+ import { z as z26 } from "zod";
3066
3198
  function registerPurgeDocument(server) {
3067
3199
  server.registerTool(
3068
3200
  "purge_document",
@@ -3070,7 +3202,7 @@ function registerPurgeDocument(server) {
3070
3202
  title: "Purge Document",
3071
3203
  description: "Delete a wiki document and all its chunks in a single transaction. Idempotent: non-existent document returns deleted_chunks=0.",
3072
3204
  inputSchema: {
3073
- document_id: z25.string().describe("Document id (UUID) to purge.")
3205
+ document_id: z26.string().describe("Document id (UUID) to purge.")
3074
3206
  }
3075
3207
  },
3076
3208
  async ({ document_id }) => {
@@ -3095,7 +3227,7 @@ function registerPurgeDocument(server) {
3095
3227
  }
3096
3228
 
3097
3229
  // src/mcp/tools/set-document-importance.ts
3098
- import { z as z26 } from "zod";
3230
+ import { z as z27 } from "zod";
3099
3231
  function registerSetDocumentImportance(server) {
3100
3232
  server.registerTool(
3101
3233
  "set_document_importance",
@@ -3103,8 +3235,8 @@ function registerSetDocumentImportance(server) {
3103
3235
  title: "Set Document Importance",
3104
3236
  description: `Bulk-update importance (${MIN_IMPORTANCE}-${MAX_IMPORTANCE}) on all chunks of a wiki document. Higher = surfaces earlier in search.`,
3105
3237
  inputSchema: {
3106
- document_id: z26.string().describe("Document id (UUID)."),
3107
- importance: z26.number().int().min(MIN_IMPORTANCE).max(MAX_IMPORTANCE).describe(`Importance score ${MIN_IMPORTANCE}-${MAX_IMPORTANCE} (inclusive).`)
3238
+ document_id: z27.string().describe("Document id (UUID)."),
3239
+ importance: z27.number().int().min(MIN_IMPORTANCE).max(MAX_IMPORTANCE).describe(`Importance score ${MIN_IMPORTANCE}-${MAX_IMPORTANCE} (inclusive).`)
3108
3240
  }
3109
3241
  },
3110
3242
  async ({ document_id, importance }) => {
@@ -3122,7 +3254,7 @@ function registerSetDocumentImportance(server) {
3122
3254
  }
3123
3255
 
3124
3256
  // src/mcp/tools/rerank-documents.ts
3125
- import { z as z27 } from "zod";
3257
+ import { z as z28 } from "zod";
3126
3258
  var MAX_CANDIDATES = 50;
3127
3259
  function registerRerankDocuments(server) {
3128
3260
  server.registerTool(
@@ -3131,14 +3263,14 @@ function registerRerankDocuments(server) {
3131
3263
  title: "Rerank Documents",
3132
3264
  description: "Score candidate texts against a query using the local Jina Reranker v3 cross-encoder. Returns candidates sorted by relevance with per-item scores and original indices. Useful for agent tool selection, pointwise re-ranking, or any flow that already has candidates and only needs scoring.",
3133
3265
  inputSchema: {
3134
- query: z27.string().min(1, "query must not be empty").describe("The query to score candidates against."),
3135
- candidates: z27.array(z27.string()).min(1, "candidates must contain at least one text").max(
3266
+ query: z28.string().min(1, "query must not be empty").describe("The query to score candidates against."),
3267
+ candidates: z28.array(z28.string()).min(1, "candidates must contain at least one text").max(
3136
3268
  MAX_CANDIDATES,
3137
3269
  `candidates may contain at most ${MAX_CANDIDATES} items`
3138
3270
  ).describe(
3139
3271
  `Ordered list of candidate texts to score (up to ${MAX_CANDIDATES}).`
3140
3272
  ),
3141
- top_k: z27.coerce.number().int().positive().optional().describe(
3273
+ top_k: z28.coerce.number().int().positive().optional().describe(
3142
3274
  "Max number of top-ranked results to return. Omit to return all candidates scored and sorted."
3143
3275
  )
3144
3276
  }
@@ -3206,26 +3338,26 @@ function registerDocument(server) {
3206
3338
  title: "Document",
3207
3339
  description: "Consolidated document domain tool. Actions: ingest, list, purge, set_importance, rerank. Legacy document tools remain available during migration.",
3208
3340
  inputSchema: {
3209
- action: z28.enum(["ingest", "list", "purge", "set_importance", "rerank"]).describe("Document operation to perform"),
3210
- workspace_id: z28.string().optional().describe("Workspace UUID or slug"),
3211
- filename: z28.string().optional().describe("Document filename for action=ingest"),
3212
- mime: z28.string().optional().describe("MIME type for action=ingest"),
3213
- source_type: z28.enum(["upload", "url", "manual", "paste"]).optional().describe("Source type for action=ingest"),
3214
- user_id: z28.string().optional().describe("Uploader user ID for action=ingest"),
3215
- chunks: z28.array(z28.object({
3216
- text: z28.string(),
3217
- char_offset: z28.number().optional(),
3218
- page_number: z28.number().optional(),
3219
- metadata: z28.record(z28.string(), z28.unknown()).optional()
3341
+ action: z29.enum(["ingest", "list", "purge", "set_importance", "rerank"]).describe("Document operation to perform"),
3342
+ workspace_id: z29.string().optional().describe("Workspace UUID or slug"),
3343
+ filename: z29.string().optional().describe("Document filename for action=ingest"),
3344
+ mime: z29.string().optional().describe("MIME type for action=ingest"),
3345
+ source_type: z29.enum(["upload", "url", "manual", "paste"]).optional().describe("Source type for action=ingest"),
3346
+ user_id: z29.string().optional().describe("Uploader user ID for action=ingest"),
3347
+ chunks: z29.array(z29.object({
3348
+ text: z29.string(),
3349
+ char_offset: z29.number().optional(),
3350
+ page_number: z29.number().optional(),
3351
+ metadata: z29.record(z29.string(), z29.unknown()).optional()
3220
3352
  })).optional().describe("Document chunks for action=ingest"),
3221
- document_metadata: z28.record(z28.string(), z28.unknown()).optional().describe("Document metadata for action=ingest"),
3222
- document_id: z28.string().optional().describe("Document ID for purge/set_importance"),
3223
- importance: z28.number().int().min(1).max(10).optional().describe("Importance for action=set_importance"),
3224
- query: z28.string().optional().describe("Query for action=rerank"),
3225
- candidates: z28.array(z28.string()).optional().describe("Candidate texts for action=rerank"),
3226
- top_k: z28.coerce.number().int().positive().optional().describe("Top K for action=rerank"),
3227
- limit: z28.number().int().positive().optional().describe("Limit for action=list"),
3228
- offset: z28.number().int().nonnegative().optional().describe("Offset for action=list")
3353
+ document_metadata: z29.record(z29.string(), z29.unknown()).optional().describe("Document metadata for action=ingest"),
3354
+ document_id: z29.string().optional().describe("Document ID for purge/set_importance"),
3355
+ importance: z29.number().int().min(1).max(10).optional().describe("Importance for action=set_importance"),
3356
+ query: z29.string().optional().describe("Query for action=rerank"),
3357
+ candidates: z29.array(z29.string()).optional().describe("Candidate texts for action=rerank"),
3358
+ top_k: z29.coerce.number().int().positive().optional().describe("Top K for action=rerank"),
3359
+ limit: z29.number().int().positive().optional().describe("Limit for action=list"),
3360
+ offset: z29.number().int().nonnegative().optional().describe("Offset for action=list")
3229
3361
  }
3230
3362
  },
3231
3363
  async (input, extra) => {
@@ -3251,14 +3383,13 @@ function registerDocument(server) {
3251
3383
  }
3252
3384
 
3253
3385
  // src/mcp/tools/gateway.ts
3254
- import { z as z33 } from "zod";
3386
+ import { z as z34 } from "zod";
3255
3387
 
3256
3388
  // src/mcp/tools/send-whatsapp.ts
3257
- import { z as z29 } from "zod";
3389
+ import { z as z30 } from "zod";
3258
3390
  import { existsSync, readFileSync } from "fs";
3259
3391
  import { homedir } from "os";
3260
3392
  import { join } from "path";
3261
- init_plan_limits();
3262
3393
  var GRAPH_API_VERSION = "v21.0";
3263
3394
  var GRAPH_API_BASE = `https://graph.facebook.com/${GRAPH_API_VERSION}`;
3264
3395
  var DEFAULT_GATEWAY_SEND_URL = "http://127.0.0.1:3100/api/send";
@@ -3389,9 +3520,9 @@ function registerSendWhatsapp(server) {
3389
3520
  title: "Send WhatsApp",
3390
3521
  description: "Send a WhatsApp message to one or more recipients. Recipients can be phone numbers or names (looked up in CRM).",
3391
3522
  inputSchema: {
3392
- recipients: z29.array(z29.string()).describe("Names to look up in CRM, or phone numbers directly"),
3393
- message: z29.string().describe("Message text to send"),
3394
- account: z29.string().optional().describe(
3523
+ recipients: z30.array(z30.string()).describe("Names to look up in CRM, or phone numbers directly"),
3524
+ message: z30.string().describe("Message text to send"),
3525
+ account: z30.string().optional().describe(
3395
3526
  "Which WhatsApp account to send from (e.g., 'lenny'). Falls back to default account."
3396
3527
  )
3397
3528
  }
@@ -3473,31 +3604,30 @@ function registerSendWhatsapp(server) {
3473
3604
  }
3474
3605
 
3475
3606
  // src/mcp/tools/query-conversations.ts
3476
- init_database();
3477
- import { z as z31 } from "zod";
3607
+ import { z as z32 } from "zod";
3478
3608
 
3479
3609
  // src/lib/unified-query.ts
3480
- import { z as z30 } from "zod";
3610
+ import { z as z31 } from "zod";
3481
3611
  var PaginationSchema = {
3482
- limit: z30.coerce.number().int().min(1).max(100).optional().describe("Max results to return (default 25, max 100)"),
3483
- offset: z30.coerce.number().int().min(0).optional().describe("Number of results to skip for pagination")
3612
+ limit: z31.coerce.number().int().min(1).max(100).optional().describe("Max results to return (default 25, max 100)"),
3613
+ offset: z31.coerce.number().int().min(0).optional().describe("Number of results to skip for pagination")
3484
3614
  };
3485
3615
  var DateRangeSchema = {
3486
- date_from: z30.string().optional().describe("Filter records created/updated after this ISO date (inclusive)"),
3487
- date_to: z30.string().optional().describe("Filter records created/updated before this ISO date (inclusive)")
3616
+ date_from: z31.string().optional().describe("Filter records created/updated after this ISO date (inclusive)"),
3617
+ date_to: z31.string().optional().describe("Filter records created/updated before this ISO date (inclusive)")
3488
3618
  };
3489
3619
  var TextSearchSchema = {
3490
- text_search: z30.string().optional().describe("Full-text search across relevant fields")
3620
+ text_search: z31.string().optional().describe("Full-text search across relevant fields")
3491
3621
  };
3492
3622
  var SortSchema = {
3493
- sort_by: z30.string().optional().describe("Field to sort by (tool-specific, default varies)"),
3494
- sort_order: z30.enum(["asc", "desc"]).optional().describe("Sort direction (default desc)")
3623
+ sort_by: z31.string().optional().describe("Field to sort by (tool-specific, default varies)"),
3624
+ sort_order: z31.enum(["asc", "desc"]).optional().describe("Sort direction (default desc)")
3495
3625
  };
3496
3626
  var SourceFilterSchema = {
3497
- source: z30.string().optional().describe("Filter by data source/platform")
3627
+ source: z31.string().optional().describe("Filter by data source/platform")
3498
3628
  };
3499
3629
  var StructuredFiltersSchema = {
3500
- structured_filters: z30.record(z30.string(), z30.unknown()).optional().describe(
3630
+ structured_filters: z31.record(z31.string(), z31.unknown()).optional().describe(
3501
3631
  "Structured field filters: { field: value } for equality, or { field: { op: 'gt'|'lt'|'gte'|'lte'|'contains'|'neq', value: ... } }"
3502
3632
  )
3503
3633
  };
@@ -3576,13 +3706,13 @@ function registerQueryConversations(server) {
3576
3706
  title: "Query Conversations",
3577
3707
  description: "Search across all adapter messages by content, sender, date range, or platform. Returns messages with source attribution (platform, sender, timestamp).",
3578
3708
  inputSchema: {
3579
- query: z31.string().optional().describe("Full-text search query across message content and responses"),
3580
- sender: z31.string().optional().describe("Filter by sender ID or name (partial match)"),
3581
- platform: z31.string().optional().describe("Filter by platform: whatsapp, signal, telegram, discord, imessage, slack, email, webchat"),
3582
- after: z31.string().optional().describe("Filter messages after this ISO 8601 date (alias for date_from)"),
3583
- before: z31.string().optional().describe("Filter messages before this ISO 8601 date (alias for date_to)"),
3584
- channel_id: z31.string().optional().describe("Filter by channel/chat ID"),
3585
- thread_id: z31.string().optional().describe("Filter by conversation thread ID"),
3709
+ query: z32.string().optional().describe("Full-text search query across message content and responses"),
3710
+ sender: z32.string().optional().describe("Filter by sender ID or name (partial match)"),
3711
+ platform: z32.string().optional().describe("Filter by platform: whatsapp, signal, telegram, discord, imessage, slack, email, webchat"),
3712
+ after: z32.string().optional().describe("Filter messages after this ISO 8601 date (alias for date_from)"),
3713
+ before: z32.string().optional().describe("Filter messages before this ISO 8601 date (alias for date_to)"),
3714
+ channel_id: z32.string().optional().describe("Filter by channel/chat ID"),
3715
+ thread_id: z32.string().optional().describe("Filter by conversation thread ID"),
3586
3716
  ...DateRangeSchema,
3587
3717
  ...SortSchema,
3588
3718
  ...PaginationSchema
@@ -3694,10 +3824,10 @@ function registerQueryConversations(server) {
3694
3824
 
3695
3825
  // src/mcp/tools/query-company-brain.ts
3696
3826
  init_config();
3697
- import { z as z32 } from "zod";
3827
+ import { z as z33 } from "zod";
3698
3828
  var FETCH_TIMEOUT_MS = 1e4;
3699
- var QUERY_SCOPE = z32.enum(["raw", "crm", "wiki", "memory", "gateway", "all", "cross"]);
3700
- var QUERY_ACTION = z32.enum(["search", "list_sources", "sql"]);
3829
+ var QUERY_SCOPE = z33.enum(["raw", "crm", "wiki", "memory", "gateway", "all", "cross"]);
3830
+ var QUERY_ACTION = z33.enum(["search", "list_sources", "sql"]);
3701
3831
  var LOCAL_GATEWAY_HTTP_HOSTS = /^(localhost|127\.0\.0\.1|::1|exe-gateway|gateway)$/i;
3702
3832
  function assertSecureGatewayUrlForToken(gatewayUrl, authToken) {
3703
3833
  if (!authToken) return;
@@ -3733,10 +3863,10 @@ function registerQueryCompanyBrain(server) {
3733
3863
  description: "Search the Company Brain \u2014 queries across all data (raw events, wiki docs, agent memories, gateway messages).",
3734
3864
  inputSchema: {
3735
3865
  action: QUERY_ACTION.default("search").describe("search = search exe-db; list_sources = list available sources; sql = run read-only SQL through gateway"),
3736
- query: z32.string().optional().describe("Search text. Required for action=search."),
3737
- sql: z32.string().optional().describe("Read-only SELECT/WITH SQL. Required for action=sql."),
3866
+ query: z33.string().optional().describe("Search text. Required for action=search."),
3867
+ sql: z33.string().optional().describe("Read-only SELECT/WITH SQL. Required for action=sql."),
3738
3868
  scope: QUERY_SCOPE.default("all").describe("Which data scope to search/read (raw, crm, wiki, memory, gateway, all)"),
3739
- source: z32.string().optional().describe("Filter raw events by source (shopify, asana, etc.)"),
3869
+ source: z33.string().optional().describe("Filter raw events by source (shopify, asana, etc.)"),
3740
3870
  ...PaginationSchema,
3741
3871
  ...DateRangeSchema,
3742
3872
  ...SortSchema
@@ -3932,22 +4062,22 @@ function registerGateway(server) {
3932
4062
  title: "Gateway",
3933
4063
  description: "Consolidated gateway/customer communication tool. Actions: send_whatsapp, query_conversations, query_company_brain. Legacy gateway tools remain available during migration.",
3934
4064
  inputSchema: {
3935
- action: z33.enum(["send_whatsapp", "query_conversations", "query_company_brain"]).describe("Gateway operation to perform"),
3936
- recipients: z33.array(z33.string()).optional().describe("Names or phone numbers for action=send_whatsapp"),
3937
- message: z33.string().optional().describe("WhatsApp message text"),
3938
- account: z33.string().optional().describe("WhatsApp account name"),
3939
- query: z33.string().optional().describe("Search query"),
3940
- sender: z33.string().optional().describe("Conversation sender filter"),
3941
- platform: z33.string().optional().describe("Conversation platform filter"),
3942
- after: z33.string().optional().describe("Conversation lower date bound"),
3943
- before: z33.string().optional().describe("Conversation upper date bound"),
3944
- channel_id: z33.string().optional().describe("Conversation channel filter"),
3945
- thread_id: z33.string().optional().describe("Conversation thread filter"),
3946
- limit: z33.coerce.number().int().min(1).max(100).optional().describe("Max results"),
3947
- scope: z33.enum(["raw", "wiki", "memory", "gateway", "all"]).optional().describe("Company Brain scope"),
3948
- source: z33.string().optional().describe("Company Brain raw event source filter"),
3949
- auth_token: z33.string().optional().describe("GoTrue JWT for user authentication"),
3950
- user_id: z33.string().optional().describe("GoTrue user ID (admin lookup fallback)")
4065
+ action: z34.enum(["send_whatsapp", "query_conversations", "query_company_brain"]).describe("Gateway operation to perform"),
4066
+ recipients: z34.array(z34.string()).optional().describe("Names or phone numbers for action=send_whatsapp"),
4067
+ message: z34.string().optional().describe("WhatsApp message text"),
4068
+ account: z34.string().optional().describe("WhatsApp account name"),
4069
+ query: z34.string().optional().describe("Search query"),
4070
+ sender: z34.string().optional().describe("Conversation sender filter"),
4071
+ platform: z34.string().optional().describe("Conversation platform filter"),
4072
+ after: z34.string().optional().describe("Conversation lower date bound"),
4073
+ before: z34.string().optional().describe("Conversation upper date bound"),
4074
+ channel_id: z34.string().optional().describe("Conversation channel filter"),
4075
+ thread_id: z34.string().optional().describe("Conversation thread filter"),
4076
+ limit: z34.coerce.number().int().min(1).max(100).optional().describe("Max results"),
4077
+ scope: z34.enum(["raw", "wiki", "memory", "gateway", "all"]).optional().describe("Company Brain scope"),
4078
+ source: z34.string().optional().describe("Company Brain raw event source filter"),
4079
+ auth_token: z34.string().optional().describe("GoTrue JWT for user authentication"),
4080
+ user_id: z34.string().optional().describe("GoTrue user ID (admin lookup fallback)")
3951
4081
  }
3952
4082
  }, async (input, extra) => {
3953
4083
  const action = input.action;
@@ -3986,11 +4116,10 @@ function registerGateway(server) {
3986
4116
  }
3987
4117
 
3988
4118
  // src/mcp/tools/graph.ts
3989
- import { z as z40 } from "zod";
4119
+ import { z as z41 } from "zod";
3990
4120
 
3991
4121
  // src/mcp/tools/get-entity-neighbors.ts
3992
- init_database();
3993
- import { z as z34 } from "zod";
4122
+ import { z as z35 } from "zod";
3994
4123
  function registerGetEntityNeighbors(server) {
3995
4124
  server.registerTool(
3996
4125
  "get_entity_neighbors",
@@ -3998,8 +4127,8 @@ function registerGetEntityNeighbors(server) {
3998
4127
  title: "Get Entity Neighbors",
3999
4128
  description: "Get connected entities for a given entity name. Returns neighbors with relationship types, directions, and weights.",
4000
4129
  inputSchema: {
4001
- entity_name: z34.string().describe("Name of the entity to find neighbors for"),
4002
- as_of: z34.string().optional().describe("ISO 8601 timestamp for time-travel. Returns only relationships valid at that point in time.")
4130
+ entity_name: z35.string().describe("Name of the entity to find neighbors for"),
4131
+ as_of: z35.string().optional().describe("ISO 8601 timestamp for time-travel. Returns only relationships valid at that point in time.")
4003
4132
  }
4004
4133
  },
4005
4134
  async ({ entity_name, as_of }) => {
@@ -4067,8 +4196,7 @@ function registerGetEntityNeighbors(server) {
4067
4196
  }
4068
4197
 
4069
4198
  // src/mcp/tools/get-hot-entities.ts
4070
- init_database();
4071
- import { z as z35 } from "zod";
4199
+ import { z as z36 } from "zod";
4072
4200
  var PERIOD_MS = {
4073
4201
  "24h": 24 * 60 * 60 * 1e3,
4074
4202
  "7d": 7 * 24 * 60 * 60 * 1e3,
@@ -4081,8 +4209,8 @@ function registerGetHotEntities(server) {
4081
4209
  title: "Get Hot Entities",
4082
4210
  description: "Get trending entities \u2014 those with the most new relationships in a time period. Surfaces what's most active in the knowledge graph.",
4083
4211
  inputSchema: {
4084
- period: z35.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to look back"),
4085
- limit: z35.number().int().min(1).max(50).default(10).describe("Max entities to return")
4212
+ period: z36.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to look back"),
4213
+ limit: z36.number().int().min(1).max(50).default(10).describe("Max entities to return")
4086
4214
  }
4087
4215
  },
4088
4216
  async ({ period, limit }) => {
@@ -4129,8 +4257,7 @@ function registerGetHotEntities(server) {
4129
4257
  }
4130
4258
 
4131
4259
  // src/mcp/tools/get-graph-stats.ts
4132
- init_database();
4133
- import { z as z36 } from "zod";
4260
+ import { z as z37 } from "zod";
4134
4261
  function registerGetGraphStats(server) {
4135
4262
  server.registerTool(
4136
4263
  "get_graph_stats",
@@ -4138,7 +4265,7 @@ function registerGetGraphStats(server) {
4138
4265
  title: "Get Graph Stats",
4139
4266
  description: "Get knowledge graph summary statistics: entity count, relationship count, and entity type breakdown.",
4140
4267
  inputSchema: {
4141
- _dummy: z36.string().optional().describe("Unused \u2014 no input required")
4268
+ _dummy: z37.string().optional().describe("Unused \u2014 no input required")
4142
4269
  }
4143
4270
  },
4144
4271
  async () => {
@@ -4178,8 +4305,7 @@ function registerGetGraphStats(server) {
4178
4305
  }
4179
4306
 
4180
4307
  // src/mcp/tools/export-graph.ts
4181
- init_database();
4182
- import { z as z37 } from "zod";
4308
+ import { z as z38 } from "zod";
4183
4309
  function registerExportGraph(server) {
4184
4310
  server.registerTool(
4185
4311
  "export_graph",
@@ -4187,7 +4313,7 @@ function registerExportGraph(server) {
4187
4313
  title: "Export Graph",
4188
4314
  description: "Export the knowledge graph as a markdown report (inline) or an interactive HTML visualization (writes file, returns path).",
4189
4315
  inputSchema: {
4190
- format: z37.enum(["html", "markdown"]).default("markdown").describe("Export format: markdown (inline) or html (file)")
4316
+ format: z38.enum(["html", "markdown"]).default("markdown").describe("Export format: markdown (inline) or html (file)")
4191
4317
  }
4192
4318
  },
4193
4319
  async ({ format: format2 }) => {
@@ -4236,8 +4362,7 @@ Open in a browser to explore interactively.`
4236
4362
  }
4237
4363
 
4238
4364
  // src/mcp/tools/merge-entities.ts
4239
- init_database();
4240
- import { z as z38 } from "zod";
4365
+ import { z as z39 } from "zod";
4241
4366
  function registerMergeEntities(server) {
4242
4367
  server.registerTool(
4243
4368
  "merge_entities",
@@ -4245,10 +4370,10 @@ function registerMergeEntities(server) {
4245
4370
  title: "Merge Entities",
4246
4371
  description: 'Merge duplicate GraphRAG entities. Moves all relationships and memory links from source to target entity, registers source name as alias, deletes source. Use when "Lenny" and "Leonard" should be the same entity.',
4247
4372
  inputSchema: {
4248
- source_name: z38.string().describe("Name of the entity to merge FROM (will be deleted)"),
4249
- source_type: z38.string().describe('Entity type (e.g., "person", "company", "product")'),
4250
- target_name: z38.string().describe("Name of the entity to merge INTO (will be kept)"),
4251
- target_type: z38.string().describe("Entity type of the target")
4373
+ source_name: z39.string().describe("Name of the entity to merge FROM (will be deleted)"),
4374
+ source_type: z39.string().describe('Entity type (e.g., "person", "company", "product")'),
4375
+ target_name: z39.string().describe("Name of the entity to merge INTO (will be kept)"),
4376
+ target_type: z39.string().describe("Entity type of the target")
4252
4377
  }
4253
4378
  },
4254
4379
  async ({ source_name, source_type, target_name, target_type }) => {
@@ -4293,8 +4418,7 @@ function registerMergeEntities(server) {
4293
4418
  }
4294
4419
 
4295
4420
  // src/mcp/tools/find-similar-trajectories.ts
4296
- init_skill_learning();
4297
- import { z as z39 } from "zod";
4421
+ import { z as z40 } from "zod";
4298
4422
  function registerFindSimilarTrajectories(server) {
4299
4423
  server.registerTool(
4300
4424
  "find_similar_trajectories",
@@ -4302,7 +4426,7 @@ function registerFindSimilarTrajectories(server) {
4302
4426
  title: "Find Similar Trajectories",
4303
4427
  description: 'Find past task trajectories that match a described tool sequence. Input a comma-separated tool sequence (e.g. "Read, Edit, Bash, Read") to find similar past workflows.',
4304
4428
  inputSchema: {
4305
- description: z39.string().describe(
4429
+ description: z40.string().describe(
4306
4430
  'Tool sequence to match \u2014 comma-separated tool names (e.g. "Read, Grep, Edit, Bash:npm, Bash:git")'
4307
4431
  )
4308
4432
  }
@@ -4406,24 +4530,24 @@ function registerGraph(server) {
4406
4530
  title: "Graph",
4407
4531
  description: "Consolidated GraphRAG tool. Actions: query_relationships, entity_neighbors, hot_entities, stats, export, merge_entities, similar_trajectories.",
4408
4532
  inputSchema: {
4409
- action: z40.enum(["query_relationships", "entity_neighbors", "hot_entities", "stats", "export", "merge_entities", "similar_trajectories"]).describe("Graph operation"),
4410
- query: z40.string().optional().describe("Query text for relationship or trajectory search"),
4411
- entity: z40.string().optional().describe("Entity name for entity_neighbors"),
4412
- entity_id: z40.string().optional().describe("Entity id for entity_neighbors/merge"),
4413
- from_entity: z40.string().optional().describe("Source entity for relationship query"),
4414
- to_entity: z40.string().optional().describe("Target entity for relationship query"),
4415
- source_id: z40.string().optional().describe("Source entity id for merge_entities"),
4416
- target_id: z40.string().optional().describe("Target entity id for merge_entities"),
4417
- entity_type: z40.string().optional().describe("Entity type filter"),
4418
- project_name: z40.string().optional().describe("Project filter"),
4419
- relationship_type: z40.string().optional().describe("Relationship type filter"),
4420
- since: z40.string().optional().describe("ISO lower-bound timestamp"),
4421
- as_of: z40.string().optional().describe("ISO 8601 timestamp for time-travel queries. Returns relationships valid at that point in time. Omit for current relationships only."),
4422
- limit: z40.coerce.number().int().min(1).max(200).optional().describe("Result limit"),
4423
- depth: z40.coerce.number().int().min(1).max(3).optional().describe("Neighbor traversal depth"),
4424
- output_path: z40.string().optional().describe("Path for export_graph output"),
4425
- format: z40.enum(["json", "graphml"]).optional().describe("Export format"),
4426
- min_count: z40.coerce.number().int().min(1).optional().describe("Minimum count for hot_entities")
4533
+ action: z41.enum(["query_relationships", "entity_neighbors", "hot_entities", "stats", "export", "merge_entities", "similar_trajectories"]).describe("Graph operation"),
4534
+ query: z41.string().optional().describe("Query text for relationship or trajectory search"),
4535
+ entity: z41.string().optional().describe("Entity name for entity_neighbors"),
4536
+ entity_id: z41.string().optional().describe("Entity id for entity_neighbors/merge"),
4537
+ from_entity: z41.string().optional().describe("Source entity for relationship query"),
4538
+ to_entity: z41.string().optional().describe("Target entity for relationship query"),
4539
+ source_id: z41.string().optional().describe("Source entity id for merge_entities"),
4540
+ target_id: z41.string().optional().describe("Target entity id for merge_entities"),
4541
+ entity_type: z41.string().optional().describe("Entity type filter"),
4542
+ project_name: z41.string().optional().describe("Project filter"),
4543
+ relationship_type: z41.string().optional().describe("Relationship type filter"),
4544
+ since: z41.string().optional().describe("ISO lower-bound timestamp"),
4545
+ as_of: z41.string().optional().describe("ISO 8601 timestamp for time-travel queries. Returns relationships valid at that point in time. Omit for current relationships only."),
4546
+ limit: z41.coerce.number().int().min(1).max(200).optional().describe("Result limit"),
4547
+ depth: z41.coerce.number().int().min(1).max(3).optional().describe("Neighbor traversal depth"),
4548
+ output_path: z41.string().optional().describe("Path for export_graph output"),
4549
+ format: z41.enum(["json", "graphml"]).optional().describe("Export format"),
4550
+ min_count: z41.coerce.number().int().min(1).optional().describe("Minimum count for hot_entities")
4427
4551
  }
4428
4552
  }, async (input, extra) => {
4429
4553
  const action = input.action;
@@ -4449,13 +4573,10 @@ function registerGraph(server) {
4449
4573
  }
4450
4574
 
4451
4575
  // src/mcp/tools/config.ts
4452
- import { z as z67 } from "zod";
4576
+ import { z as z68 } from "zod";
4453
4577
 
4454
4578
  // src/mcp/tools/set-agent-config.ts
4455
- import { z as z41 } from "zod";
4456
- init_agent_config();
4457
- init_runtime_table();
4458
- init_employees();
4579
+ import { z as z42 } from "zod";
4459
4580
  function registerSetAgentConfig(server) {
4460
4581
  server.registerTool(
4461
4582
  "set_agent_config",
@@ -4463,11 +4584,11 @@ function registerSetAgentConfig(server) {
4463
4584
  title: "Set Agent Config",
4464
4585
  description: "Set or view per-agent runtime, model, and MCP configuration. Controls which runtime (claude, codex, opencode), model, and MCP servers each agent uses when dispatched. COO-only. Omit runtime/model to view current config for an agent or all agents. Pass mcps to restrict which MCP servers an agent loads (exe-os always included).",
4465
4586
  inputSchema: {
4466
- agent_id: z41.string().optional().describe("Agent name, or 'default' for org-wide default. Omit to view all agents."),
4467
- runtime: z41.string().optional().describe(`Runtime: ${Object.keys(KNOWN_RUNTIMES).join(", ")}`),
4468
- model: z41.string().optional().describe("Model name (e.g. claude-opus-4, gpt-5.4, anthropic/claude-sonnet-4-6)"),
4469
- reasoning_effort: z41.string().optional().describe("Codex reasoning effort: low, medium, high, xhigh. Per-agent override for thinking/reasoning depth."),
4470
- mcps: z41.array(z41.string()).optional().describe("MCP server allowlist. Only these servers load for this agent. exe-os always included. Omit to load all MCPs.")
4587
+ agent_id: z42.string().optional().describe("Agent name, or 'default' for org-wide default. Omit to view all agents."),
4588
+ runtime: z42.string().optional().describe(`Runtime: ${Object.keys(KNOWN_RUNTIMES).join(", ")}`),
4589
+ model: z42.string().optional().describe("Model name (e.g. claude-opus-4, gpt-5.4, anthropic/claude-sonnet-4-6)"),
4590
+ reasoning_effort: z42.string().optional().describe("Codex reasoning effort: low, medium, high, xhigh. Per-agent override for thinking/reasoning depth."),
4591
+ mcps: z42.array(z42.string()).optional().describe("MCP server allowlist. Only these servers load for this agent. exe-os always included. Omit to load all MCPs.")
4471
4592
  }
4472
4593
  },
4473
4594
  async ({ agent_id, runtime, model, reasoning_effort, mcps }) => {
@@ -4479,14 +4600,12 @@ function registerSetAgentConfig(server) {
4479
4600
  } catch {
4480
4601
  }
4481
4602
  try {
4482
- const { getMySession } = (init_tmux_routing(), __toCommonJS(tmux_routing_exports));
4483
4603
  const session = getMySession();
4484
- if (session && !session.includes("-")) return true;
4604
+ if (session && !session.includes("-") && isCoordinatorName(agentId)) return true;
4485
4605
  } catch {
4486
4606
  }
4487
4607
  try {
4488
- const { isCoordinatorName: isCoordinatorName2 } = (init_employees(), __toCommonJS(employees_exports));
4489
- if (isCoordinatorName2(agentId)) return true;
4608
+ if (isCoordinatorName(agentId)) return true;
4490
4609
  } catch {
4491
4610
  }
4492
4611
  return false;
@@ -4586,9 +4705,7 @@ function registerSetAgentConfig(server) {
4586
4705
  }
4587
4706
 
4588
4707
  // src/mcp/tools/list-employees.ts
4589
- init_employees();
4590
- init_agent_config();
4591
- import { z as z42 } from "zod";
4708
+ import { z as z43 } from "zod";
4592
4709
  function registerListEmployees(server) {
4593
4710
  server.registerTool(
4594
4711
  "list_employees",
@@ -4596,7 +4713,7 @@ function registerListEmployees(server) {
4596
4713
  title: "List Employees",
4597
4714
  description: "List all AI employees in the organization with their role, runtime, and model configuration. Use to see who's on the team and how they're configured.",
4598
4715
  inputSchema: {
4599
- role: z42.string().optional().describe("Filter by role (case-insensitive)")
4716
+ role: z43.string().optional().describe("Filter by role (case-insensitive)")
4600
4717
  }
4601
4718
  },
4602
4719
  async ({ role }) => {
@@ -4652,7 +4769,7 @@ function registerListEmployees(server) {
4652
4769
  }
4653
4770
 
4654
4771
  // src/mcp/tools/get-agent-spend.ts
4655
- import { z as z43 } from "zod";
4772
+ import { z as z44 } from "zod";
4656
4773
  function estimateCost(input, output, cacheRead) {
4657
4774
  const inputCost = input / 1e6 * 15;
4658
4775
  const outputCost = output / 1e6 * 75;
@@ -4666,8 +4783,8 @@ function registerGetAgentSpend(server) {
4666
4783
  title: "Get Agent Spend",
4667
4784
  description: "Get per-agent token spend attribution. Shows input, output, and cache tokens consumed by each agent over a time period, with estimated cost.",
4668
4785
  inputSchema: {
4669
- period: z43.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to query"),
4670
- agent_id: z43.string().optional().describe("Filter to a specific agent (e.g. 'tom', 'yoshi')")
4786
+ period: z44.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to query"),
4787
+ agent_id: z44.string().optional().describe("Filter to a specific agent (e.g. 'tom', 'yoshi')")
4671
4788
  }
4672
4789
  },
4673
4790
  async ({ period, agent_id }) => {
@@ -4731,8 +4848,7 @@ function registerGetAgentSpend(server) {
4731
4848
  }
4732
4849
 
4733
4850
  // src/mcp/tools/list-agent-sessions.ts
4734
- init_session_registry();
4735
- import { z as z44 } from "zod";
4851
+ import { z as z45 } from "zod";
4736
4852
  function registerListAgentSessions(server) {
4737
4853
  server.registerTool(
4738
4854
  "list_agent_sessions",
@@ -4740,7 +4856,7 @@ function registerListAgentSessions(server) {
4740
4856
  title: "List Agent Sessions",
4741
4857
  description: "List all registered agent sessions with their agent ID, project, PID, and registration time.",
4742
4858
  inputSchema: {
4743
- _placeholder: z44.string().optional().describe("No input required")
4859
+ _placeholder: z45.string().optional().describe("No input required")
4744
4860
  }
4745
4861
  },
4746
4862
  async () => {
@@ -4786,8 +4902,7 @@ function registerListAgentSessions(server) {
4786
4902
  }
4787
4903
 
4788
4904
  // src/mcp/tools/get-session-kills.ts
4789
- init_session_kill_telemetry();
4790
- import { z as z45 } from "zod";
4905
+ import { z as z46 } from "zod";
4791
4906
  var PERIOD_MS2 = {
4792
4907
  "24h": 24 * 60 * 60 * 1e3,
4793
4908
  "7d": 7 * 24 * 60 * 60 * 1e3,
@@ -4803,7 +4918,7 @@ function registerGetSessionKills(server) {
4803
4918
  title: "Get Session Kills",
4804
4919
  description: "Get session kill telemetry: how many idle/TTL sessions were killed, tokens saved, and estimated cost savings over a time period.",
4805
4920
  inputSchema: {
4806
- period: z45.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to query")
4921
+ period: z46.enum(["24h", "7d", "30d"]).default("7d").describe("Time period to query")
4807
4922
  }
4808
4923
  },
4809
4924
  async ({ period }) => {
@@ -4842,7 +4957,7 @@ function registerGetSessionKills(server) {
4842
4957
  }
4843
4958
 
4844
4959
  // src/mcp/tools/get-daemon-health.ts
4845
- import { z as z46 } from "zod";
4960
+ import { z as z47 } from "zod";
4846
4961
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
4847
4962
  import path3 from "path";
4848
4963
  import { homedir as homedir2 } from "os";
@@ -4873,7 +4988,7 @@ function registerGetDaemonHealth(server) {
4873
4988
  title: "Get Daemon Health",
4874
4989
  description: "Check the embedding daemon (exed) health: whether it's running, its PID, uptime, and requests served.",
4875
4990
  inputSchema: {
4876
- _placeholder: z46.string().optional().describe("No input required")
4991
+ _placeholder: z47.string().optional().describe("No input required")
4877
4992
  }
4878
4993
  },
4879
4994
  async () => {
@@ -4905,6 +5020,14 @@ function registerGetDaemonHealth(server) {
4905
5020
  lines.push(`| Uptime | ${formatUptime(health.uptime)} |`);
4906
5021
  lines.push(`| Requests served | ${health.requests_served.toLocaleString()} |`);
4907
5022
  }
5023
+ try {
5024
+ const { getQueryCacheStats } = await import("./self-query-router-TRPHL54X.js");
5025
+ const cache = getQueryCacheStats();
5026
+ lines.push(`| Query cache size | ${cache.size} / ${cache.maxSize} |`);
5027
+ lines.push(`| Query cache hit rate | ${cache.hitRate} |`);
5028
+ lines.push(`| Query cache TTL | ${Math.round(cache.ttlMs / 6e4)}m |`);
5029
+ } catch {
5030
+ }
4908
5031
  const events = readMcpHttpEvents(50);
4909
5032
  const summary = summarizeMcpTransport(events);
4910
5033
  const lastEvent = events.at(-1);
@@ -4947,7 +5070,7 @@ function registerGetDaemonHealth(server) {
4947
5070
  import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
4948
5071
  import path4 from "path";
4949
5072
  import { homedir as homedir3 } from "os";
4950
- import { z as z47 } from "zod";
5073
+ import { z as z48 } from "zod";
4951
5074
  var PID_PATH2 = path4.join(homedir3(), ".exe-os", "exed.pid");
4952
5075
  function isDaemonAlive2() {
4953
5076
  try {
@@ -4967,7 +5090,7 @@ function registerMcpPing(server) {
4967
5090
  title: "MCP Ping",
4968
5091
  description: "Safe local MCP synthetic probe: daemon liveness plus privacy-safe transport/session summary.",
4969
5092
  inputSchema: {
4970
- _placeholder: z47.string().optional().describe("No input required")
5093
+ _placeholder: z48.string().optional().describe("No input required")
4971
5094
  }
4972
5095
  },
4973
5096
  async () => {
@@ -5000,11 +5123,7 @@ function registerMcpPing(server) {
5000
5123
  }
5001
5124
 
5002
5125
  // src/mcp/tools/get-auto-wake-status.ts
5003
- init_database();
5004
- init_session_registry();
5005
- import { z as z48 } from "zod";
5006
- init_employees();
5007
- init_task_scope();
5126
+ import { z as z49 } from "zod";
5008
5127
  function registerGetAutoWakeStatus(server) {
5009
5128
  server.registerTool(
5010
5129
  "get_auto_wake_status",
@@ -5012,7 +5131,7 @@ function registerGetAutoWakeStatus(server) {
5012
5131
  title: "Get Auto-Wake Status",
5013
5132
  description: "Check auto-wake status: orphaned tasks (assigned agent has no running session), tasks blocked by auto-wake retry limit, and session activity.",
5014
5133
  inputSchema: {
5015
- _placeholder: z48.string().optional().describe("No input required")
5134
+ _placeholder: z49.string().optional().describe("No input required")
5016
5135
  }
5017
5136
  },
5018
5137
  async () => {
@@ -5091,7 +5210,7 @@ function registerGetAutoWakeStatus(server) {
5091
5210
  }
5092
5211
 
5093
5212
  // src/mcp/tools/get-worker-gate.ts
5094
- import { z as z49 } from "zod";
5213
+ import { z as z50 } from "zod";
5095
5214
  import { readdirSync, existsSync as existsSync4 } from "fs";
5096
5215
  import path5 from "path";
5097
5216
  init_config();
@@ -5128,7 +5247,7 @@ async function getAgentSessionLoad() {
5128
5247
  try {
5129
5248
  const { listSessions: listSessions2 } = await import("./lib/session-registry.js");
5130
5249
  const { listTmuxSessions } = await import("./lib/tmux-status.js");
5131
- const { isCoordinatorName: isCoordinatorName2, baseAgentName } = await import("./lib/employees.js");
5250
+ const { isCoordinatorName: isCoordinatorName2, baseAgentName: baseAgentName2 } = await import("./lib/employees.js");
5132
5251
  const { isExeSession } = await import("./lib/tmux-routing.js");
5133
5252
  const registered = listSessions2();
5134
5253
  const liveTmux = new Set(listTmuxSessions());
@@ -5139,11 +5258,11 @@ async function getAgentSessionLoad() {
5139
5258
  return { sessions: [], totalLive: 0, busySessions: 0, idleSessions: 0 };
5140
5259
  }
5141
5260
  const { getClient: getClient2 } = await import("./lib/database.js");
5142
- const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-YIPIPEVK.js");
5261
+ const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-V2CTRHG7.js");
5143
5262
  const client = getClient2();
5144
5263
  const scope = sessionScopeFilter2();
5145
5264
  for (const s of liveAgentSessions) {
5146
- const agent = baseAgentName(s.agentId);
5265
+ const agent = baseAgentName2(s.agentId);
5147
5266
  const result3 = await client.execute({
5148
5267
  sql: `SELECT COUNT(*) as cnt FROM tasks
5149
5268
  WHERE assigned_to = ? AND status IN ('open', 'in_progress')${scope.sql}`,
@@ -5170,7 +5289,7 @@ function registerGetWorkerGate(server) {
5170
5289
  title: "Get Worker Gate",
5171
5290
  description: "Check worker concurrency gate and agent session utilization. Reports embed/summary worker slots AND live agent sessions with task load. Idle sessions (alive tmux, zero tasks) are excluded from the effective session count \u2014 they should not block new dispatches.",
5172
5291
  inputSchema: {
5173
- _placeholder: z49.string().optional().describe("No input required")
5292
+ _placeholder: z50.string().optional().describe("No input required")
5174
5293
  }
5175
5294
  },
5176
5295
  async () => {
@@ -5227,8 +5346,7 @@ function registerGetWorkerGate(server) {
5227
5346
  }
5228
5347
 
5229
5348
  // src/mcp/tools/run-memory-audit.ts
5230
- init_database();
5231
- import { z as z50 } from "zod";
5349
+ import { z as z51 } from "zod";
5232
5350
  function registerRunMemoryAudit(server) {
5233
5351
  server.registerTool(
5234
5352
  "run_memory_audit",
@@ -5236,8 +5354,8 @@ function registerRunMemoryAudit(server) {
5236
5354
  title: "Run Memory Audit",
5237
5355
  description: "Run a memory health audit: total counts, per-agent breakdown, null vectors, duplicates, FTS sync status, bloated records, and conflict detection (contradictory/superseded memories).",
5238
5356
  inputSchema: {
5239
- agent_id: z50.string().optional().describe("Filter audit to a specific agent"),
5240
- project_name: z50.string().optional().describe("Filter audit to a specific project")
5357
+ agent_id: z51.string().optional().describe("Filter audit to a specific agent"),
5358
+ project_name: z51.string().optional().describe("Filter audit to a specific project")
5241
5359
  }
5242
5360
  },
5243
5361
  async ({ agent_id, project_name }) => {
@@ -5272,8 +5390,7 @@ function registerRunMemoryAudit(server) {
5272
5390
  }
5273
5391
 
5274
5392
  // src/mcp/tools/run-consolidation.ts
5275
- init_database();
5276
- import { z as z51 } from "zod";
5393
+ import { z as z52 } from "zod";
5277
5394
  init_config();
5278
5395
  function registerRunConsolidation(server) {
5279
5396
  server.registerTool(
@@ -5282,7 +5399,7 @@ function registerRunConsolidation(server) {
5282
5399
  title: "Run Consolidation",
5283
5400
  description: "Run memory consolidation \u2014 synthesizes unconsolidated memories into meta-insights. Use dry_run=true (default) to preview without executing.",
5284
5401
  inputSchema: {
5285
- dry_run: z51.boolean().default(true).describe("Preview mode \u2014 show what would be consolidated without doing it")
5402
+ dry_run: z52.boolean().default(true).describe("Preview mode \u2014 show what would be consolidated without doing it")
5286
5403
  }
5287
5404
  },
5288
5405
  async ({ dry_run }) => {
@@ -5350,9 +5467,8 @@ function registerRunConsolidation(server) {
5350
5467
  }
5351
5468
 
5352
5469
  // src/mcp/tools/cloud-sync.ts
5353
- import { z as z52 } from "zod";
5470
+ import { z as z53 } from "zod";
5354
5471
  init_config();
5355
- init_database();
5356
5472
  function result(text3, isError = false) {
5357
5473
  return { content: [{ type: "text", text: text3 }], ...isError ? { isError: true } : {} };
5358
5474
  }
@@ -5433,9 +5549,9 @@ function registerCloudSync(server) {
5433
5549
  title: "Cloud Sync",
5434
5550
  description: "Consolidated Exe Cloud tool. Supports read-only status, normal sync-now, and explicitly confirmed post-key-rotation re-upload. Does not reveal recovery phrases and does not rotate keys.",
5435
5551
  inputSchema: {
5436
- action: z52.enum(["status", "sync", "reupload"]).default("sync").describe("Cloud operation. status is read-only; sync is normal sync-now; reupload repairs cloud after key rotation."),
5437
- force: z52.boolean().default(false).describe("Reserved for sync compatibility; normal cloud sync already runs when requested."),
5438
- confirm_local_db_source_of_truth: z52.string().optional().describe('Required for action=reupload. Must exactly equal "LOCAL DB IS SOURCE OF TRUTH".')
5552
+ action: z53.enum(["status", "sync", "reupload"]).default("sync").describe("Cloud operation. status is read-only; sync is normal sync-now; reupload repairs cloud after key rotation."),
5553
+ force: z53.boolean().default(false).describe("Reserved for sync compatibility; normal cloud sync already runs when requested."),
5554
+ confirm_local_db_source_of_truth: z53.string().optional().describe('Required for action=reupload. Must exactly equal "LOCAL DB IS SOURCE OF TRUTH".')
5439
5555
  }
5440
5556
  },
5441
5557
  async ({ action = "sync", confirm_local_db_source_of_truth }) => {
@@ -5507,7 +5623,7 @@ function registerCloudSync(server) {
5507
5623
  }
5508
5624
 
5509
5625
  // src/mcp/tools/orchestration-phase.ts
5510
- import { z as z53 } from "zod";
5626
+ import { z as z54 } from "zod";
5511
5627
  function render(info, prefix) {
5512
5628
  return [
5513
5629
  prefix,
@@ -5526,8 +5642,8 @@ function registerOrchestrationPhase(server) {
5526
5642
  title: "Orchestration Phase",
5527
5643
  description: "View or change the customer-owned orchestration maturity phase. MCP parity for `exe-os org phase`, `exe-os org unlock executives`, and `exe-os org unlock parallel`. This is a recommendation layer, not a blocker; it never exposes recovery phrases or secrets.",
5528
5644
  inputSchema: {
5529
- action: z53.enum(["status", "set", "unlock_executives", "unlock_parallel"]).default("status"),
5530
- phase: z53.enum(["phase_1_coo", "phase_2_executives", "phase_3_parallel_org", "1", "2", "3"]).optional().describe("Phase to set when action='set'.")
5645
+ action: z54.enum(["status", "set", "unlock_executives", "unlock_parallel"]).default("status"),
5646
+ phase: z54.enum(["phase_1_coo", "phase_2_executives", "phase_3_parallel_org", "1", "2", "3"]).optional().describe("Phase to set when action='set'.")
5531
5647
  }
5532
5648
  },
5533
5649
  async ({ action = "status", phase }) => {
@@ -5567,7 +5683,7 @@ function registerOrchestrationPhase(server) {
5567
5683
  }
5568
5684
 
5569
5685
  // src/mcp/tools/backup-vps.ts
5570
- import { z as z54 } from "zod";
5686
+ import { z as z55 } from "zod";
5571
5687
 
5572
5688
  // src/lib/vps-backup.ts
5573
5689
  import { createCipheriv, createDecipheriv, randomBytes } from "crypto";
@@ -5892,43 +6008,43 @@ function registerBackupVps(server) {
5892
6008
  {
5893
6009
  title: "VPS Backup",
5894
6010
  description: "Run VPS Postgres backup/restore workflows and check status.",
5895
- inputSchema: z54.discriminatedUnion("action", [
5896
- z54.object({
5897
- action: z54.literal("backup"),
5898
- databaseUrl: z54.string().min(1).describe("Postgres DATABASE_URL to dump from"),
5899
- encryptionKeyB64: z54.string().min(1).max(4096).optional().describe(
6011
+ inputSchema: z55.discriminatedUnion("action", [
6012
+ z55.object({
6013
+ action: z55.literal("backup"),
6014
+ databaseUrl: z55.string().min(1).describe("Postgres DATABASE_URL to dump from"),
6015
+ encryptionKeyB64: z55.string().min(1).max(4096).optional().describe(
5900
6016
  "Base64 AES-256 key (defaults to local master key if omitted)"
5901
6017
  ),
5902
- r2Bucket: z54.string().min(1).describe("R2 bucket name"),
5903
- r2Endpoint: z54.string().min(1).describe("R2 endpoint URL"),
5904
- r2AccessKeyId: z54.string().min(1).describe("R2 access key ID"),
5905
- r2SecretAccessKey: z54.string().min(1).describe("R2 secret access key")
6018
+ r2Bucket: z55.string().min(1).describe("R2 bucket name"),
6019
+ r2Endpoint: z55.string().min(1).describe("R2 endpoint URL"),
6020
+ r2AccessKeyId: z55.string().min(1).describe("R2 access key ID"),
6021
+ r2SecretAccessKey: z55.string().min(1).describe("R2 secret access key")
5906
6022
  }),
5907
- z54.object({
5908
- action: z54.literal("restore"),
5909
- databaseUrl: z54.string().min(1).describe("Target Postgres DATABASE_URL for restore"),
5910
- backupKey: z54.string().min(1).describe("R2 object key to restore from"),
5911
- encryptionKeyB64: z54.string().min(1).max(4096).optional().describe(
6023
+ z55.object({
6024
+ action: z55.literal("restore"),
6025
+ databaseUrl: z55.string().min(1).describe("Target Postgres DATABASE_URL for restore"),
6026
+ backupKey: z55.string().min(1).describe("R2 object key to restore from"),
6027
+ encryptionKeyB64: z55.string().min(1).max(4096).optional().describe(
5912
6028
  "Base64 AES-256 key (defaults to local master key if omitted)"
5913
6029
  ),
5914
- r2Bucket: z54.string().min(1).describe("R2 bucket name"),
5915
- r2Endpoint: z54.string().min(1).describe("R2 endpoint URL"),
5916
- r2AccessKeyId: z54.string().min(1).describe("R2 access key ID"),
5917
- r2SecretAccessKey: z54.string().min(1).describe("R2 secret access key")
6030
+ r2Bucket: z55.string().min(1).describe("R2 bucket name"),
6031
+ r2Endpoint: z55.string().min(1).describe("R2 endpoint URL"),
6032
+ r2AccessKeyId: z55.string().min(1).describe("R2 access key ID"),
6033
+ r2SecretAccessKey: z55.string().min(1).describe("R2 secret access key")
5918
6034
  }),
5919
- z54.object({
5920
- action: z54.literal("list"),
5921
- r2Bucket: z54.string().min(1).describe("R2 bucket name"),
5922
- r2Endpoint: z54.string().min(1).describe("R2 endpoint URL"),
5923
- r2AccessKeyId: z54.string().min(1).describe("R2 access key ID"),
5924
- r2SecretAccessKey: z54.string().min(1).describe("R2 secret access key")
6035
+ z55.object({
6036
+ action: z55.literal("list"),
6037
+ r2Bucket: z55.string().min(1).describe("R2 bucket name"),
6038
+ r2Endpoint: z55.string().min(1).describe("R2 endpoint URL"),
6039
+ r2AccessKeyId: z55.string().min(1).describe("R2 access key ID"),
6040
+ r2SecretAccessKey: z55.string().min(1).describe("R2 secret access key")
5925
6041
  }),
5926
- z54.object({
5927
- action: z54.literal("health"),
5928
- r2Bucket: z54.string().min(1).describe("R2 bucket name"),
5929
- r2Endpoint: z54.string().min(1).describe("R2 endpoint URL"),
5930
- r2AccessKeyId: z54.string().min(1).describe("R2 access key ID"),
5931
- r2SecretAccessKey: z54.string().min(1).describe("R2 secret access key")
6042
+ z55.object({
6043
+ action: z55.literal("health"),
6044
+ r2Bucket: z55.string().min(1).describe("R2 bucket name"),
6045
+ r2Endpoint: z55.string().min(1).describe("R2 endpoint URL"),
6046
+ r2AccessKeyId: z55.string().min(1).describe("R2 access key ID"),
6047
+ r2SecretAccessKey: z55.string().min(1).describe("R2 secret access key")
5932
6048
  })
5933
6049
  ])
5934
6050
  },
@@ -6066,7 +6182,7 @@ async function resolveEncryptionKey(providedB64) {
6066
6182
  }
6067
6183
 
6068
6184
  // src/mcp/tools/deploy-client.ts
6069
- import { z as z55 } from "zod";
6185
+ import { z as z56 } from "zod";
6070
6186
  import { execFile } from "child_process";
6071
6187
  import { promisify } from "util";
6072
6188
  import path6 from "path";
@@ -6240,12 +6356,12 @@ function registerDeployClient(server) {
6240
6356
  title: "Deploy Client",
6241
6357
  description: "Provision a Hostinger VPS and deploy exe-os for a client. Creates VPS, waits for ready state, runs Ansible playbook, verifies health.",
6242
6358
  inputSchema: {
6243
- client_name: z55.string().min(1).describe("Client name (used for hostname and identification)"),
6244
- domain: z55.string().min(1).describe("Domain name for the deployment (e.g., client.exe.ai)"),
6245
- region: z55.string().default("jakarta").describe("VPS region (default: jakarta)"),
6246
- plan: z55.string().default("kvm-2").describe("Hostinger VPS plan (default: kvm-2)"),
6247
- ssl_email: z55.string().email().describe("Email for Let's Encrypt SSL certificate"),
6248
- user_id: z55.string().min(1).describe("User/customer ID for inventory tracking")
6359
+ client_name: z56.string().min(1).describe("Client name (used for hostname and identification)"),
6360
+ domain: z56.string().min(1).describe("Domain name for the deployment (e.g., client.exe.ai)"),
6361
+ region: z56.string().default("jakarta").describe("VPS region (default: jakarta)"),
6362
+ plan: z56.string().default("kvm-2").describe("Hostinger VPS plan (default: kvm-2)"),
6363
+ ssl_email: z56.string().email().describe("Email for Let's Encrypt SSL certificate"),
6364
+ user_id: z56.string().min(1).describe("User/customer ID for inventory tracking")
6249
6365
  }
6250
6366
  },
6251
6367
  async ({ client_name, domain, region, plan, ssl_email, user_id }) => {
@@ -6406,8 +6522,7 @@ function buildInventoryRecord(params) {
6406
6522
  }
6407
6523
 
6408
6524
  // src/mcp/tools/get-license-status.ts
6409
- init_license();
6410
- import { z as z56 } from "zod";
6525
+ import { z as z57 } from "zod";
6411
6526
  var FEATURES = [
6412
6527
  "cloud_sync",
6413
6528
  "external_agents",
@@ -6421,7 +6536,7 @@ function registerGetLicenseStatus(server) {
6421
6536
  title: "Get License Status",
6422
6537
  description: "Get current license status: plan, validity, feature gates, limits, and expiry.",
6423
6538
  inputSchema: {
6424
- _dummy: z56.string().optional().describe("Unused \u2014 no input required")
6539
+ _dummy: z57.string().optional().describe("Unused \u2014 no input required")
6425
6540
  }
6426
6541
  },
6427
6542
  async () => {
@@ -6473,13 +6588,12 @@ function registerGetLicenseStatus(server) {
6473
6588
  }
6474
6589
 
6475
6590
  // src/mcp/tools/create-license.ts
6476
- init_license();
6477
6591
  import os from "os";
6478
6592
  import path7 from "path";
6479
6593
  import { randomBytes as randomBytes2, randomUUID } from "crypto";
6480
6594
  import { createRequire } from "module";
6481
6595
  import { pathToFileURL } from "url";
6482
- import { z as z57 } from "zod";
6596
+ import { z as z58 } from "zod";
6483
6597
  var prismaPromise = null;
6484
6598
  function loadPrisma() {
6485
6599
  if (!prismaPromise) {
@@ -6512,10 +6626,10 @@ function registerCreateLicense(server) {
6512
6626
  title: "Create License",
6513
6627
  description: "Generate an exe_sk_* license key for a user. Stores in billing.licenses. Returns the key to give to the customer.",
6514
6628
  inputSchema: {
6515
- email: z57.string().email().describe("Customer email address"),
6516
- name: z57.string().optional().describe("Customer name"),
6517
- plan: z57.enum(["free", "pro", "team", "agency", "enterprise"]).default("pro").describe("License plan tier"),
6518
- expires_in_days: z57.number().int().positive().default(365).describe("Days until expiration (default 365)")
6629
+ email: z58.string().email().describe("Customer email address"),
6630
+ name: z58.string().optional().describe("Customer name"),
6631
+ plan: z58.enum(["free", "pro", "team", "agency", "enterprise"]).default("pro").describe("License plan tier"),
6632
+ expires_in_days: z58.number().int().positive().default(365).describe("Days until expiration (default 365)")
6519
6633
  }
6520
6634
  },
6521
6635
  async ({ email, name, plan, expires_in_days }) => {
@@ -6570,7 +6684,7 @@ import os2 from "os";
6570
6684
  import path8 from "path";
6571
6685
  import { createRequire as createRequire2 } from "module";
6572
6686
  import { pathToFileURL as pathToFileURL2 } from "url";
6573
- import { z as z58 } from "zod";
6687
+ import { z as z59 } from "zod";
6574
6688
  var prismaPromise2 = null;
6575
6689
  function loadPrisma2() {
6576
6690
  if (!prismaPromise2) {
@@ -6600,7 +6714,7 @@ function registerListLicenses(server) {
6600
6714
  title: "List Licenses",
6601
6715
  description: "List all issued licenses with status (active/expired/revoked). Optionally filter by plan.",
6602
6716
  inputSchema: {
6603
- plan: z58.enum(["free", "pro", "team", "agency", "enterprise"]).optional().describe("Filter by plan tier (omit for all)")
6717
+ plan: z59.enum(["free", "pro", "team", "agency", "enterprise"]).optional().describe("Filter by plan tier (omit for all)")
6604
6718
  }
6605
6719
  },
6606
6720
  async ({ plan }) => {
@@ -6650,8 +6764,7 @@ function registerListLicenses(server) {
6650
6764
  }
6651
6765
 
6652
6766
  // src/mcp/tools/activate-license.ts
6653
- init_license();
6654
- import { z as z59 } from "zod";
6767
+ import { z as z60 } from "zod";
6655
6768
  function registerActivateLicense(server) {
6656
6769
  server.registerTool(
6657
6770
  "activate_license",
@@ -6659,7 +6772,7 @@ function registerActivateLicense(server) {
6659
6772
  title: "Activate License",
6660
6773
  description: "Activate an exe_sk_* license key on this device. Writes to ~/.exe-os/license.key, validates against Postgres, and caches the result.",
6661
6774
  inputSchema: {
6662
- key: z59.string().startsWith("exe_sk_").describe("License key (exe_sk_*)")
6775
+ key: z60.string().startsWith("exe_sk_").describe("License key (exe_sk_*)")
6663
6776
  }
6664
6777
  },
6665
6778
  async ({ key }) => {
@@ -6705,15 +6818,15 @@ Key saved to ~/.exe-os/license.key. Device ID: ${deviceId}`);
6705
6818
  }
6706
6819
 
6707
6820
  // src/mcp/tools/create-trigger.ts
6708
- import { z as z60 } from "zod";
6709
- var conditionSchema = z60.object({
6710
- field: z60.string().describe("Dot-path field to evaluate, e.g., 'stage' or 'amount'"),
6711
- op: z60.enum(["eq", "neq", "gt", "lt", "gte", "lte", "contains", "not_contains"]).describe("Comparison operator"),
6712
- value: z60.string().or(z60.number()).or(z60.boolean()).describe("Value to compare against")
6821
+ import { z as z61 } from "zod";
6822
+ var conditionSchema = z61.object({
6823
+ field: z61.string().describe("Dot-path field to evaluate, e.g., 'stage' or 'amount'"),
6824
+ op: z61.enum(["eq", "neq", "gt", "lt", "gte", "lte", "contains", "not_contains"]).describe("Comparison operator"),
6825
+ value: z61.string().or(z61.number()).or(z61.boolean()).describe("Value to compare against")
6713
6826
  });
6714
- var actionSchema = z60.object({
6715
- type: z60.enum(["send_whatsapp", "send_message", "create_task", "mcp_tool"]).describe("Action type to execute"),
6716
- params: z60.record(z60.string(), z60.string()).describe(
6827
+ var actionSchema = z61.object({
6828
+ type: z61.enum(["send_whatsapp", "send_message", "create_task", "mcp_tool"]).describe("Action type to execute"),
6829
+ params: z61.record(z61.string(), z61.string()).describe(
6717
6830
  "Action parameters. Supports {{record.field}} templates for dynamic values."
6718
6831
  )
6719
6832
  });
@@ -6724,24 +6837,24 @@ function registerCreateTrigger(server) {
6724
6837
  title: "Create Trigger",
6725
6838
  description: "Create a CRM event trigger or scheduled automation. When matching events occur (e.g., Deal.updated with stage=won), configured actions fire automatically (send_whatsapp, create_task, etc.).",
6726
6839
  inputSchema: {
6727
- name: z60.string().describe("Human-readable trigger name"),
6728
- event: z60.string().describe(
6840
+ name: z61.string().describe("Human-readable trigger name"),
6841
+ event: z61.string().describe(
6729
6842
  'CRM event to match, e.g., "Deal.updated", "Order.created", "*" for all'
6730
6843
  ),
6731
- conditions: z60.array(conditionSchema).default([]).describe("Conditions that must all match (AND logic)"),
6732
- actions: z60.array(actionSchema).min(1).describe("Actions to execute when trigger fires"),
6733
- project: z60.string().optional().describe("Scope trigger to a specific project"),
6734
- enabled: z60.boolean().default(true).describe("Whether trigger is active"),
6735
- schedule: z60.string().optional().describe(
6844
+ conditions: z61.array(conditionSchema).default([]).describe("Conditions that must all match (AND logic)"),
6845
+ actions: z61.array(actionSchema).min(1).describe("Actions to execute when trigger fires"),
6846
+ project: z61.string().optional().describe("Scope trigger to a specific project"),
6847
+ enabled: z61.boolean().default(true).describe("Whether trigger is active"),
6848
+ schedule: z61.string().optional().describe(
6736
6849
  'Cron schedule for time-based triggers, e.g., "0 9 * * *" or "Monday 9am"'
6737
6850
  ),
6738
- query: z60.string().optional().describe(
6851
+ query: z61.string().optional().describe(
6739
6852
  "CRM GraphQL query to run on schedule (required if schedule is set)"
6740
6853
  )
6741
6854
  }
6742
6855
  },
6743
6856
  async ({ name, event, conditions, actions, project, enabled, schedule, query }) => {
6744
- const { assertFeature: assertFeature2 } = await import("./plan-limits-TK4424RV.js");
6857
+ const { assertFeature: assertFeature2 } = await import("./plan-limits-7L75PB33.js");
6745
6858
  const gatedActions = {
6746
6859
  send_whatsapp: "external_agents",
6747
6860
  update_wiki: "wiki"
@@ -6760,7 +6873,14 @@ function registerCreateTrigger(server) {
6760
6873
  ]
6761
6874
  };
6762
6875
  }
6763
- const typedActions = actions;
6876
+ const typedActions = actions.map(
6877
+ (a) => ({
6878
+ ...a,
6879
+ params: Object.fromEntries(
6880
+ Object.entries(a.params).map(([k, v]) => [k, sanitizeParam(String(v))])
6881
+ )
6882
+ })
6883
+ );
6764
6884
  const typedConditions = conditions;
6765
6885
  const triggerInput = {
6766
6886
  name,
@@ -6808,7 +6928,7 @@ Enabled: ${trigger.enabled}` + scheduleInfo;
6808
6928
  }
6809
6929
 
6810
6930
  // src/mcp/tools/list-triggers.ts
6811
- import { z as z61 } from "zod";
6931
+ import { z as z62 } from "zod";
6812
6932
  function registerListTriggers(server) {
6813
6933
  server.registerTool(
6814
6934
  "list_triggers",
@@ -6816,7 +6936,7 @@ function registerListTriggers(server) {
6816
6936
  title: "List Triggers",
6817
6937
  description: "List configured CRM event triggers and scheduled automations.",
6818
6938
  inputSchema: {
6819
- project: z61.string().optional().describe("Filter triggers by project name")
6939
+ project: z62.string().optional().describe("Filter triggers by project name")
6820
6940
  }
6821
6941
  },
6822
6942
  async ({ project }) => {
@@ -6851,7 +6971,7 @@ function registerListTriggers(server) {
6851
6971
  }
6852
6972
 
6853
6973
  // src/mcp/tools/apply-starter-pack.ts
6854
- import { z as z62 } from "zod";
6974
+ import { z as z63 } from "zod";
6855
6975
 
6856
6976
  // src/automation/starter-packs/index.ts
6857
6977
  import { readFileSync as readFileSync4, readdirSync as readdirSync2, existsSync as existsSync6 } from "fs";
@@ -6974,9 +7094,6 @@ function applyPack(industry, project) {
6974
7094
  init_config();
6975
7095
  import { existsSync as existsSync7, mkdirSync, writeFileSync as writeFileSync3 } from "fs";
6976
7096
  import path10 from "path";
6977
- init_employees();
6978
- init_behaviors();
6979
- init_plan_limits();
6980
7097
  var ClientCOOClobberError = class extends Error {
6981
7098
  constructor(agentName, identityPath) {
6982
7099
  super(
@@ -7037,17 +7154,17 @@ function registerApplyStarterPack(server) {
7037
7154
  title: "Apply Starter Pack",
7038
7155
  description: "Apply an industry starter pack to a project. Sets up CRM custom objects, pre-wired automation triggers, and wiki seed content. When the pack creates a Client COO (e.g. distribution) and agent_name, company_name, founder_name are all provided, also provisions the COO identity, roster entry, and feedback-loop behavior. Available packs: distribution. More coming.",
7039
7156
  inputSchema: {
7040
- industry: z62.string().describe(
7157
+ industry: z63.string().describe(
7041
7158
  'Industry pack to apply (e.g., "distribution"). Use without args to list available packs.'
7042
7159
  ),
7043
- project: z62.string().describe("Project name to scope the triggers to"),
7044
- agent_name: z62.string().optional().describe(
7160
+ project: z63.string().describe("Project name to scope the triggers to"),
7161
+ agent_name: z63.string().optional().describe(
7045
7162
  "Optional. Lowercase alphanumeric name for the Client COO agent. Required (alongside company_name and founder_name) to provision a COO."
7046
7163
  ),
7047
- company_name: z62.string().optional().describe(
7164
+ company_name: z63.string().optional().describe(
7048
7165
  "Optional. The client company the COO serves. Required to provision a COO."
7049
7166
  ),
7050
- founder_name: z62.string().optional().describe(
7167
+ founder_name: z63.string().optional().describe(
7051
7168
  "Optional. The founder the COO reports to. Required to provision a COO."
7052
7169
  )
7053
7170
  }
@@ -7192,7 +7309,7 @@ ${err.message}`
7192
7309
  }
7193
7310
 
7194
7311
  // src/mcp/tools/load-skill.ts
7195
- import { z as z63 } from "zod";
7312
+ import { z as z64 } from "zod";
7196
7313
  import { readFileSync as readFileSync5, readdirSync as readdirSync3, statSync } from "fs";
7197
7314
  import path11 from "path";
7198
7315
  import { homedir as homedir4 } from "os";
@@ -7222,7 +7339,7 @@ function registerLoadSkill(server) {
7222
7339
  title: "Load Skill",
7223
7340
  description: "Load domain-specific guidance into your context. Use when you need specialized knowledge for a task (e.g., load_skill('seo') before doing SEO work, load_skill('code-reviewer') before reviewing code). Pass skill_name='list' to see all available skills.",
7224
7341
  inputSchema: {
7225
- skill_name: z63.string().describe(
7342
+ skill_name: z64.string().describe(
7226
7343
  "Skill to load (e.g. 'seo', 'code-reviewer', 'frontend-design'). Pass 'list' to see all available skills."
7227
7344
  )
7228
7345
  }
@@ -7279,7 +7396,7 @@ ${available.map((s) => `- ${s}`).join("\n")}` : "\n\nNo skills found in ~/.claud
7279
7396
  // src/mcp/tools/export-orchestration.ts
7280
7397
  import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync4 } from "fs";
7281
7398
  import path12 from "path";
7282
- import { z as z64 } from "zod";
7399
+ import { z as z65 } from "zod";
7283
7400
  function registerExportOrchestration(server) {
7284
7401
  server.registerTool(
7285
7402
  "export_orchestration",
@@ -7287,7 +7404,7 @@ function registerExportOrchestration(server) {
7287
7404
  title: "Export Orchestration",
7288
7405
  description: "Export roster, identities, behaviors, and customer procedures to a JSON package.",
7289
7406
  inputSchema: {
7290
- output_path: z64.string().describe("File path to write the JSON package")
7407
+ output_path: z65.string().describe("File path to write the JSON package")
7291
7408
  }
7292
7409
  },
7293
7410
  async ({ output_path }) => {
@@ -7318,8 +7435,7 @@ function registerExportOrchestration(server) {
7318
7435
 
7319
7436
  // src/mcp/tools/import-orchestration.ts
7320
7437
  import { readFileSync as readFileSync6 } from "fs";
7321
- import { z as z65 } from "zod";
7322
- init_employees();
7438
+ import { z as z66 } from "zod";
7323
7439
  function registerImportOrchestration(server) {
7324
7440
  server.registerTool(
7325
7441
  "import_orchestration",
@@ -7327,8 +7443,8 @@ function registerImportOrchestration(server) {
7327
7443
  title: "Import Orchestration",
7328
7444
  description: "Import roster, identities, behaviors, and procedures from an orchestration package. Restricted to coordinator/founder.",
7329
7445
  inputSchema: {
7330
- package_path: z65.string().describe("Path to the orchestration package JSON file"),
7331
- merge_strategy: z65.enum(["replace", "merge"]).default("merge").describe("How to apply the package: both strategies are additive-only \u2014 existing data is never deleted or overwritten")
7446
+ package_path: z66.string().describe("Path to the orchestration package JSON file"),
7447
+ merge_strategy: z66.enum(["replace", "merge"]).default("merge").describe("How to apply the package: both strategies are additive-only \u2014 existing data is never deleted or overwritten")
7332
7448
  }
7333
7449
  },
7334
7450
  async ({ package_path, merge_strategy }) => {
@@ -7368,9 +7484,7 @@ function registerImportOrchestration(server) {
7368
7484
  }
7369
7485
 
7370
7486
  // src/mcp/tools/global-procedure.ts
7371
- import { z as z66 } from "zod";
7372
- init_database();
7373
- init_employees();
7487
+ import { z as z67 } from "zod";
7374
7488
  function registerCompanyProcedureTool(server, toolName) {
7375
7489
  server.registerTool(
7376
7490
  toolName,
@@ -7378,12 +7492,12 @@ function registerCompanyProcedureTool(server, toolName) {
7378
7492
  title: "Company Procedure",
7379
7493
  description: "Manage company procedures (customer-owned Layer 0 rules) that supersede identity, expertise, and experience. Actions: store (create new, restricted), list (view all, open), deactivate (soft-delete, restricted).",
7380
7494
  inputSchema: {
7381
- action: z66.enum(["store", "list", "deactivate"]).describe("Action to perform"),
7382
- title: z66.string().optional().describe("Short title for the procedure (store)"),
7383
- content: z66.string().max(500).optional().describe("The procedure content \u2014 clear, actionable instruction (store)"),
7384
- priority: z66.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always (default). p1 = standard. p2 = nice-to-have."),
7385
- domain: z66.string().optional().describe("Category: workflow, code-style, communication, architecture, testing, security"),
7386
- procedure_id: z66.string().optional().describe("UUID of the company procedure (deactivate)")
7495
+ action: z67.enum(["store", "list", "deactivate"]).describe("Action to perform"),
7496
+ title: z67.string().optional().describe("Short title for the procedure (store)"),
7497
+ content: z67.string().max(500).optional().describe("The procedure content \u2014 clear, actionable instruction (store)"),
7498
+ priority: z67.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always (default). p1 = standard. p2 = nice-to-have."),
7499
+ domain: z67.string().optional().describe("Category: workflow, code-style, communication, architecture, testing, security"),
7500
+ procedure_id: z67.string().optional().describe("UUID of the company procedure (deactivate)")
7387
7501
  }
7388
7502
  },
7389
7503
  async ({ action, title, content, priority, domain, procedure_id }) => {
@@ -7579,45 +7693,45 @@ function registerConfig(server) {
7579
7693
  title: "Config",
7580
7694
  description: "Consolidated COO/admin tool for runtime config, system health, licensing, triggers, orchestration import/export, and company procedures.",
7581
7695
  inputSchema: {
7582
- action: z67.enum(Object.keys(ACTION_TO_TOOL2)).describe("Admin/config operation"),
7583
- agent_id: z67.string().optional().describe("Agent id for set_agent_config/agent_spend/session queries/hire"),
7584
- role: z67.string().optional().describe("Role template for action=hire: coo, cto, cmo, gm, principal-engineer, content-specialist, ai-specialist, staff-code-reviewer"),
7585
- runtime: z67.string().optional().describe("Runtime for set_agent_config"),
7586
- model: z67.string().optional().describe("Model for set_agent_config"),
7587
- reasoning_effort: z67.string().optional().describe("Reasoning effort for Codex agents"),
7588
- dry_run: z67.boolean().optional().describe("Preview without applying where supported"),
7589
- fix: z67.boolean().optional().describe("Apply fixes for memory_audit where supported"),
7590
- verbose: z67.boolean().optional().describe("Verbose output where supported"),
7591
- project_name: z67.string().optional().describe("Project filter/name"),
7592
- since: z67.string().optional().describe("ISO lower-bound timestamp"),
7593
- limit: z67.coerce.number().optional().describe("Result limit"),
7594
- output_path: z67.string().optional().describe("Output path for export/backup"),
7595
- input_path: z67.string().optional().describe("Input path for import_orchestration"),
7596
- strategy: z67.enum(["merge", "replace"]).optional().describe("Import strategy; replace must still be additive-only per platform rules"),
7597
- license_key: z67.string().optional().describe("License key for activation/status"),
7598
- email: z67.string().optional().describe("Customer email for license creation"),
7599
- plan: z67.string().optional().describe("License plan"),
7600
- name: z67.string().optional().describe("Trigger/starter pack/procedure/client name"),
7601
- event: z67.string().optional().describe("Trigger event"),
7602
- conditions: z67.array(z67.record(z67.string(), z67.unknown())).optional().describe("Trigger conditions"),
7603
- actions: z67.array(z67.record(z67.string(), z67.unknown())).optional().describe("Trigger actions"),
7604
- enabled: z67.boolean().optional().describe("Trigger enabled flag"),
7605
- schedule: z67.string().optional().describe("Trigger schedule"),
7606
- query: z67.string().optional().describe("Trigger query or filter"),
7607
- skill_name: z67.string().optional().describe("Skill name for load_skill"),
7608
- pack_name: z67.string().optional().describe("Starter pack name"),
7609
- title: z67.string().optional().describe("Procedure title"),
7610
- content: z67.string().optional().describe("Procedure content"),
7611
- priority: z67.enum(["p0", "p1", "p2"]).optional().describe("Procedure priority"),
7612
- domain: z67.string().optional().describe("Procedure domain"),
7613
- procedure_id: z67.string().optional().describe("Procedure id for deactivate"),
7614
- subaction: z67.enum(["store", "list", "deactivate"]).optional().describe("Nested action for company_procedure/global_procedure"),
7615
- max_clusters: z67.coerce.number().optional().describe("Consolidation max clusters"),
7616
- force: z67.boolean().optional().describe("Force operation where supported"),
7617
- cloud_action: z67.enum(["status", "sync", "reupload"]).optional().describe("Nested operation for action=cloud_sync"),
7618
- confirm_local_db_source_of_truth: z67.string().optional().describe("Required for cloud_action=reupload; must exactly equal LOCAL DB IS SOURCE OF TRUTH"),
7619
- domain_name: z67.string().optional().describe("Client deployment domain"),
7620
- phase: z67.enum(["phase_1_coo", "phase_2_executives", "phase_3_parallel_org", "1", "2", "3"]).optional().describe("Orchestration phase for orchestration_phase action")
7696
+ action: z68.enum(Object.keys(ACTION_TO_TOOL2)).describe("Admin/config operation"),
7697
+ agent_id: z68.string().optional().describe("Agent id for set_agent_config/agent_spend/session queries/hire"),
7698
+ role: z68.string().optional().describe("Role template for action=hire: coo, cto, cmo, gm, principal-engineer, content-specialist, ai-specialist, staff-code-reviewer"),
7699
+ runtime: z68.string().optional().describe("Runtime for set_agent_config"),
7700
+ model: z68.string().optional().describe("Model for set_agent_config"),
7701
+ reasoning_effort: z68.string().optional().describe("Reasoning effort for Codex agents"),
7702
+ dry_run: z68.boolean().optional().describe("Preview without applying where supported"),
7703
+ fix: z68.boolean().optional().describe("Apply fixes for memory_audit where supported"),
7704
+ verbose: z68.boolean().optional().describe("Verbose output where supported"),
7705
+ project_name: z68.string().optional().describe("Project filter/name"),
7706
+ since: z68.string().optional().describe("ISO lower-bound timestamp"),
7707
+ limit: z68.coerce.number().optional().describe("Result limit"),
7708
+ output_path: z68.string().optional().describe("Output path for export/backup"),
7709
+ input_path: z68.string().optional().describe("Input path for import_orchestration"),
7710
+ strategy: z68.enum(["merge", "replace"]).optional().describe("Import strategy; replace must still be additive-only per platform rules"),
7711
+ license_key: z68.string().optional().describe("License key for activation/status"),
7712
+ email: z68.string().optional().describe("Customer email for license creation"),
7713
+ plan: z68.string().optional().describe("License plan"),
7714
+ name: z68.string().optional().describe("Trigger/starter pack/procedure/client name"),
7715
+ event: z68.string().optional().describe("Trigger event"),
7716
+ conditions: z68.array(z68.record(z68.string(), z68.unknown())).optional().describe("Trigger conditions"),
7717
+ actions: z68.array(z68.record(z68.string(), z68.unknown())).optional().describe("Trigger actions"),
7718
+ enabled: z68.boolean().optional().describe("Trigger enabled flag"),
7719
+ schedule: z68.string().optional().describe("Trigger schedule"),
7720
+ query: z68.string().optional().describe("Trigger query or filter"),
7721
+ skill_name: z68.string().optional().describe("Skill name for load_skill"),
7722
+ pack_name: z68.string().optional().describe("Starter pack name"),
7723
+ title: z68.string().optional().describe("Procedure title"),
7724
+ content: z68.string().optional().describe("Procedure content"),
7725
+ priority: z68.enum(["p0", "p1", "p2"]).optional().describe("Procedure priority"),
7726
+ domain: z68.string().optional().describe("Procedure domain"),
7727
+ procedure_id: z68.string().optional().describe("Procedure id for deactivate"),
7728
+ subaction: z68.enum(["store", "list", "deactivate"]).optional().describe("Nested action for company_procedure/global_procedure"),
7729
+ max_clusters: z68.coerce.number().optional().describe("Consolidation max clusters"),
7730
+ force: z68.boolean().optional().describe("Force operation where supported"),
7731
+ cloud_action: z68.enum(["status", "sync", "reupload"]).optional().describe("Nested operation for action=cloud_sync"),
7732
+ confirm_local_db_source_of_truth: z68.string().optional().describe("Required for cloud_action=reupload; must exactly equal LOCAL DB IS SOURCE OF TRUTH"),
7733
+ domain_name: z68.string().optional().describe("Client deployment domain"),
7734
+ phase: z68.enum(["phase_1_coo", "phase_2_executives", "phase_3_parallel_org", "1", "2", "3"]).optional().describe("Orchestration phase for orchestration_phase action")
7621
7735
  }
7622
7736
  }, async (input, extra) => {
7623
7737
  const action = input.action;
@@ -7645,7 +7759,7 @@ function registerConfig(server) {
7645
7759
  const existing = loadEmployeesSync2();
7646
7760
  if (existing.some((e) => e.name === employeeName)) return errorResult8(`Employee "${employeeName}" already exists.`);
7647
7761
  try {
7648
- const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-TK4424RV.js");
7762
+ const { assertEmployeeLimit: assertEmployeeLimit2 } = await import("./plan-limits-7L75PB33.js");
7649
7763
  await assertEmployeeLimit2();
7650
7764
  } catch (e) {
7651
7765
  return errorResult8(e instanceof Error ? e.message : "Employee limit reached.");
@@ -7686,7 +7800,7 @@ You are ${employeeName}. Role: ${role}.`, "utf-8");
7686
7800
  }
7687
7801
  try {
7688
7802
  const { generateSessionWrappers } = await import("./lib/session-wrappers.js");
7689
- const { resolvePackageRoot } = await import("./installer-2O362XY7.js");
7803
+ const { resolvePackageRoot } = await import("./installer-SSR2OOLO.js");
7690
7804
  generateSessionWrappers(resolvePackageRoot());
7691
7805
  } catch {
7692
7806
  }
@@ -7705,10 +7819,10 @@ You are ${employeeName}. Role: ${role}.`, "utf-8");
7705
7819
  }
7706
7820
 
7707
7821
  // src/mcp/tools/wiki.ts
7708
- import { z as z70 } from "zod";
7822
+ import { z as z71 } from "zod";
7709
7823
 
7710
7824
  // src/mcp/tools/list-wiki-pages.ts
7711
- import { z as z68 } from "zod";
7825
+ import { z as z69 } from "zod";
7712
7826
  var FETCH_TIMEOUT_MS2 = 1e4;
7713
7827
  function registerListWikiPages(server) {
7714
7828
  server.registerTool(
@@ -7717,12 +7831,12 @@ function registerListWikiPages(server) {
7717
7831
  title: "List Wiki Pages",
7718
7832
  description: "List documents in an exe-wiki workspace. Optionally filter by folder.",
7719
7833
  inputSchema: {
7720
- workspace: z68.string().describe('Wiki workspace slug (e.g., "hygo")'),
7721
- folder: z68.string().optional().describe("Filter by folder path")
7834
+ workspace: z69.string().describe('Wiki workspace slug (e.g., "hygo")'),
7835
+ folder: z69.string().optional().describe("Filter by folder path")
7722
7836
  }
7723
7837
  },
7724
7838
  async ({ workspace, folder }) => {
7725
- const { assertFeature: assertFeature2 } = await import("./plan-limits-TK4424RV.js");
7839
+ const { assertFeature: assertFeature2 } = await import("./plan-limits-7L75PB33.js");
7726
7840
  await assertFeature2("wiki");
7727
7841
  const apiUrl = process.env.EXE_WIKI_API_URL;
7728
7842
  const apiKey = process.env.EXE_WIKI_API_KEY;
@@ -7807,7 +7921,7 @@ function registerListWikiPages(server) {
7807
7921
  }
7808
7922
 
7809
7923
  // src/mcp/tools/get-wiki-page.ts
7810
- import { z as z69 } from "zod";
7924
+ import { z as z70 } from "zod";
7811
7925
  var FETCH_TIMEOUT_MS3 = 1e4;
7812
7926
  function registerGetWikiPage(server) {
7813
7927
  server.registerTool(
@@ -7816,13 +7930,13 @@ function registerGetWikiPage(server) {
7816
7930
  title: "Get Wiki Page",
7817
7931
  description: "Read a wiki page by document ID or title. Returns content, metadata, and folder path. Use title search when you know the page name but not the ID.",
7818
7932
  inputSchema: {
7819
- workspace: z69.string().describe('Wiki workspace slug (e.g., "hygo")'),
7820
- document_id: z69.string().optional().describe("Specific document ID (exact lookup)"),
7821
- title: z69.string().optional().describe("Search by title (fuzzy match)")
7933
+ workspace: z70.string().describe('Wiki workspace slug (e.g., "hygo")'),
7934
+ document_id: z70.string().optional().describe("Specific document ID (exact lookup)"),
7935
+ title: z70.string().optional().describe("Search by title (fuzzy match)")
7822
7936
  }
7823
7937
  },
7824
7938
  async ({ workspace, document_id, title }) => {
7825
- const { assertFeature: assertFeature2 } = await import("./plan-limits-TK4424RV.js");
7939
+ const { assertFeature: assertFeature2 } = await import("./plan-limits-7L75PB33.js");
7826
7940
  await assertFeature2("wiki");
7827
7941
  const apiUrl = process.env.EXE_WIKI_API_URL;
7828
7942
  const apiKey = process.env.EXE_WIKI_API_KEY;
@@ -8000,15 +8114,15 @@ function registerWiki(server) {
8000
8114
  title: "Wiki",
8001
8115
  description: "Consolidated wiki domain tool. Actions: list, get. Wiki writes flow through raw data ingestion/projection into the curated wiki store; direct create/update MCP tools have been removed.",
8002
8116
  inputSchema: {
8003
- action: z70.enum(["list", "get"]).describe("Wiki read operation. Writes use raw-data ingestion/projection, not direct MCP writes."),
8004
- workspace: z70.string().optional().describe("Wiki workspace slug"),
8005
- title: z70.string().optional().describe("Fuzzy page title lookup for get"),
8006
- content: z70.string().optional().describe("Reserved; wiki writes use raw-data ingestion/projection"),
8007
- folder: z70.string().optional().describe("Optional folder path for list"),
8008
- document_id: z70.string().optional().describe("Document ID for get"),
8009
- mode: z70.enum(["replace", "append"]).optional().describe("Reserved; direct wiki updates are removed"),
8010
- section: z70.string().optional().describe("Reserved; direct wiki updates are removed"),
8011
- user_id: z70.string().optional().describe("User ID for ACL enforcement. When set, workspace access is checked against wiki_acl table.")
8117
+ action: z71.enum(["list", "get"]).describe("Wiki read operation. Writes use raw-data ingestion/projection, not direct MCP writes."),
8118
+ workspace: z71.string().optional().describe("Wiki workspace slug"),
8119
+ title: z71.string().optional().describe("Fuzzy page title lookup for get"),
8120
+ content: z71.string().optional().describe("Reserved; wiki writes use raw-data ingestion/projection"),
8121
+ folder: z71.string().optional().describe("Optional folder path for list"),
8122
+ document_id: z71.string().optional().describe("Document ID for get"),
8123
+ mode: z71.enum(["replace", "append"]).optional().describe("Reserved; direct wiki updates are removed"),
8124
+ section: z71.string().optional().describe("Reserved; direct wiki updates are removed"),
8125
+ user_id: z71.string().optional().describe("User ID for ACL enforcement. When set, workspace access is checked against wiki_acl table.")
8012
8126
  }
8013
8127
  },
8014
8128
  async (input, extra) => {
@@ -8017,7 +8131,7 @@ function registerWiki(server) {
8017
8131
  if (!legacyToolName) return errorResult9(`Unknown wiki action: ${String(input.action)}`);
8018
8132
  const { action: _action, user_id, ...legacyArgs } = input;
8019
8133
  if (user_id && legacyArgs.workspace) {
8020
- const { checkWikiAccess } = await import("./wiki-acl-OSBQJD2E.js");
8134
+ const { checkWikiAccess } = await import("./wiki-acl-R4IIHICT.js");
8021
8135
  const { allowed } = await checkWikiAccess(
8022
8136
  String(user_id),
8023
8137
  String(legacyArgs.workspace),
@@ -8042,11 +8156,7 @@ function registerWiki(server) {
8042
8156
  }
8043
8157
 
8044
8158
  // src/mcp/tools/behavior.ts
8045
- init_behaviors();
8046
- import { z as z71 } from "zod";
8047
- init_project_name();
8048
- init_database();
8049
- init_employees();
8159
+ import { z as z72 } from "zod";
8050
8160
  function rowToBehavior2(r) {
8051
8161
  return {
8052
8162
  id: String(r.id),
@@ -8071,22 +8181,47 @@ function registerBehavior(server) {
8071
8181
  title: "Behavior",
8072
8182
  description: "Manage behavioral patterns, corrections, and reusable procedures for employees. Actions: store (create new), list (query existing), audit (creation context), deactivate (soft-delete, restricted).",
8073
8183
  inputSchema: {
8074
- action: z71.enum(["store", "list", "deactivate", "audit"]).describe("Action to perform"),
8075
- content: z71.string().max(500).optional().describe("The behavioral instruction \u2014 one clear sentence (store)"),
8076
- domain: z71.string().optional().describe("Category: workflow, code-style, tool-use, communication, architecture, testing"),
8077
- priority: z71.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always included. p1 = standard (default). p2 = nice-to-have."),
8078
- agent_id: z71.string().optional().describe("Employee name. Defaults to current agent. Pass 'all' to list everyone's (list only)."),
8079
- project_name: z71.string().optional().describe("Defaults to current project. Pass 'global' for a behavior that applies everywhere (store)."),
8080
- behavior_id: z71.string().optional().describe("UUID of the behavior (deactivate)")
8184
+ action: z72.enum(["store", "list", "deactivate", "audit"]).describe("Action to perform"),
8185
+ content: z72.string().max(500).optional().describe("The behavioral instruction \u2014 one clear sentence (store)"),
8186
+ domain: z72.string().optional().describe("Category: workflow, code-style, tool-use, communication, architecture, testing"),
8187
+ priority: z72.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always included. p1 = standard (default). p2 = nice-to-have."),
8188
+ agent_id: z72.string().optional().describe("Employee name. Defaults to current agent. Pass 'all' to list everyone's (list only)."),
8189
+ project_name: z72.string().optional().describe("Defaults to current project. Pass 'global' for a behavior that applies everywhere (store)."),
8190
+ behavior_id: z72.string().optional().describe("UUID of the behavior (deactivate)"),
8191
+ shared_skills: z72.boolean().optional().describe("When true with action=list, include skills (domain='skill') from ALL agents. Default: false.")
8081
8192
  }
8082
8193
  },
8083
- async ({ action, content, domain, priority, agent_id, project_name, behavior_id }) => {
8194
+ async ({ action, content, domain, priority, agent_id, project_name, behavior_id, shared_skills }) => {
8084
8195
  if (action === "list") {
8196
+ if (shared_skills) {
8197
+ const currentAgent = agent_id ?? getActiveAgent().agentId;
8198
+ const proj = project_name || getProjectName();
8199
+ const skills = await listSharedSkills(currentAgent, proj);
8200
+ if (skills.length === 0) {
8201
+ return {
8202
+ content: [{ type: "text", text: "No shared skills found." }]
8203
+ };
8204
+ }
8205
+ const lines2 = skills.map((b) => {
8206
+ const scope = b.project_name ?? "global";
8207
+ const sharedTag = b.shared ? " [shared]" : " [own]";
8208
+ return `- [${b.agent_id}] (${scope})${sharedTag} ${b.content}
8209
+ ID: ${b.id}`;
8210
+ });
8211
+ return {
8212
+ content: [{
8213
+ type: "text",
8214
+ text: `${skills.length} skill(s):
8215
+ ${lines2.join("\n")}`
8216
+ }]
8217
+ };
8218
+ }
8085
8219
  const client2 = getClient();
8086
8220
  const conditions = ["active = 1"];
8087
8221
  const args = [];
8088
8222
  if (agent_id !== "all") {
8089
- const resolvedAgent = agent_id ?? getActiveAgent().agentId;
8223
+ const rawListAgent = agent_id ?? getActiveAgent().agentId;
8224
+ const resolvedAgent = baseAgentName(rawListAgent, loadEmployeesSync());
8090
8225
  conditions.push("agent_id = ?");
8091
8226
  args.push(resolvedAgent);
8092
8227
  }
@@ -8142,44 +8277,33 @@ ${lines.join("\n")}`
8142
8277
  isError: true
8143
8278
  };
8144
8279
  }
8145
- const resolvedAgent = agent_id ?? getActiveAgent().agentId;
8146
- const isCrossAgentWrite = agent_id != null && agent_id !== getActiveAgent().agentId;
8280
+ const caller2 = getActiveAgent();
8281
+ const roster = loadEmployeesSync();
8282
+ const rawAgent = agent_id ?? caller2.agentId;
8283
+ const resolvedAgent = baseAgentName(rawAgent, roster);
8284
+ const callerBase = baseAgentName(caller2.agentId, roster);
8285
+ const isCrossAgentWrite = resolvedAgent !== callerBase;
8147
8286
  if (isCrossAgentWrite) {
8148
- const caller2 = getActiveAgent();
8149
- const allowed2 = canCoordinate(caller2.agentId, caller2.agentRole);
8287
+ const allowed2 = canManage(callerBase, caller2.agentRole, resolvedAgent, roster);
8150
8288
  if (!allowed2) {
8151
8289
  return {
8152
8290
  content: [{
8153
8291
  type: "text",
8154
- text: `Permission denied. Only the coordinator or founder sessions can store behaviors for other agents. You are "${caller2.agentId}".`
8292
+ text: `Permission denied. Your role cannot write behaviors for "${resolvedAgent}". Chain of command: COO \u2192 anyone, CTO \u2192 engineers, CMO \u2192 content specialists. You are "${caller2.agentId}" (${caller2.agentRole ?? "unknown"}).`
8155
8293
  }],
8156
8294
  isError: true
8157
8295
  };
8158
8296
  }
8159
8297
  }
8160
8298
  if (resolvedAgent && resolvedAgent !== "default") {
8161
- try {
8162
- const { loadEmployeesSync: loadEmployeesSync2 } = await import("./lib/employees.js");
8163
- const roster = loadEmployeesSync2();
8164
- if (!roster.some((e) => e.name === resolvedAgent)) {
8165
- return {
8166
- content: [{
8167
- type: "text",
8168
- text: `Agent "${resolvedAgent}" not found in roster. Create the employee first with /exe-new-employee.`
8169
- }],
8170
- isError: true
8171
- };
8172
- }
8173
- } catch {
8174
- if (isCrossAgentWrite) {
8175
- return {
8176
- content: [{
8177
- type: "text",
8178
- text: `Unable to verify agent "${resolvedAgent}" \u2014 roster file unavailable. Cannot store cross-agent behavior without roster validation.`
8179
- }],
8180
- isError: true
8181
- };
8182
- }
8299
+ if (roster.length > 0 && !roster.some((e) => e.name === resolvedAgent)) {
8300
+ return {
8301
+ content: [{
8302
+ type: "text",
8303
+ text: `Agent "${resolvedAgent}" not found in roster. Create the employee first with /exe-new-employee.`
8304
+ }],
8305
+ isError: true
8306
+ };
8183
8307
  }
8184
8308
  }
8185
8309
  let resolvedProject;
@@ -8306,7 +8430,7 @@ Content: ${row.content}`
8306
8430
  }
8307
8431
 
8308
8432
  // src/mcp/tools/reminder.ts
8309
- import { z as z72 } from "zod";
8433
+ import { z as z73 } from "zod";
8310
8434
  function registerReminder(server) {
8311
8435
  server.registerTool(
8312
8436
  "reminder",
@@ -8314,11 +8438,11 @@ function registerReminder(server) {
8314
8438
  title: "Reminder",
8315
8439
  description: "Manage reminders for the founder. Shown in the boot brief every session. Actions: create (set new), list (view active), complete (mark done).",
8316
8440
  inputSchema: {
8317
- action: z72.enum(["create", "list", "complete"]).describe("Action to perform"),
8318
- text: z72.string().optional().describe("What to remind about (create)"),
8319
- due_date: z72.string().optional().describe("Optional due date \u2014 ISO date (2026-04-01) or null for persistent (create)"),
8320
- reminder_id: z72.string().optional().describe("Reminder UUID or text substring to match (complete)"),
8321
- include_completed: z72.boolean().optional().default(false).describe("Include completed reminders (list)")
8441
+ action: z73.enum(["create", "list", "complete"]).describe("Action to perform"),
8442
+ text: z73.string().optional().describe("What to remind about (create)"),
8443
+ due_date: z73.string().optional().describe("Optional due date \u2014 ISO date (2026-04-01) or null for persistent (create)"),
8444
+ reminder_id: z73.string().optional().describe("Reminder UUID or text substring to match (complete)"),
8445
+ include_completed: z73.boolean().optional().default(false).describe("Include completed reminders (list)")
8322
8446
  }
8323
8447
  },
8324
8448
  async ({ action, text: text3, due_date, reminder_id, include_completed }) => {
@@ -8371,8 +8495,7 @@ function registerReminder(server) {
8371
8495
  }
8372
8496
 
8373
8497
  // src/mcp/tools/store-global-procedure.ts
8374
- import { z as z73 } from "zod";
8375
- init_employees();
8498
+ import { z as z74 } from "zod";
8376
8499
  function registerStoreGlobalProcedure(server) {
8377
8500
  server.registerTool(
8378
8501
  "store_global_procedure",
@@ -8380,10 +8503,10 @@ function registerStoreGlobalProcedure(server) {
8380
8503
  title: "Store Company Procedure (use global_procedure instead)",
8381
8504
  description: "DEPRECATED \u2014 use global_procedure with action='store'. Create a company procedure (customer-owned Layer 0 rule). RESTRICTED: only coordinator or founder sessions.",
8382
8505
  inputSchema: {
8383
- title: z73.string().describe("Short title for the procedure"),
8384
- content: z73.string().max(500).describe("The procedure content \u2014 clear, actionable instruction"),
8385
- priority: z73.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always (default)."),
8386
- domain: z73.string().optional().describe("Category: workflow, code-style, communication, architecture, testing, security")
8506
+ title: z74.string().describe("Short title for the procedure"),
8507
+ content: z74.string().max(500).describe("The procedure content \u2014 clear, actionable instruction"),
8508
+ priority: z74.enum(["p0", "p1", "p2"]).optional().describe("Priority tier. p0 = always (default)."),
8509
+ domain: z74.string().optional().describe("Category: workflow, code-style, communication, architecture, testing, security")
8387
8510
  }
8388
8511
  },
8389
8512
  async ({ title, content, priority, domain }) => {
@@ -8455,9 +8578,7 @@ ${lines.join("\n\n")}`
8455
8578
  }
8456
8579
 
8457
8580
  // src/mcp/tools/deactivate-global-procedure.ts
8458
- import { z as z74 } from "zod";
8459
- init_database();
8460
- init_employees();
8581
+ import { z as z75 } from "zod";
8461
8582
  function registerDeactivateGlobalProcedure(server) {
8462
8583
  server.registerTool(
8463
8584
  "deactivate_global_procedure",
@@ -8465,7 +8586,7 @@ function registerDeactivateGlobalProcedure(server) {
8465
8586
  title: "Deactivate Company Procedure (use global_procedure instead)",
8466
8587
  description: "DEPRECATED \u2014 use global_procedure with action='deactivate'. Soft-delete a company procedure. RESTRICTED: only coordinator or founder sessions.",
8467
8588
  inputSchema: {
8468
- procedure_id: z74.string().describe("UUID of the company procedure to deactivate")
8589
+ procedure_id: z75.string().describe("UUID of the company procedure to deactivate")
8469
8590
  }
8470
8591
  },
8471
8592
  async ({ procedure_id }) => {
@@ -8520,11 +8641,8 @@ Content: ${row.content}`
8520
8641
  }
8521
8642
 
8522
8643
  // src/mcp/tools/store-decision.ts
8523
- init_embedder();
8524
- import { z as z75 } from "zod";
8644
+ import { z as z76 } from "zod";
8525
8645
  import crypto4 from "crypto";
8526
- init_database();
8527
- init_plan_limits();
8528
8646
  function registerStoreDecision(server) {
8529
8647
  server.registerTool(
8530
8648
  "store_decision",
@@ -8532,13 +8650,13 @@ function registerStoreDecision(server) {
8532
8650
  title: "Store Decision",
8533
8651
  description: "Store an authoritative decision keyed by domain. Use this when a decision is made that should be canonical \u2014 future lookups via get_decision return the latest decision for that domain. Supports supersession chains.",
8534
8652
  inputSchema: {
8535
- domain: z75.string().describe(
8653
+ domain: z76.string().describe(
8536
8654
  "Domain key, e.g. 'auth-strategy', 'db-migration-approach', 'api-versioning'"
8537
8655
  ),
8538
- decision: z75.string().describe("The decision text \u2014 what was decided"),
8539
- rationale: z75.string().optional().describe("Why this decision was made \u2014 constraints, trade-offs, context"),
8540
- supersedes: z75.string().optional().describe("UUID of the decision this supersedes (previous decision for this domain)"),
8541
- project_name: z75.string().optional().describe("Project name")
8656
+ decision: z76.string().describe("The decision text \u2014 what was decided"),
8657
+ rationale: z76.string().optional().describe("Why this decision was made \u2014 constraints, trade-offs, context"),
8658
+ supersedes: z76.string().optional().describe("UUID of the decision this supersedes (previous decision for this domain)"),
8659
+ project_name: z76.string().optional().describe("Project name")
8542
8660
  }
8543
8661
  },
8544
8662
  async ({ domain, decision, rationale, supersedes, project_name }) => {
@@ -8605,8 +8723,7 @@ Supersedes: ${supersedes}` : ""}`
8605
8723
  }
8606
8724
 
8607
8725
  // src/mcp/tools/get-decision.ts
8608
- init_database();
8609
- import { z as z76 } from "zod";
8726
+ import { z as z77 } from "zod";
8610
8727
  function registerGetDecision(server) {
8611
8728
  server.registerTool(
8612
8729
  "get_decision",
@@ -8614,7 +8731,7 @@ function registerGetDecision(server) {
8614
8731
  title: "Get Decision",
8615
8732
  description: "Retrieve the latest authoritative decision for a domain. Returns the current active decision and the supersession history.",
8616
8733
  inputSchema: {
8617
- domain: z76.string().describe(
8734
+ domain: z77.string().describe(
8618
8735
  "Domain key to look up, e.g. 'auth-strategy', 'db-migration-approach'"
8619
8736
  )
8620
8737
  }
@@ -8677,7 +8794,7 @@ function registerGetDecision(server) {
8677
8794
  }
8678
8795
 
8679
8796
  // src/mcp/tools/people-roster.ts
8680
- import { z as z77 } from "zod";
8797
+ import { z as z78 } from "zod";
8681
8798
 
8682
8799
  // src/lib/people.ts
8683
8800
  init_config();
@@ -8725,10 +8842,10 @@ function registerAddPerson(server) {
8725
8842
  title: "Add Person",
8726
8843
  description: "Add or update a key human in the people roster. Used for co-founders, partners, customers \u2014 anyone agents need to know about.",
8727
8844
  inputSchema: {
8728
- name: z77.string().describe("Person's name"),
8729
- role: z77.string().describe("Their role (e.g. co-founder, customer, partner)"),
8730
- relationship: z77.string().describe("Relationship to the organization (e.g. co-founder, early adopter, investor)"),
8731
- notes: z77.string().optional().describe("Additional context about this person")
8845
+ name: z78.string().describe("Person's name"),
8846
+ role: z78.string().describe("Their role (e.g. co-founder, customer, partner)"),
8847
+ relationship: z78.string().describe("Relationship to the organization (e.g. co-founder, early adopter, investor)"),
8848
+ notes: z78.string().optional().describe("Additional context about this person")
8732
8849
  }
8733
8850
  },
8734
8851
  async ({ name, role, relationship, notes }) => {
@@ -8774,7 +8891,7 @@ function registerGetPerson(server) {
8774
8891
  title: "Get Person",
8775
8892
  description: "Look up a specific person by name from the people roster.",
8776
8893
  inputSchema: {
8777
- name: z77.string().describe("Person's name to look up")
8894
+ name: z78.string().describe("Person's name to look up")
8778
8895
  }
8779
8896
  },
8780
8897
  async ({ name }) => {
@@ -8798,7 +8915,7 @@ Notes: ${person.notes}` : ""}`
8798
8915
  }
8799
8916
 
8800
8917
  // src/mcp/tools/crm.ts
8801
- import { z as z78 } from "zod";
8918
+ import { z as z79 } from "zod";
8802
8919
 
8803
8920
  // src/lib/exe-db-read.ts
8804
8921
  import path14 from "path";
@@ -8815,7 +8932,7 @@ async function getExeDbReadClient() {
8815
8932
  const readonlyUrl = process.env.MCP_READONLY_DATABASE_URL;
8816
8933
  if (readonlyUrl) {
8817
8934
  const { Pool } = await import("pg");
8818
- const { pgSslConfig } = await import("./pg-ssl-KFHNJPGO.js");
8935
+ const { pgSslConfig } = await import("./pg-ssl-4ZNXKUNH.js");
8819
8936
  const pool = new Pool({ connectionString: readonlyUrl, ...pgSslConfig() });
8820
8937
  return {
8821
8938
  async $queryRawUnsafe(query, ...values) {
@@ -8869,10 +8986,10 @@ function registerCrm(server) {
8869
8986
  title: "CRM",
8870
8987
  description: "Read-only CRM access from exe-db crm schema. Actions: list_people, get_person, list_tables, describe_table.",
8871
8988
  inputSchema: {
8872
- action: z78.enum(["list_people", "get_person", "list_tables", "describe_table"]).describe("CRM read operation"),
8873
- id: z78.string().optional().describe("CRM row/person id for get_person"),
8874
- query: z78.string().optional().describe("Text search for list_people/get_person"),
8875
- table: z78.string().optional().describe("crm schema table name for describe_table"),
8989
+ action: z79.enum(["list_people", "get_person", "list_tables", "describe_table"]).describe("CRM read operation"),
8990
+ id: z79.string().optional().describe("CRM row/person id for get_person"),
8991
+ query: z79.string().optional().describe("Text search for list_people/get_person"),
8992
+ table: z79.string().optional().describe("crm schema table name for describe_table"),
8876
8993
  ...PaginationSchema,
8877
8994
  ...DateRangeSchema,
8878
8995
  ...TextSearchSchema,
@@ -8972,7 +9089,7 @@ function registerCrm(server) {
8972
9089
  }
8973
9090
 
8974
9091
  // src/mcp/tools/raw-data.ts
8975
- import { z as z79 } from "zod";
9092
+ import { z as z80 } from "zod";
8976
9093
  function text2(content, isError = false) {
8977
9094
  return { content: [{ type: "text", text: content }], ...isError ? { isError: true } : {} };
8978
9095
  }
@@ -8981,14 +9098,14 @@ function registerRawData(server) {
8981
9098
  title: "Raw Data",
8982
9099
  description: "Read-only access to exe-db raw.raw_events landing pad. Actions: list_sources, query, get. Results are capped because raw payloads can consume many tokens.",
8983
9100
  inputSchema: {
8984
- action: z79.enum(["list_sources", "query", "get"]).describe("Raw data read operation"),
8985
- id: z79.string().optional().describe("raw.raw_events id for action=get"),
8986
- source: z79.string().optional().describe("Filter by raw source"),
8987
- event_type: z79.string().optional().describe("Filter by event_type"),
8988
- query: z79.string().optional().describe("Search payload/metadata text"),
8989
- processed: z79.boolean().optional().describe("Filter processed_at IS NULL/NOT NULL"),
9101
+ action: z80.enum(["list_sources", "query", "get"]).describe("Raw data read operation"),
9102
+ id: z80.string().optional().describe("raw.raw_events id for action=get"),
9103
+ source: z80.string().optional().describe("Filter by raw source"),
9104
+ event_type: z80.string().optional().describe("Filter by event_type"),
9105
+ query: z80.string().optional().describe("Search payload/metadata text"),
9106
+ processed: z80.boolean().optional().describe("Filter processed_at IS NULL/NOT NULL"),
8990
9107
  ...PaginationSchema,
8991
- include_payload: z79.boolean().optional().describe("Include full payload JSON. Default false to save tokens."),
9108
+ include_payload: z80.boolean().optional().describe("Include full payload JSON. Default false to save tokens."),
8992
9109
  ...DateRangeSchema,
8993
9110
  ...SortSchema,
8994
9111
  ...StructuredFiltersSchema
@@ -9064,9 +9181,9 @@ function registerRawData(server) {
9064
9181
 
9065
9182
  // src/mcp/tools/company-actions.ts
9066
9183
  init_config();
9067
- import { z as z80 } from "zod";
9184
+ import { z as z81 } from "zod";
9068
9185
  var FETCH_TIMEOUT_MS4 = 15e3;
9069
- var ACTION = z80.enum(["list_connectors", "describe_connector", "preview", "execute", "list_runs", "get_run"]);
9186
+ var ACTION = z81.enum(["list_connectors", "describe_connector", "preview", "execute", "list_runs", "get_run"]);
9070
9187
  function format(payload) {
9071
9188
  return ["# Company Actions", "", JSON.stringify(payload, null, 2)].join("\n");
9072
9189
  }
@@ -9078,13 +9195,13 @@ function registerCompanyActions(server) {
9078
9195
  description: "Preview and execute external connector actions (Asana, WhatsApp) through exe-gateway with audit/safety gates.",
9079
9196
  inputSchema: {
9080
9197
  action: ACTION.describe("list_connectors, describe_connector, preview, execute, list_runs, get_run"),
9081
- connector: z80.string().optional().describe("Connector to use, e.g. asana, whatsapp, airtable, notion"),
9082
- connector_ref: z80.string().optional().describe("Exact connector ref from list_connectors when connector names overlap"),
9083
- operation: z80.string().optional().describe("Connector operation, e.g. create_task or send_message"),
9084
- payload: z80.record(z80.string(), z80.unknown()).optional().describe("Operation payload"),
9085
- idempotency_key: z80.string().optional().describe("Stable key to prevent duplicate execution"),
9086
- confirm_token: z80.string().optional().describe("Optional future approval token"),
9087
- run_id: z80.string().optional().describe("Run id for get_run")
9198
+ connector: z81.string().optional().describe("Connector to use, e.g. asana, whatsapp, airtable, notion"),
9199
+ connector_ref: z81.string().optional().describe("Exact connector ref from list_connectors when connector names overlap"),
9200
+ operation: z81.string().optional().describe("Connector operation, e.g. create_task or send_message"),
9201
+ payload: z81.record(z81.string(), z81.unknown()).optional().describe("Operation payload"),
9202
+ idempotency_key: z81.string().optional().describe("Stable key to prevent duplicate execution"),
9203
+ confirm_token: z81.string().optional().describe("Optional future approval token"),
9204
+ run_id: z81.string().optional().describe("Run id for get_run")
9088
9205
  }
9089
9206
  },
9090
9207
  async (input) => {
@@ -9129,8 +9246,8 @@ function registerCompanyActions(server) {
9129
9246
  }
9130
9247
 
9131
9248
  // src/mcp/tools/workflow.ts
9132
- import { z as z81 } from "zod";
9133
- var ACTION2 = z81.enum([
9249
+ import { z as z82 } from "zod";
9250
+ var ACTION2 = z82.enum([
9134
9251
  "create_workflow",
9135
9252
  "start_workflow",
9136
9253
  "get_workflow_status",
@@ -9138,23 +9255,23 @@ var ACTION2 = z81.enum([
9138
9255
  "list_workflows",
9139
9256
  "list_instances"
9140
9257
  ]);
9141
- var StepSchema = z81.object({
9142
- name: z81.string().describe("Human-readable step name"),
9143
- type: z81.enum(["execute_action", "wait_for_approval", "conditional"]).describe("Step type"),
9144
- action: z81.object({
9145
- type: z81.enum(["send_whatsapp", "send_message", "create_task", "update_wiki", "mcp_tool"]),
9146
- params: z81.record(z81.string(), z81.string()),
9147
- requires_approval: z81.boolean().optional()
9258
+ var StepSchema = z82.object({
9259
+ name: z82.string().describe("Human-readable step name"),
9260
+ type: z82.enum(["execute_action", "wait_for_approval", "conditional"]).describe("Step type"),
9261
+ action: z82.object({
9262
+ type: z82.enum(["send_whatsapp", "send_message", "create_task", "update_wiki", "mcp_tool"]),
9263
+ params: z82.record(z82.string(), z82.string()),
9264
+ requires_approval: z82.boolean().optional()
9148
9265
  }).optional().describe("Action to execute (for execute_action steps)"),
9149
- connector: z81.string().optional().describe("Connector name (e.g., asana, whatsapp)"),
9150
- operation: z81.string().optional().describe("Connector operation (e.g., create_task)"),
9151
- payload: z81.record(z81.string(), z81.unknown()).optional().describe("Operation payload"),
9152
- condition: z81.object({
9153
- expression: z81.string().describe("Expression like '{{step.1.result.status}} == completed'"),
9154
- then_step: z81.number().optional(),
9155
- else_step: z81.number().optional()
9266
+ connector: z82.string().optional().describe("Connector name (e.g., asana, whatsapp)"),
9267
+ operation: z82.string().optional().describe("Connector operation (e.g., create_task)"),
9268
+ payload: z82.record(z82.string(), z82.unknown()).optional().describe("Operation payload"),
9269
+ condition: z82.object({
9270
+ expression: z82.string().describe("Expression like '{{step.1.result.status}} == completed'"),
9271
+ then_step: z82.number().optional(),
9272
+ else_step: z82.number().optional()
9156
9273
  }).optional().describe("Condition for conditional steps"),
9157
- approval_message: z81.string().optional().describe("Message shown when waiting for approval")
9274
+ approval_message: z82.string().optional().describe("Message shown when waiting for approval")
9158
9275
  });
9159
9276
  function registerWorkflowTool(server) {
9160
9277
  server.registerTool(
@@ -9164,14 +9281,14 @@ function registerWorkflowTool(server) {
9164
9281
  description: "Create, run, and manage multi-step workflows that chain actions with approval gates. Steps reference previous outputs via {{step.N.result}}. Actions: create_workflow, start_workflow, get_workflow_status, approve_workflow_step, list_workflows, list_instances.",
9165
9282
  inputSchema: {
9166
9283
  action: ACTION2.describe("create_workflow | start_workflow | get_workflow_status | approve_workflow_step | list_workflows | list_instances"),
9167
- name: z81.string().optional().describe("Workflow name (for create_workflow)"),
9168
- description: z81.string().optional().describe("Workflow description (for create_workflow)"),
9169
- steps: z81.array(StepSchema).optional().describe("Workflow steps (for create_workflow)"),
9170
- definition_id: z81.string().optional().describe("Workflow definition ID (for start_workflow)"),
9171
- instance_id: z81.string().optional().describe("Workflow instance ID (for get_workflow_status, approve_workflow_step)"),
9172
- context: z81.record(z81.string(), z81.unknown()).optional().describe("Initial context/record (for start_workflow)"),
9173
- approved: z81.boolean().optional().describe("Approve (true) or reject (false) the step (for approve_workflow_step)"),
9174
- status_filter: z81.string().optional().describe("Filter instances by status (for list_instances)")
9284
+ name: z82.string().optional().describe("Workflow name (for create_workflow)"),
9285
+ description: z82.string().optional().describe("Workflow description (for create_workflow)"),
9286
+ steps: z82.array(StepSchema).optional().describe("Workflow steps (for create_workflow)"),
9287
+ definition_id: z82.string().optional().describe("Workflow definition ID (for start_workflow)"),
9288
+ instance_id: z82.string().optional().describe("Workflow instance ID (for get_workflow_status, approve_workflow_step)"),
9289
+ context: z82.record(z82.string(), z82.unknown()).optional().describe("Initial context/record (for start_workflow)"),
9290
+ approved: z82.boolean().optional().describe("Approve (true) or reject (false) the step (for approve_workflow_step)"),
9291
+ status_filter: z82.string().optional().describe("Filter instances by status (for list_instances)")
9175
9292
  }
9176
9293
  },
9177
9294
  async (input) => {
@@ -9184,7 +9301,7 @@ function registerWorkflowTool(server) {
9184
9301
  getWorkflowInstance,
9185
9302
  listWorkflowInstances,
9186
9303
  approveWorkflowStep
9187
- } = await import("./workflow-engine-2XZK77ZX.js");
9304
+ } = await import("./workflow-engine-GISKRYSO.js");
9188
9305
  try {
9189
9306
  switch (input.action) {
9190
9307
  case "create_workflow": {
@@ -9307,10 +9424,24 @@ function formatInstanceStatus(inst, def) {
9307
9424
  }
9308
9425
 
9309
9426
  // src/mcp/tools/file-copy.ts
9310
- import { z as z82 } from "zod";
9427
+ import { z as z83 } from "zod";
9311
9428
  import { copyFileSync, existsSync as existsSync9, lstatSync, mkdirSync as mkdirSync3, realpathSync, statSync as statSync2 } from "fs";
9312
9429
  import path15 from "path";
9313
9430
  import os4 from "os";
9431
+ var DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
9432
+ function getMaxSize() {
9433
+ const envVal = process.env.EXE_FILE_COPY_MAX_SIZE;
9434
+ if (envVal) {
9435
+ const parsed = parseInt(envVal, 10);
9436
+ if (!isNaN(parsed) && parsed > 0) return parsed;
9437
+ }
9438
+ return DEFAULT_MAX_SIZE;
9439
+ }
9440
+ function humanSize(bytes) {
9441
+ if (bytes < 1024) return `${bytes} B`;
9442
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
9443
+ return `${(bytes / (1024 * 1024)).toFixed(2)} MB`;
9444
+ }
9314
9445
  function getAllowedRoots() {
9315
9446
  const roots = [];
9316
9447
  roots.push(path15.resolve(process.cwd()));
@@ -9334,9 +9465,9 @@ function registerFileCopy(server) {
9334
9465
  title: "File Copy",
9335
9466
  description: "Copy a file from source to destination without streaming through the LLM. Saves tokens for literal file copies.",
9336
9467
  inputSchema: {
9337
- source: z82.string().describe("Source file path (absolute or relative to cwd)"),
9338
- destination: z82.string().describe("Destination file path (absolute or relative to cwd)"),
9339
- overwrite: z82.boolean().optional().default(false).describe("Overwrite destination if it exists")
9468
+ source: z83.string().describe("Source file path (absolute or relative to cwd)"),
9469
+ destination: z83.string().describe("Destination file path (absolute or relative to cwd)"),
9470
+ overwrite: z83.boolean().optional().default(false).describe("Overwrite destination if it exists")
9340
9471
  }
9341
9472
  },
9342
9473
  async ({ source, destination, overwrite }) => {
@@ -9361,6 +9492,13 @@ function registerFileCopy(server) {
9361
9492
  if (!srcStat.isFile()) {
9362
9493
  return { content: [{ type: "text", text: `Source is not a file: ${srcPath}` }], isError: true };
9363
9494
  }
9495
+ const maxSize = getMaxSize();
9496
+ if (srcStat.size > maxSize) {
9497
+ return {
9498
+ content: [{ type: "text", text: `File too large: ${humanSize(srcStat.size)} exceeds limit of ${humanSize(maxSize)}. Set EXE_FILE_COPY_MAX_SIZE to increase.` }],
9499
+ isError: true
9500
+ };
9501
+ }
9364
9502
  const allowedRoots = getAllowedRoots();
9365
9503
  if (!isWithinBoundary(srcPath, allowedRoots)) {
9366
9504
  return {
@@ -9377,16 +9515,27 @@ function registerFileCopy(server) {
9377
9515
  if (existsSync9(dstPath) && !overwrite) {
9378
9516
  return { content: [{ type: "text", text: `Destination already exists: ${dstPath}. Set overwrite=true to replace.` }], isError: true };
9379
9517
  }
9518
+ if (existsSync9(dstPath) && overwrite) {
9519
+ try {
9520
+ const existingSize = statSync2(dstPath).size;
9521
+ process.stderr.write(
9522
+ `[file-copy] Overwriting ${dstPath} (${existingSize} bytes) with ${srcPath} (${srcStat.size} bytes)
9523
+ `
9524
+ );
9525
+ } catch {
9526
+ }
9527
+ }
9380
9528
  const dstDir = path15.dirname(dstPath);
9381
9529
  if (!existsSync9(dstDir)) {
9382
9530
  mkdirSync3(dstDir, { recursive: true });
9383
9531
  }
9384
9532
  copyFileSync(srcPath, dstPath);
9385
- const sizeMB = (srcStat.size / (1024 * 1024)).toFixed(2);
9533
+ const sizeStr = humanSize(srcStat.size);
9534
+ const filename = path15.basename(srcPath);
9386
9535
  return {
9387
9536
  content: [{
9388
9537
  type: "text",
9389
- text: `Copied ${srcPath} \u2192 ${dstPath} (${sizeMB} MB)`
9538
+ text: `Copied ${filename} (${sizeStr}): ${srcPath} \u2192 ${dstPath}`
9390
9539
  }]
9391
9540
  };
9392
9541
  } catch (err) {
@@ -9400,20 +9549,18 @@ function registerFileCopy(server) {
9400
9549
  }
9401
9550
 
9402
9551
  // src/mcp/tools/create-bug-report.ts
9403
- init_embedder();
9404
- import { z as z83 } from "zod";
9552
+ import { z as z84 } from "zod";
9405
9553
  import crypto5 from "crypto";
9406
9554
  import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
9407
9555
  import path16 from "path";
9408
9556
  init_config();
9409
- init_license();
9410
- var CLASSIFICATION = z83.enum([
9557
+ var CLASSIFICATION = z84.enum([
9411
9558
  "upstream_bug",
9412
9559
  "customer_customization",
9413
9560
  "emergency_hotfix",
9414
9561
  "unclear"
9415
9562
  ]);
9416
- var SEVERITY = z83.enum(["p0", "p1", "p2", "p3"]);
9563
+ var SEVERITY = z84.enum(["p0", "p1", "p2", "p3"]);
9417
9564
  function slugify(input) {
9418
9565
  return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "bug-report";
9419
9566
  }
@@ -9465,7 +9612,6 @@ function prepareUpstreamPayload(payload) {
9465
9612
  }
9466
9613
  delete redacted.agent_role;
9467
9614
  try {
9468
- const { encryptSyncBlob, isSyncCryptoInitialized } = (init_crypto(), __toCommonJS(crypto_exports));
9469
9615
  if (isSyncCryptoInitialized()) {
9470
9616
  const jsonBuf = Buffer.from(JSON.stringify(redacted), "utf-8");
9471
9617
  const encrypted = encryptSyncBlob(jsonBuf);
@@ -9516,23 +9662,23 @@ function registerCreateBugReport(server) {
9516
9662
  title: "Create Bug Report",
9517
9663
  description: "Classify and file an exe-os issue as upstream_bug, customer_customization, emergency_hotfix, or unclear. Writes a local report, stores memory, and optionally sends to AskExe support when a support endpoint is configured.",
9518
9664
  inputSchema: {
9519
- title: z83.string().min(3).describe("Short descriptive title"),
9665
+ title: z84.string().min(3).describe("Short descriptive title"),
9520
9666
  classification: CLASSIFICATION.describe(
9521
9667
  "upstream_bug = platform defect; customer_customization = local preference; emergency_hotfix = temporary local patch; unclear = needs maintainer triage"
9522
9668
  ),
9523
9669
  severity: SEVERITY.default("p2").describe("p0 critical \u2192 p3 low"),
9524
- summary: z83.string().min(10).describe("What happened and why it matters"),
9525
- customer_impact: z83.string().optional().describe("How this affects the customer/founder"),
9526
- reproduction_steps: z83.array(z83.string()).optional().describe("Steps to reproduce"),
9527
- expected: z83.string().optional().describe("Expected behavior"),
9528
- actual: z83.string().optional().describe("Actual behavior"),
9529
- files_changed: z83.array(z83.string()).optional().describe("Files changed or suspected"),
9530
- workaround: z83.string().optional().describe("Temporary local workaround/hotfix, if any"),
9531
- local_patch_diff: z83.string().optional().describe("Small local diff or patch summary"),
9532
- product: z83.string().optional().describe("Product this bug is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
9533
- package_version: z83.string().optional().describe("Installed package version"),
9534
- project_name: z83.string().optional().describe("Project/customer context"),
9535
- send_upstream: z83.boolean().default(true).describe("Attempt to POST to configured AskExe support endpoint")
9670
+ summary: z84.string().min(10).describe("What happened and why it matters"),
9671
+ customer_impact: z84.string().optional().describe("How this affects the customer/founder"),
9672
+ reproduction_steps: z84.array(z84.string()).optional().describe("Steps to reproduce"),
9673
+ expected: z84.string().optional().describe("Expected behavior"),
9674
+ actual: z84.string().optional().describe("Actual behavior"),
9675
+ files_changed: z84.array(z84.string()).optional().describe("Files changed or suspected"),
9676
+ workaround: z84.string().optional().describe("Temporary local workaround/hotfix, if any"),
9677
+ local_patch_diff: z84.string().optional().describe("Small local diff or patch summary"),
9678
+ product: z84.string().optional().describe("Product this bug is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
9679
+ package_version: z84.string().optional().describe("Installed package version"),
9680
+ project_name: z84.string().optional().describe("Project/customer context"),
9681
+ send_upstream: z84.boolean().default(true).describe("Attempt to POST to configured AskExe support endpoint")
9536
9682
  }
9537
9683
  },
9538
9684
  async ({
@@ -9654,20 +9800,18 @@ Upstream status: ${upstreamStatus}`
9654
9800
  }
9655
9801
 
9656
9802
  // src/mcp/tools/create-feature-request.ts
9657
- init_embedder();
9658
- import { z as z84 } from "zod";
9803
+ import { z as z85 } from "zod";
9659
9804
  import crypto6 from "crypto";
9660
9805
  import { mkdir as mkdir3, writeFile as writeFile3 } from "fs/promises";
9661
9806
  import path17 from "path";
9662
9807
  init_config();
9663
- init_license();
9664
- var CATEGORY = z84.enum([
9808
+ var CATEGORY = z85.enum([
9665
9809
  "upstream_feature",
9666
9810
  "local_customization",
9667
9811
  "integration",
9668
9812
  "unclear"
9669
9813
  ]);
9670
- var PRIORITY = z84.enum(["p0", "p1", "p2", "p3"]);
9814
+ var PRIORITY = z85.enum(["p0", "p1", "p2", "p3"]);
9671
9815
  function slugify2(input) {
9672
9816
  return input.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "feature-request";
9673
9817
  }
@@ -9735,20 +9879,20 @@ function registerCreateFeatureRequest(server) {
9735
9879
  title: "Create Feature Request",
9736
9880
  description: "File a feature request for exe-os: upstream_feature (requires platform changes), local_customization (configurable in customer layers), integration (third-party), or unclear. Writes a local report, stores memory, and optionally sends to AskExe.",
9737
9881
  inputSchema: {
9738
- title: z84.string().min(3).describe("Short descriptive title"),
9882
+ title: z85.string().min(3).describe("Short descriptive title"),
9739
9883
  category: CATEGORY.describe(
9740
9884
  "upstream_feature = platform capability change; local_customization = configurable in customer layers; integration = third-party connector; unclear = needs product triage"
9741
9885
  ),
9742
9886
  priority: PRIORITY.default("p2").describe("p0 critical \u2192 p3 low"),
9743
- description: z84.string().min(10).describe("What capability is needed and why"),
9744
- use_case: z84.string().optional().describe("Concrete scenario where this feature would be used"),
9745
- current_workaround: z84.string().optional().describe("How the need is currently addressed, if at all"),
9746
- proposed_solution: z84.string().optional().describe("Suggested implementation approach"),
9747
- business_impact: z84.string().optional().describe("Impact on business/workflow if this ships"),
9748
- product: z84.string().optional().describe("Product this feature is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
9749
- package_version: z84.string().optional().describe("Installed package version"),
9750
- project_name: z84.string().optional().describe("Project/customer context"),
9751
- send_upstream: z84.boolean().default(true).describe("Attempt to POST to configured AskExe support endpoint")
9887
+ description: z85.string().min(10).describe("What capability is needed and why"),
9888
+ use_case: z85.string().optional().describe("Concrete scenario where this feature would be used"),
9889
+ current_workaround: z85.string().optional().describe("How the need is currently addressed, if at all"),
9890
+ proposed_solution: z85.string().optional().describe("Suggested implementation approach"),
9891
+ business_impact: z85.string().optional().describe("Impact on business/workflow if this ships"),
9892
+ product: z85.string().optional().describe("Product this feature is for: exe-os, exe-create, exe-wiki, exe-gateway, exe-crm, exe-build. Defaults to exe-os."),
9893
+ package_version: z85.string().optional().describe("Installed package version"),
9894
+ project_name: z85.string().optional().describe("Project/customer context"),
9895
+ send_upstream: z85.boolean().default(true).describe("Attempt to POST to configured AskExe support endpoint")
9752
9896
  }
9753
9897
  },
9754
9898
  async ({
@@ -9850,8 +9994,7 @@ Upstream status: ${upstreamStatus}`
9850
9994
  }
9851
9995
 
9852
9996
  // src/mcp/tools/support.ts
9853
- import { z as z85 } from "zod";
9854
- init_license();
9997
+ import { z as z86 } from "zod";
9855
9998
  function formatRows(rows, mode) {
9856
9999
  const lines = [`exe-os support ${mode}`, ""];
9857
10000
  for (const row of rows) {
@@ -9892,7 +10035,7 @@ function registerSupportTools(server) {
9892
10035
  title: "Support Test",
9893
10036
  description: "End-to-end support intake smoke test. Files a clearly marked test report upstream and auto-closes it on AskExe machines with admin credentials.",
9894
10037
  inputSchema: {
9895
- project: z85.string().default("support-smoke").describe("Customer/project name, e.g. hygo")
10038
+ project: z86.string().default("support-smoke").describe("Customer/project name, e.g. hygo")
9896
10039
  }
9897
10040
  },
9898
10041
  async ({ project }) => {
@@ -9910,8 +10053,8 @@ function registerSupportTools(server) {
9910
10053
  title: "My Bug Reports",
9911
10054
  description: "List bug reports you've filed, scoped to your license. Shows status (open/triaged/fixed/closed), severity, and fixed_version so you know when to update.",
9912
10055
  inputSchema: {
9913
- status: z85.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("all").describe("Filter by status. Default: all"),
9914
- limit: z85.number().min(1).max(50).default(25).describe("Max results")
10056
+ status: z86.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("all").describe("Filter by status. Default: all"),
10057
+ limit: z86.number().min(1).max(50).default(25).describe("Max results")
9915
10058
  }
9916
10059
  },
9917
10060
  async ({ status: status2, limit }) => {
@@ -9976,8 +10119,8 @@ function registerSupportTools(server) {
9976
10119
  title: "My Feature Requests",
9977
10120
  description: "List feature requests you've filed, scoped to your license. Shows status (open/planned/in_progress/shipped/closed), priority, and shipped_version so you know when to update.",
9978
10121
  inputSchema: {
9979
- status: z85.enum(["all", "open", "planned", "in_progress", "shipped", "closed", "wontdo"]).default("all").describe("Filter by status. Default: all"),
9980
- limit: z85.number().min(1).max(50).default(25).describe("Max results")
10122
+ status: z86.enum(["all", "open", "planned", "in_progress", "shipped", "closed", "wontdo"]).default("all").describe("Filter by status. Default: all"),
10123
+ limit: z86.number().min(1).max(50).default(25).describe("Max results")
9981
10124
  }
9982
10125
  },
9983
10126
  async ({ status: status2, limit }) => {
@@ -10042,7 +10185,7 @@ function registerSupportTools(server) {
10042
10185
  // src/mcp/tools/cli-parity.ts
10043
10186
  import { execFile as execFile2 } from "child_process";
10044
10187
  import { promisify as promisify2 } from "util";
10045
- import { z as z86 } from "zod";
10188
+ import { z as z87 } from "zod";
10046
10189
  var execFileAsync2 = promisify2(execFile2);
10047
10190
  async function runCommand(command, args, timeout = 6e4) {
10048
10191
  const printable = [command, ...args].join(" ");
@@ -10078,12 +10221,12 @@ function registerCliParityTools(server) {
10078
10221
  title: "Doctor",
10079
10222
  description: "Run exe-os doctor audit. Defaults to read-only diagnostics; optional dry-run/fix flags mirror CLI.",
10080
10223
  inputSchema: {
10081
- agent: z86.string().optional(),
10082
- project: z86.string().optional(),
10083
- verbose: z86.boolean().default(false),
10084
- conflicts: z86.boolean().default(false),
10085
- dry_run: z86.boolean().default(false),
10086
- fix: z86.boolean().default(false)
10224
+ agent: z87.string().optional(),
10225
+ project: z87.string().optional(),
10226
+ verbose: z87.boolean().default(false),
10227
+ conflicts: z87.boolean().default(false),
10228
+ dry_run: z87.boolean().default(false),
10229
+ fix: z87.boolean().default(false)
10087
10230
  }
10088
10231
  }, async ({ agent, project, verbose, conflicts, dry_run, fix }) => {
10089
10232
  const args = [];
@@ -10100,9 +10243,9 @@ function registerCliParityTools(server) {
10100
10243
  title: "Rename Employee",
10101
10244
  description: "Rename an employee using the same path as `exe-os rename <old> <new>`. Use for customer roster/identity renames.",
10102
10245
  inputSchema: {
10103
- old_name: z86.string().min(1),
10104
- new_name: z86.string().min(1),
10105
- dry_run: z86.boolean().default(false)
10246
+ old_name: z87.string().min(1),
10247
+ new_name: z87.string().min(1),
10248
+ dry_run: z87.boolean().default(false)
10106
10249
  }
10107
10250
  }, async ({ old_name, new_name, dry_run }) => {
10108
10251
  if (dry_run) {
@@ -10115,7 +10258,7 @@ function registerCliParityTools(server) {
10115
10258
  server.registerTool("status_brief", {
10116
10259
  title: "Status Brief",
10117
10260
  description: "Return current employee/tmux status. Mirrors `exe-status` and supports optional deep view for one employee.",
10118
- inputSchema: { employee: z86.string().optional() }
10261
+ inputSchema: { employee: z87.string().optional() }
10119
10262
  }, async ({ employee }) => {
10120
10263
  const text3 = await status(employee);
10121
10264
  return result2(text3, { ok: true, employee: employee ?? null });
@@ -10123,7 +10266,7 @@ function registerCliParityTools(server) {
10123
10266
  server.registerTool("pending_work_summary", {
10124
10267
  title: "Pending Work Summary",
10125
10268
  description: "Return pending reviews, messages, and notifications using the same summaries as the CLI tools.",
10126
- inputSchema: { agent: z86.string().optional() }
10269
+ inputSchema: { agent: z87.string().optional() }
10127
10270
  }, async ({ agent }) => {
10128
10271
  const settled = await Promise.allSettled([
10129
10272
  runCommand("exe-pending-reviews", [], 3e4),
@@ -10147,7 +10290,7 @@ function registerCliParityTools(server) {
10147
10290
  server.registerTool("key_rotation_preflight", {
10148
10291
  title: "Key Rotation Preflight",
10149
10292
  description: "Dry-run key rotation/update preflight. No destructive changes.",
10150
- inputSchema: { mode: z86.enum(["rotate", "update"]).default("rotate") }
10293
+ inputSchema: { mode: z87.enum(["rotate", "update"]).default("rotate") }
10151
10294
  }, async ({ mode }) => {
10152
10295
  const out = await runCommand("exe-os", ["key", mode, "--dry-run"], 6e4);
10153
10296
  return result2(out.text, { ok: out.ok, command: out.command, mode }, !out.ok);
@@ -10166,11 +10309,11 @@ function registerCliParityTools(server) {
10166
10309
  title: "Stack Update Check",
10167
10310
  description: "Plan/check a customer stack update without applying Docker changes. Mirrors `exe-os stack-update --check`.",
10168
10311
  inputSchema: {
10169
- target: z86.string().optional(),
10170
- manifest: z86.string().optional(),
10171
- compose_file: z86.string().optional(),
10172
- env_file: z86.string().optional(),
10173
- deployment_persona: z86.enum(["customer", "askexe-control-plane"]).default("customer")
10312
+ target: z87.string().optional(),
10313
+ manifest: z87.string().optional(),
10314
+ compose_file: z87.string().optional(),
10315
+ env_file: z87.string().optional(),
10316
+ deployment_persona: z87.enum(["customer", "askexe-control-plane"]).default("customer")
10174
10317
  }
10175
10318
  }, async ({ target, manifest, compose_file, env_file, deployment_persona }) => {
10176
10319
  const args = ["stack-update", "--check", "--deployment-persona", deployment_persona];
@@ -10192,8 +10335,8 @@ function registerCliParityTools(server) {
10192
10335
  }
10193
10336
 
10194
10337
  // src/mcp/tools/get-session-events.ts
10195
- import { z as z87 } from "zod";
10196
- var EVENT_TYPE = z87.enum([
10338
+ import { z as z88 } from "zod";
10339
+ var EVENT_TYPE = z88.enum([
10197
10340
  "user_prompt",
10198
10341
  "assistant_response",
10199
10342
  "tool_call",
@@ -10223,11 +10366,11 @@ function registerGetSessionEvents(server) {
10223
10366
  title: "Get Session Events",
10224
10367
  description: "Return exact recent chronological user prompts, assistant responses, and tool calls from the append-only session journal. Use this when asked what happened last, not semantic memory search.",
10225
10368
  inputSchema: {
10226
- agent_id: z87.string().optional().describe("Agent to inspect. Defaults to active agent. COO/CTO may inspect others."),
10227
- session_id: z87.string().optional().describe("Optional exact runtime session id."),
10369
+ agent_id: z88.string().optional().describe("Agent to inspect. Defaults to active agent. COO/CTO may inspect others."),
10370
+ session_id: z88.string().optional().describe("Optional exact runtime session id."),
10228
10371
  event_type: EVENT_TYPE.optional().describe("Filter to one event type."),
10229
- project_name: z87.string().optional().describe("Optional project filter. Pass 'all' for all projects."),
10230
- limit: z87.number().int().min(1).max(100).default(20).describe("Number of events to return.")
10372
+ project_name: z88.string().optional().describe("Optional project filter. Pass 'all' for all projects."),
10373
+ limit: z88.number().int().min(1).max(100).default(20).describe("Number of events to return.")
10231
10374
  }
10232
10375
  },
10233
10376
  async ({ agent_id, session_id, event_type, project_name, limit }) => {
@@ -10263,8 +10406,8 @@ function registerGetLastAssistantResponse(server) {
10263
10406
  title: "Get Last Assistant Response",
10264
10407
  description: "Return the exact last assistant response for an agent from the session event journal. Use for 'what was the last thing you said?'",
10265
10408
  inputSchema: {
10266
- agent_id: z87.string().optional().describe("Agent to inspect. Defaults to active agent. COO/CTO may inspect others."),
10267
- project_name: z87.string().optional().describe("Optional project filter. Pass 'all' for all projects.")
10409
+ agent_id: z88.string().optional().describe("Agent to inspect. Defaults to active agent. COO/CTO may inspect others."),
10410
+ project_name: z88.string().optional().describe("Optional project filter. Pass 'all' for all projects.")
10268
10411
  }
10269
10412
  },
10270
10413
  async ({ agent_id, project_name }) => {
@@ -10294,7 +10437,7 @@ function registerGetLastAssistantResponse(server) {
10294
10437
  }
10295
10438
 
10296
10439
  // src/mcp/tools/code-context.ts
10297
- import { z as z88 } from "zod";
10440
+ import { z as z89 } from "zod";
10298
10441
  function errorResult10(text3) {
10299
10442
  return { content: [{ type: "text", text: text3 }], isError: true };
10300
10443
  }
@@ -10306,20 +10449,20 @@ function registerCodeContext(server) {
10306
10449
  title: "Code Context",
10307
10450
  description: "Persistent codebase context engine with semantic vector search. One consolidated tool to avoid MCP bloat. Actions: index (structural only), index_embed (structural + vector embeddings), search (semantic+lexical hybrid), trace, blast_radius, stats. Search uses RRF fusion of Jina v5 embeddings (cosine similarity) + lexical scoring. Falls back to lexical if daemon unavailable.",
10308
10451
  inputSchema: {
10309
- action: z88.enum(["index", "index_embed", "search", "trace", "blast_radius", "stats"]).describe("Code context operation. index_embed = index + generate embeddings for semantic search."),
10310
- project_root: z88.string().optional().describe("Repository root. Defaults to current working directory."),
10311
- query: z88.string().optional().describe("Natural language search query (e.g. 'authentication logic', 'database migration'). Semantic search finds conceptual matches, not just keywords."),
10312
- symbol: z88.string().optional().describe("Symbol/function/class/type name for trace or blast_radius"),
10313
- file_path: z88.string().optional().describe("File path for blast_radius"),
10314
- force: z88.boolean().optional().describe("Force rebuild before answering"),
10315
- limit: z88.coerce.number().int().min(1).max(100).optional().describe("Max results"),
10316
- offset: z88.coerce.number().int().min(0).optional().describe("Search pagination offset"),
10317
- refresh_index: z88.boolean().optional().describe("Refresh/rebuild index before searching"),
10318
- languages: z88.array(z88.string()).optional().describe('Language filters, e.g. ["python", "typescript"]'),
10319
- paths: z88.array(z88.string()).optional().describe("Path/glob filters"),
10320
- depth: z88.coerce.number().int().min(1).max(5).optional().describe("Dependent traversal depth for blast_radius"),
10321
- max_files: z88.coerce.number().int().min(1).max(1e4).optional().describe("Max code files to index"),
10322
- lexical_only: z88.boolean().optional().describe("Force lexical-only search (skip vector similarity). Default: false \u2014 uses semantic hybrid search.")
10452
+ action: z89.enum(["index", "index_embed", "search", "trace", "blast_radius", "stats"]).describe("Code context operation. index_embed = index + generate embeddings for semantic search."),
10453
+ project_root: z89.string().optional().describe("Repository root. Defaults to current working directory."),
10454
+ query: z89.string().optional().describe("Natural language search query (e.g. 'authentication logic', 'database migration'). Semantic search finds conceptual matches, not just keywords."),
10455
+ symbol: z89.string().optional().describe("Symbol/function/class/type name for trace or blast_radius"),
10456
+ file_path: z89.string().optional().describe("File path for blast_radius"),
10457
+ force: z89.boolean().optional().describe("Force rebuild before answering"),
10458
+ limit: z89.coerce.number().int().min(1).max(100).optional().describe("Max results"),
10459
+ offset: z89.coerce.number().int().min(0).optional().describe("Search pagination offset"),
10460
+ refresh_index: z89.boolean().optional().describe("Refresh/rebuild index before searching"),
10461
+ languages: z89.array(z89.string()).optional().describe('Language filters, e.g. ["python", "typescript"]'),
10462
+ paths: z89.array(z89.string()).optional().describe("Path/glob filters"),
10463
+ depth: z89.coerce.number().int().min(1).max(5).optional().describe("Dependent traversal depth for blast_radius"),
10464
+ max_files: z89.coerce.number().int().min(1).max(1e4).optional().describe("Max code files to index"),
10465
+ lexical_only: z89.boolean().optional().describe("Force lexical-only search (skip vector similarity). Default: false \u2014 uses semantic hybrid search.")
10323
10466
  }
10324
10467
  }, async ({ action, project_root, query, symbol, file_path, force, limit, offset, refresh_index, languages, paths, depth, max_files, lexical_only }) => {
10325
10468
  const opts = { projectRoot: project_root, force, maxFiles: max_files };
@@ -10395,9 +10538,9 @@ function registerCodeContext(server) {
10395
10538
  }
10396
10539
 
10397
10540
  // src/mcp/tools/support-inbox.ts
10398
- import { z as z89 } from "zod";
10541
+ import { z as z90 } from "zod";
10399
10542
  var DEFAULT_ENDPOINT = "https://cloud.askexe.com/admin/support/bug-reports";
10400
- var STATUS = z89.enum(["open", "triaged", "fixed", "closed", "wontfix"]);
10543
+ var STATUS = z90.enum(["open", "triaged", "fixed", "closed", "wontfix"]);
10401
10544
  function adminToken() {
10402
10545
  return process.env.ASKEXE_SUPPORT_ADMIN_TOKEN || process.env.EXE_SUPPORT_ADMIN_TOKEN;
10403
10546
  }
@@ -10436,9 +10579,9 @@ function registerListBugReports(server) {
10436
10579
  title: "List Bug Reports",
10437
10580
  description: "AskExe-internal only: list incoming customer bug reports from the support inbox.",
10438
10581
  inputSchema: {
10439
- status: z89.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("open"),
10440
- severity: z89.enum(["p0", "p1", "p2", "p3"]).optional(),
10441
- limit: z89.number().int().min(1).max(100).default(25)
10582
+ status: z90.enum(["all", "open", "triaged", "fixed", "closed", "wontfix"]).default("open"),
10583
+ severity: z90.enum(["p0", "p1", "p2", "p3"]).optional(),
10584
+ limit: z90.number().int().min(1).max(100).default(25)
10442
10585
  }
10443
10586
  },
10444
10587
  async ({ status: status2, severity, limit }) => {
@@ -10457,7 +10600,7 @@ function registerGetBugReport(server) {
10457
10600
  {
10458
10601
  title: "Get Bug Report",
10459
10602
  description: "AskExe-internal only: fetch one customer bug report with full markdown payload.",
10460
- inputSchema: { id: z89.string().min(8) }
10603
+ inputSchema: { id: z90.string().min(8) }
10461
10604
  },
10462
10605
  async ({ id }) => {
10463
10606
  const data = await requestJson(`${endpoint()}/${encodeURIComponent(id)}`);
@@ -10472,12 +10615,12 @@ function registerTriageBugReport(server) {
10472
10615
  title: "Triage Bug Report",
10473
10616
  description: "AskExe-internal only: update bug report status and link task/commit/release metadata.",
10474
10617
  inputSchema: {
10475
- id: z89.string().min(8),
10618
+ id: z90.string().min(8),
10476
10619
  status: STATUS.optional(),
10477
- triage_notes: z89.string().optional(),
10478
- linked_task_id: z89.string().optional(),
10479
- linked_commit: z89.string().optional(),
10480
- fixed_version: z89.string().optional()
10620
+ triage_notes: z90.string().optional(),
10621
+ linked_task_id: z90.string().optional(),
10622
+ linked_commit: z90.string().optional(),
10623
+ fixed_version: z90.string().optional()
10481
10624
  }
10482
10625
  },
10483
10626
  async ({ id, status: status2, triage_notes, linked_task_id, linked_commit, fixed_version }) => {
@@ -10490,7 +10633,7 @@ function registerTriageBugReport(server) {
10490
10633
  }
10491
10634
  );
10492
10635
  }
10493
- var FEATURE_STATUS = z89.enum(["open", "planned", "in_progress", "shipped", "closed", "wontdo"]);
10636
+ var FEATURE_STATUS = z90.enum(["open", "planned", "in_progress", "shipped", "closed", "wontdo"]);
10494
10637
  function featureEndpoint() {
10495
10638
  return endpoint().replace(/\/bug-reports\/?$/, "/feature-requests");
10496
10639
  }
@@ -10501,9 +10644,9 @@ function registerListFeatureRequests(server) {
10501
10644
  title: "List Feature Requests",
10502
10645
  description: "AskExe-internal only: list incoming customer feature requests from the support inbox.",
10503
10646
  inputSchema: {
10504
- status: z89.enum(["all", "open", "planned", "in_progress", "shipped", "closed", "wontdo"]).default("open"),
10505
- priority: z89.enum(["p0", "p1", "p2", "p3"]).optional(),
10506
- limit: z89.number().int().min(1).max(100).default(25)
10647
+ status: z90.enum(["all", "open", "planned", "in_progress", "shipped", "closed", "wontdo"]).default("open"),
10648
+ priority: z90.enum(["p0", "p1", "p2", "p3"]).optional(),
10649
+ limit: z90.number().int().min(1).max(100).default(25)
10507
10650
  }
10508
10651
  },
10509
10652
  async ({ status: status2, priority, limit }) => {
@@ -10522,7 +10665,7 @@ function registerGetFeatureRequest(server) {
10522
10665
  {
10523
10666
  title: "Get Feature Request",
10524
10667
  description: "AskExe-internal only: fetch one customer feature request with full payload.",
10525
- inputSchema: { id: z89.string().min(8) }
10668
+ inputSchema: { id: z90.string().min(8) }
10526
10669
  },
10527
10670
  async ({ id }) => {
10528
10671
  const data = await requestJson(`${featureEndpoint()}/${encodeURIComponent(id)}`);
@@ -10537,11 +10680,11 @@ function registerTriageFeatureRequest(server) {
10537
10680
  title: "Triage Feature Request",
10538
10681
  description: "AskExe-internal only: update feature request status, response notes, and version metadata.",
10539
10682
  inputSchema: {
10540
- id: z89.string().min(8),
10683
+ id: z90.string().min(8),
10541
10684
  status: FEATURE_STATUS.optional(),
10542
- response_notes: z89.string().optional(),
10543
- target_version: z89.string().optional(),
10544
- shipped_version: z89.string().optional()
10685
+ response_notes: z90.string().optional(),
10686
+ target_version: z90.string().optional(),
10687
+ shipped_version: z90.string().optional()
10545
10688
  }
10546
10689
  },
10547
10690
  async ({ id, status: status2, response_notes, target_version, shipped_version }) => {
@@ -10556,7 +10699,7 @@ function registerTriageFeatureRequest(server) {
10556
10699
  }
10557
10700
 
10558
10701
  // src/mcp/tools/decision.ts
10559
- import { z as z90 } from "zod";
10702
+ import { z as z91 } from "zod";
10560
10703
  function buildHandlers6() {
10561
10704
  const tools = /* @__PURE__ */ new Map();
10562
10705
  const fake = {
@@ -10580,12 +10723,12 @@ function registerDecision(server) {
10580
10723
  title: "Decision",
10581
10724
  description: "Store or retrieve authoritative decisions. Actions: store (persist a decision by domain), get (look up a decision by domain/query).",
10582
10725
  inputSchema: {
10583
- action: z90.enum(["store", "get"]).describe("Decision operation"),
10584
- domain: z90.string().optional().describe("Decision domain (e.g. 'architecture', 'hiring')"),
10585
- decision: z90.string().optional().describe("Decision text for action=store"),
10586
- rationale: z90.string().optional().describe("Why this decision was made (action=store)"),
10587
- query: z90.string().optional().describe("Search query for action=get"),
10588
- limit: z90.coerce.number().optional().describe("Max results for action=get")
10726
+ action: z91.enum(["store", "get"]).describe("Decision operation"),
10727
+ domain: z91.string().optional().describe("Decision domain (e.g. 'architecture', 'hiring')"),
10728
+ decision: z91.string().optional().describe("Decision text for action=store"),
10729
+ rationale: z91.string().optional().describe("Why this decision was made (action=store)"),
10730
+ query: z91.string().optional().describe("Search query for action=get"),
10731
+ limit: z91.coerce.number().optional().describe("Max results for action=get")
10589
10732
  }
10590
10733
  },
10591
10734
  async (input, extra) => {
@@ -10601,7 +10744,7 @@ function registerDecision(server) {
10601
10744
  }
10602
10745
 
10603
10746
  // src/mcp/tools/session.ts
10604
- import { z as z91 } from "zod";
10747
+ import { z as z92 } from "zod";
10605
10748
  function buildHandlers7() {
10606
10749
  const tools = /* @__PURE__ */ new Map();
10607
10750
  const fake = {
@@ -10625,9 +10768,9 @@ function registerSession(server) {
10625
10768
  title: "Session",
10626
10769
  description: "Session inspection tools. Actions: events (get session event log), last_response (get the most recent assistant response text).",
10627
10770
  inputSchema: {
10628
- action: z91.enum(["events", "last_response"]).describe("Session operation"),
10629
- session_id: z91.string().optional().describe("Session ID for action=events"),
10630
- limit: z91.coerce.number().optional().describe("Max events for action=events")
10771
+ action: z92.enum(["events", "last_response"]).describe("Session operation"),
10772
+ session_id: z92.string().optional().describe("Session ID for action=events"),
10773
+ limit: z92.coerce.number().optional().describe("Max events for action=events")
10631
10774
  }
10632
10775
  },
10633
10776
  async (input, extra) => {
@@ -10643,7 +10786,7 @@ function registerSession(server) {
10643
10786
  }
10644
10787
 
10645
10788
  // src/mcp/tools/support-consolidated.ts
10646
- import { z as z92 } from "zod";
10789
+ import { z as z93 } from "zod";
10647
10790
  function buildHandlers8() {
10648
10791
  const tools = /* @__PURE__ */ new Map();
10649
10792
  const fake = {
@@ -10684,7 +10827,7 @@ function registerSupportConsolidated(server) {
10684
10827
  title: "Support",
10685
10828
  description: "Bug reports, feature requests, and support system. Actions: create_bug, create_feature, list_my_bugs, list_my_features, list_bugs, get_bug, triage_bug, list_features, get_feature, triage_feature, health, test. Use 'product' param to file bugs for any AskExe product (exe-os, exe-create, exe-wiki, etc.).",
10686
10829
  inputSchema: {
10687
- action: z92.enum([
10830
+ action: z93.enum([
10688
10831
  "create_bug",
10689
10832
  "create_feature",
10690
10833
  "list_my_bugs",
@@ -10698,26 +10841,26 @@ function registerSupportConsolidated(server) {
10698
10841
  "health",
10699
10842
  "test"
10700
10843
  ]).describe("Support operation"),
10701
- title: z92.string().optional().describe("Bug/feature title"),
10702
- description: z92.string().optional().describe("Bug/feature description"),
10703
- steps_to_reproduce: z92.string().optional().describe("Steps to reproduce (bugs)"),
10704
- expected_behavior: z92.string().optional().describe("Expected behavior (bugs)"),
10705
- actual_behavior: z92.string().optional().describe("Actual behavior (bugs)"),
10706
- severity: z92.string().optional().describe("Severity: p0/p1/p2/p3"),
10707
- product: z92.string().optional().describe("Product: exe-os (default), exe-create, exe-wiki, exe-gateway, exe-crm, exe-build"),
10708
- use_case: z92.string().optional().describe("Use case (features)"),
10709
- proposed_solution: z92.string().optional().describe("Proposed solution (features)"),
10710
- priority: z92.string().optional().describe("Priority (features)"),
10711
- id: z92.string().optional().describe("Bug/feature ID for get/triage"),
10712
- status: z92.string().optional().describe("Filter by status"),
10713
- classification: z92.string().optional().describe("Triage classification"),
10714
- resolution: z92.string().optional().describe("Triage resolution"),
10715
- notes: z92.string().optional().describe("Triage notes (mapped to triage_notes for bug/feature triage)"),
10716
- triage_notes: z92.string().optional().describe("Triage notes (legacy field name)"),
10717
- linked_task_id: z92.string().optional().describe("Linked task ID for triage"),
10718
- linked_commit: z92.string().optional().describe("Linked commit hash for triage"),
10719
- fixed_version: z92.string().optional().describe("Version that fixes this bug"),
10720
- limit: z92.coerce.number().optional().describe("Max results")
10844
+ title: z93.string().optional().describe("Bug/feature title"),
10845
+ description: z93.string().optional().describe("Bug/feature description"),
10846
+ steps_to_reproduce: z93.string().optional().describe("Steps to reproduce (bugs)"),
10847
+ expected_behavior: z93.string().optional().describe("Expected behavior (bugs)"),
10848
+ actual_behavior: z93.string().optional().describe("Actual behavior (bugs)"),
10849
+ severity: z93.string().optional().describe("Severity: p0/p1/p2/p3"),
10850
+ product: z93.string().optional().describe("Product: exe-os (default), exe-create, exe-wiki, exe-gateway, exe-crm, exe-build"),
10851
+ use_case: z93.string().optional().describe("Use case (features)"),
10852
+ proposed_solution: z93.string().optional().describe("Proposed solution (features)"),
10853
+ priority: z93.string().optional().describe("Priority (features)"),
10854
+ id: z93.string().optional().describe("Bug/feature ID for get/triage"),
10855
+ status: z93.string().optional().describe("Filter by status"),
10856
+ classification: z93.string().optional().describe("Triage classification"),
10857
+ resolution: z93.string().optional().describe("Triage resolution"),
10858
+ notes: z93.string().optional().describe("Triage notes (mapped to triage_notes for bug/feature triage)"),
10859
+ triage_notes: z93.string().optional().describe("Triage notes (legacy field name)"),
10860
+ linked_task_id: z93.string().optional().describe("Linked task ID for triage"),
10861
+ linked_commit: z93.string().optional().describe("Linked commit hash for triage"),
10862
+ fixed_version: z93.string().optional().describe("Version that fixes this bug"),
10863
+ limit: z93.coerce.number().optional().describe("Max results")
10721
10864
  }
10722
10865
  },
10723
10866
  async (input, extra) => {
@@ -10779,7 +10922,7 @@ function registerSupportConsolidated(server) {
10779
10922
  }
10780
10923
 
10781
10924
  // src/mcp/tools/diagnostics.ts
10782
- import { z as z93 } from "zod";
10925
+ import { z as z94 } from "zod";
10783
10926
  function buildHandlers9() {
10784
10927
  const tools = /* @__PURE__ */ new Map();
10785
10928
  const fake = {
@@ -10793,21 +10936,24 @@ function buildHandlers9() {
10793
10936
  function registerDiagnostics(server) {
10794
10937
  const handlers = buildHandlers9();
10795
10938
  const toolNames = Array.from(handlers.keys());
10796
- toolNames.push("tool_search", "drift");
10939
+ toolNames.push("tool_search", "drift", "merge_agent_memories");
10797
10940
  server.registerTool(
10798
10941
  "diagnostics",
10799
10942
  {
10800
10943
  title: "Diagnostics",
10801
- description: `System diagnostics and admin operations. Actions: ${toolNames.join(", ")}. Covers health checks, update status, cloud status, key management, employee rename, semantic tool discovery (tool_search), and identity drift detection (drift).`,
10944
+ description: `System diagnostics and admin operations. Actions: ${toolNames.join(", ")}. Covers health checks, update status, cloud status, key management, employee rename, semantic tool discovery (tool_search), identity drift detection (drift), and agent memory reassignment (merge_agent_memories).`,
10802
10945
  inputSchema: {
10803
- action: z93.string().describe(`Diagnostic operation: ${toolNames.join(", ")}`),
10946
+ action: z94.string().describe(`Diagnostic operation: ${toolNames.join(", ")}`),
10804
10947
  // Pass-through params used by various sub-tools
10805
- agent_id: z93.string().optional().describe("Agent to probe (drift). Defaults to all agents."),
10806
- name: z93.string().optional().describe("Employee name (rename_employee)"),
10807
- new_name: z93.string().optional().describe("New employee name (rename_employee)"),
10808
- query: z93.string().optional().describe("Search/filter query, or natural language for tool_search"),
10809
- format: z93.string().optional().describe("Output format"),
10810
- limit: z93.coerce.number().int().min(1).max(100).optional().describe("Max results for tool_search (default 20)")
10948
+ agent_id: z94.string().optional().describe("Agent to probe (drift). Defaults to all agents."),
10949
+ name: z94.string().optional().describe("Employee name (rename_employee)"),
10950
+ new_name: z94.string().optional().describe("New employee name (rename_employee)"),
10951
+ query: z94.string().optional().describe("Search/filter query, or natural language for tool_search"),
10952
+ format: z94.string().optional().describe("Output format"),
10953
+ limit: z94.coerce.number().int().min(1).max(100).optional().describe("Max results for tool_search (default 20)"),
10954
+ from_agent_id: z94.string().optional().describe("Source agent ID to merge from (merge_agent_memories)"),
10955
+ to_agent_id: z94.string().optional().describe("Target agent ID to merge into (merge_agent_memories)"),
10956
+ dry_run: z94.boolean().optional().default(true).describe("Preview mode \u2014 show count without changing (merge_agent_memories). Default: true")
10811
10957
  }
10812
10958
  },
10813
10959
  async (input, extra) => {
@@ -10818,6 +10964,9 @@ function registerDiagnostics(server) {
10818
10964
  if (action === "drift") {
10819
10965
  return handleDrift(input);
10820
10966
  }
10967
+ if (action === "merge_agent_memories") {
10968
+ return handleMergeAgentMemories(input);
10969
+ }
10821
10970
  if (action === "audit_trail") {
10822
10971
  try {
10823
10972
  const { getClient: getClient2 } = await import("./lib/database.js");
@@ -10845,6 +10994,88 @@ function registerDiagnostics(server) {
10845
10994
  }
10846
10995
  );
10847
10996
  }
10997
+ async function handleMergeAgentMemories(input) {
10998
+ const fromAgentId = input.from_agent_id;
10999
+ const toAgentId = input.to_agent_id;
11000
+ const dryRun = input.dry_run !== false;
11001
+ if (!fromAgentId || !toAgentId) {
11002
+ return {
11003
+ content: [{
11004
+ type: "text",
11005
+ text: JSON.stringify({ error: "Both from_agent_id and to_agent_id are required" })
11006
+ }],
11007
+ isError: true
11008
+ };
11009
+ }
11010
+ if (fromAgentId === toAgentId) {
11011
+ return {
11012
+ content: [{
11013
+ type: "text",
11014
+ text: JSON.stringify({ error: "from_agent_id and to_agent_id must be different" })
11015
+ }],
11016
+ isError: true
11017
+ };
11018
+ }
11019
+ try {
11020
+ const { getClient: getClient2 } = await import("./lib/database.js");
11021
+ const client = await getClient2();
11022
+ const countResult = await client.execute({
11023
+ sql: "SELECT COUNT(*) as cnt FROM memories WHERE agent_id = ?",
11024
+ args: [fromAgentId]
11025
+ });
11026
+ const count = Number(countResult.rows[0]?.cnt ?? 0);
11027
+ if (dryRun) {
11028
+ return {
11029
+ content: [{
11030
+ type: "text",
11031
+ text: JSON.stringify({
11032
+ preview: true,
11033
+ from_agent_id: fromAgentId,
11034
+ to_agent_id: toAgentId,
11035
+ memories_to_reassign: count,
11036
+ message: count > 0 ? `Would reassign ${count} memories from "${fromAgentId}" to "${toAgentId}". Call with dry_run=false to execute.` : `No memories found for agent_id "${fromAgentId}". Nothing to do.`
11037
+ }, null, 2)
11038
+ }]
11039
+ };
11040
+ }
11041
+ if (count === 0) {
11042
+ return {
11043
+ content: [{
11044
+ type: "text",
11045
+ text: JSON.stringify({
11046
+ from_agent_id: fromAgentId,
11047
+ to_agent_id: toAgentId,
11048
+ reassigned: 0,
11049
+ message: `No memories found for agent_id "${fromAgentId}".`
11050
+ }, null, 2)
11051
+ }]
11052
+ };
11053
+ }
11054
+ await client.execute({
11055
+ sql: "UPDATE memories SET agent_id = ? WHERE agent_id = ?",
11056
+ args: [toAgentId, fromAgentId]
11057
+ });
11058
+ return {
11059
+ content: [{
11060
+ type: "text",
11061
+ text: JSON.stringify({
11062
+ from_agent_id: fromAgentId,
11063
+ to_agent_id: toAgentId,
11064
+ reassigned: count,
11065
+ message: `Successfully reassigned ${count} memories from "${fromAgentId}" to "${toAgentId}".`
11066
+ }, null, 2)
11067
+ }]
11068
+ };
11069
+ } catch (err) {
11070
+ return {
11071
+ content: [{
11072
+ type: "text",
11073
+ text: `merge_agent_memories failed: ${err instanceof Error ? err.message : String(err)}`
11074
+ }],
11075
+ isError: true
11076
+ };
11077
+ }
11078
+ }
10848
11079
  async function handleToolSearch(input) {
10849
11080
  const query = input.query ?? "";
10850
11081
  const limit = input.limit ?? 20;
@@ -10964,10 +11195,13 @@ var ALWAYS_ALLOWED = /* @__PURE__ */ new Set([
10964
11195
  function registerAllTools(server, license, hasKey) {
10965
11196
  const originalRegisterTool = server.registerTool.bind(server);
10966
11197
  server.registerTool = (toolName, config, handler) => {
10967
- const wrappedHandler = handler ? (args, extra) => {
11198
+ if (!handler) {
11199
+ return originalRegisterTool(toolName, config);
11200
+ }
11201
+ const wrappedHandler = (args, extra) => {
10968
11202
  mcpRateLimiter.check(toolName, resolveAgentIdForRateLimit());
10969
11203
  return handler(args, extra);
10970
- } : void 0;
11204
+ };
10971
11205
  return originalRegisterTool(toolName, config, wrappedHandler);
10972
11206
  };
10973
11207
  const gate = (name, fn) => {
@@ -11031,6 +11265,7 @@ function registerAllTools(server, license, hasKey) {
11031
11265
  gate("registerGetTask", registerGetTask);
11032
11266
  gate("registerCheckpointTask", registerCheckpointTask);
11033
11267
  gate("registerResumeEmployee", registerResumeEmployee);
11268
+ gate("registerDependencyTree", registerDependencyTree);
11034
11269
  }
11035
11270
  gate("registerBehavior", registerBehavior);
11036
11271
  if (exposeConsolidatedMessages) {