trybeacon 0.1.80 → 0.1.82

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 (421) 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 +22 -21
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/routes-manifest.json +20 -1
  7. package/.next/server/app/@modal/(.)settings/page.js +2 -0
  8. package/.next/server/app/@modal/(.)settings/page.js.nft.json +1 -0
  9. package/.next/server/app/@modal/(.)settings/page_client-reference-manifest.js +1 -0
  10. package/.next/server/app/_global-error/page.js +3 -3
  11. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_global-error.html +1 -1
  13. package/.next/server/app/_global-error.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  17. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  18. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  19. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  20. package/.next/server/app/_not-found/page.js +2 -2
  21. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  22. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/_not-found.html +1 -1
  24. package/.next/server/app/_not-found.rsc +27 -25
  25. package/.next/server/app/_not-found.segments/_full.segment.rsc +27 -25
  26. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_index.segment.rsc +16 -14
  28. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  29. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  30. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  31. package/.next/server/app/api/ask/answer/route.js +1 -1
  32. package/.next/server/app/api/ask/route.js +1 -1
  33. package/.next/server/app/api/ask/verdict/route.js +1 -1
  34. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  35. package/.next/server/app/api/board-annotations/route.js +1 -1
  36. package/.next/server/app/api/board-layout/route.js +1 -1
  37. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  38. package/.next/server/app/api/bug-flags/route.js +1 -1
  39. package/.next/server/app/api/changes/comment/answer/route.js +1 -1
  40. package/.next/server/app/api/changes/comment/claim/route.js +2 -2
  41. package/.next/server/app/api/changes/comment/route.js +2 -2
  42. package/.next/server/app/api/changes/quality/route.js +1 -1
  43. package/.next/server/app/api/changes/route.js +1 -1
  44. package/.next/server/app/api/changes/viewed/route.js +1 -1
  45. package/.next/server/app/api/code-graph/position/route.js +1 -1
  46. package/.next/server/app/api/code-graph/route.js +1 -1
  47. package/.next/server/app/api/context/feature/route.js +1 -1
  48. package/.next/server/app/api/context/file/route.js +1 -1
  49. package/.next/server/app/api/context/route.js +1 -1
  50. package/.next/server/app/api/db/arrange/route.js +1 -1
  51. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  52. package/.next/server/app/api/db/position/route.js +1 -1
  53. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  54. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  55. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  56. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  57. package/.next/server/app/api/draft/approve/route.js +1 -1
  58. package/.next/server/app/api/draft/route.js +1 -1
  59. package/.next/server/app/api/draft/status/route.js +1 -1
  60. package/.next/server/app/api/edges/[id]/route.js +1 -1
  61. package/.next/server/app/api/edges/route.js +1 -1
  62. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  63. package/.next/server/app/api/entities/route.js +1 -1
  64. package/.next/server/app/api/ingest/route.js +1 -1
  65. package/.next/server/app/api/init/route.js +1 -1
  66. package/.next/server/app/api/lesson/close/route.js +1 -1
  67. package/.next/server/app/api/lesson/presence/route.js +1 -1
  68. package/.next/server/app/api/lesson/questions/route.js +1 -1
  69. package/.next/server/app/api/lesson/route.js +1 -1
  70. package/.next/server/app/api/lesson/save/route.js +1 -1
  71. package/.next/server/app/api/lesson/verdict/route.js +1 -1
  72. package/.next/server/app/api/linear/route.js +2 -2
  73. package/.next/server/app/api/linear/scopes/route.js +1 -1
  74. package/.next/server/app/api/linear/sync/route.js +2 -2
  75. package/.next/server/app/api/map/describe/route.js +1 -1
  76. package/.next/server/app/api/map/files/route.js +1 -1
  77. package/.next/server/app/api/map/finish/route.js +1 -1
  78. package/.next/server/app/api/map/route.js +1 -1
  79. package/.next/server/app/api/map/start/route.js +1 -1
  80. package/.next/server/app/api/map/touch-active/route.js +1 -1
  81. package/.next/server/app/api/mention-search/route.js +1 -1
  82. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  83. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  84. package/.next/server/app/api/nodes/positions/route.js +1 -1
  85. package/.next/server/app/api/nodes/route.js +1 -1
  86. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  87. package/.next/server/app/api/notes/[id]/route.js +1 -1
  88. package/.next/server/app/api/notes/route.js +1 -1
  89. package/.next/server/app/api/open/route.js +1 -1
  90. package/.next/server/app/api/plan/annotations/route.js +2 -2
  91. package/.next/server/app/api/plan/approve/route.js +1 -1
  92. package/.next/server/app/api/plan/history/route.js +1 -1
  93. package/.next/server/app/api/plan/markdown/route.js +1 -1
  94. package/.next/server/app/api/plan/presence/route.js +1 -1
  95. package/.next/server/app/api/plan/route.js +1 -1
  96. package/.next/server/app/api/plan/verdict/route.js +1 -1
  97. package/.next/server/app/api/preferences/route.js +1 -1
  98. package/.next/server/app/api/project-meta/route.js +1 -1
  99. package/.next/server/app/api/reset/route.js +1 -1
  100. package/.next/server/app/api/scope-guard/check/route.js +2 -2
  101. package/.next/server/app/api/share/create/route.js +1 -1
  102. package/.next/server/app/api/share/route.js +1 -1
  103. package/.next/server/app/api/stream/route.js +2 -2
  104. package/.next/server/app/api/tab/nav/route.js +1 -1
  105. package/.next/server/app/api/tab/presence/route.js +1 -1
  106. package/.next/server/app/api/tab/view/route.js +1 -1
  107. package/.next/server/app/api/telemetry/route.js +1 -1
  108. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  109. package/.next/server/app/api/version/route.js +1 -1
  110. package/.next/server/app/api/workspace/activate/route.js +1 -1
  111. package/.next/server/app/api/workspace/route.js +1 -1
  112. package/.next/server/app/apple-icon.png/route.js +1 -1
  113. package/.next/server/app/docs/page.js +2 -2
  114. package/.next/server/app/docs/page.js.nft.json +1 -1
  115. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/docs.html +1 -1
  117. package/.next/server/app/docs.meta +1 -0
  118. package/.next/server/app/docs.rsc +31 -27
  119. package/.next/server/app/docs.segments/@modal/__DEFAULT__.segment.rsc +2 -0
  120. package/.next/server/app/docs.segments/_full.segment.rsc +31 -27
  121. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  122. package/.next/server/app/docs.segments/_index.segment.rsc +17 -15
  123. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  124. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  125. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  126. package/.next/server/app/help/page.js +2 -2
  127. package/.next/server/app/help/page.js.nft.json +1 -1
  128. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  129. package/.next/server/app/help.html +1 -1
  130. package/.next/server/app/help.meta +1 -0
  131. package/.next/server/app/help.rsc +40 -35
  132. package/.next/server/app/help.segments/@modal/__DEFAULT__.segment.rsc +2 -0
  133. package/.next/server/app/help.segments/_full.segment.rsc +40 -35
  134. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  135. package/.next/server/app/help.segments/_index.segment.rsc +17 -15
  136. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  137. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  138. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  139. package/.next/server/app/icon.svg/route.js +1 -1
  140. package/.next/server/app/index.html +1 -1
  141. package/.next/server/app/index.meta +1 -0
  142. package/.next/server/app/index.rsc +30 -25
  143. package/.next/server/app/index.segments/@modal/__DEFAULT__.segment.rsc +2 -0
  144. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  145. package/.next/server/app/index.segments/_full.segment.rsc +30 -25
  146. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  147. package/.next/server/app/index.segments/_index.segment.rsc +17 -15
  148. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  149. package/.next/server/app/learn/page.js +4 -4
  150. package/.next/server/app/learn/page.js.nft.json +1 -1
  151. package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
  152. package/.next/server/app/map/page.js +2 -2
  153. package/.next/server/app/map/page.js.nft.json +1 -1
  154. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  155. package/.next/server/app/page.js +2 -2
  156. package/.next/server/app/page.js.nft.json +1 -1
  157. package/.next/server/app/page_client-reference-manifest.js +1 -1
  158. package/.next/server/app/plan/page.js +3 -3
  159. package/.next/server/app/plan/page.js.nft.json +1 -1
  160. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  161. package/.next/server/app/s/[token]/page.js +2 -2
  162. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  163. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  164. package/.next/server/app/settings/page.js +2 -2
  165. package/.next/server/app/settings/page.js.nft.json +1 -1
  166. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  167. package/.next/server/app-paths-manifest.json +22 -21
  168. package/.next/server/chunks/2025.js +1 -1
  169. package/.next/server/chunks/2693.js +5 -5
  170. package/.next/server/chunks/3174.js +1 -1
  171. package/.next/server/chunks/3237.js +1 -0
  172. package/.next/server/chunks/3825.js +1 -0
  173. package/.next/server/chunks/4990.js +1 -0
  174. package/.next/server/chunks/5081.js +1 -0
  175. package/.next/server/chunks/6469.js +2 -2
  176. package/.next/server/chunks/6819.js +2 -0
  177. package/.next/server/chunks/{7720.js → 7436.js} +4 -4
  178. package/.next/server/chunks/7999.js +1 -0
  179. package/.next/server/interception-route-rewrite-manifest.js +1 -1
  180. package/.next/server/middleware-build-manifest.js +1 -1
  181. package/.next/server/pages/404.html +1 -1
  182. package/.next/server/pages/500.html +1 -1
  183. package/.next/server/server-reference-manifest.js +1 -1
  184. package/.next/server/server-reference-manifest.json +1 -1
  185. package/.next/static/32-hn-zWkepUstH6QZVnt/_buildManifest.js +1 -0
  186. package/.next/static/chunks/1569-ea8e739cccfb69b5.js +1 -0
  187. package/.next/static/chunks/1909-0f500ebe4df09208.js +1 -0
  188. package/.next/static/chunks/2114-74736df56930b46c.js +1 -0
  189. package/.next/static/chunks/4752-81a4fc25de32efa2.js +1 -0
  190. package/.next/static/chunks/4853-43350f60d0d9135b.js +1 -0
  191. package/.next/static/chunks/{9887-e8954568a4031ed3.js → 5547-2c07851028a9033a.js} +1 -1
  192. package/.next/static/chunks/569-b6c0e292fbfa6038.js +1 -0
  193. package/.next/static/chunks/{2059-fba06ba63ba64522.js → 6283-20a6abe3453496ae.js} +3 -3
  194. package/.next/static/chunks/6639-f0b63e1e7d03a20a.js +1 -0
  195. package/.next/static/chunks/6818-85b9a09bb74062ef.js +1 -0
  196. package/.next/static/chunks/7437-686839cf9b298bd8.js +1 -0
  197. package/.next/static/chunks/{5957-83f611fcd5a08b45.js → 8710-6b2685272a1e1ff7.js} +1 -1
  198. package/.next/static/chunks/app/@modal/(.)settings/page-58f068e66bf2fdf6.js +1 -0
  199. package/.next/static/chunks/app/@modal/default-b0a80080b8e8a17d.js +1 -0
  200. package/.next/static/chunks/app/_global-error/page-b0a80080b8e8a17d.js +1 -0
  201. package/.next/static/chunks/app/api/ask/answer/route-b0a80080b8e8a17d.js +1 -0
  202. package/.next/static/chunks/app/api/ask/route-b0a80080b8e8a17d.js +1 -0
  203. package/.next/static/chunks/app/api/ask/verdict/route-b0a80080b8e8a17d.js +1 -0
  204. package/.next/static/chunks/app/api/board-annotations/[id]/route-b0a80080b8e8a17d.js +1 -0
  205. package/.next/static/chunks/app/api/board-annotations/route-b0a80080b8e8a17d.js +1 -0
  206. package/.next/static/chunks/app/api/board-layout/route-b0a80080b8e8a17d.js +1 -0
  207. package/.next/static/chunks/app/api/bug-flags/[id]/route-b0a80080b8e8a17d.js +1 -0
  208. package/.next/static/chunks/app/api/bug-flags/route-b0a80080b8e8a17d.js +1 -0
  209. package/.next/static/chunks/app/api/changes/comment/answer/route-b0a80080b8e8a17d.js +1 -0
  210. package/.next/static/chunks/app/api/changes/comment/claim/route-b0a80080b8e8a17d.js +1 -0
  211. package/.next/static/chunks/app/api/changes/comment/route-b0a80080b8e8a17d.js +1 -0
  212. package/.next/static/chunks/app/api/changes/quality/route-b0a80080b8e8a17d.js +1 -0
  213. package/.next/static/chunks/app/api/changes/route-b0a80080b8e8a17d.js +1 -0
  214. package/.next/static/chunks/app/api/changes/viewed/route-b0a80080b8e8a17d.js +1 -0
  215. package/.next/static/chunks/app/api/code-graph/position/route-b0a80080b8e8a17d.js +1 -0
  216. package/.next/static/chunks/app/api/code-graph/route-b0a80080b8e8a17d.js +1 -0
  217. package/.next/static/chunks/app/api/context/feature/route-b0a80080b8e8a17d.js +1 -0
  218. package/.next/static/chunks/app/api/context/file/route-b0a80080b8e8a17d.js +1 -0
  219. package/.next/static/chunks/app/api/context/route-b0a80080b8e8a17d.js +1 -0
  220. package/.next/static/chunks/app/api/db/arrange/route-b0a80080b8e8a17d.js +1 -0
  221. package/.next/static/chunks/app/api/db/backfill-access/route-b0a80080b8e8a17d.js +1 -0
  222. package/.next/static/chunks/app/api/db/position/route-b0a80080b8e8a17d.js +1 -0
  223. package/.next/static/chunks/app/api/db/prune-planned/route-b0a80080b8e8a17d.js +1 -0
  224. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-b0a80080b8e8a17d.js +1 -0
  225. package/.next/static/chunks/app/api/db/relations/[id]/route-b0a80080b8e8a17d.js +1 -0
  226. package/.next/static/chunks/app/api/db/tables/[id]/route-b0a80080b8e8a17d.js +1 -0
  227. package/.next/static/chunks/app/api/draft/approve/route-b0a80080b8e8a17d.js +1 -0
  228. package/.next/static/chunks/app/api/draft/route-b0a80080b8e8a17d.js +1 -0
  229. package/.next/static/chunks/app/api/draft/status/route-b0a80080b8e8a17d.js +1 -0
  230. package/.next/static/chunks/app/api/edges/[id]/route-b0a80080b8e8a17d.js +1 -0
  231. package/.next/static/chunks/app/api/edges/route-b0a80080b8e8a17d.js +1 -0
  232. package/.next/static/chunks/app/api/endpoints/[id]/route-b0a80080b8e8a17d.js +1 -0
  233. package/.next/static/chunks/app/api/entities/route-b0a80080b8e8a17d.js +1 -0
  234. package/.next/static/chunks/app/api/ingest/route-b0a80080b8e8a17d.js +1 -0
  235. package/.next/static/chunks/app/api/init/route-b0a80080b8e8a17d.js +1 -0
  236. package/.next/static/chunks/app/api/lesson/close/route-b0a80080b8e8a17d.js +1 -0
  237. package/.next/static/chunks/app/api/lesson/presence/route-b0a80080b8e8a17d.js +1 -0
  238. package/.next/static/chunks/app/api/lesson/questions/route-b0a80080b8e8a17d.js +1 -0
  239. package/.next/static/chunks/app/api/lesson/route-b0a80080b8e8a17d.js +1 -0
  240. package/.next/static/chunks/app/api/lesson/save/route-b0a80080b8e8a17d.js +1 -0
  241. package/.next/static/chunks/app/api/lesson/verdict/route-b0a80080b8e8a17d.js +1 -0
  242. package/.next/static/chunks/app/api/linear/route-b0a80080b8e8a17d.js +1 -0
  243. package/.next/static/chunks/app/api/linear/scopes/route-b0a80080b8e8a17d.js +1 -0
  244. package/.next/static/chunks/app/api/linear/sync/route-b0a80080b8e8a17d.js +1 -0
  245. package/.next/static/chunks/app/api/map/describe/route-b0a80080b8e8a17d.js +1 -0
  246. package/.next/static/chunks/app/api/map/files/route-b0a80080b8e8a17d.js +1 -0
  247. package/.next/static/chunks/app/api/map/finish/route-b0a80080b8e8a17d.js +1 -0
  248. package/.next/static/chunks/app/api/map/route-b0a80080b8e8a17d.js +1 -0
  249. package/.next/static/chunks/app/api/map/start/route-b0a80080b8e8a17d.js +1 -0
  250. package/.next/static/chunks/app/api/map/touch-active/route-b0a80080b8e8a17d.js +1 -0
  251. package/.next/static/chunks/app/api/mention-search/route-b0a80080b8e8a17d.js +1 -0
  252. package/.next/static/chunks/app/api/nodes/[id]/position/route-b0a80080b8e8a17d.js +1 -0
  253. package/.next/static/chunks/app/api/nodes/[id]/route-b0a80080b8e8a17d.js +1 -0
  254. package/.next/static/chunks/app/api/nodes/positions/route-b0a80080b8e8a17d.js +1 -0
  255. package/.next/static/chunks/app/api/nodes/route-b0a80080b8e8a17d.js +1 -0
  256. package/.next/static/chunks/app/api/nodes/subtasks/route-b0a80080b8e8a17d.js +1 -0
  257. package/.next/static/chunks/app/api/notes/[id]/route-b0a80080b8e8a17d.js +1 -0
  258. package/.next/static/chunks/app/api/notes/route-b0a80080b8e8a17d.js +1 -0
  259. package/.next/static/chunks/app/api/open/route-b0a80080b8e8a17d.js +1 -0
  260. package/.next/static/chunks/app/api/plan/annotations/route-b0a80080b8e8a17d.js +1 -0
  261. package/.next/static/chunks/app/api/plan/approve/route-b0a80080b8e8a17d.js +1 -0
  262. package/.next/static/chunks/app/api/plan/history/route-b0a80080b8e8a17d.js +1 -0
  263. package/.next/static/chunks/app/api/plan/markdown/route-b0a80080b8e8a17d.js +1 -0
  264. package/.next/static/chunks/app/api/plan/presence/route-b0a80080b8e8a17d.js +1 -0
  265. package/.next/static/chunks/app/api/plan/route-b0a80080b8e8a17d.js +1 -0
  266. package/.next/static/chunks/app/api/plan/verdict/route-b0a80080b8e8a17d.js +1 -0
  267. package/.next/static/chunks/app/api/preferences/route-b0a80080b8e8a17d.js +1 -0
  268. package/.next/static/chunks/app/api/project-meta/route-b0a80080b8e8a17d.js +1 -0
  269. package/.next/static/chunks/app/api/reset/route-b0a80080b8e8a17d.js +1 -0
  270. package/.next/static/chunks/app/api/scope-guard/check/route-b0a80080b8e8a17d.js +1 -0
  271. package/.next/static/chunks/app/api/share/create/route-b0a80080b8e8a17d.js +1 -0
  272. package/.next/static/chunks/app/api/share/route-b0a80080b8e8a17d.js +1 -0
  273. package/.next/static/chunks/app/api/stream/route-b0a80080b8e8a17d.js +1 -0
  274. package/.next/static/chunks/app/api/tab/nav/route-b0a80080b8e8a17d.js +1 -0
  275. package/.next/static/chunks/app/api/tab/presence/route-b0a80080b8e8a17d.js +1 -0
  276. package/.next/static/chunks/app/api/tab/view/route-b0a80080b8e8a17d.js +1 -0
  277. package/.next/static/chunks/app/api/telemetry/route-b0a80080b8e8a17d.js +1 -0
  278. package/.next/static/chunks/app/api/telemetry/stats/route-b0a80080b8e8a17d.js +1 -0
  279. package/.next/static/chunks/app/api/version/route-b0a80080b8e8a17d.js +1 -0
  280. package/.next/static/chunks/app/api/workspace/activate/route-b0a80080b8e8a17d.js +1 -0
  281. package/.next/static/chunks/app/api/workspace/route-b0a80080b8e8a17d.js +1 -0
  282. package/.next/static/chunks/app/layout-b78f34d56f9d5aea.js +1 -0
  283. package/.next/static/chunks/app/learn/page-c01e1092ca9135e6.js +7 -0
  284. package/.next/static/chunks/app/map/page-9075091c6ba84c19.js +1 -0
  285. package/.next/static/chunks/app/page-62c53092bdab1224.js +1 -0
  286. package/.next/static/chunks/app/plan/page-6645cae32f5767c2.js +11 -0
  287. package/.next/static/chunks/app/s/[token]/page-2cf9b4a9b7740e56.js +1 -0
  288. package/.next/static/chunks/app/settings/page-435bfb2ac6f01744.js +1 -0
  289. package/.next/static/chunks/main-eef923c08f6b5e3c.js +5 -0
  290. package/.next/static/chunks/next/dist/client/components/builtin/app-error-b0a80080b8e8a17d.js +1 -0
  291. package/.next/static/chunks/next/dist/client/components/builtin/default-null-b0a80080b8e8a17d.js +1 -0
  292. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-b0a80080b8e8a17d.js +1 -0
  293. package/.next/static/chunks/next/dist/client/components/builtin/not-found-b0a80080b8e8a17d.js +1 -0
  294. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-b0a80080b8e8a17d.js +1 -0
  295. package/.next/static/css/95077158c5710c9e.css +1 -0
  296. package/.next/trace +47 -46
  297. package/.next/trace-build +1 -1
  298. package/.next/types/app/@modal/(.)settings/page.ts +87 -0
  299. package/.next/types/routes.d.ts +1 -1
  300. package/.next/types/validator.ts +9 -0
  301. package/dist/bin/beacon.js +16 -15
  302. package/dist/bin/doctor.js +61 -60
  303. package/dist/bin/hook.js +58 -57
  304. package/dist/bin/mcp.js +70 -69
  305. package/dist/bin/plan.js +61 -60
  306. package/dist/bin/uninstall.js +59 -58
  307. package/dist/lib/assets.js +55 -20
  308. package/dist/lib/codex-install.js +62 -61
  309. package/dist/lib/daemon-boot.js +37 -0
  310. package/dist/lib/global-install.js +62 -61
  311. package/package.json +1 -1
  312. package/.next/server/chunks/2994.js +0 -2
  313. package/.next/server/chunks/374.js +0 -1
  314. package/.next/server/chunks/5295.js +0 -1
  315. package/.next/server/chunks/7350.js +0 -1
  316. package/.next/server/chunks/7652.js +0 -1
  317. package/.next/static/chunks/1909-98243a0473be2aae.js +0 -1
  318. package/.next/static/chunks/3908-80efc60050779adf.js +0 -1
  319. package/.next/static/chunks/4477-cda153702c7812d2.js +0 -1
  320. package/.next/static/chunks/4607-a668ea431c41e60e.js +0 -1
  321. package/.next/static/chunks/4853-0082a1e1b820a293.js +0 -1
  322. package/.next/static/chunks/5520-32e29b8bbff59f44.js +0 -1
  323. package/.next/static/chunks/5697-5b9719b81806b4cf.js +0 -1
  324. package/.next/static/chunks/7424-d7fa15ef452064dd.js +0 -1
  325. package/.next/static/chunks/app/_global-error/page-18eb7d6678dc0ddd.js +0 -1
  326. package/.next/static/chunks/app/api/ask/answer/route-18eb7d6678dc0ddd.js +0 -1
  327. package/.next/static/chunks/app/api/ask/route-18eb7d6678dc0ddd.js +0 -1
  328. package/.next/static/chunks/app/api/ask/verdict/route-18eb7d6678dc0ddd.js +0 -1
  329. package/.next/static/chunks/app/api/board-annotations/[id]/route-18eb7d6678dc0ddd.js +0 -1
  330. package/.next/static/chunks/app/api/board-annotations/route-18eb7d6678dc0ddd.js +0 -1
  331. package/.next/static/chunks/app/api/board-layout/route-18eb7d6678dc0ddd.js +0 -1
  332. package/.next/static/chunks/app/api/bug-flags/[id]/route-18eb7d6678dc0ddd.js +0 -1
  333. package/.next/static/chunks/app/api/bug-flags/route-18eb7d6678dc0ddd.js +0 -1
  334. package/.next/static/chunks/app/api/changes/comment/answer/route-18eb7d6678dc0ddd.js +0 -1
  335. package/.next/static/chunks/app/api/changes/comment/claim/route-18eb7d6678dc0ddd.js +0 -1
  336. package/.next/static/chunks/app/api/changes/comment/route-18eb7d6678dc0ddd.js +0 -1
  337. package/.next/static/chunks/app/api/changes/quality/route-18eb7d6678dc0ddd.js +0 -1
  338. package/.next/static/chunks/app/api/changes/route-18eb7d6678dc0ddd.js +0 -1
  339. package/.next/static/chunks/app/api/changes/viewed/route-18eb7d6678dc0ddd.js +0 -1
  340. package/.next/static/chunks/app/api/code-graph/position/route-18eb7d6678dc0ddd.js +0 -1
  341. package/.next/static/chunks/app/api/code-graph/route-18eb7d6678dc0ddd.js +0 -1
  342. package/.next/static/chunks/app/api/context/feature/route-18eb7d6678dc0ddd.js +0 -1
  343. package/.next/static/chunks/app/api/context/file/route-18eb7d6678dc0ddd.js +0 -1
  344. package/.next/static/chunks/app/api/context/route-18eb7d6678dc0ddd.js +0 -1
  345. package/.next/static/chunks/app/api/db/arrange/route-18eb7d6678dc0ddd.js +0 -1
  346. package/.next/static/chunks/app/api/db/backfill-access/route-18eb7d6678dc0ddd.js +0 -1
  347. package/.next/static/chunks/app/api/db/position/route-18eb7d6678dc0ddd.js +0 -1
  348. package/.next/static/chunks/app/api/db/prune-planned/route-18eb7d6678dc0ddd.js +0 -1
  349. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-18eb7d6678dc0ddd.js +0 -1
  350. package/.next/static/chunks/app/api/db/relations/[id]/route-18eb7d6678dc0ddd.js +0 -1
  351. package/.next/static/chunks/app/api/db/tables/[id]/route-18eb7d6678dc0ddd.js +0 -1
  352. package/.next/static/chunks/app/api/draft/approve/route-18eb7d6678dc0ddd.js +0 -1
  353. package/.next/static/chunks/app/api/draft/route-18eb7d6678dc0ddd.js +0 -1
  354. package/.next/static/chunks/app/api/draft/status/route-18eb7d6678dc0ddd.js +0 -1
  355. package/.next/static/chunks/app/api/edges/[id]/route-18eb7d6678dc0ddd.js +0 -1
  356. package/.next/static/chunks/app/api/edges/route-18eb7d6678dc0ddd.js +0 -1
  357. package/.next/static/chunks/app/api/endpoints/[id]/route-18eb7d6678dc0ddd.js +0 -1
  358. package/.next/static/chunks/app/api/entities/route-18eb7d6678dc0ddd.js +0 -1
  359. package/.next/static/chunks/app/api/ingest/route-18eb7d6678dc0ddd.js +0 -1
  360. package/.next/static/chunks/app/api/init/route-18eb7d6678dc0ddd.js +0 -1
  361. package/.next/static/chunks/app/api/lesson/close/route-18eb7d6678dc0ddd.js +0 -1
  362. package/.next/static/chunks/app/api/lesson/presence/route-18eb7d6678dc0ddd.js +0 -1
  363. package/.next/static/chunks/app/api/lesson/questions/route-18eb7d6678dc0ddd.js +0 -1
  364. package/.next/static/chunks/app/api/lesson/route-18eb7d6678dc0ddd.js +0 -1
  365. package/.next/static/chunks/app/api/lesson/save/route-18eb7d6678dc0ddd.js +0 -1
  366. package/.next/static/chunks/app/api/lesson/verdict/route-18eb7d6678dc0ddd.js +0 -1
  367. package/.next/static/chunks/app/api/linear/route-18eb7d6678dc0ddd.js +0 -1
  368. package/.next/static/chunks/app/api/linear/scopes/route-18eb7d6678dc0ddd.js +0 -1
  369. package/.next/static/chunks/app/api/linear/sync/route-18eb7d6678dc0ddd.js +0 -1
  370. package/.next/static/chunks/app/api/map/describe/route-18eb7d6678dc0ddd.js +0 -1
  371. package/.next/static/chunks/app/api/map/files/route-18eb7d6678dc0ddd.js +0 -1
  372. package/.next/static/chunks/app/api/map/finish/route-18eb7d6678dc0ddd.js +0 -1
  373. package/.next/static/chunks/app/api/map/route-18eb7d6678dc0ddd.js +0 -1
  374. package/.next/static/chunks/app/api/map/start/route-18eb7d6678dc0ddd.js +0 -1
  375. package/.next/static/chunks/app/api/map/touch-active/route-18eb7d6678dc0ddd.js +0 -1
  376. package/.next/static/chunks/app/api/mention-search/route-18eb7d6678dc0ddd.js +0 -1
  377. package/.next/static/chunks/app/api/nodes/[id]/position/route-18eb7d6678dc0ddd.js +0 -1
  378. package/.next/static/chunks/app/api/nodes/[id]/route-18eb7d6678dc0ddd.js +0 -1
  379. package/.next/static/chunks/app/api/nodes/positions/route-18eb7d6678dc0ddd.js +0 -1
  380. package/.next/static/chunks/app/api/nodes/route-18eb7d6678dc0ddd.js +0 -1
  381. package/.next/static/chunks/app/api/nodes/subtasks/route-18eb7d6678dc0ddd.js +0 -1
  382. package/.next/static/chunks/app/api/notes/[id]/route-18eb7d6678dc0ddd.js +0 -1
  383. package/.next/static/chunks/app/api/notes/route-18eb7d6678dc0ddd.js +0 -1
  384. package/.next/static/chunks/app/api/open/route-18eb7d6678dc0ddd.js +0 -1
  385. package/.next/static/chunks/app/api/plan/annotations/route-18eb7d6678dc0ddd.js +0 -1
  386. package/.next/static/chunks/app/api/plan/approve/route-18eb7d6678dc0ddd.js +0 -1
  387. package/.next/static/chunks/app/api/plan/history/route-18eb7d6678dc0ddd.js +0 -1
  388. package/.next/static/chunks/app/api/plan/markdown/route-18eb7d6678dc0ddd.js +0 -1
  389. package/.next/static/chunks/app/api/plan/presence/route-18eb7d6678dc0ddd.js +0 -1
  390. package/.next/static/chunks/app/api/plan/route-18eb7d6678dc0ddd.js +0 -1
  391. package/.next/static/chunks/app/api/plan/verdict/route-18eb7d6678dc0ddd.js +0 -1
  392. package/.next/static/chunks/app/api/preferences/route-18eb7d6678dc0ddd.js +0 -1
  393. package/.next/static/chunks/app/api/project-meta/route-18eb7d6678dc0ddd.js +0 -1
  394. package/.next/static/chunks/app/api/reset/route-18eb7d6678dc0ddd.js +0 -1
  395. package/.next/static/chunks/app/api/scope-guard/check/route-18eb7d6678dc0ddd.js +0 -1
  396. package/.next/static/chunks/app/api/share/create/route-18eb7d6678dc0ddd.js +0 -1
  397. package/.next/static/chunks/app/api/share/route-18eb7d6678dc0ddd.js +0 -1
  398. package/.next/static/chunks/app/api/stream/route-18eb7d6678dc0ddd.js +0 -1
  399. package/.next/static/chunks/app/api/tab/nav/route-18eb7d6678dc0ddd.js +0 -1
  400. package/.next/static/chunks/app/api/tab/presence/route-18eb7d6678dc0ddd.js +0 -1
  401. package/.next/static/chunks/app/api/tab/view/route-18eb7d6678dc0ddd.js +0 -1
  402. package/.next/static/chunks/app/api/telemetry/route-18eb7d6678dc0ddd.js +0 -1
  403. package/.next/static/chunks/app/api/telemetry/stats/route-18eb7d6678dc0ddd.js +0 -1
  404. package/.next/static/chunks/app/api/version/route-18eb7d6678dc0ddd.js +0 -1
  405. package/.next/static/chunks/app/api/workspace/activate/route-18eb7d6678dc0ddd.js +0 -1
  406. package/.next/static/chunks/app/api/workspace/route-18eb7d6678dc0ddd.js +0 -1
  407. package/.next/static/chunks/app/layout-e728d45f193e3b95.js +0 -1
  408. package/.next/static/chunks/app/learn/page-fc0bf8bce602526b.js +0 -7
  409. package/.next/static/chunks/app/map/page-847b374e7dfed924.js +0 -1
  410. package/.next/static/chunks/app/page-ec00130a7a249f14.js +0 -1
  411. package/.next/static/chunks/app/plan/page-1108bdf804b8a1bd.js +0 -11
  412. package/.next/static/chunks/app/s/[token]/page-2fc7806fc2f205a5.js +0 -1
  413. package/.next/static/chunks/app/settings/page-7e86fd456b92c248.js +0 -1
  414. package/.next/static/chunks/main-4140465958bbcd36.js +0 -5
  415. package/.next/static/chunks/next/dist/client/components/builtin/app-error-18eb7d6678dc0ddd.js +0 -1
  416. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-18eb7d6678dc0ddd.js +0 -1
  417. package/.next/static/chunks/next/dist/client/components/builtin/not-found-18eb7d6678dc0ddd.js +0 -1
  418. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-18eb7d6678dc0ddd.js +0 -1
  419. package/.next/static/css/6eabb17c2a2081f2.css +0 -1
  420. package/.next/static/zI2f5SCpeUG4MfjJNbXnf/_buildManifest.js +0 -1
  421. /package/.next/static/{zI2f5SCpeUG4MfjJNbXnf → 32-hn-zWkepUstH6QZVnt}/_ssgManifest.js +0 -0
@@ -1,22 +1,57 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
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(`
3
+ var pZ=Object.defineProperty;var mZ=(Q)=>Q;function cZ(Q,Z){this[Q]=mZ.bind(null,Z)}var xQ=(Q,Z)=>{for(var $ in Z)pZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:cZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);import{existsSync as E,mkdirSync as MQ,readdirSync as lZ,readFileSync as g,rmSync as tZ,writeFileSync as l}from"fs";import{basename as sZ,dirname as nQ,join as K}from"path";function aQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function oQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=K(Q,".claude","plugins");if(!E(Z))return null;let $=[Z];for(let J=0;J<3&&$.length;J++){let Y=[];for(let V of $){let z=K(V,".claude-plugin","plugin.json");try{if(E(z)&&JSON.parse(g(z,"utf8")).name==="beacon")return V}catch{}try{for(let W of lZ(V,{withFileTypes:!0}))if(W.isDirectory())Y.push(K(V,W.name))}catch{}}$=Y}return null}function iQ(Q){return oQ(Q)!==null}function dZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function R(){let Q=process.env.BEACON_CLI_PATH;if(Q)return Q;if(E(rQ))return rQ;return"beacon"}function uQ(Q){let Z=Q.indexOf(" ");return Z===-1?Q:Q.slice(0,Z)}function t(Q){let Z=R();if(Z==="beacon")return Q;return Q.replace(/^beacon(\s|$)/,`${Z}$1`)}function x(Q){let Z=uQ(Q);return sZ(Z)+Q.slice(Z.length)}function rZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(g(K(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 d(Q){try{return JSON.parse(g(Q,"utf8"))}catch{return{}}}function eQ(Q,Z){MQ(nQ(Q),{recursive:!0}),l(Q,JSON.stringify(Z,null,2)+`
4
+ `)}function r(Q,Z){let $=d(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((z)=>x(z.command)===x(Z.command))))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),eQ(Q,$),!0}function n(Q,Z){return(d(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>x(V.command)===x(Z.command)))}function QZ(Q,Z){let J=d(Q).hooks?.[Z.event]??[];for(let Y of J)for(let V of Y.hooks??[])if(x(V.command)===x(Z.command))return V.command;return null}function a(Q,Z){let $=d(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((z)=>{let W=z.hooks?.length??0,q=(z.hooks??[]).filter((U)=>x(U.command)!==x(Z.command));if(q.length!==W)Y=!0;return{...z,hooks:q}}).filter((z)=>(z.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 o(Q,Z,$,J){let Y=`${Z}
5
+ ${J.trim()}
6
+ ${$}`,V="";try{V=g(Q,"utf8")}catch{}let z=new RegExp(`${Z}[\\s\\S]*?${$}`);V=z.test(V)?V.replace(z,Y):V.trim()?`${V.trim()}
7
+
8
+ ${Y}
9
+ `:`${Y}
10
+ `,MQ(nQ(Q),{recursive:!0}),l(Q,V.endsWith(`
11
+ `)?V:`${V}
12
+ `)}function b(Q,Z){try{return g(Q,"utf8").includes(Z)}catch{return!1}}function i(Q,Z,$){let J="";try{J=g(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,`
13
+
14
+ `).trimStart();return l(Q,V),!0}function e(Q,Z,$){let J=K(Q,Z);MQ(J,{recursive:!0});let Y=K(J,"SKILL.md");return l(Y,$),Y}function y(Q,Z){return E(K(Q,Z,"SKILL.md"))}function QQ(Q,Z){let $=K(Q,Z);if(!E($))return!1;return tZ($,{recursive:!0,force:!0}),!0}var j,rQ="/Applications/Beacon.app/Contents/Resources/bin/beacon",s=`## Beacon (visual planning panel)
15
+
16
+ This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
17
+ agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
18
+ the user reviews on a canvas at /plan, and feedback flows back as the next round.
19
+
20
+ **When to invoke**
21
+ - User asks to "plan a feature" / "design a schema" \u2192 if the \`beacon_propose_plan\`
22
+ MCP tool is available, design the plan and call it. If it is NOT available, the panel
23
+ isn't wired in this repo \u2014 run \`beacon\` here once, then retry.
24
+ - User asks to "set up Beacon" / "map this repo" \u2192 invoke the \`beacon-init\` skill.
25
+ - User asks to "refresh Beacon" / "update the map" / "bring Beacon up to date" \u2192 invoke
26
+ the \`beacon-refresh\` skill. Re-surveys the repo and updates init-derived nodes while
27
+ preserving anything the user added by hand.
28
+ - User asks to "explain" / "teach me" / "walk me through" / "how does X work" \u2192 if the
29
+ \`beacon_explain\` MCP tool is available, author an interactive Lesson (a concept map +
30
+ plain-English narrative on /learn the user questions back) via the \`beacon-explain\` skill.
31
+ - Run \`beacon doctor\` to audit what's wired (global hooks, repo's .mcp.json, AGENTS.md block).
32
+
33
+ **The plan feedback loop**
34
+ \`beacon_propose_plan\` BLOCKS until the user clicks Approve / Discard / submits feedback.
35
+ Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
36
+ on the /map and /db boards (added features, attached subtasks, edited columns, new
37
+ endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
38
+ verbatim. Do NOT implement until the tool returns approval.`;var ZQ=C(()=>{j=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});var U1=1500,W1=480000,H1=1800000,$Q=3600000,j1=3000;var ZZ=()=>{};var CQ={};xQ(CQ,{stripAgentsPointer:()=>VZ,repoMcpCliTarget:()=>J0,removeRepoAssets:()=>FQ,installRefreshSkill:()=>aZ,installPlanSkill:()=>oZ,installInitSkill:()=>nZ,installExplainSkill:()=>iZ,installCodexRepoSkills:()=>Q0,ensureWorkflowDoc:()=>Z0,ensureMcp:()=>$0,contextDocTargets:()=>TQ,auditRepo:()=>Y0,REFRESH_SKILL:()=>wQ,PLAN_SKILL:()=>JZ,INIT_SKILL:()=>RQ,EXPLAIN_SKILL:()=>YZ});import{existsSync as N,mkdirSync as L,readFileSync as P,rmSync as JQ,writeFileSync as H}from"fs";import{join as X}from"path";function nZ(Q){let Z=X(Q,".claude","skills","beacon-init");L(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,RQ),$}function aZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");L(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,wQ),$}function oZ(Q){let Z=X(Q,".claude","skills","beacon-plan");L(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,JZ),$}function iZ(Q){let Z=X(Q,".claude","skills","beacon-explain");L(Z,{recursive:!0});let $=X(Z,"SKILL.md");return H($,YZ),$}function Q0(Q){let Z=[];for(let $ of eZ){let J=X(Q,".agents","skills",$.name);L(J,{recursive:!0});let Y=X(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function TQ(Q){let Z=X(Q,"AGENTS.md"),$=X(Q,"CLAUDE.md"),J=N(Z),Y=N($);if(!J&&!Y)return[Z,$];let V=[];if(J)V.push(Z);if(Y)V.push($);return V}function VZ(Q){let Z=X(Q,"CLAUDE.md");if(!N(Z))return;let $=P(Z,"utf8"),J=$.split(`
4
39
  `).filter((Y)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Y)).join(`
5
40
  `).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()}
41
+ `)}function Z0(Q){let Z=new RegExp(`${YQ}[\\s\\S]*?${fQ}`);for(let $ of TQ(Q)){let J="";try{J=P($,"utf8")}catch{}J=Z.test(J)?J.replace(Z,$Z):`${J.trim()}
7
42
 
8
- ${nQ}
43
+ ${$Z}
9
44
  `.trimStart(),H($,J.endsWith(`
10
45
  `)?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,`
46
+ `)}VZ(Q)}function $0(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<$Q)return J.timeout=$Q,H(Z,JSON.stringify($,null,2)+`
47
+ `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:R(),args:["mcp"],timeout:$Q},H(Z,JSON.stringify($,null,2)+`
48
+ `),{path:Z,added:!0,updated:!1}}function J0(Q){try{return JSON.parse(P(X(Q,".mcp.json"),"utf8")).mcpServers?.beacon?.command??null}catch{return null}}function Y0(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(P(Z,"utf8")).mcpServers?.beacon}catch{}let J=TQ(Q).some((Y)=>{try{return P(Y,"utf8").includes(YQ)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:J,skills:{"beacon-init":N(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":N(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":N(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":N(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function FQ(Q){let Z=[];for(let q of["beacon-init","beacon-refresh","beacon-db-design"]){let U=X(Q,".claude","skills",q);if(N(U))JQ(U,{recursive:!0,force:!0}),Z.push(q)}for(let q of["beacon-init","beacon-refresh"]){let U=X(Q,".agents","skills",q);if(N(U))JQ(U,{recursive:!0,force:!0}),Z.push(`codex:${q}`)}let $=!1,J=X(Q,".mcp.json");try{let q=JSON.parse(P(J,"utf8"));if(q.mcpServers?.beacon){if(delete q.mcpServers.beacon,$=!0,q.mcpServers&&Object.keys(q.mcpServers).length===0)delete q.mcpServers;if(Object.keys(q).length===0)JQ(J,{force:!0});else H(J,JSON.stringify(q,null,2)+`
49
+ `)}}catch{}let Y=!1,V=new RegExp(`\\n?${YQ}[\\s\\S]*?${fQ}\\n?`);for(let q of[X(Q,"AGENTS.md"),X(Q,"CLAUDE.md")])try{let U=P(q,"utf8");if(V.test(U)){let KQ=U.replace(V,`
15
50
  `).replace(/\n{3,}/g,`
16
51
 
17
- `).trimStart();H(z,BQ.endsWith(`
18
- `)?BQ:`${BQ}
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=`---
52
+ `).trimStart();H(q,KQ.endsWith(`
53
+ `)?KQ:`${KQ}
54
+ `),Y=!0}}catch{}let z=!1,W=X(Q,"CLAUDE.md");try{let q=P(W,"utf8"),U=q.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(U!==q){if(!U.trim())JQ(W,{force:!0});else H(W,U);z=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:z}}var RQ=`---
20
55
  name: beacon-init
21
56
  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
57
  ---
@@ -63,7 +98,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
63
98
  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
99
 
65
100
  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
- `,vQ=`---
101
+ `,wQ=`---
67
102
  name: beacon-refresh
68
103
  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
104
  ---
@@ -110,7 +145,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
110
145
  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
146
 
112
147
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
113
- `,dQ=`---
148
+ `,JZ=`---
114
149
  name: beacon-plan
115
150
  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
151
  ---
@@ -159,7 +194,7 @@ If it returns feedback, revise and call it again.
159
194
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
160
195
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
161
196
  run \`beacon\` in this repo once.
162
- `,tQ=`---
197
+ `,YZ=`---
163
198
  name: beacon-explain
164
199
  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".
165
200
  ---
@@ -229,7 +264,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
229
264
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
230
265
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
231
266
  the lesson.
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}
267
+ `,eZ,YQ="<!-- beacon:workflow:start -->",fQ="<!-- beacon:workflow:end -->",$Z;var VQ=C(()=>{ZQ();ZZ();eZ=[{name:"beacon-init",body:()=>RQ},{name:"beacon-refresh",body:()=>wQ}];$Z=`${YQ}
233
268
  ## Beacon \u2014 feature workflow
234
269
 
235
270
  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:
@@ -301,55 +336,21 @@ Register them all in that single batched call. If a plan added five features, th
301
336
  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.
302
337
 
303
338
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
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}
306
- ${J.trim()}
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()}
308
-
309
- ${Y}
310
- `:`${Y}
311
- `,uQ(sQ(Q),{recursive:!0}),n(Q,V.endsWith(`
312
- `)?V:`${V}
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,`
314
-
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)
316
-
317
- This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
318
- agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
319
- the user reviews on a canvas at /plan, and feedback flows back as the next round.
320
-
321
- **When to invoke**
322
- - User asks to "plan a feature" / "design a schema" \u2192 if the \`beacon_propose_plan\`
323
- MCP tool is available, design the plan and call it. If it is NOT available, the panel
324
- isn't wired in this repo \u2014 run \`beacon\` here once, then retry.
325
- - User asks to "set up Beacon" / "map this repo" \u2192 invoke the \`beacon-init\` skill.
326
- - User asks to "refresh Beacon" / "update the map" / "bring Beacon up to date" \u2192 invoke
327
- the \`beacon-refresh\` skill. Re-surveys the repo and updates init-derived nodes while
328
- preserving anything the user added by hand.
329
- - User asks to "explain" / "teach me" / "walk me through" / "how does X work" \u2192 if the
330
- \`beacon_explain\` MCP tool is available, author an interactive Lesson (a concept map +
331
- plain-English narrative on /learn the user questions back) via the \`beacon-explain\` skill.
332
- - Run \`beacon doctor\` to audit what's wired (global hooks, repo's .mcp.json, AGENTS.md block).
333
-
334
- **The plan feedback loop**
335
- \`beacon_propose_plan\` BLOCKS until the user clicks Approve / Discard / submits feedback.
336
- Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
337
- on the /map and /db boards (added features, attached subtasks, edited columns, new
338
- endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
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
+ ${fQ}`});import{mkdirSync as V0,renameSync as q0,rmSync as z0,writeFileSync as X0}from"fs";import{dirname as U0}from"path";function qQ(Q,Z){V0(U0(Q),{recursive:!0});let $=`${Q}.tmp`;try{X0($,Z),q0($,Q)}catch(J){throw z0($,{force:!0}),J}}function M1(Q,Z,$=!1){qQ(Q,JSON.stringify(Z,null,$?2:void 0))}var qZ=()=>{};var BZ={};xQ(BZ,{setupCodexAssets:()=>K0,removeCodexMcp:()=>PZ,removeCodexArtifacts:()=>EQ,parseTomlBeacon:()=>vZ,nodeWhich:()=>UZ,hasCodexMcp:()=>DQ,ensureCodexMcp:()=>NZ,commandExists:()=>WZ,codexMcpProblem:()=>P0,codexMcpCliTarget:()=>B0,codexDetected:()=>HZ,auditCodex:()=>AQ,CODEX_HOOKS:()=>D});import{accessSync as W0,constants as H0,readFileSync as _}from"fs";import{homedir as j0}from"os";import{delimiter as G0,join as I}from"path";function zZ(){return process.env.HOME||process.env.USERPROFILE||j0()}function UZ(Q,Z=process.env.PATH||"",$=v0){if(!Q)return null;for(let J of Z.split(G0)){if(!J)continue;let Y=I(J,Q);if($(Y))return Y}return null}function v0(Q){try{return W0(Q,H0.X_OK),!0}catch{return!1}}function WZ(Q){if(typeof Bun<"u"&&typeof Bun.which==="function")return Bun.which(Q)!==null;return UZ(Q)!==null}function HZ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(gQ===void 0)gQ=WZ("codex");return gQ}function vZ(Q){let Z={},$=!1;for(let J of Q.split(`
340
+ `)){let Y=J.trim();if(!Y||Y.startsWith("#"))continue;let V=/^\[([^\]]+)\]/.exec(Y);if(V){if($=V[1].trim()==="mcp_servers.beacon",$)Z.mcp_servers=Z.mcp_servers??{},Z.mcp_servers.beacon=Z.mcp_servers.beacon??{};continue}if($){let z=/^command\s*=\s*["']([^"']*)["']/.exec(Y);if(z)Z.mcp_servers.beacon.command=z[1]}}return Z}function O(Q){try{if(typeof Bun<"u"&&Bun.TOML?.parse)return Bun.TOML.parse(Q);return vZ(Q)}catch{return null}}function DQ(){try{return Boolean(O(_(w(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function P0(){let Q="";try{Q=_(w(),"utf8")}catch{return null}let Z=O(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${k}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${k}`;return null}function NZ(){let Q="",Z=!1;try{Q=_(w(),"utf8"),Z=!0}catch{}if(Z){let V=O(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${k}`};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 ${k}`}}let $=!Q?"":Q.endsWith(`
340
341
  `)?`
341
342
  `:`
342
343
 
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
+ `,J=Q+$+N0();if(O(J)?.mcp_servers?.beacon?.command!==R())return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${k}`};return qQ(w(),J),{added:!0}}function B0(){try{return O(_(w(),"utf8"))?.mcp_servers?.beacon?.command??null}catch{return null}}function PZ(){let Q="";try{Q=_(w(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
345
+ `),$=Z.indexOf(jZ);if($===-1)return{removed:!1,skipped:DQ()};let J=Z.indexOf(GZ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
345
346
  `).replace(/\n{3,}/g,`
346
347
 
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}
348
+ `).replace(/^\n+/,"");if(O(Y)===null)return{removed:!1,skipped:!0};return qQ(w(),Y),{removed:!0}}async function K0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (VQ(),CQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let U of j){if(!y(XQ(),U))V.push(U);e(XQ(),U,Y[U])}let z=0;for(let U of D)if(r(IQ(),{event:U.event,matcher:U.matcher,command:t(U.command)}))z++;let W=b(zQ(),UQ);o(zQ(),UQ,XZ,s);let q=NZ();return{skillsAdded:V,hooksAdded:z,agentsMdBlockTouched:!W,mcp:q}}function AQ(){let Q={};for(let $ of j)Q[$]=y(XQ(),$);let Z={};for(let $ of D)Z[$.event]=n(IQ(),{event:$.event,command:$.command});return{detected:HZ(),skills:Q,hooks:Z,agentsMdBlock:b(zQ(),UQ),mcp:DQ()}}function EQ(){let Q=[];for(let Y of j)if(QQ(XQ(),Y))Q.push(Y);let Z=0;for(let Y of D)if(a(IQ(),{event:Y.event,command:Y.command}))Z++;let $=i(zQ(),UQ,XZ),J=PZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var OQ=()=>I(zZ(),".codex"),IQ=()=>I(OQ(),"hooks.json"),w=()=>I(OQ(),"config.toml"),zQ=()=>I(OQ(),"AGENTS.md"),XQ=()=>I(zZ(),".agents","skills"),UQ="<!-- beacon:global:start -->",XZ="<!-- beacon:global:end -->",D,gQ,jZ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",GZ="# beacon:end",N0=()=>`${jZ}
348
349
  [mcp_servers.beacon]
349
- command = "beacon"
350
+ command = "${R()}"
350
351
  args = ["mcp"]
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.")}
352
+ ${GZ}
353
+ `,k="add it manually: codex mcp add beacon -- beacon mcp";var bQ=C(()=>{ZQ();qZ();D=[{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."}]});var wZ={};xQ(wZ,{provisionDb:()=>m0});import{createClient as D0}from"@libsql/client";import{drizzle as A0}from"drizzle-orm/libsql";import{migrate as E0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as b0}from"drizzle-orm/migrator";import{dirname as SQ,join as y0}from"path";import{fileURLToPath as L0}from"url";async function GQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function h0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function RZ(Q){if(!await GQ(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 p0(Q){for(let[Z,$]of Object.entries(S0)){if(!await GQ(Q,Z))continue;let J=await h0(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 m0(Q,Z=_0){let $=D0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await GQ($,"__drizzle_migrations"),Y=await GQ($,"Node"),V=!1;if(Y&&!J){let W=b0({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 z=await RZ($);if(await E0(A0($),{migrationsFolder:Z}),await RZ($)>z)V=!0;return await p0($),{migrated:V}}finally{$.close()}}var k0,_0,S0;var fZ=C(async()=>{k0=SQ(SQ(SQ(L0(import.meta.url)))),_0=process.env.BEACON_MIGRATIONS_DIR||y0(k0,"drizzle"),S0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});ZQ();import{existsSync as x0}from"fs";import{homedir as M0}from"os";import{join as WQ}from"path";function u0(){return process.env.HOME||process.env.USERPROFILE||M0()}var HQ=()=>WQ(u0(),".claude"),yQ=()=>WQ(HQ(),"skills"),jQ=()=>WQ(HQ(),"settings.json"),LQ=()=>WQ(HQ(),"CLAUDE.md"),kQ="<!-- beacon:global:start -->",KZ="<!-- beacon:global:end -->";var R0=s,S=[{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 w0(Q,Z){return e(yQ(),Q,Z)}function xZ(Q){return y(yQ(),Q)}function f0(Q){return QQ(yQ(),Q)}function T0(Q){return r(jQ(),Q)}function F0(Q){return n(jQ(),Q)}function C0(Q){return a(jQ(),Q)}function g0(Q){o(LQ(),kQ,KZ,Q)}function MZ(){return b(LQ(),kQ)}function O0(){return i(LQ(),kQ,KZ)}function uZ(){let Q={};for(let $ of j)Q[$]=xZ($);let Z={};for(let $ of S)Z[$.event]=F0({event:$.event,command:$.command});return{homeExists:x0(HQ()),skills:Q,hooks:Z,claudeMdBlock:MZ()}}function D1(){let Q=QZ(jQ(),{event:"PostToolUse",command:"beacon hook"});return Q?uQ(Q):null}async function I0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:J}=await Promise.resolve().then(() => (VQ(),CQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":J},V=[];for(let q of j){if(!xZ(q))V.push(q);w0(q,Y[q])}let z=0;for(let q of S)if(T0({event:q.event,matcher:q.matcher,command:t(q.command)}))z++;let W=MZ();return g0(R0),{skillsAdded:V,hooksAdded:z,claudeMdBlockTouched:!W}}async function A1(){if(aQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(iQ()){try{_Q()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await I0()}}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(() => (bQ(),BZ));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 _Q(){let Q=[];for(let J of j)if(f0(J))Q.push(J);let Z=0;for(let J of S)if(C0(J))Z++;let $=O0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as c0}from"async_hooks";import{spawnSync as l0}from"child_process";import{createHash as t0}from"crypto";import{existsSync as FZ,mkdirSync as p,readFileSync as pQ,writeFileSync as mQ}from"fs";import{homedir as CZ}from"os";import{basename as s0,join as M,parse as d0,resolve as TZ}from"path";function B(){return process.env.BEACON_HOME||M(CZ(),".beacon")}function cQ(){return M(B(),"workspaces.json")}function h(Q){return t0("sha256").update(Q).digest("hex").slice(0,12)}function r0(Q=process.cwd()){let Z=l0("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 gZ(Q){let Z=TZ(Q);return Z!==TZ(CZ())&&Z!==d0(Z).root}function OZ(){return M(B(),"deleted.json")}function lQ(){try{let Q=JSON.parse(pQ(OZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function IZ(Q){p(B(),{recursive:!0}),mQ(OZ(),JSON.stringify(Q,null,2))}function DZ(Q){return lQ().includes(Q)}function s1(Q){let Z=lQ();if(!Z.includes(Q))IZ([...Z,Q])}function n0(Q){let Z=lQ();if(Z.includes(Q))IZ(Z.filter(($)=>$!==Q))}function vQ(Q){return M(B(),Q)}function a0(Q){return`file:${M(vQ(Q),"db.sqlite")}`}function m(){try{let Q=JSON.parse(pQ(cQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function tQ(Q){p(B(),{recursive:!0}),mQ(cQ(),JSON.stringify(Q,null,2))}function NQ(){return m().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function f(Q){return m().find((Z)=>Z.id===Q)??null}function AZ(Q,Z,$=new Date().toISOString()){if(!gZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=h(Q);if(DZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=m(),V=Y.find((q)=>q.id===J),z={id:J,path:Q,name:Z||V?.name||s0(Q),lastOpenedAt:$},W=[z,...Y.filter((q)=>q.id!==J)];return p(vQ(J),{recursive:!0}),tQ(W),z}function d1(Q,Z){return n0(h(Q)),AZ(Q,Z)}function r1(Q,Z=new Date().toISOString()){let $=m(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,tQ($)}function n1(Q){if(tQ(m().filter((Z)=>Z.id!==Q)),sQ()===Q)o0(NQ()[0]?.id??null)}function EZ(){return M(B(),"active")}function sQ(){try{return pQ(EZ(),"utf8").trim()||null}catch{return null}}function o0(Q){p(B(),{recursive:!0}),mQ(EZ(),Q??"")}function a1(){let Q=sQ();return Q?f(Q):null}function o1(){let Q=e0()??sQ();return Q?f(Q):null}function i1(Q){return f(Q)?.path??null}function e1(){return FZ(cQ())}var bZ="beacon_ws";function yZ(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 Q2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&f(Z))return Z;let $=yZ(Q,bZ);if($&&f($))return $;return i0()}function i0(){let Q=NQ();return Q.length===1?Q[0].id:null}var LZ="x-beacon-workspace-path";function Z2(Q=process.cwd()){let Z=r0(Q);return{"x-beacon-workspace":h(Z),[LZ]:Z}}async function $2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&f(Z))return Z;let $=Q.headers.get(LZ);if($&&gZ($)&&!DZ(h($))&&(!Z||h($)===Z)){let Y=AZ($);return await Q1(Y.id),Y.id}let J=yZ(Q,bZ);if(J&&f(J))return J;return null}var kZ=new c0;function J2(Q,Z){return Q?kZ.run(Q,Z):Z()}function e0(){return kZ.getStore()??null}var hQ=new Set;function Y2(Q){hQ.delete(M(vQ(Q),"db.sqlite"))}async function Q1(Q){let Z=vQ(Q),$=M(Z,"db.sqlite"),J=FZ($);if(J&&hQ.has($))return{ok:!0,created:!1,migrated:!1};try{p(Z,{recursive:!0});let{provisionDb:Y}=await fZ().then(() => wZ),V=await Y(a0(Q));return hQ.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)}}}VQ();bQ();import{existsSync as PQ,readFileSync as Z1,rmSync as $1}from"fs";import{join as J1}from"path";var _Z=process.argv.slice(3),SZ=_Z.includes("--yes")||_Z.includes("-y"),v=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,G=(Q)=>`\x1B[2m${Q}\x1B[0m`,F=(Q)=>`
354
+ \x1B[1m${Q}\x1B[0m`,hZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,T=B(),c=NQ(),dQ=uZ();console.log(F(SZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(F("Global"));console.log(` ${PQ(T)?`wipe ${T} (${c.length} workspaces)`:`${G(`${T} \u2014 already gone`)}`}`);for(let Q of j)console.log(` ${dQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:G(`skill ${Q} \u2014 already gone`)}`);for(let Q of S)console.log(` ${dQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:G(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${dQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":G("global CLAUDE.md block \u2014 already gone")}`);var BQ=AQ();console.log(F("Codex"));for(let Q of j)console.log(` ${BQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:G(`skill ${Q} \u2014 already gone`)}`);for(let Q of D)console.log(` ${BQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:G(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${BQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":G("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${BQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":G("config.toml beacon entry \u2014 already gone")}`);if(c.length){console.log(F(`Per-repo (${c.length})`));for(let Q of c){if(!PQ(Q.path)){console.log(` ${G(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${G("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!SZ)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.
355
+ `),process.exit(0);console.log(F("Applying\u2026"));var A=_Q();if(A.skillsRemoved.length)console.log(` ${v(`removed skills: ${A.skillsRemoved.join(", ")}`)}`);if(A.hooksRemoved)console.log(` ${v(`removed ${A.hooksRemoved} hook${A.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(A.claudeMdBlockRemoved)console.log(` ${v("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=EQ();if(u.skillsRemoved.length)console.log(` ${v(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${v(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${v("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${v("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${hZ("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 c){if(!PQ(Q.path))continue;let Z=FQ(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(` ${v(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var Y1=J1(T,"server.json");try{let{pid:Q}=JSON.parse(Z1(Y1,"utf8"));if(Q)try{process.kill(Q),console.log(` ${v(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(PQ(T))$1(T,{recursive:!0,force:!0}),console.log(` ${v(`removed ${T}`)}`);console.log(F("Done."));console.log(` ${hZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
355
356
  `);
@@ -1,21 +1,56 @@
1
1
  // @bun
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,`
2
+ var p=Object.defineProperty;var l=(q)=>q;function t(q,J){this[q]=l.bind(null,J)}var m=(q,J)=>{for(var Q in J)p(q,Q,{get:J[Q],enumerable:!0,configurable:!0,set:t.bind(J,Q)})};var K=(q,J)=>()=>(q&&(J=q(q=0)),J);import{existsSync as P,mkdirSync as E,readdirSync as s,readFileSync as W,rmSync as a,writeFileSync as I}from"fs";import{basename as d,dirname as R,join as v}from"path";function Nq(){return!!process.env.CLAUDE_PLUGIN_ROOT}function c(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;let J=v(q,".claude","plugins");if(!P(J))return null;let Q=[J];for(let V=0;V<3&&Q.length;V++){let Y=[];for(let Z of Q){let X=v(Z,".claude-plugin","plugin.json");try{if(P(X)&&JSON.parse(W(X,"utf8")).name==="beacon")return Z}catch{}try{for(let N of s(Z,{withFileTypes:!0}))if(N.isDirectory())Y.push(v(Z,N.name))}catch{}}Q=Y}return null}function vq(q){return c(q)!==null}function Mq(q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(q)}function O(){let q=process.env.BEACON_CLI_PATH;if(q)return q;if(P(k))return k;return"beacon"}function n(q){let J=q.indexOf(" ");return J===-1?q:q.slice(0,J)}function Wq(q){let J=O();if(J==="beacon")return q;return q.replace(/^beacon(\s|$)/,`${J}$1`)}function M(q){let J=n(q);return d(J)+q.slice(J.length)}function Pq(q=process.env.HOME||process.env.USERPROFILE||""){if(!q)return null;try{let J=JSON.parse(W(v(q,".claude","plugins","installed_plugins.json"),"utf8"));for(let Q of Object.keys(J.plugins??{}))if(/^beacon@/.test(Q))return{key:Q,marketplace:Q.split("@")[1]??""}}catch{}return null}function u(q){try{return JSON.parse(W(q,"utf8"))}catch{return{}}}function _(q,J){E(R(q),{recursive:!0}),I(q,JSON.stringify(J,null,2)+`
3
+ `)}function Iq(q,J){let Q=u(q);Q.hooks=Q.hooks??{},Q.hooks[J.event]=Q.hooks[J.event]??[];let V=Q.hooks[J.event];if(V.some((Z)=>Z.matcher===J.matcher&&Z.hooks?.some((X)=>M(X.command)===M(J.command))))return!1;return V.push({matcher:J.matcher,hooks:[{type:"command",command:J.command}]}),_(q,Q),!0}function uq(q,J){return(u(q).hooks?.[J.event]??[]).some((Y)=>Y.hooks?.some((Z)=>M(Z.command)===M(J.command)))}function xq(q,J){let V=u(q).hooks?.[J.event]??[];for(let Y of V)for(let Z of Y.hooks??[])if(M(Z.command)===M(J.command))return Z.command;return null}function Aq(q,J){let Q=u(q),V=Q.hooks?.[J.event];if(!V)return!1;let Y=!1,Z=V.map((X)=>{let N=X.hooks?.length??0,G=(X.hooks??[]).filter((z)=>M(z.command)!==M(J.command));if(G.length!==N)Y=!0;return{...X,hooks:G}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(Z.length)Q.hooks[J.event]=Z;else delete Q.hooks[J.event];if(Q.hooks&&Object.keys(Q.hooks).length===0)delete Q.hooks;return _(q,Q),!0}function wq(q,J,Q,V){let Y=`${J}
4
+ ${V.trim()}
5
+ ${Q}`,Z="";try{Z=W(q,"utf8")}catch{}let X=new RegExp(`${J}[\\s\\S]*?${Q}`);Z=X.test(Z)?Z.replace(X,Y):Z.trim()?`${Z.trim()}
6
+
7
+ ${Y}
8
+ `:`${Y}
9
+ `,E(R(q),{recursive:!0}),I(q,Z.endsWith(`
10
+ `)?Z:`${Z}
11
+ `)}function Cq(q,J){try{return W(q,"utf8").includes(J)}catch{return!1}}function Kq(q,J,Q){let V="";try{V=W(q,"utf8")}catch{return!1}let Y=new RegExp(`${J}[\\s\\S]*?${Q}\\n?`);if(!Y.test(V))return!1;let Z=V.replace(Y,"").replace(/\n{3,}/g,`
12
+
13
+ `).trimStart();return I(q,Z),!0}function Eq(q,J,Q){let V=v(q,J);E(V,{recursive:!0});let Y=v(V,"SKILL.md");return I(Y,Q),Y}function Oq(q,J){return P(v(q,J,"SKILL.md"))}function Dq(q,J){let Q=v(q,J);if(!P(Q))return!1;return a(Q,{recursive:!0,force:!0}),!0}var Bq,k="/Applications/Beacon.app/Contents/Resources/bin/beacon",Tq=`## Beacon (visual planning panel)
14
+
15
+ This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
16
+ agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
17
+ the user reviews on a canvas at /plan, and feedback flows back as the next round.
18
+
19
+ **When to invoke**
20
+ - User asks to "plan a feature" / "design a schema" \u2192 if the \`beacon_propose_plan\`
21
+ MCP tool is available, design the plan and call it. If it is NOT available, the panel
22
+ isn't wired in this repo \u2014 run \`beacon\` here once, then retry.
23
+ - User asks to "set up Beacon" / "map this repo" \u2192 invoke the \`beacon-init\` skill.
24
+ - User asks to "refresh Beacon" / "update the map" / "bring Beacon up to date" \u2192 invoke
25
+ the \`beacon-refresh\` skill. Re-surveys the repo and updates init-derived nodes while
26
+ preserving anything the user added by hand.
27
+ - User asks to "explain" / "teach me" / "walk me through" / "how does X work" \u2192 if the
28
+ \`beacon_explain\` MCP tool is available, author an interactive Lesson (a concept map +
29
+ plain-English narrative on /learn the user questions back) via the \`beacon-explain\` skill.
30
+ - Run \`beacon doctor\` to audit what's wired (global hooks, repo's .mcp.json, AGENTS.md block).
31
+
32
+ **The plan feedback loop**
33
+ \`beacon_propose_plan\` BLOCKS until the user clicks Approve / Discard / submits feedback.
34
+ Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
35
+ on the /map and /db boards (added features, attached subtasks, edited columns, new
36
+ endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
37
+ verbatim. Do NOT implement until the tool returns approval.`;var g=K(()=>{Bq=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});var bq=1500,jq=480000,kq=1800000,x=3600000,Rq=3000;var F=()=>{};var Gq={};m(Gq,{stripAgentsPointer:()=>y,repoMcpCliTarget:()=>Yq,removeRepoAssets:()=>$q,installRefreshSkill:()=>o,installPlanSkill:()=>i,installInitSkill:()=>r,installExplainSkill:()=>e,installCodexRepoSkills:()=>Jq,ensureWorkflowDoc:()=>Qq,ensureMcp:()=>Vq,contextDocTargets:()=>j,auditRepo:()=>Zq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>h,INIT_SKILL:()=>D,EXPLAIN_SKILL:()=>S});import{existsSync as U,mkdirSync as T,readFileSync as B,rmSync as A,writeFileSync as H}from"fs";import{join as $}from"path";function r(q){let J=$(q,".claude","skills","beacon-init");T(J,{recursive:!0});let Q=$(J,"SKILL.md");return H(Q,D),Q}function o(q){let J=$(q,".claude","skills","beacon-refresh");T(J,{recursive:!0});let Q=$(J,"SKILL.md");return H(Q,L),Q}function i(q){let J=$(q,".claude","skills","beacon-plan");T(J,{recursive:!0});let Q=$(J,"SKILL.md");return H(Q,h),Q}function e(q){let J=$(q,".claude","skills","beacon-explain");T(J,{recursive:!0});let Q=$(J,"SKILL.md");return H(Q,S),Q}function Jq(q){let J=[];for(let Q of qq){let V=$(q,".agents","skills",Q.name);T(V,{recursive:!0});let Y=$(V,"SKILL.md");H(Y,Q.body()),J.push(Y)}return J}function j(q){let J=$(q,"AGENTS.md"),Q=$(q,"CLAUDE.md"),V=U(J),Y=U(Q);if(!V&&!Y)return[J,Q];let Z=[];if(V)Z.push(J);if(Y)Z.push(Q);return Z}function y(q){let J=$(q,"CLAUDE.md");if(!U(J))return;let Q=B(J,"utf8"),V=Q.split(`
38
+ `).filter((Y)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(Y)).join(`
39
+ `).trim();if(V&&V!==Q.trim())H(J,`${V}
40
+ `)}function Qq(q){let J=new RegExp(`${w}[\\s\\S]*?${b}`);for(let Q of j(q)){let V="";try{V=B(Q,"utf8")}catch{}V=J.test(V)?V.replace(J,f):`${V.trim()}
41
+
42
+ ${f}
43
+ `.trimStart(),H(Q,V.endsWith(`
44
+ `)?V:`${V}
45
+ `)}y(q)}function Vq(q){let J=$(q,".mcp.json"),Q={};try{Q=JSON.parse(B(J,"utf8"))}catch{}Q.mcpServers=Q.mcpServers??{};let V=Q.mcpServers.beacon;if(V){if(!V.timeout||V.timeout<x)return V.timeout=x,H(J,JSON.stringify(Q,null,2)+`
46
+ `),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return Q.mcpServers.beacon={command:O(),args:["mcp"],timeout:x},H(J,JSON.stringify(Q,null,2)+`
47
+ `),{path:J,added:!0,updated:!1}}function Yq(q){try{return JSON.parse(B($(q,".mcp.json"),"utf8")).mcpServers?.beacon?.command??null}catch{return null}}function Zq(q){let J=$(q,".mcp.json"),Q=!1;try{Q=!!JSON.parse(B(J,"utf8")).mcpServers?.beacon}catch{}let V=j(q).some((Y)=>{try{return B(Y,"utf8").includes(w)}catch{return!1}});return{repo:q,mcpRegistered:Q,workflowBlock:V,skills:{"beacon-init":U($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":U($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":U($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":U($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function $q(q){let J=[];for(let G of["beacon-init","beacon-refresh","beacon-db-design"]){let z=$(q,".claude","skills",G);if(U(z))A(z,{recursive:!0,force:!0}),J.push(G)}for(let G of["beacon-init","beacon-refresh"]){let z=$(q,".agents","skills",G);if(U(z))A(z,{recursive:!0,force:!0}),J.push(`codex:${G}`)}let Q=!1,V=$(q,".mcp.json");try{let G=JSON.parse(B(V,"utf8"));if(G.mcpServers?.beacon){if(delete G.mcpServers.beacon,Q=!0,G.mcpServers&&Object.keys(G.mcpServers).length===0)delete G.mcpServers;if(Object.keys(G).length===0)A(V,{force:!0});else H(V,JSON.stringify(G,null,2)+`
48
+ `)}}catch{}let Y=!1,Z=new RegExp(`\\n?${w}[\\s\\S]*?${b}\\n?`);for(let G of[$(q,"AGENTS.md"),$(q,"CLAUDE.md")])try{let z=B(G,"utf8");if(Z.test(z)){let C=z.replace(Z,`
14
49
  `).replace(/\n{3,}/g,`
15
50
 
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=`---
51
+ `).trimStart();H(G,C.endsWith(`
52
+ `)?C:`${C}
53
+ `),Y=!0}}catch{}let X=!1,N=$(q,"CLAUDE.md");try{let G=B(N,"utf8"),z=G.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(z!==G){if(!z.trim())A(N,{force:!0});else H(N,z);X=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:Q,agentsBlockRemoved:Y,claudeImportRemoved:X}}var D=`---
19
54
  name: beacon-init
20
55
  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
56
  ---
@@ -62,7 +97,7 @@ beacon init-persist /tmp/beacon-init.json # or: beacon init-persist < /tmp/bea
62
97
  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
98
 
64
99
  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
- `,x=`---
100
+ `,L=`---
66
101
  name: beacon-refresh
67
102
  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
103
  ---
@@ -109,7 +144,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
109
144
  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
145
 
111
146
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
112
- `,u=`---
147
+ `,h=`---
113
148
  name: beacon-plan
114
149
  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
150
  ---
@@ -158,7 +193,7 @@ If it returns feedback, revise and call it again.
158
193
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
159
194
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
160
195
  run \`beacon\` in this repo once.
161
- `,E=`---
196
+ `,S=`---
162
197
  name: beacon-explain
163
198
  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".
164
199
  ---
@@ -228,7 +263,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
228
263
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
229
264
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
230
265
  the lesson.
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}
266
+ `,qq,w="<!-- beacon:workflow:start -->",b="<!-- beacon:workflow:end -->",f;var Xq=K(()=>{g();F();qq=[{name:"beacon-init",body:()=>D},{name:"beacon-refresh",body:()=>L}];f=`${w}
232
267
  ## Beacon \u2014 feature workflow
233
268
 
234
269
  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,4 +335,4 @@ Register them all in that single batched call. If a plan added five features, th
300
335
  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
336
 
302
337
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
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};
338
+ ${b}`});Xq();export{y as stripAgentsPointer,Yq as repoMcpCliTarget,$q as removeRepoAssets,o as installRefreshSkill,i as installPlanSkill,r as installInitSkill,e as installExplainSkill,Jq as installCodexRepoSkills,Qq as ensureWorkflowDoc,Vq as ensureMcp,j as contextDocTargets,Zq as auditRepo,L as REFRESH_SKILL,h as PLAN_SKILL,D as INIT_SKILL,S as EXPLAIN_SKILL};