@askexenow/exe-os 0.9.227 → 0.9.229

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/dist/active-agent-GJDG4CAW.js +24 -0
  2. package/dist/active-agent-WOP3ZHLN.js +25 -0
  3. package/dist/agent-context-ZPDQOAD2.js +9 -0
  4. package/dist/agent-heartbeat-AWTVGE4C.js +60 -0
  5. package/dist/agent-loop-7UM2ENGU.js +10 -0
  6. package/dist/agentic-ontology-ASORFII6.js +25 -0
  7. package/dist/asana-JN2UF47A.js +129 -0
  8. package/dist/assets/ghostty.conf +83 -0
  9. package/dist/assets/statusline-command.sh +44 -0
  10. package/dist/assets/tmux.conf +56 -0
  11. package/dist/assets/wezterm.lua +68 -0
  12. package/dist/backfill-metadata-JRWUECUS.js +596 -0
  13. package/dist/background-jobs-VTOMOTNA.js +25 -0
  14. package/dist/bash-XA65M6T6.js +8 -0
  15. package/dist/behaviors-36T3O2DC.js +24 -0
  16. package/dist/bin/age-ontology-load.js +85 -0
  17. package/dist/bin/agentic-ontology-backfill.js +84 -0
  18. package/dist/bin/agentic-reflection-backfill.js +45 -0
  19. package/dist/bin/agentic-semantic-label.js +193 -0
  20. package/dist/bin/backfill-conversations.js +399 -0
  21. package/dist/bin/backfill-responses.js +227 -0
  22. package/dist/bin/backfill-vectors.js +149 -0
  23. package/dist/bin/bulk-sync-postgres.js +92 -0
  24. package/dist/bin/cc-doctor.js +51 -0
  25. package/dist/bin/cleanup-stale-review-tasks.js +139 -0
  26. package/dist/bin/cli.js +1076 -0
  27. package/dist/bin/customer-readiness.js +389 -0
  28. package/dist/bin/deferred-daemon-restart.js +123 -0
  29. package/dist/bin/exe-agent-config.js +87 -0
  30. package/dist/bin/exe-agent.js +190 -0
  31. package/dist/bin/exe-assign.js +93 -0
  32. package/dist/bin/exe-boot.js +1114 -0
  33. package/dist/bin/exe-call.js +127 -0
  34. package/dist/bin/exe-cloud.js +484 -0
  35. package/dist/bin/exe-dispatch.js +72 -0
  36. package/dist/bin/exe-doctor.js +48 -0
  37. package/dist/bin/exe-export-behaviors.js +48 -0
  38. package/dist/bin/exe-forget.js +204 -0
  39. package/dist/bin/exe-gateway.js +1137 -0
  40. package/dist/bin/exe-healthcheck.js +14 -0
  41. package/dist/bin/exe-heartbeat.js +233 -0
  42. package/dist/bin/exe-kill.js +126 -0
  43. package/dist/bin/exe-launch-agent.js +678 -0
  44. package/dist/bin/exe-new-employee.js +160 -0
  45. package/dist/bin/exe-pending-messages.js +60 -0
  46. package/dist/bin/exe-pending-notifications.js +107 -0
  47. package/dist/bin/exe-pending-reviews.js +81 -0
  48. package/dist/bin/exe-rename.js +219 -0
  49. package/dist/bin/exe-repo-drift.js +95 -0
  50. package/dist/bin/exe-review.js +251 -0
  51. package/dist/bin/exe-search.js +65 -0
  52. package/dist/bin/exe-session-cleanup.js +331 -0
  53. package/dist/bin/exe-settings.js +364 -0
  54. package/dist/bin/exe-start-codex.js +404 -0
  55. package/dist/bin/exe-start-opencode.js +233 -0
  56. package/dist/bin/exe-start.sh +194 -0
  57. package/dist/bin/exe-status.js +34 -0
  58. package/dist/bin/exe-support.js +17 -0
  59. package/dist/bin/exe-team.js +83 -0
  60. package/dist/bin/generate-hook-manifest.js +30 -0
  61. package/dist/bin/git-sweep.js +74 -0
  62. package/dist/bin/graph-backfill.js +78 -0
  63. package/dist/bin/graph-export.js +66 -0
  64. package/dist/bin/graph-layer-benchmark.js +113 -0
  65. package/dist/bin/import-history.js +84 -0
  66. package/dist/bin/install-launchd.js +41 -0
  67. package/dist/bin/install.js +422 -0
  68. package/dist/bin/intercom-check.js +137 -0
  69. package/dist/bin/list-providers.js +128 -0
  70. package/dist/bin/mcp-sessions.js +194 -0
  71. package/dist/bin/orchestration-metrics.js +61 -0
  72. package/dist/bin/postgres-agentic-reflection-backfill.js +123 -0
  73. package/dist/bin/postgres-agentic-semantic-backfill.js +126 -0
  74. package/dist/bin/pre-build-guard.js +98 -0
  75. package/dist/bin/pre-publish.js +224 -0
  76. package/dist/bin/registry-proxy.js +44 -0
  77. package/dist/bin/scan-tasks.js +265 -0
  78. package/dist/bin/setup.js +19 -0
  79. package/dist/bin/shard-migrate.js +162 -0
  80. package/dist/bin/stack-update.js +372 -0
  81. package/dist/bin/update.js +354 -0
  82. package/dist/bin/verify-stack.js +389 -0
  83. package/dist/bin/vps-backup.js +170 -0
  84. package/dist/bin/vps-health-gate.js +232 -0
  85. package/dist/branding-I2TDZFUH.js +97 -0
  86. package/dist/browser-sanitizer-MRSSEJZE.js +229 -0
  87. package/dist/browser-session-store-RF45DSJR.js +232 -0
  88. package/dist/capacity-monitor-HZPAFQZH.js +48 -0
  89. package/dist/catchup-brief-CDG4KD5Y.js +150 -0
  90. package/dist/chunk-26PUEPOY.js +290 -0
  91. package/dist/chunk-2VZ6SY2R.js +142 -0
  92. package/dist/chunk-36DAY227.js +297 -0
  93. package/dist/chunk-3A5BZETG.js +463 -0
  94. package/dist/chunk-3DQ3IPPO.js +50 -0
  95. package/dist/chunk-3JP3FY33.js +258 -0
  96. package/dist/chunk-3MK3R5E6.js +85 -0
  97. package/dist/chunk-46SQTBQW.js +207 -0
  98. package/dist/chunk-4JERP7NT.js +132 -0
  99. package/dist/chunk-557C2IGL.js +0 -0
  100. package/dist/chunk-5BS5ELMC.js +85 -0
  101. package/dist/chunk-5NFBE376.js +391 -0
  102. package/dist/chunk-6A7P74QV.js +53 -0
  103. package/dist/chunk-6KFICEAT.js +20 -0
  104. package/dist/chunk-6MP5NOOR.js +151 -0
  105. package/dist/chunk-6Y4B3QF6.js +19 -0
  106. package/dist/chunk-7BPKHR4O.js +171 -0
  107. package/dist/chunk-7DNX45WB.js +244 -0
  108. package/dist/chunk-7EZCYO76.js +128 -0
  109. package/dist/chunk-7NNXBDOO.js +541 -0
  110. package/dist/chunk-ADJXHBEU.js +667 -0
  111. package/dist/chunk-AHMUF6RO.js +147 -0
  112. package/dist/chunk-AJWFPKQS.js +573 -0
  113. package/dist/chunk-AVE2B4DQ.js +140 -0
  114. package/dist/chunk-AZSCW64F.js +190 -0
  115. package/dist/chunk-BZAQ4UG7.js +614 -0
  116. package/dist/chunk-CHCA3ZM2.js +167 -0
  117. package/dist/chunk-CHT3THVG.js +240 -0
  118. package/dist/chunk-CLGB3FGL.js +48 -0
  119. package/dist/chunk-CQDSTBKT.js +1919 -0
  120. package/dist/chunk-CTFKTUYN.js +627 -0
  121. package/dist/chunk-CVYC6DUW.js +78 -0
  122. package/dist/chunk-CX6GL3ZJ.js +274 -0
  123. package/dist/chunk-D4IVTUNN.js +377 -0
  124. package/dist/chunk-DGOGCPYU.js +390 -0
  125. package/dist/chunk-DKRTWILB.js +81 -0
  126. package/dist/chunk-DLXTKVBO.js +183 -0
  127. package/dist/chunk-E6ORBQHP.js +225 -0
  128. package/dist/chunk-ECGTESAP.js +236 -0
  129. package/dist/chunk-ECQBG62Y.js +363 -0
  130. package/dist/chunk-ECSNSHZ7.js +431 -0
  131. package/dist/chunk-EEAKFEEA.js +221 -0
  132. package/dist/chunk-EGWPJQRQ.js +159 -0
  133. package/dist/chunk-EHKIJPVX.js +30 -0
  134. package/dist/chunk-EIT6J37V.js +119 -0
  135. package/dist/chunk-EQSQ4HBW.js +9 -0
  136. package/dist/chunk-ETSREHYC.js +55 -0
  137. package/dist/chunk-F2GUJW5O.js +1090 -0
  138. package/dist/chunk-F7LU65PQ.js +33 -0
  139. package/dist/chunk-FF62UWIJ.js +90 -0
  140. package/dist/chunk-FIPU4BDF.js +123 -0
  141. package/dist/chunk-FLSASUV3.js +177 -0
  142. package/dist/chunk-FWFFZGSC.js +94 -0
  143. package/dist/chunk-FXU7JOXK.js +6 -0
  144. package/dist/chunk-G4LLKD4Z.js +147 -0
  145. package/dist/chunk-GFCQJZTO.js +1051 -0
  146. package/dist/chunk-GGV3PFUW.js +41 -0
  147. package/dist/chunk-GJV3WDWM.js +14 -0
  148. package/dist/chunk-GKM7RYN3.js +1020 -0
  149. package/dist/chunk-GNHN5HRQ.js +40 -0
  150. package/dist/chunk-GP6G6EQI.js +632 -0
  151. package/dist/chunk-GUMRIUI5.js +63 -0
  152. package/dist/chunk-GVP5U4WL.js +113 -0
  153. package/dist/chunk-HF25XPZE.js +83 -0
  154. package/dist/chunk-HFJNYSTQ.js +1088 -0
  155. package/dist/chunk-HO5SBL4B.js +97 -0
  156. package/dist/chunk-HOKOOBDL.js +52 -0
  157. package/dist/chunk-HQMEOIUJ.js +69 -0
  158. package/dist/chunk-HTCBLSIB.js +813 -0
  159. package/dist/chunk-HYZV25LY.js +34 -0
  160. package/dist/chunk-I2CDSGQW.js +280 -0
  161. package/dist/chunk-I7AW4237.js +251 -0
  162. package/dist/chunk-IKTMX6N7.js +495 -0
  163. package/dist/chunk-IQT43SDJ.js +357 -0
  164. package/dist/chunk-IW53DAYO.js +210 -0
  165. package/dist/chunk-JBKA7F5V.js +2017 -0
  166. package/dist/chunk-JJNXFW7M.js +330 -0
  167. package/dist/chunk-JKGAJAM7.js +214 -0
  168. package/dist/chunk-JQ6TLNIV.js +133 -0
  169. package/dist/chunk-JSH5MAMM.js +284 -0
  170. package/dist/chunk-KCUYRZSX.js +72 -0
  171. package/dist/chunk-KH5Y6RR4.js +360 -0
  172. package/dist/chunk-L24HYX62.js +498 -0
  173. package/dist/chunk-L3TB7CC3.js +170 -0
  174. package/dist/chunk-LHOIY5LQ.js +58 -0
  175. package/dist/chunk-LWVZLTMD.js +412 -0
  176. package/dist/chunk-LYH5HE24.js +73 -0
  177. package/dist/chunk-M37HYGAG.js +346 -0
  178. package/dist/chunk-MJXEOKIW.js +54 -0
  179. package/dist/chunk-MKVFPQH2.js +1051 -0
  180. package/dist/chunk-MLXJ5EZG.js +90 -0
  181. package/dist/chunk-MP2AFCGL.js +53 -0
  182. package/dist/chunk-MSCB4ACU.js +356 -0
  183. package/dist/chunk-MVW62NIZ.js +20 -0
  184. package/dist/chunk-MZIGUUDQ.js +42 -0
  185. package/dist/chunk-N5RRQOAC.js +134 -0
  186. package/dist/chunk-NFB4N53K.js +159 -0
  187. package/dist/chunk-NGP6LSV2.js +25 -0
  188. package/dist/chunk-NGVOA6ZQ.js +84 -0
  189. package/dist/chunk-NRFVWJHP.js +575 -0
  190. package/dist/chunk-NUVDSQNY.js +1345 -0
  191. package/dist/chunk-O377P7GM.js +100 -0
  192. package/dist/chunk-OE6SYHTC.js +157 -0
  193. package/dist/chunk-OHPRXEUA.js +75 -0
  194. package/dist/chunk-OI6MVDSY.js +33 -0
  195. package/dist/chunk-ONKIWA3R.js +249 -0
  196. package/dist/chunk-OPU3NYOO.js +55 -0
  197. package/dist/chunk-ORCCI2VV.js +140 -0
  198. package/dist/chunk-OSMMWGJ2.js +204 -0
  199. package/dist/chunk-OYNKIAVW.js +181 -0
  200. package/dist/chunk-PRKVT4KN.js +90 -0
  201. package/dist/chunk-PW2YH2ZR.js +403 -0
  202. package/dist/chunk-PWMMIGVQ.js +332 -0
  203. package/dist/chunk-Q3V7K4ME.js +149 -0
  204. package/dist/chunk-Q5GUJUDW.js +348 -0
  205. package/dist/chunk-Q7RGLXQO.js +574 -0
  206. package/dist/chunk-Q7XA3SQ4.js +13097 -0
  207. package/dist/chunk-QGGH7LOU.js +93 -0
  208. package/dist/chunk-QHIGMP2M.js +237 -0
  209. package/dist/chunk-QI4IXJN7.js +132 -0
  210. package/dist/chunk-R2E4TV5V.js +56 -0
  211. package/dist/chunk-R4WMF32C.js +81 -0
  212. package/dist/chunk-R5U7XKVJ.js +16 -0
  213. package/dist/chunk-RJT7H2KR.js +349 -0
  214. package/dist/chunk-RMPAMMYW.js +70 -0
  215. package/dist/chunk-RTXGUKY3.js +731 -0
  216. package/dist/chunk-SH45SJQW.js +0 -0
  217. package/dist/chunk-SUNYJ6YE.js +204 -0
  218. package/dist/chunk-SVXDCELZ.js +163 -0
  219. package/dist/chunk-TMEE7AT7.js +72 -0
  220. package/dist/chunk-TNTFEWU5.js +361 -0
  221. package/dist/chunk-TOQZO2XX.js +76 -0
  222. package/dist/chunk-UBMGUX6T.js +3753 -0
  223. package/dist/chunk-UJOSFVWG.js +3511 -0
  224. package/dist/chunk-UPSZ2VKV.js +197 -0
  225. package/dist/chunk-UV4ZHXUP.js +38 -0
  226. package/dist/chunk-UWISNP4U.js +1073 -0
  227. package/dist/chunk-V3QAAU2U.js +129 -0
  228. package/dist/chunk-V4TZI6EO.js +60 -0
  229. package/dist/chunk-W6TC6A73.js +77 -0
  230. package/dist/chunk-WA67SFFZ.js +227 -0
  231. package/dist/chunk-WWPX2LLP.js +262 -0
  232. package/dist/chunk-WZ2RVKRO.js +121 -0
  233. package/dist/chunk-X2Z5GT3V.js +118 -0
  234. package/dist/chunk-X3AVWFWW.js +294 -0
  235. package/dist/chunk-XEKO37NM.js +43 -0
  236. package/dist/chunk-YADYM2DE.js +42 -0
  237. package/dist/chunk-YCTCKUZE.js +128 -0
  238. package/dist/chunk-YGAAZN3E.js +47 -0
  239. package/dist/chunk-YKIPAQZG.js +333 -0
  240. package/dist/chunk-YSU7JB7H.js +0 -0
  241. package/dist/chunk-YZFZDJWZ.js +107 -0
  242. package/dist/chunk-YZKJLGWL.js +169 -0
  243. package/dist/chunk-Z3TT2SVJ.js +135 -0
  244. package/dist/chunk-Z3ZCLTP7.js +382 -0
  245. package/dist/chunk-ZVSG2KKG.js +106 -0
  246. package/dist/co-activation-AJZTQHI3.js +71 -0
  247. package/dist/co-occurrence-FGEJIMMV.js +73 -0
  248. package/dist/code-context-index-KHUYATRB.js +29 -0
  249. package/dist/content-extractor-CUJOBFBU.js +9 -0
  250. package/dist/conversation-entity-extractor-TW4W57K4.js +114 -0
  251. package/dist/conversation-wiki-populator-GNFRTS7X.js +105 -0
  252. package/dist/core-memory-R7QBLN4C.js +110 -0
  253. package/dist/crdt-sync-K25AKQAD.js +33 -0
  254. package/dist/crm-bridge-NG5WJMGF.js +19 -0
  255. package/dist/crm-webhook-3ODT32F7.js +10 -0
  256. package/dist/cto-delegation-gate-4XDMTK6H.js +205 -0
  257. package/dist/daemon-auth-WFQMMNSD.js +13 -0
  258. package/dist/daemon-orchestration-5I7RLXCP.js +133 -0
  259. package/dist/daemon-protocol-4FUHT5NH.js +17 -0
  260. package/dist/db-backup-MSQKO6M5.js +25 -0
  261. package/dist/devtools-J4QYYO7U.js +8 -0
  262. package/dist/discord-7UHIZNJ3.js +7 -0
  263. package/dist/dispatch-ack-RMVFHO4I.js +13 -0
  264. package/dist/dreaming-UL7T5ZXA.js +12 -0
  265. package/dist/email-T6PQUUY6.js +137 -0
  266. package/dist/entity-boost-7MB2IYAE.js +332 -0
  267. package/dist/exe-drift-2KHRPBUK.js +67 -0
  268. package/dist/exe-export-UZN6EFOR.js +72 -0
  269. package/dist/exe-import-OSM3U36A.js +75 -0
  270. package/dist/exe-key-OG35WPBA.js +573 -0
  271. package/dist/exe-org-JRBBON5H.js +73 -0
  272. package/dist/exe-snapshot-7TQIN7XI.js +145 -0
  273. package/dist/factory-UQSRMKJW.js +67 -0
  274. package/dist/fast-db-init-4VXDSFUY.js +7 -0
  275. package/dist/file-edit-YORRFENG.js +8 -0
  276. package/dist/file-read-RMQFDE5L.js +8 -0
  277. package/dist/file-write-VO4MQW5Y.js +8 -0
  278. package/dist/founder-context-3N6BMG7B.js +96 -0
  279. package/dist/gateway/index.js +148 -0
  280. package/dist/gateway-client-V7NH35Q2.js +11 -0
  281. package/dist/git-staleness-JW57ZGEJ.js +109 -0
  282. package/dist/git-task-sweep-HYAPIM44.js +39 -0
  283. package/dist/glob-2LXRC3F5.js +7 -0
  284. package/dist/global-procedures-NY3W7L5Q.js +19 -0
  285. package/dist/graph-auto-extract-5GZ34NXS.js +161 -0
  286. package/dist/graph-query-YZ4RZEIL.js +26 -0
  287. package/dist/graph-rag-S5SBJW5J.js +29 -0
  288. package/dist/grep-OY7KCRLQ.js +7 -0
  289. package/dist/hook-integrity-OKSYTGVP.js +89 -0
  290. package/dist/hooks/bug-report-worker.js +179 -0
  291. package/dist/hooks/codex-stop-task-finalizer.js +258 -0
  292. package/dist/hooks/commit-complete.js +162 -0
  293. package/dist/hooks/error-recall.js +129 -0
  294. package/dist/hooks/exe-heartbeat-hook.js +78 -0
  295. package/dist/hooks/ingest-worker.js +51 -0
  296. package/dist/hooks/ingest.js +491 -0
  297. package/dist/hooks/instructions-loaded.js +119 -0
  298. package/dist/hooks/manifest.json +25 -0
  299. package/dist/hooks/notification.js +67 -0
  300. package/dist/hooks/post-compact.js +138 -0
  301. package/dist/hooks/post-tool-combined.js +152 -0
  302. package/dist/hooks/pre-compact.js +159 -0
  303. package/dist/hooks/pre-tool-use.js +512 -0
  304. package/dist/hooks/prompt-submit.js +699 -0
  305. package/dist/hooks/session-end.js +482 -0
  306. package/dist/hooks/session-start.js +362 -0
  307. package/dist/hooks/stop.js +332 -0
  308. package/dist/hooks/subagent-stop.js +85 -0
  309. package/dist/hooks/summary-worker.js +298 -0
  310. package/dist/hooks-RPTZV5KX.js +9 -0
  311. package/dist/imessage-CE5USLTI.js +7 -0
  312. package/dist/index.js +60 -0
  313. package/dist/installer-GMIVB2JS.js +341 -0
  314. package/dist/installer-OBYQ6O3C.js +295 -0
  315. package/dist/installer-UAMA6ZVH.js +37 -0
  316. package/dist/intercom-queue-USIXVVJQ.js +17 -0
  317. package/dist/key-backup-status-TVFMMWTT.js +39 -0
  318. package/dist/keyword-extractor-OGQRRVTB.js +11 -0
  319. package/dist/lib/agent-config.js +30 -0
  320. package/dist/lib/cloud-sync.js +103 -0
  321. package/dist/lib/cloudflare-dns.js +13 -0
  322. package/dist/lib/config.js +32 -0
  323. package/dist/lib/consolidation.js +38 -0
  324. package/dist/lib/crypto.js +13 -0
  325. package/dist/lib/database.js +31 -0
  326. package/dist/lib/db-daemon-client.js +141 -0
  327. package/dist/lib/db.js +31 -0
  328. package/dist/lib/device-registry.js +70 -0
  329. package/dist/lib/embed-worker.js +165 -0
  330. package/dist/lib/embedder.js +19 -0
  331. package/dist/lib/employee-templates.js +34 -0
  332. package/dist/lib/employees.js +63 -0
  333. package/dist/lib/error-detector.js +16 -0
  334. package/dist/lib/exe-daemon-client.js +25 -0
  335. package/dist/lib/exe-daemon.js +4454 -0
  336. package/dist/lib/file-grep.js +242 -0
  337. package/dist/lib/hybrid-search.js +28 -0
  338. package/dist/lib/identity-templates.js +650 -0
  339. package/dist/lib/identity.js +19 -0
  340. package/dist/lib/keychain.js +17 -0
  341. package/dist/lib/license.js +35 -0
  342. package/dist/lib/messaging.js +59 -0
  343. package/dist/lib/post-tool-memory.js +13 -0
  344. package/dist/lib/registry-proxy.js +15 -0
  345. package/dist/lib/reminders.js +16 -0
  346. package/dist/lib/runtime-table.js +9 -0
  347. package/dist/lib/schedules.js +24 -0
  348. package/dist/lib/session-registry.js +21 -0
  349. package/dist/lib/session-wrappers.js +7 -0
  350. package/dist/lib/skill-learning.js +29 -0
  351. package/dist/lib/status-brief.js +7 -0
  352. package/dist/lib/store.js +43 -0
  353. package/dist/lib/task-router.js +22 -0
  354. package/dist/lib/tasks.js +66 -0
  355. package/dist/lib/tmux-routing.js +70 -0
  356. package/dist/lib/tmux-status.js +29 -0
  357. package/dist/lib/tmux-transport.js +7 -0
  358. package/dist/lib/token-spend.js +12 -0
  359. package/dist/lib/transport.js +10 -0
  360. package/dist/lib/ws-auth.js +11 -0
  361. package/dist/lib/ws-client.js +190 -0
  362. package/dist/license-gate-7QVCYARF.js +14 -0
  363. package/dist/mcp/register-tools.js +102 -0
  364. package/dist/mcp/server.js +370 -0
  365. package/dist/mcp/tools/complete-reminder.js +13 -0
  366. package/dist/mcp/tools/create-reminder.js +13 -0
  367. package/dist/mcp/tools/create-task.js +34 -0
  368. package/dist/mcp/tools/deactivate-behavior.js +16 -0
  369. package/dist/mcp/tools/list-reminders.js +13 -0
  370. package/dist/mcp/tools/list-tasks.js +33 -0
  371. package/dist/mcp/tools/send-message.js +33 -0
  372. package/dist/mcp/tools/update-task.js +32 -0
  373. package/dist/mcp-diagnostics-5T5OZ52S.js +200 -0
  374. package/dist/mcp-disconnect-tracker-VINUVEZJ.js +79 -0
  375. package/dist/mcp-http-config-YPF4WGU5.js +26 -0
  376. package/dist/memory-cards-XHZEOX7Q.js +173 -0
  377. package/dist/memory-graph-extractor-J3K7B4GC.js +16 -0
  378. package/dist/memory-poisoning-defense-I76FGNHK.js +224 -0
  379. package/dist/memory-queue-WEVFXPZO.js +19 -0
  380. package/dist/memory-queue-client-5XBHYAQR.js +15 -0
  381. package/dist/memory-reflection-YJGI6IDI.js +237 -0
  382. package/dist/message-queue-client-FUKX43JD.js +92 -0
  383. package/dist/notifications-H4F77BYT.js +44 -0
  384. package/dist/oauth-server-CCZPDTZJ.js +437 -0
  385. package/dist/orchestration-events-LXVPJL6S.js +24 -0
  386. package/dist/orchestration-phase-HXRKMZXM.js +23 -0
  387. package/dist/orchestrator-HXUZ6LYM.js +32 -0
  388. package/dist/permission-presets-UPVLJWZD.js +25 -0
  389. package/dist/permissions-C4EMHPDD.js +14 -0
  390. package/dist/pg-ssl-GD3332YS.js +7 -0
  391. package/dist/pipeline-router-QRJQWMFF.js +12 -0
  392. package/dist/plan-limits-NFQVRHS5.js +25 -0
  393. package/dist/prediction-log-C2BD3AHR.js +120 -0
  394. package/dist/preferences-5ARPMYE7.js +10 -0
  395. package/dist/preflight-TZOGLBZU.js +287 -0
  396. package/dist/project-boot-JIGOSGCN.js +254 -0
  397. package/dist/project-name-4SKOH2UO.js +10 -0
  398. package/dist/projection-worker-JZQTL4NU.js +877 -0
  399. package/dist/push-notifications-3GNJ5SZS.js +15 -0
  400. package/dist/reranker-U6DEAT4S.js +19 -0
  401. package/dist/review-gate-I66GDXNR.js +120 -0
  402. package/dist/review-polling-W2S3XAAU.js +123 -0
  403. package/dist/runtime/index.js +129 -0
  404. package/dist/self-query-router-QMK5ZSZR.js +188 -0
  405. package/dist/session-events-MNWHGZY5.js +35 -0
  406. package/dist/session-kill-telemetry-JHSI7D3F.js +28 -0
  407. package/dist/session-scope-SMT225X3.js +85 -0
  408. package/dist/setup-wizard-RBUTEZB2.js +12 -0
  409. package/dist/shard-manager-ON2WWCRM.js +29 -0
  410. package/dist/signal-KF2LIO7Y.js +7 -0
  411. package/dist/signal-paths-5ZTWCBUX.js +19 -0
  412. package/dist/skill-refinement-LKJHUW2U.js +156 -0
  413. package/dist/slack-JRDUD5Z7.js +7 -0
  414. package/dist/stack-update-ZIMV4OEQ.js +50 -0
  415. package/dist/steward-gate-6IKH335D.js +12 -0
  416. package/dist/support-outbox-HIJVUDA2.js +206 -0
  417. package/dist/task-enforcement-UIEWTA6H.js +292 -0
  418. package/dist/task-scanner-5OQBNC2N.js +11 -0
  419. package/dist/task-scope-DNQURKOQ.js +34 -0
  420. package/dist/tasks-crud-CLAYZZ4O.js +76 -0
  421. package/dist/tasks-review-OHR2P4QE.js +46 -0
  422. package/dist/telegram-COCYUCT7.js +7 -0
  423. package/dist/telemetry-QKWQKAUC.js +9 -0
  424. package/dist/telemetry-upload-APVDPCEV.js +609 -0
  425. package/dist/token-budget-6IQNYKLR.js +83 -0
  426. package/dist/tool-capability-index-UUNF7VPA.js +10 -0
  427. package/dist/tool-gates-6A6LE4DZ.js +14 -0
  428. package/dist/tool-gates-RNWEH5IK.js +13 -0
  429. package/dist/tool-registry-KL24CAFR.js +11 -0
  430. package/dist/tool-telemetry-SJSIL5M5.js +17 -0
  431. package/dist/tui/App.js +10223 -0
  432. package/dist/tui-data-L6XG4Z52.js +161 -0
  433. package/dist/typed-messages-53Q7L3LB.js +17 -0
  434. package/dist/update-check-5IL5I3E2.js +11 -0
  435. package/dist/webhook-VXGIH7PN.js +96 -0
  436. package/dist/webhook-pipe-4WPFGGFD.js +114 -0
  437. package/dist/whatsapp-PSMKCDS7.js +9 -0
  438. package/dist/whatsapp-accounts-4OKWFRWL.js +15 -0
  439. package/dist/whatsapp-config-ZG5LX4O4.js +125 -0
  440. package/dist/wiki-acl-XCT6QQGP.js +111 -0
  441. package/dist/wiki-client-KE622HKY.js +157 -0
  442. package/dist/worker-gate-GFKXZ6V5.js +21 -0
  443. package/dist/workflow-engine-6HTKI2ZE.js +28 -0
  444. package/dist/working-memory-Z3EB3FW6.js +77 -0
  445. package/dist/worktree-BO7QQ32T.js +25 -0
  446. package/package.json +1 -1
@@ -0,0 +1,1076 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin/cli.ts
4
+ import { existsSync, readFileSync, writeFileSync, readdirSync, rmSync } from "fs";
5
+ import path from "path";
6
+ import os from "os";
7
+ var nodeVersion = parseInt(process.versions.node, 10);
8
+ if (nodeVersion < 20) {
9
+ process.stderr.write(`
10
+ exe-os requires Node.js 20 or later (you have ${process.version}).
11
+ Install: https://nodejs.org/
12
+
13
+ `);
14
+ process.exit(1);
15
+ }
16
+ var args = process.argv.slice(2);
17
+ if (args.includes("--version") || args.includes("-v")) {
18
+ try {
19
+ const pkgPath = path.join(path.dirname(new URL(import.meta.url).pathname), "..", "..", "package.json");
20
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
21
+ console.log(pkg.version);
22
+ } catch {
23
+ console.log("unknown");
24
+ }
25
+ process.exit(0);
26
+ }
27
+ if (args.includes("--help") || args.includes("-h") || args.includes("help")) {
28
+ let version = "unknown";
29
+ try {
30
+ const pkgPath = path.join(path.dirname(new URL(import.meta.url).pathname), "..", "..", "package.json");
31
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
32
+ version = pkg.version;
33
+ } catch {
34
+ }
35
+ console.log(`
36
+ exe-os v${version} \u2014 AI employee operating system
37
+
38
+ Usage: exe-os <command>
39
+
40
+ Commands:
41
+ setup First-time setup (encryption, license, team)
42
+ update Check for and install updates
43
+ cloud Cloud sync setup and device linking
44
+ doctor Diagnose installation health
45
+ support test Verify support intake works
46
+ settings Configure memory system settings
47
+ org phase View/change orchestration phase
48
+ healthcheck Check daemon and service health
49
+
50
+ Session commands (run from a project folder):
51
+ exe1 Launch COO session #1
52
+ exe2 Launch COO session #2
53
+
54
+ Options:
55
+ --help, -h Show this help message
56
+ --version, -v Show version
57
+
58
+ Learn more: https://askexe.com/docs
59
+ `);
60
+ process.exit(0);
61
+ }
62
+ if (args.includes("--global")) {
63
+ process.stderr.write(
64
+ "\x1B[33m[deprecated]\x1B[0m --global is deprecated. Use: exe-os claude install\n"
65
+ );
66
+ await runClaudeInstall();
67
+ } else if (args.includes("--commands-only")) {
68
+ const { copySlashCommands, resolvePackageRoot } = await import("../installer-UAMA6ZVH.js");
69
+ try {
70
+ const packageRoot = resolvePackageRoot();
71
+ const result = await copySlashCommands(packageRoot);
72
+ if (result.copied > 0) {
73
+ process.stderr.write(
74
+ `exe-os: ${result.copied} slash command(s) updated
75
+ `
76
+ );
77
+ }
78
+ } catch {
79
+ }
80
+ } else if (args[0] === "claude") {
81
+ const sub = args[1];
82
+ switch (sub) {
83
+ case "install":
84
+ await runClaudeInstall();
85
+ break;
86
+ case "check":
87
+ await runClaudeCheck();
88
+ break;
89
+ case "mcp-doctor":
90
+ await runClaudeMcpDoctor();
91
+ break;
92
+ case "mcp":
93
+ if (args[2] === "doctor") {
94
+ await runClaudeMcpDoctor();
95
+ } else {
96
+ console.error("Usage: exe-os claude mcp-doctor");
97
+ process.exit(1);
98
+ }
99
+ break;
100
+ case "uninstall":
101
+ await runClaudeUninstall(args.slice(2));
102
+ break;
103
+ default:
104
+ await runClaudeInstall();
105
+ break;
106
+ }
107
+ } else if (args[0] === "codex") {
108
+ const sub = args[1];
109
+ switch (sub) {
110
+ case "install":
111
+ await runCodexInstall();
112
+ break;
113
+ default:
114
+ await runCodexInstall();
115
+ break;
116
+ }
117
+ } else if (args[0] === "opencode") {
118
+ const sub = args[1];
119
+ switch (sub) {
120
+ case "install":
121
+ await runOpenCodeInstall();
122
+ break;
123
+ default:
124
+ await runOpenCodeInstall();
125
+ break;
126
+ }
127
+ } else if (args[0] === "org") {
128
+ const { main: runOrg } = await import("../exe-org-JRBBON5H.js");
129
+ await runOrg(args.slice(1));
130
+ } else if (args[0] === "code-context") {
131
+ await runCodeContext(args.slice(1));
132
+ } else if (args[0] === "jobs") {
133
+ const { cancelBackgroundJob, formatJobs, listBackgroundJobs } = await import("../background-jobs-VTOMOTNA.js");
134
+ const sub = args[1] ?? "status";
135
+ if (sub === "status" || sub === "list") {
136
+ console.log(formatJobs(listBackgroundJobs()));
137
+ } else if (sub === "cancel") {
138
+ const id = args[2];
139
+ if (!id) {
140
+ console.error("Usage: exe-os jobs cancel <job-id-or-pid>");
141
+ process.exit(1);
142
+ }
143
+ const job = cancelBackgroundJob(id);
144
+ if (!job) {
145
+ console.error(`No exe-os background job found for ${id}`);
146
+ process.exit(1);
147
+ }
148
+ console.log(`Cancelled ${job.name} (${job.id}).`);
149
+ } else {
150
+ console.error("Usage: exe-os jobs status | exe-os jobs cancel <job-id-or-pid>");
151
+ process.exit(1);
152
+ }
153
+ } else if (args[0] === "key") {
154
+ const { main: runKey } = await import("../exe-key-OG35WPBA.js");
155
+ await runKey(args.slice(1));
156
+ } else if (args[0] === "link") {
157
+ console.error("`exe-os link` has been removed from the customer command surface.");
158
+ console.error("Use `exe-os cloud link --show-full` to reveal the recovery phrase in your local Terminal.");
159
+ console.error("Use `exe-os setup` on a new device to paste/import that phrase.");
160
+ process.exitCode = 1;
161
+ } else if (args[0] === "cloud") {
162
+ const sub = args[1];
163
+ if (sub === "sync") {
164
+ if (args.includes("--show-full") || args.includes("--local-terminal-only")) {
165
+ console.error("`exe-os cloud sync` never shows recovery phrases; it only syncs data.");
166
+ console.error("To reveal the full recovery phrase, run in your local Terminal:");
167
+ console.error(" exe-os cloud link --show-full");
168
+ process.exitCode = 1;
169
+ } else {
170
+ await runCloudSync();
171
+ }
172
+ } else {
173
+ process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
174
+ const { main: runCloud } = await import("./exe-cloud.js");
175
+ await runCloud();
176
+ }
177
+ } else if (args[0] === "support") {
178
+ const { main: runSupport } = await import("./exe-support.js");
179
+ await runSupport(args.slice(1));
180
+ } else if (args[0] === "bulk-sync-postgres") {
181
+ const { main: runBulkSyncPostgres } = await import("./bulk-sync-postgres.js");
182
+ await runBulkSyncPostgres();
183
+ } else if (args[0] === "backfill-conversations") {
184
+ const { backfillConversations } = await import("./backfill-conversations.js");
185
+ const opts = parseBackfillArgs(args.slice(1));
186
+ try {
187
+ const result = await backfillConversations(opts);
188
+ console.log(JSON.stringify(result, null, 2));
189
+ } catch (err) {
190
+ console.error("Backfill failed:", err instanceof Error ? err.message : String(err));
191
+ process.exit(1);
192
+ }
193
+ } else if (args[0] === "backfill-metadata") {
194
+ const { backfillMetadata } = await import("../backfill-metadata-JRWUECUS.js");
195
+ let batchSize = 50;
196
+ let limit = 0;
197
+ let dryRun = false;
198
+ let entities = false;
199
+ const bmArgs = args.slice(1);
200
+ for (let i = 0; i < bmArgs.length; i++) {
201
+ const arg = bmArgs[i];
202
+ if (arg.startsWith("--batch-size=")) {
203
+ batchSize = parseInt(arg.split("=")[1], 10) || 50;
204
+ } else if (arg === "--batch-size" && bmArgs[i + 1]) {
205
+ batchSize = parseInt(bmArgs[++i], 10) || 50;
206
+ } else if (arg.startsWith("--limit=")) {
207
+ limit = parseInt(arg.split("=")[1], 10) || 0;
208
+ } else if (arg === "--limit" && bmArgs[i + 1]) {
209
+ limit = parseInt(bmArgs[++i], 10) || 0;
210
+ } else if (arg === "--dry-run") {
211
+ dryRun = true;
212
+ } else if (arg === "--entities") {
213
+ entities = true;
214
+ }
215
+ }
216
+ try {
217
+ const result = await backfillMetadata({ batchSize, limit, dryRun, entities, exportBatches: false, importDir: "", heuristic: false, stats: false });
218
+ console.log(JSON.stringify(result, null, 2));
219
+ process.exit(result.failed > 0 ? 1 : 0);
220
+ } catch (err) {
221
+ console.error("Backfill failed:", err instanceof Error ? err.message : String(err));
222
+ process.exit(1);
223
+ }
224
+ } else if (args[0] === "export") {
225
+ const { runExeExport } = await import("../exe-export-UZN6EFOR.js");
226
+ await runExeExport(args.slice(1));
227
+ } else if (args[0] === "import") {
228
+ const { runExeImport } = await import("../exe-import-OSM3U36A.js");
229
+ await runExeImport(args.slice(1));
230
+ } else if (args[0] === "import-history") {
231
+ const { runImportHistory } = await import("./import-history.js");
232
+ await runImportHistory(args.slice(1));
233
+ } else if (args[0] === "send-message" || args[0] === "send_message") {
234
+ const target = args[1];
235
+ const msgParts = [];
236
+ let priority = "normal";
237
+ for (let i = 2; i < args.length; i++) {
238
+ if (args[i] === "--priority" && args[i + 1]) {
239
+ priority = args[i + 1];
240
+ i++;
241
+ } else {
242
+ msgParts.push(args[i]);
243
+ }
244
+ }
245
+ const message = msgParts.join(" ");
246
+ if (!target || !message) {
247
+ console.error("Usage: exe-os send-message <target-agent> <message> [--priority urgent]");
248
+ process.exit(1);
249
+ }
250
+ const { initStore } = await import("../lib/store.js");
251
+ await initStore();
252
+ const { sendMessage } = await import("../lib/messaging.js");
253
+ const { getActiveAgent } = await import("../active-agent-GJDG4CAW.js");
254
+ const { agentId } = getActiveAgent();
255
+ const result = await sendMessage({
256
+ fromAgent: agentId,
257
+ targetAgent: target,
258
+ content: message,
259
+ priority
260
+ });
261
+ console.log(`Message sent to ${target}: ${result.status}
262
+ ID: ${result.id}`);
263
+ } else if (args[0] === "rename") {
264
+ process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
265
+ const { main: runRename } = await import("./exe-rename.js");
266
+ await runRename();
267
+ } else if (args[0] === "--activate" || args[0] === "activate") {
268
+ await runActivate(args[1]);
269
+ } else if (args[0] === "doctor") {
270
+ if (args.includes("--drift")) {
271
+ const { runDrift } = await import("../exe-drift-2KHRPBUK.js");
272
+ await runDrift(args.slice(1));
273
+ } else {
274
+ const { runCcDoctor } = await import("./cc-doctor.js");
275
+ const { results, failed } = runCcDoctor();
276
+ console.log("\n exe-os doctor\n");
277
+ for (const r of results) {
278
+ const icon = r.pass ? "\x1B[32m\u2713\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
279
+ console.log(` ${icon} ${r.name}: ${r.detail}`);
280
+ }
281
+ console.log(failed === 0 ? "\n \x1B[32mAll checks passed\x1B[0m\n" : `
282
+ \x1B[31m${failed} issue(s) found\x1B[0m
283
+ `);
284
+ process.exit(failed > 0 ? 1 : 0);
285
+ }
286
+ } else if (args[0] === "backup") {
287
+ const sub = args[1];
288
+ const { listBackups, createBackup, restoreBackup } = await import("../db-backup-MSQKO6M5.js");
289
+ if (sub === "list" || !sub) {
290
+ const backups = listBackups();
291
+ if (backups.length === 0) {
292
+ console.log("No backups found.");
293
+ } else {
294
+ console.log(`
295
+ Available backups (${backups.length}):
296
+ `);
297
+ for (const b of backups) {
298
+ const age = Math.round((Date.now() - b.date.getTime()) / 36e5);
299
+ console.log(` ${b.name} (${(b.size / 1024).toFixed(1)} KB, ${age}h ago)`);
300
+ }
301
+ console.log(`
302
+ Restore with: exe-os backup restore [name]
303
+ `);
304
+ }
305
+ } else if (sub === "create") {
306
+ const reason = args[2] || "manual";
307
+ const result = createBackup(reason);
308
+ if (result) {
309
+ console.log(`Backup created: ${path.basename(result)}`);
310
+ } else {
311
+ console.error("No active database found to back up.");
312
+ process.exit(1);
313
+ }
314
+ } else if (sub === "restore") {
315
+ const backups = listBackups();
316
+ let target;
317
+ if (args[2]) {
318
+ const match = backups.find((b) => b.name === args[2] || b.name.includes(args[2]));
319
+ if (!match) {
320
+ console.error(`Backup not found: ${args[2]}`);
321
+ console.error("Run 'exe-os backup list' to see available backups.");
322
+ process.exit(1);
323
+ }
324
+ target = match.path;
325
+ }
326
+ const result = restoreBackup(target);
327
+ if (result) {
328
+ console.log(`Restored: ${result.restored}`);
329
+ if (result.preRestoreBackup) {
330
+ console.log(`Pre-restore snapshot saved: ${path.basename(result.preRestoreBackup)}`);
331
+ }
332
+ console.log("Restart the daemon for changes to take effect: exe-os daemon restart");
333
+ } else {
334
+ console.error("No backup available to restore.");
335
+ process.exit(1);
336
+ }
337
+ } else {
338
+ console.error(`Unknown backup command: ${sub}`);
339
+ console.error("Usage: exe-os backup [list|create|restore]");
340
+ process.exit(1);
341
+ }
342
+ } else if (args[0] === "setup" || args[0] === "-setup" || args[0] === "--setup") {
343
+ const { runSetupWizard } = await import("../setup-wizard-RBUTEZB2.js");
344
+ await runSetupWizard({ skipModel: args.includes("--skip-model") });
345
+ } else if (args[0] === "update") {
346
+ const { runUpdate } = await import("./update.js");
347
+ await runUpdate(args.slice(1));
348
+ } else if (args[0] === "stack-update") {
349
+ const { runStackUpdateCli } = await import("./stack-update.js");
350
+ await runStackUpdateCli(args.slice(1));
351
+ } else if (args[0] === "verify-stack") {
352
+ const { runVerifyStack } = await import("./verify-stack.js");
353
+ const vsArgs = args.slice(1);
354
+ if (vsArgs.includes("--help") || vsArgs.includes("-h")) {
355
+ console.log(`
356
+ Usage: exe-os verify-stack [--compose <path>] [--env <path>]
357
+
358
+ Post-deploy verification \u2014 8 runtime checks after stack-update.
359
+ `);
360
+ process.exit(0);
361
+ }
362
+ const composeIdx = vsArgs.indexOf("--compose");
363
+ const envIdx = vsArgs.indexOf("--env");
364
+ const opts = {};
365
+ if (composeIdx >= 0 && vsArgs[composeIdx + 1]) opts.composeFile = vsArgs[composeIdx + 1];
366
+ if (envIdx >= 0 && vsArgs[envIdx + 1]) opts.envFile = vsArgs[envIdx + 1];
367
+ const report = await runVerifyStack(opts);
368
+ const icons = { pass: "\u2705", fail: "\u274C", warn: "\u26A0\uFE0F ", skip: "\u23ED\uFE0F " };
369
+ console.log("\n\x1B[1mPost-Deploy Verification\x1B[0m\n");
370
+ for (const r of report.results) {
371
+ console.log(` ${icons[r.status] ?? "?"} ${r.check}: ${r.message}`);
372
+ }
373
+ console.log(`
374
+ Pass: ${report.passed} Fail: ${report.failed} Warn: ${report.warned} Skip: ${report.skipped}
375
+ `);
376
+ process.exit(report.failed > 0 ? 1 : 0);
377
+ } else if (args[0] === "snapshot") {
378
+ const { main: runSnapshot } = await import("../exe-snapshot-7TQIN7XI.js");
379
+ await runSnapshot(args.slice(1));
380
+ } else if (args[0] === "boot") {
381
+ const { projectBoot, parseBootArgs } = await import("../project-boot-JIGOSGCN.js");
382
+ const bootOpts = parseBootArgs(args.slice(1));
383
+ console.log(await projectBoot(bootOpts));
384
+ } else if (args[0] === "brand") {
385
+ const configIdx = args.indexOf("--config");
386
+ if (configIdx === -1 || !args[configIdx + 1]) {
387
+ const { loadBranding, BRANDING_PATH } = await import("../branding-I2TDZFUH.js");
388
+ const b = loadBranding();
389
+ console.log(`
390
+ Brand: ${b.name}`);
391
+ console.log(` Primary: ${b.primaryColor} Accent: ${b.accentColor}`);
392
+ if (b.domain) console.log(` Domain: ${b.domain}`);
393
+ console.log(` Config: ${BRANDING_PATH}
394
+ `);
395
+ } else {
396
+ const configPath = args[configIdx + 1];
397
+ const { existsSync: ex, readFileSync: rf } = await import("fs");
398
+ if (!ex(configPath)) {
399
+ console.error(`
400
+ File not found: ${configPath}
401
+ `);
402
+ process.exit(1);
403
+ }
404
+ try {
405
+ const raw = JSON.parse(rf(configPath, "utf-8"));
406
+ const { validateBranding, saveBranding } = await import("../branding-I2TDZFUH.js");
407
+ const result = validateBranding(raw);
408
+ if (!result.valid) {
409
+ console.error(`
410
+ Validation errors:
411
+ ${result.errors.map((e) => ` - ${e}`).join("\n")}
412
+ `);
413
+ process.exit(1);
414
+ }
415
+ saveBranding(result.config);
416
+ console.log(`
417
+ Branding saved: ${result.config.name}`);
418
+ console.log(` Primary: ${result.config.primaryColor} Accent: ${result.config.accentColor}
419
+ `);
420
+ } catch (err) {
421
+ console.error(`
422
+ Invalid JSON: ${err instanceof Error ? err.message : String(err)}
423
+ `);
424
+ process.exit(1);
425
+ }
426
+ }
427
+ } else if (args[0] === "registry-proxy") {
428
+ const { main: runRegistryProxy } = await import("./registry-proxy.js");
429
+ await runRegistryProxy(args.slice(1));
430
+ } else if (args.includes("--tui") || args.includes("--demo") || args[0] === "tui") {
431
+ checkForUpdateOnBoot().catch(() => {
432
+ });
433
+ await import("../tui/App.js");
434
+ } else {
435
+ const claudeDir = path.join(os.homedir(), ".claude");
436
+ const settingsPath = path.join(claudeDir, "settings.json");
437
+ const hasClaudeCode = existsSync(settingsPath) && (() => {
438
+ try {
439
+ const raw = readFileSync(settingsPath, "utf8");
440
+ return raw.includes("exe-os") || raw.includes("exe-mem");
441
+ } catch {
442
+ return false;
443
+ }
444
+ })();
445
+ if (hasClaudeCode) {
446
+ const { DEFAULT_COORDINATOR_TEMPLATE_NAME } = await import("../lib/employees.js");
447
+ let cooName = DEFAULT_COORDINATOR_TEMPLATE_NAME;
448
+ try {
449
+ const rosterPath = path.join(os.homedir(), ".exe-os", "exe-employees.json");
450
+ if (existsSync(rosterPath)) {
451
+ const roster = JSON.parse(readFileSync(rosterPath, "utf8"));
452
+ const coo = roster.find((e) => e.role === "COO");
453
+ if (coo) cooName = coo.name;
454
+ }
455
+ } catch {
456
+ }
457
+ console.log(`
458
+ \x1B[1mexe-os\x1B[0m \u2014 AI Employee Operating System
459
+
460
+ \x1B[33mMode 1 detected:\x1B[0m Claude Code integration is installed.
461
+ cd into a project folder and run \x1B[1m${cooName}1\x1B[0m to boot your COO.
462
+
463
+ \x1B[2mCommands:\x1B[0m
464
+ ${cooName}1 Launch COO in project folder
465
+ exe-os update Check for and install updates
466
+ exe-os setup Re-run setup wizard
467
+ exe-os cloud status Show cloud connection status
468
+ exe-os cloud sync Run sync now (normally automatic)
469
+ exe-os cloud link Show recovery phrase + cloud info for a new device
470
+ exe-os cloud reupload Re-upload cloud backup after key rotation
471
+ exe-os key status Check whether encrypted memory opens
472
+ exe-os key rotate Guided key rotation + automatic cloud re-upload
473
+ exe-os key update Update this device/server after key rotation
474
+ exe-os jobs status Show background jobs/backfills
475
+ exe-os jobs cancel Stop a background job safely
476
+ exe-os org phase Show/change orchestration phase
477
+ exe-os org unlock executives Move from COO mode to executive bench
478
+ exe-os org unlock parallel Move to parallel execution org
479
+ exe-os claude check Verify Claude Code integration
480
+ exe-os claude mcp-doctor Diagnose Claude MCP tool visibility
481
+ exe-os tui Launch TUI dashboard (Mode 2)
482
+ exe-os --help Show all commands
483
+ `);
484
+ } else {
485
+ checkForUpdateOnBoot().catch(() => {
486
+ });
487
+ await import("../tui/App.js");
488
+ }
489
+ }
490
+ async function runCodeContext(ccArgs) {
491
+ const { buildCodeContextIndex, getCodeContextStats, searchCodeContext } = await import("../code-context-index-KHUYATRB.js");
492
+ const sub = ccArgs[0] ?? "status";
493
+ const projectRoot = valueAfter(ccArgs, "--project-root") ?? process.cwd();
494
+ if (sub === "init" || sub === "index") {
495
+ const force = ccArgs.includes("--force") || ccArgs.includes("--refresh");
496
+ const index = buildCodeContextIndex({ projectRoot, force });
497
+ console.log(JSON.stringify({ projectRoot: index.projectRoot, branch: index.branch, indexedAt: index.indexedAt, files: Object.keys(index.files).length, symbols: Object.values(index.files).reduce((sum, f) => sum + f.symbols.length, 0), languageBreakdown: index.stats.languageBreakdown, rebuiltFiles: index.stats.rebuiltFiles, reusedFiles: index.stats.reusedFiles }, null, 2));
498
+ return;
499
+ }
500
+ if (sub === "status" || sub === "stats") {
501
+ console.log(JSON.stringify(getCodeContextStats({ projectRoot }), null, 2));
502
+ return;
503
+ }
504
+ if (sub === "search") {
505
+ const query = valueAfter(ccArgs, "--query") ?? positionalSearchQuery(ccArgs.slice(1));
506
+ if (!query) {
507
+ console.error("Usage: exe-os code-context search <query> [--limit N] [--offset N] [--language python] [--path 'src/**'] [--refresh]");
508
+ process.exit(1);
509
+ }
510
+ const languageFilters = [...valuesAfter(ccArgs, "--language") ?? [], ...valuesAfter(ccArgs, "--languages") ?? []];
511
+ const pathFilters = [...valuesAfter(ccArgs, "--path") ?? [], ...valuesAfter(ccArgs, "--paths") ?? []];
512
+ const results = searchCodeContext(query, {
513
+ projectRoot,
514
+ limit: numberAfter(ccArgs, "--limit") ?? 20,
515
+ offset: numberAfter(ccArgs, "--offset") ?? 0,
516
+ refreshIndex: ccArgs.includes("--refresh") || ccArgs.includes("--refresh-index"),
517
+ languages: languageFilters.length > 0 ? languageFilters : void 0,
518
+ paths: pathFilters.length > 0 ? pathFilters : void 0
519
+ });
520
+ console.log(JSON.stringify({ query, results }, null, 2));
521
+ return;
522
+ }
523
+ if (sub === "doctor") {
524
+ const stats = getCodeContextStats({ projectRoot });
525
+ console.log(JSON.stringify({ ok: stats.files > 0, ...stats }, null, 2));
526
+ process.exit(stats.files > 0 ? 0 : 1);
527
+ }
528
+ console.error("Usage: exe-os code-context init|index|status|stats|search|doctor");
529
+ process.exit(1);
530
+ }
531
+ function positionalSearchQuery(args2) {
532
+ const valueFlags = /* @__PURE__ */ new Set(["--project-root", "--limit", "--offset", "--language", "--languages", "--path", "--paths", "--query"]);
533
+ const parts = [];
534
+ for (let i = 0; i < args2.length; i++) {
535
+ const arg = args2[i];
536
+ if (valueFlags.has(arg)) {
537
+ i++;
538
+ continue;
539
+ }
540
+ if (arg.startsWith("--")) continue;
541
+ parts.push(arg);
542
+ }
543
+ return parts.join(" ").trim();
544
+ }
545
+ function valueAfter(args2, flag) {
546
+ const i = args2.indexOf(flag);
547
+ if (i >= 0) return args2[i + 1];
548
+ const prefixed = args2.find((arg) => arg.startsWith(`${flag}=`));
549
+ return prefixed?.slice(flag.length + 1);
550
+ }
551
+ function valuesAfter(args2, flag) {
552
+ const values = [];
553
+ for (let i = 0; i < args2.length; i++) {
554
+ const arg = args2[i];
555
+ if (arg === flag && args2[i + 1]) values.push(args2[++i]);
556
+ else if (arg.startsWith(`${flag}=`)) values.push(arg.slice(flag.length + 1));
557
+ }
558
+ return values.length > 0 ? values.flatMap((v) => v.split(",").map((s) => s.trim()).filter(Boolean)) : void 0;
559
+ }
560
+ function numberAfter(args2, flag) {
561
+ const value = valueAfter(args2, flag);
562
+ if (!value) return void 0;
563
+ const parsed = Number(value);
564
+ return Number.isFinite(parsed) ? parsed : void 0;
565
+ }
566
+ async function runClaudeInstall() {
567
+ const { runInstaller } = await import("../installer-UAMA6ZVH.js");
568
+ try {
569
+ await runInstaller();
570
+ } catch (err) {
571
+ console.error(
572
+ "Installation failed:",
573
+ err instanceof Error ? err.message : String(err)
574
+ );
575
+ process.exit(1);
576
+ }
577
+ }
578
+ async function runOpenCodeInstall() {
579
+ const { runOpenCodeInstaller } = await import("../installer-OBYQ6O3C.js");
580
+ try {
581
+ await runOpenCodeInstaller();
582
+ } catch (err) {
583
+ console.error(
584
+ "OpenCode installation failed:",
585
+ err instanceof Error ? err.message : String(err)
586
+ );
587
+ process.exit(1);
588
+ }
589
+ }
590
+ async function runCodexInstall() {
591
+ const { runCodexInstaller } = await import("../installer-GMIVB2JS.js");
592
+ try {
593
+ await runCodexInstaller();
594
+ } catch (err) {
595
+ console.error(
596
+ "Codex hook installation failed:",
597
+ err instanceof Error ? err.message : String(err)
598
+ );
599
+ process.exit(1);
600
+ }
601
+ }
602
+ async function runClaudeCheck() {
603
+ const { detectMcpNameCollisions } = await import("../installer-UAMA6ZVH.js");
604
+ const claudeDir = path.join(os.homedir(), ".claude");
605
+ const settingsPath = path.join(claudeDir, "settings.json");
606
+ const claudeJsonPath = path.join(os.homedir(), ".claude.json");
607
+ let ok = true;
608
+ if (existsSync(settingsPath)) {
609
+ let settings;
610
+ try {
611
+ settings = JSON.parse(readFileSync(settingsPath, "utf8"));
612
+ } catch {
613
+ console.log("\x1B[31m\u2717\x1B[0m settings.json is malformed (invalid JSON)");
614
+ ok = false;
615
+ settings = {};
616
+ }
617
+ const hasHooks = settings.hooks && Object.keys(settings.hooks).some((k) => {
618
+ const groups = settings.hooks[k];
619
+ return Array.isArray(groups) && groups.some((g) => {
620
+ const hooks = g.hooks;
621
+ if (!Array.isArray(hooks)) return false;
622
+ return hooks.some(
623
+ (h) => typeof h.command === "string" && h.command.includes("exe-os")
624
+ );
625
+ });
626
+ });
627
+ if (hasHooks) {
628
+ console.log("\x1B[32m\u2713\x1B[0m Hooks registered in settings.json");
629
+ } else {
630
+ console.log("\x1B[31m\u2717\x1B[0m No exe-os hooks found in settings.json");
631
+ ok = false;
632
+ }
633
+ } else {
634
+ console.log("\x1B[31m\u2717\x1B[0m settings.json not found");
635
+ ok = false;
636
+ }
637
+ if (existsSync(claudeJsonPath)) {
638
+ let claudeJson;
639
+ try {
640
+ claudeJson = JSON.parse(readFileSync(claudeJsonPath, "utf8"));
641
+ } catch {
642
+ console.log("\x1B[31m\u2717\x1B[0m claude.json is malformed (invalid JSON)");
643
+ ok = false;
644
+ claudeJson = {};
645
+ }
646
+ const hasMcp = claudeJson.mcpServers && (claudeJson.mcpServers["exe-mem"] || claudeJson.mcpServers["exe-os"]);
647
+ if (hasMcp) {
648
+ console.log("\x1B[32m\u2713\x1B[0m MCP server configured in claude.json");
649
+ } else {
650
+ console.log(
651
+ "\x1B[31m\u2717\x1B[0m No exe-os MCP server found in claude.json"
652
+ );
653
+ ok = false;
654
+ }
655
+ } else {
656
+ console.log("\x1B[31m\u2717\x1B[0m claude.json not found");
657
+ ok = false;
658
+ }
659
+ const collisions = detectMcpNameCollisions(os.homedir(), process.cwd());
660
+ const disabledCollisions = collisions.filter((c) => c.disabledInMcpJson);
661
+ if (disabledCollisions.length > 0) {
662
+ console.log("\x1B[31m\u2717\x1B[0m MCP name collision: disabled .mcp.json entries shadow project MCP servers");
663
+ for (const c of disabledCollisions) {
664
+ console.log(` - ${c.serverName}: ${c.mcpJsonPath} shadows ~/.claude.json project ${c.projectPath}`);
665
+ }
666
+ console.log(" Fix: remove/rename the duplicate .mcp.json server entry, or use one MCP config source of truth.");
667
+ ok = false;
668
+ } else if (collisions.length > 0) {
669
+ console.log("\x1B[33m!\x1B[0m MCP server names duplicated between .mcp.json and project config");
670
+ } else {
671
+ console.log("\x1B[32m\u2713\x1B[0m No .mcp.json/project MCP name collisions detected");
672
+ }
673
+ const skillsDir = path.join(claudeDir, "skills");
674
+ if (existsSync(skillsDir)) {
675
+ console.log("\x1B[32m\u2713\x1B[0m Slash skills directory exists");
676
+ } else {
677
+ console.log("\x1B[31m\u2717\x1B[0m Slash skills directory missing");
678
+ ok = false;
679
+ }
680
+ if (!ok) {
681
+ console.log("\nRun \x1B[36mexe-os claude install\x1B[0m to fix.");
682
+ process.exit(1);
683
+ } else {
684
+ console.log("\nAll checks passed.");
685
+ }
686
+ }
687
+ async function runClaudeMcpDoctor() {
688
+ const { diagnoseClaudeMcpConfig, formatMcpDiagnosticReport } = await import("../mcp-diagnostics-5T5OZ52S.js");
689
+ const report = diagnoseClaudeMcpConfig(os.homedir(), process.cwd(), process.env);
690
+ console.log(formatMcpDiagnosticReport(report));
691
+ const hasError = report.issues.some((issue) => issue.severity === "error");
692
+ process.exit(hasError ? 1 : 0);
693
+ }
694
+ async function runClaudeUninstall(flags = []) {
695
+ const dryRun = flags.includes("--dry-run");
696
+ const purge = flags.includes("--purge");
697
+ const homeDir = os.homedir();
698
+ const claudeDir = path.join(homeDir, ".claude");
699
+ const settingsPath = path.join(claudeDir, "settings.json");
700
+ const claudeJsonPath = path.join(homeDir, ".claude.json");
701
+ const exeOsDir = path.join(homeDir, ".exe-os");
702
+ let removed = 0;
703
+ const log = (msg) => console.log(dryRun ? `[dry-run] ${msg}` : msg);
704
+ let settings = {};
705
+ if (existsSync(settingsPath)) {
706
+ try {
707
+ settings = JSON.parse(readFileSync(settingsPath, "utf8"));
708
+ } catch {
709
+ console.error("Your ~/.claude/settings.json appears malformed.");
710
+ if (purge) {
711
+ console.error("Skipping settings cleanup (--purge).");
712
+ } else {
713
+ console.error("Try running: exe-os claude install");
714
+ process.exit(1);
715
+ }
716
+ }
717
+ if (settings.hooks) {
718
+ for (const key of Object.keys(settings.hooks)) {
719
+ const groups = settings.hooks[key];
720
+ if (!Array.isArray(groups)) continue;
721
+ settings.hooks[key] = groups.map((g) => {
722
+ if (!Array.isArray(g.hooks)) return g;
723
+ return {
724
+ ...g,
725
+ hooks: g.hooks.filter(
726
+ (h) => !(typeof h.command === "string" && (h.command.includes("exe-os") || h.command.includes("askexenow") || h.command.includes("exe-mem")))
727
+ )
728
+ };
729
+ }).filter(
730
+ (g) => !Array.isArray(g.hooks) || g.hooks.length > 0
731
+ );
732
+ if (settings.hooks[key].length === 0) {
733
+ delete settings.hooks[key];
734
+ }
735
+ }
736
+ let permCount = 0;
737
+ if (Array.isArray(settings.permissions?.allow)) {
738
+ const before = settings.permissions.allow.length;
739
+ settings.permissions.allow = settings.permissions.allow.filter(
740
+ (p) => !p.startsWith("mcp__exe-mem__") && !p.startsWith("mcp__exe-os__")
741
+ );
742
+ permCount = before - settings.permissions.allow.length;
743
+ }
744
+ if (!dryRun) {
745
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
746
+ }
747
+ log("\u2713 Removed exe-os hooks from settings.json");
748
+ if (permCount > 0) log(`\u2713 Removed ${permCount} MCP permission entries`);
749
+ removed++;
750
+ }
751
+ }
752
+ if (existsSync(claudeJsonPath)) {
753
+ const raw = readFileSync(claudeJsonPath, "utf8");
754
+ if (raw.length > 1e6) {
755
+ console.error("claude.json exceeds 1 MB \u2014 skipping parse.");
756
+ } else {
757
+ let claudeJson;
758
+ try {
759
+ claudeJson = JSON.parse(raw);
760
+ } catch {
761
+ console.error("claude.json is malformed JSON \u2014 skipping.");
762
+ claudeJson = {};
763
+ }
764
+ if (claudeJson.mcpServers) {
765
+ let removedMcp = false;
766
+ for (const key of ["exe-mem", "exe-os"]) {
767
+ if (claudeJson.mcpServers[key]) {
768
+ if (!dryRun) delete claudeJson.mcpServers[key];
769
+ removedMcp = true;
770
+ }
771
+ }
772
+ if (removedMcp) {
773
+ if (!dryRun) {
774
+ writeFileSync(claudeJsonPath, JSON.stringify(claudeJson, null, 2) + "\n");
775
+ }
776
+ log("\u2713 Removed exe-os MCP server from claude.json");
777
+ removed++;
778
+ }
779
+ }
780
+ }
781
+ }
782
+ const skillsDir = path.join(claudeDir, "skills");
783
+ if (existsSync(skillsDir)) {
784
+ let skillCount = 0;
785
+ try {
786
+ const entries = readdirSync(skillsDir);
787
+ for (const entry of entries) {
788
+ if (entry.startsWith("exe")) {
789
+ const fullPath = path.join(skillsDir, entry);
790
+ if (!dryRun) rmSync(fullPath, { recursive: true, force: true });
791
+ skillCount++;
792
+ }
793
+ }
794
+ } catch {
795
+ }
796
+ if (skillCount > 0) {
797
+ log(`\u2713 Removed ${skillCount} skill directories`);
798
+ removed++;
799
+ }
800
+ }
801
+ const claudeMdPath = path.join(claudeDir, "CLAUDE.md");
802
+ if (existsSync(claudeMdPath)) {
803
+ const content = readFileSync(claudeMdPath, "utf8");
804
+ const startMarker = "<!-- exe-os:orchestration-start -->";
805
+ const endMarker = "<!-- exe-os:orchestration-end -->";
806
+ const startIdx = content.indexOf(startMarker);
807
+ const endIdx = content.indexOf(endMarker);
808
+ if (startIdx !== -1 && endIdx !== -1) {
809
+ const cleaned = (content.slice(0, startIdx) + content.slice(endIdx + endMarker.length)).replace(/\n{3,}/g, "\n\n").trim() + "\n";
810
+ if (!dryRun) writeFileSync(claudeMdPath, cleaned);
811
+ log("\u2713 Removed orchestration block from CLAUDE.md");
812
+ removed++;
813
+ }
814
+ }
815
+ const agentsDir = path.join(claudeDir, "agents");
816
+ if (existsSync(agentsDir)) {
817
+ let agentCount = 0;
818
+ try {
819
+ const entries = readdirSync(agentsDir).filter((f) => f.endsWith(".md"));
820
+ let knownNames = /* @__PURE__ */ new Set();
821
+ const rosterPath = path.join(exeOsDir, "exe-employees.json");
822
+ if (existsSync(rosterPath)) {
823
+ try {
824
+ const roster = JSON.parse(readFileSync(rosterPath, "utf8"));
825
+ knownNames = new Set(roster.map((e) => e.name));
826
+ } catch {
827
+ }
828
+ }
829
+ for (const entry of entries) {
830
+ const name = entry.replace(/\.md$/, "");
831
+ if (knownNames.has(name)) {
832
+ if (!dryRun) rmSync(path.join(agentsDir, entry), { force: true });
833
+ agentCount++;
834
+ }
835
+ }
836
+ } catch {
837
+ }
838
+ if (agentCount > 0) {
839
+ log(`\u2713 Removed ${agentCount} agent identity files`);
840
+ removed++;
841
+ }
842
+ }
843
+ const projectsDir = path.join(claudeDir, "projects");
844
+ if (existsSync(projectsDir)) {
845
+ let projectCount = 0;
846
+ try {
847
+ const projects = readdirSync(projectsDir);
848
+ for (const proj of projects) {
849
+ const projSettings = path.join(projectsDir, proj, "settings.json");
850
+ if (!existsSync(projSettings)) continue;
851
+ try {
852
+ const pSettings = JSON.parse(readFileSync(projSettings, "utf8"));
853
+ let changed = false;
854
+ if (Array.isArray(pSettings.permissions?.allow)) {
855
+ const before = pSettings.permissions.allow.length;
856
+ pSettings.permissions.allow = pSettings.permissions.allow.filter(
857
+ (p) => !p.startsWith("mcp__exe-mem__") && !p.startsWith("mcp__exe-os__")
858
+ );
859
+ if (pSettings.permissions.allow.length < before) changed = true;
860
+ }
861
+ if (changed && !dryRun) {
862
+ writeFileSync(projSettings, JSON.stringify(pSettings, null, 2) + "\n");
863
+ }
864
+ if (changed) projectCount++;
865
+ } catch {
866
+ }
867
+ }
868
+ } catch {
869
+ }
870
+ if (projectCount > 0) {
871
+ log(`\u2713 Cleaned exe-os entries from ${projectCount} project settings`);
872
+ removed++;
873
+ }
874
+ }
875
+ try {
876
+ const { execSync } = await import("child_process");
877
+ const findExeBin = () => {
878
+ try {
879
+ return execSync(process.platform === "win32" ? "where exe-os" : "which exe-os", { encoding: "utf8" }).trim();
880
+ } catch {
881
+ return null;
882
+ }
883
+ };
884
+ const exeBinPath = findExeBin();
885
+ if (!exeBinPath) throw new Error("exe-os not found in PATH");
886
+ const binDir = path.dirname(exeBinPath);
887
+ let symlinkCount = 0;
888
+ const rosterPath = path.join(exeOsDir, "exe-employees.json");
889
+ if (existsSync(rosterPath)) {
890
+ const roster = JSON.parse(readFileSync(rosterPath, "utf8"));
891
+ const { DEFAULT_COORDINATOR_TEMPLATE_NAME } = await import("../lib/employees.js");
892
+ const coordinatorName = roster.find((e) => e.role?.toLowerCase() === "coo")?.name ?? DEFAULT_COORDINATOR_TEMPLATE_NAME;
893
+ for (const emp of roster) {
894
+ if (emp.name === coordinatorName) continue;
895
+ for (const suffix of ["", "-opencode"]) {
896
+ const linkPath = path.join(binDir, `${emp.name}${suffix}`);
897
+ if (existsSync(linkPath)) {
898
+ if (!dryRun) rmSync(linkPath, { force: true });
899
+ symlinkCount++;
900
+ }
901
+ }
902
+ }
903
+ }
904
+ if (symlinkCount > 0) {
905
+ log(`\u2713 Removed ${symlinkCount} employee symlinks`);
906
+ removed++;
907
+ }
908
+ } catch {
909
+ }
910
+ if (purge && existsSync(exeOsDir)) {
911
+ if (!dryRun) {
912
+ process.stdout.write("\x1B[33m\u26A0 This will delete all memories, identities, and agent data.\x1B[0m\n");
913
+ process.stdout.write(" Removing ~/.exe-os...\n");
914
+ rmSync(exeOsDir, { recursive: true, force: true });
915
+ }
916
+ log("\u2713 Purged ~/.exe-os data directory");
917
+ removed++;
918
+ }
919
+ if (removed === 0) {
920
+ console.log("Nothing to remove \u2014 exe-os was not installed.");
921
+ } else {
922
+ if (dryRun) {
923
+ console.log("\nDry run complete. Re-run without --dry-run to apply.");
924
+ } else {
925
+ console.log("\nDone. Run \x1B[36mexe-os claude install\x1B[0m to reinstall.");
926
+ }
927
+ }
928
+ }
929
+ async function checkForUpdateOnBoot() {
930
+ try {
931
+ const { loadConfig } = await import("../lib/config.js");
932
+ const config = await loadConfig();
933
+ if (!config.autoUpdate.checkOnBoot) return;
934
+ const { checkForUpdate } = await import("./update.js");
935
+ const packageRoot = path.resolve(
936
+ new URL("../..", import.meta.url).pathname
937
+ );
938
+ const result = checkForUpdate(packageRoot);
939
+ if (result.updateAvailable) {
940
+ process.stderr.write(
941
+ `\x1B[33m[update]\x1B[0m exe-os v${result.remoteVersion} available (current: v${result.localVersion}). Run \x1B[36mexe-os update\x1B[0m to upgrade.
942
+ `
943
+ );
944
+ }
945
+ } catch {
946
+ }
947
+ }
948
+ async function runActivate(key) {
949
+ if (!key) {
950
+ process.stderr.write("Usage: exe-os --activate <license-key>\n");
951
+ process.exit(1);
952
+ }
953
+ const { saveLicense, mirrorLicenseKey, validateLicense } = await import("../lib/license.js");
954
+ const { loadEmployees, saveEmployees, addEmployee, registerBinSymlinks } = await import("../lib/employees.js");
955
+ const { getTemplateByRole } = await import("../lib/employee-templates.js");
956
+ const { getTemplate: getIdentityTemplate } = await import("../lib/identity-templates.js");
957
+ const { identityPath } = await import("../lib/identity.js");
958
+ const { createInterface } = await import("readline");
959
+ const fs = await import("fs");
960
+ saveLicense(key);
961
+ mirrorLicenseKey(key);
962
+ try {
963
+ const license = await validateLicense(key);
964
+ if (!license.valid && license.error === "offline") {
965
+ console.log("\u26A0 Activated in offline mode \u2014 will verify when connected");
966
+ } else if (!license.valid) {
967
+ process.stderr.write(`License invalid: ${license.plan || "unknown"}
968
+ `);
969
+ process.exit(1);
970
+ } else {
971
+ const planLabel = license.plan === "pro" ? "Solopreneur" : license.plan.charAt(0).toUpperCase() + license.plan.slice(1);
972
+ console.log(`Plan activated: ${planLabel}`);
973
+ }
974
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
975
+ const ask = (prompt) => new Promise((resolve) => rl.question(prompt, (a) => resolve(a.trim())));
976
+ let employees = await loadEmployees();
977
+ const existingNames = new Set(employees.map((e) => e.name));
978
+ const createSpecialist = async (role, identityKey) => {
979
+ const template = getTemplateByRole(role);
980
+ if (!template) return;
981
+ const defaultName = template.name;
982
+ if (existingNames.has(defaultName)) return;
983
+ const create = await ask(`Create your ${role}? [Y/n]: `);
984
+ if (create.toLowerCase() === "n") return;
985
+ const nameInput = await ask(`Name your ${role} [${defaultName}]: `);
986
+ const name = nameInput || defaultName;
987
+ const { systemPrompt: _templatePrompt, ...templateMeta } = template;
988
+ const emp = { ...templateMeta, name, createdAt: (/* @__PURE__ */ new Date()).toISOString() };
989
+ employees = addEmployee(employees, emp);
990
+ await saveEmployees(employees);
991
+ registerBinSymlinks(name);
992
+ existingNames.add(name);
993
+ const idTemplate = getIdentityTemplate(identityKey);
994
+ if (idTemplate) {
995
+ const idPath = identityPath(name);
996
+ const dir = path.dirname(idPath);
997
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
998
+ fs.writeFileSync(idPath, idTemplate.replace(/^agent_id: \w+/m, `agent_id: ${name}`), "utf-8");
999
+ }
1000
+ console.log(`Created: ${name} (${role})`);
1001
+ };
1002
+ await createSpecialist("CTO", "cto");
1003
+ await createSpecialist("CMO", "cmo");
1004
+ rl.close();
1005
+ console.log(`${employees.length} employees active.`);
1006
+ } catch (err) {
1007
+ process.stderr.write(`Activation failed: ${err instanceof Error ? err.message : String(err)}
1008
+ `);
1009
+ process.exit(1);
1010
+ }
1011
+ }
1012
+ async function runCloudSync() {
1013
+ const { loadConfig } = await import("../lib/config.js");
1014
+ const config = await loadConfig();
1015
+ if (!config.cloud?.apiKey) {
1016
+ console.error("Cloud sync is not configured. Run \x1B[36mexe-os cloud\x1B[0m to set up.");
1017
+ process.exit(1);
1018
+ }
1019
+ const { initStore, disposeStore } = await import("../lib/store.js");
1020
+ const { cloudSync } = await import("../lib/cloud-sync.js");
1021
+ const { getMasterKey } = await import("../lib/keychain.js");
1022
+ const { initSyncCrypto } = await import("../lib/crypto.js");
1023
+ await initStore();
1024
+ const masterKey = await getMasterKey();
1025
+ if (masterKey) {
1026
+ initSyncCrypto(masterKey);
1027
+ } else {
1028
+ console.error("No encryption key found. Run \x1B[36mexe-os setup\x1B[0m first.");
1029
+ await disposeStore();
1030
+ process.exit(1);
1031
+ }
1032
+ console.log("Syncing with Exe Cloud now... (Normally this runs automatically in the background.)");
1033
+ try {
1034
+ const result = await cloudSync(config.cloud);
1035
+ console.log("");
1036
+ console.log(` Active memories: ${result.totalMemories} (\u2191 ${result.pushed} syncable rows pushed, \u2193 ${result.pulled} pulled)`);
1037
+ console.log(` Behaviors: ${result.behaviors.pushed} total (\u2193 ${result.behaviors.pulled} pulled)`);
1038
+ console.log(` Roster: ${result.roster.employees} employees, ${result.roster.identities} identities`);
1039
+ console.log(` Tasks: ${result.tasks.pushed} total (\u2193 ${result.tasks.pulled} pulled)`);
1040
+ console.log(` Conversations: ${result.conversations.pushed} total (\u2193 ${result.conversations.pulled} pulled)`);
1041
+ console.log(` Documents: ${result.documents.pushed} total (\u2193 ${result.documents.pulled} pulled)`);
1042
+ console.log(` GraphRAG: ${result.graphrag.pushed} entities`);
1043
+ console.log("\n\x1B[32mSync complete.\x1B[0m");
1044
+ } catch (err) {
1045
+ const message = err instanceof Error ? err.message : String(err);
1046
+ if (message.includes("Cloud sync is blocked because this device rotated")) {
1047
+ console.error("\nCloud sync is blocked for safety.");
1048
+ console.error("This device changed its memory encryption key, so Exe Cloud must be re-uploaded with the new key first.");
1049
+ console.error("Run: exe-os cloud reupload");
1050
+ } else {
1051
+ console.error(`Sync failed: ${message}`);
1052
+ }
1053
+ process.exit(1);
1054
+ } finally {
1055
+ await disposeStore();
1056
+ }
1057
+ }
1058
+ function parseBackfillArgs(argv) {
1059
+ let days = 30;
1060
+ let projectFilter;
1061
+ let dryRun = false;
1062
+ for (let i = 0; i < argv.length; i++) {
1063
+ switch (argv[i]) {
1064
+ case "--days":
1065
+ days = parseInt(argv[++i] ?? "30", 10) || 30;
1066
+ break;
1067
+ case "--project":
1068
+ projectFilter = argv[++i] ?? void 0;
1069
+ break;
1070
+ case "--dry-run":
1071
+ dryRun = true;
1072
+ break;
1073
+ }
1074
+ }
1075
+ return { days, projectFilter, dryRun };
1076
+ }