@askexenow/exe-os 0.9.225 → 0.9.227

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 (446) hide show
  1. package/package.json +1 -1
  2. package/dist/active-agent-HWGGCRZZ.js +0 -24
  3. package/dist/active-agent-QN6UYVDF.js +0 -25
  4. package/dist/agent-context-ZPDQOAD2.js +0 -9
  5. package/dist/agent-heartbeat-AWTVGE4C.js +0 -60
  6. package/dist/agent-loop-7UM2ENGU.js +0 -10
  7. package/dist/agentic-ontology-DOGTSZVP.js +0 -25
  8. package/dist/asana-JN2UF47A.js +0 -129
  9. package/dist/assets/ghostty.conf +0 -83
  10. package/dist/assets/statusline-command.sh +0 -44
  11. package/dist/assets/tmux.conf +0 -56
  12. package/dist/assets/wezterm.lua +0 -68
  13. package/dist/backfill-metadata-LVC55ZQI.js +0 -596
  14. package/dist/background-jobs-ZX3RLNWC.js +0 -25
  15. package/dist/bash-XA65M6T6.js +0 -8
  16. package/dist/behaviors-MCOIXNLQ.js +0 -24
  17. package/dist/bin/age-ontology-load.js +0 -85
  18. package/dist/bin/agentic-ontology-backfill.js +0 -84
  19. package/dist/bin/agentic-reflection-backfill.js +0 -45
  20. package/dist/bin/agentic-semantic-label.js +0 -193
  21. package/dist/bin/backfill-conversations.js +0 -399
  22. package/dist/bin/backfill-responses.js +0 -227
  23. package/dist/bin/backfill-vectors.js +0 -149
  24. package/dist/bin/bulk-sync-postgres.js +0 -92
  25. package/dist/bin/cc-doctor.js +0 -51
  26. package/dist/bin/cleanup-stale-review-tasks.js +0 -139
  27. package/dist/bin/cli.js +0 -1032
  28. package/dist/bin/customer-readiness.js +0 -389
  29. package/dist/bin/deferred-daemon-restart.js +0 -123
  30. package/dist/bin/exe-agent-config.js +0 -87
  31. package/dist/bin/exe-agent.js +0 -190
  32. package/dist/bin/exe-assign.js +0 -93
  33. package/dist/bin/exe-boot.js +0 -1114
  34. package/dist/bin/exe-call.js +0 -127
  35. package/dist/bin/exe-cloud.js +0 -484
  36. package/dist/bin/exe-dispatch.js +0 -72
  37. package/dist/bin/exe-doctor.js +0 -48
  38. package/dist/bin/exe-export-behaviors.js +0 -48
  39. package/dist/bin/exe-forget.js +0 -204
  40. package/dist/bin/exe-gateway.js +0 -1137
  41. package/dist/bin/exe-healthcheck.js +0 -14
  42. package/dist/bin/exe-heartbeat.js +0 -233
  43. package/dist/bin/exe-kill.js +0 -126
  44. package/dist/bin/exe-launch-agent.js +0 -678
  45. package/dist/bin/exe-new-employee.js +0 -160
  46. package/dist/bin/exe-pending-messages.js +0 -60
  47. package/dist/bin/exe-pending-notifications.js +0 -107
  48. package/dist/bin/exe-pending-reviews.js +0 -81
  49. package/dist/bin/exe-rename.js +0 -219
  50. package/dist/bin/exe-repo-drift.js +0 -95
  51. package/dist/bin/exe-review.js +0 -251
  52. package/dist/bin/exe-search.js +0 -65
  53. package/dist/bin/exe-session-cleanup.js +0 -331
  54. package/dist/bin/exe-settings.js +0 -364
  55. package/dist/bin/exe-start-codex.js +0 -404
  56. package/dist/bin/exe-start-opencode.js +0 -233
  57. package/dist/bin/exe-start.sh +0 -190
  58. package/dist/bin/exe-status.js +0 -34
  59. package/dist/bin/exe-support.js +0 -17
  60. package/dist/bin/exe-team.js +0 -83
  61. package/dist/bin/generate-hook-manifest.js +0 -30
  62. package/dist/bin/git-sweep.js +0 -74
  63. package/dist/bin/graph-backfill.js +0 -78
  64. package/dist/bin/graph-export.js +0 -66
  65. package/dist/bin/graph-layer-benchmark.js +0 -113
  66. package/dist/bin/import-history.js +0 -84
  67. package/dist/bin/install-launchd.js +0 -41
  68. package/dist/bin/install.js +0 -366
  69. package/dist/bin/intercom-check.js +0 -137
  70. package/dist/bin/list-providers.js +0 -128
  71. package/dist/bin/mcp-sessions.js +0 -194
  72. package/dist/bin/orchestration-metrics.js +0 -61
  73. package/dist/bin/postgres-agentic-reflection-backfill.js +0 -123
  74. package/dist/bin/postgres-agentic-semantic-backfill.js +0 -126
  75. package/dist/bin/pre-build-guard.js +0 -98
  76. package/dist/bin/pre-publish.js +0 -224
  77. package/dist/bin/registry-proxy.js +0 -44
  78. package/dist/bin/scan-tasks.js +0 -265
  79. package/dist/bin/setup.js +0 -19
  80. package/dist/bin/shard-migrate.js +0 -162
  81. package/dist/bin/stack-update.js +0 -372
  82. package/dist/bin/update.js +0 -354
  83. package/dist/bin/verify-stack.js +0 -389
  84. package/dist/bin/vps-backup.js +0 -170
  85. package/dist/bin/vps-health-gate.js +0 -232
  86. package/dist/branding-Q6HNW3JX.js +0 -97
  87. package/dist/browser-sanitizer-MRSSEJZE.js +0 -229
  88. package/dist/browser-session-store-RF45DSJR.js +0 -232
  89. package/dist/capacity-monitor-FNVWLAZL.js +0 -48
  90. package/dist/catchup-brief-FHMT7TRP.js +0 -150
  91. package/dist/chunk-24O54E7A.js +0 -1919
  92. package/dist/chunk-2VKESAZB.js +0 -3506
  93. package/dist/chunk-32NB4ZYS.js +0 -227
  94. package/dist/chunk-3FYSV5AI.js +0 -382
  95. package/dist/chunk-4524GLEQ.js +0 -204
  96. package/dist/chunk-465VKMEV.js +0 -85
  97. package/dist/chunk-46SQTBQW.js +0 -207
  98. package/dist/chunk-4ENKQHHV.js +0 -262
  99. package/dist/chunk-4JERP7NT.js +0 -132
  100. package/dist/chunk-4L35E6O7.js +0 -280
  101. package/dist/chunk-4UKEZJMM.js +0 -50
  102. package/dist/chunk-4ZEGEULO.js +0 -627
  103. package/dist/chunk-54GARVEX.js +0 -294
  104. package/dist/chunk-54IWHLZU.js +0 -129
  105. package/dist/chunk-557C2IGL.js +0 -0
  106. package/dist/chunk-5BS5ELMC.js +0 -85
  107. package/dist/chunk-5NFBE376.js +0 -391
  108. package/dist/chunk-5R7FJZWJ.js +0 -157
  109. package/dist/chunk-6A7P74QV.js +0 -53
  110. package/dist/chunk-6D23UNXU.js +0 -531
  111. package/dist/chunk-6HBCYEMA.js +0 -58
  112. package/dist/chunk-6KFICEAT.js +0 -20
  113. package/dist/chunk-6RX2XEET.js +0 -113
  114. package/dist/chunk-6XDH5H5V.js +0 -147
  115. package/dist/chunk-6Y4B3QF6.js +0 -19
  116. package/dist/chunk-72DJ42IE.js +0 -377
  117. package/dist/chunk-7JGZWG4U.js +0 -76
  118. package/dist/chunk-ABREUO7D.js +0 -403
  119. package/dist/chunk-ADNX3MBF.js +0 -197
  120. package/dist/chunk-AFYZGDFX.js +0 -356
  121. package/dist/chunk-AH4IJYYP.js +0 -54
  122. package/dist/chunk-AHMUF6RO.js +0 -147
  123. package/dist/chunk-AIAODMIW.js +0 -1051
  124. package/dist/chunk-AJWFPKQS.js +0 -573
  125. package/dist/chunk-AQX4SHLQ.js +0 -357
  126. package/dist/chunk-ARWBYEVQ.js +0 -183
  127. package/dist/chunk-AVE2B4DQ.js +0 -140
  128. package/dist/chunk-B4MV6W2S.js +0 -81
  129. package/dist/chunk-B7K6C6T7.js +0 -240
  130. package/dist/chunk-BDHQMDCD.js +0 -128
  131. package/dist/chunk-BDTCA647.js +0 -123
  132. package/dist/chunk-BW2CW4LG.js +0 -346
  133. package/dist/chunk-BXL7RBRI.js +0 -214
  134. package/dist/chunk-C27C2OZM.js +0 -70
  135. package/dist/chunk-CF6TE3YY.js +0 -614
  136. package/dist/chunk-CFVDND7E.js +0 -171
  137. package/dist/chunk-CHCA3ZM2.js +0 -167
  138. package/dist/chunk-CLGB3FGL.js +0 -48
  139. package/dist/chunk-CVYC6DUW.js +0 -78
  140. package/dist/chunk-CX6GL3ZJ.js +0 -274
  141. package/dist/chunk-DR75RGZS.js +0 -75
  142. package/dist/chunk-E6ORBQHP.js +0 -225
  143. package/dist/chunk-ECGTESAP.js +0 -236
  144. package/dist/chunk-ECSNSHZ7.js +0 -431
  145. package/dist/chunk-EF4PA3TY.js +0 -498
  146. package/dist/chunk-EIT6J37V.js +0 -119
  147. package/dist/chunk-EQSQ4HBW.js +0 -9
  148. package/dist/chunk-EZEU2YJQ.js +0 -38
  149. package/dist/chunk-F2DMSZZO.js +0 -69
  150. package/dist/chunk-F7LU65PQ.js +0 -33
  151. package/dist/chunk-FI4ESHBS.js +0 -244
  152. package/dist/chunk-FLLCEGSL.js +0 -55
  153. package/dist/chunk-FLSASUV3.js +0 -177
  154. package/dist/chunk-FOHKYDTJ.js +0 -2017
  155. package/dist/chunk-FWFFZGSC.js +0 -94
  156. package/dist/chunk-FXU7JOXK.js +0 -6
  157. package/dist/chunk-GCMXBQ7Y.js +0 -41
  158. package/dist/chunk-GD4VXNXO.js +0 -169
  159. package/dist/chunk-GJV3WDWM.js +0 -14
  160. package/dist/chunk-GKA5QAFL.js +0 -1345
  161. package/dist/chunk-GNBOSFEX.js +0 -363
  162. package/dist/chunk-GNHN5HRQ.js +0 -40
  163. package/dist/chunk-GP6G6EQI.js +0 -632
  164. package/dist/chunk-GQYIMXUW.js +0 -575
  165. package/dist/chunk-GUMRIUI5.js +0 -63
  166. package/dist/chunk-H6CS2GG5.js +0 -221
  167. package/dist/chunk-HA7PFCJ6.js +0 -574
  168. package/dist/chunk-HF25XPZE.js +0 -83
  169. package/dist/chunk-HOKOOBDL.js +0 -52
  170. package/dist/chunk-HU2GB7EP.js +0 -13097
  171. package/dist/chunk-HYZV25LY.js +0 -34
  172. package/dist/chunk-I7AW4237.js +0 -251
  173. package/dist/chunk-IVUL6LTK.js +0 -77
  174. package/dist/chunk-JKBHO7HA.js +0 -121
  175. package/dist/chunk-JMDBTBTS.js +0 -284
  176. package/dist/chunk-JQ6TLNIV.js +0 -133
  177. package/dist/chunk-KAUKA5JX.js +0 -1104
  178. package/dist/chunk-KCUYRZSX.js +0 -72
  179. package/dist/chunk-KH5Y6RR4.js +0 -360
  180. package/dist/chunk-KVP2UQ7R.js +0 -30
  181. package/dist/chunk-L3TB7CC3.js +0 -170
  182. package/dist/chunk-L6TSZOAD.js +0 -667
  183. package/dist/chunk-LJ36AKUW.js +0 -297
  184. package/dist/chunk-LMSRF47U.js +0 -42
  185. package/dist/chunk-LNICJE6C.js +0 -1073
  186. package/dist/chunk-LWVZLTMD.js +0 -412
  187. package/dist/chunk-LYH5HE24.js +0 -73
  188. package/dist/chunk-MLXJ5EZG.js +0 -90
  189. package/dist/chunk-MP2AFCGL.js +0 -53
  190. package/dist/chunk-MVW62NIZ.js +0 -20
  191. package/dist/chunk-MZIGUUDQ.js +0 -42
  192. package/dist/chunk-N2EVTB35.js +0 -731
  193. package/dist/chunk-N5RRQOAC.js +0 -134
  194. package/dist/chunk-NDAC3SSO.js +0 -1090
  195. package/dist/chunk-NGP6LSV2.js +0 -25
  196. package/dist/chunk-NGVOA6ZQ.js +0 -84
  197. package/dist/chunk-NHAEAOJL.js +0 -463
  198. package/dist/chunk-O377P7GM.js +0 -100
  199. package/dist/chunk-OADQCC5E.js +0 -333
  200. package/dist/chunk-OCR7A6VV.js +0 -817
  201. package/dist/chunk-ONKIWA3R.js +0 -249
  202. package/dist/chunk-OOKYLZTO.js +0 -993
  203. package/dist/chunk-OPU3NYOO.js +0 -55
  204. package/dist/chunk-ORCCI2VV.js +0 -140
  205. package/dist/chunk-OSYUNKBM.js +0 -213
  206. package/dist/chunk-OYNKIAVW.js +0 -181
  207. package/dist/chunk-PRKVT4KN.js +0 -90
  208. package/dist/chunk-PWMMIGVQ.js +0 -332
  209. package/dist/chunk-PZPQVIXS.js +0 -348
  210. package/dist/chunk-Q3V7K4ME.js +0 -149
  211. package/dist/chunk-QGGH7LOU.js +0 -93
  212. package/dist/chunk-QI4IXJN7.js +0 -132
  213. package/dist/chunk-QQZSKURD.js +0 -210
  214. package/dist/chunk-R4PJKJXP.js +0 -159
  215. package/dist/chunk-R4WMF32C.js +0 -81
  216. package/dist/chunk-R5U7XKVJ.js +0 -16
  217. package/dist/chunk-RAV23DU2.js +0 -390
  218. package/dist/chunk-RJT7H2KR.js +0 -349
  219. package/dist/chunk-SH45SJQW.js +0 -0
  220. package/dist/chunk-SUNYJ6YE.js +0 -204
  221. package/dist/chunk-SVXDCELZ.js +0 -163
  222. package/dist/chunk-T2L43P65.js +0 -495
  223. package/dist/chunk-TJ6VZK5N.js +0 -97
  224. package/dist/chunk-TLM2DDBX.js +0 -258
  225. package/dist/chunk-TMEE7AT7.js +0 -72
  226. package/dist/chunk-TPSACMM2.js +0 -3753
  227. package/dist/chunk-TQBUAZXA.js +0 -128
  228. package/dist/chunk-UKP2WIND.js +0 -330
  229. package/dist/chunk-V4TZI6EO.js +0 -60
  230. package/dist/chunk-VKACBTUG.js +0 -56
  231. package/dist/chunk-VZ5ELOUC.js +0 -33
  232. package/dist/chunk-WHEFT5FS.js +0 -290
  233. package/dist/chunk-WSKWSZQB.js +0 -90
  234. package/dist/chunk-WWTYMPKI.js +0 -159
  235. package/dist/chunk-WXW3XGWX.js +0 -332
  236. package/dist/chunk-X2Z5GT3V.js +0 -118
  237. package/dist/chunk-X4QO5DXP.js +0 -190
  238. package/dist/chunk-XEKO37NM.js +0 -43
  239. package/dist/chunk-XGOYEQMQ.js +0 -1051
  240. package/dist/chunk-XHTOAJYD.js +0 -106
  241. package/dist/chunk-Y2FNO5SU.js +0 -135
  242. package/dist/chunk-YGAAZN3E.js +0 -47
  243. package/dist/chunk-YSU7JB7H.js +0 -0
  244. package/dist/chunk-YZFZDJWZ.js +0 -107
  245. package/dist/chunk-ZGUSJ6BG.js +0 -151
  246. package/dist/chunk-ZHMQDTGE.js +0 -136
  247. package/dist/co-activation-IC5XKEXV.js +0 -71
  248. package/dist/co-occurrence-5X54MZDP.js +0 -73
  249. package/dist/code-context-index-3FHYHWV3.js +0 -29
  250. package/dist/content-extractor-CUJOBFBU.js +0 -9
  251. package/dist/conversation-entity-extractor-TW4W57K4.js +0 -114
  252. package/dist/conversation-wiki-populator-MTRQYBQZ.js +0 -105
  253. package/dist/core-memory-YHFDOGBC.js +0 -110
  254. package/dist/crdt-sync-XHQ6HC2X.js +0 -33
  255. package/dist/crm-bridge-NG5WJMGF.js +0 -19
  256. package/dist/crm-webhook-3JWHNIPR.js +0 -10
  257. package/dist/cto-delegation-gate-CNXEBVDU.js +0 -205
  258. package/dist/daemon-auth-6QSCVMPV.js +0 -13
  259. package/dist/daemon-orchestration-7BY7POV2.js +0 -133
  260. package/dist/daemon-protocol-4FUHT5NH.js +0 -17
  261. package/dist/db-backup-XGB725XE.js +0 -25
  262. package/dist/devtools-J4QYYO7U.js +0 -8
  263. package/dist/discord-7UHIZNJ3.js +0 -7
  264. package/dist/dispatch-ack-RMVFHO4I.js +0 -13
  265. package/dist/dreaming-KYPSZZA2.js +0 -12
  266. package/dist/email-T6PQUUY6.js +0 -137
  267. package/dist/entity-boost-6PC4KAGM.js +0 -332
  268. package/dist/exe-drift-HXATDG6V.js +0 -67
  269. package/dist/exe-export-JQSD3D4D.js +0 -72
  270. package/dist/exe-import-G4BFRTBN.js +0 -75
  271. package/dist/exe-key-CORPDZ7F.js +0 -573
  272. package/dist/exe-org-DR7IKYC5.js +0 -73
  273. package/dist/exe-snapshot-L6UZDFCH.js +0 -145
  274. package/dist/factory-UQSRMKJW.js +0 -67
  275. package/dist/fast-db-init-O3JWHJEE.js +0 -7
  276. package/dist/file-edit-YORRFENG.js +0 -8
  277. package/dist/file-read-RMQFDE5L.js +0 -8
  278. package/dist/file-write-VO4MQW5Y.js +0 -8
  279. package/dist/founder-context-DYPGK265.js +0 -96
  280. package/dist/gateway/index.js +0 -148
  281. package/dist/gateway-client-4GDNTHMN.js +0 -11
  282. package/dist/git-staleness-47T5DHHD.js +0 -109
  283. package/dist/git-task-sweep-CXLXWILF.js +0 -39
  284. package/dist/glob-2LXRC3F5.js +0 -7
  285. package/dist/global-procedures-A5OG775F.js +0 -19
  286. package/dist/graph-auto-extract-ATKNU47J.js +0 -161
  287. package/dist/graph-query-YZ4RZEIL.js +0 -26
  288. package/dist/graph-rag-S5SBJW5J.js +0 -29
  289. package/dist/grep-OY7KCRLQ.js +0 -7
  290. package/dist/hook-integrity-WNIRU724.js +0 -89
  291. package/dist/hooks/bug-report-worker.js +0 -179
  292. package/dist/hooks/codex-stop-task-finalizer.js +0 -258
  293. package/dist/hooks/commit-complete.js +0 -162
  294. package/dist/hooks/error-recall.js +0 -129
  295. package/dist/hooks/exe-heartbeat-hook.js +0 -78
  296. package/dist/hooks/ingest-worker.js +0 -51
  297. package/dist/hooks/ingest.js +0 -491
  298. package/dist/hooks/instructions-loaded.js +0 -119
  299. package/dist/hooks/manifest.json +0 -25
  300. package/dist/hooks/notification.js +0 -67
  301. package/dist/hooks/post-compact.js +0 -138
  302. package/dist/hooks/post-tool-combined.js +0 -152
  303. package/dist/hooks/pre-compact.js +0 -159
  304. package/dist/hooks/pre-tool-use.js +0 -512
  305. package/dist/hooks/prompt-submit.js +0 -699
  306. package/dist/hooks/session-end.js +0 -482
  307. package/dist/hooks/session-start.js +0 -362
  308. package/dist/hooks/stop.js +0 -332
  309. package/dist/hooks/subagent-stop.js +0 -85
  310. package/dist/hooks/summary-worker.js +0 -298
  311. package/dist/hooks-RPTZV5KX.js +0 -9
  312. package/dist/imessage-CE5USLTI.js +0 -7
  313. package/dist/index.js +0 -60
  314. package/dist/installer-6EN626JD.js +0 -37
  315. package/dist/installer-KLGJVSB7.js +0 -341
  316. package/dist/installer-X7IYABLB.js +0 -295
  317. package/dist/intercom-queue-USIXVVJQ.js +0 -17
  318. package/dist/key-backup-status-PSBX547O.js +0 -39
  319. package/dist/keyword-extractor-OGQRRVTB.js +0 -11
  320. package/dist/lib/agent-config.js +0 -30
  321. package/dist/lib/cloud-sync.js +0 -103
  322. package/dist/lib/cloudflare-dns.js +0 -13
  323. package/dist/lib/config.js +0 -32
  324. package/dist/lib/consolidation.js +0 -38
  325. package/dist/lib/crypto.js +0 -13
  326. package/dist/lib/database.js +0 -31
  327. package/dist/lib/db-daemon-client.js +0 -141
  328. package/dist/lib/db.js +0 -31
  329. package/dist/lib/device-registry.js +0 -70
  330. package/dist/lib/embed-worker.js +0 -165
  331. package/dist/lib/embedder.js +0 -19
  332. package/dist/lib/employee-templates.js +0 -34
  333. package/dist/lib/employees.js +0 -63
  334. package/dist/lib/error-detector.js +0 -16
  335. package/dist/lib/exe-daemon-client.js +0 -25
  336. package/dist/lib/exe-daemon.js +0 -4417
  337. package/dist/lib/file-grep.js +0 -242
  338. package/dist/lib/hybrid-search.js +0 -28
  339. package/dist/lib/identity-templates.js +0 -650
  340. package/dist/lib/identity.js +0 -19
  341. package/dist/lib/keychain.js +0 -17
  342. package/dist/lib/license.js +0 -35
  343. package/dist/lib/messaging.js +0 -59
  344. package/dist/lib/post-tool-memory.js +0 -13
  345. package/dist/lib/registry-proxy.js +0 -15
  346. package/dist/lib/reminders.js +0 -16
  347. package/dist/lib/runtime-table.js +0 -9
  348. package/dist/lib/schedules.js +0 -24
  349. package/dist/lib/session-registry.js +0 -21
  350. package/dist/lib/session-wrappers.js +0 -7
  351. package/dist/lib/skill-learning.js +0 -29
  352. package/dist/lib/status-brief.js +0 -7
  353. package/dist/lib/store.js +0 -43
  354. package/dist/lib/task-router.js +0 -22
  355. package/dist/lib/tasks.js +0 -66
  356. package/dist/lib/tmux-routing.js +0 -70
  357. package/dist/lib/tmux-status.js +0 -29
  358. package/dist/lib/tmux-transport.js +0 -7
  359. package/dist/lib/token-spend.js +0 -12
  360. package/dist/lib/transport.js +0 -10
  361. package/dist/lib/ws-auth.js +0 -11
  362. package/dist/lib/ws-client.js +0 -190
  363. package/dist/license-gate-7MTUBAQ6.js +0 -14
  364. package/dist/mcp/register-tools.js +0 -102
  365. package/dist/mcp/server.js +0 -370
  366. package/dist/mcp/tools/complete-reminder.js +0 -13
  367. package/dist/mcp/tools/create-reminder.js +0 -13
  368. package/dist/mcp/tools/create-task.js +0 -34
  369. package/dist/mcp/tools/deactivate-behavior.js +0 -16
  370. package/dist/mcp/tools/list-reminders.js +0 -13
  371. package/dist/mcp/tools/list-tasks.js +0 -33
  372. package/dist/mcp/tools/send-message.js +0 -33
  373. package/dist/mcp/tools/update-task.js +0 -32
  374. package/dist/mcp-diagnostics-5T5OZ52S.js +0 -200
  375. package/dist/mcp-disconnect-tracker-VINUVEZJ.js +0 -79
  376. package/dist/mcp-http-config-MODBCWK5.js +0 -26
  377. package/dist/memory-cards-33TRK6LU.js +0 -173
  378. package/dist/memory-graph-extractor-OBPRJKLY.js +0 -16
  379. package/dist/memory-poisoning-defense-PQV674AN.js +0 -224
  380. package/dist/memory-queue-EFSUQITE.js +0 -19
  381. package/dist/memory-queue-client-3RRVVVSZ.js +0 -15
  382. package/dist/memory-reflection-RFHRFSUD.js +0 -237
  383. package/dist/message-queue-client-P2LRY5EG.js +0 -92
  384. package/dist/notifications-P7K3ZWXX.js +0 -44
  385. package/dist/oauth-server-2QW23H7W.js +0 -437
  386. package/dist/orchestration-events-CWG6V7CV.js +0 -24
  387. package/dist/orchestration-phase-ZMMLNZAY.js +0 -23
  388. package/dist/orchestrator-O5BMUTIC.js +0 -32
  389. package/dist/permission-presets-UPVLJWZD.js +0 -25
  390. package/dist/permissions-C4EMHPDD.js +0 -14
  391. package/dist/pg-ssl-GD3332YS.js +0 -7
  392. package/dist/pipeline-router-SOF3OPQK.js +0 -12
  393. package/dist/plan-limits-DQYHBNVM.js +0 -25
  394. package/dist/prediction-log-4OYMLWU6.js +0 -120
  395. package/dist/preferences-5ARPMYE7.js +0 -10
  396. package/dist/preflight-TZOGLBZU.js +0 -287
  397. package/dist/project-boot-SC7HKBDP.js +0 -254
  398. package/dist/project-name-4SKOH2UO.js +0 -10
  399. package/dist/projection-worker-KP5ZNYQS.js +0 -877
  400. package/dist/push-notifications-IR3Z7WAT.js +0 -15
  401. package/dist/reranker-CKSUJEVR.js +0 -19
  402. package/dist/review-gate-I66GDXNR.js +0 -120
  403. package/dist/review-polling-KXD6IHFG.js +0 -123
  404. package/dist/runtime/index.js +0 -129
  405. package/dist/self-query-router-QMK5ZSZR.js +0 -188
  406. package/dist/session-events-HHOCWMZD.js +0 -35
  407. package/dist/session-kill-telemetry-PQVX3DCZ.js +0 -28
  408. package/dist/session-scope-UYHT6CHN.js +0 -85
  409. package/dist/setup-wizard-GKBK4WFY.js +0 -12
  410. package/dist/shard-manager-67Y6WYV4.js +0 -29
  411. package/dist/signal-KF2LIO7Y.js +0 -7
  412. package/dist/signal-paths-5ZTWCBUX.js +0 -19
  413. package/dist/skill-refinement-GVPVMADH.js +0 -156
  414. package/dist/slack-JRDUD5Z7.js +0 -7
  415. package/dist/stack-update-WLDGSSKX.js +0 -50
  416. package/dist/steward-gate-5P54P23O.js +0 -12
  417. package/dist/support-outbox-HIJVUDA2.js +0 -206
  418. package/dist/task-enforcement-2XZHFJSH.js +0 -292
  419. package/dist/task-scanner-5OQBNC2N.js +0 -11
  420. package/dist/task-scope-JWX77L6K.js +0 -34
  421. package/dist/tasks-crud-EFCAVOLV.js +0 -76
  422. package/dist/tasks-review-3HNBOQCH.js +0 -46
  423. package/dist/telegram-COCYUCT7.js +0 -7
  424. package/dist/telemetry-QKWQKAUC.js +0 -9
  425. package/dist/telemetry-upload-EH6KDKJN.js +0 -609
  426. package/dist/token-budget-SXD3WYQ2.js +0 -83
  427. package/dist/tool-capability-index-3UK7U6I3.js +0 -10
  428. package/dist/tool-gates-6A6LE4DZ.js +0 -14
  429. package/dist/tool-gates-RNWEH5IK.js +0 -13
  430. package/dist/tool-registry-KL24CAFR.js +0 -11
  431. package/dist/tool-telemetry-H4JCEGKN.js +0 -17
  432. package/dist/tui/App.js +0 -10223
  433. package/dist/tui-data-M2PDKZL5.js +0 -161
  434. package/dist/typed-messages-53Q7L3LB.js +0 -17
  435. package/dist/update-check-5IL5I3E2.js +0 -11
  436. package/dist/webhook-VXGIH7PN.js +0 -96
  437. package/dist/webhook-pipe-6JPL3ERE.js +0 -114
  438. package/dist/whatsapp-PSMKCDS7.js +0 -9
  439. package/dist/whatsapp-accounts-4OKWFRWL.js +0 -15
  440. package/dist/whatsapp-config-ZG5LX4O4.js +0 -125
  441. package/dist/wiki-acl-KKGKE57D.js +0 -111
  442. package/dist/wiki-client-P55NUEDE.js +0 -157
  443. package/dist/worker-gate-GAQP7EFH.js +0 -21
  444. package/dist/workflow-engine-DVOBNVA7.js +0 -28
  445. package/dist/working-memory-Z3EB3FW6.js +0 -77
  446. package/dist/worktree-LADUN5X3.js +0 -25
@@ -1,596 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- disposeStore,
4
- initStore
5
- } from "./chunk-OCR7A6VV.js";
6
- import "./chunk-CHCA3ZM2.js";
7
- import "./chunk-QQZSKURD.js";
8
- import "./chunk-F7LU65PQ.js";
9
- import "./chunk-MP2AFCGL.js";
10
- import {
11
- getClient,
12
- getEmployeeNamesByRole,
13
- loadEmployeesSync
14
- } from "./chunk-2VKESAZB.js";
15
- import "./chunk-OSYUNKBM.js";
16
- import "./chunk-FXU7JOXK.js";
17
- import "./chunk-6D23UNXU.js";
18
- import "./chunk-WXW3XGWX.js";
19
- import "./chunk-LYH5HE24.js";
20
- import {
21
- isMainModule
22
- } from "./chunk-6Y4B3QF6.js";
23
- import "./chunk-R5U7XKVJ.js";
24
-
25
- // src/bin/backfill-metadata.ts
26
- var VALID_INTENTS = /* @__PURE__ */ new Set(["decision", "question", "correction", "report", "discovery", "implementation"]);
27
- var VALID_OUTCOMES = /* @__PURE__ */ new Set(["success", "failure", "partial", "superseded"]);
28
- var VALID_DOMAINS = /* @__PURE__ */ new Set(["code", "architecture", "marketing", "operations", "customer", "research"]);
29
- var VALID_AUDIENCES = /* @__PURE__ */ new Set(["founder", "team", "self"]);
30
- var VALID_LANGUAGE_TYPES = /* @__PURE__ */ new Set(["code", "prose", "mixed", "json", "sql"]);
31
- var MAX_TEXT_LENGTH = 2e3;
32
- var BATCH_SLEEP_MS = 1e3;
33
- function roleAgentMarkers(role) {
34
- try {
35
- const employees = loadEmployeesSync();
36
- const names = getEmployeeNamesByRole(employees, role).map((n) => n.toLowerCase().trim()).filter(Boolean);
37
- if (names.length > 0) return names;
38
- } catch {
39
- }
40
- return [];
41
- }
42
- var MARKETING_AGENT_MARKERS = roleAgentMarkers("CMO");
43
- var RESEARCH_AGENT_MARKERS = roleAgentMarkers("AI Product Lead");
44
- function mentionsAgentMarker(text, markers) {
45
- return markers.some(
46
- (marker) => text.includes(`/${marker}/`) || text.includes(`agent_id: ${marker}`)
47
- );
48
- }
49
- function classifyMemoryHeuristic(rawText, toolName) {
50
- const t = rawText.toLowerCase();
51
- let intent;
52
- if (toolName === "store_decision" || t.includes("decided") || t.includes("decision:")) {
53
- intent = "decision";
54
- } else if (toolName === "store_memory" || toolName === "commit_to_long_term_memory" || toolName === "update_task" || toolName === "store_behavior" || t.startsWith("stored memory") || t.startsWith("task updated") || t.startsWith("auto-summary")) {
55
- intent = "report";
56
- } else if (t.includes("fix ") || t.includes("fixed") || t.includes("correction") || t.includes("bug") || t.includes("revert") || t.includes("hotfix")) {
57
- intent = "correction";
58
- } else if (toolName === "Edit" || toolName === "Write" || toolName === "NotebookEdit" || toolName === "Bash" && (t.includes("npm run build") || t.includes("git commit") || t.includes("npm install") || t.includes("npx "))) {
59
- intent = "implementation";
60
- } else if (toolName === "Read" || toolName === "Grep" || toolName === "Glob" || toolName === "Agent" || t.includes("?") || t.includes("search")) {
61
- intent = "question";
62
- } else if (t.includes("found") || t.includes("discovered") || t.includes("noticed") || t.includes("interesting") || t.includes("realized")) {
63
- intent = "discovery";
64
- } else if (toolName === "Bash") {
65
- intent = "implementation";
66
- } else {
67
- intent = "report";
68
- }
69
- let outcome;
70
- if (t.includes("error") || t.includes("failed") || t.includes("failure") || t.includes("exit code 1") || t.includes("exception") || t.includes("crash") || t.includes("rejected") || t.includes("\u274C")) {
71
- outcome = "failure";
72
- } else if (t.includes("success") || t.includes("passed") || t.includes("\u2713") || t.includes("complete") || t.includes("done") || t.includes("shipped") || t.includes("merged") || t.includes("build success")) {
73
- outcome = "success";
74
- } else if (t.includes("superseded") || t.includes("deprecated") || t.includes("replaced by") || t.includes("archived")) {
75
- outcome = "superseded";
76
- } else {
77
- outcome = "partial";
78
- }
79
- let domain;
80
- if (t.includes("marketing") || t.includes("campaign") || t.includes("brand") || t.includes("carousel") || t.includes("seo") || t.includes("content strategy") || mentionsAgentMarker(t, MARKETING_AGENT_MARKERS)) {
81
- domain = "marketing";
82
- } else if (t.includes("architecture") || t.includes("adr") || t.includes("design doc") || t.includes("system design") || t.includes("ARCHITECTURE.md") || t.includes("schema") && t.includes("migration")) {
83
- domain = "architecture";
84
- } else if (t.includes("customer") || t.includes("onboarding") || t.includes("install") || t.includes("setup wizard") || t.includes("license") || t.includes("stripe") || t.includes("user feedback")) {
85
- domain = "customer";
86
- } else if (t.includes("deploy") || t.includes("ci/cd") || t.includes("docker") || t.includes("nginx") || t.includes("cron") || t.includes("schedule") || t.includes("task management") || t.includes("roster") || toolName === "update_task" || toolName === "create_task") {
87
- domain = "operations";
88
- } else if (t.includes("research") || t.includes("competitor") || t.includes("benchmark") || t.includes("comparison") || t.includes("analysis") || t.includes("evaluate") || mentionsAgentMarker(t, RESEARCH_AGENT_MARKERS)) {
89
- domain = "research";
90
- } else {
91
- domain = "code";
92
- }
93
- let audience;
94
- if (toolName === "send_message" || toolName === "ask_team_memory" || toolName === "create_task" || toolName === "update_task" || t.includes("dispatched") || t.includes("assigned to")) {
95
- audience = "team";
96
- } else if (toolName === "store_memory" || toolName === "commit_to_long_term_memory" || toolName === "store_decision" || toolName === "store_behavior" || t.includes("summary") || t.includes("report") || t.includes("audit") || t.startsWith("stored memory")) {
97
- audience = "founder";
98
- } else {
99
- audience = "self";
100
- }
101
- let languageType;
102
- const jsonIndicators = (t.match(/[{}[\]]/g) || []).length;
103
- const codeIndicators = (t.match(/\b(function|const|let|var|import|export|return|if|else|class|async|await)\b/g) || []).length;
104
- const sqlIndicators = (t.match(/\b(SELECT|INSERT|UPDATE|DELETE|CREATE|ALTER|FROM|WHERE|JOIN)\b/gi) || []).length;
105
- if (sqlIndicators >= 2) {
106
- languageType = "sql";
107
- } else if (jsonIndicators > 6 && jsonIndicators > codeIndicators) {
108
- languageType = "json";
109
- } else if (codeIndicators >= 3) {
110
- languageType = codeIndicators > 5 ? "code" : "mixed";
111
- } else if (jsonIndicators > 3) {
112
- languageType = "mixed";
113
- } else {
114
- languageType = "prose";
115
- }
116
- return { intent, outcome, domain, audience, language_type: languageType };
117
- }
118
- async function classifyMemory(_anthropic, rawText) {
119
- const truncated = rawText.length > MAX_TEXT_LENGTH ? rawText.slice(0, MAX_TEXT_LENGTH) : rawText;
120
- const baseUrl = process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
121
- const apiKey = process.env.ANTHROPIC_API_KEY ?? "";
122
- const model = process.env.BACKFILL_MODEL ?? "claude-haiku-4-5-20251001";
123
- try {
124
- const res = await fetch(`${baseUrl}/v1/messages`, {
125
- method: "POST",
126
- headers: {
127
- "x-api-key": apiKey,
128
- "anthropic-version": "2023-06-01",
129
- "content-type": "application/json"
130
- },
131
- body: JSON.stringify({
132
- model,
133
- max_tokens: 100,
134
- system: "You are a JSON classifier. Output ONLY valid JSON. No explanation, no markdown, no text before or after the JSON object.",
135
- messages: [
136
- {
137
- role: "user",
138
- content: `{"task":"classify","categories":{"intent":["decision","question","correction","report","discovery","implementation"],"outcome":["success","failure","partial","superseded"],"domain":["code","architecture","marketing","operations","customer","research"],"audience":["founder","team","self"],"language_type":["code","prose","mixed","json","sql"]},"text":"${truncated.replace(/"/g, '\\"').replace(/\n/g, " ").slice(0, 500)}"}`
139
- },
140
- {
141
- role: "assistant",
142
- content: "{"
143
- }
144
- ]
145
- })
146
- });
147
- if (!res.ok) {
148
- const errText = await res.text();
149
- throw new Error(`${res.status} ${errText.slice(0, 200)}`);
150
- }
151
- const data = await res.json();
152
- const textBlock = data.content.find((b) => b.type === "text");
153
- if (!textBlock?.text) return null;
154
- const jsonText = "{" + textBlock.text.trim();
155
- const parsed = JSON.parse(jsonText);
156
- if (!VALID_INTENTS.has(parsed.intent)) return null;
157
- if (!VALID_OUTCOMES.has(parsed.outcome)) return null;
158
- if (!VALID_DOMAINS.has(parsed.domain)) return null;
159
- if (!VALID_AUDIENCES.has(parsed.audience)) return null;
160
- if (!VALID_LANGUAGE_TYPES.has(parsed.language_type)) return null;
161
- return parsed;
162
- } catch (err) {
163
- process.stderr.write(
164
- `[backfill-metadata] LLM error: ${err instanceof Error ? err.message : String(err)}
165
- `
166
- );
167
- return null;
168
- }
169
- }
170
- async function backfillHeuristic(options) {
171
- const client = getClient();
172
- const countResult = await client.execute({
173
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL",
174
- args: []
175
- });
176
- const totalUnclassified = Number(countResult.rows[0]?.cnt ?? 0);
177
- if (totalUnclassified === 0) {
178
- process.stderr.write("[backfill-metadata] All memories already classified.\n");
179
- return { classified: 0, skipped: 0, remaining: 0 };
180
- }
181
- const toProcess = options.limit > 0 ? Math.min(options.limit, totalUnclassified) : totalUnclassified;
182
- process.stderr.write(`[backfill-metadata] ${totalUnclassified} unclassified. Heuristic-classifying ${toProcess}.
183
- `);
184
- if (options.dryRun) {
185
- process.stderr.write("[backfill-metadata] Dry run \u2014 would classify " + toProcess + " memories.\n");
186
- return { classified: 0, skipped: 0, remaining: totalUnclassified };
187
- }
188
- let classified = 0;
189
- let skipped = 0;
190
- while (classified + skipped < toProcess) {
191
- const batch = await client.execute({
192
- sql: `SELECT id, raw_text, tool_name FROM memories
193
- WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL
194
- ORDER BY rowid LIMIT ?`,
195
- args: [options.batchSize]
196
- });
197
- if (batch.rows.length === 0) break;
198
- for (const row of batch.rows) {
199
- const rawText = row.raw_text;
200
- const toolName = row.tool_name;
201
- if (!rawText || rawText.length < 10) {
202
- await client.execute({
203
- sql: "UPDATE memories SET intent = 'report', outcome = 'partial', domain = 'code', audience = 'self', language_type = 'prose' WHERE id = ?",
204
- args: [row.id]
205
- });
206
- skipped++;
207
- continue;
208
- }
209
- const result = classifyMemoryHeuristic(rawText, toolName);
210
- await client.execute({
211
- sql: "UPDATE memories SET intent = ?, outcome = ?, domain = ?, audience = ?, language_type = ? WHERE id = ?",
212
- args: [result.intent, result.outcome, result.domain, result.audience, result.language_type, row.id]
213
- });
214
- classified++;
215
- }
216
- if (classified % 5e3 < options.batchSize) {
217
- process.stderr.write(`[backfill-metadata] Heuristic progress: ${classified} classified, ${skipped} skipped
218
- `);
219
- }
220
- }
221
- const remainResult = await client.execute({
222
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL",
223
- args: []
224
- });
225
- const remaining = Number(remainResult.rows[0]?.cnt ?? 0);
226
- process.stderr.write(
227
- `[backfill-metadata] Heuristic complete. Classified: ${classified}, Skipped: ${skipped}, Remaining: ${remaining}
228
- `
229
- );
230
- return { classified, skipped, remaining };
231
- }
232
- async function backfillClassifications(options) {
233
- const Anthropic = (await import("@anthropic-ai/sdk")).default;
234
- const client = getClient();
235
- const anthropic = new Anthropic();
236
- let classified = 0;
237
- let skipped = 0;
238
- let failed = 0;
239
- const countResult = await client.execute({
240
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL",
241
- args: []
242
- });
243
- const totalUnclassified = Number(countResult.rows[0]?.cnt ?? 0);
244
- if (totalUnclassified === 0) {
245
- process.stderr.write("[backfill-metadata] All memories already classified.\n");
246
- return { classified: 0, skipped: 0, failed: 0, remaining: 0 };
247
- }
248
- const toProcess = options.limit > 0 ? Math.min(options.limit, totalUnclassified) : totalUnclassified;
249
- process.stderr.write(`[backfill-metadata] ${totalUnclassified} unclassified memories. Processing ${toProcess}.
250
- `);
251
- if (options.dryRun) {
252
- const sample = await client.execute({
253
- sql: "SELECT id, SUBSTR(raw_text, 1, 80) as preview FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL ORDER BY timestamp DESC LIMIT 10",
254
- args: []
255
- });
256
- process.stderr.write("[backfill-metadata] Dry run \u2014 sample of unclassified memories:\n");
257
- for (const row of sample.rows) {
258
- process.stderr.write(` ${row.id} \u2014 ${row.preview}...
259
- `);
260
- }
261
- return { classified: 0, skipped: 0, failed: 0, remaining: totalUnclassified };
262
- }
263
- while (classified + skipped + failed < toProcess) {
264
- const batch = await client.execute({
265
- sql: "SELECT id, raw_text FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL ORDER BY timestamp DESC LIMIT ?",
266
- args: [options.batchSize]
267
- });
268
- if (batch.rows.length === 0) break;
269
- for (const row of batch.rows) {
270
- const id = row.id;
271
- const rawText = row.raw_text;
272
- if (!rawText || rawText.length < 10) {
273
- skipped++;
274
- continue;
275
- }
276
- const result = await classifyMemory(anthropic, rawText);
277
- if (!result) {
278
- failed++;
279
- process.stderr.write(`[backfill-metadata] Failed to classify ${id}
280
- `);
281
- await client.execute({
282
- sql: "UPDATE memories SET intent = 'unknown' WHERE id = ?",
283
- args: [id]
284
- });
285
- continue;
286
- }
287
- await client.execute({
288
- sql: "UPDATE memories SET intent = ?, outcome = ?, domain = ?, audience = ?, language_type = ? WHERE id = ?",
289
- args: [result.intent, result.outcome, result.domain, result.audience, result.language_type, id]
290
- });
291
- classified++;
292
- }
293
- const total = classified + skipped + failed;
294
- if (total % 100 < options.batchSize) {
295
- process.stderr.write(`[backfill-metadata] Progress: ${classified} classified, ${failed} failed, ${skipped} skipped (${total}/${toProcess})
296
- `);
297
- }
298
- if (classified + skipped + failed < toProcess) {
299
- await new Promise((resolve) => setTimeout(resolve, BATCH_SLEEP_MS));
300
- }
301
- }
302
- const remainResult = await client.execute({
303
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL",
304
- args: []
305
- });
306
- const remaining = Number(remainResult.rows[0]?.cnt ?? 0);
307
- process.stderr.write(
308
- `[backfill-metadata] Classification complete. Classified: ${classified}, Failed: ${failed}, Skipped: ${skipped}, Remaining: ${remaining}
309
- `
310
- );
311
- return { classified, skipped, failed, remaining };
312
- }
313
- async function backfillEntities(options) {
314
- const client = getClient();
315
- let populated = 0;
316
- const countResult = await client.execute({
317
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE referenced_entities IS NULL",
318
- args: []
319
- });
320
- const totalNull = Number(countResult.rows[0]?.cnt ?? 0);
321
- if (totalNull === 0) {
322
- process.stderr.write("[backfill-metadata] All memories already have referenced_entities.\n");
323
- return 0;
324
- }
325
- const toProcess = options.limit > 0 ? Math.min(options.limit, totalNull) : totalNull;
326
- process.stderr.write(`[backfill-metadata] ${totalNull} memories without referenced_entities. Processing ${toProcess}.
327
- `);
328
- if (options.dryRun) {
329
- process.stderr.write("[backfill-metadata] Dry run \u2014 would populate referenced_entities for up to " + toProcess + " memories.\n");
330
- return 0;
331
- }
332
- const entityRows = await client.execute({
333
- sql: "SELECT DISTINCT name FROM entities",
334
- args: []
335
- });
336
- const knownEntities = new Set(entityRows.rows.map((r) => r.name));
337
- let processed = 0;
338
- while (processed < toProcess) {
339
- const batch = await client.execute({
340
- sql: `SELECT m.id, m.raw_text, GROUP_CONCAT(e.name) as entities
341
- FROM memories m
342
- LEFT JOIN entity_memories em ON em.memory_id = m.id
343
- LEFT JOIN entities e ON e.id = em.entity_id
344
- WHERE m.referenced_entities IS NULL
345
- GROUP BY m.id
346
- LIMIT ?`,
347
- args: [options.batchSize]
348
- });
349
- if (batch.rows.length === 0) break;
350
- for (const row of batch.rows) {
351
- const id = row.id;
352
- const rawText = row.raw_text;
353
- const graphEntities = row.entities;
354
- let entityList;
355
- if (graphEntities) {
356
- entityList = graphEntities.split(",").filter(Boolean);
357
- } else {
358
- entityList = extractEntitiesHeuristic(rawText, knownEntities);
359
- }
360
- const jsonArray = JSON.stringify(entityList);
361
- await client.execute({
362
- sql: "UPDATE memories SET referenced_entities = ? WHERE id = ?",
363
- args: [jsonArray, id]
364
- });
365
- populated++;
366
- }
367
- processed += batch.rows.length;
368
- if (processed % 100 < options.batchSize) {
369
- process.stderr.write(`[backfill-metadata] Entity progress: ${populated} populated (${processed}/${toProcess})
370
- `);
371
- }
372
- }
373
- process.stderr.write(`[backfill-metadata] Entity extraction complete. Populated: ${populated}
374
- `);
375
- return populated;
376
- }
377
- function extractEntitiesHeuristic(rawText, knownEntities) {
378
- const entities = /* @__PURE__ */ new Set();
379
- for (const name of knownEntities) {
380
- if (name.length >= 3 && rawText.toLowerCase().includes(name.toLowerCase())) {
381
- entities.add(name);
382
- }
383
- }
384
- const filePathPattern = /(?:\/[\w.-]+){2,}/g;
385
- const paths = rawText.match(filePathPattern);
386
- if (paths) {
387
- for (const p of paths.slice(0, 5)) {
388
- entities.add(p);
389
- }
390
- }
391
- const toolPattern = /\b(Read|Write|Edit|Bash|Grep|Glob|Agent|mcp__\w+)\b/g;
392
- const tools = rawText.match(toolPattern);
393
- if (tools) {
394
- for (const t of new Set(tools)) {
395
- entities.add(t);
396
- }
397
- }
398
- return [...entities];
399
- }
400
- async function showStats() {
401
- const client = getClient();
402
- const fields = ["intent", "outcome", "domain", "audience", "language_type"];
403
- const totalResult = await client.execute({ sql: "SELECT COUNT(*) as cnt FROM memories", args: [] });
404
- const total = Number(totalResult.rows[0]?.cnt ?? 0);
405
- const unclassResult = await client.execute({
406
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL",
407
- args: []
408
- });
409
- const unclassified = Number(unclassResult.rows[0]?.cnt ?? 0);
410
- process.stdout.write(`Total memories: ${total}
411
- Classified: ${total - unclassified}
412
- Unclassified: ${unclassified}
413
-
414
- `);
415
- for (const field of fields) {
416
- const dist = await client.execute({
417
- sql: `SELECT ${field} as val, COUNT(*) as cnt FROM memories WHERE ${field} IS NOT NULL GROUP BY ${field} ORDER BY cnt DESC`,
418
- args: []
419
- });
420
- process.stdout.write(`${field}:
421
- `);
422
- for (const row of dist.rows) {
423
- const pct = (Number(row.cnt) / (total - unclassified) * 100).toFixed(1);
424
- process.stdout.write(` ${String(row.val).padEnd(20)} ${String(row.cnt).padStart(7)} (${pct}%)
425
- `);
426
- }
427
- process.stdout.write("\n");
428
- }
429
- }
430
- async function exportBatches(options) {
431
- const fs = await import("fs");
432
- const path = await import("path");
433
- const client = getClient();
434
- const outDir = path.join(process.cwd(), "exe/output/classifications/input");
435
- fs.mkdirSync(outDir, { recursive: true });
436
- const countResult = await client.execute({
437
- sql: "SELECT COUNT(*) as cnt FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL",
438
- args: []
439
- });
440
- const total = Number(countResult.rows[0]?.cnt ?? 0);
441
- process.stderr.write(`[backfill-metadata] ${total} unclassified memories to export.
442
- `);
443
- if (total === 0) return 0;
444
- const toProcess = options.limit > 0 ? Math.min(options.limit, total) : total;
445
- let offset = 0;
446
- let batchNum = 1;
447
- let exported = 0;
448
- while (offset < toProcess) {
449
- const batch = await client.execute({
450
- sql: "SELECT id, SUBSTR(raw_text, 1, 500) as text FROM memories WHERE intent IS NULL AND outcome IS NULL AND domain IS NULL ORDER BY rowid LIMIT ? OFFSET ?",
451
- args: [options.batchSize, offset]
452
- });
453
- if (batch.rows.length === 0) break;
454
- const lines = batch.rows.map((row) => {
455
- const text = String(row.text || "").replace(/\n/g, " ");
456
- return JSON.stringify({ id: row.id, text });
457
- });
458
- const batchFile = path.join(outDir, `batch-${String(batchNum).padStart(4, "0")}.jsonl`);
459
- fs.writeFileSync(batchFile, lines.join("\n") + "\n");
460
- exported += batch.rows.length;
461
- offset += options.batchSize;
462
- batchNum++;
463
- if ((batchNum - 1) % 50 === 0) {
464
- process.stderr.write(`[backfill-metadata] Exported ${exported}/${toProcess}
465
- `);
466
- }
467
- }
468
- process.stderr.write(`[backfill-metadata] Export complete: ${batchNum - 1} batch files, ${exported} memories.
469
- `);
470
- return exported;
471
- }
472
- async function importClassifications(importDir) {
473
- const fs = await import("fs");
474
- const path = await import("path");
475
- const client = getClient();
476
- const files = fs.readdirSync(importDir).filter((f) => f.endsWith(".jsonl")).sort();
477
- process.stderr.write(`[backfill-metadata] Found ${files.length} JSONL files to import from ${importDir}
478
- `);
479
- let imported = 0;
480
- let invalid = 0;
481
- for (const file of files) {
482
- const lines = fs.readFileSync(path.join(importDir, file), "utf-8").split("\n").filter(Boolean);
483
- for (const line of lines) {
484
- try {
485
- const rec = JSON.parse(line);
486
- if (!rec.id || !VALID_INTENTS.has(rec.intent) || !VALID_OUTCOMES.has(rec.outcome) || !VALID_DOMAINS.has(rec.domain) || !VALID_AUDIENCES.has(rec.audience) || !VALID_LANGUAGE_TYPES.has(rec.language_type)) {
487
- invalid++;
488
- continue;
489
- }
490
- await client.execute({
491
- sql: "UPDATE memories SET intent = ?, outcome = ?, domain = ?, audience = ?, language_type = ? WHERE id = ?",
492
- args: [rec.intent, rec.outcome, rec.domain, rec.audience, rec.language_type, rec.id]
493
- });
494
- imported++;
495
- } catch {
496
- invalid++;
497
- }
498
- }
499
- if (imported % 1e3 < 200) {
500
- process.stderr.write(`[backfill-metadata] Imported ${imported} (${invalid} invalid)
501
- `);
502
- }
503
- }
504
- process.stderr.write(`[backfill-metadata] Import complete: ${imported} updated, ${invalid} invalid.
505
- `);
506
- return { imported, invalid };
507
- }
508
- function parseArgs(argv) {
509
- let batchSize = 50;
510
- let limit = 0;
511
- let dryRun = false;
512
- let entities = false;
513
- let exportBatchesFlag = false;
514
- let importDir = "";
515
- let heuristic = false;
516
- let stats = false;
517
- for (let i = 0; i < argv.length; i++) {
518
- const arg = argv[i];
519
- if (arg.startsWith("--batch-size=")) {
520
- batchSize = parseInt(arg.split("=")[1], 10) || 50;
521
- } else if (arg === "--batch-size" && argv[i + 1]) {
522
- batchSize = parseInt(argv[++i], 10) || 50;
523
- } else if (arg.startsWith("--limit=")) {
524
- limit = parseInt(arg.split("=")[1], 10) || 0;
525
- } else if (arg === "--limit" && argv[i + 1]) {
526
- limit = parseInt(argv[++i], 10) || 0;
527
- } else if (arg === "--dry-run") {
528
- dryRun = true;
529
- } else if (arg === "--entities") {
530
- entities = true;
531
- } else if (arg === "--heuristic") {
532
- heuristic = true;
533
- } else if (arg === "--stats") {
534
- stats = true;
535
- } else if (arg === "--export") {
536
- exportBatchesFlag = true;
537
- } else if (arg.startsWith("--import=")) {
538
- importDir = arg.split("=")[1];
539
- } else if (arg === "--import" && argv[i + 1]) {
540
- importDir = argv[++i];
541
- }
542
- }
543
- return { batchSize, limit, dryRun, entities, exportBatches: exportBatchesFlag, importDir, heuristic, stats };
544
- }
545
- async function backfillMetadata(options) {
546
- await initStore();
547
- let classified = 0;
548
- let skipped = 0;
549
- let failed = 0;
550
- let remaining = 0;
551
- let entitiesPopulated = 0;
552
- if (options.stats) {
553
- await showStats();
554
- await disposeStore();
555
- return { classified: 0, skipped: 0, failed: 0, entitiesPopulated: 0, remaining: 0 };
556
- }
557
- if (options.exportBatches) {
558
- const exported = await exportBatches(options);
559
- await disposeStore();
560
- return { classified: 0, skipped: 0, failed: 0, entitiesPopulated: 0, remaining: exported };
561
- }
562
- if (options.importDir) {
563
- const { imported, invalid } = await importClassifications(options.importDir);
564
- await disposeStore();
565
- return { classified: imported, skipped: 0, failed: invalid, entitiesPopulated: 0, remaining: 0 };
566
- }
567
- if (options.heuristic) {
568
- const result = await backfillHeuristic(options);
569
- await disposeStore();
570
- return { classified: result.classified, skipped: result.skipped, failed: 0, entitiesPopulated: 0, remaining: result.remaining };
571
- }
572
- if (options.entities) {
573
- entitiesPopulated = await backfillEntities(options);
574
- } else {
575
- const result = await backfillClassifications(options);
576
- classified = result.classified;
577
- skipped = result.skipped;
578
- failed = result.failed;
579
- remaining = result.remaining;
580
- }
581
- await disposeStore();
582
- return { classified, skipped, failed, entitiesPopulated, remaining };
583
- }
584
- if (isMainModule(import.meta.url)) {
585
- const options = parseArgs(process.argv.slice(2));
586
- backfillMetadata(options).then((result) => {
587
- console.log(JSON.stringify(result, null, 2));
588
- process.exit(result.failed > 0 ? 1 : 0);
589
- }).catch((err) => {
590
- console.error("[backfill-metadata] Fatal:", err instanceof Error ? err.message : String(err));
591
- process.exit(1);
592
- });
593
- }
594
- export {
595
- backfillMetadata
596
- };
@@ -1,25 +0,0 @@
1
- import {
2
- acquireJobLock,
3
- cancelBackgroundJob,
4
- enforceBackgroundJobGuardrails,
5
- formatJobs,
6
- listBackgroundJobs,
7
- politeBatchPause,
8
- releaseJobLock,
9
- reniceCurrentProcess,
10
- startManagedJob
11
- } from "./chunk-54GARVEX.js";
12
- import "./chunk-WXW3XGWX.js";
13
- import "./chunk-LYH5HE24.js";
14
- import "./chunk-R5U7XKVJ.js";
15
- export {
16
- acquireJobLock,
17
- cancelBackgroundJob,
18
- enforceBackgroundJobGuardrails,
19
- formatJobs,
20
- listBackgroundJobs,
21
- politeBatchPause,
22
- releaseJobLock,
23
- reniceCurrentProcess,
24
- startManagedJob
25
- };
@@ -1,8 +0,0 @@
1
- import {
2
- BashTool
3
- } from "./chunk-5BS5ELMC.js";
4
- import "./chunk-AVE2B4DQ.js";
5
- import "./chunk-R5U7XKVJ.js";
6
- export {
7
- BashTool
8
- };
@@ -1,24 +0,0 @@
1
- import {
2
- deactivateBehavior,
3
- listBehaviors,
4
- listBehaviorsByDomain,
5
- listBehaviorsSince,
6
- listSharedSkills,
7
- reactivateBehavior,
8
- storeBehavior
9
- } from "./chunk-FI4ESHBS.js";
10
- import "./chunk-2VKESAZB.js";
11
- import "./chunk-OSYUNKBM.js";
12
- import "./chunk-FXU7JOXK.js";
13
- import "./chunk-WXW3XGWX.js";
14
- import "./chunk-LYH5HE24.js";
15
- import "./chunk-R5U7XKVJ.js";
16
- export {
17
- deactivateBehavior,
18
- listBehaviors,
19
- listBehaviorsByDomain,
20
- listBehaviorsSince,
21
- listSharedSkills,
22
- reactivateBehavior,
23
- storeBehavior
24
- };