@askexenow/exe-os 0.9.302 → 0.9.310

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/deploy/compose/.env.example +8 -2
  2. package/deploy/compose/README.md +7 -3
  3. package/deploy/compose/add-routes.sh +107 -0
  4. package/deploy/compose/docker-compose.yml +91 -18
  5. package/deploy/compose/gateway-watchdog.sh +223 -0
  6. package/deploy/compose/generate-env.ts +16 -4
  7. package/deploy/compose/setup.sh +7 -8
  8. package/deploy/stack-manifests/v0.9.json +125 -4
  9. package/dist/{active-agent-ODI6GGVD.js → active-agent-ORX47ZKW.js} +4 -3
  10. package/dist/{active-agent-GGQAP4QE.js → active-agent-S5T2YMOR.js} +4 -3
  11. package/dist/{agentic-ontology-M7T72M6V.js → agentic-ontology-6KBAXLSJ.js} +1 -1
  12. package/dist/{backfill-metadata-GSZP2BEW.js → backfill-metadata-FV7GX6AS.js} +5 -4
  13. package/dist/{behaviors-JM6KFSXL.js → behaviors-47CPEKJ7.js} +6 -5
  14. package/dist/bin/agentic-ontology-backfill.js +6 -5
  15. package/dist/bin/agentic-reflection-backfill.js +7 -6
  16. package/dist/bin/agentic-semantic-label.js +6 -5
  17. package/dist/bin/backfill-conversations.js +8 -7
  18. package/dist/bin/backfill-responses.js +8 -7
  19. package/dist/bin/backfill-vectors.js +10 -9
  20. package/dist/bin/bulk-sync-postgres.js +14 -13
  21. package/dist/bin/cc-doctor.js +5 -4
  22. package/dist/bin/cleanup-stale-review-tasks.js +13 -12
  23. package/dist/bin/cli.js +20 -17
  24. package/dist/bin/deferred-daemon-restart.js +4 -4
  25. package/dist/bin/exe-agent-config.js +3 -2
  26. package/dist/bin/exe-agent.js +12 -11
  27. package/dist/bin/exe-assign.js +10 -9
  28. package/dist/bin/exe-boot.js +21 -20
  29. package/dist/bin/exe-call.js +5 -4
  30. package/dist/bin/exe-cloud.js +14 -13
  31. package/dist/bin/exe-config-dump.js +525 -0
  32. package/dist/bin/exe-dispatch.js +13 -12
  33. package/dist/bin/exe-doctor.js +2 -2
  34. package/dist/bin/exe-export-behaviors.js +8 -7
  35. package/dist/bin/exe-forget.js +7 -6
  36. package/dist/bin/exe-gateway.js +22 -11
  37. package/dist/bin/exe-healthcheck.js +7 -4
  38. package/dist/bin/exe-heartbeat.js +13 -12
  39. package/dist/bin/exe-kill.js +16 -15
  40. package/dist/bin/exe-launch-agent.js +41 -25
  41. package/dist/bin/exe-new-employee.js +9 -8
  42. package/dist/bin/exe-pending-messages.js +14 -13
  43. package/dist/bin/exe-pending-notifications.js +13 -12
  44. package/dist/bin/exe-pending-reviews.js +13 -12
  45. package/dist/bin/exe-preflight.js +108 -0
  46. package/dist/bin/exe-rename.js +5 -4
  47. package/dist/bin/exe-review.js +15 -14
  48. package/dist/bin/exe-search-quality.js +282 -0
  49. package/dist/bin/exe-search.js +6 -5
  50. package/dist/bin/exe-session-cleanup.js +18 -17
  51. package/dist/bin/exe-settings.js +15 -14
  52. package/dist/bin/exe-start-codex.js +13 -12
  53. package/dist/bin/exe-start-opencode.js +9 -8
  54. package/dist/bin/exe-status.js +14 -13
  55. package/dist/bin/exe-support.js +4 -4
  56. package/dist/bin/exe-team.js +4 -3
  57. package/dist/bin/exe-timers.js +237 -0
  58. package/dist/bin/git-sweep.js +14 -13
  59. package/dist/bin/graph-backfill.js +7 -6
  60. package/dist/bin/graph-export.js +6 -5
  61. package/dist/bin/import-history.js +10 -9
  62. package/dist/bin/install-launchd.js +5 -2
  63. package/dist/bin/install.js +16 -15
  64. package/dist/bin/intercom-check.js +4 -4
  65. package/dist/bin/mcp-sessions.js +2 -2
  66. package/dist/bin/orchestration-metrics.js +5 -4
  67. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  68. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  69. package/dist/bin/prune-orphan-chunks.js +43 -10
  70. package/dist/bin/scan-tasks.js +13 -12
  71. package/dist/bin/setup.js +1 -1
  72. package/dist/bin/shard-migrate.js +5 -4
  73. package/dist/bin/stack-update.js +30 -5
  74. package/dist/bin/vps-health-gate.js +1 -1
  75. package/dist/{capability-cards-BCTFKT4G.js → capability-cards-WQVY7WSS.js} +3 -2
  76. package/dist/{capacity-monitor-B4S3XEDO.js → capacity-monitor-BUKYPSWR.js} +14 -13
  77. package/dist/{catchup-brief-I35KHK62.js → catchup-brief-X5IVQAOH.js} +16 -15
  78. package/dist/{chunk-74TUYU5A.js → chunk-255DIG4B.js} +1 -1
  79. package/dist/{chunk-CXKR5Z5F.js → chunk-2EJ636HI.js} +4 -0
  80. package/dist/{chunk-ST3X3YMZ.js → chunk-2NGPZCWX.js} +4 -4
  81. package/dist/{chunk-LD2JKEJT.js → chunk-2NVEKSSP.js} +7 -7
  82. package/dist/{chunk-V6P7TPPA.js → chunk-2UVN2NBN.js} +148 -2
  83. package/dist/{chunk-OZRO37JW.js → chunk-3KH6GXXX.js} +2 -2
  84. package/dist/{chunk-IMJNYREY.js → chunk-43R2GILO.js} +1 -1
  85. package/dist/{chunk-6X2YNVLB.js → chunk-4BANMHJ5.js} +3 -3
  86. package/dist/{chunk-QNJPDIWY.js → chunk-4L4R6AQJ.js} +1 -1
  87. package/dist/{chunk-QWLPAEG5.js → chunk-4Q5VNQTV.js} +3 -3
  88. package/dist/{chunk-VLSYKMCJ.js → chunk-4RJJ5FJ2.js} +14 -2
  89. package/dist/{chunk-4AN6KMVG.js → chunk-5DPE7B7K.js} +1 -1
  90. package/dist/{chunk-H7ZNSQ2E.js → chunk-62UZWGFX.js} +2 -2
  91. package/dist/{chunk-ZQ2QHGWE.js → chunk-66JPZELX.js} +20 -24
  92. package/dist/{chunk-BUGMW7YF.js → chunk-6LNSZADA.js} +11 -11
  93. package/dist/{chunk-PBCRUNIK.js → chunk-6OD2RVIA.js} +492 -157
  94. package/dist/chunk-7ODTYODO.js +350 -0
  95. package/dist/{chunk-5YL4Y27D.js → chunk-7WDIGRSO.js} +1 -1
  96. package/dist/{chunk-WIL6LXNG.js → chunk-AC6DKMVS.js} +1 -1
  97. package/dist/{chunk-HZEAAKCR.js → chunk-B2J3BBJC.js} +3 -3
  98. package/dist/{chunk-LE7CDIOA.js → chunk-BUOMSIXH.js} +1 -1
  99. package/dist/{chunk-XKGNKH6V.js → chunk-DFUCFLZH.js} +1 -1
  100. package/dist/{chunk-U724Z3S3.js → chunk-DKHBMIVE.js} +100 -37
  101. package/dist/{chunk-MY36XDUK.js → chunk-DNFU56ZS.js} +1 -1
  102. package/dist/{chunk-GSWGOGP5.js → chunk-EOS7VPVT.js} +5 -5
  103. package/dist/{chunk-P33JVGSP.js → chunk-FM7XZDZI.js} +1 -1
  104. package/dist/chunk-G6EJKYK3.js +33 -0
  105. package/dist/{chunk-OMCNFTSI.js → chunk-GMZMBLHT.js} +1 -1
  106. package/dist/{chunk-4LZ54YGA.js → chunk-GSY6HL3T.js} +5 -5
  107. package/dist/{chunk-OVKNFTCL.js → chunk-HED6D5KR.js} +132 -21
  108. package/dist/{chunk-ALH6QLYF.js → chunk-HQODUV3G.js} +2 -2
  109. package/dist/{chunk-US64UR5O.js → chunk-IIHE3FNC.js} +3 -3
  110. package/dist/{chunk-H2ISTRWU.js → chunk-IRIPGGGL.js} +1 -1
  111. package/dist/{chunk-Z3EXECOX.js → chunk-ISILDO7P.js} +1 -1
  112. package/dist/{chunk-6ERZFDBS.js → chunk-IZPO6IOZ.js} +1 -1
  113. package/dist/{chunk-W65Z4SJS.js → chunk-J3QZPDNH.js} +1 -1
  114. package/dist/{chunk-3IJCP6ZH.js → chunk-JDYO76PI.js} +1 -1
  115. package/dist/{chunk-ORNKGGFX.js → chunk-JNARUXDC.js} +1 -1
  116. package/dist/{chunk-VME3UH4D.js → chunk-JV225JBX.js} +1 -1
  117. package/dist/{chunk-EI7PBUIA.js → chunk-JZW5AOWI.js} +1 -1
  118. package/dist/{chunk-TLOILHSL.js → chunk-K7KBAJQL.js} +36 -18
  119. package/dist/{chunk-RHMWSUJB.js → chunk-KAVUTP5G.js} +2 -2
  120. package/dist/{chunk-7FNELLMX.js → chunk-KPVVTHPK.js} +8 -8
  121. package/dist/{chunk-35U72CD2.js → chunk-KSMITUGY.js} +3 -3
  122. package/dist/{chunk-D6UICP3C.js → chunk-LMX7UKGX.js} +81 -3
  123. package/dist/{chunk-7ZWC5HVG.js → chunk-MTIJ2NXY.js} +1 -1
  124. package/dist/{chunk-KVHPBQV4.js → chunk-NCC3F6GM.js} +1 -1
  125. package/dist/{chunk-AYMSIV7X.js → chunk-NIZQ3CIS.js} +1 -1
  126. package/dist/{chunk-LTI2DLHY.js → chunk-OBJXZII2.js} +2 -2
  127. package/dist/{chunk-WHOT5NZ7.js → chunk-OR3TAZL3.js} +14 -2
  128. package/dist/{chunk-RQUHAXMM.js → chunk-PHFPIUWU.js} +2 -0
  129. package/dist/{chunk-N76VTMMF.js → chunk-PMEOSD6S.js} +2 -2
  130. package/dist/{chunk-TCJEFW5V.js → chunk-PPXQE7AS.js} +4 -4
  131. package/dist/{chunk-KHZQVLNZ.js → chunk-QE7UVQDP.js} +46 -0
  132. package/dist/{chunk-SXJACGQ5.js → chunk-QEGXNJGR.js} +4 -4
  133. package/dist/{chunk-W3E4VEEJ.js → chunk-RPBTYQKJ.js} +1 -1
  134. package/dist/chunk-RQ7OVXUZ.js +81 -0
  135. package/dist/{chunk-7L2EV3XX.js → chunk-RVXWGPD3.js} +39 -6
  136. package/dist/{chunk-YNALY3SX.js → chunk-RZJ6DXVE.js} +1 -1
  137. package/dist/{chunk-P3SIFDES.js → chunk-SCYWCWKY.js} +16 -4
  138. package/dist/{chunk-7I43GVER.js → chunk-SOT23KWW.js} +3 -3
  139. package/dist/{chunk-T62GAN7I.js → chunk-SPOXL7HF.js} +7 -7
  140. package/dist/{chunk-3YJMI422.js → chunk-TN2YCFQE.js} +4 -4
  141. package/dist/{chunk-YMSWCERY.js → chunk-U63BZI2B.js} +3 -3
  142. package/dist/{chunk-KA5RK5HZ.js → chunk-V42BSVX6.js} +2 -2
  143. package/dist/{chunk-PJTRAFL4.js → chunk-V4BW5HFQ.js} +3 -3
  144. package/dist/{chunk-4FG6IX7U.js → chunk-VFSYVQX4.js} +1 -1
  145. package/dist/chunk-VQRTO7IS.js +290 -0
  146. package/dist/{chunk-OR7J7TIA.js → chunk-VT6P7FV4.js} +1 -1
  147. package/dist/{chunk-BEIYF4NS.js → chunk-W2J2RF5N.js} +3 -3
  148. package/dist/{chunk-Y5ASPRP7.js → chunk-WBJXJ2R4.js} +17 -13
  149. package/dist/chunk-WCGNCH3Q.js +72 -0
  150. package/dist/{chunk-2LJDLQNO.js → chunk-WJ2PZGRV.js} +1 -1
  151. package/dist/{chunk-AAPPSMPH.js → chunk-WZBUKC5N.js} +1 -1
  152. package/dist/{chunk-RO7EXVSJ.js → chunk-X4AFBL4N.js} +1 -1
  153. package/dist/{chunk-BR74NYEF.js → chunk-XV5HRIXG.js} +5 -5
  154. package/dist/chunk-XXJRZ75E.js +43 -0
  155. package/dist/{chunk-VDHUHXFF.js → chunk-XYG722JW.js} +2 -2
  156. package/dist/{chunk-MM7SWUQ4.js → chunk-YB7U4WTY.js} +4 -4
  157. package/dist/{chunk-RMRZXPUU.js → chunk-Z6H6Y4BS.js} +1 -1
  158. package/dist/{token-budget-UMHRRDBT.js → chunk-ZOVHXTGC.js} +2 -9
  159. package/dist/{chunk-HNLBHP6P.js → chunk-ZZXADKAP.js} +3 -3
  160. package/dist/{co-activation-OKAHEMPE.js → co-activation-WN25AJOC.js} +3 -2
  161. package/dist/{co-occurrence-IHSPB53O.js → co-occurrence-YP2Q3OEA.js} +5 -4
  162. package/dist/{code-context-index-KGY4LKCA.js → code-context-index-ZWONKBKX.js} +4 -4
  163. package/dist/{conversation-entity-extractor-KXJSHRGJ.js → conversation-entity-extractor-KYOBXNID.js} +2 -2
  164. package/dist/{crdt-sync-K2G3C6XY.js → crdt-sync-ZFIFL2QM.js} +1 -1
  165. package/dist/{crm-webhook-ERZSQ3CW.js → crm-webhook-DGPHULOO.js} +2 -2
  166. package/dist/{cto-delegation-gate-ZCJ53LBQ.js → cto-delegation-gate-OF2A3TSS.js} +12 -11
  167. package/dist/daemon-auth-N6P2MZAV.js +17 -0
  168. package/dist/{daemon-orchestration-V6HALVDS.js → daemon-orchestration-G4RRTPP7.js} +16 -15
  169. package/dist/daemon-ready-signal-3L2MJT7C.js +13 -0
  170. package/dist/{db-backup-VZHSFUVA.js → db-backup-EORG4LBO.js} +1 -1
  171. package/dist/{doc-graph-extractor-LQ2IFND2.js → doc-graph-extractor-APZS3DFD.js} +5 -4
  172. package/dist/{dreaming-QAKUASYV.js → dreaming-Q4E3WBGY.js} +13 -12
  173. package/dist/{exe-drift-H3UWNFFY.js → exe-drift-CI5R6GUT.js} +4 -3
  174. package/dist/{exe-export-MN5D4JMT.js → exe-export-HQIQASIT.js} +7 -6
  175. package/dist/{exe-import-IFFMEVD7.js → exe-import-ULZK56WC.js} +7 -6
  176. package/dist/{exe-key-RSZC72QK.js → exe-key-ILNSBGRN.js} +5 -4
  177. package/dist/{exe-snapshot-I622MPLS.js → exe-snapshot-RUZTWZOF.js} +16 -15
  178. package/dist/{factory-CTFAGZUA.js → factory-YHQZ6RZZ.js} +14 -6
  179. package/dist/{fast-db-init-QEFVT7Q3.js → fast-db-init-KNJRL7T3.js} +1 -1
  180. package/dist/{founder-context-3SOKEW76.js → founder-context-QCTMEK66.js} +2 -2
  181. package/dist/gateway/index.js +12 -11
  182. package/dist/{git-staleness-E7RPQA5U.js → git-staleness-KIA5YI4H.js} +3 -2
  183. package/dist/{git-task-sweep-D3A2C5BW.js → git-task-sweep-WH6QE7HL.js} +13 -12
  184. package/dist/{global-procedures-POG4V6IK.js → global-procedures-SYZZCGDS.js} +4 -3
  185. package/dist/{graph-auto-extract-E7KALNWA.js → graph-auto-extract-J2TIWZEE.js} +5 -4
  186. package/dist/{graph-rag-3RZN7JR3.js → graph-rag-HITZZ63L.js} +2 -2
  187. package/dist/hooks/bug-report-worker.js +15 -14
  188. package/dist/hooks/codex-stop-task-finalizer.js +15 -14
  189. package/dist/hooks/commit-complete.js +15 -14
  190. package/dist/hooks/error-recall.js +8 -7
  191. package/dist/hooks/exe-heartbeat-hook.js +4 -3
  192. package/dist/hooks/ingest-worker.js +4 -4
  193. package/dist/hooks/ingest.js +8 -7
  194. package/dist/hooks/instructions-loaded.js +5 -4
  195. package/dist/hooks/manifest.json +20 -20
  196. package/dist/hooks/notification.js +5 -4
  197. package/dist/hooks/post-compact.js +14 -13
  198. package/dist/hooks/post-tool-combined.js +7 -7
  199. package/dist/hooks/pre-compact.js +19 -18
  200. package/dist/hooks/pre-tool-use.js +18 -17
  201. package/dist/hooks/prompt-submit.js +28 -27
  202. package/dist/hooks/session-end.js +24 -23
  203. package/dist/hooks/session-start.js +46 -22
  204. package/dist/hooks/stop.js +22 -21
  205. package/dist/hooks/subagent-stop.js +14 -13
  206. package/dist/hooks/summary-worker.js +22 -21
  207. package/dist/index.js +25 -23
  208. package/dist/{installer-IXUX73JN.js → installer-3NB3IBHF.js} +10 -9
  209. package/dist/{installer-RCUPPZ7Y.js → installer-IIJFCTMH.js} +10 -9
  210. package/dist/{installer-HDD6OH5Z.js → installer-PSDYMGN7.js} +7 -6
  211. package/dist/lib/cloud-sync.js +14 -13
  212. package/dist/lib/consolidation.js +8 -7
  213. package/dist/lib/database.js +3 -2
  214. package/dist/lib/db-daemon-client.js +4 -4
  215. package/dist/lib/db.js +3 -2
  216. package/dist/lib/device-registry.js +3 -1
  217. package/dist/lib/embedder.js +4 -4
  218. package/dist/lib/employee-templates.js +5 -4
  219. package/dist/lib/employees.js +3 -2
  220. package/dist/lib/exe-daemon-client.js +3 -3
  221. package/dist/lib/exe-daemon.js +256 -406
  222. package/dist/lib/hybrid-search.js +6 -5
  223. package/dist/lib/identity.js +3 -2
  224. package/dist/lib/license.js +2 -2
  225. package/dist/lib/messaging.js +13 -12
  226. package/dist/lib/reminders.js +4 -3
  227. package/dist/lib/schedules.js +6 -5
  228. package/dist/lib/session-registry.js +5 -4
  229. package/dist/lib/skill-learning.js +7 -6
  230. package/dist/lib/store.js +7 -4
  231. package/dist/lib/task-router.js +4 -3
  232. package/dist/lib/tasks.js +14 -13
  233. package/dist/lib/tmux-routing.js +16 -11
  234. package/dist/lib/token-spend.js +4 -3
  235. package/dist/{license-gate-V2UCK4KJ.js → license-gate-7SDHCJUO.js} +3 -3
  236. package/dist/mcp/register-tools.js +74 -73
  237. package/dist/mcp/server.js +97 -79
  238. package/dist/mcp/tools/complete-reminder.js +5 -4
  239. package/dist/mcp/tools/create-reminder.js +5 -4
  240. package/dist/mcp/tools/create-task.js +16 -15
  241. package/dist/mcp/tools/deactivate-behavior.js +8 -7
  242. package/dist/mcp/tools/list-reminders.js +5 -4
  243. package/dist/mcp/tools/list-tasks.js +16 -15
  244. package/dist/mcp/tools/send-message.js +15 -14
  245. package/dist/mcp/tools/update-task.js +15 -14
  246. package/dist/{mcp-http-config-7LFFPNGV.js → mcp-http-config-QSOVFXHW.js} +4 -3
  247. package/dist/mcp-tool-surface-CSPFXL3F.js +15 -0
  248. package/dist/{memory-cards-BGI6MJRN.js → memory-cards-II67WFL2.js} +3 -2
  249. package/dist/{memory-graph-extractor-DTRRNWHZ.js → memory-graph-extractor-PM4Q2KJG.js} +6 -5
  250. package/dist/{memory-poisoning-defense-MOCWJK6S.js → memory-poisoning-defense-ECXSX7HK.js} +3 -2
  251. package/dist/{memory-queue-client-DD4E5SIZ.js → memory-queue-client-HLURQEV6.js} +4 -4
  252. package/dist/{memory-reflection-UKKTGZYR.js → memory-reflection-PXF6YFDU.js} +3 -2
  253. package/dist/{notifications-AMJ2K3MM.js → notifications-UP7WQGG4.js} +12 -11
  254. package/dist/{orchestration-events-MB4QVHTD.js → orchestration-events-PZLLPCKY.js} +4 -3
  255. package/dist/orchestration-health-read-EJWVUARG.js +191 -0
  256. package/dist/{orchestrator-M7DJH6TN.js → orchestrator-PUT45J4O.js} +14 -13
  257. package/dist/{pipeline-router-4LT5YG5P.js → pipeline-router-5CRWKESM.js} +4 -3
  258. package/dist/{plan-limits-ENS7OJWP.js → plan-limits-SH2NDFNX.js} +6 -5
  259. package/dist/{project-boot-6W5JPGSB.js → project-boot-2TCPDZ4S.js} +25 -1
  260. package/dist/{projection-worker-WWXZK7QD.js → projection-worker-HWY37MNC.js} +2 -2
  261. package/dist/{prospective-memory-VNGLPMS6.js → prospective-memory-FQSVMCGG.js} +3 -2
  262. package/dist/{reranker-6XBS55FA.js → reranker-AALRMGMM.js} +1 -1
  263. package/dist/{retrieval-health-ATX5TIQ2.js → retrieval-health-PNWJSJNG.js} +1 -1
  264. package/dist/{review-polling-E4ALHTQE.js → review-polling-65JZUE3T.js} +13 -12
  265. package/dist/runtime/index.js +24 -22
  266. package/dist/{session-events-3J6APMKN.js → session-events-EJ3OSAA6.js} +13 -12
  267. package/dist/session-kill-telemetry-3HGM7SNQ.js +63 -0
  268. package/dist/{session-scope-E54VIYTJ.js → session-scope-JGDYAMJO.js} +12 -11
  269. package/dist/{setup-wizard-XV736U5D.js → setup-wizard-44LMFM2C.js} +1 -1
  270. package/dist/shared-rate-limit-store-QZPQEVE2.js +80 -0
  271. package/dist/{skill-refinement-FTURVWFN.js → skill-refinement-DUOO6B7V.js} +3 -2
  272. package/dist/{stack-release-JZVTSBJJ.js → stack-release-XYMKU7NT.js} +53 -4
  273. package/dist/{stack-update-BIK2QHOE.js → stack-update-XHQJRJEP.js} +5 -3
  274. package/dist/{steward-gate-YGU4VXPP.js → steward-gate-6NWRDLX2.js} +4 -3
  275. package/dist/{task-enforcement-GY3VTY6L.js → task-enforcement-UOULTGFB.js} +12 -11
  276. package/dist/{task-scope-PYOK7OQ6.js → task-scope-P5STKYAC.js} +12 -11
  277. package/dist/{tasks-crud-HLJEJ2UU.js → tasks-crud-24HMTULR.js} +12 -11
  278. package/dist/{tasks-notify-NGS3DWUJ.js → tasks-notify-LAIU7UUI.js} +13 -12
  279. package/dist/{tasks-review-BP5V2X34.js → tasks-review-AFJAU2DY.js} +12 -11
  280. package/dist/{telemetry-upload-AXYPFAPS.js → telemetry-upload-DWFGC2XJ.js} +8 -7
  281. package/dist/token-budget-4RFZKWGH.js +16 -0
  282. package/dist/{tool-capability-index-RHPVMMDD.js → tool-capability-index-ZEXBWKUZ.js} +1 -1
  283. package/dist/{tool-telemetry-BLSVABFJ.js → tool-telemetry-BS5JXM5M.js} +1 -1
  284. package/dist/tui/App.js +21 -20
  285. package/dist/{tui-data-EYPOFYLS.js → tui-data-UNO5B7PU.js} +12 -11
  286. package/dist/{worker-gate-SMFOBMMX.js → worker-gate-C6CTTYMD.js} +1 -1
  287. package/dist/{workflow-engine-TDJZ3TXB.js → workflow-engine-4W2KYCDV.js} +2 -2
  288. package/dist/{worktree-XISIYRM4.js → worktree-2CXY6NEB.js} +5 -4
  289. package/dist/{worktree-sweep-AS6GAR6X.js → worktree-sweep-K3CJFSUL.js} +6 -5
  290. package/package.json +9 -4
  291. package/release-notes.json +17 -88
  292. package/stack.release.json +51 -4
  293. package/dist/chunk-PHOQAVTK.js +0 -42
  294. package/dist/daemon-auth-BK7ON5ZH.js +0 -13
  295. package/dist/session-kill-telemetry-KOAHLRBT.js +0 -31
  296. package/dist/{chunk-XDE5IGBX.js → chunk-2NS3QRMJ.js} +0 -0
  297. package/dist/{chunk-JTMKRUX6.js → chunk-A2YZG4AD.js} +0 -0
  298. package/dist/{chunk-UZATXREL.js → chunk-AE74NOE6.js} +0 -0
  299. package/dist/{chunk-LUGWK6QB.js → chunk-FF5DA4XP.js} +3 -3
  300. /package/dist/{chunk-BGOMFGSW.js → chunk-GWPICNSO.js} +0 -0
  301. /package/dist/{chunk-NLHUA3YB.js → chunk-I3DPCSDG.js} +0 -0
  302. /package/dist/{chunk-YM3367VC.js → chunk-J3SR5MGG.js} +0 -0
  303. /package/dist/{chunk-FKFVNV7X.js → chunk-K4BKJJ4F.js} +0 -0
  304. /package/dist/{chunk-PTDBHQX7.js → chunk-MQCTK6EF.js} +0 -0
  305. /package/dist/{chunk-GBV5PV5T.js → chunk-QNXM2HXW.js} +0 -0
  306. /package/dist/{chunk-GZSG2ZOX.js → chunk-YUBTHJVV.js} +0 -0
  307. /package/dist/{core-memory-4OM7LR77.js → core-memory-OC5ITKKV.js} +0 -0
  308. /package/dist/{entity-boost-SFHIRXT5.js → entity-boost-NF3LE6OJ.js} +0 -0
  309. /package/dist/{message-queue-client-QTC3VHJT.js → message-queue-client-4VDU6BZY.js} +0 -0
  310. /package/dist/{oauth-server-BPN55EJM.js → oauth-server-EWUL7DMD.js} +0 -0
  311. /package/dist/{wiki-acl-45SIGG4O.js → wiki-acl-CONNF6ES.js} +0 -0
@@ -0,0 +1,33 @@
1
+ // src/lib/providers/billing-mode.ts
2
+ function isTrue(v) {
3
+ return typeof v === "string" && v.trim().toLowerCase() === "true";
4
+ }
5
+ function resolveBillingMode(env = process.env) {
6
+ const rawMode = (env.EXE_BILLING_MODE ?? "").trim().toLowerCase();
7
+ const explicitAllow = isTrue(env.EXE_ALLOW_DIRECT_PROVIDER_KEYS);
8
+ const byokAlias = isTrue(env.BYOK_ENABLED);
9
+ if (rawMode === "metered") {
10
+ return {
11
+ mode: "metered",
12
+ allowDirectKeys: false,
13
+ reason: byokAlias || explicitAllow ? "EXE_BILLING_MODE=metered overrides BYOK opt-in \u2014 metering enforced, direct keys rejected" : "EXE_BILLING_MODE=metered \u2014 metering enforced"
14
+ };
15
+ }
16
+ const byokRequested = rawMode === "byok" || byokAlias || explicitAllow;
17
+ if (!byokRequested) {
18
+ return {
19
+ mode: "metered",
20
+ allowDirectKeys: false,
21
+ reason: "no BYOK opt-in (EXE_BILLING_MODE/EXE_ALLOW_DIRECT_PROVIDER_KEYS/BYOK_ENABLED unset) \u2014 metering enforced"
22
+ };
23
+ }
24
+ return {
25
+ mode: "byok",
26
+ allowDirectKeys: true,
27
+ reason: "BYOK explicitly enabled \u2014 direct provider keys accepted, billing not metered"
28
+ };
29
+ }
30
+
31
+ export {
32
+ resolveBillingMode
33
+ };
@@ -119,7 +119,7 @@ function releaseBackfillLock() {
119
119
  }
120
120
  async function getTaskAwareCapacity() {
121
121
  const { getClient } = await import("./lib/database.js");
122
- const { sessionScopeFilter } = await import("./task-scope-PYOK7OQ6.js");
122
+ const { sessionScopeFilter } = await import("./task-scope-P5STKYAC.js");
123
123
  const client = getClient();
124
124
  const scope = sessionScopeFilter();
125
125
  const result = await client.execute({
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  recordSessionKill
3
- } from "./chunk-D6UICP3C.js";
3
+ } from "./chunk-LMX7UKGX.js";
4
4
  import {
5
5
  sessionScopeFilter,
6
6
  verifyPaneAtCapacity,
7
7
  writeNotification
8
- } from "./chunk-OVKNFTCL.js";
8
+ } from "./chunk-HED6D5KR.js";
9
9
  import {
10
10
  listSessions
11
- } from "./chunk-2LJDLQNO.js";
11
+ } from "./chunk-WJ2PZGRV.js";
12
12
  import {
13
13
  getTransport
14
14
  } from "./chunk-KOO3J5PV.js";
15
15
  import {
16
16
  recordOrchestrationEventBestEffort
17
- } from "./chunk-WHOT5NZ7.js";
17
+ } from "./chunk-OR3TAZL3.js";
18
18
  import {
19
19
  getClient,
20
20
  isCoordinatorName
21
- } from "./chunk-P3SIFDES.js";
21
+ } from "./chunk-SCYWCWKY.js";
22
22
 
23
23
  // src/lib/capacity-monitor.ts
24
24
  var CAPACITY_PATTERNS = [
@@ -2,7 +2,7 @@ import {
2
2
  ensureWorktree,
3
3
  getGitRoot,
4
4
  isWorktreeDirty
5
- } from "./chunk-YNALY3SX.js";
5
+ } from "./chunk-RZJ6DXVE.js";
6
6
  import {
7
7
  buildTaskResult,
8
8
  serializeMessage
@@ -16,16 +16,16 @@ import {
16
16
  } from "./chunk-E23LNUWJ.js";
17
17
  import {
18
18
  registerSession
19
- } from "./chunk-2LJDLQNO.js";
20
- import {
21
- getTransport
22
- } from "./chunk-KOO3J5PV.js";
19
+ } from "./chunk-WJ2PZGRV.js";
23
20
  import {
24
21
  listTmuxSessions
25
22
  } from "./chunk-SSTLTIF3.js";
23
+ import {
24
+ getTransport
25
+ } from "./chunk-KOO3J5PV.js";
26
26
  import {
27
27
  recordOrchestrationEventBestEffort
28
- } from "./chunk-WHOT5NZ7.js";
28
+ } from "./chunk-OR3TAZL3.js";
29
29
  import {
30
30
  getAgentRuntime,
31
31
  normalizeCcModelName
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  PlanLimitError,
38
38
  assertEmployeeLimitSync
39
- } from "./chunk-VDHUHXFF.js";
39
+ } from "./chunk-XYG722JW.js";
40
40
  import {
41
41
  getSessionKey
42
42
  } from "./chunk-CVYC6DUW.js";
@@ -51,7 +51,7 @@ import {
51
51
  } from "./chunk-MP2AFCGL.js";
52
52
  import {
53
53
  ensureAgentSymlink
54
- } from "./chunk-AYMSIV7X.js";
54
+ } from "./chunk-NIZQ3CIS.js";
55
55
  import {
56
56
  expandDualPrefixTools
57
57
  } from "./chunk-HYZV25LY.js";
@@ -63,10 +63,10 @@ import {
63
63
  isCoordinatorName,
64
64
  loadEmployees,
65
65
  loadEmployeesSync
66
- } from "./chunk-P3SIFDES.js";
66
+ } from "./chunk-SCYWCWKY.js";
67
67
  import {
68
68
  loadDeviceId
69
- } from "./chunk-VME3UH4D.js";
69
+ } from "./chunk-JV225JBX.js";
70
70
  import {
71
71
  EXE_AI_DIR
72
72
  } from "./chunk-DFIOOK5R.js";
@@ -673,7 +673,7 @@ async function createTaskCore(input) {
673
673
  if (isCoordinatorSession) {
674
674
  earlySessionScope = resolved;
675
675
  } else {
676
- const { getSessionProject } = await import("./session-scope-E54VIYTJ.js");
676
+ const { getSessionProject } = await import("./session-scope-JGDYAMJO.js");
677
677
  const sessionProject = getSessionProject(resolved);
678
678
  if (sessionProject && sessionProject !== input.projectName) {
679
679
  scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
@@ -922,7 +922,7 @@ async function queryTaskRows(opts) {
922
922
  }
923
923
  if (opts.founderId !== null) {
924
924
  try {
925
- const { founderScopeFilter } = await import("./founder-context-3SOKEW76.js");
925
+ const { founderScopeFilter } = await import("./founder-context-QCTMEK66.js");
926
926
  const founderFilter = founderScopeFilter(opts.founderId);
927
927
  const cleaned = founderFilter.sql.replace(/^\s*AND\s+/, "");
928
928
  conditions.push(cleaned);
@@ -1154,7 +1154,7 @@ async function updateTaskStatus(input) {
1154
1154
  } catch {
1155
1155
  }
1156
1156
  try {
1157
- const { writeNotification: writeNotification2 } = await import("./notifications-AMJ2K3MM.js");
1157
+ const { writeNotification: writeNotification2 } = await import("./notifications-UP7WQGG4.js");
1158
1158
  await writeNotification2({
1159
1159
  agentId: reviewer,
1160
1160
  agentRole: isCoordinatorName(reviewer) ? "COO" : "manager",
@@ -1574,7 +1574,7 @@ ${input.result ?? ""}`;
1574
1574
  }
1575
1575
  if (shouldWriteCompletionMemory && input.result) {
1576
1576
  try {
1577
- const { writeMemoryViaDaemon } = await import("./memory-queue-client-DD4E5SIZ.js");
1577
+ const { writeMemoryViaDaemon } = await import("./memory-queue-client-HLURQEV6.js");
1578
1578
  await writeMemoryViaDaemon({
1579
1579
  raw_text: input.result,
1580
1580
  agent_id: String(row.assigned_to),
@@ -1677,7 +1677,7 @@ ${input.result ?? ""}`;
1677
1677
  }
1678
1678
  if (input.status === "done" || input.status === "needs_review") {
1679
1679
  try {
1680
- const { incrementSkillSuccess } = await import("./skill-refinement-FTURVWFN.js");
1680
+ const { incrementSkillSuccess } = await import("./skill-refinement-DUOO6B7V.js");
1681
1681
  await incrementSkillSuccess(
1682
1682
  String(row.assigned_to),
1683
1683
  row.project_name ? String(row.project_name) : null
@@ -2847,6 +2847,45 @@ function formatIntercomPrompt(reason = "nudge") {
2847
2847
  }
2848
2848
 
2849
2849
  // src/lib/tmux-routing.ts
2850
+ var _cachedExeBinDir;
2851
+ function resolveExeBinDir() {
2852
+ if (_cachedExeBinDir !== void 0) return _cachedExeBinDir;
2853
+ const nodeBinDir = path7.dirname(process.execPath);
2854
+ if (existsSync7(path7.join(nodeBinDir, "exe-launch-agent"))) {
2855
+ _cachedExeBinDir = nodeBinDir;
2856
+ return _cachedExeBinDir;
2857
+ }
2858
+ const localBin = path7.join(os5.homedir(), ".local", "bin");
2859
+ if (existsSync7(path7.join(localBin, "exe-launch-agent"))) {
2860
+ _cachedExeBinDir = localBin;
2861
+ return _cachedExeBinDir;
2862
+ }
2863
+ _cachedExeBinDir = null;
2864
+ return _cachedExeBinDir;
2865
+ }
2866
+ function _resetExeBinDirCache() {
2867
+ _cachedExeBinDir = void 0;
2868
+ }
2869
+ function buildSpawnPath(inheritedPath = process.env.PATH, execPath = process.execPath) {
2870
+ const sep = path7.delimiter;
2871
+ const nodeBinDir = path7.dirname(execPath);
2872
+ const localBin = path7.join(os5.homedir(), ".local", "bin");
2873
+ const exeBinDir = resolveExeBinDir();
2874
+ const prefixDirs = [nodeBinDir, exeBinDir, localBin].filter(
2875
+ (d) => Boolean(d)
2876
+ );
2877
+ const fallbackDirs = ["/opt/homebrew/bin", "/usr/local/bin", "/usr/bin", "/bin"];
2878
+ const inherited = (inheritedPath ?? "").split(sep).filter(Boolean);
2879
+ const seen = /* @__PURE__ */ new Set();
2880
+ const ordered = [];
2881
+ for (const dir of [...prefixDirs, ...inherited, ...fallbackDirs]) {
2882
+ if (!seen.has(dir)) {
2883
+ seen.add(dir);
2884
+ ordered.push(dir);
2885
+ }
2886
+ }
2887
+ return ordered.join(sep);
2888
+ }
2850
2889
  var SPAWN_LOCK_DIR = path7.join(os5.homedir(), ".exe-os", "spawn-locks");
2851
2890
  function spawnLockPath(sessionName) {
2852
2891
  return path7.join(SPAWN_LOCK_DIR, `${sessionName}.lock`);
@@ -3276,7 +3315,7 @@ async function verifyPaneAtCapacity(sessionName) {
3276
3315
  reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
3277
3316
  };
3278
3317
  }
3279
- const { isAtCapacity } = await import("./capacity-monitor-B4S3XEDO.js");
3318
+ const { isAtCapacity } = await import("./capacity-monitor-BUKYPSWR.js");
3280
3319
  if (!isAtCapacity(pane)) {
3281
3320
  return {
3282
3321
  atCapacity: false,
@@ -4026,6 +4065,46 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4026
4065
  } catch {
4027
4066
  }
4028
4067
  const spawnCwd = opts?.cwd ?? projectDir;
4068
+ try {
4069
+ const inWorktree = spawnCwd.includes("/.worktrees/") || spawnCwd.includes("/.claude/worktrees/");
4070
+ if (!inWorktree) {
4071
+ const COORDINATOR_ROLES = /* @__PURE__ */ new Set(["COO", "CTO", "CMO"]);
4072
+ const roster = loadEmployeesSync();
4073
+ const emp = roster.find(
4074
+ (e) => baseAgentName(e.name) === baseAgentName(employeeName)
4075
+ );
4076
+ const isCodeRole = emp != null && !COORDINATOR_ROLES.has(emp.role);
4077
+ if (isCodeRole) {
4078
+ const reason = opts?.cwd != null ? "preset_cwd" : process.env.EXE_IS_DAEMON === "1" ? "daemon_env" : "git_timeout";
4079
+ process.stderr.write(
4080
+ `[tmux-routing] WORKTREE BYPASSED: code-role ${employeeName} (role=${emp.role}) spawning in MAIN checkout ${spawnCwd} (reason=${reason}) \u2014 commits will land on main
4081
+ `
4082
+ );
4083
+ recordOrchestrationEventBestEffort({
4084
+ eventType: "worktree.bypassed",
4085
+ source: "tmux-routing.spawnEmployee",
4086
+ severity: "warn",
4087
+ agentId: employeeName,
4088
+ sessionScope: exeSession,
4089
+ instanceId: opts?.instance != null ? String(opts.instance) : null,
4090
+ tmuxSession: sessionName,
4091
+ payload: { agent: employeeName, role: emp.role, cwd: spawnCwd, reason }
4092
+ });
4093
+ } else if (emp == null) {
4094
+ recordOrchestrationEventBestEffort({
4095
+ eventType: "worktree.bypassed",
4096
+ source: "tmux-routing.spawnEmployee",
4097
+ severity: "warn",
4098
+ agentId: employeeName,
4099
+ sessionScope: exeSession,
4100
+ instanceId: opts?.instance != null ? String(opts.instance) : null,
4101
+ tmuxSession: sessionName,
4102
+ payload: { agent: employeeName, role: "unknown", cwd: spawnCwd, reason: "roster_miss" }
4103
+ });
4104
+ }
4105
+ }
4106
+ } catch {
4107
+ }
4029
4108
  const useExeAgent = !!(opts?.model && opts?.provider);
4030
4109
  const baseRtConfig = getAgentRuntime(employeeName);
4031
4110
  const agentRtConfig = {
@@ -4092,7 +4171,13 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4092
4171
  EXE_SESSION: exeSession,
4093
4172
  EXE_SESSION_NAME: sessionName,
4094
4173
  EXE_SESSION_START_ISO: (/* @__PURE__ */ new Date()).toISOString(),
4095
- EXE_OS_ENABLE_LEAN_MCP: "1"
4174
+ EXE_OS_ENABLE_LEAN_MCP: "1",
4175
+ // Bug bbf7824c: tmux inherits a minimal PATH from the launchd-spawned
4176
+ // daemon, which omits the nvm/.local bin dir where exe-launch-agent,
4177
+ // exe-agent, and claude live — so the spawn command is unresolvable and
4178
+ // every auto-dispatch fails. Carry an explicit, PATH that includes the
4179
+ // running node's bin dir and preserves the inherited PATH.
4180
+ PATH: buildSpawnPath()
4096
4181
  };
4097
4182
  if (ccProvider !== DEFAULT_PROVIDER) {
4098
4183
  const cfg = PROVIDER_TABLE[ccProvider];
@@ -4159,7 +4244,13 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4159
4244
  );
4160
4245
  spawnCommand = `${binName}${cleanupSuffix}`;
4161
4246
  } else {
4162
- spawnCommand = `exe-launch-agent --agent ${employeeName}${cleanupSuffix}`;
4247
+ let launcherAbs = "";
4248
+ try {
4249
+ const launcherJs = path7.join(path7.dirname(fileURLToPath(import.meta.url)), "..", "bin", "exe-launch-agent.js");
4250
+ if (existsSync7(launcherJs)) launcherAbs = launcherJs;
4251
+ } catch {
4252
+ }
4253
+ spawnCommand = launcherAbs ? `"${process.execPath}" "${launcherAbs}" --agent ${employeeName}${cleanupSuffix}` : `exe-launch-agent --agent ${employeeName}${cleanupSuffix}`;
4163
4254
  }
4164
4255
  const tmuxEnvArgs = Object.entries(launchEnv).flatMap(([key, val]) => ["-e", `${key}=${val}`]);
4165
4256
  let spawnResult;
@@ -4229,8 +4320,23 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4229
4320
  if (!sessionLive) {
4230
4321
  releaseSpawnLock(sessionName);
4231
4322
  const runtimeLabel = useExeAgent ? "exe-agent" : useCodex ? "codex" : useOpencode ? "opencode" : "claude";
4232
- const errMsg = `spawn did not start: tmux session "${sessionName}" never came alive within ${LIVENESS_CAP_MS / 1e3}s (${runtimeLabel} process failed to launch or exited immediately). Check ~/.exe-os/session-logs/${instanceLabel}-*.log \u2014 common cause: installed Claude Code does not support a launch flag.`;
4233
- process.stderr.write(`[tmux-routing] SPAWN FAILED ${sessionName}: ${errMsg}
4323
+ let lastPane = "";
4324
+ try {
4325
+ lastPane = transport.capturePane(sessionName, 50);
4326
+ } catch {
4327
+ }
4328
+ const paneLc = lastPane.toLowerCase();
4329
+ let spawnFailureCause;
4330
+ if (paneLc.includes("command not found") || paneLc.includes(": not found")) {
4331
+ spawnFailureCause = "path_not_found";
4332
+ } else if (paneLc.includes("exit 127") || paneLc.includes("claude") && paneLc.includes("not found") || paneLc.includes("not support") || // existing "unsupported launch flag" hint
4333
+ paneLc.includes("unknown option") || paneLc.includes("enoent")) {
4334
+ spawnFailureCause = "claude_launch_failed";
4335
+ } else {
4336
+ spawnFailureCause = "timeout";
4337
+ }
4338
+ const errMsg = `spawn did not start: tmux session "${sessionName}" never came alive within ${LIVENESS_CAP_MS / 1e3}s (${runtimeLabel} process failed to launch or exited immediately; cause=${spawnFailureCause}). Check ~/.exe-os/session-logs/${instanceLabel}-*.log \u2014 common cause: installed Claude Code does not support a launch flag, or the daemon PATH excludes the node/launcher bin dir (cause=path_not_found).`;
4339
+ process.stderr.write(`[tmux-routing] SPAWN FAILED ${sessionName} (${spawnFailureCause}): ${errMsg}
4234
4340
  `);
4235
4341
  recordOrchestrationEventBestEffort({
4236
4342
  eventType: "tmux.spawn.completed",
@@ -4243,7 +4349,10 @@ function spawnEmployee(employeeName, exeSession, projectDir, opts) {
4243
4349
  runtime: useCodex ? "codex" : useOpencode ? "opencode" : useExeAgent ? "exe-agent" : "claude",
4244
4350
  durationMs: Date.now() - spawnStartedAt,
4245
4351
  result: "failed",
4246
- errorCode: "spawn_session_not_live"
4352
+ // Refined, classified errorCode drives the spawnFailureByCause breakdown
4353
+ // in orchestration-events. Keep the generic detail in payload for context.
4354
+ errorCode: spawnFailureCause,
4355
+ payload: { spawnFailureCause, detail: "spawn_session_not_live", spawnCommand }
4247
4356
  });
4248
4357
  return { sessionName, error: errMsg };
4249
4358
  }
@@ -4433,6 +4542,8 @@ export {
4433
4542
  createReviewForCompletedTask,
4434
4543
  cleanupReviewFile,
4435
4544
  formatIntercomPrompt,
4545
+ _resetExeBinDirCache,
4546
+ buildSpawnPath,
4436
4547
  acquireSpawnLock,
4437
4548
  releaseSpawnLock,
4438
4549
  getMySession,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  sendMessage
3
- } from "./chunk-QWLPAEG5.js";
3
+ } from "./chunk-4Q5VNQTV.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-LE7CDIOA.js";
6
+ } from "./chunk-BUOMSIXH.js";
7
7
 
8
8
  // src/mcp/tools/send-message.ts
9
9
  import { z } from "zod";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getActiveAgent
3
- } from "./chunk-LE7CDIOA.js";
3
+ } from "./chunk-BUOMSIXH.js";
4
4
  import {
5
5
  listTasks
6
- } from "./chunk-OVKNFTCL.js";
6
+ } from "./chunk-HED6D5KR.js";
7
7
  import {
8
8
  getAgentContext
9
9
  } from "./chunk-GJV3WDWM.js";
10
10
  import {
11
11
  isCoordinatorName
12
- } from "./chunk-P3SIFDES.js";
12
+ } from "./chunk-SCYWCWKY.js";
13
13
 
14
14
  // src/mcp/tools/list-tasks.ts
15
15
  import { z } from "zod";
@@ -2,7 +2,7 @@ import {
2
2
  getClient,
3
3
  isCoordinatorName,
4
4
  loadEmployeesSync
5
- } from "./chunk-P3SIFDES.js";
5
+ } from "./chunk-SCYWCWKY.js";
6
6
 
7
7
  // src/lib/steward-gate.ts
8
8
  import crypto from "crypto";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-VUH67PT4.js";
5
5
  import {
6
6
  getClient
7
- } from "./chunk-P3SIFDES.js";
7
+ } from "./chunk-SCYWCWKY.js";
8
8
 
9
9
  // src/lib/global-procedures.ts
10
10
  import { randomUUID } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getGlobalProceduresBlock
3
- } from "./chunk-Z3EXECOX.js";
3
+ } from "./chunk-ISILDO7P.js";
4
4
 
5
5
  // src/lib/employee-templates.ts
6
6
  var BASE_OPERATING_PROCEDURES = `
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeReminder
3
- } from "./chunk-ORNKGGFX.js";
3
+ } from "./chunk-JNARUXDC.js";
4
4
 
5
5
  // src/mcp/tools/complete-reminder.ts
6
6
  import { z } from "zod";
@@ -204,7 +204,7 @@ async function main(args) {
204
204
  console.log("[health-gate] Starting rollback...");
205
205
  restorePreDeployBackup();
206
206
  try {
207
- const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-BIK2QHOE.js");
207
+ const { rollbackStackUpdate, defaultStackPaths } = await import("./stack-update-XHQJRJEP.js");
208
208
  const paths = defaultStackPaths();
209
209
  await rollbackStackUpdate({
210
210
  manifestRef: paths.manifestRef,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-P3SIFDES.js";
3
+ } from "./chunk-SCYWCWKY.js";
4
4
  import {
5
5
  loadConfig
6
6
  } from "./chunk-DFIOOK5R.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDeviceInfo
3
- } from "./chunk-CXKR5Z5F.js";
3
+ } from "./chunk-2EJ636HI.js";
4
4
  import {
5
5
  EXE_AI_DIR
6
6
  } from "./chunk-DFIOOK5R.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ELXR65AN.js";
4
4
  import {
5
5
  loadEmployeesSync
6
- } from "./chunk-P3SIFDES.js";
6
+ } from "./chunk-SCYWCWKY.js";
7
7
 
8
8
  // src/adapters/mcp-http-config.ts
9
9
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -1,20 +1,23 @@
1
1
  import {
2
2
  MultiAgentOrchestrator
3
- } from "./chunk-BEIYF4NS.js";
3
+ } from "./chunk-W2J2RF5N.js";
4
+ import {
5
+ createTokenBudgetMiddleware
6
+ } from "./chunk-ZOVHXTGC.js";
4
7
  import {
5
8
  createQuietRenderer,
6
9
  createTerminalRenderer,
7
10
  renderAgentEvents
8
11
  } from "./chunk-YZFZDJWZ.js";
9
- import {
10
- checkDangerousPatterns,
11
- hasCriticalPattern
12
- } from "./chunk-CMCYL2JC.js";
13
12
  import {
14
13
  checkPathSafety,
15
14
  checkReadPathSafety,
16
15
  containsPathTraversal
17
16
  } from "./chunk-NGVOA6ZQ.js";
17
+ import {
18
+ checkDangerousPatterns,
19
+ hasCriticalPattern
20
+ } from "./chunk-CMCYL2JC.js";
18
21
  import {
19
22
  ContextManager,
20
23
  agentLoop,
@@ -28,10 +31,6 @@ import {
28
31
  recordSuccess,
29
32
  shouldFallbackToAsk
30
33
  } from "./chunk-UAMWGUBX.js";
31
- import {
32
- composeHooks,
33
- createDefaultHooks
34
- } from "./chunk-O377P7GM.js";
35
34
  import {
36
35
  ToolRegistry,
37
36
  partitionTools,
@@ -50,6 +49,10 @@ import {
50
49
  matchInputPattern,
51
50
  matchToolPattern
52
51
  } from "./chunk-HF25XPZE.js";
52
+ import {
53
+ composeHooks,
54
+ createDefaultHooks
55
+ } from "./chunk-O377P7GM.js";
53
56
  import {
54
57
  StateBus,
55
58
  orgBus
@@ -206,7 +209,7 @@ function createExeOSHooks(config) {
206
209
  );
207
210
  }
208
211
  try {
209
- const { listBehaviors } = await import("./behaviors-JM6KFSXL.js");
212
+ const { listBehaviors } = await import("./behaviors-47CPEKJ7.js");
210
213
  const behaviors = await listBehaviors(config.agentId, config.projectName, 12);
211
214
  if (behaviors.length > 0) {
212
215
  process.stderr.write(
@@ -327,7 +330,7 @@ function createExeOSHooks(config) {
327
330
  async onSubagentStop(_reason) {
328
331
  try {
329
332
  const { getClient } = await import("./lib/database.js");
330
- const { sessionScopeFilter } = await import("./task-scope-PYOK7OQ6.js");
333
+ const { sessionScopeFilter } = await import("./task-scope-P5STKYAC.js");
331
334
  const client = getClient();
332
335
  const ehScope = sessionScopeFilter();
333
336
  const tasks = await client.execute({
@@ -419,7 +422,7 @@ function createExeOSHooks(config) {
419
422
  try {
420
423
  const { writeMemory, flushBatch } = await import("./lib/store.js");
421
424
  const { getClient } = await import("./lib/database.js");
422
- const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-PYOK7OQ6.js");
425
+ const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-P5STKYAC.js");
423
426
  const client = getClient();
424
427
  const cpScope = cpScopeFilter();
425
428
  const tasks = await client.execute({
@@ -482,10 +485,20 @@ ${taskList}`,
482
485
  var SessionManager = class {
483
486
  sessions = /* @__PURE__ */ new Map();
484
487
  eventHandlers = /* @__PURE__ */ new Set();
485
- /** Start a new agent session for an employee */
486
- startSession(employeeId, config) {
488
+ /**
489
+ * Start a new agent session for an employee.
490
+ *
491
+ * When `taskId` is provided, a token-budget middleware bound to that task
492
+ * is constructed and attached to the agent-loop config so per-task token
493
+ * limits are enforced live. The middleware reads budget config from the
494
+ * tasks DB on every call and is a no-op when the task has no `budget_tokens`
495
+ * set — so budget-less sessions are entirely unaffected. An explicit
496
+ * `config.tokenBudgetMiddleware` always takes precedence (we never override).
497
+ */
498
+ startSession(employeeId, config, taskId) {
487
499
  const sessionId = randomUUID2();
488
500
  const abortController = new AbortController();
501
+ const tokenBudgetMiddleware = config.tokenBudgetMiddleware ?? (taskId ? createTokenBudgetMiddleware(taskId) : void 0);
489
502
  const session = {
490
503
  info: {
491
504
  sessionId,
@@ -496,7 +509,7 @@ var SessionManager = class {
496
509
  status: "active",
497
510
  messageCount: 0
498
511
  },
499
- config: { ...config, abortController },
512
+ config: { ...config, abortController, tokenBudgetMiddleware },
500
513
  history: [],
501
514
  abortController,
502
515
  processing: false
@@ -589,14 +602,19 @@ var SessionManager = class {
589
602
  offEvent(handler) {
590
603
  this.eventHandlers.delete(handler);
591
604
  }
592
- /** Start a session with ExeOS hooks wired in */
593
- startExeOSSession(employeeId, config, hookConfig) {
605
+ /**
606
+ * Start a session with ExeOS hooks wired in.
607
+ *
608
+ * Pass `taskId` to enable live per-task token-budget enforcement (no-op
609
+ * when the task has no budget configured — see `startSession`).
610
+ */
611
+ startExeOSSession(employeeId, config, hookConfig, taskId) {
594
612
  const exeHooks = createExeOSHooks(hookConfig);
595
613
  const composedConfig = {
596
614
  ...config,
597
615
  hooks: composeHooks(exeHooks, config.hooks)
598
616
  };
599
- return this.startSession(employeeId, composedConfig);
617
+ return this.startSession(employeeId, composedConfig, taskId);
600
618
  }
601
619
  /** Stop all sessions */
602
620
  stopAll() {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  storeBehavior
3
- } from "./chunk-N76VTMMF.js";
3
+ } from "./chunk-PMEOSD6S.js";
4
4
  import {
5
5
  getClient
6
- } from "./chunk-P3SIFDES.js";
6
+ } from "./chunk-SCYWCWKY.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-DFIOOK5R.js";
@@ -4,31 +4,31 @@ import {
4
4
  } from "./chunk-HMP5VT6A.js";
5
5
  import {
6
6
  createTask
7
- } from "./chunk-GSWGOGP5.js";
7
+ } from "./chunk-EOS7VPVT.js";
8
8
  import {
9
9
  getActiveAgent
10
- } from "./chunk-LE7CDIOA.js";
10
+ } from "./chunk-BUOMSIXH.js";
11
11
  import {
12
12
  ensureEmployee,
13
13
  logTaskDispatch,
14
14
  resolveExeSession
15
- } from "./chunk-OVKNFTCL.js";
15
+ } from "./chunk-HED6D5KR.js";
16
16
  import {
17
17
  recordOrchestrationEventBestEffort
18
- } from "./chunk-WHOT5NZ7.js";
18
+ } from "./chunk-OR3TAZL3.js";
19
19
  import {
20
20
  getAgentRuntime,
21
21
  validateRuntimeModel
22
22
  } from "./chunk-QB5JOGPK.js";
23
23
  import {
24
24
  getLicenseSync
25
- } from "./chunk-VDHUHXFF.js";
25
+ } from "./chunk-XYG722JW.js";
26
26
  import {
27
27
  getAgentContext
28
28
  } from "./chunk-GJV3WDWM.js";
29
29
  import {
30
30
  isCoordinatorName
31
- } from "./chunk-P3SIFDES.js";
31
+ } from "./chunk-SCYWCWKY.js";
32
32
 
33
33
  // src/mcp/tools/create-task.ts
34
34
  import { z } from "zod";
@@ -334,7 +334,7 @@ function registerCreateTask(server) {
334
334
  session_scope: sessionScope,
335
335
  created_at: (/* @__PURE__ */ new Date()).toISOString()
336
336
  }), "utf-8");
337
- const { recordOrchestrationEventBestEffort: recordOE } = await import("./orchestration-events-MB4QVHTD.js");
337
+ const { recordOrchestrationEventBestEffort: recordOE } = await import("./orchestration-events-PZLLPCKY.js");
338
338
  recordOE({
339
339
  eventType: "signal.created",
340
340
  source: "create-task.mcp",
@@ -366,7 +366,7 @@ function registerCreateTask(server) {
366
366
  let projectConflictOpts = {};
367
367
  try {
368
368
  const { getClient } = await import("./lib/database.js");
369
- const { sessionScopeFilter } = await import("./task-scope-PYOK7OQ6.js");
369
+ const { sessionScopeFilter } = await import("./task-scope-P5STKYAC.js");
370
370
  const client = getClient();
371
371
  const scope = sessionScopeFilter(task.sessionScope || callerRoot || exeSession || null);
372
372
  const existing = await client.execute({