@askexenow/exe-os 0.9.299 → 0.9.300

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 (360) hide show
  1. package/deploy/compose/.env.customer.example +1 -1
  2. package/deploy/compose/.env.example +1 -1
  3. package/deploy/compose/docker-compose.yml +31 -5
  4. package/deploy/compose/generate-env.ts +1 -1
  5. package/deploy/compose/observability/otel-collector-config.yaml +10 -1
  6. package/deploy/compose/setup.sh +1 -1
  7. package/dist/active-agent-56J56WW5.js +27 -0
  8. package/dist/active-agent-VDWK7TES.js +28 -0
  9. package/dist/agentic-ontology-MZ4WHFDE.js +25 -0
  10. package/dist/assets/com.askexe.exed.plist +6 -5
  11. package/dist/backfill-metadata-IHKI5GXV.js +600 -0
  12. package/dist/backfill-metadata-ZU3SZNBD.js +600 -0
  13. package/dist/behaviors-G4KWGS24.js +46 -0
  14. package/dist/behaviors-WO67R6C4.js +46 -0
  15. package/dist/bin/agentic-ontology-backfill.js +5 -5
  16. package/dist/bin/agentic-reflection-backfill.js +6 -6
  17. package/dist/bin/agentic-semantic-label.js +5 -5
  18. package/dist/bin/backfill-conversations.js +6 -6
  19. package/dist/bin/backfill-responses.js +6 -6
  20. package/dist/bin/backfill-vectors.js +8 -8
  21. package/dist/bin/bulk-sync-postgres.js +13 -7
  22. package/dist/bin/cc-doctor.js +5 -5
  23. package/dist/bin/cleanup-stale-review-tasks.js +10 -10
  24. package/dist/bin/cli.js +16 -16
  25. package/dist/bin/deferred-daemon-restart.js +1 -1
  26. package/dist/bin/exe-agent-config.js +2 -2
  27. package/dist/bin/exe-agent.js +10 -10
  28. package/dist/bin/exe-assign.js +8 -8
  29. package/dist/bin/exe-boot.js +30 -20
  30. package/dist/bin/exe-call.js +4 -4
  31. package/dist/bin/exe-cloud.js +13 -7
  32. package/dist/bin/exe-dispatch.js +10 -10
  33. package/dist/bin/exe-doctor.js +2 -2
  34. package/dist/bin/exe-export-behaviors.js +7 -7
  35. package/dist/bin/exe-forget.js +6 -6
  36. package/dist/bin/exe-gateway.js +7 -7
  37. package/dist/bin/exe-healthcheck.js +5 -5
  38. package/dist/bin/exe-heartbeat.js +10 -10
  39. package/dist/bin/exe-kill.js +13 -13
  40. package/dist/bin/exe-launch-agent.js +29 -19
  41. package/dist/bin/exe-new-employee.js +6 -6
  42. package/dist/bin/exe-pending-messages.js +11 -11
  43. package/dist/bin/exe-pending-notifications.js +10 -10
  44. package/dist/bin/exe-pending-reviews.js +10 -10
  45. package/dist/bin/exe-rename.js +4 -4
  46. package/dist/bin/exe-review.js +12 -12
  47. package/dist/bin/exe-search.js +5 -5
  48. package/dist/bin/exe-session-cleanup.js +15 -15
  49. package/dist/bin/exe-settings.js +13 -7
  50. package/dist/bin/exe-start-codex.js +11 -11
  51. package/dist/bin/exe-start-opencode.js +8 -8
  52. package/dist/bin/exe-status.js +11 -11
  53. package/dist/bin/exe-team.js +3 -3
  54. package/dist/bin/git-sweep.js +11 -11
  55. package/dist/bin/graph-backfill.js +6 -6
  56. package/dist/bin/graph-export.js +5 -5
  57. package/dist/bin/import-history.js +9 -9
  58. package/dist/bin/install-launchd.js +7 -3
  59. package/dist/bin/install.js +19 -15
  60. package/dist/bin/intercom-check.js +4 -4
  61. package/dist/bin/mcp-sessions.js +2 -2
  62. package/dist/bin/orchestration-metrics.js +4 -4
  63. package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
  64. package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
  65. package/dist/bin/pre-publish.js +24 -1
  66. package/dist/bin/scan-tasks.js +10 -10
  67. package/dist/bin/setup.js +1 -1
  68. package/dist/bin/shard-migrate.js +4 -4
  69. package/dist/bin/stack-update.js +123 -3
  70. package/dist/bin/vps-health-gate.js +1 -1
  71. package/dist/capability-cards-XAQSL26B.js +89 -0
  72. package/dist/capacity-monitor-6MQLFFQT.js +51 -0
  73. package/dist/capacity-monitor-BB3LKJLE.js +51 -0
  74. package/dist/catchup-brief-BQSL5M5S.js +175 -0
  75. package/dist/catchup-brief-COALBX6L.js +175 -0
  76. package/dist/cc-binary-detect-B5JDCJ5J.js +19 -0
  77. package/dist/chunk-22LDUTY7.js +14597 -0
  78. package/dist/chunk-24M4AJPG.js +128 -0
  79. package/dist/chunk-2B7RCTPT.js +85 -0
  80. package/dist/chunk-2QBA6YE6.js +127 -0
  81. package/dist/chunk-2RGDEBZC.js +731 -0
  82. package/dist/chunk-32DBQWR5.js +333 -0
  83. package/dist/chunk-3EOPMTG2.js +128 -0
  84. package/dist/chunk-3NS4V4JW.js +382 -0
  85. package/dist/chunk-3NYY2NZ3.js +836 -0
  86. package/dist/chunk-3ROUD5WA.js +97 -0
  87. package/dist/chunk-3RY2ARDN.js +129 -0
  88. package/dist/chunk-3Y5IRIRU.js +290 -0
  89. package/dist/chunk-3ZWWUKBI.js +210 -0
  90. package/dist/chunk-463G3VAH.js +122 -0
  91. package/dist/chunk-4LC7BFI2.js +76 -0
  92. package/dist/chunk-4Z3FWLOE.js +836 -0
  93. package/dist/chunk-5BAU4T5G.js +208 -0
  94. package/dist/chunk-5FP7YHCG.js +1158 -0
  95. package/dist/chunk-5U3JZP62.js +1352 -0
  96. package/dist/chunk-5VNFXIGF.js +85 -0
  97. package/dist/chunk-6UVUJNLY.js +1186 -0
  98. package/dist/chunk-7KPWYWYL.js +290 -0
  99. package/dist/chunk-7URNGDEY.js +2145 -0
  100. package/dist/chunk-ADZQBZOX.js +122 -0
  101. package/dist/chunk-APSZAEDO.js +1186 -0
  102. package/dist/chunk-ASHF6VO4.js +2265 -0
  103. package/dist/chunk-BT2LEHIW.js +448 -0
  104. package/dist/chunk-BTS5QUWB.js +50 -0
  105. package/dist/chunk-BWJDJ3BS.js +604 -0
  106. package/dist/chunk-CME46VWP.js +150 -0
  107. package/dist/chunk-D3ICCKXY.js +54 -0
  108. package/dist/chunk-D3IOU3NO.js +377 -0
  109. package/dist/chunk-DFGXRKI2.js +221 -0
  110. package/dist/chunk-DO65VHQZ.js +128 -0
  111. package/dist/chunk-E2OMUBXQ.js +567 -0
  112. package/dist/chunk-ECMXIV6N.js +97 -0
  113. package/dist/chunk-EDMVA3PT.js +727 -0
  114. package/dist/chunk-F5OSXH4A.js +4388 -0
  115. package/dist/chunk-F5OWHPRG.js +236 -0
  116. package/dist/chunk-F7MZA3QP.js +199 -0
  117. package/dist/chunk-FRNXQSB4.js +134 -0
  118. package/dist/chunk-FTAASABV.js +362 -0
  119. package/dist/chunk-GBL5QSTM.js +197 -0
  120. package/dist/chunk-GRXWINOW.js +244 -0
  121. package/dist/chunk-GUPNVUG5.js +348 -0
  122. package/dist/chunk-GY66UPMX.js +167 -0
  123. package/dist/chunk-HCCG67BY.js +43 -0
  124. package/dist/chunk-HCSZZXZZ.js +197 -0
  125. package/dist/chunk-HNGNZU62.js +240 -0
  126. package/dist/chunk-HP2D5LIE.js +214 -0
  127. package/dist/chunk-HUABQHDC.js +1352 -0
  128. package/dist/chunk-HYKO2LNW.js +157 -0
  129. package/dist/chunk-IFL6DG2K.js +181 -0
  130. package/dist/chunk-IKPQRHVQ.js +304 -0
  131. package/dist/chunk-JCWA3X6A.js +402 -0
  132. package/dist/chunk-JHPK33IP.js +2162 -0
  133. package/dist/chunk-JWGDH5I2.js +127 -0
  134. package/dist/chunk-KBXQFXYM.js +567 -0
  135. package/dist/chunk-KGY5QIOJ.js +1350 -0
  136. package/dist/chunk-KLES22FB.js +1094 -0
  137. package/dist/chunk-KY43UELJ.js +331 -0
  138. package/dist/chunk-L32V4O5Z.js +58 -0
  139. package/dist/chunk-LC7ETNTJ.js +1350 -0
  140. package/dist/chunk-LEJ5FKIK.js +55 -0
  141. package/dist/chunk-LNLLCAI4.js +377 -0
  142. package/dist/chunk-LQWZYMNU.js +448 -0
  143. package/dist/chunk-LY3SOO73.js +76 -0
  144. package/dist/chunk-M6CIHXXB.js +159 -0
  145. package/dist/chunk-MJOQ35DX.js +427 -0
  146. package/dist/chunk-MO5HER5Y.js +345 -0
  147. package/dist/chunk-MY4TGLT6.js +284 -0
  148. package/dist/chunk-N3ARGCVG.js +345 -0
  149. package/dist/chunk-N4XG2M2U.js +735 -0
  150. package/dist/chunk-N72JNFJ4.js +535 -0
  151. package/dist/chunk-NM3AUMFE.js +2145 -0
  152. package/dist/chunk-NPPQ3TR4.js +735 -0
  153. package/dist/chunk-NTWF4DAF.js +581 -0
  154. package/dist/chunk-NXL3VKXM.js +331 -0
  155. package/dist/chunk-OMSLHEEF.js +456 -0
  156. package/dist/chunk-OYIP3QVN.js +167 -0
  157. package/dist/chunk-P2IOW54H.js +668 -0
  158. package/dist/chunk-P5KXQ3RN.js +731 -0
  159. package/dist/chunk-P5UXP53T.js +81 -0
  160. package/dist/chunk-PH6VRRFR.js +395 -0
  161. package/dist/chunk-Q3GKOF7Z.js +85 -0
  162. package/dist/chunk-QKBN3CY2.js +381 -0
  163. package/dist/chunk-QNNAVMQH.js +1094 -0
  164. package/dist/chunk-QODDW4YI.js +171 -0
  165. package/dist/chunk-QPAYPTSH.js +2162 -0
  166. package/dist/chunk-QRWDJ5RI.js +381 -0
  167. package/dist/chunk-RBFZCHVB.js +105 -0
  168. package/dist/chunk-RCEULTPF.js +185 -0
  169. package/dist/chunk-RCGHXBCX.js +630 -0
  170. package/dist/chunk-ROSCLRTH.js +204 -0
  171. package/dist/chunk-RYAOSGUW.js +227 -0
  172. package/dist/chunk-S2SPGHPY.js +38 -0
  173. package/dist/chunk-SBPEWD7Z.js +171 -0
  174. package/dist/chunk-SDPUWZP5.js +333 -0
  175. package/dist/chunk-SVLSHDNL.js +54 -0
  176. package/dist/chunk-SVUYBT5N.js +262 -0
  177. package/dist/chunk-T7PTLVJV.js +284 -0
  178. package/dist/chunk-TGUSLO4B.js +50 -0
  179. package/dist/chunk-TPJH6PE6.js +1158 -0
  180. package/dist/chunk-TVW7EDOJ.js +382 -0
  181. package/dist/chunk-TYRUIE6P.js +58 -0
  182. package/dist/chunk-UN5EPVBN.js +14597 -0
  183. package/dist/chunk-URLH7ZVR.js +70 -0
  184. package/dist/chunk-USYRTGR7.js +402 -0
  185. package/dist/chunk-V4ABCEHM.js +30 -0
  186. package/dist/chunk-VKCNXOQ6.js +214 -0
  187. package/dist/chunk-WB2B25UM.js +230 -0
  188. package/dist/chunk-WCUZX7F7.js +204 -0
  189. package/dist/chunk-WL5RMOZQ.js +362 -0
  190. package/dist/chunk-WPAXAOHD.js +1079 -0
  191. package/dist/chunk-XABJRAUW.js +3346 -0
  192. package/dist/chunk-YDFY6YCH.js +280 -0
  193. package/dist/chunk-YGUMRYCN.js +33 -0
  194. package/dist/chunk-YJSP5PPG.js +128 -0
  195. package/dist/chunk-YOMETWOJ.js +4388 -0
  196. package/dist/chunk-Z4FVFSE3.js +81 -0
  197. package/dist/chunk-Z4TLSNUW.js +244 -0
  198. package/dist/chunk-ZP6T5K6I.js +535 -0
  199. package/dist/chunk-ZR6ZJT32.js +123 -0
  200. package/dist/co-activation-JGF5YIDU.js +74 -0
  201. package/dist/co-occurrence-HLLC6GT2.js +95 -0
  202. package/dist/co-occurrence-W2LIAPHI.js +95 -0
  203. package/dist/code-context-index-FCL47WKE.js +30 -0
  204. package/dist/conversation-entity-extractor-WC2RU6RS.js +114 -0
  205. package/dist/core-memory-CRSR2PSL.js +110 -0
  206. package/dist/core-memory-VSKFRMEV.js +110 -0
  207. package/dist/crdt-sync-6VH2YDVY.js +33 -0
  208. package/dist/crm-webhook-RXFPZJXP.js +10 -0
  209. package/dist/crm-webhook-Z26LEFKG.js +10 -0
  210. package/dist/cto-delegation-gate-45IBLPTK.js +280 -0
  211. package/dist/cto-delegation-gate-SF4EUB2Q.js +280 -0
  212. package/dist/daemon-orchestration-VB3BLYIT.js +143 -0
  213. package/dist/daemon-orchestration-W66UYGUD.js +143 -0
  214. package/dist/db-backup-NVUTS7L5.js +43 -0
  215. package/dist/doc-graph-extractor-MLYQYT4B.js +133 -0
  216. package/dist/doc-graph-extractor-SVFSXKL6.js +133 -0
  217. package/dist/dreaming-AZYRAGKA.js +34 -0
  218. package/dist/dreaming-WG5CDUHX.js +34 -0
  219. package/dist/entity-boost-XAFCDDB6.js +375 -0
  220. package/dist/exe-drift-3SGA53CL.js +70 -0
  221. package/dist/exe-export-APUNLKWF.js +77 -0
  222. package/dist/exe-export-NM4SXB3P.js +77 -0
  223. package/dist/exe-import-6GLNCP62.js +80 -0
  224. package/dist/exe-import-U4H4ES3Z.js +80 -0
  225. package/dist/exe-key-FIPXUTMF.js +673 -0
  226. package/dist/exe-key-WTLCMOYJ.js +673 -0
  227. package/dist/exe-snapshot-ILO3WSEC.js +338 -0
  228. package/dist/exe-snapshot-IODRQLBX.js +338 -0
  229. package/dist/fast-db-init-7LYYUCSJ.js +7 -0
  230. package/dist/fast-db-init-IU7GYFWB.js +7 -0
  231. package/dist/gateway/index.js +11 -11
  232. package/dist/git-staleness-GGCFPHQ5.js +112 -0
  233. package/dist/git-task-sweep-M3SWXFKJ.js +42 -0
  234. package/dist/git-task-sweep-Y6KNWB67.js +42 -0
  235. package/dist/global-procedures-626WAU3I.js +22 -0
  236. package/dist/graph-auto-extract-TKHQ4OR3.js +183 -0
  237. package/dist/graph-auto-extract-VGFEWFZX.js +183 -0
  238. package/dist/graph-rag-KECA5TE4.js +35 -0
  239. package/dist/hooks/bug-report-worker.js +12 -12
  240. package/dist/hooks/codex-stop-task-finalizer.js +12 -12
  241. package/dist/hooks/commit-complete.js +12 -12
  242. package/dist/hooks/error-recall.js +6 -6
  243. package/dist/hooks/exe-heartbeat-hook.js +3 -3
  244. package/dist/hooks/ingest-worker.js +3 -3
  245. package/dist/hooks/ingest.js +6 -6
  246. package/dist/hooks/instructions-loaded.js +4 -4
  247. package/dist/hooks/manifest.json +20 -20
  248. package/dist/hooks/notification.js +4 -4
  249. package/dist/hooks/post-compact.js +11 -11
  250. package/dist/hooks/post-tool-combined.js +6 -6
  251. package/dist/hooks/pre-compact.js +15 -15
  252. package/dist/hooks/pre-tool-use.js +15 -15
  253. package/dist/hooks/prompt-submit.js +23 -23
  254. package/dist/hooks/session-end.js +20 -20
  255. package/dist/hooks/session-start.js +12 -12
  256. package/dist/hooks/stop.js +18 -18
  257. package/dist/hooks/subagent-stop.js +11 -11
  258. package/dist/hooks/summary-worker.js +18 -18
  259. package/dist/index.js +20 -20
  260. package/dist/installer-3FB5EMPB.js +40 -0
  261. package/dist/installer-BRQ42CPB.js +344 -0
  262. package/dist/installer-PXZJG256.js +298 -0
  263. package/dist/lib/cloud-sync.js +13 -7
  264. package/dist/lib/consolidation.js +7 -7
  265. package/dist/lib/database.js +6 -4
  266. package/dist/lib/db-daemon-client.js +11 -202
  267. package/dist/lib/db.js +6 -4
  268. package/dist/lib/embedder.js +3 -3
  269. package/dist/lib/employee-templates.js +4 -4
  270. package/dist/lib/employees.js +2 -2
  271. package/dist/lib/exe-daemon-client.js +2 -2
  272. package/dist/lib/exe-daemon.js +53 -51
  273. package/dist/lib/hybrid-search.js +5 -5
  274. package/dist/lib/identity.js +2 -2
  275. package/dist/lib/messaging.js +10 -10
  276. package/dist/lib/reminders.js +3 -3
  277. package/dist/lib/schedules.js +5 -5
  278. package/dist/lib/session-registry.js +4 -4
  279. package/dist/lib/skill-learning.js +6 -6
  280. package/dist/lib/store.js +4 -4
  281. package/dist/lib/task-router.js +3 -3
  282. package/dist/lib/tasks.js +11 -11
  283. package/dist/lib/tmux-routing.js +9 -9
  284. package/dist/lib/token-spend.js +3 -3
  285. package/dist/mcp/register-tools.js +65 -63
  286. package/dist/mcp/server.js +66 -64
  287. package/dist/mcp/tools/complete-reminder.js +4 -4
  288. package/dist/mcp/tools/create-reminder.js +4 -4
  289. package/dist/mcp/tools/create-task.js +13 -13
  290. package/dist/mcp/tools/deactivate-behavior.js +7 -7
  291. package/dist/mcp/tools/list-reminders.js +4 -4
  292. package/dist/mcp/tools/list-tasks.js +13 -13
  293. package/dist/mcp/tools/send-message.js +12 -12
  294. package/dist/mcp/tools/update-task.js +12 -12
  295. package/dist/mcp-http-config-OF3MB7M5.js +31 -0
  296. package/dist/memory-cards-CPIZVXWI.js +180 -0
  297. package/dist/memory-graph-extractor-JIYWLBFF.js +22 -0
  298. package/dist/memory-graph-extractor-MDPSLZDM.js +22 -0
  299. package/dist/memory-poisoning-defense-5UZT3WWA.js +224 -0
  300. package/dist/memory-queue-client-WKWRFERJ.js +16 -0
  301. package/dist/memory-reflection-TA2VQYPH.js +244 -0
  302. package/dist/message-queue-client-IFQQ2HI7.js +92 -0
  303. package/dist/notifications-CZBQ3H5T.js +47 -0
  304. package/dist/notifications-EIIL2EQV.js +47 -0
  305. package/dist/orchestration-events-VUYR6MXE.js +27 -0
  306. package/dist/orchestrator-MAMR4C37.js +35 -0
  307. package/dist/orchestrator-VE5WHEJH.js +35 -0
  308. package/dist/pipeline-router-DKXD6DJO.js +15 -0
  309. package/dist/pipeline-router-YNW63BY5.js +15 -0
  310. package/dist/plan-limits-ZM4MNZKY.js +28 -0
  311. package/dist/project-boot-E2TWYTAC.js +299 -0
  312. package/dist/projection-worker-WFPRM4AI.js +1084 -0
  313. package/dist/projection-worker-YKV3PFCV.js +1084 -0
  314. package/dist/prospective-memory-OAFZUODU.js +232 -0
  315. package/dist/reranker-AFU75HEX.js +19 -0
  316. package/dist/reranker-RYNSJNDF.js +19 -0
  317. package/dist/retrieval-health-RSQEIYIB.js +12 -0
  318. package/dist/review-polling-LGX7DUNT.js +126 -0
  319. package/dist/review-polling-MJBCYV4I.js +126 -0
  320. package/dist/runtime/index.js +16 -16
  321. package/dist/services/codex-reviewd/index.js +855 -0
  322. package/dist/session-events-5N47BRFK.js +38 -0
  323. package/dist/session-events-PT6SVS2P.js +38 -0
  324. package/dist/session-kill-telemetry-HKL2NQMR.js +31 -0
  325. package/dist/session-scope-GQNCM6UQ.js +88 -0
  326. package/dist/session-scope-MMGM232A.js +88 -0
  327. package/dist/setup-wizard-SELXXVLD.js +12 -0
  328. package/dist/setup-wizard-X7YSRDNQ.js +12 -0
  329. package/dist/skill-refinement-CCP4ULZ3.js +159 -0
  330. package/dist/skill-refinement-WCPDNHZ5.js +159 -0
  331. package/dist/stack-update-5VSGG36W.js +84 -0
  332. package/dist/steward-gate-PIXNK4BK.js +15 -0
  333. package/dist/task-enforcement-LEBWCYZT.js +506 -0
  334. package/dist/task-enforcement-VOSQRAQB.js +506 -0
  335. package/dist/task-scope-CQZ33PRU.js +37 -0
  336. package/dist/task-scope-JTTEZKDU.js +37 -0
  337. package/dist/tasks-crud-DC4GCXQQ.js +79 -0
  338. package/dist/tasks-crud-T32IRPXF.js +79 -0
  339. package/dist/tasks-notify-OBFVHJDP.js +40 -0
  340. package/dist/tasks-notify-OUQWUM6W.js +40 -0
  341. package/dist/tasks-review-N33MTHWJ.js +49 -0
  342. package/dist/tasks-review-OSBG2YN2.js +49 -0
  343. package/dist/telemetry-upload-EYHEWTKG.js +741 -0
  344. package/dist/telemetry-upload-XLBW4DRP.js +741 -0
  345. package/dist/token-budget-I6FMMDFX.js +86 -0
  346. package/dist/tool-capability-index-IWQBQKM7.js +10 -0
  347. package/dist/tool-telemetry-2E3Z7CRV.js +17 -0
  348. package/dist/tui/App.js +17 -17
  349. package/dist/tui-data-VWT4Q5UT.js +260 -0
  350. package/dist/tui-data-XFBFBSBE.js +260 -0
  351. package/dist/wiki-acl-EUOPNUIQ.js +111 -0
  352. package/dist/worker-gate-OQMKAMP7.js +21 -0
  353. package/dist/worker-gate-ZPP3SZK6.js +21 -0
  354. package/dist/workflow-engine-P7WYJP2B.js +28 -0
  355. package/dist/workflow-engine-UYNB5RTB.js +28 -0
  356. package/dist/worktree-H5C4LMQR.js +28 -0
  357. package/dist/worktree-sweep-KFWF3XZD.js +21 -0
  358. package/package.json +1 -1
  359. package/release-notes.json +30 -104
  360. package/src/commands/exe.md +18 -1
@@ -0,0 +1,74 @@
1
+ import {
2
+ getClient
3
+ } from "./chunk-XABJRAUW.js";
4
+ import "./chunk-2I23RPSI.js";
5
+ import "./chunk-PH6VRRFR.js";
6
+ import "./chunk-PNQDP3OA.js";
7
+ import "./chunk-7HLWBYH7.js";
8
+ import "./chunk-FXU7JOXK.js";
9
+ import "./chunk-R36FAN53.js";
10
+ import "./chunk-LYH5HE24.js";
11
+ import "./chunk-MLKGABMK.js";
12
+
13
+ // src/lib/co-activation.ts
14
+ async function recordCoActivations(entityIds) {
15
+ if (entityIds.length < 2) return;
16
+ const unique = [...new Set(entityIds)].slice(0, 20);
17
+ const client = getClient();
18
+ const pairs = [];
19
+ for (let i = 0; i < unique.length; i++) {
20
+ for (let j = i + 1; j < unique.length; j++) {
21
+ const idI = unique[i];
22
+ const idJ = unique[j];
23
+ const pair = idI < idJ ? [idI, idJ] : [idJ, idI];
24
+ pairs.push(pair);
25
+ }
26
+ }
27
+ for (const [a, b] of pairs) {
28
+ await client.execute({
29
+ sql: `INSERT INTO co_activations (entity_a_id, entity_b_id, count, last_activated_at)
30
+ VALUES (?, ?, 1, datetime('now'))
31
+ ON CONFLICT (entity_a_id, entity_b_id)
32
+ DO UPDATE SET count = count + 1, last_activated_at = datetime('now')`,
33
+ args: [a, b]
34
+ });
35
+ }
36
+ }
37
+ async function getHotPairs(limit = 20) {
38
+ const client = getClient();
39
+ const result = await client.execute({
40
+ sql: `SELECT entity_a_id, entity_b_id, count, last_activated_at
41
+ FROM co_activations
42
+ ORDER BY count DESC
43
+ LIMIT ?`,
44
+ args: [limit]
45
+ });
46
+ return result.rows.map((r) => ({
47
+ entity_a_id: String(r.entity_a_id),
48
+ entity_b_id: String(r.entity_b_id),
49
+ count: Number(r.count),
50
+ last_activated_at: String(r.last_activated_at)
51
+ }));
52
+ }
53
+ async function getCoActivationNeighbors(entityId, limit = 20) {
54
+ const client = getClient();
55
+ const result = await client.execute({
56
+ sql: `SELECT entity_a_id, entity_b_id, count, last_activated_at
57
+ FROM co_activations
58
+ WHERE entity_a_id = ? OR entity_b_id = ?
59
+ ORDER BY count DESC
60
+ LIMIT ?`,
61
+ args: [entityId, entityId, limit]
62
+ });
63
+ return result.rows.map((r) => ({
64
+ entity_a_id: String(r.entity_a_id),
65
+ entity_b_id: String(r.entity_b_id),
66
+ count: Number(r.count),
67
+ last_activated_at: String(r.last_activated_at)
68
+ }));
69
+ }
70
+ export {
71
+ getCoActivationNeighbors,
72
+ getHotPairs,
73
+ recordCoActivations
74
+ };
@@ -0,0 +1,95 @@
1
+ import {
2
+ entityId,
3
+ normalizeEntityName
4
+ } from "./chunk-6OAAN25C.js";
5
+ import "./chunk-GUMRIUI5.js";
6
+ import "./chunk-I7AW4237.js";
7
+ import {
8
+ getClient
9
+ } from "./chunk-XABJRAUW.js";
10
+ import "./chunk-2I23RPSI.js";
11
+ import "./chunk-PH6VRRFR.js";
12
+ import "./chunk-PNQDP3OA.js";
13
+ import "./chunk-7HLWBYH7.js";
14
+ import "./chunk-FXU7JOXK.js";
15
+ import "./chunk-R36FAN53.js";
16
+ import "./chunk-LYH5HE24.js";
17
+ import "./chunk-MLKGABMK.js";
18
+
19
+ // src/lib/co-occurrence.ts
20
+ var SPECIFICITY = {
21
+ file: 5,
22
+ function: 4,
23
+ error: 3,
24
+ tool: 2,
25
+ agent: 1,
26
+ project: 0
27
+ };
28
+ function getSpecificity(type) {
29
+ return SPECIFICITY[type] ?? 1;
30
+ }
31
+ function coOccurrenceId(entityId1, entityId2) {
32
+ const sorted = [entityId1, entityId2].sort();
33
+ return `cooccur:${sorted[0]}:${sorted[1]}`;
34
+ }
35
+ async function actualEntityId(name, type, fallbackId) {
36
+ try {
37
+ const result = await getClient().execute({
38
+ sql: "SELECT id FROM entities WHERE LOWER(name) = LOWER(?) AND type = ? LIMIT 1",
39
+ args: [name, type]
40
+ });
41
+ return result.rows[0]?.id ? String(result.rows[0].id) : fallbackId;
42
+ } catch {
43
+ return fallbackId;
44
+ }
45
+ }
46
+ async function createCoOccurrenceEdges(entities, _memoryId) {
47
+ if (entities.length < 2) return 0;
48
+ const client = getClient();
49
+ const now = (/* @__PURE__ */ new Date()).toISOString();
50
+ const seen = /* @__PURE__ */ new Set();
51
+ const deduped = entities.filter((e) => {
52
+ const key = `${e.type.toLowerCase()}:${normalizeEntityName(e.name)}`;
53
+ if (seen.has(key)) return false;
54
+ seen.add(key);
55
+ return true;
56
+ });
57
+ const sorted = deduped.sort((a, b) => getSpecificity(b.type) - getSpecificity(a.type));
58
+ const MAX_PAIRS = 10;
59
+ const pairs = [];
60
+ for (let i = 0; i < sorted.length && pairs.length < MAX_PAIRS; i++) {
61
+ for (let j = i + 1; j < sorted.length && pairs.length < MAX_PAIRS; j++) {
62
+ pairs.push([sorted[i], sorted[j]]);
63
+ }
64
+ }
65
+ let created = 0;
66
+ for (const [a, b] of pairs) {
67
+ const aName = normalizeEntityName(a.name);
68
+ const bName = normalizeEntityName(b.name);
69
+ const aType = a.type.toLowerCase();
70
+ const bType = b.type.toLowerCase();
71
+ const aId = await actualEntityId(aName, aType, entityId(aName, aType));
72
+ const bId = await actualEntityId(bName, bType, entityId(bName, bType));
73
+ if (aId === bId) continue;
74
+ const relId = coOccurrenceId(aId, bId);
75
+ const sortedIds = [aId, bId].sort();
76
+ const sourceId = sortedIds[0];
77
+ const targetId = sortedIds[1];
78
+ try {
79
+ await client.execute({
80
+ sql: `INSERT INTO relationships (id, source_entity_id, target_entity_id, type, weight, timestamp, properties)
81
+ VALUES (?, ?, ?, 'co_occurs_with', 1.0, ?, '{}')
82
+ ON CONFLICT(source_entity_id, target_entity_id, type) DO UPDATE SET
83
+ weight = MIN(weight + 0.1, 10.0),
84
+ timestamp = ?`,
85
+ args: [relId, sourceId, targetId, now, now]
86
+ });
87
+ created++;
88
+ } catch {
89
+ }
90
+ }
91
+ return created;
92
+ }
93
+ export {
94
+ createCoOccurrenceEdges
95
+ };
@@ -0,0 +1,95 @@
1
+ import {
2
+ entityId,
3
+ normalizeEntityName
4
+ } from "./chunk-EDMVA3PT.js";
5
+ import "./chunk-I7AW4237.js";
6
+ import "./chunk-GUMRIUI5.js";
7
+ import {
8
+ getClient
9
+ } from "./chunk-XABJRAUW.js";
10
+ import "./chunk-2I23RPSI.js";
11
+ import "./chunk-PH6VRRFR.js";
12
+ import "./chunk-PNQDP3OA.js";
13
+ import "./chunk-7HLWBYH7.js";
14
+ import "./chunk-FXU7JOXK.js";
15
+ import "./chunk-R36FAN53.js";
16
+ import "./chunk-LYH5HE24.js";
17
+ import "./chunk-MLKGABMK.js";
18
+
19
+ // src/lib/co-occurrence.ts
20
+ var SPECIFICITY = {
21
+ file: 5,
22
+ function: 4,
23
+ error: 3,
24
+ tool: 2,
25
+ agent: 1,
26
+ project: 0
27
+ };
28
+ function getSpecificity(type) {
29
+ return SPECIFICITY[type] ?? 1;
30
+ }
31
+ function coOccurrenceId(entityId1, entityId2) {
32
+ const sorted = [entityId1, entityId2].sort();
33
+ return `cooccur:${sorted[0]}:${sorted[1]}`;
34
+ }
35
+ async function actualEntityId(name, type, fallbackId) {
36
+ try {
37
+ const result = await getClient().execute({
38
+ sql: "SELECT id FROM entities WHERE LOWER(name) = LOWER(?) AND type = ? LIMIT 1",
39
+ args: [name, type]
40
+ });
41
+ return result.rows[0]?.id ? String(result.rows[0].id) : fallbackId;
42
+ } catch {
43
+ return fallbackId;
44
+ }
45
+ }
46
+ async function createCoOccurrenceEdges(entities, _memoryId) {
47
+ if (entities.length < 2) return 0;
48
+ const client = getClient();
49
+ const now = (/* @__PURE__ */ new Date()).toISOString();
50
+ const seen = /* @__PURE__ */ new Set();
51
+ const deduped = entities.filter((e) => {
52
+ const key = `${e.type.toLowerCase()}:${normalizeEntityName(e.name)}`;
53
+ if (seen.has(key)) return false;
54
+ seen.add(key);
55
+ return true;
56
+ });
57
+ const sorted = deduped.sort((a, b) => getSpecificity(b.type) - getSpecificity(a.type));
58
+ const MAX_PAIRS = 10;
59
+ const pairs = [];
60
+ for (let i = 0; i < sorted.length && pairs.length < MAX_PAIRS; i++) {
61
+ for (let j = i + 1; j < sorted.length && pairs.length < MAX_PAIRS; j++) {
62
+ pairs.push([sorted[i], sorted[j]]);
63
+ }
64
+ }
65
+ let created = 0;
66
+ for (const [a, b] of pairs) {
67
+ const aName = normalizeEntityName(a.name);
68
+ const bName = normalizeEntityName(b.name);
69
+ const aType = a.type.toLowerCase();
70
+ const bType = b.type.toLowerCase();
71
+ const aId = await actualEntityId(aName, aType, entityId(aName, aType));
72
+ const bId = await actualEntityId(bName, bType, entityId(bName, bType));
73
+ if (aId === bId) continue;
74
+ const relId = coOccurrenceId(aId, bId);
75
+ const sortedIds = [aId, bId].sort();
76
+ const sourceId = sortedIds[0];
77
+ const targetId = sortedIds[1];
78
+ try {
79
+ await client.execute({
80
+ sql: `INSERT INTO relationships (id, source_entity_id, target_entity_id, type, weight, timestamp, properties)
81
+ VALUES (?, ?, ?, 'co_occurs_with', 1.0, ?, '{}')
82
+ ON CONFLICT(source_entity_id, target_entity_id, type) DO UPDATE SET
83
+ weight = MIN(weight + 0.1, 10.0),
84
+ timestamp = ?`,
85
+ args: [relId, sourceId, targetId, now, now]
86
+ });
87
+ created++;
88
+ } catch {
89
+ }
90
+ }
91
+ return created;
92
+ }
93
+ export {
94
+ createCoOccurrenceEdges
95
+ };
@@ -0,0 +1,30 @@
1
+ import {
2
+ analyzeBlastRadius,
3
+ buildCodeContextIndex,
4
+ buildCodeContextIndexWithEmbeddings,
5
+ getCodeContextIndexPath,
6
+ getCodeContextStats,
7
+ loadOrBuildCodeContextIndex,
8
+ searchCodeContext,
9
+ searchCodeContextSemantic,
10
+ traceCodeSymbol
11
+ } from "./chunk-BWJDJ3BS.js";
12
+ import "./chunk-I7AW4237.js";
13
+ import "./chunk-NTWF4DAF.js";
14
+ import "./chunk-QOZQ2MYZ.js";
15
+ import "./chunk-HCCG67BY.js";
16
+ import "./chunk-7L2EV3XX.js";
17
+ import "./chunk-R36FAN53.js";
18
+ import "./chunk-LYH5HE24.js";
19
+ import "./chunk-MLKGABMK.js";
20
+ export {
21
+ analyzeBlastRadius,
22
+ buildCodeContextIndex,
23
+ buildCodeContextIndexWithEmbeddings,
24
+ getCodeContextIndexPath,
25
+ getCodeContextStats,
26
+ loadOrBuildCodeContextIndex,
27
+ searchCodeContext,
28
+ searchCodeContextSemantic,
29
+ traceCodeSymbol
30
+ };
@@ -0,0 +1,114 @@
1
+ import {
2
+ EXTRACT_TOOL
3
+ } from "./chunk-EDMVA3PT.js";
4
+ import "./chunk-I7AW4237.js";
5
+ import "./chunk-GUMRIUI5.js";
6
+ import "./chunk-MLKGABMK.js";
7
+
8
+ // src/lib/conversation-entity-extractor.ts
9
+ async function extractFromConversation(msg, agentResponse, agentName, model = "claude-haiku-4-5-20251001") {
10
+ const text = msg.text ?? "";
11
+ if (text.length < 20) {
12
+ return { entities: [], relationships: [], hyperedges: [] };
13
+ }
14
+ const senderName = msg.senderName ?? msg.senderId;
15
+ const prompt = [
16
+ `Extract entities and relationships from this conversation message.`,
17
+ `Platform: ${msg.platform} | Sender: ${senderName} | Account: ${msg.accountId ?? "unknown"}`,
18
+ ``,
19
+ `Focus on: people (from sender name, mentioned names), companies, products, topics discussed, locations mentioned.`,
20
+ `Only extract what's clearly stated. For business conversations, capture: customer intent, product interest, service requests.`,
21
+ ``,
22
+ `MESSAGE:`,
23
+ text,
24
+ agentResponse ? `
25
+ AGENT RESPONSE (${agentName ?? "unknown"}):
26
+ ${agentResponse}` : ""
27
+ ].join("\n");
28
+ try {
29
+ const Anthropic = (await import("@anthropic-ai/sdk")).default;
30
+ const client = new Anthropic();
31
+ const response = await client.messages.create({
32
+ model,
33
+ max_tokens: 512,
34
+ system: prompt,
35
+ messages: [{ role: "user", content: "Extract entities and relationships from the message above." }],
36
+ tools: [EXTRACT_TOOL],
37
+ tool_choice: { type: "tool", name: "extract_entities_and_relationships" }
38
+ });
39
+ const toolBlock = response.content.find((b) => b.type === "tool_use");
40
+ if (!toolBlock || toolBlock.type !== "tool_use") {
41
+ return { entities: [], relationships: [], hyperedges: [] };
42
+ }
43
+ const input = toolBlock.input;
44
+ const rawEntities = input.entities ?? [];
45
+ const rawRels = input.relationships ?? [];
46
+ const rawHyperedges = input.hyperedges ?? [];
47
+ const entities = rawEntities.map((e) => ({ name: e.name ?? "", type: e.type ?? "concept" })).filter((e) => e.name.length > 0);
48
+ const relationships = rawRels.map((r) => ({
49
+ source: r.source ?? "",
50
+ sourceType: r.source_type ?? "concept",
51
+ target: r.target ?? "",
52
+ targetType: r.target_type ?? "concept",
53
+ relationship: r.relationship ?? "related_to",
54
+ confidence: Number(r.confidence ?? 1),
55
+ confidenceLabel: String(r.confidence_label ?? "extracted")
56
+ })).filter((r) => r.source.length > 0 && r.target.length > 0);
57
+ const hyperedges = rawHyperedges.map((h) => ({
58
+ label: String(h.label ?? ""),
59
+ relation: String(h.relation ?? ""),
60
+ entityNames: h.entity_names ?? [],
61
+ confidence: Number(h.confidence ?? 1)
62
+ })).filter((h) => h.label.length > 0 && h.entityNames.length >= 3);
63
+ const senderExists = entities.some(
64
+ (e) => e.type === "person" && e.name.toLowerCase() === senderName.toLowerCase()
65
+ );
66
+ if (!senderExists) {
67
+ entities.push({ name: senderName, type: "person" });
68
+ }
69
+ if (msg.accountId) {
70
+ const hasCommunicates = relationships.some(
71
+ (r) => r.relationship === "communicates_with" && r.source.toLowerCase() === senderName.toLowerCase()
72
+ );
73
+ if (!hasCommunicates) {
74
+ relationships.push({
75
+ source: senderName,
76
+ sourceType: "person",
77
+ target: msg.accountId,
78
+ targetType: "person",
79
+ relationship: "communicates_with",
80
+ confidence: 1,
81
+ confidenceLabel: "extracted"
82
+ });
83
+ }
84
+ }
85
+ const provenance = {
86
+ source: "gateway-conversation",
87
+ platform: msg.platform,
88
+ senderId: msg.senderId,
89
+ senderName: msg.senderName,
90
+ accountId: msg.accountId,
91
+ messageId: msg.messageId,
92
+ timestamp: msg.timestamp,
93
+ agentName,
94
+ extractionModel: model,
95
+ extractedAt: (/* @__PURE__ */ new Date()).toISOString()
96
+ };
97
+ for (const entity of entities) {
98
+ entity.properties = { ...entity.properties ?? {}, provenance };
99
+ }
100
+ for (const rel of relationships) {
101
+ rel.properties = { ...rel.properties ?? {}, provenance };
102
+ }
103
+ return { entities, relationships, hyperedges };
104
+ } catch (err) {
105
+ process.stderr.write(
106
+ `[conversation-entity-extractor] Extraction failed: ${err instanceof Error ? err.message : String(err)}
107
+ `
108
+ );
109
+ return { entities: [], relationships: [], hyperedges: [] };
110
+ }
111
+ }
112
+ export {
113
+ extractFromConversation
114
+ };
@@ -0,0 +1,110 @@
1
+ import "./chunk-MLKGABMK.js";
2
+
3
+ // src/lib/core-memory.ts
4
+ var MAX_CORE_ENTRIES = 10;
5
+ var MAX_ENTRY_LENGTH = 500;
6
+ var MAX_TOTAL_CHARS = 5e3;
7
+ async function getCoreMemory(agentId) {
8
+ try {
9
+ const { getClient } = await import("./lib/database.js");
10
+ const client = getClient();
11
+ const result = await client.execute({
12
+ sql: `SELECT key, value, updated_at FROM core_memory
13
+ WHERE agent_id = ? ORDER BY key ASC`,
14
+ args: [agentId]
15
+ });
16
+ return result.rows.map((r) => ({
17
+ key: String(r.key),
18
+ value: String(r.value),
19
+ updatedAt: String(r.updated_at)
20
+ }));
21
+ } catch {
22
+ return [];
23
+ }
24
+ }
25
+ async function setCoreMemory(agentId, key, value) {
26
+ if (value.length > MAX_ENTRY_LENGTH) {
27
+ throw new Error(`Core memory value too long (${value.length}/${MAX_ENTRY_LENGTH} chars). Core memory is for key facts, not documents.`);
28
+ }
29
+ const { getClient } = await import("./lib/database.js");
30
+ const client = getClient();
31
+ const countResult = await client.execute({
32
+ sql: `SELECT COUNT(*) as cnt FROM core_memory WHERE agent_id = ?`,
33
+ args: [agentId]
34
+ });
35
+ const count = Number(countResult.rows[0]?.cnt ?? 0);
36
+ const existing = await client.execute({
37
+ sql: `SELECT key FROM core_memory WHERE agent_id = ? AND key = ?`,
38
+ args: [agentId, key]
39
+ });
40
+ if (existing.rows.length === 0 && count >= MAX_CORE_ENTRIES) {
41
+ const oldest = await client.execute({
42
+ sql: `SELECT key, value, updated_at FROM core_memory
43
+ WHERE agent_id = ? ORDER BY updated_at ASC LIMIT 1`,
44
+ args: [agentId]
45
+ });
46
+ if (oldest.rows.length > 0) {
47
+ const oldKey = String(oldest.rows[0].key);
48
+ const oldValue = String(oldest.rows[0].value);
49
+ try {
50
+ const { randomUUID } = await import("crypto");
51
+ const { writeMemory } = await import("./lib/store.js");
52
+ await writeMemory({
53
+ id: randomUUID(),
54
+ agent_id: agentId,
55
+ agent_role: "core-demotion",
56
+ session_id: "core-memory-demotion",
57
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
58
+ tool_name: "core_memory_demotion",
59
+ project_name: "exe-os",
60
+ has_error: false,
61
+ raw_text: `[Demoted from core memory] ${oldKey}: ${oldValue}`,
62
+ vector: null
63
+ });
64
+ } catch {
65
+ }
66
+ await client.execute({
67
+ sql: `DELETE FROM core_memory WHERE agent_id = ? AND key = ?`,
68
+ args: [agentId, oldKey]
69
+ });
70
+ process.stderr.write(`[core-memory] Auto-demoted "${oldKey}" to regular memory (core full at ${MAX_CORE_ENTRIES})
71
+ `);
72
+ }
73
+ }
74
+ const sizeResult = await client.execute({
75
+ sql: `SELECT COALESCE(SUM(LENGTH(value)), 0) as total FROM core_memory WHERE agent_id = ? AND key != ?`,
76
+ args: [agentId, key]
77
+ });
78
+ const currentSize = Number(sizeResult.rows[0]?.total ?? 0);
79
+ if (currentSize + value.length > MAX_TOTAL_CHARS) {
80
+ throw new Error(`Core memory would exceed ${MAX_TOTAL_CHARS} char limit. Delete entries or shorten values.`);
81
+ }
82
+ await client.execute({
83
+ sql: `INSERT OR REPLACE INTO core_memory (agent_id, key, value, updated_at)
84
+ VALUES (?, ?, ?, ?)`,
85
+ args: [agentId, key, value, (/* @__PURE__ */ new Date()).toISOString()]
86
+ });
87
+ }
88
+ async function deleteCoreMemory(agentId, key) {
89
+ const { getClient } = await import("./lib/database.js");
90
+ const client = getClient();
91
+ const result = await client.execute({
92
+ sql: `DELETE FROM core_memory WHERE agent_id = ? AND key = ?`,
93
+ args: [agentId, key]
94
+ });
95
+ return (result.rowsAffected ?? 0) > 0;
96
+ }
97
+ function formatCoreMemoryBlock(entries) {
98
+ if (entries.length === 0) return null;
99
+ const lines = ["## Core Memory (always in context)", ""];
100
+ for (const e of entries) {
101
+ lines.push(`- **${e.key}:** ${e.value}`);
102
+ }
103
+ return lines.join("\n");
104
+ }
105
+ export {
106
+ deleteCoreMemory,
107
+ formatCoreMemoryBlock,
108
+ getCoreMemory,
109
+ setCoreMemory
110
+ };
@@ -0,0 +1,110 @@
1
+ import "./chunk-MLKGABMK.js";
2
+
3
+ // src/lib/core-memory.ts
4
+ var MAX_CORE_ENTRIES = 10;
5
+ var MAX_ENTRY_LENGTH = 500;
6
+ var MAX_TOTAL_CHARS = 5e3;
7
+ async function getCoreMemory(agentId) {
8
+ try {
9
+ const { getClient } = await import("./lib/database.js");
10
+ const client = getClient();
11
+ const result = await client.execute({
12
+ sql: `SELECT key, value, updated_at FROM core_memory
13
+ WHERE agent_id = ? ORDER BY key ASC`,
14
+ args: [agentId]
15
+ });
16
+ return result.rows.map((r) => ({
17
+ key: String(r.key),
18
+ value: String(r.value),
19
+ updatedAt: String(r.updated_at)
20
+ }));
21
+ } catch {
22
+ return [];
23
+ }
24
+ }
25
+ async function setCoreMemory(agentId, key, value) {
26
+ if (value.length > MAX_ENTRY_LENGTH) {
27
+ throw new Error(`Core memory value too long (${value.length}/${MAX_ENTRY_LENGTH} chars). Core memory is for key facts, not documents.`);
28
+ }
29
+ const { getClient } = await import("./lib/database.js");
30
+ const client = getClient();
31
+ const countResult = await client.execute({
32
+ sql: `SELECT COUNT(*) as cnt FROM core_memory WHERE agent_id = ?`,
33
+ args: [agentId]
34
+ });
35
+ const count = Number(countResult.rows[0]?.cnt ?? 0);
36
+ const existing = await client.execute({
37
+ sql: `SELECT key FROM core_memory WHERE agent_id = ? AND key = ?`,
38
+ args: [agentId, key]
39
+ });
40
+ if (existing.rows.length === 0 && count >= MAX_CORE_ENTRIES) {
41
+ const oldest = await client.execute({
42
+ sql: `SELECT key, value, updated_at FROM core_memory
43
+ WHERE agent_id = ? ORDER BY updated_at ASC LIMIT 1`,
44
+ args: [agentId]
45
+ });
46
+ if (oldest.rows.length > 0) {
47
+ const oldKey = String(oldest.rows[0].key);
48
+ const oldValue = String(oldest.rows[0].value);
49
+ try {
50
+ const { randomUUID } = await import("crypto");
51
+ const { writeMemory } = await import("./lib/store.js");
52
+ await writeMemory({
53
+ id: randomUUID(),
54
+ agent_id: agentId,
55
+ agent_role: "core-demotion",
56
+ session_id: "core-memory-demotion",
57
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
58
+ tool_name: "core_memory_demotion",
59
+ project_name: "exe-os",
60
+ has_error: false,
61
+ raw_text: `[Demoted from core memory] ${oldKey}: ${oldValue}`,
62
+ vector: null
63
+ });
64
+ } catch {
65
+ }
66
+ await client.execute({
67
+ sql: `DELETE FROM core_memory WHERE agent_id = ? AND key = ?`,
68
+ args: [agentId, oldKey]
69
+ });
70
+ process.stderr.write(`[core-memory] Auto-demoted "${oldKey}" to regular memory (core full at ${MAX_CORE_ENTRIES})
71
+ `);
72
+ }
73
+ }
74
+ const sizeResult = await client.execute({
75
+ sql: `SELECT COALESCE(SUM(LENGTH(value)), 0) as total FROM core_memory WHERE agent_id = ? AND key != ?`,
76
+ args: [agentId, key]
77
+ });
78
+ const currentSize = Number(sizeResult.rows[0]?.total ?? 0);
79
+ if (currentSize + value.length > MAX_TOTAL_CHARS) {
80
+ throw new Error(`Core memory would exceed ${MAX_TOTAL_CHARS} char limit. Delete entries or shorten values.`);
81
+ }
82
+ await client.execute({
83
+ sql: `INSERT OR REPLACE INTO core_memory (agent_id, key, value, updated_at)
84
+ VALUES (?, ?, ?, ?)`,
85
+ args: [agentId, key, value, (/* @__PURE__ */ new Date()).toISOString()]
86
+ });
87
+ }
88
+ async function deleteCoreMemory(agentId, key) {
89
+ const { getClient } = await import("./lib/database.js");
90
+ const client = getClient();
91
+ const result = await client.execute({
92
+ sql: `DELETE FROM core_memory WHERE agent_id = ? AND key = ?`,
93
+ args: [agentId, key]
94
+ });
95
+ return (result.rowsAffected ?? 0) > 0;
96
+ }
97
+ function formatCoreMemoryBlock(entries) {
98
+ if (entries.length === 0) return null;
99
+ const lines = ["## Core Memory (always in context)", ""];
100
+ for (const e of entries) {
101
+ lines.push(`- **${e.key}:** ${e.value}`);
102
+ }
103
+ return lines.join("\n");
104
+ }
105
+ export {
106
+ deleteCoreMemory,
107
+ formatCoreMemoryBlock,
108
+ getCoreMemory,
109
+ setCoreMemory
110
+ };
@@ -0,0 +1,33 @@
1
+ import {
2
+ _setStatePath,
3
+ applyRemoteUpdate,
4
+ destroyCrdtDoc,
5
+ getDiffUpdate,
6
+ getFullState,
7
+ getStateVector,
8
+ importExistingBehaviors,
9
+ importExistingMemories,
10
+ initCrdtDoc,
11
+ isCrdtSyncEnabled,
12
+ onUpdate,
13
+ readAllBehaviors,
14
+ readAllMemories,
15
+ rebuildFromDb
16
+ } from "./chunk-DFGXRKI2.js";
17
+ import "./chunk-MLKGABMK.js";
18
+ export {
19
+ _setStatePath,
20
+ applyRemoteUpdate,
21
+ destroyCrdtDoc,
22
+ getDiffUpdate,
23
+ getFullState,
24
+ getStateVector,
25
+ importExistingBehaviors,
26
+ importExistingMemories,
27
+ initCrdtDoc,
28
+ isCrdtSyncEnabled,
29
+ onUpdate,
30
+ readAllBehaviors,
31
+ readAllMemories,
32
+ rebuildFromDb
33
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ createCRMWebhookHandler,
3
+ parseTwentyWebhook
4
+ } from "./chunk-SVLSHDNL.js";
5
+ import "./chunk-TVW7EDOJ.js";
6
+ import "./chunk-MLKGABMK.js";
7
+ export {
8
+ createCRMWebhookHandler,
9
+ parseTwentyWebhook
10
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ createCRMWebhookHandler,
3
+ parseTwentyWebhook
4
+ } from "./chunk-D3ICCKXY.js";
5
+ import "./chunk-3NS4V4JW.js";
6
+ import "./chunk-MLKGABMK.js";
7
+ export {
8
+ createCRMWebhookHandler,
9
+ parseTwentyWebhook
10
+ };