trybeacon 0.1.72 → 0.1.74

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 (432) 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 +17 -9
  4. package/.next/build-manifest.json +3 -3
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/routes-manifest.json +54 -6
  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.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +23 -22
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +23 -22
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +12 -11
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next/server/app/api/ask/answer/route.js +1 -0
  29. package/.next/server/app/api/ask/answer/route.js.nft.json +1 -0
  30. package/.next/server/app/api/ask/answer/route_client-reference-manifest.js +1 -0
  31. package/.next/server/app/api/ask/route.js +1 -0
  32. package/.next/server/app/api/ask/route.js.nft.json +1 -0
  33. package/.next/server/app/api/ask/route_client-reference-manifest.js +1 -0
  34. package/.next/server/app/api/ask/verdict/route.js +1 -0
  35. package/.next/server/app/api/ask/verdict/route.js.nft.json +1 -0
  36. package/.next/server/app/api/ask/verdict/route_client-reference-manifest.js +1 -0
  37. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  38. package/.next/server/app/api/board-annotations/route.js +1 -1
  39. package/.next/server/app/api/board-layout/route.js +1 -1
  40. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  41. package/.next/server/app/api/bug-flags/route.js +1 -1
  42. package/.next/server/app/api/changes/comment/answer/route.js +4 -0
  43. package/.next/server/app/api/changes/comment/answer/route.js.nft.json +1 -0
  44. package/.next/server/app/api/changes/comment/answer/route_client-reference-manifest.js +1 -0
  45. package/.next/server/app/api/changes/comment/claim/route.js +4 -0
  46. package/.next/server/app/api/changes/comment/claim/route.js.nft.json +1 -0
  47. package/.next/server/app/api/changes/comment/claim/route_client-reference-manifest.js +1 -0
  48. package/.next/server/app/api/changes/comment/route.js +4 -0
  49. package/.next/server/app/api/changes/comment/route.js.nft.json +1 -0
  50. package/.next/server/app/api/changes/comment/route_client-reference-manifest.js +1 -0
  51. package/.next/server/app/api/changes/quality/route.js +1 -0
  52. package/.next/server/app/api/changes/quality/route.js.nft.json +1 -0
  53. package/.next/server/app/api/changes/quality/route_client-reference-manifest.js +1 -0
  54. package/.next/server/app/api/changes/route.js +1 -0
  55. package/.next/server/app/api/{flags → changes}/route.js.nft.json +1 -1
  56. package/.next/server/app/api/changes/route_client-reference-manifest.js +1 -0
  57. package/.next/server/app/api/changes/viewed/route.js +1 -0
  58. package/.next/server/app/api/changes/viewed/route.js.nft.json +1 -0
  59. package/.next/server/app/api/changes/viewed/route_client-reference-manifest.js +1 -0
  60. package/.next/server/app/api/code-graph/position/route.js +1 -1
  61. package/.next/server/app/api/code-graph/route.js +1 -1
  62. package/.next/server/app/api/context/feature/route.js +1 -1
  63. package/.next/server/app/api/context/file/route.js +1 -1
  64. package/.next/server/app/api/context/route.js +1 -9
  65. package/.next/server/app/api/context/route.js.nft.json +1 -1
  66. package/.next/server/app/api/db/arrange/route.js +1 -1
  67. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  68. package/.next/server/app/api/db/position/route.js +1 -1
  69. package/.next/server/app/api/db/position/route.js.nft.json +1 -1
  70. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  71. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  72. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  73. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  74. package/.next/server/app/api/draft/approve/route.js +1 -1
  75. package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
  76. package/.next/server/app/api/draft/route.js +1 -1
  77. package/.next/server/app/api/draft/route.js.nft.json +1 -1
  78. package/.next/server/app/api/draft/status/route.js +1 -1
  79. package/.next/server/app/api/edges/[id]/route.js +1 -1
  80. package/.next/server/app/api/edges/route.js +1 -1
  81. package/.next/server/app/api/edges/route.js.nft.json +1 -1
  82. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  83. package/.next/server/app/api/entities/route.js +1 -1
  84. package/.next/server/app/api/ingest/route.js +1 -9
  85. package/.next/server/app/api/ingest/route.js.nft.json +1 -1
  86. package/.next/server/app/api/init/route.js +1 -9
  87. package/.next/server/app/api/init/route.js.nft.json +1 -1
  88. package/.next/server/app/api/lesson/close/route.js +1 -1
  89. package/.next/server/app/api/lesson/presence/route.js +1 -1
  90. package/.next/server/app/api/lesson/questions/route.js +1 -1
  91. package/.next/server/app/api/lesson/route.js +1 -1
  92. package/.next/server/app/api/lesson/save/route.js +1 -1
  93. package/.next/server/app/api/lesson/verdict/route.js +1 -1
  94. package/.next/server/app/api/map/describe/route.js +1 -9
  95. package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
  96. package/.next/server/app/api/map/files/route.js +1 -1
  97. package/.next/server/app/api/map/files/route.js.nft.json +1 -1
  98. package/.next/server/app/api/map/finish/route.js +1 -1
  99. package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
  100. package/.next/server/app/api/map/route.js +1 -1
  101. package/.next/server/app/api/map/route.js.nft.json +1 -1
  102. package/.next/server/app/api/map/start/route.js +1 -1
  103. package/.next/server/app/api/map/start/route.js.nft.json +1 -1
  104. package/.next/server/app/api/map/touch-active/route.js +1 -1
  105. package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
  106. package/.next/server/app/api/mention-search/route.js +1 -1
  107. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  108. package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
  109. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  110. package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
  111. package/.next/server/app/api/nodes/positions/route.js +1 -1
  112. package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
  113. package/.next/server/app/api/nodes/route.js +1 -1
  114. package/.next/server/app/api/nodes/route.js.nft.json +1 -1
  115. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  116. package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
  117. package/.next/server/app/api/notes/[id]/route.js +1 -1
  118. package/.next/server/app/api/notes/route.js +1 -1
  119. package/.next/server/app/api/open/route.js +1 -1
  120. package/.next/server/app/api/plan/annotations/route.js +2 -2
  121. package/.next/server/app/api/plan/approve/route.js +1 -9
  122. package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
  123. package/.next/server/app/api/plan/history/route.js +1 -1
  124. package/.next/server/app/api/plan/markdown/route.js +1 -1
  125. package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
  126. package/.next/server/app/api/plan/presence/route.js +1 -1
  127. package/.next/server/app/api/plan/route.js +1 -1
  128. package/.next/server/app/api/plan/route.js.nft.json +1 -1
  129. package/.next/server/app/api/plan/verdict/route.js +1 -1
  130. package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
  131. package/.next/server/app/api/preferences/route.js +1 -1
  132. package/.next/server/app/api/project-meta/route.js +1 -1
  133. package/.next/server/app/api/reset/route.js +1 -1
  134. package/.next/server/app/api/scope-guard/check/route.js +4 -1
  135. package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -1
  136. package/.next/server/app/api/share/create/route.js +1 -1
  137. package/.next/server/app/api/share/create/route.js.nft.json +1 -1
  138. package/.next/server/app/api/share/route.js +1 -1
  139. package/.next/server/app/api/stream/route.js +2 -2
  140. package/.next/server/app/api/tab/nav/route.js +1 -1
  141. package/.next/server/app/api/tab/presence/route.js +1 -1
  142. package/.next/server/app/api/telemetry/route.js +1 -1
  143. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  144. package/.next/server/app/api/version/route.js +1 -1
  145. package/.next/server/app/api/workspace/activate/route.js +1 -1
  146. package/.next/server/app/api/workspace/route.js +1 -1
  147. package/.next/server/app/apple-icon.png/route.js +1 -1
  148. package/.next/server/app/docs/page.js +2 -2
  149. package/.next/server/app/docs/page.js.nft.json +1 -1
  150. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  151. package/.next/server/app/docs.html +1 -1
  152. package/.next/server/app/docs.rsc +24 -23
  153. package/.next/server/app/docs.segments/_full.segment.rsc +24 -23
  154. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  155. package/.next/server/app/docs.segments/_index.segment.rsc +12 -11
  156. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  157. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  158. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  159. package/.next/server/app/help/page.js +2 -2
  160. package/.next/server/app/help/page.js.nft.json +1 -1
  161. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/help.html +1 -1
  163. package/.next/server/app/help.rsc +32 -31
  164. package/.next/server/app/help.segments/_full.segment.rsc +32 -31
  165. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  166. package/.next/server/app/help.segments/_index.segment.rsc +12 -11
  167. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  168. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  169. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  170. package/.next/server/app/icon.svg/route.js +1 -1
  171. package/.next/server/app/index.html +1 -1
  172. package/.next/server/app/index.rsc +22 -21
  173. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  174. package/.next/server/app/index.segments/_full.segment.rsc +22 -21
  175. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  176. package/.next/server/app/index.segments/_index.segment.rsc +12 -11
  177. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  178. package/.next/server/app/learn/page.js +3 -3
  179. package/.next/server/app/learn/page.js.nft.json +1 -1
  180. package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
  181. package/.next/server/app/map/page.js +2 -2
  182. package/.next/server/app/map/page.js.nft.json +1 -1
  183. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  184. package/.next/server/app/page.js +2 -2
  185. package/.next/server/app/page.js.nft.json +1 -1
  186. package/.next/server/app/page_client-reference-manifest.js +1 -1
  187. package/.next/server/app/plan/page.js +12 -2
  188. package/.next/server/app/plan/page.js.nft.json +1 -1
  189. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/s/[token]/page.js +2 -2
  191. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  192. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  193. package/.next/server/app/settings/page.js +2 -2
  194. package/.next/server/app/settings/page.js.nft.json +1 -1
  195. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app-paths-manifest.json +17 -9
  197. package/.next/server/chunks/1130.js +1 -1
  198. package/.next/server/chunks/2031.js +1 -0
  199. package/.next/server/chunks/230.js +1 -0
  200. package/.next/server/chunks/2693.js +8 -0
  201. package/.next/server/chunks/374.js +1 -0
  202. package/.next/server/chunks/5295.js +1 -0
  203. package/.next/server/chunks/{4700.js → 5704.js} +2 -2
  204. package/.next/server/chunks/6469.js +10 -0
  205. package/.next/server/chunks/6962.js +1 -0
  206. package/.next/server/chunks/8227.js +1 -0
  207. package/.next/server/chunks/8674.js +7 -0
  208. package/.next/server/middleware-build-manifest.js +1 -1
  209. package/.next/server/pages/404.html +1 -1
  210. package/.next/server/pages/500.html +1 -1
  211. package/.next/server/server-reference-manifest.js +1 -1
  212. package/.next/server/server-reference-manifest.json +1 -1
  213. package/.next/static/chunks/3151-861a6caa40f70f79.js +1 -0
  214. package/.next/static/chunks/3908-80efc60050779adf.js +1 -0
  215. package/.next/static/chunks/5697-5b9719b81806b4cf.js +1 -0
  216. package/.next/static/chunks/654-8e68a43e4c589e9c.js +1 -0
  217. package/.next/static/chunks/7424-d7fa15ef452064dd.js +1 -0
  218. package/.next/static/chunks/app/_global-error/page-d54a69e7dc6b4008.js +1 -0
  219. package/.next/static/chunks/app/api/ask/answer/route-d54a69e7dc6b4008.js +1 -0
  220. package/.next/static/chunks/app/api/ask/route-d54a69e7dc6b4008.js +1 -0
  221. package/.next/static/chunks/app/api/ask/verdict/route-d54a69e7dc6b4008.js +1 -0
  222. package/.next/static/chunks/app/api/board-annotations/[id]/route-d54a69e7dc6b4008.js +1 -0
  223. package/.next/static/chunks/app/api/board-annotations/route-d54a69e7dc6b4008.js +1 -0
  224. package/.next/static/chunks/app/api/board-layout/route-d54a69e7dc6b4008.js +1 -0
  225. package/.next/static/chunks/app/api/bug-flags/[id]/route-d54a69e7dc6b4008.js +1 -0
  226. package/.next/static/chunks/app/api/bug-flags/route-d54a69e7dc6b4008.js +1 -0
  227. package/.next/static/chunks/app/api/changes/comment/answer/route-d54a69e7dc6b4008.js +1 -0
  228. package/.next/static/chunks/app/api/changes/comment/claim/route-d54a69e7dc6b4008.js +1 -0
  229. package/.next/static/chunks/app/api/changes/comment/route-d54a69e7dc6b4008.js +1 -0
  230. package/.next/static/chunks/app/api/changes/quality/route-d54a69e7dc6b4008.js +1 -0
  231. package/.next/static/chunks/app/api/changes/route-d54a69e7dc6b4008.js +1 -0
  232. package/.next/static/chunks/app/api/changes/viewed/route-d54a69e7dc6b4008.js +1 -0
  233. package/.next/static/chunks/app/api/code-graph/position/route-d54a69e7dc6b4008.js +1 -0
  234. package/.next/static/chunks/app/api/code-graph/route-d54a69e7dc6b4008.js +1 -0
  235. package/.next/static/chunks/app/api/context/feature/route-d54a69e7dc6b4008.js +1 -0
  236. package/.next/static/chunks/app/api/context/file/route-d54a69e7dc6b4008.js +1 -0
  237. package/.next/static/chunks/app/api/context/route-d54a69e7dc6b4008.js +1 -0
  238. package/.next/static/chunks/app/api/db/arrange/route-d54a69e7dc6b4008.js +1 -0
  239. package/.next/static/chunks/app/api/db/backfill-access/route-d54a69e7dc6b4008.js +1 -0
  240. package/.next/static/chunks/app/api/db/position/route-d54a69e7dc6b4008.js +1 -0
  241. package/.next/static/chunks/app/api/db/prune-planned/route-d54a69e7dc6b4008.js +1 -0
  242. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-d54a69e7dc6b4008.js +1 -0
  243. package/.next/static/chunks/app/api/db/relations/[id]/route-d54a69e7dc6b4008.js +1 -0
  244. package/.next/static/chunks/app/api/db/tables/[id]/route-d54a69e7dc6b4008.js +1 -0
  245. package/.next/static/chunks/app/api/draft/approve/route-d54a69e7dc6b4008.js +1 -0
  246. package/.next/static/chunks/app/api/draft/route-d54a69e7dc6b4008.js +1 -0
  247. package/.next/static/chunks/app/api/draft/status/route-d54a69e7dc6b4008.js +1 -0
  248. package/.next/static/chunks/app/api/edges/[id]/route-d54a69e7dc6b4008.js +1 -0
  249. package/.next/static/chunks/app/api/edges/route-d54a69e7dc6b4008.js +1 -0
  250. package/.next/static/chunks/app/api/endpoints/[id]/route-d54a69e7dc6b4008.js +1 -0
  251. package/.next/static/chunks/app/api/entities/route-d54a69e7dc6b4008.js +1 -0
  252. package/.next/static/chunks/app/api/ingest/route-d54a69e7dc6b4008.js +1 -0
  253. package/.next/static/chunks/app/api/init/route-d54a69e7dc6b4008.js +1 -0
  254. package/.next/static/chunks/app/api/lesson/close/route-d54a69e7dc6b4008.js +1 -0
  255. package/.next/static/chunks/app/api/lesson/presence/route-d54a69e7dc6b4008.js +1 -0
  256. package/.next/static/chunks/app/api/lesson/questions/route-d54a69e7dc6b4008.js +1 -0
  257. package/.next/static/chunks/app/api/lesson/route-d54a69e7dc6b4008.js +1 -0
  258. package/.next/static/chunks/app/api/lesson/save/route-d54a69e7dc6b4008.js +1 -0
  259. package/.next/static/chunks/app/api/lesson/verdict/route-d54a69e7dc6b4008.js +1 -0
  260. package/.next/static/chunks/app/api/map/describe/route-d54a69e7dc6b4008.js +1 -0
  261. package/.next/static/chunks/app/api/map/files/route-d54a69e7dc6b4008.js +1 -0
  262. package/.next/static/chunks/app/api/map/finish/route-d54a69e7dc6b4008.js +1 -0
  263. package/.next/static/chunks/app/api/map/route-d54a69e7dc6b4008.js +1 -0
  264. package/.next/static/chunks/app/api/map/start/route-d54a69e7dc6b4008.js +1 -0
  265. package/.next/static/chunks/app/api/map/touch-active/route-d54a69e7dc6b4008.js +1 -0
  266. package/.next/static/chunks/app/api/mention-search/route-d54a69e7dc6b4008.js +1 -0
  267. package/.next/static/chunks/app/api/nodes/[id]/position/route-d54a69e7dc6b4008.js +1 -0
  268. package/.next/static/chunks/app/api/nodes/[id]/route-d54a69e7dc6b4008.js +1 -0
  269. package/.next/static/chunks/app/api/nodes/positions/route-d54a69e7dc6b4008.js +1 -0
  270. package/.next/static/chunks/app/api/nodes/route-d54a69e7dc6b4008.js +1 -0
  271. package/.next/static/chunks/app/api/nodes/subtasks/route-d54a69e7dc6b4008.js +1 -0
  272. package/.next/static/chunks/app/api/notes/[id]/route-d54a69e7dc6b4008.js +1 -0
  273. package/.next/static/chunks/app/api/notes/route-d54a69e7dc6b4008.js +1 -0
  274. package/.next/static/chunks/app/api/open/route-d54a69e7dc6b4008.js +1 -0
  275. package/.next/static/chunks/app/api/plan/annotations/route-d54a69e7dc6b4008.js +1 -0
  276. package/.next/static/chunks/app/api/plan/approve/route-d54a69e7dc6b4008.js +1 -0
  277. package/.next/static/chunks/app/api/plan/history/route-d54a69e7dc6b4008.js +1 -0
  278. package/.next/static/chunks/app/api/plan/markdown/route-d54a69e7dc6b4008.js +1 -0
  279. package/.next/static/chunks/app/api/plan/presence/route-d54a69e7dc6b4008.js +1 -0
  280. package/.next/static/chunks/app/api/plan/route-d54a69e7dc6b4008.js +1 -0
  281. package/.next/static/chunks/app/api/plan/verdict/route-d54a69e7dc6b4008.js +1 -0
  282. package/.next/static/chunks/app/api/preferences/route-d54a69e7dc6b4008.js +1 -0
  283. package/.next/static/chunks/app/api/project-meta/route-d54a69e7dc6b4008.js +1 -0
  284. package/.next/static/chunks/app/api/reset/route-d54a69e7dc6b4008.js +1 -0
  285. package/.next/static/chunks/app/api/scope-guard/check/route-d54a69e7dc6b4008.js +1 -0
  286. package/.next/static/chunks/app/api/share/create/route-d54a69e7dc6b4008.js +1 -0
  287. package/.next/static/chunks/app/api/share/route-d54a69e7dc6b4008.js +1 -0
  288. package/.next/static/chunks/app/api/stream/route-d54a69e7dc6b4008.js +1 -0
  289. package/.next/static/chunks/app/api/tab/nav/route-d54a69e7dc6b4008.js +1 -0
  290. package/.next/static/chunks/app/api/tab/presence/route-d54a69e7dc6b4008.js +1 -0
  291. package/.next/static/chunks/app/api/telemetry/route-d54a69e7dc6b4008.js +1 -0
  292. package/.next/static/chunks/app/api/telemetry/stats/route-d54a69e7dc6b4008.js +1 -0
  293. package/.next/static/chunks/app/api/version/route-d54a69e7dc6b4008.js +1 -0
  294. package/.next/static/chunks/app/api/workspace/activate/route-d54a69e7dc6b4008.js +1 -0
  295. package/.next/static/chunks/app/api/workspace/route-d54a69e7dc6b4008.js +1 -0
  296. package/.next/static/chunks/app/layout-f908dc26e06f4302.js +1 -0
  297. package/.next/static/chunks/app/learn/{page-e5bd3257170098e7.js → page-bc40746566d115e5.js} +1 -1
  298. package/.next/static/chunks/app/map/{page-5ab46e5ea28ecd79.js → page-233ccd830873114b.js} +1 -1
  299. package/.next/static/chunks/app/plan/page-8ec1e1d8ea40686a.js +11 -0
  300. package/.next/static/chunks/app/s/[token]/{page-8e4ffccdf7cd0309.js → page-2a3f04bc3f60ec49.js} +1 -1
  301. package/.next/static/chunks/app/settings/page-a751eabdd933f685.js +1 -0
  302. package/.next/static/chunks/next/dist/client/components/builtin/app-error-d54a69e7dc6b4008.js +1 -0
  303. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d54a69e7dc6b4008.js +1 -0
  304. package/.next/static/chunks/next/dist/client/components/builtin/not-found-d54a69e7dc6b4008.js +1 -0
  305. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d54a69e7dc6b4008.js +1 -0
  306. package/.next/static/chunks/{webpack-de4a0d9611ec2cad.js → webpack-6c27b0ed1ac1459c.js} +1 -1
  307. package/.next/static/css/60048003a8c96562.css +1 -0
  308. package/.next/static/css/a5d17568738ef1e9.css +1 -0
  309. package/.next/static/yescmIM6BeSzGgwZ-Dwpq/_buildManifest.js +1 -0
  310. package/.next/trace +46 -43
  311. package/.next/trace-build +1 -1
  312. package/.next/types/app/api/ask/answer/route.ts +351 -0
  313. package/.next/types/app/api/{flags → ask}/route.ts +3 -3
  314. package/.next/types/app/api/ask/verdict/route.ts +351 -0
  315. package/.next/types/app/api/changes/comment/answer/route.ts +351 -0
  316. package/.next/types/app/api/changes/comment/claim/route.ts +351 -0
  317. package/.next/types/app/api/changes/comment/route.ts +351 -0
  318. package/.next/types/app/api/changes/quality/route.ts +351 -0
  319. package/.next/types/app/api/changes/route.ts +351 -0
  320. package/.next/types/app/api/changes/viewed/route.ts +351 -0
  321. package/.next/types/routes.d.ts +10 -2
  322. package/.next/types/validator.ts +81 -9
  323. package/bun.lock +54 -0
  324. package/dist/bin/answer.js +8 -0
  325. package/dist/bin/ask.js +5 -0
  326. package/dist/bin/beacon.js +5 -5
  327. package/dist/bin/doctor.js +36 -35
  328. package/dist/bin/guard.js +1 -1
  329. package/dist/bin/hook.js +33 -32
  330. package/dist/bin/mcp.js +45 -44
  331. package/dist/bin/plan.js +36 -35
  332. package/dist/bin/remove.js +6 -6
  333. package/dist/bin/stop-hook.js +7 -3
  334. package/dist/bin/uninstall.js +35 -34
  335. package/dist/lib/assets.js +25 -24
  336. package/dist/lib/codex-install.js +32 -31
  337. package/dist/lib/global-install.js +33 -32
  338. package/dist/lib/telemetry.js +1 -1
  339. package/dist/lib/workspaces.js +1 -1
  340. package/package.json +3 -1
  341. package/plugin/skills/beacon-plan/SKILL.md +5 -4
  342. package/.next/server/app/api/flags/route.js +0 -1
  343. package/.next/server/app/api/flags/route_client-reference-manifest.js +0 -1
  344. package/.next/server/chunks/3098.js +0 -1
  345. package/.next/server/chunks/3221.js +0 -5
  346. package/.next/server/chunks/4307.js +0 -1
  347. package/.next/server/chunks/5719.js +0 -1
  348. package/.next/server/chunks/7604.js +0 -1
  349. package/.next/static/chunks/2231-63ad38ec8fb7cb6f.js +0 -1
  350. package/.next/static/chunks/2416-dbbbff4e4c9abad1.js +0 -1
  351. package/.next/static/chunks/766-242213d211df0afd.js +0 -1
  352. package/.next/static/chunks/8997-78a359d0d238622e.js +0 -1
  353. package/.next/static/chunks/app/_global-error/page-93569b5eb93a61e9.js +0 -1
  354. package/.next/static/chunks/app/api/board-annotations/[id]/route-93569b5eb93a61e9.js +0 -1
  355. package/.next/static/chunks/app/api/board-annotations/route-93569b5eb93a61e9.js +0 -1
  356. package/.next/static/chunks/app/api/board-layout/route-93569b5eb93a61e9.js +0 -1
  357. package/.next/static/chunks/app/api/bug-flags/[id]/route-93569b5eb93a61e9.js +0 -1
  358. package/.next/static/chunks/app/api/bug-flags/route-93569b5eb93a61e9.js +0 -1
  359. package/.next/static/chunks/app/api/code-graph/position/route-93569b5eb93a61e9.js +0 -1
  360. package/.next/static/chunks/app/api/code-graph/route-93569b5eb93a61e9.js +0 -1
  361. package/.next/static/chunks/app/api/context/feature/route-93569b5eb93a61e9.js +0 -1
  362. package/.next/static/chunks/app/api/context/file/route-93569b5eb93a61e9.js +0 -1
  363. package/.next/static/chunks/app/api/context/route-93569b5eb93a61e9.js +0 -1
  364. package/.next/static/chunks/app/api/db/arrange/route-93569b5eb93a61e9.js +0 -1
  365. package/.next/static/chunks/app/api/db/backfill-access/route-93569b5eb93a61e9.js +0 -1
  366. package/.next/static/chunks/app/api/db/position/route-93569b5eb93a61e9.js +0 -1
  367. package/.next/static/chunks/app/api/db/prune-planned/route-93569b5eb93a61e9.js +0 -1
  368. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-93569b5eb93a61e9.js +0 -1
  369. package/.next/static/chunks/app/api/db/relations/[id]/route-93569b5eb93a61e9.js +0 -1
  370. package/.next/static/chunks/app/api/db/tables/[id]/route-93569b5eb93a61e9.js +0 -1
  371. package/.next/static/chunks/app/api/draft/approve/route-93569b5eb93a61e9.js +0 -1
  372. package/.next/static/chunks/app/api/draft/route-93569b5eb93a61e9.js +0 -1
  373. package/.next/static/chunks/app/api/draft/status/route-93569b5eb93a61e9.js +0 -1
  374. package/.next/static/chunks/app/api/edges/[id]/route-93569b5eb93a61e9.js +0 -1
  375. package/.next/static/chunks/app/api/edges/route-93569b5eb93a61e9.js +0 -1
  376. package/.next/static/chunks/app/api/endpoints/[id]/route-93569b5eb93a61e9.js +0 -1
  377. package/.next/static/chunks/app/api/entities/route-93569b5eb93a61e9.js +0 -1
  378. package/.next/static/chunks/app/api/flags/route-93569b5eb93a61e9.js +0 -1
  379. package/.next/static/chunks/app/api/ingest/route-93569b5eb93a61e9.js +0 -1
  380. package/.next/static/chunks/app/api/init/route-93569b5eb93a61e9.js +0 -1
  381. package/.next/static/chunks/app/api/lesson/close/route-93569b5eb93a61e9.js +0 -1
  382. package/.next/static/chunks/app/api/lesson/presence/route-93569b5eb93a61e9.js +0 -1
  383. package/.next/static/chunks/app/api/lesson/questions/route-93569b5eb93a61e9.js +0 -1
  384. package/.next/static/chunks/app/api/lesson/route-93569b5eb93a61e9.js +0 -1
  385. package/.next/static/chunks/app/api/lesson/save/route-93569b5eb93a61e9.js +0 -1
  386. package/.next/static/chunks/app/api/lesson/verdict/route-93569b5eb93a61e9.js +0 -1
  387. package/.next/static/chunks/app/api/map/describe/route-93569b5eb93a61e9.js +0 -1
  388. package/.next/static/chunks/app/api/map/files/route-93569b5eb93a61e9.js +0 -1
  389. package/.next/static/chunks/app/api/map/finish/route-93569b5eb93a61e9.js +0 -1
  390. package/.next/static/chunks/app/api/map/route-93569b5eb93a61e9.js +0 -1
  391. package/.next/static/chunks/app/api/map/start/route-93569b5eb93a61e9.js +0 -1
  392. package/.next/static/chunks/app/api/map/touch-active/route-93569b5eb93a61e9.js +0 -1
  393. package/.next/static/chunks/app/api/mention-search/route-93569b5eb93a61e9.js +0 -1
  394. package/.next/static/chunks/app/api/nodes/[id]/position/route-93569b5eb93a61e9.js +0 -1
  395. package/.next/static/chunks/app/api/nodes/[id]/route-93569b5eb93a61e9.js +0 -1
  396. package/.next/static/chunks/app/api/nodes/positions/route-93569b5eb93a61e9.js +0 -1
  397. package/.next/static/chunks/app/api/nodes/route-93569b5eb93a61e9.js +0 -1
  398. package/.next/static/chunks/app/api/nodes/subtasks/route-93569b5eb93a61e9.js +0 -1
  399. package/.next/static/chunks/app/api/notes/[id]/route-93569b5eb93a61e9.js +0 -1
  400. package/.next/static/chunks/app/api/notes/route-93569b5eb93a61e9.js +0 -1
  401. package/.next/static/chunks/app/api/open/route-93569b5eb93a61e9.js +0 -1
  402. package/.next/static/chunks/app/api/plan/annotations/route-93569b5eb93a61e9.js +0 -1
  403. package/.next/static/chunks/app/api/plan/approve/route-93569b5eb93a61e9.js +0 -1
  404. package/.next/static/chunks/app/api/plan/history/route-93569b5eb93a61e9.js +0 -1
  405. package/.next/static/chunks/app/api/plan/markdown/route-93569b5eb93a61e9.js +0 -1
  406. package/.next/static/chunks/app/api/plan/presence/route-93569b5eb93a61e9.js +0 -1
  407. package/.next/static/chunks/app/api/plan/route-93569b5eb93a61e9.js +0 -1
  408. package/.next/static/chunks/app/api/plan/verdict/route-93569b5eb93a61e9.js +0 -1
  409. package/.next/static/chunks/app/api/preferences/route-93569b5eb93a61e9.js +0 -1
  410. package/.next/static/chunks/app/api/project-meta/route-93569b5eb93a61e9.js +0 -1
  411. package/.next/static/chunks/app/api/reset/route-93569b5eb93a61e9.js +0 -1
  412. package/.next/static/chunks/app/api/scope-guard/check/route-93569b5eb93a61e9.js +0 -1
  413. package/.next/static/chunks/app/api/share/create/route-93569b5eb93a61e9.js +0 -1
  414. package/.next/static/chunks/app/api/share/route-93569b5eb93a61e9.js +0 -1
  415. package/.next/static/chunks/app/api/stream/route-93569b5eb93a61e9.js +0 -1
  416. package/.next/static/chunks/app/api/tab/nav/route-93569b5eb93a61e9.js +0 -1
  417. package/.next/static/chunks/app/api/tab/presence/route-93569b5eb93a61e9.js +0 -1
  418. package/.next/static/chunks/app/api/telemetry/route-93569b5eb93a61e9.js +0 -1
  419. package/.next/static/chunks/app/api/telemetry/stats/route-93569b5eb93a61e9.js +0 -1
  420. package/.next/static/chunks/app/api/version/route-93569b5eb93a61e9.js +0 -1
  421. package/.next/static/chunks/app/api/workspace/activate/route-93569b5eb93a61e9.js +0 -1
  422. package/.next/static/chunks/app/api/workspace/route-93569b5eb93a61e9.js +0 -1
  423. package/.next/static/chunks/app/layout-d3b7276f116dce46.js +0 -1
  424. package/.next/static/chunks/app/plan/page-948f3eca400e746a.js +0 -1
  425. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +0 -1
  426. package/.next/static/chunks/next/dist/client/components/builtin/app-error-93569b5eb93a61e9.js +0 -1
  427. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-93569b5eb93a61e9.js +0 -1
  428. package/.next/static/chunks/next/dist/client/components/builtin/not-found-93569b5eb93a61e9.js +0 -1
  429. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-93569b5eb93a61e9.js +0 -1
  430. package/.next/static/css/446974879473fd01.css +0 -1
  431. package/.next/static/lnOOQsWRymiliRmMEQ95F/_buildManifest.js +0 -1
  432. /package/.next/static/{lnOOQsWRymiliRmMEQ95F → yescmIM6BeSzGgwZ-Dwpq}/_ssgManifest.js +0 -0
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var EZ=Object.defineProperty;var DZ=(Q)=>Q;function bZ(Q,Z){this[Q]=DZ.bind(null,Z)}var jQ=(Q,Z)=>{for(var $ in Z)EZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:bZ.bind(Z,$)})};var f=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var m0=1500,p0=480000,c0=1800000,S=3600000,l0=3000;var cQ=()=>{};var xQ={};jQ(xQ,{removeRepoAssets:()=>NQ,installRefreshSkill:()=>OZ,installPlanSkill:()=>AZ,installInitSkill:()=>IZ,installExplainSkill:()=>yZ,installCodexRepoSkills:()=>_Z,ensureWorkflowDoc:()=>kZ,ensureMcp:()=>SZ,auditRepo:()=>hZ,REFRESH_SKILL:()=>PQ,PLAN_SKILL:()=>nQ,INIT_SKILL:()=>GQ,EXPLAIN_SKILL:()=>tQ});import{existsSync as T,mkdirSync as E,readFileSync as P,rmSync as h,writeFileSync as H}from"fs";import{join as X}from"path";function IZ(Q){let Z=X(Q,".claude","skills","beacon-init");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,GQ),$}function OZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,PQ),$}function AZ(Q){let Z=X(Q,".claude","skills","beacon-plan");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,nQ),$}function yZ(Q){let Z=X(Q,".claude","skills","beacon-explain");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,tQ),$}function _Z(Q){let Z=[];for(let $ of LZ){let J=X(Q,".agents","skills",$.name);E(J,{recursive:!0});let Y=X(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function kZ(Q){let Z=X(Q,"AGENTS.md"),$="";try{$=P(Z,"utf8")}catch{}let J=new RegExp(`${m}[\\s\\S]*?${vQ}`);$=J.test($)?$.replace(J,lQ):`${$.trim()}
4
-
5
- ${lQ}
6
- `.trimStart(),H(Z,$.endsWith(`
7
- `)?$:`${$}
8
- `);let Y=X(Q,"CLAUDE.md"),V="";try{V=P(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
9
-
10
- `:""}@AGENTS.md
11
- `)}function SZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(P(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<S)return J.timeout=S,H(Z,JSON.stringify($,null,2)+`
12
- `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:S},H(Z,JSON.stringify($,null,2)+`
13
- `),{path:Z,added:!0,updated:!1}}function hZ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(P(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=P(X(Q,"AGENTS.md"),"utf8").includes(m)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(P(X(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":T(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":T(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":T(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":T(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function NQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(T(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(T(U))h(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(P(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 H(J,JSON.stringify(z,null,2)+`
14
- `)}}catch{}let Y=!1,V=X(Q,"AGENTS.md");try{let z=P(V,"utf8"),U=new RegExp(`\\n?${m}[\\s\\S]*?${vQ}\\n?`);if(U.test(z)){let BQ=z.replace(U,`
3
+ var OZ=Object.defineProperty;var bZ=(Q)=>Q;function AZ(Q,Z){this[Q]=bZ.bind(null,Z)}var jQ=(Q,Z)=>{for(var $ in Z)OZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:AZ.bind(Z,$)})};var T=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var l0=1500,n0=480000,d0=1800000,h=3600000,t0=3000;var lQ=()=>{};var KQ={};jQ(KQ,{stripAgentsPointer:()=>aQ,removeRepoAssets:()=>xQ,installRefreshSkill:()=>LZ,installPlanSkill:()=>kZ,installInitSkill:()=>yZ,installExplainSkill:()=>_Z,installCodexRepoSkills:()=>hZ,ensureWorkflowDoc:()=>mZ,ensureMcp:()=>pZ,contextDocTargets:()=>NQ,auditRepo:()=>cZ,REFRESH_SKILL:()=>vQ,PLAN_SKILL:()=>dQ,INIT_SKILL:()=>GQ,EXPLAIN_SKILL:()=>tQ});import{existsSync as v,mkdirSync as E,readFileSync as N,rmSync as m,writeFileSync as H}from"fs";import{join as X}from"path";function yZ(Q){let Z=X(Q,".claude","skills","beacon-init");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,GQ),$}function LZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,vQ),$}function kZ(Q){let Z=X(Q,".claude","skills","beacon-plan");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,dQ),$}function _Z(Q){let Z=X(Q,".claude","skills","beacon-explain");E(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,tQ),$}function hZ(Q){let Z=[];for(let $ of SZ){let J=X(Q,".agents","skills",$.name);E(J,{recursive:!0});let Y=X(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function NQ(Q){let Z=X(Q,"AGENTS.md"),$=X(Q,"CLAUDE.md"),J=v(Z),Y=v($);if(!J&&!Y)return[Z,$];let V=[];if(J)V.push(Z);if(Y)V.push($);return V}function aQ(Q){let Z=X(Q,"CLAUDE.md");if(!v(Z))return;let $=N(Z,"utf8"),J=$.split(`
4
+ `).filter((Y)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Y)).join(`
5
+ `).trim();if(J&&J!==$.trim())H(Z,`${J}
6
+ `)}function mZ(Q){let Z=new RegExp(`${p}[\\s\\S]*?${PQ}`);for(let $ of NQ(Q)){let J="";try{J=N($,"utf8")}catch{}J=Z.test(J)?J.replace(Z,nQ):`${J.trim()}
7
+
8
+ ${nQ}
9
+ `.trimStart(),H($,J.endsWith(`
10
+ `)?J:`${J}
11
+ `)}aQ(Q)}function pZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(N(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<h)return J.timeout=h,H(Z,JSON.stringify($,null,2)+`
12
+ `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:h},H(Z,JSON.stringify($,null,2)+`
13
+ `),{path:Z,added:!0,updated:!1}}function cZ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(N(Z,"utf8")).mcpServers?.beacon}catch{}let J=NQ(Q).some((Y)=>{try{return N(Y,"utf8").includes(p)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:J,skills:{"beacon-init":v(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",z);if(v(U))m(U,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",z);if(v(U))m(U,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(N(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)m(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let Y=!1,V=new RegExp(`\\n?${p}[\\s\\S]*?${PQ}\\n?`);for(let z of[X(Q,"AGENTS.md"),X(Q,"CLAUDE.md")])try{let U=N(z,"utf8");if(V.test(U)){let BQ=U.replace(V,`
15
15
  `).replace(/\n{3,}/g,`
16
16
 
17
- `).trimStart();H(V,BQ.endsWith(`
17
+ `).trimStart();H(z,BQ.endsWith(`
18
18
  `)?BQ:`${BQ}
19
- `),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=P(W,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())h(W,{force:!0});else H(W,U);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var GQ=`---
19
+ `),Y=!0}}catch{}let q=!1,W=X(Q,"CLAUDE.md");try{let z=N(W,"utf8"),U=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==z){if(!U.trim())m(W,{force:!0});else H(W,U);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var GQ=`---
20
20
  name: beacon-init
21
21
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
22
22
  ---
@@ -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
+ `,vQ=`---
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
  ---
@@ -110,7 +110,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
110
110
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
111
111
 
112
112
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
113
- `,nQ=`---
113
+ `,dQ=`---
114
114
  name: beacon-plan
115
115
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
116
116
  ---
@@ -139,10 +139,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
139
139
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
140
140
 
141
141
  - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
142
- \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
143
- has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
144
- implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
145
- to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
142
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
143
+ frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
144
+ for the user's authorization (which then adds it to the contract), and the /plan Changes view
145
+ groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
146
+ (if omitted, the scope is inferred from the files you name in backticks).
146
147
 
147
148
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
148
149
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
@@ -228,7 +229,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
228
229
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
229
230
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
230
231
  the lesson.
231
- `,LZ,m="<!-- beacon:workflow:start -->",vQ="<!-- beacon:workflow:end -->",lQ;var p=f(()=>{cQ();LZ=[{name:"beacon-init",body:()=>GQ},{name:"beacon-refresh",body:()=>PQ}];lQ=`${m}
232
+ `,SZ,p="<!-- beacon:workflow:start -->",PQ="<!-- beacon:workflow:end -->",nQ;var c=T(()=>{lQ();SZ=[{name:"beacon-init",body:()=>GQ},{name:"beacon-refresh",body:()=>vQ}];nQ=`${p}
232
233
  ## Beacon \u2014 feature workflow
233
234
 
234
235
  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:
@@ -300,18 +301,18 @@ Register them all in that single batched call. If a plan added five features, th
300
301
  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.
301
302
 
302
303
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
303
- ${vQ}`});import{existsSync as c,mkdirSync as KQ,readdirSync as mZ,readFileSync as w,rmSync as pZ,writeFileSync as l}from"fs";import{dirname as dQ,join as N}from"path";function sQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function aQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=N(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=N(V,".claude-plugin","plugin.json");try{if(c(q)&&JSON.parse(w(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of mZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(N(V,W.name))}catch{}}$=Y}return null}function rQ(Q){return aQ(Q)!==null}function cZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function lZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(w(N(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 uQ(Q){try{return JSON.parse(w(Q,"utf8"))}catch{return{}}}function oQ(Q,Z){KQ(dQ(Q),{recursive:!0}),l(Q,JSON.stringify(Z,null,2)+`
304
- `)}function t(Q,Z){let $=uQ(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}]}),oQ(Q,$),!0}function d(Q,Z){return(uQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function s(Q,Z){let $=uQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((U)=>U.command!==Z.command);if(z.length!==W)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 oQ(Q,$),!0}function a(Q,Z,$,J){let Y=`${Z}
304
+ ${PQ}`});import{existsSync as l,mkdirSync as uQ,readdirSync as lZ,readFileSync as w,rmSync as nZ,writeFileSync as n}from"fs";import{dirname as sQ,join as x}from"path";function rQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function oQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=x(Q,".claude","plugins");if(!l(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let q=x(V,".claude-plugin","plugin.json");try{if(l(q)&&JSON.parse(w(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of lZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(x(V,W.name))}catch{}}$=Y}return null}function iQ(Q){return oQ(Q)!==null}function dZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function tZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(w(x(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(w(Q,"utf8"))}catch{return{}}}function eQ(Q,Z){uQ(sQ(Q),{recursive:!0}),n(Q,JSON.stringify(Z,null,2)+`
305
+ `)}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}]}),eQ(Q,$),!0}function a(Q,Z){return(MQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function s(Q,Z){let $=MQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((U)=>U.command!==Z.command);if(z.length!==W)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 eQ(Q,$),!0}function r(Q,Z,$,J){let Y=`${Z}
305
306
  ${J.trim()}
306
307
  ${$}`,V="";try{V=w(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
307
308
 
308
309
  ${Y}
309
310
  `:`${Y}
310
- `,KQ(dQ(Q),{recursive:!0}),l(Q,V.endsWith(`
311
+ `,uQ(sQ(Q),{recursive:!0}),n(Q,V.endsWith(`
311
312
  `)?V:`${V}
312
- `)}function D(Q,Z){try{return w(Q,"utf8").includes(Z)}catch{return!1}}function r(Q,Z,$){let J="";try{J=w(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,`
313
+ `)}function I(Q,Z){try{return w(Q,"utf8").includes(Z)}catch{return!1}}function o(Q,Z,$){let J="";try{J=w(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,`
313
314
 
314
- `).trimStart();return l(Q,V),!0}function o(Q,Z,$){let J=N(Q,Z);KQ(J,{recursive:!0});let Y=N(J,"SKILL.md");return l(Y,$),Y}function b(Q,Z){return c(N(Q,Z,"SKILL.md"))}function i(Q,Z){let $=N(Q,Z);if(!c($))return!1;return pZ($,{recursive:!0,force:!0}),!0}var B,n=`## Beacon (visual planning panel)
315
+ `).trimStart();return n(Q,V),!0}function i(Q,Z,$){let J=x(Q,Z);uQ(J,{recursive:!0});let Y=x(J,"SKILL.md");return n(Y,$),Y}function D(Q,Z){return l(x(Q,Z,"SKILL.md"))}function e(Q,Z){let $=x(Q,Z);if(!l($))return!1;return nZ($,{recursive:!0,force:!0}),!0}var B,d=`## Beacon (visual planning panel)
315
316
 
316
317
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
317
318
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -335,20 +336,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
335
336
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
336
337
  on the /map and /db boards (added features, attached subtasks, edited columns, new
337
338
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
338
- verbatim. Do NOT implement until the tool returns approval.`;var CQ=f(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as nZ,renameSync as tZ,rmSync as dZ,writeFileSync as sZ}from"fs";import{dirname as aZ}from"path";function e(Q,Z){nZ(aZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{sZ($,Z),tZ($,Q)}catch(J){throw dZ($,{force:!0}),J}}function Q1(Q,Z,$=!1){e(Q,JSON.stringify(Z,null,$?2:void 0))}var iQ=()=>{};var zZ={};jQ(zZ,{setupCodexAssets:()=>eZ,removeCodexMcp:()=>VZ,removeCodexArtifacts:()=>FQ,hasCodexMcp:()=>wQ,ensureCodexMcp:()=>YZ,codexMcpProblem:()=>iZ,codexDetected:()=>ZZ,auditCodex:()=>RQ,CODEX_HOOKS:()=>F});import{readFileSync as JQ}from"fs";import{homedir as rZ}from"os";import{join as A}from"path";function eQ(){return process.env.HOME||process.env.USERPROFILE||rZ()}function ZZ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(MQ===void 0)MQ=Bun.which("codex")!==null;return MQ}function O(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function wQ(){try{return Boolean(O(JQ(R(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function iZ(){let Q="";try{Q=JQ(R(),"utf8")}catch{return null}let Z=O(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${I}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${I}`;return null}function YZ(){let Q="",Z=!1;try{Q=JQ(R(),"utf8"),Z=!0}catch{}if(Z){let V=O(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${I}`};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 ${I}`}}let $=!Q?"":Q.endsWith(`
339
+ verbatim. Do NOT implement until the tool returns approval.`;var CQ=T(()=>{B=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as aZ,renameSync as sZ,rmSync as rZ,writeFileSync as oZ}from"fs";import{dirname as iZ}from"path";function QQ(Q,Z){aZ(iZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{oZ($,Z),sZ($,Q)}catch(J){throw rZ($,{force:!0}),J}}function J1(Q,Z,$=!1){QQ(Q,JSON.stringify(Z,null,$?2:void 0))}var QZ=()=>{};var XZ={};jQ(XZ,{setupCodexAssets:()=>$0,removeCodexMcp:()=>qZ,removeCodexArtifacts:()=>gQ,hasCodexMcp:()=>RQ,ensureCodexMcp:()=>zZ,codexMcpProblem:()=>Z0,codexDetected:()=>JZ,auditCodex:()=>FQ,CODEX_HOOKS:()=>F});import{readFileSync as YQ}from"fs";import{homedir as eZ}from"os";import{join as A}from"path";function ZZ(){return process.env.HOME||process.env.USERPROFILE||eZ()}function JZ(){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(R(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Z0(){let Q="";try{Q=YQ(R(),"utf8")}catch{return null}let Z=b(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${O}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${O}`;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 ${O}`};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 ${O}`}}let $=!Q?"":Q.endsWith(`
339
340
  `)?`
340
341
  `:`
341
342
 
342
- `,J=Q+$+oZ;if(O(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return e(R(),J),{added:!0}}function VZ(){let Q="";try{Q=JQ(R(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
343
- `),$=Z.indexOf($Z);if($===-1)return{removed:!1,skipped:wQ()};let J=Z.indexOf(JZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
343
+ `,J=Q+$+Q0;if(b(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${O}`};return QQ(R(),J),{added:!0}}function qZ(){let Q="";try{Q=YQ(R(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
344
+ `),$=Z.indexOf(YZ);if($===-1)return{removed:!1,skipped:RQ()};let J=Z.indexOf(VZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
344
345
  `).replace(/\n{3,}/g,`
345
346
 
346
- `).replace(/^\n+/,"");if(O(Y)===null)return{removed:!1,skipped:!0};return e(R(),Y),{removed:!0}}async function eZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),xQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of B){if(!b(ZQ(),U))V.push(U);o(ZQ(),U,Y[U])}let q=0;for(let U of F)if(t(TQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let W=D(QQ(),$Q);a(QQ(),$Q,QZ,n);let z=YZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function RQ(){let Q={};for(let $ of B)Q[$]=b(ZQ(),$);let Z={};for(let $ of F)Z[$.event]=d(TQ(),{event:$.event,command:$.command});return{detected:ZZ(),skills:Q,hooks:Z,agentsMdBlock:D(QQ(),$Q),mcp:wQ()}}function FQ(){let Q=[];for(let Y of B)if(i(ZQ(),Y))Q.push(Y);let Z=0;for(let Y of F)if(s(TQ(),{event:Y.event,command:Y.command}))Z++;let $=r(QQ(),$Q,QZ),J=VZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var fQ=()=>A(eQ(),".codex"),TQ=()=>A(fQ(),"hooks.json"),R=()=>A(fQ(),"config.toml"),QQ=()=>A(fQ(),"AGENTS.md"),ZQ=()=>A(eQ(),".agents","skills"),$Q="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->",F,MQ,$Z="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",JZ="# beacon:end",oZ,I="add it manually: codex mcp add beacon -- beacon mcp";var gQ=f(()=>{CQ();iQ();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."}];oZ=`${$Z}
347
+ `).replace(/^\n+/,"");if(b(Y)===null)return{removed:!1,skipped:!0};return QQ(R(),Y),{removed:!0}}async function $0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (c(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of B){if(!D($Q(),U))V.push(U);i($Q(),U,Y[U])}let q=0;for(let U of F)if(t(wQ(),{event:U.event,matcher:U.matcher,command:U.command}))q++;let W=I(ZQ(),JQ);r(ZQ(),JQ,$Z,d);let z=zZ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function FQ(){let Q={};for(let $ of B)Q[$]=D($Q(),$);let Z={};for(let $ of F)Z[$.event]=a(wQ(),{event:$.event,command:$.command});return{detected:JZ(),skills:Q,hooks:Z,agentsMdBlock:I(ZQ(),JQ),mcp:RQ()}}function gQ(){let Q=[];for(let Y of B)if(e($Q(),Y))Q.push(Y);let Z=0;for(let Y of F)if(s(wQ(),{event:Y.event,command:Y.command}))Z++;let $=o(ZQ(),JQ,$Z),J=qZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var TQ=()=>A(ZZ(),".codex"),wQ=()=>A(TQ(),"hooks.json"),R=()=>A(TQ(),"config.toml"),ZQ=()=>A(TQ(),"AGENTS.md"),$Q=()=>A(ZZ(),".agents","skills"),JQ="<!-- beacon:global:start -->",$Z="<!-- beacon:global:end -->",F,fQ,YZ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",VZ="# beacon:end",Q0,O="add it manually: codex mcp add beacon -- beacon mcp";var EQ=T(()=>{CQ();QZ();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."}];Q0=`${YZ}
347
348
  [mcp_servers.beacon]
348
349
  command = "beacon"
349
350
  args = ["mcp"]
350
- ${JZ}
351
- `});var BZ={};jQ(BZ,{provisionDb:()=>f0});import{createClient as B0}from"@libsql/client";import{drizzle as j0}from"drizzle-orm/libsql";import{migrate as G0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as P0}from"drizzle-orm/migrator";import{dirname as AQ,join as v0}from"path";import{fileURLToPath as N0}from"url";async function zQ(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 HZ(Q){if(!await zQ(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(u0)){if(!await zQ(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 f0(Q,Z=K0){let $=B0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await zQ($,"__drizzle_migrations"),Y=await zQ($,"Node"),V=!1;if(Y&&!J){let W=P0({migrationsFolder:Z})[0];if(W)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:[W.hash,W.folderMillis]}),V=!0}let q=await HZ($);if(await G0(j0($),{migrationsFolder:Z}),await HZ($)>q)V=!0;return await M0($),{migrated:V}}finally{$.close()}}var x0,K0,u0;var jZ=f(async()=>{x0=AQ(AQ(AQ(N0(import.meta.url)))),K0=process.env.BEACON_MIGRATIONS_DIR||v0(x0,"drizzle"),u0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});CQ();import{existsSync as Q0}from"fs";import{homedir as Z0}from"os";import{join as YQ}from"path";function $0(){return process.env.HOME||process.env.USERPROFILE||Z0()}var VQ=()=>YQ($0(),".claude"),EQ=()=>YQ(VQ(),"skills"),DQ=()=>YQ(VQ(),"settings.json"),bQ=()=>YQ(VQ(),"CLAUDE.md"),IQ="<!-- beacon:global:start -->",qZ="<!-- beacon:global:end -->";var J0=n,y=[{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 Y0(Q,Z){return o(EQ(),Q,Z)}function XZ(Q){return b(EQ(),Q)}function V0(Q){return i(EQ(),Q)}function z0(Q){return t(DQ(),Q)}function q0(Q){return d(DQ(),Q)}function X0(Q){return s(DQ(),Q)}function U0(Q){a(bQ(),IQ,qZ,Q)}function UZ(){return D(bQ(),IQ)}function W0(){return r(bQ(),IQ,qZ)}function WZ(){let Q={};for(let $ of B)Q[$]=XZ($);let Z={};for(let $ of y)Z[$.event]=q0({event:$.event,command:$.command});return{homeExists:Q0(VQ()),skills:Q,hooks:Z,claudeMdBlock:UZ()}}async function H0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (p(),xQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of B){if(!XZ(z))V.push(z);Y0(z,Y[z])}let q=0;for(let z of y)if(z0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=UZ();return U0(J0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function H1(){if(sQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(rQ()){try{OQ()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await H0()}}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(() => (gQ(),zZ));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 OQ(){let Q=[];for(let J of B)if(V0(J))Q.push(J);let Z=0;for(let J of y)if(X0(J))Z++;let $=W0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as T0}from"async_hooks";import{spawnSync as w0}from"child_process";import{createHash as R0}from"crypto";import{existsSync as PZ,mkdirSync as L,readFileSync as LQ,writeFileSync as _Q}from"fs";import{homedir as vZ}from"os";import{basename as F0,join as x,parse as g0,resolve as GZ}from"path";function v(){return process.env.BEACON_HOME||x(vZ(),".beacon")}function kQ(){return x(v(),"workspaces.json")}function qQ(Q){return R0("sha256").update(Q).digest("hex").slice(0,12)}function w1(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 NZ(Q){let Z=GZ(Q);return Z!==GZ(vZ())&&Z!==g0(Z).root}function xZ(){return x(v(),"deleted.json")}function SQ(){try{let Q=JSON.parse(LQ(xZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function KZ(Q){L(v(),{recursive:!0}),_Q(xZ(),JSON.stringify(Q,null,2))}function uZ(Q){return SQ().includes(Q)}function R1(Q){let Z=SQ();if(!Z.includes(Q))KZ([...Z,Q])}function E0(Q){let Z=SQ();if(Z.includes(Q))KZ(Z.filter(($)=>$!==Q))}function XQ(Q){return x(v(),Q)}function D0(Q){return`file:${x(XQ(Q),"db.sqlite")}`}function _(){try{let Q=JSON.parse(LQ(kQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function hQ(Q){L(v(),{recursive:!0}),_Q(kQ(),JSON.stringify(Q,null,2))}function UQ(){return _().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function u(Q){return _().find((Z)=>Z.id===Q)??null}function CZ(Q,Z,$=new Date().toISOString()){if(!NZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=qQ(Q);if(uZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=_(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||F0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return L(XQ(J),{recursive:!0}),hQ(W),q}function F1(Q,Z){return E0(qQ(Q)),CZ(Q,Z)}function g1(Q,Z=new Date().toISOString()){let $=_(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,hQ($)}function E1(Q){if(hQ(_().filter((Z)=>Z.id!==Q)),mQ()===Q)b0(UQ()[0]?.id??null)}function MZ(){return x(v(),"active")}function mQ(){try{return LQ(MZ(),"utf8").trim()||null}catch{return null}}function b0(Q){L(v(),{recursive:!0}),_Q(MZ(),Q??"")}function D1(){let Q=mQ();return Q?u(Q):null}function b1(){let Q=A0()??mQ();return Q?u(Q):null}function I1(Q){return u(Q)?.path??null}function O1(){return PZ(kQ())}var fZ="beacon_ws";function TZ(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 A1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=TZ(Q,fZ);if($&&u($))return $;return I0()}function I0(){let Q=UQ();return Q.length===1?Q[0].id:null}var O0="x-beacon-workspace-path";async function y1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=Q.headers.get(O0);if($&&NZ($)&&!uZ(qQ($))&&(!Z||qQ($)===Z)){let Y=CZ($);return await y0(Y.id),Y.id}let J=TZ(Q,fZ);if(J&&u(J))return J;return null}var wZ=new T0;function L1(Q,Z){return Q?wZ.run(Q,Z):Z()}function A0(){return wZ.getStore()??null}var yQ=new Set;function _1(Q){yQ.delete(x(XQ(Q),"db.sqlite"))}async function y0(Q){let Z=XQ(Q),$=x(Z,"db.sqlite"),J=PZ($);if(J&&yQ.has($))return{ok:!0,created:!1,migrated:!1};try{L(Z,{recursive:!0});let{provisionDb:Y}=await jZ().then(() => BZ),V=await Y(D0(Q));return yQ.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();gQ();import{existsSync as WQ,readFileSync as L0,rmSync as _0}from"fs";import{join as k0}from"path";var RZ=process.argv.slice(3),FZ=RZ.includes("--yes")||RZ.includes("-y"),G=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[2m${Q}\x1B[0m`,M=(Q)=>`
352
- \x1B[1m${Q}\x1B[0m`,gZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,C=v(),k=UQ(),pQ=WZ();console.log(M(FZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(M("Global"));console.log(` ${WQ(C)?`wipe ${C} (${k.length} workspaces)`:`${j(`${C} \u2014 already gone`)}`}`);for(let Q of B)console.log(` ${pQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of y)console.log(` ${pQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${pQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":j("global CLAUDE.md block \u2014 already gone")}`);var HQ=RQ();console.log(M("Codex"));for(let Q of B)console.log(` ${HQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of F)console.log(` ${HQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${HQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":j("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${HQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":j("config.toml beacon entry \u2014 already gone")}`);if(k.length){console.log(M(`Per-repo (${k.length})`));for(let Q of k){if(!WQ(Q.path)){console.log(` ${j(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${j("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!FZ)console.log(M("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
353
- `),process.exit(0);console.log(M("Applying\u2026"));var g=OQ();if(g.skillsRemoved.length)console.log(` ${G(`removed skills: ${g.skillsRemoved.join(", ")}`)}`);if(g.hooksRemoved)console.log(` ${G(`removed ${g.hooksRemoved} hook${g.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(g.claudeMdBlockRemoved)console.log(` ${G("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var K=FQ();if(K.skillsRemoved.length)console.log(` ${G(`removed ~/.agents/skills: ${K.skillsRemoved.join(", ")}`)}`);if(K.hooksRemoved)console.log(` ${G(`removed ${K.hooksRemoved} hook${K.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(K.agentsMdBlockRemoved)console.log(` ${G("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(K.mcpRemoved)console.log(` ${G("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(K.mcpSkipped)console.log(` ${gZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of k){if(!WQ(Q.path))continue;let Z=NQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${G(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var S0=k0(C,"server.json");try{let{pid:Q}=JSON.parse(L0(S0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${G(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(WQ(C))_0(C,{recursive:!0,force:!0}),console.log(` ${G(`removed ${C}`)}`);console.log(M("Done."));console.log(` ${gZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
351
+ ${VZ}
352
+ `});var GZ={};jQ(GZ,{provisionDb:()=>R0});import{createClient as v0}from"@libsql/client";import{drizzle as P0}from"drizzle-orm/libsql";import{migrate as N0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as x0}from"drizzle-orm/migrator";import{dirname as yQ,join as K0}from"path";import{fileURLToPath as u0}from"url";async function qQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function T0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function jZ(Q){if(!await qQ(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 w0(Q){for(let[Z,$]of Object.entries(f0)){if(!await qQ(Q,Z))continue;let J=await T0(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 R0(Q,Z=C0){let $=v0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await qQ($,"__drizzle_migrations"),Y=await qQ($,"Node"),V=!1;if(Y&&!J){let W=x0({migrationsFolder:Z})[0];if(W)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:[W.hash,W.folderMillis]}),V=!0}let q=await jZ($);if(await N0(P0($),{migrationsFolder:Z}),await jZ($)>q)V=!0;return await w0($),{migrated:V}}finally{$.close()}}var M0,C0,f0;var vZ=T(async()=>{M0=yQ(yQ(yQ(u0(import.meta.url)))),C0=process.env.BEACON_MIGRATIONS_DIR||K0(M0,"drizzle"),f0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});CQ();import{existsSync as J0}from"fs";import{homedir as Y0}from"os";import{join as VQ}from"path";function V0(){return process.env.HOME||process.env.USERPROFILE||Y0()}var zQ=()=>VQ(V0(),".claude"),IQ=()=>VQ(zQ(),"skills"),DQ=()=>VQ(zQ(),"settings.json"),OQ=()=>VQ(zQ(),"CLAUDE.md"),bQ="<!-- beacon:global:start -->",UZ="<!-- beacon:global:end -->";var z0=d,y=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract: in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. Fail-open when there's no active contract."},{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:"PreToolUse",matcher:"AskUserQuestion",command:"beacon ask",description:"Surface the agent's AskUserQuestion in Beacon's modal; your pick flows back as the answer (falls through to the terminal if Beacon isn't open)."},{event:"PermissionRequest",matcher:"Edit|Write|MultiEdit|Bash|NotebookEdit",command:"beacon ask",description:"Surface edit/create/run approvals in Beacon's modal; your allow/deny flows back (falls through to the terminal prompt if Beacon isn't open)."},{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(IQ(),Q,Z)}function WZ(Q){return D(IQ(),Q)}function X0(Q){return e(IQ(),Q)}function U0(Q){return t(DQ(),Q)}function W0(Q){return a(DQ(),Q)}function H0(Q){return s(DQ(),Q)}function B0(Q){r(OQ(),bQ,UZ,Q)}function HZ(){return I(OQ(),bQ)}function j0(){return o(OQ(),bQ,UZ)}function BZ(){let Q={};for(let $ of B)Q[$]=WZ($);let Z={};for(let $ of y)Z[$.event]=W0({event:$.event,command:$.command});return{homeExists:J0(zQ()),skills:Q,hooks:Z,claudeMdBlock:HZ()}}async function G0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (c(),KQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let z of B){if(!WZ(z))V.push(z);q0(z,Y[z])}let q=0;for(let z of y)if(U0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=HZ();return B0(z0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function G1(){if(rQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(iQ()){try{AQ()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await G0()}}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(),XZ));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 AQ(){let Q=[];for(let J of B)if(X0(J))Q.push(J);let Z=0;for(let J of y)if(H0(J))Z++;let $=j0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as F0}from"async_hooks";import{spawnSync as g0}from"child_process";import{createHash as E0}from"crypto";import{existsSync as NZ,mkdirSync as k,readFileSync as kQ,writeFileSync as _Q}from"fs";import{homedir as xZ}from"os";import{basename as I0,join as K,parse as D0,resolve as PZ}from"path";function P(){return process.env.BEACON_HOME||K(xZ(),".beacon")}function SQ(){return K(P(),"workspaces.json")}function L(Q){return E0("sha256").update(Q).digest("hex").slice(0,12)}function O0(Q=process.cwd()){let Z=g0("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 KZ(Q){let Z=PZ(Q);return Z!==PZ(xZ())&&Z!==D0(Z).root}function uZ(){return K(P(),"deleted.json")}function hQ(){try{let Q=JSON.parse(kQ(uZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function MZ(Q){k(P(),{recursive:!0}),_Q(uZ(),JSON.stringify(Q,null,2))}function CZ(Q){return hQ().includes(Q)}function g1(Q){let Z=hQ();if(!Z.includes(Q))MZ([...Z,Q])}function b0(Q){let Z=hQ();if(Z.includes(Q))MZ(Z.filter(($)=>$!==Q))}function XQ(Q){return K(P(),Q)}function A0(Q){return`file:${K(XQ(Q),"db.sqlite")}`}function _(){try{let Q=JSON.parse(kQ(SQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function mQ(Q){k(P(),{recursive:!0}),_Q(SQ(),JSON.stringify(Q,null,2))}function UQ(){return _().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function M(Q){return _().find((Z)=>Z.id===Q)??null}function fZ(Q,Z,$=new Date().toISOString()){if(!KZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=L(Q);if(CZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=_(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||I0(Q),lastOpenedAt:$},W=[q,...Y.filter((z)=>z.id!==J)];return k(XQ(J),{recursive:!0}),mQ(W),q}function E1(Q,Z){return b0(L(Q)),fZ(Q,Z)}function I1(Q,Z=new Date().toISOString()){let $=_(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,mQ($)}function D1(Q){if(mQ(_().filter((Z)=>Z.id!==Q)),pQ()===Q)y0(UQ()[0]?.id??null)}function TZ(){return K(P(),"active")}function pQ(){try{return kQ(TZ(),"utf8").trim()||null}catch{return null}}function y0(Q){k(P(),{recursive:!0}),_Q(TZ(),Q??"")}function O1(){let Q=pQ();return Q?M(Q):null}function b1(){let Q=k0()??pQ();return Q?M(Q):null}function A1(Q){return M(Q)?.path??null}function y1(){return NZ(SQ())}var wZ="beacon_ws";function RZ(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&&M(Z))return Z;let $=RZ(Q,wZ);if($&&M($))return $;return L0()}function L0(){let Q=UQ();return Q.length===1?Q[0].id:null}var FZ="x-beacon-workspace-path";function k1(Q=process.cwd()){let Z=O0(Q);return{"x-beacon-workspace":L(Z),[FZ]:Z}}async function _1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=Q.headers.get(FZ);if($&&KZ($)&&!CZ(L($))&&(!Z||L($)===Z)){let Y=fZ($);return await _0(Y.id),Y.id}let J=RZ(Q,wZ);if(J&&M(J))return J;return null}var gZ=new F0;function S1(Q,Z){return Q?gZ.run(Q,Z):Z()}function k0(){return gZ.getStore()??null}var LQ=new Set;function h1(Q){LQ.delete(K(XQ(Q),"db.sqlite"))}async function _0(Q){let Z=XQ(Q),$=K(Z,"db.sqlite"),J=NZ($);if(J&&LQ.has($))return{ok:!0,created:!1,migrated:!1};try{k(Z,{recursive:!0});let{provisionDb:Y}=await vZ().then(() => GZ),V=await Y(A0(Q));return LQ.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)}}}c();EQ();import{existsSync as WQ,readFileSync as S0,rmSync as h0}from"fs";import{join as m0}from"path";var EZ=process.argv.slice(3),IZ=EZ.includes("--yes")||EZ.includes("-y"),G=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[2m${Q}\x1B[0m`,f=(Q)=>`
353
+ \x1B[1m${Q}\x1B[0m`,DZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,C=P(),S=UQ(),cQ=BZ();console.log(f(IZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(f("Global"));console.log(` ${WQ(C)?`wipe ${C} (${S.length} workspaces)`:`${j(`${C} \u2014 already gone`)}`}`);for(let Q of B)console.log(` ${cQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of y)console.log(` ${cQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${cQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":j("global CLAUDE.md block \u2014 already gone")}`);var HQ=FQ();console.log(f("Codex"));for(let Q of B)console.log(` ${HQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of F)console.log(` ${HQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${HQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":j("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${HQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":j("config.toml beacon entry \u2014 already gone")}`);if(S.length){console.log(f(`Per-repo (${S.length})`));for(let Q of S){if(!WQ(Q.path)){console.log(` ${j(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${j("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!IZ)console.log(f("Nothing was changed.")),console.log(" Run \x1B[1mbeacon uninstall --yes\x1B[0m to apply."),console.log(` The \x1B[1mbeacon\x1B[0m binary itself (the cloned source + your PATH symlink) is NOT removed by this \u2014 your install script handles that.
354
+ `),process.exit(0);console.log(f("Applying\u2026"));var g=AQ();if(g.skillsRemoved.length)console.log(` ${G(`removed skills: ${g.skillsRemoved.join(", ")}`)}`);if(g.hooksRemoved)console.log(` ${G(`removed ${g.hooksRemoved} hook${g.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(g.claudeMdBlockRemoved)console.log(` ${G("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=gQ();if(u.skillsRemoved.length)console.log(` ${G(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${G(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${G("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${G("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${DZ("left [mcp_servers.beacon] in ~/.codex/config.toml \u2014 it wasn't written by Beacon (remove with: codex mcp remove beacon)")}`);for(let Q of S){if(!WQ(Q.path))continue;let Z=xQ(Q.path),$=[];if(Z.skillsRemoved.length)$.push(`skills(${Z.skillsRemoved.length})`);if(Z.mcpUnregistered)$.push(".mcp.json");if(Z.agentsBlockRemoved)$.push("AGENTS.md");if(Z.claudeImportRemoved)$.push("CLAUDE.md");if($.length)console.log(` ${G(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var p0=m0(C,"server.json");try{let{pid:Q}=JSON.parse(S0(p0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${G(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(WQ(C))h0(C,{recursive:!0,force:!0}),console.log(` ${G(`removed ${C}`)}`);console.log(f("Done."));console.log(` ${DZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
354
355
  `);
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- var I=Object.defineProperty;var E=(z)=>z;function M(z,J){this[z]=E.bind(null,J)}var K=(z,J)=>{for(var q in J)I(z,q,{get:J[q],enumerable:!0,configurable:!0,set:M.bind(J,q)})};var T=(z,J)=>()=>(z&&(J=z(z=0)),J);var a=1500,d=480000,p=1800000,C=3600000,c=3000;var f=()=>{};var y={};K(y,{removeRepoAssets:()=>l,installRefreshSkill:()=>O,installPlanSkill:()=>L,installInitSkill:()=>j,installExplainSkill:()=>g,installCodexRepoSkills:()=>_,ensureWorkflowDoc:()=>h,ensureMcp:()=>R,auditRepo:()=>m,REFRESH_SKILL:()=>b,PLAN_SKILL:()=>A,INIT_SKILL:()=>k,EXPLAIN_SKILL:()=>W});import{existsSync as D,mkdirSync as B,readFileSync as H,rmSync as U,writeFileSync as $}from"fs";import{join as Q}from"path";function j(z){let J=Q(z,".claude","skills","beacon-init");B(J,{recursive:!0});let q=Q(J,"SKILL.md");return $(q,k),q}function O(z){let J=Q(z,".claude","skills","beacon-refresh");B(J,{recursive:!0});let q=Q(J,"SKILL.md");return $(q,b),q}function L(z){let J=Q(z,".claude","skills","beacon-plan");B(J,{recursive:!0});let q=Q(J,"SKILL.md");return $(q,A),q}function g(z){let J=Q(z,".claude","skills","beacon-explain");B(J,{recursive:!0});let q=Q(J,"SKILL.md");return $(q,W),q}function _(z){let J=[];for(let q of F){let Y=Q(z,".agents","skills",q.name);B(Y,{recursive:!0});let G=Q(Y,"SKILL.md");$(G,q.body()),J.push(G)}return J}function h(z){let J=Q(z,"AGENTS.md"),q="";try{q=H(J,"utf8")}catch{}let Y=new RegExp(`${v}[\\s\\S]*?${P}`);q=Y.test(q)?q.replace(Y,u):`${q.trim()}
3
-
4
- ${u}
5
- `.trimStart(),$(J,q.endsWith(`
6
- `)?q:`${q}
7
- `);let G=Q(z,"CLAUDE.md"),X="";try{X=H(G,"utf8")}catch{}if(!/@AGENTS\.md/.test(X))$(G,`${X?`${X.trim()}
8
-
9
- `:""}@AGENTS.md
10
- `)}function R(z){let J=Q(z,".mcp.json"),q={};try{q=JSON.parse(H(J,"utf8"))}catch{}q.mcpServers=q.mcpServers??{};let Y=q.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<C)return Y.timeout=C,$(J,JSON.stringify(q,null,2)+`
11
- `),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return q.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:C},$(J,JSON.stringify(q,null,2)+`
12
- `),{path:J,added:!0,updated:!1}}function m(z){let J=Q(z,".mcp.json"),q=!1;try{q=!!JSON.parse(H(J,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=H(Q(z,"AGENTS.md"),"utf8").includes(v)}catch{}let G=!1;try{G=/@AGENTS\.md/.test(H(Q(z,"CLAUDE.md"),"utf8"))}catch{}return{repo:z,mcpRegistered:q,agentsMdBlock:Y,claudeMdImport:G,skills:{"beacon-init":D(Q(z,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":D(Q(z,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".agents","skills","beacon-refresh","SKILL.md"))}}}function l(z){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let Z=Q(z,".claude","skills",V);if(D(Z))U(Z,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let Z=Q(z,".agents","skills",V);if(D(Z))U(Z,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let q=!1,Y=Q(z,".mcp.json");try{let V=JSON.parse(H(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,q=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)U(Y,{force:!0});else $(Y,JSON.stringify(V,null,2)+`
13
- `)}}catch{}let G=!1,X=Q(z,"AGENTS.md");try{let V=H(X,"utf8"),Z=new RegExp(`\\n?${v}[\\s\\S]*?${P}\\n?`);if(Z.test(V)){let N=V.replace(Z,`
2
+ var f=Object.defineProperty;var K=(z)=>z;function j(z,q){this[z]=K.bind(null,q)}var O=(z,q)=>{for(var J in q)f(z,J,{get:q[J],enumerable:!0,configurable:!0,set:j.bind(q,J)})};var w=(z,q)=>()=>(z&&(q=z(z=0)),q);var c=1500,p=480000,n=1800000,U=3600000,t=3000;var W=()=>{};var d={};O(d,{stripAgentsPointer:()=>A,removeRepoAssets:()=>S,installRefreshSkill:()=>F,installPlanSkill:()=>_,installInitSkill:()=>L,installExplainSkill:()=>g,installCodexRepoSkills:()=>R,ensureWorkflowDoc:()=>h,ensureMcp:()=>y,contextDocTargets:()=>b,auditRepo:()=>l,REFRESH_SKILL:()=>x,PLAN_SKILL:()=>u,INIT_SKILL:()=>P,EXPLAIN_SKILL:()=>E});import{existsSync as H,mkdirSync as D,readFileSync as X,rmSync as v,writeFileSync as G}from"fs";import{join as V}from"path";function L(z){let q=V(z,".claude","skills","beacon-init");D(q,{recursive:!0});let J=V(q,"SKILL.md");return G(J,P),J}function F(z){let q=V(z,".claude","skills","beacon-refresh");D(q,{recursive:!0});let J=V(q,"SKILL.md");return G(J,x),J}function _(z){let q=V(z,".claude","skills","beacon-plan");D(q,{recursive:!0});let J=V(q,"SKILL.md");return G(J,u),J}function g(z){let q=V(z,".claude","skills","beacon-explain");D(q,{recursive:!0});let J=V(q,"SKILL.md");return G(J,E),J}function R(z){let q=[];for(let J of m){let Q=V(z,".agents","skills",J.name);D(Q,{recursive:!0});let Z=V(Q,"SKILL.md");G(Z,J.body()),q.push(Z)}return q}function b(z){let q=V(z,"AGENTS.md"),J=V(z,"CLAUDE.md"),Q=H(q),Z=H(J);if(!Q&&!Z)return[q,J];let B=[];if(Q)B.push(q);if(Z)B.push(J);return B}function A(z){let q=V(z,"CLAUDE.md");if(!H(q))return;let J=X(q,"utf8"),Q=J.split(`
3
+ `).filter((Z)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Z)).join(`
4
+ `).trim();if(Q&&Q!==J.trim())G(q,`${Q}
5
+ `)}function h(z){let q=new RegExp(`${C}[\\s\\S]*?${M}`);for(let J of b(z)){let Q="";try{Q=X(J,"utf8")}catch{}Q=q.test(Q)?Q.replace(q,T):`${Q.trim()}
6
+
7
+ ${T}
8
+ `.trimStart(),G(J,Q.endsWith(`
9
+ `)?Q:`${Q}
10
+ `)}A(z)}function y(z){let q=V(z,".mcp.json"),J={};try{J=JSON.parse(X(q,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<U)return Q.timeout=U,G(q,JSON.stringify(J,null,2)+`
11
+ `),{path:q,added:!1,updated:!0};return{path:q,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:U},G(q,JSON.stringify(J,null,2)+`
12
+ `),{path:q,added:!0,updated:!1}}function l(z){let q=V(z,".mcp.json"),J=!1;try{J=!!JSON.parse(X(q,"utf8")).mcpServers?.beacon}catch{}let Q=b(z).some((Z)=>{try{return X(Z,"utf8").includes(C)}catch{return!1}});return{repo:z,mcpRegistered:J,workflowBlock:Q,skills:{"beacon-init":H(V(z,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":H(V(z,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":H(V(z,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":H(V(z,".agents","skills","beacon-refresh","SKILL.md"))}}}function S(z){let q=[];for(let Y of["beacon-init","beacon-refresh","beacon-db-design"]){let $=V(z,".claude","skills",Y);if(H($))v($,{recursive:!0,force:!0}),q.push(Y)}for(let Y of["beacon-init","beacon-refresh"]){let $=V(z,".agents","skills",Y);if(H($))v($,{recursive:!0,force:!0}),q.push(`codex:${Y}`)}let J=!1,Q=V(z,".mcp.json");try{let Y=JSON.parse(X(Q,"utf8"));if(Y.mcpServers?.beacon){if(delete Y.mcpServers.beacon,J=!0,Y.mcpServers&&Object.keys(Y.mcpServers).length===0)delete Y.mcpServers;if(Object.keys(Y).length===0)v(Q,{force:!0});else G(Q,JSON.stringify(Y,null,2)+`
13
+ `)}}catch{}let Z=!1,B=new RegExp(`\\n?${C}[\\s\\S]*?${M}\\n?`);for(let Y of[V(z,"AGENTS.md"),V(z,"CLAUDE.md")])try{let $=X(Y,"utf8");if(B.test($)){let k=$.replace(B,`
14
14
  `).replace(/\n{3,}/g,`
15
15
 
16
- `).trimStart();$(X,N.endsWith(`
17
- `)?N:`${N}
18
- `),G=!0}}catch{}let w=!1,x=Q(z,"CLAUDE.md");try{let V=H(x,"utf8"),Z=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(Z!==V){if(!Z.trim())U(x,{force:!0});else $(x,Z);w=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:q,agentsBlockRemoved:G,claudeImportRemoved:w}}var k=`---
16
+ `).trimStart();G(Y,k.endsWith(`
17
+ `)?k:`${k}
18
+ `),Z=!0}}catch{}let I=!1,N=V(z,"CLAUDE.md");try{let Y=X(N,"utf8"),$=Y.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if($!==Y){if(!$.trim())v(N,{force:!0});else G(N,$);I=!0}}catch{}return{skillsRemoved:q,mcpUnregistered:J,agentsBlockRemoved:Z,claudeImportRemoved:I}}var P=`---
19
19
  name: beacon-init
20
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
21
21
  ---
@@ -62,7 +62,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
62
62
  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.
63
63
 
64
64
  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.
65
- `,b=`---
65
+ `,x=`---
66
66
  name: beacon-refresh
67
67
  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.
68
68
  ---
@@ -109,7 +109,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
109
109
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
110
110
 
111
111
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
112
- `,A=`---
112
+ `,u=`---
113
113
  name: beacon-plan
114
114
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
115
115
  ---
@@ -138,10 +138,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
138
138
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
139
139
 
140
140
  - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
141
- \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
142
- has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
143
- implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
144
- to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
141
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
142
+ frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
143
+ for the user's authorization (which then adds it to the contract), and the /plan Changes view
144
+ groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
145
+ (if omitted, the scope is inferred from the files you name in backticks).
145
146
 
146
147
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
147
148
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
@@ -157,7 +158,7 @@ If it returns feedback, revise and call it again.
157
158
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
158
159
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
159
160
  run \`beacon\` in this repo once.
160
- `,W=`---
161
+ `,E=`---
161
162
  name: beacon-explain
162
163
  description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
163
164
  ---
@@ -227,7 +228,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
227
228
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
228
229
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
229
230
  the lesson.
230
- `,F,v="<!-- beacon:workflow:start -->",P="<!-- beacon:workflow:end -->",u;var S=T(()=>{f();F=[{name:"beacon-init",body:()=>k},{name:"beacon-refresh",body:()=>b}];u=`${v}
231
+ `,m,C="<!-- beacon:workflow:start -->",M="<!-- beacon:workflow:end -->",T;var s=w(()=>{W();m=[{name:"beacon-init",body:()=>P},{name:"beacon-refresh",body:()=>x}];T=`${C}
231
232
  ## Beacon \u2014 feature workflow
232
233
 
233
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:
@@ -299,4 +300,4 @@ Register them all in that single batched call. If a plan added five features, th
299
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.
300
301
 
301
302
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
302
- ${P}`});S();export{l as removeRepoAssets,O as installRefreshSkill,L as installPlanSkill,j as installInitSkill,g as installExplainSkill,_ as installCodexRepoSkills,h as ensureWorkflowDoc,R as ensureMcp,m as auditRepo,b as REFRESH_SKILL,A as PLAN_SKILL,k as INIT_SKILL,W as EXPLAIN_SKILL};
303
+ ${M}`});s();export{A as stripAgentsPointer,S as removeRepoAssets,F as installRefreshSkill,_ as installPlanSkill,L as installInitSkill,g as installExplainSkill,R as installCodexRepoSkills,h as ensureWorkflowDoc,y as ensureMcp,b as contextDocTargets,l as auditRepo,x as REFRESH_SKILL,u as PLAN_SKILL,P as INIT_SKILL,E as EXPLAIN_SKILL};
@@ -1,21 +1,21 @@
1
1
  // @bun
2
- var bq=Object.defineProperty;var wq=(q)=>q;function gq(q,J){this[q]=wq.bind(null,J)}var d=(q,J)=>{for(var z in J)bq(q,z,{get:J[z],enumerable:!0,configurable:!0,set:gq.bind(J,z)})};var u=(q,J)=>()=>(q&&(J=q(q=0)),J);var tq=1500,nq=480000,rq=1800000,C=3600000,oq=3000;var c=()=>{};var o={};d(o,{removeRepoAssets:()=>Aq,installRefreshSkill:()=>Cq,installPlanSkill:()=>Kq,installInitSkill:()=>jq,installExplainSkill:()=>Nq,installCodexRepoSkills:()=>Rq,ensureWorkflowDoc:()=>fq,ensureMcp:()=>Dq,auditRepo:()=>Tq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>n,INIT_SKILL:()=>O,EXPLAIN_SKILL:()=>r});import{existsSync as G,mkdirSync as b,readFileSync as B,rmSync as K,writeFileSync as H}from"fs";import{join as Z}from"path";function jq(q){let J=Z(q,".claude","skills","beacon-init");b(J,{recursive:!0});let z=Z(J,"SKILL.md");return H(z,O),z}function Cq(q){let J=Z(q,".claude","skills","beacon-refresh");b(J,{recursive:!0});let z=Z(J,"SKILL.md");return H(z,L),z}function Kq(q){let J=Z(q,".claude","skills","beacon-plan");b(J,{recursive:!0});let z=Z(J,"SKILL.md");return H(z,n),z}function Nq(q){let J=Z(q,".claude","skills","beacon-explain");b(J,{recursive:!0});let z=Z(J,"SKILL.md");return H(z,r),z}function Rq(q){let J=[];for(let z of Mq){let Q=Z(q,".agents","skills",z.name);b(Q,{recursive:!0});let V=Z(Q,"SKILL.md");H(V,z.body()),J.push(V)}return J}function fq(q){let J=Z(q,"AGENTS.md"),z="";try{z=B(J,"utf8")}catch{}let Q=new RegExp(`${N}[\\s\\S]*?${y}`);z=Q.test(z)?z.replace(Q,t):`${z.trim()}
2
+ var jq=Object.defineProperty;var gq=(q)=>q;function Kq(q,z){this[q]=gq.bind(null,z)}var s=(q,z)=>{for(var J in z)jq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Kq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var rq=1500,oq=480000,iq=1800000,K=3600000,eq=3000;var n=()=>{};var e={};s(e,{stripAgentsPointer:()=>i,removeRepoAssets:()=>Fq,installRefreshSkill:()=>Nq,installPlanSkill:()=>Mq,installInitSkill:()=>Cq,installExplainSkill:()=>Rq,installCodexRepoSkills:()=>Dq,ensureWorkflowDoc:()=>Tq,ensureMcp:()=>fq,contextDocTargets:()=>h,auditRepo:()=>Aq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>r,INIT_SKILL:()=>O,EXPLAIN_SKILL:()=>o});import{existsSync as B,mkdirSync as w,readFileSync as v,rmSync as C,writeFileSync as W}from"fs";import{join as Z}from"path";function Cq(q){let z=Z(q,".claude","skills","beacon-init");w(z,{recursive:!0});let J=Z(z,"SKILL.md");return W(J,O),J}function Nq(q){let z=Z(q,".claude","skills","beacon-refresh");w(z,{recursive:!0});let J=Z(z,"SKILL.md");return W(J,L),J}function Mq(q){let z=Z(q,".claude","skills","beacon-plan");w(z,{recursive:!0});let J=Z(z,"SKILL.md");return W(J,r),J}function Rq(q){let z=Z(q,".claude","skills","beacon-explain");w(z,{recursive:!0});let J=Z(z,"SKILL.md");return W(J,o),J}function Dq(q){let z=[];for(let J of Iq){let Q=Z(q,".agents","skills",J.name);w(Q,{recursive:!0});let V=Z(Q,"SKILL.md");W(V,J.body()),z.push(V)}return z}function h(q){let z=Z(q,"AGENTS.md"),J=Z(q,"CLAUDE.md"),Q=B(z),V=B(J);if(!Q&&!V)return[z,J];let Y=[];if(Q)Y.push(z);if(V)Y.push(J);return Y}function i(q){let z=Z(q,"CLAUDE.md");if(!B(z))return;let J=v(z,"utf8"),Q=J.split(`
3
+ `).filter((V)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(V)).join(`
4
+ `).trim();if(Q&&Q!==J.trim())W(z,`${Q}
5
+ `)}function Tq(q){let z=new RegExp(`${N}[\\s\\S]*?${y}`);for(let J of h(q)){let Q="";try{Q=v(J,"utf8")}catch{}Q=z.test(Q)?Q.replace(z,t):`${Q.trim()}
3
6
 
4
7
  ${t}
5
- `.trimStart(),H(J,z.endsWith(`
6
- `)?z:`${z}
7
- `);let V=Z(q,"CLAUDE.md"),Y="";try{Y=B(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))H(V,`${Y?`${Y.trim()}
8
-
9
- `:""}@AGENTS.md
10
- `)}function Dq(q){let J=Z(q,".mcp.json"),z={};try{z=JSON.parse(B(J,"utf8"))}catch{}z.mcpServers=z.mcpServers??{};let Q=z.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<C)return Q.timeout=C,H(J,JSON.stringify(z,null,2)+`
11
- `),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return z.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:C},H(J,JSON.stringify(z,null,2)+`
12
- `),{path:J,added:!0,updated:!1}}function Tq(q){let J=Z(q,".mcp.json"),z=!1;try{z=!!JSON.parse(B(J,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=B(Z(q,"AGENTS.md"),"utf8").includes(N)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(B(Z(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:z,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":G(Z(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":G(Z(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":G(Z(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":G(Z(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function Aq(q){let J=[];for(let $ of["beacon-init","beacon-refresh","beacon-db-design"]){let U=Z(q,".claude","skills",$);if(G(U))K(U,{recursive:!0,force:!0}),J.push($)}for(let $ of["beacon-init","beacon-refresh"]){let U=Z(q,".agents","skills",$);if(G(U))K(U,{recursive:!0,force:!0}),J.push(`codex:${$}`)}let z=!1,Q=Z(q,".mcp.json");try{let $=JSON.parse(B(Q,"utf8"));if($.mcpServers?.beacon){if(delete $.mcpServers.beacon,z=!0,$.mcpServers&&Object.keys($.mcpServers).length===0)delete $.mcpServers;if(Object.keys($).length===0)K(Q,{force:!0});else H(Q,JSON.stringify($,null,2)+`
13
- `)}}catch{}let V=!1,Y=Z(q,"AGENTS.md");try{let $=B(Y,"utf8"),U=new RegExp(`\\n?${N}[\\s\\S]*?${y}\\n?`);if(U.test($)){let k=$.replace(U,`
8
+ `.trimStart(),W(J,Q.endsWith(`
9
+ `)?Q:`${Q}
10
+ `)}i(q)}function fq(q){let z=Z(q,".mcp.json"),J={};try{J=JSON.parse(v(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<K)return Q.timeout=K,W(z,JSON.stringify(J,null,2)+`
11
+ `),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:K},W(z,JSON.stringify(J,null,2)+`
12
+ `),{path:z,added:!0,updated:!1}}function Aq(q){let z=Z(q,".mcp.json"),J=!1;try{J=!!JSON.parse(v(z,"utf8")).mcpServers?.beacon}catch{}let Q=h(q).some((V)=>{try{return v(V,"utf8").includes(N)}catch{return!1}});return{repo:q,mcpRegistered:J,workflowBlock:Q,skills:{"beacon-init":B(Z(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":B(Z(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":B(Z(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":B(Z(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function Fq(q){let z=[];for(let $ of["beacon-init","beacon-refresh","beacon-db-design"]){let U=Z(q,".claude","skills",$);if(B(U))C(U,{recursive:!0,force:!0}),z.push($)}for(let $ of["beacon-init","beacon-refresh"]){let U=Z(q,".agents","skills",$);if(B(U))C(U,{recursive:!0,force:!0}),z.push(`codex:${$}`)}let J=!1,Q=Z(q,".mcp.json");try{let $=JSON.parse(v(Q,"utf8"));if($.mcpServers?.beacon){if(delete $.mcpServers.beacon,J=!0,$.mcpServers&&Object.keys($.mcpServers).length===0)delete $.mcpServers;if(Object.keys($).length===0)C(Q,{force:!0});else W(Q,JSON.stringify($,null,2)+`
13
+ `)}}catch{}let V=!1,Y=new RegExp(`\\n?${N}[\\s\\S]*?${y}\\n?`);for(let $ of[Z(q,"AGENTS.md"),Z(q,"CLAUDE.md")])try{let U=v($,"utf8");if(Y.test(U)){let k=U.replace(Y,`
14
14
  `).replace(/\n{3,}/g,`
15
15
 
16
- `).trimStart();H(Y,k.endsWith(`
16
+ `).trimStart();W($,k.endsWith(`
17
17
  `)?k:`${k}
18
- `),V=!0}}catch{}let W=!1,P=Z(q,"CLAUDE.md");try{let $=B(P,"utf8"),U=$.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==$){if(!U.trim())K(P,{force:!0});else H(P,U);W=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:z,agentsBlockRemoved:V,claudeImportRemoved:W}}var O=`---
18
+ `),V=!0}}catch{}let P=!1,H=Z(q,"CLAUDE.md");try{let $=v(H,"utf8"),U=$.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==$){if(!U.trim())C(H,{force:!0});else W(H,U);P=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:P}}var O=`---
19
19
  name: beacon-init
20
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
21
21
  ---
@@ -109,7 +109,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
109
109
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
110
110
 
111
111
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
112
- `,n=`---
112
+ `,r=`---
113
113
  name: beacon-plan
114
114
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
115
115
  ---
@@ -138,10 +138,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
138
138
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
139
139
 
140
140
  - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
141
- \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
142
- has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
143
- implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
144
- to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
141
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
142
+ frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
143
+ for the user's authorization (which then adds it to the contract), and the /plan Changes view
144
+ groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
145
+ (if omitted, the scope is inferred from the files you name in backticks).
145
146
 
146
147
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
147
148
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
@@ -157,7 +158,7 @@ If it returns feedback, revise and call it again.
157
158
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
158
159
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
159
160
  run \`beacon\` in this repo once.
160
- `,r=`---
161
+ `,o=`---
161
162
  name: beacon-explain
162
163
  description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
163
164
  ---
@@ -227,7 +228,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
227
228
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
228
229
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
229
230
  the lesson.
230
- `,Mq,N="<!-- beacon:workflow:start -->",y="<!-- beacon:workflow:end -->",t;var i=u(()=>{c();Mq=[{name:"beacon-init",body:()=>O},{name:"beacon-refresh",body:()=>L}];t=`${N}
231
+ `,Iq,N="<!-- beacon:workflow:start -->",y="<!-- beacon:workflow:end -->",t;var qq=b(()=>{n();Iq=[{name:"beacon-init",body:()=>O},{name:"beacon-refresh",body:()=>L}];t=`${N}
231
232
  ## Beacon \u2014 feature workflow
232
233
 
233
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:
@@ -299,18 +300,18 @@ Register them all in that single batched call. If a plan added five features, th
299
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.
300
301
 
301
302
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
302
- ${y}`});import{existsSync as M,mkdirSync as h,readdirSync as Iq,readFileSync as X,rmSync as Fq,writeFileSync as R}from"fs";import{dirname as e,join as v}from"path";function Vz(){return!!process.env.CLAUDE_PLUGIN_ROOT}function Eq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let J=v(q,".claude","plugins");if(!M(J))return null;let z=[J];for(let Q=0;Q<3&&z.length;Q++){let V=[];for(let Y of z){let W=v(Y,".claude-plugin","plugin.json");try{if(M(W)&&JSON.parse(X(W,"utf8")).name==="beacon")return Y}catch{}try{for(let P of Iq(Y,{withFileTypes:!0}))if(P.isDirectory())V.push(v(Y,P.name))}catch{}}z=V}return null}function Yz(q){return Eq(q)!==null}function Zz(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function $z(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let J=JSON.parse(X(v(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let z of Object.keys(J.plugins??{}))if(/^beacon@/.test(z))return{key:z,marketplace:z.split("@")[1]??""}}catch{}return null}function _(q){try{return JSON.parse(X(q,"utf8"))}catch{return{}}}function zq(q,J){h(e(q),{recursive:!0}),R(q,JSON.stringify(J,null,2)+`
303
- `)}function Jq(q,J){let z=_(q);z.hooks=z.hooks??{},z.hooks[J.event]=z.hooks[J.event]??[];let Q=z.hooks[J.event];if(Q.some((Y)=>Y.matcher===J.matcher&&Y.hooks?.some((W)=>W.command===J.command)))return!1;return Q.push({matcher:J.matcher,hooks:[{type:"command",command:J.command}]}),zq(q,z),!0}function Qq(q,J){return(_(q).hooks?.[J.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===J.command))}function Vq(q,J){let z=_(q),Q=z.hooks?.[J.event];if(!Q)return!1;let V=!1,Y=Q.map((W)=>{let P=W.hooks?.length??0,$=(W.hooks??[]).filter((U)=>U.command!==J.command);if($.length!==P)V=!0;return{...W,hooks:$}}).filter((W)=>(W.hooks??[]).length>0);if(!V)return!1;if(Y.length)z.hooks[J.event]=Y;else delete z.hooks[J.event];if(z.hooks&&Object.keys(z.hooks).length===0)delete z.hooks;return zq(q,z),!0}function Yq(q,J,z,Q){let V=`${J}
303
+ ${y}`});import{existsSync as M,mkdirSync as _,readdirSync as Eq,readFileSync as X,rmSync as kq,writeFileSync as R}from"fs";import{dirname as zq,join as G}from"path";function Zz(){return!!process.env.CLAUDE_PLUGIN_ROOT}function Oq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let z=G(q,".claude","plugins");if(!M(z))return null;let J=[z];for(let Q=0;Q<3&&J.length;Q++){let V=[];for(let Y of J){let P=G(Y,".claude-plugin","plugin.json");try{if(M(P)&&JSON.parse(X(P,"utf8")).name==="beacon")return Y}catch{}try{for(let H of Eq(Y,{withFileTypes:!0}))if(H.isDirectory())V.push(G(Y,H.name))}catch{}}J=V}return null}function $z(q){return Oq(q)!==null}function Uz(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function Pz(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let z=JSON.parse(X(G(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let J of Object.keys(z.plugins??{}))if(/^beacon@/.test(J))return{key:J,marketplace:J.split("@")[1]??""}}catch{}return null}function m(q){try{return JSON.parse(X(q,"utf8"))}catch{return{}}}function Qq(q,z){_(zq(q),{recursive:!0}),R(q,JSON.stringify(z,null,2)+`
304
+ `)}function Vq(q,z){let J=m(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((P)=>P.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),Qq(q,J),!0}function Yq(q,z){return(m(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function Zq(q,z){let J=m(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((P)=>{let H=P.hooks?.length??0,$=(P.hooks??[]).filter((U)=>U.command!==z.command);if($.length!==H)V=!0;return{...P,hooks:$}}).filter((P)=>(P.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return Qq(q,J),!0}function $q(q,z,J,Q){let V=`${z}
304
305
  ${Q.trim()}
305
- ${z}`,Y="";try{Y=X(q,"utf8")}catch{}let W=new RegExp(`${J}[\\s\\S]*?${z}`);Y=W.test(Y)?Y.replace(W,V):Y.trim()?`${Y.trim()}
306
+ ${J}`,Y="";try{Y=X(q,"utf8")}catch{}let P=new RegExp(`${z}[\\s\\S]*?${J}`);Y=P.test(Y)?Y.replace(P,V):Y.trim()?`${Y.trim()}
306
307
 
307
308
  ${V}
308
309
  `:`${V}
309
- `,h(e(q),{recursive:!0}),R(q,Y.endsWith(`
310
+ `,_(zq(q),{recursive:!0}),R(q,Y.endsWith(`
310
311
  `)?Y:`${Y}
311
- `)}function m(q,J){try{return X(q,"utf8").includes(J)}catch{return!1}}function Zq(q,J,z){let Q="";try{Q=X(q,"utf8")}catch{return!1}let V=new RegExp(`${J}[\\s\\S]*?${z}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
312
+ `)}function S(q,z){try{return X(q,"utf8").includes(z)}catch{return!1}}function Uq(q,z,J){let Q="";try{Q=X(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
312
313
 
313
- `).trimStart();return R(q,Y),!0}function $q(q,J,z){let Q=v(q,J);h(Q,{recursive:!0});let V=v(Q,"SKILL.md");return R(V,z),V}function S(q,J){return M(v(q,J,"SKILL.md"))}function Uq(q,J){let z=v(q,J);if(!M(z))return!1;return Fq(z,{recursive:!0,force:!0}),!0}var f,qq=`## Beacon (visual planning panel)
314
+ `).trimStart();return R(q,Y),!0}function Pq(q,z,J){let Q=G(q,z);_(Q,{recursive:!0});let V=G(Q,"SKILL.md");return R(V,J),V}function p(q,z){return M(G(q,z,"SKILL.md"))}function Wq(q,z){let J=G(q,z);if(!M(J))return!1;return kq(J,{recursive:!0,force:!0}),!0}var I,Jq=`## Beacon (visual planning panel)
314
315
 
315
316
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
316
317
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -334,17 +335,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
334
335
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
335
336
  on the /map and /db boards (added features, attached subtasks, edited columns, new
336
337
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
337
- verbatim. Do NOT implement until the tool returns approval.`;var Wq=u(()=>{f=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as kq,renameSync as Oq,rmSync as Lq,writeFileSync as yq}from"fs";import{dirname as hq}from"path";function D(q,J){kq(hq(q),{recursive:!0});let z=`${q}.tmp`;try{yq(z,J),Oq(z,q)}catch(Q){throw Lq(z,{force:!0}),Q}}function Pz(q,J,z=!1){D(q,JSON.stringify(J,null,z?2:void 0))}var Hq=()=>{};var sq={};d(sq,{setupCodexAssets:()=>pq,removeCodexMcp:()=>uq,removeCodexArtifacts:()=>lq,hasCodexMcp:()=>s,ensureCodexMcp:()=>xq,codexMcpProblem:()=>Sq,codexDetected:()=>vq,auditCodex:()=>aq,CODEX_HOOKS:()=>E});import{readFileSync as F}from"fs";import{homedir as _q}from"os";import{join as j}from"path";function Pq(){return process.env.HOME||process.env.USERPROFILE||_q()}function vq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(p===void 0)p=Bun.which("codex")!==null;return p}function g(q){try{return Bun.TOML.parse(q)}catch{return null}}function s(){try{return Boolean(g(F(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Sq(){let q="";try{q=F(x(),"utf8")}catch{return null}let J=g(q);if(!J)return`~/.codex/config.toml does not parse \u2014 ${w}`;if(J.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${w}`;return null}function xq(){let q="",J=!1;try{q=F(x(),"utf8"),J=!0}catch{}if(J){let Y=g(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${w}`};if(Y.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 ${w}`}}let z=!q?"":q.endsWith(`
338
+ verbatim. Do NOT implement until the tool returns approval.`;var Hq=b(()=>{I=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as Lq,renameSync as yq,rmSync as hq,writeFileSync as _q}from"fs";import{dirname as mq}from"path";function D(q,z){Lq(mq(q),{recursive:!0});let J=`${q}.tmp`;try{_q(J,z),yq(J,q)}catch(Q){throw hq(J,{force:!0}),Q}}function vz(q,z,J=!1){D(q,JSON.stringify(z,null,J?2:void 0))}var Bq=()=>{};var sq={};s(sq,{setupCodexAssets:()=>aq,removeCodexMcp:()=>xq,removeCodexArtifacts:()=>cq,hasCodexMcp:()=>c,ensureCodexMcp:()=>wq,codexMcpProblem:()=>lq,codexDetected:()=>Xq,auditCodex:()=>dq,CODEX_HOOKS:()=>E});import{readFileSync as F}from"fs";import{homedir as Sq}from"os";import{join as g}from"path";function vq(){return process.env.HOME||process.env.USERPROFILE||Sq()}function Xq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(l===void 0)l=Bun.which("codex")!==null;return l}function j(q){try{return Bun.TOML.parse(q)}catch{return null}}function c(){try{return Boolean(j(F(u(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function lq(){let q="";try{q=F(u(),"utf8")}catch{return null}let z=j(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${x}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${x}`;return null}function wq(){let q="",z=!1;try{q=F(u(),"utf8"),z=!0}catch{}if(z){let Y=j(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${x}`};if(Y.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 ${x}`}}let J=!q?"":q.endsWith(`
338
339
  `)?`
339
340
  `:`
340
341
 
341
- `,Q=q+z+mq;if(g(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${w}`};return D(x(),Q),{added:!0}}function uq(){let q="";try{q=F(x(),"utf8")}catch{return{removed:!1}}let J=q.split(`
342
- `),z=J.indexOf(Gq);if(z===-1)return{removed:!1,skipped:s()};let Q=J.indexOf(Xq,z);if(Q===-1)return{removed:!1,skipped:!0};J.splice(z,Q-z+1);let V=J.join(`
342
+ `,Q=q+J+pq;if(j(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${x}`};return D(u(),Q),{added:!0}}function xq(){let q="";try{q=F(u(),"utf8")}catch{return{removed:!1}}let z=q.split(`
343
+ `),J=z.indexOf(uq);if(J===-1)return{removed:!1,skipped:c()};let Q=z.indexOf(bq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
343
344
  `).replace(/\n{3,}/g,`
344
345
 
345
- `).replace(/^\n+/,"");if(g(V)===null)return{removed:!1,skipped:!0};return D(x(),V),{removed:!0}}async function pq(){let{INIT_SKILL:q,REFRESH_SKILL:J,PLAN_SKILL:z,EXPLAIN_SKILL:Q}=await Promise.resolve().then(() => (i(),o)),V={"beacon-init":q,"beacon-refresh":J,"beacon-plan":z,"beacon-explain":Q},Y=[];for(let U of f){if(!S(A(),U))Y.push(U);$q(A(),U,V[U])}let W=0;for(let U of E)if(Jq(l(),{event:U.event,matcher:U.matcher,command:U.command}))W++;let P=m(T(),I);Yq(T(),I,Bq,qq);let $=xq();return{skillsAdded:Y,hooksAdded:W,agentsMdBlockTouched:!P,mcp:$}}function aq(){let q={};for(let z of f)q[z]=S(A(),z);let J={};for(let z of E)J[z.event]=Qq(l(),{event:z.event,command:z.command});return{detected:vq(),skills:q,hooks:J,agentsMdBlock:m(T(),I),mcp:s()}}function lq(){let q=[];for(let V of f)if(Uq(A(),V))q.push(V);let J=0;for(let V of E)if(Vq(l(),{event:V.event,command:V.command}))J++;let z=Zq(T(),I,Bq),Q=uq();return{skillsRemoved:q,hooksRemoved:J,agentsMdBlockRemoved:z,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var a=()=>j(Pq(),".codex"),l=()=>j(a(),"hooks.json"),x=()=>j(a(),"config.toml"),T=()=>j(a(),"AGENTS.md"),A=()=>j(Pq(),".agents","skills"),I="<!-- beacon:global:start -->",Bq="<!-- beacon:global:end -->",E,p,Gq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Xq="# beacon:end",mq,w="add it manually: codex mcp add beacon -- beacon mcp";var dq=u(()=>{Wq();Hq();E=[{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."}];mq=`${Gq}
346
+ `).replace(/^\n+/,"");if(j(V)===null)return{removed:!1,skipped:!0};return D(u(),V),{removed:!0}}async function aq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J,EXPLAIN_SKILL:Q}=await Promise.resolve().then(() => (qq(),e)),V={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J,"beacon-explain":Q},Y=[];for(let U of I){if(!p(f(),U))Y.push(U);Pq(f(),U,V[U])}let P=0;for(let U of E)if(Vq(d(),{event:U.event,matcher:U.matcher,command:U.command}))P++;let H=S(T(),A);$q(T(),A,Gq,Jq);let $=wq();return{skillsAdded:Y,hooksAdded:P,agentsMdBlockTouched:!H,mcp:$}}function dq(){let q={};for(let J of I)q[J]=p(f(),J);let z={};for(let J of E)z[J.event]=Yq(d(),{event:J.event,command:J.command});return{detected:Xq(),skills:q,hooks:z,agentsMdBlock:S(T(),A),mcp:c()}}function cq(){let q=[];for(let V of I)if(Wq(f(),V))q.push(V);let z=0;for(let V of E)if(Zq(d(),{event:V.event,command:V.command}))z++;let J=Uq(T(),A,Gq),Q=xq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var a=()=>g(vq(),".codex"),d=()=>g(a(),"hooks.json"),u=()=>g(a(),"config.toml"),T=()=>g(a(),"AGENTS.md"),f=()=>g(vq(),".agents","skills"),A="<!-- beacon:global:start -->",Gq="<!-- beacon:global:end -->",E,l,uq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",bq="# beacon:end",pq,x="add it manually: codex mcp add beacon -- beacon mcp";var nq=b(()=>{Hq();Bq();E=[{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."}];pq=`${uq}
346
347
  [mcp_servers.beacon]
347
348
  command = "beacon"
348
349
  args = ["mcp"]
349
- ${Xq}
350
- `});dq();export{pq as setupCodexAssets,uq as removeCodexMcp,lq as removeCodexArtifacts,s as hasCodexMcp,xq as ensureCodexMcp,Sq as codexMcpProblem,vq as codexDetected,aq as auditCodex,E as CODEX_HOOKS};
350
+ ${bq}
351
+ `});nq();export{aq as setupCodexAssets,xq as removeCodexMcp,cq as removeCodexArtifacts,c as hasCodexMcp,wq as ensureCodexMcp,lq as codexMcpProblem,Xq as codexDetected,dq as auditCodex,E as CODEX_HOOKS};