trybeacon 0.1.66 → 0.1.68

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 (392) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-path-routes-manifest.json +8 -12
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -27
  6. package/.next/routes-manifest.json +0 -28
  7. package/.next/server/app/_global-error/page.js +3 -3
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +11 -11
  21. package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  22. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  28. package/.next/server/app/api/board-annotations/route.js +1 -1
  29. package/.next/server/app/api/board-layout/route.js +1 -1
  30. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  31. package/.next/server/app/api/bug-flags/route.js +1 -1
  32. package/.next/server/app/api/code-graph/position/route.js +1 -1
  33. package/.next/server/app/api/code-graph/route.js +1 -1
  34. package/.next/server/app/api/context/feature/route.js +1 -1
  35. package/.next/server/app/api/context/file/route.js +1 -1
  36. package/.next/server/app/api/context/route.js +1 -1
  37. package/.next/server/app/api/db/arrange/route.js +1 -1
  38. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  39. package/.next/server/app/api/db/position/route.js +1 -1
  40. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  41. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  42. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  43. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  44. package/.next/server/app/api/draft/approve/route.js +1 -1
  45. package/.next/server/app/api/draft/route.js +1 -1
  46. package/.next/server/app/api/draft/status/route.js +1 -1
  47. package/.next/server/app/api/edges/[id]/route.js +1 -1
  48. package/.next/server/app/api/edges/route.js +1 -1
  49. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  50. package/.next/server/app/api/entities/route.js +1 -1
  51. package/.next/server/app/api/flags/route.js +1 -1
  52. package/.next/server/app/api/ingest/route.js +2 -2
  53. package/.next/server/app/api/init/route.js +2 -2
  54. package/.next/server/app/api/lesson/close/route.js +1 -1
  55. package/.next/server/app/api/lesson/presence/route.js +1 -1
  56. package/.next/server/app/api/lesson/questions/route.js +1 -1
  57. package/.next/server/app/api/lesson/route.js +1 -1
  58. package/.next/server/app/api/lesson/save/route.js +1 -1
  59. package/.next/server/app/api/lesson/verdict/route.js +1 -1
  60. package/.next/server/app/api/map/describe/route.js +2 -2
  61. package/.next/server/app/api/map/files/route.js +1 -1
  62. package/.next/server/app/api/map/finish/route.js +1 -1
  63. package/.next/server/app/api/map/route.js +1 -1
  64. package/.next/server/app/api/map/start/route.js +1 -1
  65. package/.next/server/app/api/map/touch-active/route.js +1 -1
  66. package/.next/server/app/api/mention-search/route.js +1 -1
  67. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  68. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  69. package/.next/server/app/api/nodes/positions/route.js +1 -1
  70. package/.next/server/app/api/nodes/route.js +1 -1
  71. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  72. package/.next/server/app/api/notes/[id]/route.js +1 -1
  73. package/.next/server/app/api/notes/route.js +1 -1
  74. package/.next/server/app/api/open/route.js +1 -1
  75. package/.next/server/app/api/plan/annotations/route.js +3 -3
  76. package/.next/server/app/api/plan/approve/route.js +2 -2
  77. package/.next/server/app/api/plan/history/route.js +1 -1
  78. package/.next/server/app/api/plan/markdown/route.js +1 -1
  79. package/.next/server/app/api/plan/presence/route.js +1 -1
  80. package/.next/server/app/api/plan/route.js +1 -1
  81. package/.next/server/app/api/plan/verdict/route.js +1 -1
  82. package/.next/server/app/api/preferences/route.js +1 -1
  83. package/.next/server/app/api/project-meta/route.js +1 -1
  84. package/.next/server/app/api/reset/route.js +1 -1
  85. package/.next/server/app/api/scope-guard/check/route.js +1 -1
  86. package/.next/server/app/api/share/create/route.js +1 -1
  87. package/.next/server/app/api/share/route.js +1 -1
  88. package/.next/server/app/api/share/route.js.nft.json +1 -1
  89. package/.next/server/app/api/stream/route.js +2 -2
  90. package/.next/server/app/api/tab/nav/route.js +1 -1
  91. package/.next/server/app/api/tab/presence/route.js +1 -1
  92. package/.next/server/app/api/telemetry/route.js +1 -1
  93. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  94. package/.next/server/app/api/version/route.js +1 -1
  95. package/.next/server/app/api/workspace/activate/route.js +1 -1
  96. package/.next/server/app/api/workspace/route.js +1 -1
  97. package/.next/server/app/apple-icon.png/route.js +1 -1
  98. package/.next/server/app/docs/page.js +2 -2
  99. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  100. package/.next/server/app/docs.html +1 -1
  101. package/.next/server/app/docs.rsc +12 -12
  102. package/.next/server/app/docs.segments/_full.segment.rsc +12 -12
  103. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  104. package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
  105. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  106. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
  107. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  108. package/.next/server/app/help/page.js +2 -2
  109. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/help.html +1 -1
  111. package/.next/server/app/help.rsc +11 -11
  112. package/.next/server/app/help.segments/_full.segment.rsc +11 -11
  113. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  114. package/.next/server/app/help.segments/_index.segment.rsc +11 -11
  115. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  116. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  117. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  118. package/.next/server/app/icon.svg/route.js +1 -1
  119. package/.next/server/app/index.html +1 -1
  120. package/.next/server/app/index.rsc +12 -12
  121. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  122. package/.next/server/app/index.segments/_full.segment.rsc +12 -12
  123. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  124. package/.next/server/app/index.segments/_index.segment.rsc +11 -11
  125. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  126. package/.next/server/app/learn/page.js +5 -3
  127. package/.next/server/app/learn/page.js.nft.json +1 -1
  128. package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
  129. package/.next/server/app/map/page.js +2 -2
  130. package/.next/server/app/map/page.js.nft.json +1 -1
  131. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  132. package/.next/server/app/page.js +2 -2
  133. package/.next/server/app/page.js.nft.json +1 -1
  134. package/.next/server/app/page_client-reference-manifest.js +1 -1
  135. package/.next/server/app/plan/page.js +2 -2
  136. package/.next/server/app/plan/page.js.nft.json +1 -1
  137. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  138. package/.next/server/app/s/[token]/page.js +2 -2
  139. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  140. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  141. package/.next/server/app/settings/page.js +2 -2
  142. package/.next/server/app/settings/page.js.nft.json +1 -1
  143. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  144. package/.next/server/app-paths-manifest.json +8 -12
  145. package/.next/server/chunks/2025.js +1 -0
  146. package/.next/server/chunks/2773.js +1 -0
  147. package/.next/server/chunks/2994.js +2 -0
  148. package/.next/server/chunks/4046.js +3 -3
  149. package/.next/server/chunks/4307.js +1 -1
  150. package/.next/server/chunks/5719.js +1 -0
  151. package/.next/server/chunks/6709.js +1 -0
  152. package/.next/server/chunks/7720.js +154 -0
  153. package/.next/server/middleware-build-manifest.js +1 -1
  154. package/.next/server/middleware.js +1 -1
  155. package/.next/server/pages/404.html +1 -1
  156. package/.next/server/pages/500.html +1 -1
  157. package/.next/server/server-reference-manifest.js +1 -1
  158. package/.next/server/server-reference-manifest.json +1 -1
  159. package/.next/static/ZEJwYPSMMES2UlUBBgBmw/_buildManifest.js +1 -0
  160. package/.next/static/chunks/1a258343-954e0e6619585d3c.js +2 -0
  161. package/.next/static/chunks/2059-fba06ba63ba64522.js +62 -0
  162. package/.next/static/chunks/4607-a668ea431c41e60e.js +1 -0
  163. package/.next/static/chunks/4853-6dc402b4ce452fa5.js +1 -0
  164. package/.next/static/chunks/{7043-254590cf9891391f.js → 4888-911c0da3c2d785d2.js} +1 -1
  165. package/.next/static/chunks/5957-83f611fcd5a08b45.js +1 -0
  166. package/.next/static/chunks/6371-9ebaddaf512402a4.js +1 -0
  167. package/.next/static/chunks/766-242213d211df0afd.js +1 -0
  168. package/.next/static/chunks/8997-78a359d0d238622e.js +1 -0
  169. package/.next/static/chunks/app/_global-error/page-93569b5eb93a61e9.js +1 -0
  170. package/.next/static/chunks/app/api/board-annotations/[id]/route-93569b5eb93a61e9.js +1 -0
  171. package/.next/static/chunks/app/api/board-annotations/route-93569b5eb93a61e9.js +1 -0
  172. package/.next/static/chunks/app/api/board-layout/route-93569b5eb93a61e9.js +1 -0
  173. package/.next/static/chunks/app/api/bug-flags/[id]/route-93569b5eb93a61e9.js +1 -0
  174. package/.next/static/chunks/app/api/bug-flags/route-93569b5eb93a61e9.js +1 -0
  175. package/.next/static/chunks/app/api/code-graph/position/route-93569b5eb93a61e9.js +1 -0
  176. package/.next/static/chunks/app/api/code-graph/route-93569b5eb93a61e9.js +1 -0
  177. package/.next/static/chunks/app/api/context/feature/route-93569b5eb93a61e9.js +1 -0
  178. package/.next/static/chunks/app/api/context/file/route-93569b5eb93a61e9.js +1 -0
  179. package/.next/static/chunks/app/api/context/route-93569b5eb93a61e9.js +1 -0
  180. package/.next/static/chunks/app/api/db/arrange/route-93569b5eb93a61e9.js +1 -0
  181. package/.next/static/chunks/app/api/db/backfill-access/route-93569b5eb93a61e9.js +1 -0
  182. package/.next/static/chunks/app/api/db/position/route-93569b5eb93a61e9.js +1 -0
  183. package/.next/static/chunks/app/api/db/prune-planned/route-93569b5eb93a61e9.js +1 -0
  184. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-93569b5eb93a61e9.js +1 -0
  185. package/.next/static/chunks/app/api/db/relations/[id]/route-93569b5eb93a61e9.js +1 -0
  186. package/.next/static/chunks/app/api/db/tables/[id]/route-93569b5eb93a61e9.js +1 -0
  187. package/.next/static/chunks/app/api/draft/approve/route-93569b5eb93a61e9.js +1 -0
  188. package/.next/static/chunks/app/api/draft/route-93569b5eb93a61e9.js +1 -0
  189. package/.next/static/chunks/app/api/draft/status/route-93569b5eb93a61e9.js +1 -0
  190. package/.next/static/chunks/app/api/edges/[id]/route-93569b5eb93a61e9.js +1 -0
  191. package/.next/static/chunks/app/api/edges/route-93569b5eb93a61e9.js +1 -0
  192. package/.next/static/chunks/app/api/endpoints/[id]/route-93569b5eb93a61e9.js +1 -0
  193. package/.next/static/chunks/app/api/entities/route-93569b5eb93a61e9.js +1 -0
  194. package/.next/static/chunks/app/api/flags/route-93569b5eb93a61e9.js +1 -0
  195. package/.next/static/chunks/app/api/ingest/route-93569b5eb93a61e9.js +1 -0
  196. package/.next/static/chunks/app/api/init/route-93569b5eb93a61e9.js +1 -0
  197. package/.next/static/chunks/app/api/lesson/close/route-93569b5eb93a61e9.js +1 -0
  198. package/.next/static/chunks/app/api/lesson/presence/route-93569b5eb93a61e9.js +1 -0
  199. package/.next/static/chunks/app/api/lesson/questions/route-93569b5eb93a61e9.js +1 -0
  200. package/.next/static/chunks/app/api/lesson/route-93569b5eb93a61e9.js +1 -0
  201. package/.next/static/chunks/app/api/lesson/save/route-93569b5eb93a61e9.js +1 -0
  202. package/.next/static/chunks/app/api/lesson/verdict/route-93569b5eb93a61e9.js +1 -0
  203. package/.next/static/chunks/app/api/map/describe/route-93569b5eb93a61e9.js +1 -0
  204. package/.next/static/chunks/app/api/map/files/route-93569b5eb93a61e9.js +1 -0
  205. package/.next/static/chunks/app/api/map/finish/route-93569b5eb93a61e9.js +1 -0
  206. package/.next/static/chunks/app/api/map/route-93569b5eb93a61e9.js +1 -0
  207. package/.next/static/chunks/app/api/map/start/route-93569b5eb93a61e9.js +1 -0
  208. package/.next/static/chunks/app/api/map/touch-active/route-93569b5eb93a61e9.js +1 -0
  209. package/.next/static/chunks/app/api/mention-search/route-93569b5eb93a61e9.js +1 -0
  210. package/.next/static/chunks/app/api/nodes/[id]/position/route-93569b5eb93a61e9.js +1 -0
  211. package/.next/static/chunks/app/api/nodes/[id]/route-93569b5eb93a61e9.js +1 -0
  212. package/.next/static/chunks/app/api/nodes/positions/route-93569b5eb93a61e9.js +1 -0
  213. package/.next/static/chunks/app/api/nodes/route-93569b5eb93a61e9.js +1 -0
  214. package/.next/static/chunks/app/api/nodes/subtasks/route-93569b5eb93a61e9.js +1 -0
  215. package/.next/static/chunks/app/api/notes/[id]/route-93569b5eb93a61e9.js +1 -0
  216. package/.next/static/chunks/app/api/notes/route-93569b5eb93a61e9.js +1 -0
  217. package/.next/static/chunks/app/api/open/route-93569b5eb93a61e9.js +1 -0
  218. package/.next/static/chunks/app/api/plan/annotations/route-93569b5eb93a61e9.js +1 -0
  219. package/.next/static/chunks/app/api/plan/approve/route-93569b5eb93a61e9.js +1 -0
  220. package/.next/static/chunks/app/api/plan/history/route-93569b5eb93a61e9.js +1 -0
  221. package/.next/static/chunks/app/api/plan/markdown/route-93569b5eb93a61e9.js +1 -0
  222. package/.next/static/chunks/app/api/plan/presence/route-93569b5eb93a61e9.js +1 -0
  223. package/.next/static/chunks/app/api/plan/route-93569b5eb93a61e9.js +1 -0
  224. package/.next/static/chunks/app/api/plan/verdict/route-93569b5eb93a61e9.js +1 -0
  225. package/.next/static/chunks/app/api/preferences/route-93569b5eb93a61e9.js +1 -0
  226. package/.next/static/chunks/app/api/project-meta/route-93569b5eb93a61e9.js +1 -0
  227. package/.next/static/chunks/app/api/reset/route-93569b5eb93a61e9.js +1 -0
  228. package/.next/static/chunks/app/api/scope-guard/check/route-93569b5eb93a61e9.js +1 -0
  229. package/.next/static/chunks/app/api/share/create/route-93569b5eb93a61e9.js +1 -0
  230. package/.next/static/chunks/app/api/share/route-93569b5eb93a61e9.js +1 -0
  231. package/.next/static/chunks/app/api/stream/route-93569b5eb93a61e9.js +1 -0
  232. package/.next/static/chunks/app/api/tab/nav/route-93569b5eb93a61e9.js +1 -0
  233. package/.next/static/chunks/app/api/tab/presence/route-93569b5eb93a61e9.js +1 -0
  234. package/.next/static/chunks/app/api/telemetry/route-93569b5eb93a61e9.js +1 -0
  235. package/.next/static/chunks/app/api/telemetry/stats/route-93569b5eb93a61e9.js +1 -0
  236. package/.next/static/chunks/app/api/version/route-93569b5eb93a61e9.js +1 -0
  237. package/.next/static/chunks/app/api/workspace/activate/route-93569b5eb93a61e9.js +1 -0
  238. package/.next/static/chunks/app/api/workspace/route-93569b5eb93a61e9.js +1 -0
  239. package/.next/static/chunks/app/docs/page-126c0e42c71731b2.js +1 -0
  240. package/.next/static/chunks/app/layout-e46e1337e196e904.js +1 -0
  241. package/.next/static/chunks/app/learn/page-4193bf2f60c4f812.js +7 -0
  242. package/.next/static/chunks/app/map/page-6f0139228ec52538.js +1 -0
  243. package/.next/static/chunks/app/page-ec00130a7a249f14.js +1 -0
  244. package/.next/static/chunks/app/plan/page-5addc50440c40167.js +1 -0
  245. package/.next/static/chunks/app/s/[token]/page-13976553e707cad8.js +1 -0
  246. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
  247. package/.next/static/chunks/next/dist/client/components/builtin/app-error-93569b5eb93a61e9.js +1 -0
  248. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-93569b5eb93a61e9.js +1 -0
  249. package/.next/static/chunks/next/dist/client/components/builtin/not-found-93569b5eb93a61e9.js +1 -0
  250. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-93569b5eb93a61e9.js +1 -0
  251. package/.next/static/css/ac0b6ff5058ccc12.css +1 -0
  252. package/.next/trace +43 -43
  253. package/.next/trace-build +1 -1
  254. package/.next/types/routes.d.ts +2 -6
  255. package/.next/types/validator.ts +0 -36
  256. package/dist/bin/beacon.js +14 -12
  257. package/dist/bin/doctor.js +22 -15
  258. package/dist/bin/hook.js +18 -11
  259. package/dist/bin/mcp.js +41 -34
  260. package/dist/bin/plan.js +21 -14
  261. package/dist/bin/uninstall.js +26 -19
  262. package/dist/lib/assets.js +7 -0
  263. package/dist/lib/codex-install.js +28 -21
  264. package/dist/lib/global-install.js +27 -20
  265. package/package.json +3 -3
  266. package/plugin/skills/beacon-explain/SKILL.md +7 -0
  267. package/.next/server/app/api/feedback/[id]/route.js +0 -1
  268. package/.next/server/app/api/feedback/[id]/route.js.nft.json +0 -1
  269. package/.next/server/app/api/feedback/[id]/route_client-reference-manifest.js +0 -1
  270. package/.next/server/app/api/feedback/[id]/vote/route.js +0 -1
  271. package/.next/server/app/api/feedback/[id]/vote/route.js.nft.json +0 -1
  272. package/.next/server/app/api/feedback/[id]/vote/route_client-reference-manifest.js +0 -1
  273. package/.next/server/app/api/feedback/route.js +0 -1
  274. package/.next/server/app/api/feedback/route.js.nft.json +0 -1
  275. package/.next/server/app/api/feedback/route_client-reference-manifest.js +0 -1
  276. package/.next/server/app/feedback/page.js +0 -2
  277. package/.next/server/app/feedback/page.js.nft.json +0 -1
  278. package/.next/server/app/feedback/page_client-reference-manifest.js +0 -1
  279. package/.next/server/app/feedback.html +0 -1
  280. package/.next/server/app/feedback.meta +0 -15
  281. package/.next/server/app/feedback.rsc +0 -32
  282. package/.next/server/app/feedback.segments/_full.segment.rsc +0 -32
  283. package/.next/server/app/feedback.segments/_head.segment.rsc +0 -6
  284. package/.next/server/app/feedback.segments/_index.segment.rsc +0 -15
  285. package/.next/server/app/feedback.segments/_tree.segment.rsc +0 -5
  286. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +0 -9
  287. package/.next/server/app/feedback.segments/feedback.segment.rsc +0 -5
  288. package/.next/server/chunks/2050.js +0 -1
  289. package/.next/server/chunks/3584.js +0 -154
  290. package/.next/server/chunks/6024.js +0 -2
  291. package/.next/server/chunks/7187.js +0 -1
  292. package/.next/server/chunks/8035.js +0 -1
  293. package/.next/static/P3uXQySdS-m6_bxuiezYe/_buildManifest.js +0 -1
  294. package/.next/static/chunks/1936-7fea5225b5bfcfda.js +0 -1
  295. package/.next/static/chunks/1a258343-6baccd9e573fdfaf.js +0 -2
  296. package/.next/static/chunks/2019-3be80edc82176878.js +0 -1
  297. package/.next/static/chunks/3845-6fe7e66d4bf82eb5.js +0 -1
  298. package/.next/static/chunks/4549-591415d55ca009a3.js +0 -62
  299. package/.next/static/chunks/6638-4e53879181b1df75.js +0 -1
  300. package/.next/static/chunks/7643-6c7ff4b9400f68fc.js +0 -1
  301. package/.next/static/chunks/app/_global-error/page-2390ea0e69e5991f.js +0 -1
  302. package/.next/static/chunks/app/api/board-annotations/[id]/route-2390ea0e69e5991f.js +0 -1
  303. package/.next/static/chunks/app/api/board-annotations/route-2390ea0e69e5991f.js +0 -1
  304. package/.next/static/chunks/app/api/board-layout/route-2390ea0e69e5991f.js +0 -1
  305. package/.next/static/chunks/app/api/bug-flags/[id]/route-2390ea0e69e5991f.js +0 -1
  306. package/.next/static/chunks/app/api/bug-flags/route-2390ea0e69e5991f.js +0 -1
  307. package/.next/static/chunks/app/api/code-graph/position/route-2390ea0e69e5991f.js +0 -1
  308. package/.next/static/chunks/app/api/code-graph/route-2390ea0e69e5991f.js +0 -1
  309. package/.next/static/chunks/app/api/context/feature/route-2390ea0e69e5991f.js +0 -1
  310. package/.next/static/chunks/app/api/context/file/route-2390ea0e69e5991f.js +0 -1
  311. package/.next/static/chunks/app/api/context/route-2390ea0e69e5991f.js +0 -1
  312. package/.next/static/chunks/app/api/db/arrange/route-2390ea0e69e5991f.js +0 -1
  313. package/.next/static/chunks/app/api/db/backfill-access/route-2390ea0e69e5991f.js +0 -1
  314. package/.next/static/chunks/app/api/db/position/route-2390ea0e69e5991f.js +0 -1
  315. package/.next/static/chunks/app/api/db/prune-planned/route-2390ea0e69e5991f.js +0 -1
  316. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-2390ea0e69e5991f.js +0 -1
  317. package/.next/static/chunks/app/api/db/relations/[id]/route-2390ea0e69e5991f.js +0 -1
  318. package/.next/static/chunks/app/api/db/tables/[id]/route-2390ea0e69e5991f.js +0 -1
  319. package/.next/static/chunks/app/api/draft/approve/route-2390ea0e69e5991f.js +0 -1
  320. package/.next/static/chunks/app/api/draft/route-2390ea0e69e5991f.js +0 -1
  321. package/.next/static/chunks/app/api/draft/status/route-2390ea0e69e5991f.js +0 -1
  322. package/.next/static/chunks/app/api/edges/[id]/route-2390ea0e69e5991f.js +0 -1
  323. package/.next/static/chunks/app/api/edges/route-2390ea0e69e5991f.js +0 -1
  324. package/.next/static/chunks/app/api/endpoints/[id]/route-2390ea0e69e5991f.js +0 -1
  325. package/.next/static/chunks/app/api/entities/route-2390ea0e69e5991f.js +0 -1
  326. package/.next/static/chunks/app/api/feedback/[id]/route-2390ea0e69e5991f.js +0 -1
  327. package/.next/static/chunks/app/api/feedback/[id]/vote/route-2390ea0e69e5991f.js +0 -1
  328. package/.next/static/chunks/app/api/feedback/route-2390ea0e69e5991f.js +0 -1
  329. package/.next/static/chunks/app/api/flags/route-2390ea0e69e5991f.js +0 -1
  330. package/.next/static/chunks/app/api/ingest/route-2390ea0e69e5991f.js +0 -1
  331. package/.next/static/chunks/app/api/init/route-2390ea0e69e5991f.js +0 -1
  332. package/.next/static/chunks/app/api/lesson/close/route-2390ea0e69e5991f.js +0 -1
  333. package/.next/static/chunks/app/api/lesson/presence/route-2390ea0e69e5991f.js +0 -1
  334. package/.next/static/chunks/app/api/lesson/questions/route-2390ea0e69e5991f.js +0 -1
  335. package/.next/static/chunks/app/api/lesson/route-2390ea0e69e5991f.js +0 -1
  336. package/.next/static/chunks/app/api/lesson/save/route-2390ea0e69e5991f.js +0 -1
  337. package/.next/static/chunks/app/api/lesson/verdict/route-2390ea0e69e5991f.js +0 -1
  338. package/.next/static/chunks/app/api/map/describe/route-2390ea0e69e5991f.js +0 -1
  339. package/.next/static/chunks/app/api/map/files/route-2390ea0e69e5991f.js +0 -1
  340. package/.next/static/chunks/app/api/map/finish/route-2390ea0e69e5991f.js +0 -1
  341. package/.next/static/chunks/app/api/map/route-2390ea0e69e5991f.js +0 -1
  342. package/.next/static/chunks/app/api/map/start/route-2390ea0e69e5991f.js +0 -1
  343. package/.next/static/chunks/app/api/map/touch-active/route-2390ea0e69e5991f.js +0 -1
  344. package/.next/static/chunks/app/api/mention-search/route-2390ea0e69e5991f.js +0 -1
  345. package/.next/static/chunks/app/api/nodes/[id]/position/route-2390ea0e69e5991f.js +0 -1
  346. package/.next/static/chunks/app/api/nodes/[id]/route-2390ea0e69e5991f.js +0 -1
  347. package/.next/static/chunks/app/api/nodes/positions/route-2390ea0e69e5991f.js +0 -1
  348. package/.next/static/chunks/app/api/nodes/route-2390ea0e69e5991f.js +0 -1
  349. package/.next/static/chunks/app/api/nodes/subtasks/route-2390ea0e69e5991f.js +0 -1
  350. package/.next/static/chunks/app/api/notes/[id]/route-2390ea0e69e5991f.js +0 -1
  351. package/.next/static/chunks/app/api/notes/route-2390ea0e69e5991f.js +0 -1
  352. package/.next/static/chunks/app/api/open/route-2390ea0e69e5991f.js +0 -1
  353. package/.next/static/chunks/app/api/plan/annotations/route-2390ea0e69e5991f.js +0 -1
  354. package/.next/static/chunks/app/api/plan/approve/route-2390ea0e69e5991f.js +0 -1
  355. package/.next/static/chunks/app/api/plan/history/route-2390ea0e69e5991f.js +0 -1
  356. package/.next/static/chunks/app/api/plan/markdown/route-2390ea0e69e5991f.js +0 -1
  357. package/.next/static/chunks/app/api/plan/presence/route-2390ea0e69e5991f.js +0 -1
  358. package/.next/static/chunks/app/api/plan/route-2390ea0e69e5991f.js +0 -1
  359. package/.next/static/chunks/app/api/plan/verdict/route-2390ea0e69e5991f.js +0 -1
  360. package/.next/static/chunks/app/api/preferences/route-2390ea0e69e5991f.js +0 -1
  361. package/.next/static/chunks/app/api/project-meta/route-2390ea0e69e5991f.js +0 -1
  362. package/.next/static/chunks/app/api/reset/route-2390ea0e69e5991f.js +0 -1
  363. package/.next/static/chunks/app/api/scope-guard/check/route-2390ea0e69e5991f.js +0 -1
  364. package/.next/static/chunks/app/api/share/create/route-2390ea0e69e5991f.js +0 -1
  365. package/.next/static/chunks/app/api/share/route-2390ea0e69e5991f.js +0 -1
  366. package/.next/static/chunks/app/api/stream/route-2390ea0e69e5991f.js +0 -1
  367. package/.next/static/chunks/app/api/tab/nav/route-2390ea0e69e5991f.js +0 -1
  368. package/.next/static/chunks/app/api/tab/presence/route-2390ea0e69e5991f.js +0 -1
  369. package/.next/static/chunks/app/api/telemetry/route-2390ea0e69e5991f.js +0 -1
  370. package/.next/static/chunks/app/api/telemetry/stats/route-2390ea0e69e5991f.js +0 -1
  371. package/.next/static/chunks/app/api/version/route-2390ea0e69e5991f.js +0 -1
  372. package/.next/static/chunks/app/api/workspace/activate/route-2390ea0e69e5991f.js +0 -1
  373. package/.next/static/chunks/app/api/workspace/route-2390ea0e69e5991f.js +0 -1
  374. package/.next/static/chunks/app/docs/page-ae19d2e91ec24771.js +0 -1
  375. package/.next/static/chunks/app/feedback/page-ea7f66503f2a4ca6.js +0 -1
  376. package/.next/static/chunks/app/layout-0c993f55d3a798f4.js +0 -1
  377. package/.next/static/chunks/app/learn/page-797d74e02b98fa88.js +0 -5
  378. package/.next/static/chunks/app/map/page-634b6d5d98e921b3.js +0 -1
  379. package/.next/static/chunks/app/page-84dc684d45002cfb.js +0 -1
  380. package/.next/static/chunks/app/plan/page-df829b2054c40611.js +0 -1
  381. package/.next/static/chunks/app/s/[token]/page-f97dec75856a7952.js +0 -1
  382. package/.next/static/chunks/app/settings/page-59d90685cd17fc1f.js +0 -1
  383. package/.next/static/chunks/next/dist/client/components/builtin/app-error-2390ea0e69e5991f.js +0 -1
  384. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2390ea0e69e5991f.js +0 -1
  385. package/.next/static/chunks/next/dist/client/components/builtin/not-found-2390ea0e69e5991f.js +0 -1
  386. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2390ea0e69e5991f.js +0 -1
  387. package/.next/static/css/b3d3212da726bbfb.css +0 -1
  388. package/.next/types/app/api/feedback/[id]/route.ts +0 -351
  389. package/.next/types/app/api/feedback/[id]/vote/route.ts +0 -351
  390. package/.next/types/app/api/feedback/route.ts +0 -351
  391. package/.next/types/app/feedback/page.ts +0 -87
  392. /package/.next/static/{P3uXQySdS-m6_bxuiezYe → ZEJwYPSMMES2UlUBBgBmw}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":22422596,"timestamp":107949380,"id":14,"parentId":1,"tags":{},"startTime":1781886052822,"traceId":"4a78aff6d6c45b26"},{"name":"run-typescript","duration":10799237,"timestamp":130374507,"id":4611,"parentId":1,"tags":{},"startTime":1781886075247,"traceId":"4a78aff6d6c45b26"},{"name":"static-check","duration":753338,"timestamp":141187533,"id":4614,"parentId":1,"tags":{},"startTime":1781886086060,"traceId":"4a78aff6d6c45b26"},{"name":"static-generation","duration":3426683,"timestamp":142701350,"id":4790,"parentId":1,"tags":{},"startTime":1781886087574,"traceId":"4a78aff6d6c45b26"},{"name":"collect-build-traces","duration":10211433,"timestamp":141943622,"id":4787,"parentId":1,"tags":{},"startTime":1781886086816,"traceId":"4a78aff6d6c45b26"},{"name":"telemetry-flush","duration":51,"timestamp":152158659,"id":4799,"parentId":1,"tags":{},"startTime":1781886097031,"traceId":"4a78aff6d6c45b26"},{"name":"next-build","duration":44317576,"timestamp":107841143,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781886052714,"traceId":"4a78aff6d6c45b26"}]
1
+ [{"name":"run-webpack","duration":21712576,"timestamp":104755083,"id":14,"parentId":1,"tags":{},"startTime":1781982894006,"traceId":"821f885057cd1708"},{"name":"run-typescript","duration":10207746,"timestamp":126469880,"id":4551,"parentId":1,"tags":{},"startTime":1781982915721,"traceId":"821f885057cd1708"},{"name":"static-check","duration":713617,"timestamp":136771437,"id":4554,"parentId":1,"tags":{},"startTime":1781982926023,"traceId":"821f885057cd1708"},{"name":"static-generation","duration":3295707,"timestamp":138218522,"id":4722,"parentId":1,"tags":{},"startTime":1781982927470,"traceId":"821f885057cd1708"},{"name":"collect-build-traces","duration":9989914,"timestamp":137487598,"id":4719,"parentId":1,"tags":{},"startTime":1781982926739,"traceId":"821f885057cd1708"},{"name":"telemetry-flush","duration":50,"timestamp":147481096,"id":4731,"parentId":1,"tags":{},"startTime":1781982936732,"traceId":"821f885057cd1708"},{"name":"next-build","duration":42825922,"timestamp":104655233,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781982893906,"traceId":"821f885057cd1708"}]
@@ -1,8 +1,8 @@
1
1
  // This file is generated automatically by Next.js
2
2
  // Do not edit this file manually
3
3
 
4
- type AppRoutes = "/" | "/docs" | "/feedback" | "/help" | "/learn" | "/map" | "/plan" | "/s/[token]" | "/settings"
5
- type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/flags" | "/api/ingest" | "/api/init" | "/api/lesson" | "/api/lesson/close" | "/api/lesson/presence" | "/api/lesson/questions" | "/api/lesson/save" | "/api/lesson/verdict" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/mention-search" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/scope-guard/check" | "/api/share" | "/api/share/create" | "/api/stream" | "/api/tab/nav" | "/api/tab/presence" | "/api/telemetry" | "/api/telemetry/stats" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
4
+ type AppRoutes = "/" | "/docs" | "/help" | "/learn" | "/map" | "/plan" | "/s/[token]" | "/settings"
5
+ type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/flags" | "/api/ingest" | "/api/init" | "/api/lesson" | "/api/lesson/close" | "/api/lesson/presence" | "/api/lesson/questions" | "/api/lesson/save" | "/api/lesson/verdict" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/mention-search" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/scope-guard/check" | "/api/share" | "/api/share/create" | "/api/stream" | "/api/tab/nav" | "/api/tab/presence" | "/api/telemetry" | "/api/telemetry/stats" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
6
6
  type PageRoutes = never
7
7
  type LayoutRoutes = "/"
8
8
  type RedirectRoutes = never
@@ -36,9 +36,6 @@ interface ParamMap {
36
36
  "/api/edges/[id]": { "id": string; }
37
37
  "/api/endpoints/[id]": { "id": string; }
38
38
  "/api/entities": {}
39
- "/api/feedback": {}
40
- "/api/feedback/[id]": { "id": string; }
41
- "/api/feedback/[id]/vote": { "id": string; }
42
39
  "/api/flags": {}
43
40
  "/api/ingest": {}
44
41
  "/api/init": {}
@@ -85,7 +82,6 @@ interface ParamMap {
85
82
  "/api/workspace": {}
86
83
  "/api/workspace/activate": {}
87
84
  "/docs": {}
88
- "/feedback": {}
89
85
  "/help": {}
90
86
  "/learn": {}
91
87
  "/map": {}
@@ -56,15 +56,6 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
56
56
  type __Unused = __Check
57
57
  }
58
58
 
59
- // Validate ../../app/feedback/page.tsx
60
- {
61
- type __IsExpected<Specific extends AppPageConfig<"/feedback">> = Specific
62
- const handler = {} as typeof import("../../app/feedback/page.js")
63
- type __Check = __IsExpected<typeof handler>
64
- // @ts-ignore
65
- type __Unused = __Check
66
- }
67
-
68
59
  // Validate ../../app/help/page.tsx
69
60
  {
70
61
  type __IsExpected<Specific extends AppPageConfig<"/help">> = Specific
@@ -344,33 +335,6 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
344
335
  type __Unused = __Check
345
336
  }
346
337
 
347
- // Validate ../../app/api/feedback/[id]/route.ts
348
- {
349
- type __IsExpected<Specific extends RouteHandlerConfig<"/api/feedback/[id]">> = Specific
350
- const handler = {} as typeof import("../../app/api/feedback/[id]/route.js")
351
- type __Check = __IsExpected<typeof handler>
352
- // @ts-ignore
353
- type __Unused = __Check
354
- }
355
-
356
- // Validate ../../app/api/feedback/[id]/vote/route.ts
357
- {
358
- type __IsExpected<Specific extends RouteHandlerConfig<"/api/feedback/[id]/vote">> = Specific
359
- const handler = {} as typeof import("../../app/api/feedback/[id]/vote/route.js")
360
- type __Check = __IsExpected<typeof handler>
361
- // @ts-ignore
362
- type __Unused = __Check
363
- }
364
-
365
- // Validate ../../app/api/feedback/route.ts
366
- {
367
- type __IsExpected<Specific extends RouteHandlerConfig<"/api/feedback">> = Specific
368
- const handler = {} as typeof import("../../app/api/feedback/route.js")
369
- type __Check = __IsExpected<typeof handler>
370
- // @ts-ignore
371
- type __Unused = __Check
372
- }
373
-
374
338
  // Validate ../../app/api/flags/route.ts
375
339
  {
376
340
  type __IsExpected<Specific extends RouteHandlerConfig<"/api/flags">> = Specific
@@ -1,20 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{execSync as C,spawn as c}from"child_process";import{existsSync as k,mkdirSync as d,openSync as p,readFileSync as f,writeFileSync as l}from"fs";import{homedir as t,platform as _}from"os";import{basename as n,dirname as L,join as B}from"path";import{fileURLToPath as a}from"url";var w=L(a(import.meta.url)),P=n(L(w))==="dist",j=P?L(L(w)):L(w),y=process.cwd(),A=process.env.BEACON_HOME||B(t(),".beacon"),R=B(A,"server.json"),T=process.env.PORT||"4319";if(!process.env.CLAUDE_PLUGIN_ROOT&&k(B(j,".claude-plugin","plugin.json")))process.env.CLAUDE_PLUGIN_ROOT=j;if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=B(j,"drizzle");function $(z){if(!P)return B(j,z);return B(j,"dist",z.replace(/\.ts$/,".js"))}var q=process.argv[2];if(q==="mcp")await import($("bin/mcp.ts"));else if(q==="hook")await import($("bin/hook.ts"));else if(q==="guard")await import($("bin/guard.ts"));else if(q==="plan")await import($("bin/plan.ts"));else if(q==="prompt")await import($("bin/prompt.ts"));else if(q==="stop-hook")await import($("bin/stop-hook.ts"));else if(q==="stop")m();else if(q==="remove")await import($("bin/remove.ts"));else if(q==="setup")await x(O()||y);else if(q==="ensure")await e();else if(q==="init-persist")await s(process.argv[3]);else if(q==="doctor")await import($("bin/doctor.ts"));else if(q==="uninstall")await import($("bin/uninstall.ts"));else if(q==="update")await Zz(process.argv.includes("--force")||process.argv.includes("-f"));else if(q==="telemetry")await Xz(process.argv[3]);else if(q==="version"||q==="--version"||q==="-v")console.log(S());else await zz();async function x(z,X=!1){let{installInitSkill:Z,installRefreshSkill:J,installCodexRepoSkills:K,ensureMcp:Q,ensureWorkflowDoc:G}=await import($("lib/assets.ts")),{selfHealGlobal:M,isPluginManaged:I}=await import($("lib/global-install.ts")),{codexDetected:N}=await import($("lib/codex-install.ts")),Y=await M();if(I())return{initSkill:"",refreshSkill:"",mcp:{path:"",added:!1,updated:!1},codexSkills:[],heal:Y};let W=Z(z),H=J(z);G(z);let V=Q(z),F=N()?K(z):[];if(X){if(V.added||V.updated)console.log(`[beacon] ${V.added?"registered":"updated"} Beacon MCP in ${V.path} \u2014 restart your agent CLI`+(V.updated?" to apply the longer plan-review timeout.":" to use @beacon mentions."))}else{console.log(`
4
- \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${W}`),console.log(` \u2713 skill: ${H}`);for(let v of F)console.log(` \u2713 skill: ${v}`);console.log(` ${V.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${V.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
- `)}return{initSkill:W,refreshSkill:H,mcp:V,codexSkills:F,heal:Y}}async function s(z){let X=O()||y,{idForPath:Z,isRegistrableWorkspacePath:J,BEACON_WS_PATH_HEADER:K}=await import($("lib/workspaces.ts"));if(!J(X))console.error(`[beacon] refusing to init ${X} \u2014 that's your home directory, not a project.
6
- `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let Q="";try{Q=f(z??0,"utf8").trim()}catch(Y){console.error(`[beacon] could not read the init analysis ${z?`from ${z}`:"from stdin"}: ${Y instanceof Error?Y.message:Y}`),process.exit(1)}if(!Q)console.error("[beacon] empty init analysis \u2014 pass the JSON as a file argument (`beacon init-persist analysis.json`) or on stdin."),process.exit(1);await x(X,!0);let G=await D(),M=Z(X),I;try{I=await fetch(`http://localhost:${G}/api/init`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":M,[K]:X},body:Q})}catch(Y){console.error(`[beacon] could not reach the Beacon daemon on port ${G}: ${Y instanceof Error?Y.message:Y}`),process.exit(1)}let N=await I.text();if(!I.ok)console.error(`[beacon] init failed (HTTP ${I.status}): ${N}`),process.exit(1);console.log(`[beacon] mapped ${X} into Beacon: ${N}`),console.log(`[beacon] open the panel \u2192 http://localhost:${G}/map`)}function O(){try{return C("git rev-parse --show-toplevel",{cwd:y,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function h(z){try{return process.kill(z,0),!0}catch{return!1}}function E(z){try{return JSON.parse(f(z,"utf8"))}catch{return null}}async function b(z){try{return(await fetch(z)).ok}catch{return!1}}async function i(z,X=60){for(let Z=0;Z<X;Z++){if(await b(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function o(z){d(A,{recursive:!0});let X=p(B(A,"server.log"),"a"),Z={...process.env,PORT:z,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:B(j,"drizzle")};delete Z.BEACON_REPO,delete Z.BEACON_DATA_DIR,delete Z.DATABASE_URL;let K=c("bun",P?["run","start"]:["run","dev"],{cwd:j,env:Z,detached:!0,stdio:["ignore",X,X]});K.unref();let Q={pid:K.pid??0,port:z};return l(R,JSON.stringify(Q)),Q}async function D(){let z=E(R);if(z&&h(z.pid)&&await b(`http://localhost:${z.port}/api/workspace`))return z.port;let{findAvailablePort:X}=await import($("lib/daemon-port.ts")),Z=String(await X(Number(T)));console.log(Z===T?"[beacon] starting the Beacon server\u2026":`[beacon] port ${T} is busy \u2014 starting the Beacon server on port ${Z}\u2026`);let{port:J}=o(Z);if(!await i(`http://localhost:${J}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return J}function r(z){if(process.env.BEACON_NO_OPEN)return;let X=_()==="darwin"?"open":_()==="win32"?"start":"xdg-open";try{C(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function e(){let z=O()||y,{registerWorkspaceExplicit:X,idForPath:Z,ensureWorkspaceDb:J,isRegistrableWorkspacePath:K}=await import($("lib/workspaces.ts"));if(!K(z))return;let Q=Z(z);await J(Q),X(z);let G=await D();console.log(`[beacon] ready \u2192 http://localhost:${G}/map?ws=${Q}`)}async function zz(){let z=O()||y,{registerWorkspaceExplicit:X,idForPath:Z,dataDirFor:J,ensureWorkspaceDb:K,isRegistrableWorkspacePath:Q}=await import($("lib/workspaces.ts"));if(!Q(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
7
- `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let G=Z(z),M=J(G),I=!k(B(M,"db.sqlite"));if(I)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await K(G);if(!N.ok)console.error(`[beacon] failed to provision database: ${N.error}`);if(I)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:Y}=await x(z,!0),W=[];if(Y.skillsAdded.length)W.push(`skills ${Y.skillsAdded.join(", ")}`);if(Y.hooksAdded)W.push(`${Y.hooksAdded} Claude Code hook${Y.hooksAdded===1?"":"s"}`);if(Y.claudeMdBlockTouched)W.push("global CLAUDE.md block");if(W.length)console.log(`[beacon] wired into ~/.claude/: ${W.join(" + ")}.`);let H=Y.codex;if(H){let U=[];if(H.skillsAdded.length)U.push(`skills ${H.skillsAdded.join(", ")}`);if(H.hooksAdded)U.push(`${H.hooksAdded} Codex hook${H.hooksAdded===1?"":"s"}`);if(H.agentsMdBlockTouched)U.push("global AGENTS.md block");if(H.mcp.added)U.push("MCP entry in config.toml");if(U.length)console.log(`[beacon] wired into ~/.codex/: ${U.join(" + ")}.`);if(H.mcp.error)console.log(`[beacon] codex MCP not wired: ${H.mcp.error}`)}try{let U=await import($("lib/telemetry.ts"));if(!U.telemetryStatus().machineId){let g=U.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
3
+ import{execSync as F,spawn as c}from"child_process";import{existsSync as f,mkdirSync as d,openSync as p,readFileSync as h,writeFileSync as t}from"fs";import{homedir as l,platform as C}from"os";import{basename as a,dirname as v,join as V}from"path";import{fileURLToPath as n}from"url";var T=v(n(import.meta.url)),E=a(v(T))==="dist",j=E?v(v(T)):v(T),O=process.cwd(),R=process.env.BEACON_HOME||V(l(),".beacon"),x=V(R,"server.json"),A=process.env.PORT||"4319",s=/[\\/]\.claude[\\/]plugins[\\/]/.test(T);if(!process.env.CLAUDE_PLUGIN_ROOT&&s&&f(V(j,".claude-plugin","plugin.json")))process.env.CLAUDE_PLUGIN_ROOT=j;if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=V(j,"drizzle");function $(z){if(!E)return V(j,z);return V(j,"dist",z.replace(/\.ts$/,".js"))}var q=process.argv[2];if(q==="mcp")await import($("bin/mcp.ts"));else if(q==="hook")await import($("bin/hook.ts"));else if(q==="guard")await import($("bin/guard.ts"));else if(q==="plan")await import($("bin/plan.ts"));else if(q==="prompt")await import($("bin/prompt.ts"));else if(q==="stop-hook")await import($("bin/stop-hook.ts"));else if(q==="stop")u();else if(q==="remove")await import($("bin/remove.ts"));else if(q==="setup")await P(_()||O);else if(q==="ensure")await zz();else if(q==="init-persist")await i(process.argv[3]);else if(q==="doctor")await import($("bin/doctor.ts"));else if(q==="uninstall")await import($("bin/uninstall.ts"));else if(q==="update")await $z(process.argv.includes("--force")||process.argv.includes("-f"));else if(q==="telemetry")await Zz(process.argv[3]);else if(q==="version"||q==="--version"||q==="-v")console.log(S());else await Xz();async function P(z,X=!1){let{installInitSkill:Z,installRefreshSkill:J,installCodexRepoSkills:K,ensureMcp:Y,ensureWorkflowDoc:G}=await import($("lib/assets.ts")),{selfHealGlobal:M,isPluginManaged:B}=await import($("lib/global-install.ts")),{codexDetected:N}=await import($("lib/codex-install.ts")),Q=await M();if(B())return{initSkill:"",refreshSkill:"",mcp:{path:"",added:!1,updated:!1},codexSkills:[],heal:Q};let{isRegistrableWorkspacePath:W}=await import($("lib/workspaces.ts"));if(!W(z))return{initSkill:"",refreshSkill:"",mcp:{path:"",added:!1,updated:!1},codexSkills:[],heal:Q};let H=Z(z),w=J(z);G(z);let I=Y(z),L=N()?K(z):[];if(X){if(I.added||I.updated)console.log(`[beacon] ${I.added?"registered":"updated"} Beacon MCP in ${I.path} \u2014 restart your agent CLI`+(I.updated?" to apply the longer plan-review timeout.":" to use @beacon mentions."))}else{console.log(`
4
+ \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${H}`),console.log(` \u2713 skill: ${w}`);for(let y of L)console.log(` \u2713 skill: ${y}`);console.log(` ${I.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${I.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
+ `)}return{initSkill:H,refreshSkill:w,mcp:I,codexSkills:L,heal:Q}}async function i(z){let X=_()||O,{idForPath:Z,isRegistrableWorkspacePath:J,BEACON_WS_PATH_HEADER:K}=await import($("lib/workspaces.ts"));if(!J(X))console.error(`[beacon] refusing to init ${X} \u2014 that's your home directory, not a project.
6
+ `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let Y="";try{Y=h(z??0,"utf8").trim()}catch(Q){console.error(`[beacon] could not read the init analysis ${z?`from ${z}`:"from stdin"}: ${Q instanceof Error?Q.message:Q}`),process.exit(1)}if(!Y)console.error("[beacon] empty init analysis \u2014 pass the JSON as a file argument (`beacon init-persist analysis.json`) or on stdin."),process.exit(1);await P(X,!0);let G=await k(),M=Z(X),B;try{B=await fetch(`http://localhost:${G}/api/init`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":M,[K]:X},body:Y})}catch(Q){console.error(`[beacon] could not reach the Beacon daemon on port ${G}: ${Q instanceof Error?Q.message:Q}`),process.exit(1)}let N=await B.text();if(!B.ok)console.error(`[beacon] init failed (HTTP ${B.status}): ${N}`),process.exit(1);console.log(`[beacon] mapped ${X} into Beacon: ${N}`),console.log(`[beacon] open the panel \u2192 http://localhost:${G}/map`)}function _(){try{return F("git rev-parse --show-toplevel",{cwd:O,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function b(z){try{return process.kill(z,0),!0}catch{return!1}}function D(z){try{return JSON.parse(h(z,"utf8"))}catch{return null}}async function m(z){try{return(await fetch(z)).ok}catch{return!1}}async function o(z,X=60){for(let Z=0;Z<X;Z++){if(await m(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function r(z){d(R,{recursive:!0});let X=p(V(R,"server.log"),"a"),Z={...process.env,PORT:z,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:V(j,"drizzle")};delete Z.BEACON_REPO,delete Z.BEACON_DATA_DIR,delete Z.DATABASE_URL;let K=c("bun",E?["run","start"]:["run","dev"],{cwd:j,env:Z,detached:!0,stdio:["ignore",X,X]});K.unref();let Y={pid:K.pid??0,port:z};return t(x,JSON.stringify(Y)),Y}async function k(){let z=D(x);if(z&&b(z.pid)&&await m(`http://localhost:${z.port}/api/workspace`))return z.port;let{findAvailablePort:X}=await import($("lib/daemon-port.ts")),Z=String(await X(Number(A)));console.log(Z===A?"[beacon] starting the Beacon server\u2026":`[beacon] port ${A} is busy \u2014 starting the Beacon server on port ${Z}\u2026`);let{port:J}=r(Z);if(!await o(`http://localhost:${J}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return J}function e(z){if(process.env.BEACON_NO_OPEN)return;let X=C()==="darwin"?"open":C()==="win32"?"start":"xdg-open";try{F(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function zz(){let z=_()||O,{registerWorkspaceExplicit:X,idForPath:Z,ensureWorkspaceDb:J,isRegistrableWorkspacePath:K}=await import($("lib/workspaces.ts"));if(!K(z))return;let Y=Z(z);await J(Y),X(z);let G=await k();console.log(`[beacon] ready \u2192 http://localhost:${G}/map?ws=${Y}`)}async function Xz(){let z=_()||O,{registerWorkspaceExplicit:X,idForPath:Z,dataDirFor:J,ensureWorkspaceDb:K,isRegistrableWorkspacePath:Y}=await import($("lib/workspaces.ts"));if(!Y(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
7
+ `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let G=Z(z),M=J(G),B=!f(V(M,"db.sqlite"));if(B)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await K(G);if(!N.ok)console.error(`[beacon] failed to provision database: ${N.error}`);if(B)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:Q}=await P(z,!0),W=[];if(Q.skillsAdded.length)W.push(`skills ${Q.skillsAdded.join(", ")}`);if(Q.hooksAdded)W.push(`${Q.hooksAdded} Claude Code hook${Q.hooksAdded===1?"":"s"}`);if(Q.claudeMdBlockTouched)W.push("global CLAUDE.md block");if(W.length)console.log(`[beacon] wired into ~/.claude/: ${W.join(" + ")}.`);let H=Q.codex;if(H){let U=[];if(H.skillsAdded.length)U.push(`skills ${H.skillsAdded.join(", ")}`);if(H.hooksAdded)U.push(`${H.hooksAdded} Codex hook${H.hooksAdded===1?"":"s"}`);if(H.agentsMdBlockTouched)U.push("global AGENTS.md block");if(H.mcp.added)U.push("MCP entry in config.toml");if(U.length)console.log(`[beacon] wired into ~/.codex/: ${U.join(" + ")}.`);if(H.mcp.error)console.log(`[beacon] codex MCP not wired: ${H.mcp.error}`)}try{let U=await import($("lib/telemetry.ts"));if(!U.telemetryStatus().machineId){let g=U.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
8
8
  `+` architecture \u2014 never repo names, paths, or code) at most every 12h to count
9
9
  `+` active installs. Opt out: \`beacon telemetry off\`, BEACON_TELEMETRY_DISABLED=1,
10
- or DO_NOT_TRACK=1. Details: beacon telemetry status.${g?"":" (currently disabled by your env)"}`),U.ensureTelemetryId()}}catch{}X(z);let F=`http://localhost:${await D()}`,v=`/map?ws=${G}`,u=`${F}/api/workspace/activate?id=${G}&redirect=${encodeURIComponent(v)}`;if(console.log(`
10
+ or DO_NOT_TRACK=1. Details: beacon telemetry status.${g?"":" (currently disabled by your env)"}`),U.ensureTelemetryId()}}catch{}X(z);let I=`http://localhost:${await k()}`,L=`/map?ws=${G}`,y=`${I}/api/workspace/activate?id=${G}&redirect=${encodeURIComponent(L)}`;if(console.log(`
11
11
  \u25C9 Beacon
12
12
  repo: ${z}
13
13
  data: ${M}
14
- url: ${F}
15
- `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),await fetch(`${F}/api/tab/presence`,{headers:{"x-beacon-workspace":G}}).then((U)=>U.json()).then((U)=>!!U?.live).catch(()=>!1))await fetch(`${F}/api/tab/nav`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":G},body:JSON.stringify({path:v})}).catch(()=>{}),console.log(` \u21BB reusing your open Beacon tab \u2014 switch to your browser.
16
- `);else r(u)}function S(){return E(B(j,"package.json"))?.version??"0.0.0"}async function Xz(z){let X=await import($("lib/telemetry.ts"));if(z==="on"||z==="off"){X.setTelemetryEnabled(z==="on"),console.log(`[beacon] telemetry ${z==="on"?"enabled":"disabled"}.`);return}if(z&&z!=="status")console.error("usage: beacon telemetry [on|off|status]"),process.exit(1);let Z=X.telemetryStatus(),J=Z.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":Z.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":Z.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
14
+ url: ${I}
15
+ `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),await fetch(`${I}/api/tab/presence`,{headers:{"x-beacon-workspace":G}}).then((U)=>U.json()).then((U)=>!!U?.live).catch(()=>!1))await fetch(`${I}/api/tab/nav`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":G},body:JSON.stringify({path:L})}).catch(()=>{}),console.log(` \u21BB reusing your open Beacon tab \u2014 switch to your browser.
16
+ `);else e(y)}function S(){return D(V(j,"package.json"))?.version??"0.0.0"}async function Zz(z){let X=await import($("lib/telemetry.ts"));if(z==="on"||z==="off"){X.setTelemetryEnabled(z==="on"),console.log(`[beacon] telemetry ${z==="on"?"enabled":"disabled"}.`);return}if(z&&z!=="status")console.error("usage: beacon telemetry [on|off|status]"),process.exit(1);let Z=X.telemetryStatus(),J=Z.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":Z.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":Z.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
17
17
  \u25C9 Beacon telemetry: ${Z.enabled?"enabled":"disabled"}${J}`),console.log(` machine id: ${Z.machineId??"(not generated yet \u2014 created on first `beacon` run)"}`),Z.machineId)console.log(` payload: ${JSON.stringify(X.heartbeatPayload(S()))}`);console.log(` sent at most every 12h while the daemon runs \u2014 never repo names, paths, or code.
18
- `+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function Zz(z){let X=S(),{INSTALL_COMMAND:Z,NPM_LATEST_URL:J}=await import($("lib/release.ts"));if(_()==="win32"){console.log(`[beacon] current version v${X}.`),console.log(`[beacon] on Windows, update with your package manager:
19
- npm i -g trybeacon@latest`);return}let K=null;try{let Q=await fetch(J);if(Q.ok)K=(await Q.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:Q}=await import($("lib/semver.ts"));if(!Q(K,X)){console.log(`[beacon] already on the latest version (v${X}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(K?`[beacon] updating Beacon v${X} \u2192 v${K}\u2026`:`[beacon] reinstalling Beacon (current v${X})\u2026`);try{C(Z,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
20
- ${Z}`),process.exitCode=1;return}m(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function m(){let z=E(R);if(z&&h(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
18
+ `+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function $z(z){let X=S(),{INSTALL_COMMAND:Z,NPM_LATEST_URL:J}=await import($("lib/release.ts"));if(C()==="win32"){console.log(`[beacon] current version v${X}.`),console.log(`[beacon] on Windows, update with your package manager:
19
+ npm i -g trybeacon@latest`);return}let K=null;try{let Y=await fetch(J);if(Y.ok)K=(await Y.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:Y}=await import($("lib/semver.ts"));if(!Y(K,X)){console.log(`[beacon] already on the latest version (v${X}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(K?`[beacon] updating Beacon v${X} \u2192 v${K}\u2026`:`[beacon] reinstalling Beacon (current v${X})\u2026`);try{F(Z,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
20
+ ${Z}`),process.exitCode=1;return}try{F("beacon setup",{stdio:"inherit"})}catch{}await Qz(),u(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}async function Qz(){let{installedBeaconPlugin:z}=await import($("lib/global-install.ts")),X=z();if(!X)return;try{F("command -v claude",{stdio:"ignore"})}catch{console.log(`[beacon] Beacon plugin detected \u2014 update it with:
21
+ claude plugin update ${X.key}`);return}console.log(`[beacon] updating the Beacon Claude Code plugin (${X.key})\u2026`);try{if(X.marketplace)F(`claude plugin marketplace update ${X.marketplace}`,{stdio:"inherit"});F(`claude plugin update ${X.key}`,{stdio:"inherit"}),console.log("[beacon] plugin updated \u2014 restart your agent to apply.")}catch{console.log(`[beacon] couldn't auto-update the plugin. Run:
22
+ claude plugin update ${X.key}`)}}function u(){let z=D(x);if(z&&b(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var RZ=Object.defineProperty;var gZ=(Q)=>Q;function EZ(Q,Z){this[Q]=gZ.bind(null,Z)}var BQ=(Q,Z)=>{for(var $ in Z)RZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var u=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var c0=1500,l0=480000,n0=1800000,S=3600000,s0=3000;var pQ=()=>{};var KQ={};BQ(KQ,{removeRepoAssets:()=>LZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>OZ,installInitSkill:()=>DZ,installExplainSkill:()=>yZ,installCodexRepoSkills:()=>bZ,ensureWorkflowDoc:()=>_Z,ensureMcp:()=>kZ,auditRepo:()=>xQ,REFRESH_SKILL:()=>PQ,PLAN_SKILL:()=>lQ,INIT_SKILL:()=>NQ,EXPLAIN_SKILL:()=>nQ});import{existsSync as F,mkdirSync as D,readFileSync as K,rmSync as h,writeFileSync as N}from"fs";import{join as X}from"path";function DZ(Q){let Z=X(Q,".claude","skills","beacon-init");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,NQ),$}function IZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,PQ),$}function OZ(Q){let Z=X(Q,".claude","skills","beacon-plan");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,lQ),$}function yZ(Q){let Z=X(Q,".claude","skills","beacon-explain");D(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,nQ),$}function bZ(Q){let Z=[];for(let $ of AZ){let J=X(Q,".agents","skills",$.name);D(J,{recursive:!0});let Y=X(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function _Z(Q){let Z=X(Q,"AGENTS.md"),$="";try{$=K(Z,"utf8")}catch{}let J=new RegExp(`${m}[\\s\\S]*?${GQ}`);$=J.test($)?$.replace(J,cQ):`${$.trim()}
3
+ var uZ=Object.defineProperty;var gZ=(Q)=>Q;function EZ(Q,Z){this[Q]=gZ.bind(null,Z)}var BQ=(Q,Z)=>{for(var $ in Z)uZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var F=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var n0=1500,s0=480000,t0=1800000,S=3600000,a0=3000;var pQ=()=>{};var KQ={};BQ(KQ,{removeRepoAssets:()=>LZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>OZ,installInitSkill:()=>DZ,installExplainSkill:()=>yZ,installCodexRepoSkills:()=>bZ,ensureWorkflowDoc:()=>_Z,ensureMcp:()=>kZ,auditRepo:()=>xQ,REFRESH_SKILL:()=>GQ,PLAN_SKILL:()=>lQ,INIT_SKILL:()=>NQ,EXPLAIN_SKILL:()=>nQ});import{existsSync as R,mkdirSync as I,readFileSync as K,rmSync as h,writeFileSync as N}from"fs";import{join as X}from"path";function DZ(Q){let Z=X(Q,".claude","skills","beacon-init");I(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,NQ),$}function IZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");I(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,GQ),$}function OZ(Q){let Z=X(Q,".claude","skills","beacon-plan");I(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,lQ),$}function yZ(Q){let Z=X(Q,".claude","skills","beacon-explain");I(Z,{recursive:!0});let $=X(Z,"SKILL.md");return N($,nQ),$}function bZ(Q){let Z=[];for(let $ of AZ){let J=X(Q,".agents","skills",$.name);I(J,{recursive:!0});let Y=X(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function _Z(Q){let Z=X(Q,"AGENTS.md"),$="";try{$=K(Z,"utf8")}catch{}let J=new RegExp(`${m}[\\s\\S]*?${PQ}`);$=J.test($)?$.replace(J,cQ):`${$.trim()}
4
4
 
5
5
  ${cQ}
6
6
  `.trimStart(),N(Z,$.endsWith(`
@@ -10,8 +10,8 @@ ${cQ}
10
10
  `:""}@AGENTS.md
11
11
  `)}function kZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(K(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<S)return J.timeout=S,N(Z,JSON.stringify($,null,2)+`
12
12
  `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:S},N(Z,JSON.stringify($,null,2)+`
13
- `),{path:Z,added:!0,updated:!1}}function xQ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(K(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=K(X(Q,"AGENTS.md"),"utf8").includes(m)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(K(X(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":F(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":F(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":F(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":F(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function LZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(F(U))h(U,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",z);if(F(U))h(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(K(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)h(J,{force:!0});else N(J,JSON.stringify(z,null,2)+`
14
- `)}}catch{}let Y=!1,V=X(Q,"AGENTS.md");try{let z=K(V,"utf8"),U=new RegExp(`\\n?${m}[\\s\\S]*?${GQ}\\n?`);if(U.test(z)){let vQ=z.replace(U,`
13
+ `),{path:Z,added:!0,updated:!1}}function xQ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(K(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=K(X(Q,"AGENTS.md"),"utf8").includes(m)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(K(X(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":R(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":R(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":R(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":R(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function LZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(R(U))h(U,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",z);if(R(U))h(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(K(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)h(J,{force:!0});else N(J,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let Y=!1,V=X(Q,"AGENTS.md");try{let z=K(V,"utf8"),U=new RegExp(`\\n?${m}[\\s\\S]*?${PQ}\\n?`);if(U.test(z)){let vQ=z.replace(U,`
15
15
  `).replace(/\n{3,}/g,`
16
16
 
17
17
  `).trimStart();N(V,vQ.endsWith(`
@@ -63,7 +63,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
63
63
  That one command wires the repo (writes \`.mcp.json\` + skills so your NEXT session gets the \`beacon_*\` tools natively, heals the global install), starts the Beacon daemon if it isn't running, registers + provisions this workspace, and POSTs your analysis to the same \`/api/init\` endpoint the MCP tool uses \u2014 so init completes in THIS session. Read the counts it prints and report them.
64
64
 
65
65
  After the tool (or \`beacon init-persist\`) returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
66
- `,PQ=`---
66
+ `,GQ=`---
67
67
  name: beacon-refresh
68
68
  description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
69
69
  ---
@@ -214,6 +214,13 @@ push depth into \`detail\`, not the node face. Supply \`steps\` for the guided w
214
214
  is the overview (empty \`focusIds\`), then teach one node (or a few) per step in order, each with its
215
215
  \`focusIds\`.
216
216
 
217
+ When the topic involves DATABASE tables, pass them in \`tables\` (they render as annotated schema cards
218
+ on the SAME board, not just raw schemas). For each table give a one-line \`note\` (why it exists), mark
219
+ the key columns \`isPk\`, point FKs at another table with \`fkTo: "<that table's id>"\`, give EVERY column a
220
+ short plain-English \`note\`, and add a \`sample\` row or two (the worked example, made concrete). Connect a
221
+ concept to its table with an \`edge\` (e.g. \`persists to\` / \`reads from\`) whose \`toId\` is the table's id \u2014
222
+ so the learner sees the table IN CONTEXT, wired to the code that uses it.
223
+
217
224
  ## 4. Answer in the loop \u2014 don't stop after one round
218
225
 
219
226
  \`beacon_explain\` returns the user's questions, each tagged \`[q:ID]\`. Answer EACH by calling
@@ -221,7 +228,7 @@ is the overview (empty \`focusIds\`), then teach one node (or a few) per step in
221
228
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
222
229
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
223
230
  the lesson.
224
- `,AZ,m="<!-- beacon:workflow:start -->",GQ="<!-- beacon:workflow:end -->",cQ;var p=u(()=>{pQ();AZ=[{name:"beacon-init",body:()=>NQ},{name:"beacon-refresh",body:()=>PQ}];cQ=`${m}
231
+ `,AZ,m="<!-- beacon:workflow:start -->",PQ="<!-- beacon:workflow:end -->",cQ;var p=F(()=>{pQ();AZ=[{name:"beacon-init",body:()=>NQ},{name:"beacon-refresh",body:()=>GQ}];cQ=`${m}
225
232
  ## Beacon \u2014 feature workflow
226
233
 
227
234
  This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
@@ -293,18 +300,18 @@ Register them all in that single batched call. If a plan added five features, th
293
300
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
294
301
 
295
302
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
296
- ${GQ}`});import{existsSync as c,mkdirSync as CQ,readdirSync as SZ,readFileSync as I,rmSync as hZ,writeFileSync as l}from"fs";import{dirname as sQ,join as w}from"path";function tQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function n(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=w(Q,".claude","plugins");if(!c(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=w(V,".claude-plugin","plugin.json");try{if(c(q)&&JSON.parse(I(q,"utf8")).name==="beacon")return V}catch{}try{for(let H of SZ(V,{withFileTypes:!0}))if(H.isDirectory())Y.push(w(V,H.name))}catch{}}$=Y}return null}function aQ(Q){return n(Q)!==null}function MQ(Q){try{return JSON.parse(I(Q,"utf8"))}catch{return{}}}function dQ(Q,Z){CQ(sQ(Q),{recursive:!0}),l(Q,JSON.stringify(Z,null,2)+`
303
+ ${PQ}`});import{existsSync as c,mkdirSync as CQ,readdirSync as SZ,readFileSync as u,rmSync as hZ,writeFileSync as l}from"fs";import{dirname as sQ,join as C}from"path";function tQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function n(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=C(Q,".claude","plugins");if(!c(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=C(V,".claude-plugin","plugin.json");try{if(c(q)&&JSON.parse(u(q,"utf8")).name==="beacon")return V}catch{}try{for(let H of SZ(V,{withFileTypes:!0}))if(H.isDirectory())Y.push(C(V,H.name))}catch{}}$=Y}return null}function aQ(Q){return n(Q)!==null}function mZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function pZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(u(C(Q,".claude","plugins","installed_plugins.json"),"utf8"));for(let $ of Object.keys(Z.plugins??{}))if(/^beacon@/.test($))return{key:$,marketplace:$.split("@")[1]??""}}catch{}return null}function MQ(Q){try{return JSON.parse(u(Q,"utf8"))}catch{return{}}}function dQ(Q,Z){CQ(sQ(Q),{recursive:!0}),l(Q,JSON.stringify(Z,null,2)+`
297
304
  `)}function t(Q,Z){let $=MQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),dQ(Q,$),!0}function a(Q,Z){return(MQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function d(Q,Z){let $=MQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let H=q.hooks?.length??0,z=(q.hooks??[]).filter((U)=>U.command!==Z.command);if(z.length!==H)Y=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return dQ(Q,$),!0}function r(Q,Z,$,J){let Y=`${Z}
298
305
  ${J.trim()}
299
- ${$}`,V="";try{V=I(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
306
+ ${$}`,V="";try{V=u(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
300
307
 
301
308
  ${Y}
302
309
  `:`${Y}
303
310
  `,CQ(sQ(Q),{recursive:!0}),l(Q,V.endsWith(`
304
311
  `)?V:`${V}
305
- `)}function O(Q,Z){try{return I(Q,"utf8").includes(Z)}catch{return!1}}function o(Q,Z,$){let J="";try{J=I(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
312
+ `)}function O(Q,Z){try{return u(Q,"utf8").includes(Z)}catch{return!1}}function o(Q,Z,$){let J="";try{J=u(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
306
313
 
307
- `).trimStart();return l(Q,V),!0}function i(Q,Z,$){let J=w(Q,Z);CQ(J,{recursive:!0});let Y=w(J,"SKILL.md");return l(Y,$),Y}function y(Q,Z){return c(w(Q,Z,"SKILL.md"))}function e(Q,Z){let $=w(Q,Z);if(!c($))return!1;return hZ($,{recursive:!0,force:!0}),!0}var B,s=`## Beacon (visual planning panel)
314
+ `).trimStart();return l(Q,V),!0}function i(Q,Z,$){let J=C(Q,Z);CQ(J,{recursive:!0});let Y=C(J,"SKILL.md");return l(Y,$),Y}function y(Q,Z){return c(C(Q,Z,"SKILL.md"))}function e(Q,Z){let $=C(Q,Z);if(!c($))return!1;return hZ($,{recursive:!0,force:!0}),!0}var B,s=`## Beacon (visual planning panel)
308
315
 
309
316
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
310
317
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -328,19 +335,19 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
328
335
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
329
336
  on the /map and /db boards (added features, attached subtasks, edited columns, new
330
337
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
331
- verbatim. Do NOT implement until the tool returns approval.`;var wQ=u(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as mZ,renameSync as pZ,rmSync as cZ,writeFileSync as lZ}from"fs";import{dirname as nZ}from"path";function QQ(Q,Z){mZ(nZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{lZ($,Z),pZ($,Q)}catch(J){throw cZ($,{force:!0}),J}}function $1(Q,Z,$=!1){QQ(Q,JSON.stringify(Z,null,$?2:void 0))}var rQ=()=>{};var JZ={};BQ(JZ,{setupCodexAssets:()=>aZ,removeCodexMcp:()=>$Z,removeCodexArtifacts:()=>dZ,hasCodexMcp:()=>FQ,ensureCodexMcp:()=>ZZ,codexMcpProblem:()=>RQ,codexDetected:()=>VQ,auditCodex:()=>gQ,CODEX_HOOKS:()=>f});import{readFileSync as YQ}from"fs";import{homedir as sZ}from"os";import{join as _}from"path";function oQ(){return process.env.HOME||process.env.USERPROFILE||sZ()}function VQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(fQ===void 0)fQ=Bun.which("codex")!==null;return fQ}function b(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function FQ(){try{return Boolean(b(YQ(R(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function RQ(){let Q="";try{Q=YQ(R(),"utf8")}catch{return null}let Z=b(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${A}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${A}`;return null}function ZZ(){let Q="",Z=!1;try{Q=YQ(R(),"utf8"),Z=!0}catch{}if(Z){let V=b(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${A}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${A}`}}let $=!Q?"":Q.endsWith(`
338
+ verbatim. Do NOT implement until the tool returns approval.`;var wQ=F(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as cZ,renameSync as lZ,rmSync as nZ,writeFileSync as sZ}from"fs";import{dirname as tZ}from"path";function QQ(Q,Z){cZ(tZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{sZ($,Z),lZ($,Q)}catch(J){throw nZ($,{force:!0}),J}}function Y1(Q,Z,$=!1){QQ(Q,JSON.stringify(Z,null,$?2:void 0))}var rQ=()=>{};var JZ={};BQ(JZ,{setupCodexAssets:()=>rZ,removeCodexMcp:()=>$Z,removeCodexArtifacts:()=>oZ,hasCodexMcp:()=>RQ,ensureCodexMcp:()=>ZZ,codexMcpProblem:()=>uQ,codexDetected:()=>VQ,auditCodex:()=>gQ,CODEX_HOOKS:()=>f});import{readFileSync as YQ}from"fs";import{homedir as aZ}from"os";import{join as _}from"path";function oQ(){return process.env.HOME||process.env.USERPROFILE||aZ()}function VQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(fQ===void 0)fQ=Bun.which("codex")!==null;return fQ}function b(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function RQ(){try{return Boolean(b(YQ(g(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function uQ(){let Q="";try{Q=YQ(g(),"utf8")}catch{return null}let Z=b(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${A}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${A}`;return null}function ZZ(){let Q="",Z=!1;try{Q=YQ(g(),"utf8"),Z=!0}catch{}if(Z){let V=b(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${A}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${A}`}}let $=!Q?"":Q.endsWith(`
332
339
  `)?`
333
340
  `:`
334
341
 
335
- `,J=Q+$+tZ;if(b(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${A}`};return QQ(R(),J),{added:!0}}function $Z(){let Q="";try{Q=YQ(R(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
336
- `),$=Z.indexOf(eQ);if($===-1)return{removed:!1,skipped:FQ()};let J=Z.indexOf(QZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
342
+ `,J=Q+$+dZ;if(b(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${A}`};return QQ(g(),J),{added:!0}}function $Z(){let Q="";try{Q=YQ(g(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
343
+ `),$=Z.indexOf(eQ);if($===-1)return{removed:!1,skipped:RQ()};let J=Z.indexOf(QZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
337
344
  `).replace(/\n{3,}/g,`
338
345
 
339
- `).replace(/^\n+/,"");if(b(Y)===null)return{removed:!1,skipped:!0};return QQ(R(),Y),{removed:!0}}async function aZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of B){if(!y($Q(),U))V.push(U);i($Q(),U,Y[U])}let q=0;for(let U of f)if(t(uQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let H=O(ZQ(),JQ);r(ZQ(),JQ,iQ,s);let z=ZZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!H,mcp:z}}function gQ(){let Q={};for(let $ of B)Q[$]=y($Q(),$);let Z={};for(let $ of f)Z[$.event]=a(uQ(),{event:$.event,command:$.command});return{detected:VQ(),skills:Q,hooks:Z,agentsMdBlock:O(ZQ(),JQ),mcp:FQ()}}function dZ(){let Q=[];for(let Y of B)if(e($Q(),Y))Q.push(Y);let Z=0;for(let Y of f)if(d(uQ(),{event:Y.event,command:Y.command}))Z++;let $=o(ZQ(),JQ,iQ),J=$Z();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var TQ=()=>_(oQ(),".codex"),uQ=()=>_(TQ(),"hooks.json"),R=()=>_(TQ(),"config.toml"),ZQ=()=>_(TQ(),"AGENTS.md"),$Q=()=>_(oQ(),".agents","skills"),JQ="<!-- beacon:global:start -->",iQ="<!-- beacon:global:end -->",f,fQ,eQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",QZ="# beacon:end",tZ,A="add it manually: codex mcp add beacon -- beacon mcp";var EQ=u(()=>{wQ();rQ();f=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];tZ=`${eQ}
346
+ `).replace(/^\n+/,"");if(b(Y)===null)return{removed:!1,skipped:!0};return QQ(g(),Y),{removed:!0}}async function rZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of B){if(!y($Q(),U))V.push(U);i($Q(),U,Y[U])}let q=0;for(let U of f)if(t(FQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let H=O(ZQ(),JQ);r(ZQ(),JQ,iQ,s);let z=ZZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!H,mcp:z}}function gQ(){let Q={};for(let $ of B)Q[$]=y($Q(),$);let Z={};for(let $ of f)Z[$.event]=a(FQ(),{event:$.event,command:$.command});return{detected:VQ(),skills:Q,hooks:Z,agentsMdBlock:O(ZQ(),JQ),mcp:RQ()}}function oZ(){let Q=[];for(let Y of B)if(e($Q(),Y))Q.push(Y);let Z=0;for(let Y of f)if(d(FQ(),{event:Y.event,command:Y.command}))Z++;let $=o(ZQ(),JQ,iQ),J=$Z();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var TQ=()=>_(oQ(),".codex"),FQ=()=>_(TQ(),"hooks.json"),g=()=>_(TQ(),"config.toml"),ZQ=()=>_(TQ(),"AGENTS.md"),$Q=()=>_(oQ(),".agents","skills"),JQ="<!-- beacon:global:start -->",iQ="<!-- beacon:global:end -->",f,fQ,eQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",QZ="# beacon:end",dZ,A="add it manually: codex mcp add beacon -- beacon mcp";var EQ=F(()=>{wQ();rQ();f=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];dZ=`${eQ}
340
347
  [mcp_servers.beacon]
341
348
  command = "beacon"
342
349
  args = ["mcp"]
343
350
  ${QZ}
344
- `});var UZ={};BQ(UZ,{provisionDb:()=>C0});import{createClient as U0}from"@libsql/client";import{drizzle as W0}from"drizzle-orm/libsql";import{migrate as H0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as j0}from"drizzle-orm/migrator";import{dirname as AQ,join as v0}from"path";import{fileURLToPath as B0}from"url";async function XQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function x0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function XZ(Q){if(!await XQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function K0(Q){for(let[Z,$]of Object.entries(G0)){if(!await XQ(Q,Z))continue;let J=await x0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function C0(Q,Z=P0){let $=U0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await XQ($,"__drizzle_migrations"),Y=await XQ($,"Node"),V=!1;if(Y&&!J){let H=j0({migrationsFolder:Z})[0];if(H)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[H.hash,H.folderMillis]}),V=!0}let q=await XZ($);if(await H0(W0($),{migrationsFolder:Z}),await XZ($)>q)V=!0;return await K0($),{migrated:V}}finally{$.close()}}var N0,P0,G0;var WZ=u(async()=>{N0=AQ(AQ(AQ(B0(import.meta.url)))),P0=process.env.BEACON_MIGRATIONS_DIR||v0(N0,"drizzle"),G0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});wQ();import{existsSync as rZ}from"fs";import{homedir as oZ}from"os";import{join as zQ}from"path";function iZ(){return process.env.HOME||process.env.USERPROFILE||oZ()}var qQ=()=>zQ(iZ(),".claude"),DQ=()=>zQ(qQ(),"skills"),IQ=()=>zQ(qQ(),"settings.json"),OQ=()=>zQ(qQ(),"CLAUDE.md"),yQ="<!-- beacon:global:start -->",YZ="<!-- beacon:global:end -->";var eZ=s,g=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function Q0(Q,Z){return i(DQ(),Q,Z)}function VZ(Q){return y(DQ(),Q)}function Z0(Q){return e(DQ(),Q)}function $0(Q){return t(IQ(),Q)}function J0(Q){return a(IQ(),Q)}function Y0(Q){return d(IQ(),Q)}function V0(Q){r(OQ(),yQ,YZ,Q)}function zZ(){return O(OQ(),yQ)}function z0(){return o(OQ(),yQ,YZ)}function qZ(){let Q={};for(let $ of B)Q[$]=VZ($);let Z={};for(let $ of g)Z[$.event]=J0({event:$.event,command:$.command});return{homeExists:rZ(qQ()),skills:Q,hooks:Z,claudeMdBlock:zZ()}}async function q0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of B){if(!VZ(z))V.push(z);Q0(z,Y[z])}let q=0;for(let z of g)if($0({event:z.event,matcher:z.matcher,command:z.command}))q++;let H=zZ();return V0(eZ),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!H}}async function v1(){if(tQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(aQ()){try{X0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await q0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (EQ(),JZ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function X0(){let Q=[];for(let J of B)if(Z0(J))Q.push(J);let Z=0;for(let J of g)if(Y0(J))Z++;let $=z0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as M0}from"async_hooks";import{spawnSync as w0}from"child_process";import{createHash as f0}from"crypto";import{existsSync as jZ,mkdirSync as k,readFileSync as _Q,writeFileSync as kQ}from"fs";import{homedir as vZ}from"os";import{basename as T0,join as C,parse as u0,resolve as HZ}from"path";function G(){return process.env.BEACON_HOME||C(vZ(),".beacon")}function LQ(){return C(G(),"workspaces.json")}function UQ(Q){return f0("sha256").update(Q).digest("hex").slice(0,12)}function R1(Q=process.cwd()){let Z=w0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function BZ(Q){let Z=HZ(Q);return Z!==HZ(vZ())&&Z!==u0(Z).root}function NZ(){return C(G(),"deleted.json")}function SQ(){try{let Q=JSON.parse(_Q(NZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function PZ(Q){k(G(),{recursive:!0}),kQ(NZ(),JSON.stringify(Q,null,2))}function GZ(Q){return SQ().includes(Q)}function g1(Q){let Z=SQ();if(!Z.includes(Q))PZ([...Z,Q])}function F0(Q){let Z=SQ();if(Z.includes(Q))PZ(Z.filter(($)=>$!==Q))}function WQ(Q){return C(G(),Q)}function R0(Q){return`file:${C(WQ(Q),"db.sqlite")}`}function L(){try{let Q=JSON.parse(_Q(LQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function hQ(Q){k(G(),{recursive:!0}),kQ(LQ(),JSON.stringify(Q,null,2))}function HQ(){return L().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function T(Q){return L().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!BZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=UQ(Q);if(GZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=L(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||T0(Q),lastOpenedAt:$},H=[q,...Y.filter((z)=>z.id!==J)];return k(WQ(J),{recursive:!0}),hQ(H),q}function E1(Q,Z){return F0(UQ(Q)),xZ(Q,Z)}function D1(Q,Z=new Date().toISOString()){let $=L(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,hQ($)}function I1(Q){if(hQ(L().filter((Z)=>Z.id!==Q)),mQ()===Q)g0(HQ()[0]?.id??null)}function KZ(){return C(G(),"active")}function mQ(){try{return _Q(KZ(),"utf8").trim()||null}catch{return null}}function g0(Q){k(G(),{recursive:!0}),kQ(KZ(),Q??"")}function O1(){let Q=mQ();return Q?T(Q):null}function y1(){let Q=I0()??mQ();return Q?T(Q):null}function A1(Q){return T(Q)?.path??null}function b1(){return jZ(LQ())}var CZ="beacon_ws";function MZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function _1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&T(Z))return Z;let $=MZ(Q,CZ);if($&&T($))return $;return E0()}function E0(){let Q=HQ();return Q.length===1?Q[0].id:null}var D0="x-beacon-workspace-path";async function k1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&T(Z))return Z;let $=Q.headers.get(D0);if($&&BZ($)&&!GZ(UQ($))&&(!Z||UQ($)===Z)){let Y=xZ($);return await O0(Y.id),Y.id}let J=MZ(Q,CZ);if(J&&T(J))return J;return null}var wZ=new M0;function L1(Q,Z){return Q?wZ.run(Q,Z):Z()}function I0(){return wZ.getStore()??null}var bQ=new Set;function S1(Q){bQ.delete(C(WQ(Q),"db.sqlite"))}async function O0(Q){let Z=WQ(Q),$=C(Z,"db.sqlite"),J=jZ($);if(J&&bQ.has($))return{ok:!0,created:!1,migrated:!1};try{k(Z,{recursive:!0});let{provisionDb:Y}=await WZ().then(() => UZ),V=await Y(R0(Q));return bQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}p();EQ();import{execSync as y0,spawnSync as TZ}from"child_process";import{existsSync as A0,readFileSync as b0}from"fs";import{join as uZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,x=(Q)=>`\x1B[2m${Q}\x1B[0m`,E=(Q)=>`
345
- \x1B[1m${Q}\x1B[0m`;function _0(){try{return y0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function k0(){let Q=uZ(G(),"server.json");try{let Z=JSON.parse(b0(Q,"utf8"));if(!Z.pid)return j("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return j(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return j("daemon: no server.json (never started)")}}function L0(){let Q=TZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return j("bun NOT found on PATH (required to run Beacon)")}function S0(){return _0()||process.cwd()}var jQ=S0(),M=qZ(),FZ=HQ(),h0=FZ.some((Q)=>Q.path===jQ),v=h0||A0(uZ(jQ,".mcp.json"))?xQ(jQ):null;console.log(E("Beacon \xB7 doctor"));console.log(E("Runtime"));console.log(` ${L0()}`);console.log(` ${k0()}`);console.log(` ${W(`home: ${G()}`)}`);console.log(` ${W(`workspaces registered: ${FZ.length}`)}`);console.log(E("Global (~/.claude/)"));for(let Q of B)console.log(` ${M.skills[Q]?W(`skill ${Q}`):j(`skill ${Q} \u2014 missing`)}`);for(let Q of g)console.log(` ${M.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):j(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${x(Q.description)}`);console.log(` ${M.claudeMdBlock?W("global CLAUDE.md block"):j("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(E("Plugin (Claude Code)"));var fZ=n();if(fZ)if(console.log(` ${W(`installed as a Claude Code plugin \u2192 ${fZ}`)}`),console.log(` ${x("the plugin owns the Claude-side skills/hooks/MCP")}`),M.hooks.PostToolUse||B.some((Q)=>M.skills[Q]))console.log(` ${x("npm-global ~/.claude entries still present \u2014 they'll be removed automatically on the next `beacon` run (run `beacon` once to deconflict now).")}`);else console.log(` ${W("npm-global ~/.claude layer stepped aside \u2014 no double-registration")}`);else console.log(` ${x("not installed as a Claude Code plugin (using the npm `trybeacon` CLI).")}`);console.log(E("Codex (~/.codex/ + ~/.agents/)"));var P=VQ()?gQ():null;if(!P)console.log(` ${x("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=TZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):x("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of B)console.log(` ${P.skills[$]?W(`skill ${$} (~/.agents/skills)`):j(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of f)console.log(` ${P.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):j(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${x($.description)}`);console.log(` ${P.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):j("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=RQ();console.log(` ${P.mcp?W("config.toml has [mcp_servers.beacon]"):j(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(E(`Current repo (${jQ})`));if(!v)console.log(` ${x("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${v.mcpRegistered?W(".mcp.json has beacon entry"):j(".mcp.json missing beacon entry")}`),console.log(` ${v.agentsMdBlock?W("AGENTS.md has Beacon workflow block"):j("AGENTS.md missing Beacon workflow block")}`),console.log(` ${v.claudeMdImport?W("CLAUDE.md @-imports AGENTS.md"):j("CLAUDE.md does NOT @-import AGENTS.md")}`),console.log(` ${v.skills["beacon-init"]?W("skill beacon-init (repo)"):j("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${v.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):j("skill beacon-refresh (repo) \u2014 missing")}`),P)console.log(` ${v.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):j("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${v.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):j("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var m0=B.some((Q)=>!M.skills[Q])||g.some((Q)=>!M.hooks[Q.event])||!M.claudeMdBlock||(P?B.some((Q)=>!P.skills[Q])||f.some((Q)=>!P.hooks[Q.event])||!P.agentsMdBlock||!P.mcp:!1)||(v?!v.mcpRegistered||!v.agentsMdBlock||!v.claudeMdImport||!v.skills["beacon-init"]||!v.skills["beacon-refresh"]||(P?!v.codexSkills["beacon-init"]||!v.codexSkills["beacon-refresh"]:!1):!1);if(m0)console.log(`
351
+ `});var UZ={};BQ(UZ,{provisionDb:()=>w0});import{createClient as H0}from"@libsql/client";import{drizzle as j0}from"drizzle-orm/libsql";import{migrate as v0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as B0}from"drizzle-orm/migrator";import{dirname as AQ,join as N0}from"path";import{fileURLToPath as G0}from"url";async function XQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function C0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function XZ(Q){if(!await XQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function M0(Q){for(let[Z,$]of Object.entries(K0)){if(!await XQ(Q,Z))continue;let J=await C0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function w0(Q,Z=x0){let $=H0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await XQ($,"__drizzle_migrations"),Y=await XQ($,"Node"),V=!1;if(Y&&!J){let H=B0({migrationsFolder:Z})[0];if(H)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[H.hash,H.folderMillis]}),V=!0}let q=await XZ($);if(await v0(j0($),{migrationsFolder:Z}),await XZ($)>q)V=!0;return await M0($),{migrated:V}}finally{$.close()}}var P0,x0,K0;var WZ=F(async()=>{P0=AQ(AQ(AQ(G0(import.meta.url)))),x0=process.env.BEACON_MIGRATIONS_DIR||N0(P0,"drizzle"),K0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});wQ();import{existsSync as iZ}from"fs";import{homedir as eZ}from"os";import{join as zQ}from"path";function Q0(){return process.env.HOME||process.env.USERPROFILE||eZ()}var qQ=()=>zQ(Q0(),".claude"),DQ=()=>zQ(qQ(),"skills"),IQ=()=>zQ(qQ(),"settings.json"),OQ=()=>zQ(qQ(),"CLAUDE.md"),yQ="<!-- beacon:global:start -->",YZ="<!-- beacon:global:end -->";var Z0=s,E=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function $0(Q,Z){return i(DQ(),Q,Z)}function VZ(Q){return y(DQ(),Q)}function J0(Q){return e(DQ(),Q)}function Y0(Q){return t(IQ(),Q)}function V0(Q){return a(IQ(),Q)}function z0(Q){return d(IQ(),Q)}function q0(Q){r(OQ(),yQ,YZ,Q)}function zZ(){return O(OQ(),yQ)}function X0(){return o(OQ(),yQ,YZ)}function qZ(){let Q={};for(let $ of B)Q[$]=VZ($);let Z={};for(let $ of E)Z[$.event]=V0({event:$.event,command:$.command});return{homeExists:iZ(qQ()),skills:Q,hooks:Z,claudeMdBlock:zZ()}}async function U0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of B){if(!VZ(z))V.push(z);$0(z,Y[z])}let q=0;for(let z of E)if(Y0({event:z.event,matcher:z.matcher,command:z.command}))q++;let H=zZ();return q0(Z0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!H}}async function N1(){if(tQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(aQ()){try{W0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await U0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (EQ(),JZ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function W0(){let Q=[];for(let J of B)if(J0(J))Q.push(J);let Z=0;for(let J of E)if(z0(J))Z++;let $=X0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as f0}from"async_hooks";import{spawnSync as T0}from"child_process";import{createHash as F0}from"crypto";import{existsSync as jZ,mkdirSync as k,readFileSync as _Q,writeFileSync as kQ}from"fs";import{homedir as vZ}from"os";import{basename as R0,join as M,parse as u0,resolve as HZ}from"path";function P(){return process.env.BEACON_HOME||M(vZ(),".beacon")}function LQ(){return M(P(),"workspaces.json")}function UQ(Q){return F0("sha256").update(Q).digest("hex").slice(0,12)}function E1(Q=process.cwd()){let Z=T0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function BZ(Q){let Z=HZ(Q);return Z!==HZ(vZ())&&Z!==u0(Z).root}function NZ(){return M(P(),"deleted.json")}function SQ(){try{let Q=JSON.parse(_Q(NZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function GZ(Q){k(P(),{recursive:!0}),kQ(NZ(),JSON.stringify(Q,null,2))}function PZ(Q){return SQ().includes(Q)}function D1(Q){let Z=SQ();if(!Z.includes(Q))GZ([...Z,Q])}function g0(Q){let Z=SQ();if(Z.includes(Q))GZ(Z.filter(($)=>$!==Q))}function WQ(Q){return M(P(),Q)}function E0(Q){return`file:${M(WQ(Q),"db.sqlite")}`}function L(){try{let Q=JSON.parse(_Q(LQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function hQ(Q){k(P(),{recursive:!0}),kQ(LQ(),JSON.stringify(Q,null,2))}function HQ(){return L().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function T(Q){return L().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!BZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=UQ(Q);if(PZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=L(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||R0(Q),lastOpenedAt:$},H=[q,...Y.filter((z)=>z.id!==J)];return k(WQ(J),{recursive:!0}),hQ(H),q}function I1(Q,Z){return g0(UQ(Q)),xZ(Q,Z)}function O1(Q,Z=new Date().toISOString()){let $=L(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,hQ($)}function y1(Q){if(hQ(L().filter((Z)=>Z.id!==Q)),mQ()===Q)D0(HQ()[0]?.id??null)}function KZ(){return M(P(),"active")}function mQ(){try{return _Q(KZ(),"utf8").trim()||null}catch{return null}}function D0(Q){k(P(),{recursive:!0}),kQ(KZ(),Q??"")}function A1(){let Q=mQ();return Q?T(Q):null}function b1(){let Q=y0()??mQ();return Q?T(Q):null}function _1(Q){return T(Q)?.path??null}function k1(){return jZ(LQ())}var CZ="beacon_ws";function MZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function L1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&T(Z))return Z;let $=MZ(Q,CZ);if($&&T($))return $;return I0()}function I0(){let Q=HQ();return Q.length===1?Q[0].id:null}var O0="x-beacon-workspace-path";async function S1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&T(Z))return Z;let $=Q.headers.get(O0);if($&&BZ($)&&!PZ(UQ($))&&(!Z||UQ($)===Z)){let Y=xZ($);return await A0(Y.id),Y.id}let J=MZ(Q,CZ);if(J&&T(J))return J;return null}var wZ=new f0;function h1(Q,Z){return Q?wZ.run(Q,Z):Z()}function y0(){return wZ.getStore()??null}var bQ=new Set;function m1(Q){bQ.delete(M(WQ(Q),"db.sqlite"))}async function A0(Q){let Z=WQ(Q),$=M(Z,"db.sqlite"),J=jZ($);if(J&&bQ.has($))return{ok:!0,created:!1,migrated:!1};try{k(Z,{recursive:!0});let{provisionDb:Y}=await WZ().then(() => UZ),V=await Y(E0(Q));return bQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}p();EQ();import{execSync as b0,spawnSync as TZ}from"child_process";import{existsSync as _0,readFileSync as k0}from"fs";import{join as FZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,x=(Q)=>`\x1B[2m${Q}\x1B[0m`,D=(Q)=>`
352
+ \x1B[1m${Q}\x1B[0m`;function L0(){try{return b0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function S0(){let Q=FZ(P(),"server.json");try{let Z=JSON.parse(k0(Q,"utf8"));if(!Z.pid)return j("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return j(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return j("daemon: no server.json (never started)")}}function h0(){let Q=TZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return j("bun NOT found on PATH (required to run Beacon)")}function m0(){return L0()||process.cwd()}var jQ=m0(),w=qZ(),RZ=HQ(),p0=RZ.some((Q)=>Q.path===jQ),v=p0||_0(FZ(jQ,".mcp.json"))?xQ(jQ):null;console.log(D("Beacon \xB7 doctor"));console.log(D("Runtime"));console.log(` ${h0()}`);console.log(` ${S0()}`);console.log(` ${W(`home: ${P()}`)}`);console.log(` ${W(`workspaces registered: ${RZ.length}`)}`);console.log(D("Global (~/.claude/)"));for(let Q of B)console.log(` ${w.skills[Q]?W(`skill ${Q}`):j(`skill ${Q} \u2014 missing`)}`);for(let Q of E)console.log(` ${w.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):j(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${x(Q.description)}`);console.log(` ${w.claudeMdBlock?W("global CLAUDE.md block"):j("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(D("Plugin (Claude Code)"));var fZ=n();if(fZ)if(console.log(` ${W(`installed as a Claude Code plugin \u2192 ${fZ}`)}`),console.log(` ${x("the plugin owns the Claude-side skills/hooks/MCP")}`),w.hooks.PostToolUse||B.some((Q)=>w.skills[Q]))console.log(` ${x("npm-global ~/.claude entries still present \u2014 they'll be removed automatically on the next `beacon` run (run `beacon` once to deconflict now).")}`);else console.log(` ${W("npm-global ~/.claude layer stepped aside \u2014 no double-registration")}`);else console.log(` ${x("not installed as a Claude Code plugin (using the npm `trybeacon` CLI).")}`);console.log(D("Codex (~/.codex/ + ~/.agents/)"));var G=VQ()?gQ():null;if(!G)console.log(` ${x("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=TZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):x("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of B)console.log(` ${G.skills[$]?W(`skill ${$} (~/.agents/skills)`):j(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of f)console.log(` ${G.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):j(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${x($.description)}`);console.log(` ${G.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):j("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=uQ();console.log(` ${G.mcp?W("config.toml has [mcp_servers.beacon]"):j(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(D(`Current repo (${jQ})`));if(!v)console.log(` ${x("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${v.mcpRegistered?W(".mcp.json has beacon entry"):j(".mcp.json missing beacon entry")}`),console.log(` ${v.agentsMdBlock?W("AGENTS.md has Beacon workflow block"):j("AGENTS.md missing Beacon workflow block")}`),console.log(` ${v.claudeMdImport?W("CLAUDE.md @-imports AGENTS.md"):j("CLAUDE.md does NOT @-import AGENTS.md")}`),console.log(` ${v.skills["beacon-init"]?W("skill beacon-init (repo)"):j("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${v.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):j("skill beacon-refresh (repo) \u2014 missing")}`),G)console.log(` ${v.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):j("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${v.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):j("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var c0=B.some((Q)=>!w.skills[Q])||E.some((Q)=>!w.hooks[Q.event])||!w.claudeMdBlock||(G?B.some((Q)=>!G.skills[Q])||f.some((Q)=>!G.hooks[Q.event])||!G.agentsMdBlock||!G.mcp:!1)||(v?!v.mcpRegistered||!v.agentsMdBlock||!v.claudeMdImport||!v.skills["beacon-init"]||!v.skills["beacon-refresh"]||(G?!v.codexSkills["beacon-init"]||!v.codexSkills["beacon-refresh"]:!1):!1);if(c0)console.log(`
346
353
  ${x("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${x("in this repo.")}`);console.log();