@askexenow/exe-os 0.9.199 → 0.9.200

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 (230) hide show
  1. package/dist/{active-agent-O433V5SV.js → active-agent-J3YKAXE2.js} +2 -2
  2. package/dist/{active-agent-PWI2YWBG.js → active-agent-LCEW3PSL.js} +2 -2
  3. package/dist/{agentic-ontology-64X76FKF.js → agentic-ontology-N5HXDWIN.js} +1 -1
  4. package/dist/{backfill-metadata-RL7T4XGY.js → backfill-metadata-LIACQP2F.js} +3 -3
  5. package/dist/{behaviors-ZW4BWUGD.js → behaviors-GXMZW7B3.js} +2 -2
  6. package/dist/bin/agentic-ontology-backfill.js +4 -4
  7. package/dist/bin/agentic-reflection-backfill.js +5 -5
  8. package/dist/bin/agentic-semantic-label.js +4 -4
  9. package/dist/bin/backfill-conversations.js +4 -4
  10. package/dist/bin/backfill-responses.js +4 -4
  11. package/dist/bin/backfill-vectors.js +5 -5
  12. package/dist/bin/bulk-sync-postgres.js +5 -5
  13. package/dist/bin/cleanup-stale-review-tasks.js +7 -6
  14. package/dist/bin/cli.js +13 -13
  15. package/dist/bin/deferred-daemon-restart.js +1 -1
  16. package/dist/bin/exe-agent-config.js +1 -1
  17. package/dist/bin/exe-agent.js +4 -4
  18. package/dist/bin/exe-assign.js +6 -6
  19. package/dist/bin/exe-boot.js +14 -13
  20. package/dist/bin/exe-call.js +3 -3
  21. package/dist/bin/exe-cloud.js +3 -3
  22. package/dist/bin/exe-dispatch.js +7 -6
  23. package/dist/bin/exe-doctor.js +1 -1
  24. package/dist/bin/exe-export-behaviors.js +6 -6
  25. package/dist/bin/exe-forget.js +5 -5
  26. package/dist/bin/exe-gateway.js +5 -5
  27. package/dist/bin/exe-heartbeat.js +7 -6
  28. package/dist/bin/exe-kill.js +10 -9
  29. package/dist/bin/exe-launch-agent.js +9 -9
  30. package/dist/bin/exe-new-employee.js +5 -5
  31. package/dist/bin/exe-pending-messages.js +8 -7
  32. package/dist/bin/exe-pending-notifications.js +7 -6
  33. package/dist/bin/exe-pending-reviews.js +7 -6
  34. package/dist/bin/exe-rename.js +3 -3
  35. package/dist/bin/exe-review.js +9 -8
  36. package/dist/bin/exe-search.js +4 -4
  37. package/dist/bin/exe-session-cleanup.js +11 -10
  38. package/dist/bin/exe-settings.js +3 -3
  39. package/dist/bin/exe-start-codex.js +10 -10
  40. package/dist/bin/exe-start-opencode.js +7 -7
  41. package/dist/bin/exe-status.js +8 -7
  42. package/dist/bin/exe-team.js +2 -2
  43. package/dist/bin/git-sweep.js +7 -6
  44. package/dist/bin/graph-backfill.js +3 -3
  45. package/dist/bin/graph-export.js +4 -4
  46. package/dist/bin/import-history.js +4 -4
  47. package/dist/bin/install.js +6 -6
  48. package/dist/bin/intercom-check.js +4 -4
  49. package/dist/bin/orchestration-metrics.js +47 -0
  50. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  51. package/dist/bin/postgres-agentic-semantic-backfill.js +4 -4
  52. package/dist/bin/scan-tasks.js +7 -6
  53. package/dist/bin/setup.js +1 -1
  54. package/dist/bin/shard-migrate.js +3 -3
  55. package/dist/bin/stack-update.js +1 -1
  56. package/dist/bin/vps-health-gate.js +1 -1
  57. package/dist/{capacity-monitor-2TRPP3AX.js → capacity-monitor-HJSJ2PCF.js} +8 -7
  58. package/dist/{catchup-brief-74ORL525.js → catchup-brief-XD7IJBMN.js} +9 -8
  59. package/dist/{chunk-7WUBXLK2.js → chunk-2EYYW724.js} +2 -2
  60. package/dist/{chunk-TGOJR5SS.js → chunk-3HM6MZ4O.js} +36 -0
  61. package/dist/{chunk-JRLSQFIE.js → chunk-43HRNKQX.js} +68 -68
  62. package/dist/{chunk-4X7CMJDN.js → chunk-6UZHYTLV.js} +42 -7
  63. package/dist/{chunk-M7NGABPF.js → chunk-7BNZUXFJ.js} +1 -1
  64. package/dist/{chunk-5YVGHP2B.js → chunk-7Y4F7IPJ.js} +8 -8
  65. package/dist/{chunk-GIIRWR35.js → chunk-7YTVWNSS.js} +2 -2
  66. package/dist/{chunk-JW3MATT5.js → chunk-ATVB6CY7.js} +1 -1
  67. package/dist/{chunk-6BJ5GZD4.js → chunk-AVRQWLQR.js} +6 -6
  68. package/dist/{chunk-2DWKMJPE.js → chunk-AWYLVIGA.js} +2 -2
  69. package/dist/chunk-BDRSCPCG.js +221 -0
  70. package/dist/{chunk-WSYFZZCP.js → chunk-C5A3L3HS.js} +2 -2
  71. package/dist/{chunk-KTJ57PVS.js → chunk-CBAW3YFB.js} +1 -1
  72. package/dist/{chunk-L7ZYZCJ5.js → chunk-D42R5MZU.js} +1 -1
  73. package/dist/{chunk-65K2BQTG.js → chunk-E5P2TY4E.js} +1 -1
  74. package/dist/{chunk-K6K55GMZ.js → chunk-EEG6E34W.js} +1 -1
  75. package/dist/{chunk-JDHB6I4O.js → chunk-F3QROFHP.js} +2 -2
  76. package/dist/{chunk-5XAGTHF2.js → chunk-GKQXZZBT.js} +1 -1
  77. package/dist/{chunk-2HEXCZGP.js → chunk-GR53PEEH.js} +1 -1
  78. package/dist/{chunk-FDD7KX7Q.js → chunk-GSKJ72LT.js} +7 -7
  79. package/dist/{chunk-OO5EWGC6.js → chunk-HGO5VFED.js} +1 -1
  80. package/dist/{chunk-JSMOQRIV.js → chunk-HUIYZHN3.js} +1 -1
  81. package/dist/{chunk-V5U3FYDZ.js → chunk-HVUBZOOT.js} +2 -2
  82. package/dist/{chunk-JPZQM7VW.js → chunk-IOEK5ZX6.js} +1 -1
  83. package/dist/{chunk-JDGCEOT4.js → chunk-K3FJHQ3F.js} +2 -2
  84. package/dist/{chunk-QPSUK5HA.js → chunk-K6A7ZE2F.js} +1 -1
  85. package/dist/{chunk-BO3ZQIWF.js → chunk-KEJ3HOBN.js} +1 -1
  86. package/dist/{chunk-FBTIOBF6.js → chunk-KVVCXK3J.js} +3 -3
  87. package/dist/{chunk-ACOQS4ZL.js → chunk-LKBN6BFL.js} +2 -2
  88. package/dist/{chunk-RUKOGGQG.js → chunk-LLYF22CH.js} +2 -2
  89. package/dist/{chunk-YT67TJQZ.js → chunk-LPPCJZVI.js} +1 -1
  90. package/dist/{chunk-JQLWMZZJ.js → chunk-LWM3FUGY.js} +1 -1
  91. package/dist/{chunk-PHIQW2IU.js → chunk-LWYXWPZZ.js} +6 -6
  92. package/dist/{chunk-KRYEHI4V.js → chunk-NOSCV7MH.js} +3 -3
  93. package/dist/{chunk-OYU7TCBG.js → chunk-OOMA2AEM.js} +1 -1
  94. package/dist/{chunk-SKXHR35T.js → chunk-OW4QI3K4.js} +3 -3
  95. package/dist/{chunk-CGAYSKQF.js → chunk-P4LUVVX4.js} +5 -5
  96. package/dist/{chunk-FXVTLBBA.js → chunk-P6PKNRFD.js} +3 -3
  97. package/dist/{chunk-DNEOEKWA.js → chunk-PIJSZELU.js} +2 -2
  98. package/dist/{chunk-BDYUENC7.js → chunk-QOW5EEYO.js} +1 -1
  99. package/dist/{chunk-ZAF4GJTD.js → chunk-QQXMGLSN.js} +9 -9
  100. package/dist/{chunk-OF6TXNOC.js → chunk-SUNFUS3O.js} +1 -1
  101. package/dist/{chunk-ZLP5TNRU.js → chunk-TBZB4PPZ.js} +3 -3
  102. package/dist/{chunk-YZIUQ77U.js → chunk-TJHE2HYS.js} +3 -3
  103. package/dist/{chunk-ZHINF5CG.js → chunk-VQB4VBEQ.js} +1 -1
  104. package/dist/{chunk-IFFVONU6.js → chunk-WVNKXOWZ.js} +1 -1
  105. package/dist/{chunk-MABQMUCQ.js → chunk-WXQRFDY4.js} +230 -18
  106. package/dist/{chunk-CWY3M4SR.js → chunk-X2KLWLCB.js} +1 -1
  107. package/dist/{chunk-MWGAC2ER.js → chunk-X33TOTUD.js} +2 -2
  108. package/dist/{chunk-WATDOTGK.js → chunk-XZQWEY5S.js} +1 -1
  109. package/dist/{chunk-2GJWENBT.js → chunk-Y35YW6EL.js} +1 -1
  110. package/dist/{chunk-6FBYGI2H.js → chunk-YZNGBIXU.js} +1 -1
  111. package/dist/{chunk-UWMFQKOB.js → chunk-Z4FV45FW.js} +1 -1
  112. package/dist/{chunk-XNXTN5XZ.js → chunk-Z6AUK6YH.js} +1 -1
  113. package/dist/{chunk-OGQX7HLN.js → chunk-ZB3TDCXG.js} +1 -1
  114. package/dist/{chunk-WRCETUYE.js → chunk-ZZODXCWK.js} +1 -1
  115. package/dist/{co-occurrence-OVDIX3OS.js → co-occurrence-6OAMOUTF.js} +1 -1
  116. package/dist/{code-context-index-TBCTP47N.js → code-context-index-JPQDRTTX.js} +2 -2
  117. package/dist/{crdt-sync-L42FZQ7O.js → crdt-sync-6EI7LAPI.js} +1 -1
  118. package/dist/{crm-webhook-OFWPEK33.js → crm-webhook-LEWQNEDD.js} +2 -2
  119. package/dist/{cto-delegation-gate-7PGS5IN4.js → cto-delegation-gate-GXRHD4WX.js} +6 -5
  120. package/dist/{daemon-orchestration-MP3PPX7Q.js → daemon-orchestration-QOKZVECP.js} +9 -8
  121. package/dist/{exe-drift-BUFQKOM5.js → exe-drift-N2IDPAQ7.js} +2 -2
  122. package/dist/{exe-export-QMGWH3PL.js → exe-export-63FYZTV3.js} +4 -4
  123. package/dist/{exe-import-7NNKSCKI.js → exe-import-T5OPTK5T.js} +4 -4
  124. package/dist/{exe-key-QZ5GWV6D.js → exe-key-ROFJ6HUG.js} +1 -1
  125. package/dist/{fast-db-init-DAZZ7ZUP.js → fast-db-init-GC4SYSFV.js} +1 -1
  126. package/dist/gateway/index.js +9 -9
  127. package/dist/{git-staleness-JY7PJT6F.js → git-staleness-QKURDEMW.js} +1 -1
  128. package/dist/{git-task-sweep-SLANXCSW.js → git-task-sweep-5YHZF2E5.js} +7 -6
  129. package/dist/{global-procedures-GKQGLYXQ.js → global-procedures-PQKUKKM6.js} +2 -2
  130. package/dist/{graph-auto-extract-5OYWXUKD.js → graph-auto-extract-GUEMG3Q3.js} +1 -1
  131. package/dist/hooks/bug-report-worker.js +8 -7
  132. package/dist/hooks/codex-stop-task-finalizer.js +8 -7
  133. package/dist/hooks/commit-complete.js +9 -8
  134. package/dist/hooks/error-recall.js +5 -5
  135. package/dist/hooks/exe-heartbeat-hook.js +2 -2
  136. package/dist/hooks/ingest-worker.js +2 -2
  137. package/dist/hooks/ingest.js +5 -5
  138. package/dist/hooks/instructions-loaded.js +3 -3
  139. package/dist/hooks/manifest.json +20 -20
  140. package/dist/hooks/notification.js +3 -3
  141. package/dist/hooks/post-compact.js +8 -7
  142. package/dist/hooks/post-tool-combined.js +5 -5
  143. package/dist/hooks/pre-compact.js +11 -10
  144. package/dist/hooks/pre-tool-use.js +12 -11
  145. package/dist/hooks/prompt-submit.js +18 -17
  146. package/dist/hooks/session-end.js +14 -13
  147. package/dist/hooks/session-start.js +7 -7
  148. package/dist/hooks/stop.js +15 -14
  149. package/dist/hooks/subagent-stop.js +8 -7
  150. package/dist/hooks/summary-worker.js +14 -13
  151. package/dist/index.js +15 -14
  152. package/dist/{installer-CWKEI7SE.js → installer-AYN7WB62.js} +4 -4
  153. package/dist/{installer-DWVZFKAH.js → installer-D4XB27FY.js} +4 -4
  154. package/dist/{installer-GSA2KOSE.js → installer-Z4LBQTL6.js} +4 -4
  155. package/dist/lib/cloud-sync.js +3 -3
  156. package/dist/lib/consolidation.js +4 -4
  157. package/dist/lib/database.js +1 -1
  158. package/dist/lib/db-daemon-client.js +1 -1
  159. package/dist/lib/db.js +1 -1
  160. package/dist/lib/embedder.js +2 -2
  161. package/dist/lib/employee-templates.js +3 -3
  162. package/dist/lib/employees.js +1 -1
  163. package/dist/lib/exe-daemon-client.js +1 -1
  164. package/dist/lib/exe-daemon.js +47 -23
  165. package/dist/lib/hybrid-search.js +4 -4
  166. package/dist/lib/identity.js +1 -1
  167. package/dist/lib/messaging.js +7 -6
  168. package/dist/lib/reminders.js +2 -2
  169. package/dist/lib/schedules.js +4 -4
  170. package/dist/lib/skill-learning.js +3 -3
  171. package/dist/lib/store.js +3 -3
  172. package/dist/lib/task-router.js +2 -2
  173. package/dist/lib/tasks.js +7 -6
  174. package/dist/lib/tmux-routing.js +6 -5
  175. package/dist/lib/token-spend.js +2 -2
  176. package/dist/mcp/register-tools.js +49 -48
  177. package/dist/mcp/server.js +50 -49
  178. package/dist/mcp/tools/complete-reminder.js +3 -3
  179. package/dist/mcp/tools/create-reminder.js +3 -3
  180. package/dist/mcp/tools/create-task.js +9 -8
  181. package/dist/mcp/tools/deactivate-behavior.js +4 -4
  182. package/dist/mcp/tools/list-reminders.js +3 -3
  183. package/dist/mcp/tools/list-tasks.js +9 -8
  184. package/dist/mcp/tools/send-message.js +9 -8
  185. package/dist/mcp/tools/update-task.js +8 -7
  186. package/dist/{mcp-http-config-YOB4QWYP.js → mcp-http-config-JFGNXQ5M.js} +2 -2
  187. package/dist/{memory-cards-UPFWA3YQ.js → memory-cards-QHCHERFV.js} +1 -1
  188. package/dist/{memory-graph-extractor-XTH3U6QS.js → memory-graph-extractor-RAF4M3YY.js} +2 -2
  189. package/dist/{memory-poisoning-defense-WDSEUEBW.js → memory-poisoning-defense-M4E6D6NI.js} +1 -1
  190. package/dist/{memory-queue-client-FJOLJYUK.js → memory-queue-client-XCBQIT3T.js} +2 -2
  191. package/dist/{memory-reflection-A2PLKX7A.js → memory-reflection-OVQDAOKW.js} +1 -1
  192. package/dist/{notifications-WYNI5OG6.js → notifications-QCZJTMU4.js} +6 -5
  193. package/dist/{orchestrator-FRFCMLW3.js → orchestrator-RETZBZNU.js} +8 -7
  194. package/dist/{plan-limits-FKTRN25T.js → plan-limits-KY5FB6FM.js} +2 -2
  195. package/dist/{projection-worker-R2JOVCXX.js → projection-worker-B4FYF4FS.js} +1 -1
  196. package/dist/{reranker-2ZWUZRUF.js → reranker-DLESU7S4.js} +1 -1
  197. package/dist/{review-polling-ADP5YFHW.js → review-polling-S4HD536T.js} +7 -6
  198. package/dist/runtime/index.js +13 -12
  199. package/dist/{session-events-JA3MCMZK.js → session-events-TRCSYKGW.js} +7 -6
  200. package/dist/{session-kill-telemetry-GV7LE56P.js → session-kill-telemetry-WBB7YHWC.js} +2 -2
  201. package/dist/{session-scope-LXQKQDIS.js → session-scope-H6H7EVMH.js} +6 -5
  202. package/dist/{setup-wizard-GRR4F4TX.js → setup-wizard-QGJEHEJP.js} +1 -1
  203. package/dist/{skill-refinement-3UVLBCZD.js → skill-refinement-DDFALKOD.js} +1 -1
  204. package/dist/{stack-update-C4BAPLXJ.js → stack-update-Q2WQOJTS.js} +1 -1
  205. package/dist/{task-enforcement-KSLBFILH.js → task-enforcement-7NCE6NJC.js} +25 -5
  206. package/dist/{task-scope-AI62AIPT.js → task-scope-C7QECQSB.js} +6 -5
  207. package/dist/{tasks-crud-IEOK55IV.js → tasks-crud-4VGXAUW5.js} +6 -5
  208. package/dist/{tasks-review-ID7V6RSR.js → tasks-review-ATHR7IZK.js} +6 -5
  209. package/dist/{token-budget-Z4ONSQLC.js → token-budget-2ZZRFSHF.js} +1 -1
  210. package/dist/{tool-capability-index-2MHWYQH5.js → tool-capability-index-6ICPKH5O.js} +1 -1
  211. package/dist/{tool-telemetry-Z46QEUD5.js → tool-telemetry-EWE2YR2K.js} +1 -1
  212. package/dist/tui/App.js +14 -13
  213. package/dist/{tui-data-HIFVW2PE.js → tui-data-LQQ66HCW.js} +6 -5
  214. package/dist/{worker-gate-F3L7XDMJ.js → worker-gate-POIBNVX7.js} +1 -1
  215. package/dist/{workflow-engine-H5KTDDJG.js → workflow-engine-MA2H5JEZ.js} +2 -2
  216. package/package.json +2 -1
  217. package/release-notes.json +101 -104
  218. /package/dist/{chunk-MQLMIY6U.js → chunk-2GHDAIDB.js} +0 -0
  219. /package/dist/{chunk-NF4AEKQK.js → chunk-35ES3HTI.js} +0 -0
  220. /package/dist/{chunk-MNNWWEVJ.js → chunk-6YFGFW4V.js} +0 -0
  221. /package/dist/{chunk-KBZM7HRB.js → chunk-GOA7VQT7.js} +0 -0
  222. /package/dist/{chunk-54MZI4PK.js → chunk-I3B4QG5C.js} +0 -0
  223. /package/dist/{chunk-AFJWUI3Y.js → chunk-JMMYWY7C.js} +0 -0
  224. /package/dist/{chunk-G5GFP5J6.js → chunk-LZPZ67IT.js} +0 -0
  225. /package/dist/{chunk-OO5CPMT3.js → chunk-SY4TZ224.js} +0 -0
  226. /package/dist/{chunk-GHCVD7WV.js → chunk-XJTHRKML.js} +0 -0
  227. /package/dist/{core-memory-VQKCHGFX.js → core-memory-4QNM6MZ5.js} +0 -0
  228. /package/dist/{entity-boost-WEQDV6P6.js → entity-boost-QXR3LCYV.js} +0 -0
  229. /package/dist/{message-queue-client-BR7DXK7J.js → message-queue-client-CUCAQME6.js} +0 -0
  230. /package/dist/{wiki-acl-DDF2QQOD.js → wiki-acl-UTITDXLT.js} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  listWorkflowDefinitions,
3
3
  runWorkflow,
4
4
  startWorkflow
5
- } from "./chunk-OF6TXNOC.js";
5
+ } from "./chunk-SUNFUS3O.js";
6
6
  import {
7
7
  initCRMBridge
8
8
  } from "./chunk-ONKIWA3R.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-MP2AFCGL.js";
12
12
  import {
13
13
  getClient
14
- } from "./chunk-TGOJR5SS.js";
14
+ } from "./chunk-3HM6MZ4O.js";
15
15
 
16
16
  // src/gateway/router.ts
17
17
  function matchesPlatform(msgPlatform, matchPlatform) {
@@ -0,0 +1,221 @@
1
+ import {
2
+ getClient
3
+ } from "./chunk-3HM6MZ4O.js";
4
+
5
+ // src/lib/orchestration-events.ts
6
+ import crypto from "crypto";
7
+ var SENSITIVE_PAYLOAD_KEY = /(context|prompt|secret|token|password|passphrase|recovery|raw|key)/i;
8
+ async function ensureOrchestrationEventsSchema(client = getClient()) {
9
+ await client.execute({
10
+ sql: `CREATE TABLE IF NOT EXISTS orchestration_events (
11
+ id TEXT PRIMARY KEY,
12
+ ts TEXT NOT NULL,
13
+ event_type TEXT NOT NULL,
14
+ source TEXT NOT NULL,
15
+ severity TEXT NOT NULL DEFAULT 'info',
16
+ task_id TEXT,
17
+ agent_id TEXT,
18
+ reviewer TEXT,
19
+ session_scope TEXT,
20
+ project_name TEXT,
21
+ instance_id TEXT,
22
+ tmux_session TEXT,
23
+ runtime TEXT,
24
+ correlation_id TEXT,
25
+ attempt INTEGER,
26
+ duration_ms INTEGER,
27
+ result TEXT,
28
+ error_code TEXT,
29
+ payload_json TEXT,
30
+ created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
31
+ )`,
32
+ args: []
33
+ });
34
+ await client.execute({ sql: "CREATE INDEX IF NOT EXISTS idx_orch_events_ts ON orchestration_events(ts)", args: [] });
35
+ await client.execute({ sql: "CREATE INDEX IF NOT EXISTS idx_orch_events_task ON orchestration_events(task_id, ts)", args: [] });
36
+ await client.execute({ sql: "CREATE INDEX IF NOT EXISTS idx_orch_events_agent ON orchestration_events(agent_id, session_scope, ts)", args: [] });
37
+ await client.execute({ sql: "CREATE INDEX IF NOT EXISTS idx_orch_events_type ON orchestration_events(event_type, ts)", args: [] });
38
+ }
39
+ async function recordOrchestrationEvent(input) {
40
+ try {
41
+ const client = getClient();
42
+ await ensureOrchestrationEventsSchema(client);
43
+ const payloadJson = sanitizePayload(input.payload);
44
+ await client.execute({
45
+ sql: `INSERT INTO orchestration_events (
46
+ id, ts, event_type, source, severity,
47
+ task_id, agent_id, reviewer, session_scope, project_name,
48
+ instance_id, tmux_session, runtime, correlation_id, attempt,
49
+ duration_ms, result, error_code, payload_json
50
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
51
+ args: [
52
+ crypto.randomUUID(),
53
+ input.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
54
+ input.eventType,
55
+ input.source,
56
+ input.severity ?? "info",
57
+ input.taskId ?? null,
58
+ input.agentId ?? null,
59
+ input.reviewer ?? null,
60
+ input.sessionScope ?? null,
61
+ input.projectName ?? null,
62
+ input.instanceId ?? null,
63
+ input.tmuxSession ?? null,
64
+ input.runtime ?? null,
65
+ input.correlationId ?? null,
66
+ input.attempt ?? null,
67
+ input.durationMs ?? null,
68
+ input.result ?? null,
69
+ input.errorCode ?? null,
70
+ payloadJson
71
+ ]
72
+ });
73
+ return true;
74
+ } catch (err) {
75
+ if (process.env.EXE_DEBUG === "1") {
76
+ process.stderr.write(
77
+ `[orchestration-events] write skipped: ${err instanceof Error ? err.message : String(err)}
78
+ `
79
+ );
80
+ }
81
+ return false;
82
+ }
83
+ }
84
+ function recordOrchestrationEventBestEffort(input) {
85
+ void recordOrchestrationEvent(input);
86
+ }
87
+ async function getOrchestrationMetrics(input = {}) {
88
+ const client = getClient();
89
+ await ensureOrchestrationEventsSchema(client);
90
+ const sinceIso = input.sinceIso ?? null;
91
+ const result = sinceIso ? await client.execute({
92
+ sql: `SELECT event_type, ts, task_id, duration_ms
93
+ FROM orchestration_events
94
+ WHERE ts >= ?
95
+ ORDER BY ts ASC`,
96
+ args: [sinceIso]
97
+ }) : await client.execute({
98
+ sql: `SELECT event_type, ts, task_id, duration_ms
99
+ FROM orchestration_events
100
+ ORDER BY ts ASC`,
101
+ args: []
102
+ });
103
+ const rows = result.rows;
104
+ const taskEvents = /* @__PURE__ */ new Map();
105
+ const daemonTickDurations = [];
106
+ const counts = {
107
+ duplicateNudges: 0,
108
+ missedReviews: 0,
109
+ tmuxCommandTimeouts: 0,
110
+ claimCollisions: 0,
111
+ crossSessionBlocks: 0,
112
+ dispatchUnclaimed: 0
113
+ };
114
+ for (const row of rows) {
115
+ const type = String(row.event_type ?? "");
116
+ const taskId = row.task_id == null ? "" : String(row.task_id);
117
+ const ts = Date.parse(String(row.ts ?? ""));
118
+ if (type === "nudge.duplicate") counts.duplicateNudges++;
119
+ if (type === "review.missed") counts.missedReviews++;
120
+ if (type === "tmux.command.timeout") counts.tmuxCommandTimeouts++;
121
+ if (type === "claim.collision") counts.claimCollisions++;
122
+ if (type === "session.scope_violation") counts.crossSessionBlocks++;
123
+ if (type === "dispatch.unclaimed") counts.dispatchUnclaimed++;
124
+ if (type === "daemon.tick.completed") {
125
+ const duration = Number(row.duration_ms ?? NaN);
126
+ if (Number.isFinite(duration)) daemonTickDurations.push(duration);
127
+ }
128
+ if (!taskId || !Number.isFinite(ts)) continue;
129
+ const bucket = taskEvents.get(taskId) ?? {};
130
+ if (type === "task.created" && bucket.created === void 0) bucket.created = ts;
131
+ if (type === "task.claimed" && bucket.claimed === void 0) bucket.claimed = ts;
132
+ if (type === "task.done" && bucket.done === void 0) bucket.done = ts;
133
+ if (type === "review.ready" && bucket.reviewReady === void 0) bucket.reviewReady = ts;
134
+ taskEvents.set(taskId, bucket);
135
+ }
136
+ const createToClaim = [];
137
+ const doneToReview = [];
138
+ for (const eventSet of taskEvents.values()) {
139
+ if (eventSet.created !== void 0 && eventSet.claimed !== void 0 && eventSet.claimed >= eventSet.created) {
140
+ createToClaim.push(eventSet.claimed - eventSet.created);
141
+ }
142
+ if (eventSet.done !== void 0 && eventSet.reviewReady !== void 0 && eventSet.reviewReady >= eventSet.done) {
143
+ doneToReview.push(eventSet.reviewReady - eventSet.done);
144
+ }
145
+ }
146
+ return {
147
+ sinceIso,
148
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
149
+ totalEvents: rows.length,
150
+ counts,
151
+ createToClaimMs: percentileMetric(createToClaim),
152
+ doneToReviewMs: percentileMetric(doneToReview),
153
+ daemonTickMs: percentileMetric(daemonTickDurations)
154
+ };
155
+ }
156
+ function formatOrchestrationMetrics(metrics) {
157
+ const lines = [
158
+ "# Orchestration Metrics",
159
+ "",
160
+ `Generated: ${metrics.generatedAt}`,
161
+ `Since: ${metrics.sinceIso ?? "beginning"}`,
162
+ `Total events: ${metrics.totalEvents}`,
163
+ "",
164
+ "## Latency",
165
+ `- create\u2192claim: ${formatMetric(metrics.createToClaimMs)}`,
166
+ `- done\u2192review.ready: ${formatMetric(metrics.doneToReviewMs)}`,
167
+ `- daemon tick: ${formatMetric(metrics.daemonTickMs)}`,
168
+ "",
169
+ "## Counts",
170
+ `- duplicate nudges: ${metrics.counts.duplicateNudges}`,
171
+ `- missed reviews: ${metrics.counts.missedReviews}`,
172
+ `- tmux command timeouts: ${metrics.counts.tmuxCommandTimeouts}`,
173
+ `- claim collisions: ${metrics.counts.claimCollisions}`,
174
+ `- cross-session blocks: ${metrics.counts.crossSessionBlocks}`,
175
+ `- dispatch unclaimed: ${metrics.counts.dispatchUnclaimed}`
176
+ ];
177
+ return lines.join("\n");
178
+ }
179
+ function sanitizePayload(payload) {
180
+ if (!payload) return null;
181
+ const safe = {};
182
+ for (const [key, value] of Object.entries(payload)) {
183
+ if (SENSITIVE_PAYLOAD_KEY.test(key)) continue;
184
+ if (value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
185
+ safe[key] = value;
186
+ } else if (Array.isArray(value)) {
187
+ safe[key] = value.filter((item) => ["string", "number", "boolean"].includes(typeof item)).slice(0, 20);
188
+ }
189
+ }
190
+ return Object.keys(safe).length > 0 ? JSON.stringify(safe) : null;
191
+ }
192
+ function percentileMetric(values) {
193
+ if (values.length === 0) return { count: 0, p50: null, p95: null, p99: null };
194
+ const sorted = [...values].sort((a, b) => a - b);
195
+ return {
196
+ count: sorted.length,
197
+ p50: percentile(sorted, 50),
198
+ p95: percentile(sorted, 95),
199
+ p99: percentile(sorted, 99)
200
+ };
201
+ }
202
+ function percentile(sorted, percentileValue) {
203
+ if (sorted.length === 0) return 0;
204
+ const rank = Math.ceil(percentileValue / 100 * sorted.length) - 1;
205
+ return sorted[Math.min(sorted.length - 1, Math.max(0, rank))] ?? 0;
206
+ }
207
+ function formatMetric(metric) {
208
+ if (metric.count === 0) return "n=0";
209
+ return `n=${metric.count}, p50=${formatMs(metric.p50)}, p95=${formatMs(metric.p95)}, p99=${formatMs(metric.p99)}`;
210
+ }
211
+ function formatMs(value) {
212
+ if (value == null) return "n/a";
213
+ if (value < 1e3) return `${value}ms`;
214
+ return `${Math.round(value / 1e3 * 10) / 10}s`;
215
+ }
216
+
217
+ export {
218
+ recordOrchestrationEventBestEffort,
219
+ getOrchestrationMetrics,
220
+ formatOrchestrationMetrics
221
+ };
@@ -849,7 +849,7 @@ function formatReport(report, flags) {
849
849
  return lines.join("\n");
850
850
  }
851
851
  async function fixNullVectors() {
852
- const { tryAcquireWorkerSlot, registerWorkerPid } = await import("./worker-gate-F3L7XDMJ.js");
852
+ const { tryAcquireWorkerSlot, registerWorkerPid } = await import("./worker-gate-POIBNVX7.js");
853
853
  if (!tryAcquireWorkerSlot()) {
854
854
  process.stderr.write("[exe-doctor] Worker gate full \u2014 waiting for existing backfill workers to finish\n");
855
855
  await new Promise((r) => setTimeout(r, 5e3));
@@ -970,7 +970,7 @@ function splitAtSentences(text, maxChunkSize) {
970
970
  }
971
971
  async function main(argv = process.argv.slice(2)) {
972
972
  const flags = parseFlags(argv);
973
- const { fastDbInit } = await import("./fast-db-init-DAZZ7ZUP.js");
973
+ const { fastDbInit } = await import("./fast-db-init-GC4SYSFV.js");
974
974
  const client = await fastDbInit();
975
975
  const report = await runAudit(client, flags);
976
976
  console.log(formatReport(report, flags));
@@ -2,7 +2,7 @@ import {
2
2
  connectEmbedDaemon,
3
3
  disconnectClient,
4
4
  embedViaClient
5
- } from "./chunk-2GJWENBT.js";
5
+ } from "./chunk-Y35YW6EL.js";
6
6
  import {
7
7
  EMBEDDING_DIM
8
8
  } from "./chunk-FXU7JOXK.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  isClientConnected,
6
6
  sendDaemonRequest
7
- } from "./chunk-2GJWENBT.js";
7
+ } from "./chunk-Y35YW6EL.js";
8
8
 
9
9
  // src/lib/memory-queue-client.ts
10
10
  async function writeMemoryViaDaemon(entry) {
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-2ZYEO7U7.js";
5
5
  import {
6
6
  getClient
7
- } from "./chunk-TGOJR5SS.js";
7
+ } from "./chunk-3HM6MZ4O.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
  listReminders
3
- } from "./chunk-UWMFQKOB.js";
3
+ } from "./chunk-Z4FV45FW.js";
4
4
 
5
5
  // src/mcp/tools/list-reminders.ts
6
6
  import { z } from "zod";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  vectorToBlob
3
- } from "./chunk-4X7CMJDN.js";
3
+ } from "./chunk-6UZHYTLV.js";
4
4
  import {
5
5
  extractKeywords,
6
6
  keywordsToString
7
7
  } from "./chunk-CHCA3ZM2.js";
8
8
  import {
9
9
  isCoordinatorName
10
- } from "./chunk-TGOJR5SS.js";
10
+ } from "./chunk-3HM6MZ4O.js";
11
11
 
12
12
  // src/lib/consolidation.ts
13
13
  import { randomUUID } from "crypto";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  completeReminder
3
- } from "./chunk-UWMFQKOB.js";
3
+ } from "./chunk-Z4FV45FW.js";
4
4
 
5
5
  // src/mcp/tools/complete-reminder.ts
6
6
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getGlobalProceduresBlock
3
- } from "./chunk-65K2BQTG.js";
3
+ } from "./chunk-E5P2TY4E.js";
4
4
 
5
5
  // src/lib/employee-templates.ts
6
6
  var BASE_OPERATING_PROCEDURES = `
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  recordSessionKill
3
- } from "./chunk-WRCETUYE.js";
3
+ } from "./chunk-ZZODXCWK.js";
4
4
  import {
5
5
  updateTask
6
- } from "./chunk-6BJ5GZD4.js";
6
+ } from "./chunk-AVRQWLQR.js";
7
7
  import {
8
8
  ensureEmployee,
9
9
  extractRootExe,
@@ -14,20 +14,20 @@ import {
14
14
  sessionScopeFilter,
15
15
  strictSessionScopeFilter,
16
16
  writeNotification
17
- } from "./chunk-MABQMUCQ.js";
17
+ } from "./chunk-WXQRFDY4.js";
18
18
  import {
19
19
  queueIntercom
20
20
  } from "./chunk-QI4IXJN7.js";
21
21
  import {
22
22
  listSessions
23
23
  } from "./chunk-64WZEXXA.js";
24
+ import {
25
+ getTransport
26
+ } from "./chunk-TXWQPL2U.js";
24
27
  import {
25
28
  listTmuxSessions,
26
29
  parseContextPercentage
27
30
  } from "./chunk-GZIAQYGI.js";
28
- import {
29
- getTransport
30
- } from "./chunk-TXWQPL2U.js";
31
31
  import {
32
32
  getAgentRuntime
33
33
  } from "./chunk-H2CFBUGF.js";
@@ -35,7 +35,7 @@ import {
35
35
  baseAgentName,
36
36
  isCoordinatorName,
37
37
  shouldAutoInstance
38
- } from "./chunk-TGOJR5SS.js";
38
+ } from "./chunk-3HM6MZ4O.js";
39
39
  import {
40
40
  loadConfigSync
41
41
  } from "./chunk-4GXRETYL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getClient
3
- } from "./chunk-TGOJR5SS.js";
3
+ } from "./chunk-3HM6MZ4O.js";
4
4
 
5
5
  // src/lib/token-spend.ts
6
6
  import { readdir } from "fs/promises";
@@ -6,7 +6,7 @@ import {
6
6
  getIdentity,
7
7
  listIdentities,
8
8
  updateIdentity
9
- } from "./chunk-TGOJR5SS.js";
9
+ } from "./chunk-3HM6MZ4O.js";
10
10
  import {
11
11
  atomicWriteJsonSync
12
12
  } from "./chunk-LYH5HE24.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  storeBehavior
3
- } from "./chunk-OGQX7HLN.js";
3
+ } from "./chunk-ZB3TDCXG.js";
4
4
  import {
5
5
  getClient
6
- } from "./chunk-TGOJR5SS.js";
6
+ } from "./chunk-3HM6MZ4O.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-4GXRETYL.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getIdentity,
3
3
  loadEmployeesSync
4
- } from "./chunk-TGOJR5SS.js";
4
+ } from "./chunk-3HM6MZ4O.js";
5
5
 
6
6
  // src/lib/drift-probes.ts
7
7
  var DRIFT_THRESHOLD = 80;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getActiveAgent
3
- } from "./chunk-BDYUENC7.js";
3
+ } from "./chunk-QOW5EEYO.js";
4
4
  import {
5
5
  listTasks
6
- } from "./chunk-MABQMUCQ.js";
6
+ } from "./chunk-WXQRFDY4.js";
7
7
 
8
8
  // src/mcp/tools/list-tasks.ts
9
9
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadEmployeesSync
3
- } from "./chunk-TGOJR5SS.js";
3
+ } from "./chunk-3HM6MZ4O.js";
4
4
 
5
5
  // src/adapters/mcp-http-config.ts
6
6
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listBehaviors
3
- } from "./chunk-OGQX7HLN.js";
3
+ } from "./chunk-ZB3TDCXG.js";
4
4
  import {
5
5
  loadConfigSync
6
6
  } from "./chunk-4GXRETYL.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  deactivateBehavior
3
- } from "./chunk-OGQX7HLN.js";
3
+ } from "./chunk-ZB3TDCXG.js";
4
4
  import {
5
5
  getActiveAgent
6
- } from "./chunk-BDYUENC7.js";
6
+ } from "./chunk-QOW5EEYO.js";
7
7
  import {
8
8
  canCoordinate,
9
9
  getClient
10
- } from "./chunk-TGOJR5SS.js";
10
+ } from "./chunk-3HM6MZ4O.js";
11
11
 
12
12
  // src/mcp/tools/deactivate-behavior.ts
13
13
  import { z } from "zod";
@@ -4,10 +4,10 @@ import {
4
4
  resolveExeSession,
5
5
  sendIntercom,
6
6
  strictSessionScopeFilter
7
- } from "./chunk-MABQMUCQ.js";
7
+ } from "./chunk-WXQRFDY4.js";
8
8
  import {
9
9
  getClient
10
- } from "./chunk-TGOJR5SS.js";
10
+ } from "./chunk-3HM6MZ4O.js";
11
11
 
12
12
  // src/lib/messaging.ts
13
13
  import crypto from "crypto";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  initStore
3
- } from "./chunk-4X7CMJDN.js";
3
+ } from "./chunk-6UZHYTLV.js";
4
4
  import {
5
5
  getClient,
6
6
  isInitialized
7
- } from "./chunk-TGOJR5SS.js";
7
+ } from "./chunk-3HM6MZ4O.js";
8
8
 
9
9
  // src/lib/schedules.ts
10
10
  import crypto from "crypto";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  connectEmbedDaemon,
9
9
  embedBatchViaClient
10
- } from "./chunk-2GJWENBT.js";
10
+ } from "./chunk-Y35YW6EL.js";
11
11
  import {
12
12
  EXE_AI_DIR
13
13
  } from "./chunk-4GXRETYL.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCurrentSessionScope,
3
3
  strictSessionScopeFilter
4
- } from "./chunk-MABQMUCQ.js";
4
+ } from "./chunk-WXQRFDY4.js";
5
5
  import {
6
6
  getProjectName
7
7
  } from "./chunk-OPU3NYOO.js";
@@ -3,24 +3,24 @@ import {
3
3
  } from "./chunk-MLXJ5EZG.js";
4
4
  import {
5
5
  createTask
6
- } from "./chunk-6BJ5GZD4.js";
6
+ } from "./chunk-AVRQWLQR.js";
7
7
  import {
8
8
  getActiveAgent
9
- } from "./chunk-BDYUENC7.js";
9
+ } from "./chunk-QOW5EEYO.js";
10
10
  import {
11
11
  ensureEmployee,
12
12
  logTaskDispatch,
13
13
  resolveExeSession
14
- } from "./chunk-MABQMUCQ.js";
14
+ } from "./chunk-WXQRFDY4.js";
15
15
  import {
16
16
  getLicenseSync
17
- } from "./chunk-ZHINF5CG.js";
17
+ } from "./chunk-VQB4VBEQ.js";
18
18
  import {
19
19
  getAgentContext
20
20
  } from "./chunk-GJV3WDWM.js";
21
21
  import {
22
22
  isCoordinatorName
23
- } from "./chunk-TGOJR5SS.js";
23
+ } from "./chunk-3HM6MZ4O.js";
24
24
 
25
25
  // src/mcp/tools/create-task.ts
26
26
  import { z } from "zod";
@@ -208,7 +208,7 @@ function registerCreateTask(server) {
208
208
  let projectConflictOpts = {};
209
209
  try {
210
210
  const { getClient } = await import("./lib/database.js");
211
- const { sessionScopeFilter } = await import("./task-scope-AI62AIPT.js");
211
+ const { sessionScopeFilter } = await import("./task-scope-C7QECQSB.js");
212
212
  const client = getClient();
213
213
  const scope = sessionScopeFilter();
214
214
  const existing = await client.execute({
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  fastDbInit
3
- } from "./chunk-NF4AEKQK.js";
3
+ } from "./chunk-35ES3HTI.js";
4
4
  import {
5
5
  sessionScopeFilter
6
- } from "./chunk-MABQMUCQ.js";
6
+ } from "./chunk-WXQRFDY4.js";
7
7
  import {
8
8
  formatStatusAll,
9
9
  formatStatusDeep,
@@ -14,7 +14,7 @@ import {
14
14
  getClient,
15
15
  isCoordinatorRole,
16
16
  loadEmployees
17
- } from "./chunk-TGOJR5SS.js";
17
+ } from "./chunk-3HM6MZ4O.js";
18
18
  import {
19
19
  isMainModule
20
20
  } from "./chunk-6Y4B3QF6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  processCRMEvent
3
- } from "./chunk-54MZI4PK.js";
3
+ } from "./chunk-I3B4QG5C.js";
4
4
 
5
5
  // src/gateway/adapters/crm-webhook.ts
6
6
  function parseTwentyWebhook(payload) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isCrdtSyncEnabled
3
- } from "./chunk-KBZM7HRB.js";
3
+ } from "./chunk-GOA7VQT7.js";
4
4
  import {
5
5
  decryptSyncBlob,
6
6
  encryptSyncBlob,
@@ -12,7 +12,7 @@ import {
12
12
  loadEmployees,
13
13
  registerBinSymlinks,
14
14
  saveEmployees
15
- } from "./chunk-TGOJR5SS.js";
15
+ } from "./chunk-3HM6MZ4O.js";
16
16
  import {
17
17
  loadDeviceId
18
18
  } from "./chunk-MVMMULOJ.js";
@@ -489,7 +489,7 @@ async function cloudSync(config) {
489
489
  let pulled = 0;
490
490
  if (pullResult.records.length > 0) {
491
491
  if (isCrdtSyncEnabled()) {
492
- const { initCrdtDoc, importExistingMemories, readAllMemories } = await import("./crdt-sync-L42FZQ7O.js");
492
+ const { initCrdtDoc, importExistingMemories, readAllMemories } = await import("./crdt-sync-6EI7LAPI.js");
493
493
  initCrdtDoc();
494
494
  importExistingMemories(
495
495
  pullResult.records.map((rec) => ({
@@ -1,3 +1,7 @@
1
+ import {
2
+ createCRMWebhookHandler,
3
+ parseTwentyWebhook
4
+ } from "./chunk-OOMA2AEM.js";
1
5
  import {
2
6
  WhatsAppAdapter
3
7
  } from "./chunk-ECSNSHZ7.js";
@@ -16,10 +20,6 @@ import {
16
20
  import {
17
21
  IMessageAdapter
18
22
  } from "./chunk-FLSASUV3.js";
19
- import {
20
- createCRMWebhookHandler,
21
- parseTwentyWebhook
22
- } from "./chunk-OYU7TCBG.js";
23
23
  import {
24
24
  BotRegistry,
25
25
  BotRuntime,
@@ -42,7 +42,7 @@ import {
42
42
  retryWithBackoff,
43
43
  routeMessage,
44
44
  validateGatewayConfig
45
- } from "./chunk-2DWKMJPE.js";
45
+ } from "./chunk-AWYLVIGA.js";
46
46
  import {
47
47
  OllamaProvider
48
48
  } from "./chunk-FWFFZGSC.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  routeTask
3
- } from "./chunk-CWY3M4SR.js";
3
+ } from "./chunk-X2KLWLCB.js";
4
4
  import {
5
5
  createTaskCore,
6
6
  employeeSessionName,
@@ -9,11 +9,11 @@ import {
9
9
  isEmployeeAlive,
10
10
  sessionScopeFilter,
11
11
  updateTaskStatus
12
- } from "./chunk-MABQMUCQ.js";
12
+ } from "./chunk-WXQRFDY4.js";
13
13
  import {
14
14
  DEFAULT_COORDINATOR_TEMPLATE_NAME,
15
15
  getCoordinatorName
16
- } from "./chunk-TGOJR5SS.js";
16
+ } from "./chunk-3HM6MZ4O.js";
17
17
 
18
18
  // src/runtime/orchestrator.ts
19
19
  var STALE_THRESHOLD_MS = 2 * 60 * 60 * 1e3;