trybeacon 0.1.72 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-path-routes-manifest.json +17 -9
  4. package/.next/build-manifest.json +3 -3
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/routes-manifest.json +54 -6
  7. package/.next/server/app/_global-error/page.js +3 -3
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +23 -22
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +23 -22
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +12 -11
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next/server/app/api/ask/answer/route.js +1 -0
  29. package/.next/server/app/api/ask/answer/route.js.nft.json +1 -0
  30. package/.next/server/app/api/ask/answer/route_client-reference-manifest.js +1 -0
  31. package/.next/server/app/api/ask/route.js +1 -0
  32. package/.next/server/app/api/ask/route.js.nft.json +1 -0
  33. package/.next/server/app/api/ask/route_client-reference-manifest.js +1 -0
  34. package/.next/server/app/api/ask/verdict/route.js +1 -0
  35. package/.next/server/app/api/ask/verdict/route.js.nft.json +1 -0
  36. package/.next/server/app/api/ask/verdict/route_client-reference-manifest.js +1 -0
  37. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  38. package/.next/server/app/api/board-annotations/route.js +1 -1
  39. package/.next/server/app/api/board-layout/route.js +1 -1
  40. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  41. package/.next/server/app/api/bug-flags/route.js +1 -1
  42. package/.next/server/app/api/changes/comment/answer/route.js +4 -0
  43. package/.next/server/app/api/changes/comment/answer/route.js.nft.json +1 -0
  44. package/.next/server/app/api/changes/comment/answer/route_client-reference-manifest.js +1 -0
  45. package/.next/server/app/api/changes/comment/claim/route.js +4 -0
  46. package/.next/server/app/api/changes/comment/claim/route.js.nft.json +1 -0
  47. package/.next/server/app/api/changes/comment/claim/route_client-reference-manifest.js +1 -0
  48. package/.next/server/app/api/changes/comment/route.js +4 -0
  49. package/.next/server/app/api/changes/comment/route.js.nft.json +1 -0
  50. package/.next/server/app/api/changes/comment/route_client-reference-manifest.js +1 -0
  51. package/.next/server/app/api/changes/quality/route.js +1 -0
  52. package/.next/server/app/api/changes/quality/route.js.nft.json +1 -0
  53. package/.next/server/app/api/changes/quality/route_client-reference-manifest.js +1 -0
  54. package/.next/server/app/api/changes/route.js +1 -0
  55. package/.next/server/app/api/{flags → changes}/route.js.nft.json +1 -1
  56. package/.next/server/app/api/changes/route_client-reference-manifest.js +1 -0
  57. package/.next/server/app/api/changes/viewed/route.js +1 -0
  58. package/.next/server/app/api/changes/viewed/route.js.nft.json +1 -0
  59. package/.next/server/app/api/changes/viewed/route_client-reference-manifest.js +1 -0
  60. package/.next/server/app/api/code-graph/position/route.js +1 -1
  61. package/.next/server/app/api/code-graph/route.js +1 -1
  62. package/.next/server/app/api/context/feature/route.js +1 -1
  63. package/.next/server/app/api/context/file/route.js +1 -1
  64. package/.next/server/app/api/context/route.js +1 -9
  65. package/.next/server/app/api/context/route.js.nft.json +1 -1
  66. package/.next/server/app/api/db/arrange/route.js +1 -1
  67. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  68. package/.next/server/app/api/db/position/route.js +1 -1
  69. package/.next/server/app/api/db/position/route.js.nft.json +1 -1
  70. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  71. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  72. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  73. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  74. package/.next/server/app/api/draft/approve/route.js +1 -1
  75. package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
  76. package/.next/server/app/api/draft/route.js +1 -1
  77. package/.next/server/app/api/draft/route.js.nft.json +1 -1
  78. package/.next/server/app/api/draft/status/route.js +1 -1
  79. package/.next/server/app/api/edges/[id]/route.js +1 -1
  80. package/.next/server/app/api/edges/route.js +1 -1
  81. package/.next/server/app/api/edges/route.js.nft.json +1 -1
  82. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  83. package/.next/server/app/api/entities/route.js +1 -1
  84. package/.next/server/app/api/ingest/route.js +1 -9
  85. package/.next/server/app/api/ingest/route.js.nft.json +1 -1
  86. package/.next/server/app/api/init/route.js +1 -9
  87. package/.next/server/app/api/init/route.js.nft.json +1 -1
  88. package/.next/server/app/api/lesson/close/route.js +1 -1
  89. package/.next/server/app/api/lesson/presence/route.js +1 -1
  90. package/.next/server/app/api/lesson/questions/route.js +1 -1
  91. package/.next/server/app/api/lesson/route.js +1 -1
  92. package/.next/server/app/api/lesson/save/route.js +1 -1
  93. package/.next/server/app/api/lesson/verdict/route.js +1 -1
  94. package/.next/server/app/api/map/describe/route.js +1 -9
  95. package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
  96. package/.next/server/app/api/map/files/route.js +1 -1
  97. package/.next/server/app/api/map/files/route.js.nft.json +1 -1
  98. package/.next/server/app/api/map/finish/route.js +1 -1
  99. package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
  100. package/.next/server/app/api/map/route.js +1 -1
  101. package/.next/server/app/api/map/route.js.nft.json +1 -1
  102. package/.next/server/app/api/map/start/route.js +1 -1
  103. package/.next/server/app/api/map/start/route.js.nft.json +1 -1
  104. package/.next/server/app/api/map/touch-active/route.js +1 -1
  105. package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
  106. package/.next/server/app/api/mention-search/route.js +1 -1
  107. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  108. package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
  109. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  110. package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
  111. package/.next/server/app/api/nodes/positions/route.js +1 -1
  112. package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
  113. package/.next/server/app/api/nodes/route.js +1 -1
  114. package/.next/server/app/api/nodes/route.js.nft.json +1 -1
  115. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  116. package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
  117. package/.next/server/app/api/notes/[id]/route.js +1 -1
  118. package/.next/server/app/api/notes/route.js +1 -1
  119. package/.next/server/app/api/open/route.js +1 -1
  120. package/.next/server/app/api/plan/annotations/route.js +2 -2
  121. package/.next/server/app/api/plan/approve/route.js +1 -9
  122. package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
  123. package/.next/server/app/api/plan/history/route.js +1 -1
  124. package/.next/server/app/api/plan/markdown/route.js +1 -1
  125. package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
  126. package/.next/server/app/api/plan/presence/route.js +1 -1
  127. package/.next/server/app/api/plan/route.js +1 -1
  128. package/.next/server/app/api/plan/route.js.nft.json +1 -1
  129. package/.next/server/app/api/plan/verdict/route.js +1 -1
  130. package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
  131. package/.next/server/app/api/preferences/route.js +1 -1
  132. package/.next/server/app/api/project-meta/route.js +1 -1
  133. package/.next/server/app/api/reset/route.js +1 -1
  134. package/.next/server/app/api/scope-guard/check/route.js +4 -1
  135. package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -1
  136. package/.next/server/app/api/share/create/route.js +1 -1
  137. package/.next/server/app/api/share/create/route.js.nft.json +1 -1
  138. package/.next/server/app/api/share/route.js +1 -1
  139. package/.next/server/app/api/stream/route.js +2 -2
  140. package/.next/server/app/api/tab/nav/route.js +1 -1
  141. package/.next/server/app/api/tab/presence/route.js +1 -1
  142. package/.next/server/app/api/telemetry/route.js +1 -1
  143. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  144. package/.next/server/app/api/version/route.js +1 -1
  145. package/.next/server/app/api/workspace/activate/route.js +1 -1
  146. package/.next/server/app/api/workspace/route.js +1 -1
  147. package/.next/server/app/apple-icon.png/route.js +1 -1
  148. package/.next/server/app/docs/page.js +2 -2
  149. package/.next/server/app/docs/page.js.nft.json +1 -1
  150. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  151. package/.next/server/app/docs.html +1 -1
  152. package/.next/server/app/docs.rsc +24 -23
  153. package/.next/server/app/docs.segments/_full.segment.rsc +24 -23
  154. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  155. package/.next/server/app/docs.segments/_index.segment.rsc +12 -11
  156. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  157. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  158. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  159. package/.next/server/app/help/page.js +2 -2
  160. package/.next/server/app/help/page.js.nft.json +1 -1
  161. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/help.html +1 -1
  163. package/.next/server/app/help.rsc +32 -31
  164. package/.next/server/app/help.segments/_full.segment.rsc +32 -31
  165. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  166. package/.next/server/app/help.segments/_index.segment.rsc +12 -11
  167. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  168. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  169. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  170. package/.next/server/app/icon.svg/route.js +1 -1
  171. package/.next/server/app/index.html +1 -1
  172. package/.next/server/app/index.rsc +22 -21
  173. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  174. package/.next/server/app/index.segments/_full.segment.rsc +22 -21
  175. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  176. package/.next/server/app/index.segments/_index.segment.rsc +12 -11
  177. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  178. package/.next/server/app/learn/page.js +3 -3
  179. package/.next/server/app/learn/page.js.nft.json +1 -1
  180. package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
  181. package/.next/server/app/map/page.js +2 -2
  182. package/.next/server/app/map/page.js.nft.json +1 -1
  183. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  184. package/.next/server/app/page.js +2 -2
  185. package/.next/server/app/page.js.nft.json +1 -1
  186. package/.next/server/app/page_client-reference-manifest.js +1 -1
  187. package/.next/server/app/plan/page.js +12 -2
  188. package/.next/server/app/plan/page.js.nft.json +1 -1
  189. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/s/[token]/page.js +2 -2
  191. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  192. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  193. package/.next/server/app/settings/page.js +2 -2
  194. package/.next/server/app/settings/page.js.nft.json +1 -1
  195. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app-paths-manifest.json +17 -9
  197. package/.next/server/chunks/1130.js +1 -1
  198. package/.next/server/chunks/2031.js +1 -0
  199. package/.next/server/chunks/230.js +1 -0
  200. package/.next/server/chunks/2693.js +8 -0
  201. package/.next/server/chunks/374.js +1 -0
  202. package/.next/server/chunks/5295.js +1 -0
  203. package/.next/server/chunks/{4700.js → 5704.js} +2 -2
  204. package/.next/server/chunks/6469.js +10 -0
  205. package/.next/server/chunks/6962.js +1 -0
  206. package/.next/server/chunks/8227.js +1 -0
  207. package/.next/server/chunks/8674.js +7 -0
  208. package/.next/server/middleware-build-manifest.js +1 -1
  209. package/.next/server/pages/404.html +1 -1
  210. package/.next/server/pages/500.html +1 -1
  211. package/.next/server/server-reference-manifest.js +1 -1
  212. package/.next/server/server-reference-manifest.json +1 -1
  213. package/.next/static/chunks/3151-861a6caa40f70f79.js +1 -0
  214. package/.next/static/chunks/3908-80efc60050779adf.js +1 -0
  215. package/.next/static/chunks/5697-5b9719b81806b4cf.js +1 -0
  216. package/.next/static/chunks/654-8e68a43e4c589e9c.js +1 -0
  217. package/.next/static/chunks/7424-d7fa15ef452064dd.js +1 -0
  218. package/.next/static/chunks/app/_global-error/page-d54a69e7dc6b4008.js +1 -0
  219. package/.next/static/chunks/app/api/ask/answer/route-d54a69e7dc6b4008.js +1 -0
  220. package/.next/static/chunks/app/api/ask/route-d54a69e7dc6b4008.js +1 -0
  221. package/.next/static/chunks/app/api/ask/verdict/route-d54a69e7dc6b4008.js +1 -0
  222. package/.next/static/chunks/app/api/board-annotations/[id]/route-d54a69e7dc6b4008.js +1 -0
  223. package/.next/static/chunks/app/api/board-annotations/route-d54a69e7dc6b4008.js +1 -0
  224. package/.next/static/chunks/app/api/board-layout/route-d54a69e7dc6b4008.js +1 -0
  225. package/.next/static/chunks/app/api/bug-flags/[id]/route-d54a69e7dc6b4008.js +1 -0
  226. package/.next/static/chunks/app/api/bug-flags/route-d54a69e7dc6b4008.js +1 -0
  227. package/.next/static/chunks/app/api/changes/comment/answer/route-d54a69e7dc6b4008.js +1 -0
  228. package/.next/static/chunks/app/api/changes/comment/claim/route-d54a69e7dc6b4008.js +1 -0
  229. package/.next/static/chunks/app/api/changes/comment/route-d54a69e7dc6b4008.js +1 -0
  230. package/.next/static/chunks/app/api/changes/quality/route-d54a69e7dc6b4008.js +1 -0
  231. package/.next/static/chunks/app/api/changes/route-d54a69e7dc6b4008.js +1 -0
  232. package/.next/static/chunks/app/api/changes/viewed/route-d54a69e7dc6b4008.js +1 -0
  233. package/.next/static/chunks/app/api/code-graph/position/route-d54a69e7dc6b4008.js +1 -0
  234. package/.next/static/chunks/app/api/code-graph/route-d54a69e7dc6b4008.js +1 -0
  235. package/.next/static/chunks/app/api/context/feature/route-d54a69e7dc6b4008.js +1 -0
  236. package/.next/static/chunks/app/api/context/file/route-d54a69e7dc6b4008.js +1 -0
  237. package/.next/static/chunks/app/api/context/route-d54a69e7dc6b4008.js +1 -0
  238. package/.next/static/chunks/app/api/db/arrange/route-d54a69e7dc6b4008.js +1 -0
  239. package/.next/static/chunks/app/api/db/backfill-access/route-d54a69e7dc6b4008.js +1 -0
  240. package/.next/static/chunks/app/api/db/position/route-d54a69e7dc6b4008.js +1 -0
  241. package/.next/static/chunks/app/api/db/prune-planned/route-d54a69e7dc6b4008.js +1 -0
  242. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-d54a69e7dc6b4008.js +1 -0
  243. package/.next/static/chunks/app/api/db/relations/[id]/route-d54a69e7dc6b4008.js +1 -0
  244. package/.next/static/chunks/app/api/db/tables/[id]/route-d54a69e7dc6b4008.js +1 -0
  245. package/.next/static/chunks/app/api/draft/approve/route-d54a69e7dc6b4008.js +1 -0
  246. package/.next/static/chunks/app/api/draft/route-d54a69e7dc6b4008.js +1 -0
  247. package/.next/static/chunks/app/api/draft/status/route-d54a69e7dc6b4008.js +1 -0
  248. package/.next/static/chunks/app/api/edges/[id]/route-d54a69e7dc6b4008.js +1 -0
  249. package/.next/static/chunks/app/api/edges/route-d54a69e7dc6b4008.js +1 -0
  250. package/.next/static/chunks/app/api/endpoints/[id]/route-d54a69e7dc6b4008.js +1 -0
  251. package/.next/static/chunks/app/api/entities/route-d54a69e7dc6b4008.js +1 -0
  252. package/.next/static/chunks/app/api/ingest/route-d54a69e7dc6b4008.js +1 -0
  253. package/.next/static/chunks/app/api/init/route-d54a69e7dc6b4008.js +1 -0
  254. package/.next/static/chunks/app/api/lesson/close/route-d54a69e7dc6b4008.js +1 -0
  255. package/.next/static/chunks/app/api/lesson/presence/route-d54a69e7dc6b4008.js +1 -0
  256. package/.next/static/chunks/app/api/lesson/questions/route-d54a69e7dc6b4008.js +1 -0
  257. package/.next/static/chunks/app/api/lesson/route-d54a69e7dc6b4008.js +1 -0
  258. package/.next/static/chunks/app/api/lesson/save/route-d54a69e7dc6b4008.js +1 -0
  259. package/.next/static/chunks/app/api/lesson/verdict/route-d54a69e7dc6b4008.js +1 -0
  260. package/.next/static/chunks/app/api/map/describe/route-d54a69e7dc6b4008.js +1 -0
  261. package/.next/static/chunks/app/api/map/files/route-d54a69e7dc6b4008.js +1 -0
  262. package/.next/static/chunks/app/api/map/finish/route-d54a69e7dc6b4008.js +1 -0
  263. package/.next/static/chunks/app/api/map/route-d54a69e7dc6b4008.js +1 -0
  264. package/.next/static/chunks/app/api/map/start/route-d54a69e7dc6b4008.js +1 -0
  265. package/.next/static/chunks/app/api/map/touch-active/route-d54a69e7dc6b4008.js +1 -0
  266. package/.next/static/chunks/app/api/mention-search/route-d54a69e7dc6b4008.js +1 -0
  267. package/.next/static/chunks/app/api/nodes/[id]/position/route-d54a69e7dc6b4008.js +1 -0
  268. package/.next/static/chunks/app/api/nodes/[id]/route-d54a69e7dc6b4008.js +1 -0
  269. package/.next/static/chunks/app/api/nodes/positions/route-d54a69e7dc6b4008.js +1 -0
  270. package/.next/static/chunks/app/api/nodes/route-d54a69e7dc6b4008.js +1 -0
  271. package/.next/static/chunks/app/api/nodes/subtasks/route-d54a69e7dc6b4008.js +1 -0
  272. package/.next/static/chunks/app/api/notes/[id]/route-d54a69e7dc6b4008.js +1 -0
  273. package/.next/static/chunks/app/api/notes/route-d54a69e7dc6b4008.js +1 -0
  274. package/.next/static/chunks/app/api/open/route-d54a69e7dc6b4008.js +1 -0
  275. package/.next/static/chunks/app/api/plan/annotations/route-d54a69e7dc6b4008.js +1 -0
  276. package/.next/static/chunks/app/api/plan/approve/route-d54a69e7dc6b4008.js +1 -0
  277. package/.next/static/chunks/app/api/plan/history/route-d54a69e7dc6b4008.js +1 -0
  278. package/.next/static/chunks/app/api/plan/markdown/route-d54a69e7dc6b4008.js +1 -0
  279. package/.next/static/chunks/app/api/plan/presence/route-d54a69e7dc6b4008.js +1 -0
  280. package/.next/static/chunks/app/api/plan/route-d54a69e7dc6b4008.js +1 -0
  281. package/.next/static/chunks/app/api/plan/verdict/route-d54a69e7dc6b4008.js +1 -0
  282. package/.next/static/chunks/app/api/preferences/route-d54a69e7dc6b4008.js +1 -0
  283. package/.next/static/chunks/app/api/project-meta/route-d54a69e7dc6b4008.js +1 -0
  284. package/.next/static/chunks/app/api/reset/route-d54a69e7dc6b4008.js +1 -0
  285. package/.next/static/chunks/app/api/scope-guard/check/route-d54a69e7dc6b4008.js +1 -0
  286. package/.next/static/chunks/app/api/share/create/route-d54a69e7dc6b4008.js +1 -0
  287. package/.next/static/chunks/app/api/share/route-d54a69e7dc6b4008.js +1 -0
  288. package/.next/static/chunks/app/api/stream/route-d54a69e7dc6b4008.js +1 -0
  289. package/.next/static/chunks/app/api/tab/nav/route-d54a69e7dc6b4008.js +1 -0
  290. package/.next/static/chunks/app/api/tab/presence/route-d54a69e7dc6b4008.js +1 -0
  291. package/.next/static/chunks/app/api/telemetry/route-d54a69e7dc6b4008.js +1 -0
  292. package/.next/static/chunks/app/api/telemetry/stats/route-d54a69e7dc6b4008.js +1 -0
  293. package/.next/static/chunks/app/api/version/route-d54a69e7dc6b4008.js +1 -0
  294. package/.next/static/chunks/app/api/workspace/activate/route-d54a69e7dc6b4008.js +1 -0
  295. package/.next/static/chunks/app/api/workspace/route-d54a69e7dc6b4008.js +1 -0
  296. package/.next/static/chunks/app/layout-f908dc26e06f4302.js +1 -0
  297. package/.next/static/chunks/app/learn/{page-e5bd3257170098e7.js → page-bc40746566d115e5.js} +1 -1
  298. package/.next/static/chunks/app/map/{page-5ab46e5ea28ecd79.js → page-233ccd830873114b.js} +1 -1
  299. package/.next/static/chunks/app/plan/page-8ec1e1d8ea40686a.js +11 -0
  300. package/.next/static/chunks/app/s/[token]/{page-8e4ffccdf7cd0309.js → page-2a3f04bc3f60ec49.js} +1 -1
  301. package/.next/static/chunks/app/settings/page-a751eabdd933f685.js +1 -0
  302. package/.next/static/chunks/next/dist/client/components/builtin/app-error-d54a69e7dc6b4008.js +1 -0
  303. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-d54a69e7dc6b4008.js +1 -0
  304. package/.next/static/chunks/next/dist/client/components/builtin/not-found-d54a69e7dc6b4008.js +1 -0
  305. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-d54a69e7dc6b4008.js +1 -0
  306. package/.next/static/chunks/{webpack-de4a0d9611ec2cad.js → webpack-6c27b0ed1ac1459c.js} +1 -1
  307. package/.next/static/css/60048003a8c96562.css +1 -0
  308. package/.next/static/css/a5d17568738ef1e9.css +1 -0
  309. package/.next/static/yescmIM6BeSzGgwZ-Dwpq/_buildManifest.js +1 -0
  310. package/.next/trace +46 -43
  311. package/.next/trace-build +1 -1
  312. package/.next/types/app/api/ask/answer/route.ts +351 -0
  313. package/.next/types/app/api/{flags → ask}/route.ts +3 -3
  314. package/.next/types/app/api/ask/verdict/route.ts +351 -0
  315. package/.next/types/app/api/changes/comment/answer/route.ts +351 -0
  316. package/.next/types/app/api/changes/comment/claim/route.ts +351 -0
  317. package/.next/types/app/api/changes/comment/route.ts +351 -0
  318. package/.next/types/app/api/changes/quality/route.ts +351 -0
  319. package/.next/types/app/api/changes/route.ts +351 -0
  320. package/.next/types/app/api/changes/viewed/route.ts +351 -0
  321. package/.next/types/routes.d.ts +10 -2
  322. package/.next/types/validator.ts +81 -9
  323. package/bun.lock +54 -0
  324. package/dist/bin/answer.js +8 -0
  325. package/dist/bin/ask.js +5 -0
  326. package/dist/bin/beacon.js +5 -5
  327. package/dist/bin/doctor.js +36 -35
  328. package/dist/bin/guard.js +1 -1
  329. package/dist/bin/hook.js +33 -32
  330. package/dist/bin/mcp.js +45 -44
  331. package/dist/bin/plan.js +36 -35
  332. package/dist/bin/remove.js +6 -6
  333. package/dist/bin/stop-hook.js +7 -3
  334. package/dist/bin/uninstall.js +35 -34
  335. package/dist/lib/assets.js +25 -24
  336. package/dist/lib/codex-install.js +32 -31
  337. package/dist/lib/global-install.js +33 -32
  338. package/dist/lib/telemetry.js +1 -1
  339. package/dist/lib/workspaces.js +1 -1
  340. package/package.json +3 -1
  341. package/plugin/skills/beacon-plan/SKILL.md +5 -4
  342. package/.next/server/app/api/flags/route.js +0 -1
  343. package/.next/server/app/api/flags/route_client-reference-manifest.js +0 -1
  344. package/.next/server/chunks/3098.js +0 -1
  345. package/.next/server/chunks/3221.js +0 -5
  346. package/.next/server/chunks/4307.js +0 -1
  347. package/.next/server/chunks/5719.js +0 -1
  348. package/.next/server/chunks/7604.js +0 -1
  349. package/.next/static/chunks/2231-63ad38ec8fb7cb6f.js +0 -1
  350. package/.next/static/chunks/2416-dbbbff4e4c9abad1.js +0 -1
  351. package/.next/static/chunks/766-242213d211df0afd.js +0 -1
  352. package/.next/static/chunks/8997-78a359d0d238622e.js +0 -1
  353. package/.next/static/chunks/app/_global-error/page-93569b5eb93a61e9.js +0 -1
  354. package/.next/static/chunks/app/api/board-annotations/[id]/route-93569b5eb93a61e9.js +0 -1
  355. package/.next/static/chunks/app/api/board-annotations/route-93569b5eb93a61e9.js +0 -1
  356. package/.next/static/chunks/app/api/board-layout/route-93569b5eb93a61e9.js +0 -1
  357. package/.next/static/chunks/app/api/bug-flags/[id]/route-93569b5eb93a61e9.js +0 -1
  358. package/.next/static/chunks/app/api/bug-flags/route-93569b5eb93a61e9.js +0 -1
  359. package/.next/static/chunks/app/api/code-graph/position/route-93569b5eb93a61e9.js +0 -1
  360. package/.next/static/chunks/app/api/code-graph/route-93569b5eb93a61e9.js +0 -1
  361. package/.next/static/chunks/app/api/context/feature/route-93569b5eb93a61e9.js +0 -1
  362. package/.next/static/chunks/app/api/context/file/route-93569b5eb93a61e9.js +0 -1
  363. package/.next/static/chunks/app/api/context/route-93569b5eb93a61e9.js +0 -1
  364. package/.next/static/chunks/app/api/db/arrange/route-93569b5eb93a61e9.js +0 -1
  365. package/.next/static/chunks/app/api/db/backfill-access/route-93569b5eb93a61e9.js +0 -1
  366. package/.next/static/chunks/app/api/db/position/route-93569b5eb93a61e9.js +0 -1
  367. package/.next/static/chunks/app/api/db/prune-planned/route-93569b5eb93a61e9.js +0 -1
  368. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-93569b5eb93a61e9.js +0 -1
  369. package/.next/static/chunks/app/api/db/relations/[id]/route-93569b5eb93a61e9.js +0 -1
  370. package/.next/static/chunks/app/api/db/tables/[id]/route-93569b5eb93a61e9.js +0 -1
  371. package/.next/static/chunks/app/api/draft/approve/route-93569b5eb93a61e9.js +0 -1
  372. package/.next/static/chunks/app/api/draft/route-93569b5eb93a61e9.js +0 -1
  373. package/.next/static/chunks/app/api/draft/status/route-93569b5eb93a61e9.js +0 -1
  374. package/.next/static/chunks/app/api/edges/[id]/route-93569b5eb93a61e9.js +0 -1
  375. package/.next/static/chunks/app/api/edges/route-93569b5eb93a61e9.js +0 -1
  376. package/.next/static/chunks/app/api/endpoints/[id]/route-93569b5eb93a61e9.js +0 -1
  377. package/.next/static/chunks/app/api/entities/route-93569b5eb93a61e9.js +0 -1
  378. package/.next/static/chunks/app/api/flags/route-93569b5eb93a61e9.js +0 -1
  379. package/.next/static/chunks/app/api/ingest/route-93569b5eb93a61e9.js +0 -1
  380. package/.next/static/chunks/app/api/init/route-93569b5eb93a61e9.js +0 -1
  381. package/.next/static/chunks/app/api/lesson/close/route-93569b5eb93a61e9.js +0 -1
  382. package/.next/static/chunks/app/api/lesson/presence/route-93569b5eb93a61e9.js +0 -1
  383. package/.next/static/chunks/app/api/lesson/questions/route-93569b5eb93a61e9.js +0 -1
  384. package/.next/static/chunks/app/api/lesson/route-93569b5eb93a61e9.js +0 -1
  385. package/.next/static/chunks/app/api/lesson/save/route-93569b5eb93a61e9.js +0 -1
  386. package/.next/static/chunks/app/api/lesson/verdict/route-93569b5eb93a61e9.js +0 -1
  387. package/.next/static/chunks/app/api/map/describe/route-93569b5eb93a61e9.js +0 -1
  388. package/.next/static/chunks/app/api/map/files/route-93569b5eb93a61e9.js +0 -1
  389. package/.next/static/chunks/app/api/map/finish/route-93569b5eb93a61e9.js +0 -1
  390. package/.next/static/chunks/app/api/map/route-93569b5eb93a61e9.js +0 -1
  391. package/.next/static/chunks/app/api/map/start/route-93569b5eb93a61e9.js +0 -1
  392. package/.next/static/chunks/app/api/map/touch-active/route-93569b5eb93a61e9.js +0 -1
  393. package/.next/static/chunks/app/api/mention-search/route-93569b5eb93a61e9.js +0 -1
  394. package/.next/static/chunks/app/api/nodes/[id]/position/route-93569b5eb93a61e9.js +0 -1
  395. package/.next/static/chunks/app/api/nodes/[id]/route-93569b5eb93a61e9.js +0 -1
  396. package/.next/static/chunks/app/api/nodes/positions/route-93569b5eb93a61e9.js +0 -1
  397. package/.next/static/chunks/app/api/nodes/route-93569b5eb93a61e9.js +0 -1
  398. package/.next/static/chunks/app/api/nodes/subtasks/route-93569b5eb93a61e9.js +0 -1
  399. package/.next/static/chunks/app/api/notes/[id]/route-93569b5eb93a61e9.js +0 -1
  400. package/.next/static/chunks/app/api/notes/route-93569b5eb93a61e9.js +0 -1
  401. package/.next/static/chunks/app/api/open/route-93569b5eb93a61e9.js +0 -1
  402. package/.next/static/chunks/app/api/plan/annotations/route-93569b5eb93a61e9.js +0 -1
  403. package/.next/static/chunks/app/api/plan/approve/route-93569b5eb93a61e9.js +0 -1
  404. package/.next/static/chunks/app/api/plan/history/route-93569b5eb93a61e9.js +0 -1
  405. package/.next/static/chunks/app/api/plan/markdown/route-93569b5eb93a61e9.js +0 -1
  406. package/.next/static/chunks/app/api/plan/presence/route-93569b5eb93a61e9.js +0 -1
  407. package/.next/static/chunks/app/api/plan/route-93569b5eb93a61e9.js +0 -1
  408. package/.next/static/chunks/app/api/plan/verdict/route-93569b5eb93a61e9.js +0 -1
  409. package/.next/static/chunks/app/api/preferences/route-93569b5eb93a61e9.js +0 -1
  410. package/.next/static/chunks/app/api/project-meta/route-93569b5eb93a61e9.js +0 -1
  411. package/.next/static/chunks/app/api/reset/route-93569b5eb93a61e9.js +0 -1
  412. package/.next/static/chunks/app/api/scope-guard/check/route-93569b5eb93a61e9.js +0 -1
  413. package/.next/static/chunks/app/api/share/create/route-93569b5eb93a61e9.js +0 -1
  414. package/.next/static/chunks/app/api/share/route-93569b5eb93a61e9.js +0 -1
  415. package/.next/static/chunks/app/api/stream/route-93569b5eb93a61e9.js +0 -1
  416. package/.next/static/chunks/app/api/tab/nav/route-93569b5eb93a61e9.js +0 -1
  417. package/.next/static/chunks/app/api/tab/presence/route-93569b5eb93a61e9.js +0 -1
  418. package/.next/static/chunks/app/api/telemetry/route-93569b5eb93a61e9.js +0 -1
  419. package/.next/static/chunks/app/api/telemetry/stats/route-93569b5eb93a61e9.js +0 -1
  420. package/.next/static/chunks/app/api/version/route-93569b5eb93a61e9.js +0 -1
  421. package/.next/static/chunks/app/api/workspace/activate/route-93569b5eb93a61e9.js +0 -1
  422. package/.next/static/chunks/app/api/workspace/route-93569b5eb93a61e9.js +0 -1
  423. package/.next/static/chunks/app/layout-d3b7276f116dce46.js +0 -1
  424. package/.next/static/chunks/app/plan/page-948f3eca400e746a.js +0 -1
  425. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +0 -1
  426. package/.next/static/chunks/next/dist/client/components/builtin/app-error-93569b5eb93a61e9.js +0 -1
  427. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-93569b5eb93a61e9.js +0 -1
  428. package/.next/static/chunks/next/dist/client/components/builtin/not-found-93569b5eb93a61e9.js +0 -1
  429. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-93569b5eb93a61e9.js +0 -1
  430. package/.next/static/css/446974879473fd01.css +0 -1
  431. package/.next/static/lnOOQsWRymiliRmMEQ95F/_buildManifest.js +0 -1
  432. /package/.next/static/{lnOOQsWRymiliRmMEQ95F → yescmIM6BeSzGgwZ-Dwpq}/_ssgManifest.js +0 -0
package/dist/bin/plan.js CHANGED
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var OZ=Object.defineProperty;var AZ=(Q)=>Q;function EZ(Q,Z){this[Q]=AZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)OZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var yQ=1500,LQ=480000,P1=1800000,E=3600000,v1=3000;var zQ=()=>{};var WQ={};VQ(WQ,{removeRepoAssets:()=>pZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>yZ,installInitSkill:()=>bZ,installExplainSkill:()=>LZ,installCodexRepoSkills:()=>_Z,ensureWorkflowDoc:()=>SZ,ensureMcp:()=>hZ,auditRepo:()=>mZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>_Q,INIT_SKILL:()=>qQ,EXPLAIN_SKILL:()=>SQ});import{existsSync as M,mkdirSync as F,readFileSync as j,rmSync as b,writeFileSync as B}from"fs";import{join as U}from"path";function bZ(Q){let Z=U(Q,".claude","skills","beacon-init");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function IZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function yZ(Q){let Z=U(Q,".claude","skills","beacon-plan");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,_Q),$}function LZ(Q){let Z=U(Q,".claude","skills","beacon-explain");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,SQ),$}function _Z(Q){let Z=[];for(let $ of kZ){let Y=U(Q,".agents","skills",$.name);F(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function SZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=j(Z,"utf8")}catch{}let Y=new RegExp(`${I}[\\s\\S]*?${UQ}`);$=Y.test($)?$.replace(Y,kQ):`${$.trim()}
4
-
5
- ${kQ}
6
- `.trimStart(),B(Z,$.endsWith(`
7
- `)?$:`${$}
8
- `);let J=U(Q,"CLAUDE.md"),V="";try{V=j(J,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))B(J,`${V?`${V.trim()}
9
-
10
- `:""}@AGENTS.md
11
- `)}function hZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(j(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<E)return Y.timeout=E,B(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:E},B(Z,JSON.stringify($,null,2)+`
13
- `),{path:Z,added:!0,updated:!1}}function mZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(j(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=j(U(Q,"AGENTS.md"),"utf8").includes(I)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(j(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":M(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function pZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=U(Q,".claude","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let X=U(Q,".agents","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(j(Y,"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)b(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
14
- `)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=j(V,"utf8"),X=new RegExp(`\\n?${I}[\\s\\S]*?${UQ}\\n?`);if(X.test(z)){let H=z.replace(X,`
3
+ var AZ=Object.defineProperty;var IZ=(Q)=>Q;function yZ(Q,Z){this[Q]=IZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)AZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:yZ.bind(Z,$)})};var M=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var LQ=1500,kQ=480000,M1=1800000,A=3600000,T1=3000;var zQ=()=>{};var HQ={};VQ(HQ,{stripAgentsPointer:()=>mQ,removeRepoAssets:()=>dZ,installRefreshSkill:()=>kZ,installPlanSkill:()=>_Z,installInitSkill:()=>LZ,installExplainSkill:()=>SZ,installCodexRepoSkills:()=>mZ,ensureWorkflowDoc:()=>pZ,ensureMcp:()=>cZ,contextDocTargets:()=>WQ,auditRepo:()=>lZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>SQ,INIT_SKILL:()=>qQ,EXPLAIN_SKILL:()=>hQ});import{existsSync as j,mkdirSync as R,readFileSync as K,rmSync as I,writeFileSync as B}from"fs";import{join as U}from"path";function LZ(Q){let Z=U(Q,".claude","skills","beacon-init");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function kZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function _Z(Q){let Z=U(Q,".claude","skills","beacon-plan");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,SQ),$}function SZ(Q){let Z=U(Q,".claude","skills","beacon-explain");R(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,hQ),$}function mZ(Q){let Z=[];for(let $ of hZ){let Y=U(Q,".agents","skills",$.name);R(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function WQ(Q){let Z=U(Q,"AGENTS.md"),$=U(Q,"CLAUDE.md"),Y=j(Z),J=j($);if(!Y&&!J)return[Z,$];let V=[];if(Y)V.push(Z);if(J)V.push($);return V}function mQ(Q){let Z=U(Q,"CLAUDE.md");if(!j(Z))return;let $=K(Z,"utf8"),Y=$.split(`
4
+ `).filter((J)=>!/^\s*@\.?\/?AGENTS\.md\s*$/.test(J)).join(`
5
+ `).trim();if(Y&&Y!==$.trim())B(Z,`${Y}
6
+ `)}function pZ(Q){let Z=new RegExp(`${y}[\\s\\S]*?${UQ}`);for(let $ of WQ(Q)){let Y="";try{Y=K($,"utf8")}catch{}Y=Z.test(Y)?Y.replace(Z,_Q):`${Y.trim()}
7
+
8
+ ${_Q}
9
+ `.trimStart(),B($,Y.endsWith(`
10
+ `)?Y:`${Y}
11
+ `)}mQ(Q)}function cZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(K(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<A)return Y.timeout=A,B(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:A},B(Z,JSON.stringify($,null,2)+`
13
+ `),{path:Z,added:!0,updated:!1}}function lZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(K(Z,"utf8")).mcpServers?.beacon}catch{}let Y=WQ(Q).some((J)=>{try{return K(J,"utf8").includes(y)}catch{return!1}});return{repo:Q,mcpRegistered:$,workflowBlock:Y,skills:{"beacon-init":j(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":j(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":j(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":j(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function dZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=U(Q,".claude","skills",z);if(j(X))I(X,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let X=U(Q,".agents","skills",z);if(j(X))I(X,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(K(Y,"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)I(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let J=!1,V=new RegExp(`\\n?${y}[\\s\\S]*?${UQ}\\n?`);for(let z of[U(Q,"AGENTS.md"),U(Q,"CLAUDE.md")])try{let X=K(z,"utf8");if(V.test(X)){let H=X.replace(V,`
15
15
  `).replace(/\n{3,}/g,`
16
16
 
17
- `).trimStart();B(V,H.endsWith(`
17
+ `).trimStart();B(z,H.endsWith(`
18
18
  `)?H:`${H}
19
- `),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=j(W,"utf8"),X=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==z){if(!X.trim())b(W,{force:!0});else B(W,X);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
19
+ `),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=K(W,"utf8"),X=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==z){if(!X.trim())I(W,{force:!0});else B(W,X);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
20
20
  name: beacon-init
21
21
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
22
22
  ---
@@ -110,7 +110,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
110
110
  If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
111
111
 
112
112
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
113
- `,_Q=`---
113
+ `,SQ=`---
114
114
  name: beacon-plan
115
115
  description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
116
116
  ---
@@ -139,10 +139,11 @@ board on /plan. The board is built ONLY from the block \u2014 prose is never par
139
139
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
140
140
 
141
141
  - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
142
- \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
143
- has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
144
- implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
145
- to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
142
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). Those files are
143
+ frozen at approval and you're held to them while implementing \u2014 editing an undeclared file pauses
144
+ for the user's authorization (which then adds it to the contract), and the /plan Changes view
145
+ groups your edits On-plan vs Strayed against them. Declare the files you genuinely expect to edit
146
+ (if omitted, the scope is inferred from the files you name in backticks).
146
147
 
147
148
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
148
149
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
@@ -158,7 +159,7 @@ If it returns feedback, revise and call it again.
158
159
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
159
160
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
160
161
  run \`beacon\` in this repo once.
161
- `,SQ=`---
162
+ `,hQ=`---
162
163
  name: beacon-explain
163
164
  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
165
  ---
@@ -228,7 +229,7 @@ so the learner sees the table IN CONTEXT, wired to the code that uses it.
228
229
  Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
229
230
  the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
230
231
  the lesson.
231
- `,kZ,I="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",kQ;var HQ=C(()=>{zQ();kZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];kQ=`${I}
232
+ `,hZ,y="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",_Q;var BQ=M(()=>{zQ();hZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];_Q=`${y}
232
233
  ## Beacon \u2014 feature workflow
233
234
 
234
235
  This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
@@ -300,18 +301,18 @@ Register them all in that single batched call. If a plan added five features, th
300
301
  If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
301
302
 
302
303
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
303
- ${UQ}`});import{existsSync as y,mkdirSync as BQ,readdirSync as cZ,readFileSync as T,rmSync as lZ,writeFileSync as L}from"fs";import{dirname as hQ,join as K}from"path";function mQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function pQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=K(Q,".claude","plugins");if(!y(Z))return null;let $=[Z];for(let Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=K(V,".claude-plugin","plugin.json");try{if(y(q)&&JSON.parse(T(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of cZ(V,{withFileTypes:!0}))if(W.isDirectory())J.push(K(V,W.name))}catch{}}$=J}return null}function cQ(Q){return pQ(Q)!==null}function dZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function aZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(T(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 GQ(Q){try{return JSON.parse(T(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){BQ(hQ(Q),{recursive:!0}),L(Q,JSON.stringify(Z,null,2)+`
304
- `)}function _(Q,Z){let $=GQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function S(Q,Z){return(GQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function h(Q,Z){let $=GQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((X)=>X.command!==Z.command);if(z.length!==W)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function m(Q,Z,$,Y){let J=`${Z}
304
+ ${UQ}`});import{existsSync as L,mkdirSync as GQ,readdirSync as aZ,readFileSync as T,rmSync as nZ,writeFileSync as k}from"fs";import{dirname as pQ,join as x}from"path";function cQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function lQ(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 Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=x(V,".claude-plugin","plugin.json");try{if(L(q)&&JSON.parse(T(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of aZ(V,{withFileTypes:!0}))if(W.isDirectory())J.push(x(V,W.name))}catch{}}$=J}return null}function dQ(Q){return lQ(Q)!==null}function sZ(Q){return/[\\/]\.claude[\\/]plugins[\\/]/.test(Q)}function tZ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;try{let Z=JSON.parse(T(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 jQ(Q){try{return JSON.parse(T(Q,"utf8"))}catch{return{}}}function aQ(Q,Z){GQ(pQ(Q),{recursive:!0}),k(Q,JSON.stringify(Z,null,2)+`
305
+ `)}function S(Q,Z){let $=jQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),aQ(Q,$),!0}function h(Q,Z){return(jQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function m(Q,Z){let $=jQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((X)=>X.command!==Z.command);if(z.length!==W)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return aQ(Q,$),!0}function p(Q,Z,$,Y){let J=`${Z}
305
306
  ${Y.trim()}
306
307
  ${$}`,V="";try{V=T(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
307
308
 
308
309
  ${J}
309
310
  `:`${J}
310
- `,BQ(hQ(Q),{recursive:!0}),L(Q,V.endsWith(`
311
+ `,GQ(pQ(Q),{recursive:!0}),k(Q,V.endsWith(`
311
312
  `)?V:`${V}
312
- `)}function w(Q,Z){try{return T(Q,"utf8").includes(Z)}catch{return!1}}function p(Q,Z,$){let Y="";try{Y=T(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
313
+ `)}function w(Q,Z){try{return T(Q,"utf8").includes(Z)}catch{return!1}}function c(Q,Z,$){let Y="";try{Y=T(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
313
314
 
314
- `).trimStart();return L(Q,V),!0}function c(Q,Z,$){let Y=K(Q,Z);BQ(Y,{recursive:!0});let J=K(Y,"SKILL.md");return L(J,$),J}function u(Q,Z){return y(K(Q,Z,"SKILL.md"))}function l(Q,Z){let $=K(Q,Z);if(!y($))return!1;return lZ($,{recursive:!0,force:!0}),!0}var x,k=`## Beacon (visual planning panel)
315
+ `).trimStart();return k(Q,V),!0}function l(Q,Z,$){let Y=x(Q,Z);GQ(Y,{recursive:!0});let J=x(Y,"SKILL.md");return k(J,$),J}function g(Q,Z){return L(x(Q,Z,"SKILL.md"))}function d(Q,Z){let $=x(Q,Z);if(!L($))return!1;return nZ($,{recursive:!0,force:!0}),!0}var N,_=`## Beacon (visual planning panel)
315
316
 
316
317
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
317
318
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -335,24 +336,24 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
335
336
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
336
337
  on the /map and /db boards (added features, attached subtasks, edited columns, new
337
338
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
338
- verbatim. Do NOT implement until the tool returns approval.`;var jQ=C(()=>{x=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as nZ,renameSync as tZ,rmSync as sZ,writeFileSync as rZ}from"fs";import{dirname as oZ}from"path";function d(Q,Z){nZ(oZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{rZ($,Z),tZ($,Q)}catch(Y){throw sZ($,{force:!0}),Y}}function f1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var dQ=()=>{};var eQ={};VQ(eQ,{setupCodexAssets:()=>Z0,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>Y0,hasCodexMcp:()=>PQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>Q0,codexDetected:()=>tQ,auditCodex:()=>$0,CODEX_HOOKS:()=>r});import{readFileSync as s}from"fs";import{homedir as iZ}from"os";import{join as f}from"path";function aQ(){return process.env.HOME||process.env.USERPROFILE||iZ()}function tQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function PQ(){try{return Boolean(D(s(R(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Q0(){let Q="";try{Q=s(R(),"utf8")}catch{return null}let Z=D(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${g}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${g}`;return null}function oQ(){let Q="",Z=!1;try{Q=s(R(),"utf8"),Z=!0}catch{}if(Z){let V=D(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${g}`};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 ${g}`}}let $=!Q?"":Q.endsWith(`
339
+ verbatim. Do NOT implement until the tool returns approval.`;var KQ=M(()=>{N=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as rZ,renameSync as oZ,rmSync as iZ,writeFileSync as eZ}from"fs";import{dirname as Q0}from"path";function a(Q,Z){rZ(Q0(Q),{recursive:!0});let $=`${Q}.tmp`;try{eZ($,Z),oZ($,Q)}catch(Y){throw iZ($,{force:!0}),Y}}function b1(Q,Z,$=!1){a(Q,JSON.stringify(Z,null,$?2:void 0))}var nQ=()=>{};var ZZ={};VQ(ZZ,{setupCodexAssets:()=>J0,removeCodexMcp:()=>QZ,removeCodexArtifacts:()=>z0,hasCodexMcp:()=>vQ,ensureCodexMcp:()=>eQ,codexMcpProblem:()=>Y0,codexDetected:()=>rQ,auditCodex:()=>V0,CODEX_HOOKS:()=>o});import{readFileSync as r}from"fs";import{homedir as Z0}from"os";import{join as f}from"path";function sQ(){return process.env.HOME||process.env.USERPROFILE||Z0()}function rQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(xQ===void 0)xQ=Bun.which("codex")!==null;return xQ}function O(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function vQ(){try{return Boolean(O(r(F(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Y0(){let Q="";try{Q=r(F(),"utf8")}catch{return null}let Z=O(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${D}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${D}`;return null}function eQ(){let Q="",Z=!1;try{Q=r(F(),"utf8"),Z=!0}catch{}if(Z){let V=O(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${D}`};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 ${D}`}}let $=!Q?"":Q.endsWith(`
339
340
  `)?`
340
341
  `:`
341
342
 
342
- `,Y=Q+$+eZ;if(D(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${g}`};return d(R(),Y),{added:!0}}function iQ(){let Q="";try{Q=s(R(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
343
- `),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:PQ()};let Y=Z.indexOf(rQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
343
+ `,Y=Q+$+$0;if(O(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${D}`};return a(F(),Y),{added:!0}}function QZ(){let Q="";try{Q=r(F(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
344
+ `),$=Z.indexOf(oQ);if($===-1)return{removed:!1,skipped:vQ()};let Y=Z.indexOf(iQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
344
345
  `).replace(/\n{3,}/g,`
345
346
 
346
- `).replace(/^\n+/,"");if(D(J)===null)return{removed:!1,skipped:!0};return d(R(),J),{removed:!0}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let X of x){if(!u(n(),X))V.push(X);c(n(),X,J[X])}let q=0;for(let X of r)if(_(NQ(),{event:X.event,matcher:X.matcher,command:X.command}))q++;let W=w(a(),t);m(a(),t,nQ,k);let z=oQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function $0(){let Q={};for(let $ of x)Q[$]=u(n(),$);let Z={};for(let $ of r)Z[$.event]=S(NQ(),{event:$.event,command:$.command});return{detected:tQ(),skills:Q,hooks:Z,agentsMdBlock:w(a(),t),mcp:PQ()}}function Y0(){let Q=[];for(let J of x)if(l(n(),J))Q.push(J);let Z=0;for(let J of r)if(h(NQ(),{event:J.event,command:J.command}))Z++;let $=p(a(),t,nQ),Y=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var xQ=()=>f(aQ(),".codex"),NQ=()=>f(xQ(),"hooks.json"),R=()=>f(xQ(),"config.toml"),a=()=>f(xQ(),"AGENTS.md"),n=()=>f(aQ(),".agents","skills"),t="<!-- beacon:global:start -->",nQ="<!-- beacon:global:end -->",r,KQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",eZ,g="add it manually: codex mcp add beacon -- beacon mcp";var QZ=C(()=>{jQ();dQ();r=[{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."}];eZ=`${sQ}
347
+ `).replace(/^\n+/,"");if(O(J)===null)return{removed:!1,skipped:!0};return a(F(),J),{removed:!0}}async function J0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (BQ(),HQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let X of N){if(!g(s(),X))V.push(X);l(s(),X,J[X])}let q=0;for(let X of o)if(S(PQ(),{event:X.event,matcher:X.matcher,command:X.command}))q++;let W=w(n(),t);p(n(),t,tQ,_);let z=eQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function V0(){let Q={};for(let $ of N)Q[$]=g(s(),$);let Z={};for(let $ of o)Z[$.event]=h(PQ(),{event:$.event,command:$.command});return{detected:rQ(),skills:Q,hooks:Z,agentsMdBlock:w(n(),t),mcp:vQ()}}function z0(){let Q=[];for(let J of N)if(d(s(),J))Q.push(J);let Z=0;for(let J of o)if(m(PQ(),{event:J.event,command:J.command}))Z++;let $=c(n(),t,tQ),Y=QZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var NQ=()=>f(sQ(),".codex"),PQ=()=>f(NQ(),"hooks.json"),F=()=>f(NQ(),"config.toml"),n=()=>f(NQ(),"AGENTS.md"),s=()=>f(sQ(),".agents","skills"),t="<!-- beacon:global:start -->",tQ="<!-- beacon:global:end -->",o,xQ,oQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",iQ="# beacon:end",$0,D="add it manually: codex mcp add beacon -- beacon mcp";var $Z=M(()=>{KQ();nQ();o=[{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."}];$0=`${oQ}
347
348
  [mcp_servers.beacon]
348
349
  command = "beacon"
349
350
  args = ["mcp"]
350
- ${rQ}
351
- `});var zZ={};VQ(zZ,{provisionDb:()=>D0});import{createClient as N0}from"@libsql/client";import{drizzle as P0}from"drizzle-orm/libsql";import{migrate as v0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as C0}from"drizzle-orm/migrator";import{dirname as FQ,join as M0}from"path";import{fileURLToPath as T0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function u0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function VZ(Q){if(!await e(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 g0(Q){for(let[Z,$]of Object.entries(w0)){if(!await e(Q,Z))continue;let Y=await u0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function D0(Q,Z=F0){let $=N0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let W=C0({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 VZ($);if(await v0(P0($),{migrationsFolder:Z}),await VZ($)>q)V=!0;return await g0($),{migrated:V}}finally{$.close()}}var R0,F0,w0;var qZ=C(async()=>{R0=FQ(FQ(FQ(T0(import.meta.url)))),F0=process.env.BEACON_MIGRATIONS_DIR||M0(R0,"drizzle"),w0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});jQ();import{existsSync as J0}from"fs";import{homedir as V0}from"os";import{join as o}from"path";function z0(){return process.env.HOME||process.env.USERPROFILE||V0()}var i=()=>o(z0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",ZZ="<!-- beacon:global:end -->";var q0=k,RQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function X0(Q,Z){return c(vQ(),Q,Z)}function $Z(Q){return u(vQ(),Q)}function U0(Q){return l(vQ(),Q)}function W0(Q){return _(CQ(),Q)}function H0(Q){return S(CQ(),Q)}function B0(Q){return h(CQ(),Q)}function G0(Q){m(MQ(),TQ,ZZ,Q)}function YZ(){return w(MQ(),TQ)}function j0(){return p(MQ(),TQ,ZZ)}function h1(){let Q={};for(let $ of x)Q[$]=$Z($);let Z={};for(let $ of RQ)Z[$.event]=H0({event:$.event,command:$.command});return{homeExists:J0(i()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function K0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of x){if(!$Z(z))V.push(z);X0(z,J[z])}let q=0;for(let z of RQ)if(W0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=YZ();return G0(q0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function JZ(){if(mQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(cQ()){try{x0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await K0()}}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(() => (QZ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function x0(){let Q=[];for(let Y of x)if(U0(Y))Q.push(Y);let Z=0;for(let Y of RQ)if(B0(Y))Z++;let $=j0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as f0}from"async_hooks";import{spawnSync as O0}from"child_process";import{createHash as A0}from"crypto";import{existsSync as UZ,mkdirSync as O,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as WZ}from"os";import{basename as E0,join as N,parse as b0,resolve as XZ}from"path";function G(){return process.env.BEACON_HOME||N(WZ(),".beacon")}function DQ(){return N(G(),"workspaces.json")}function QQ(Q){return A0("sha256").update(Q).digest("hex").slice(0,12)}function Q2(Q=process.cwd()){let Z=O0("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 HZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==b0(Z).root}function BZ(){return N(G(),"deleted.json")}function fQ(){try{let Q=JSON.parse(uQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function GZ(Q){O(G(),{recursive:!0}),gQ(BZ(),JSON.stringify(Q,null,2))}function jZ(Q){return fQ().includes(Q)}function Z2(Q){let Z=fQ();if(!Z.includes(Q))GZ([...Z,Q])}function I0(Q){let Z=fQ();if(Z.includes(Q))GZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return N(G(),Q)}function y0(Q){return`file:${N(ZQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function OQ(Q){O(G(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function KZ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return A().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!HZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||E0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return O(ZQ(Y),{recursive:!0}),OQ(W),q}function $2(Q,Z){return I0(QQ(Q)),xZ(Q,Z)}function Y2(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,OQ($)}function J2(Q){if(OQ(A().filter((Z)=>Z.id!==Q)),AQ()===Q)L0(KZ()[0]?.id??null)}function NZ(){return N(G(),"active")}function AQ(){try{return uQ(NZ(),"utf8").trim()||null}catch{return null}}function L0(Q){O(G(),{recursive:!0}),gQ(NZ(),Q??"")}function V2(){let Q=AQ();return Q?P(Q):null}function z2(){let Q=S0()??AQ();return Q?P(Q):null}function q2(Q){return P(Q)?.path??null}function X2(){return UZ(DQ())}var PZ="beacon_ws";function vZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function U2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=vZ(Q,PZ);if($&&P($))return $;return k0()}function k0(){let Q=KZ();return Q.length===1?Q[0].id:null}var _0="x-beacon-workspace-path";async function W2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(_0);if($&&HZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=xZ($);return await h0(J.id),J.id}let Y=vZ(Q,PZ);if(Y&&P(Y))return Y;return null}var CZ=new f0;function H2(Q,Z){return Q?CZ.run(Q,Z):Z()}function S0(){return CZ.getStore()??null}var wQ=new Set;function B2(Q){wQ.delete(N(ZQ(Q),"db.sqlite"))}async function h0(Q){let Z=ZQ(Q),$=N(Z,"db.sqlite"),Y=UZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{O(Z,{recursive:!0});let{provisionDb:J}=await qZ().then(() => zZ),V=await J(y0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as m0}from"net";var K2=4319;function p0(Q,Z,$=400){return new Promise((Y)=>{let J=m0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function c0(Q){for(let Z of["127.0.0.1","::1"])if(await p0(Z,Q))return!1;return!0}async function MZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await c0($))return $;return Q}import{execSync as o0,spawn as i0}from"child_process";import{mkdirSync as e0,openSync as Q1,readFileSync as Z1,writeFileSync as $1}from"fs";import{homedir as Y1}from"os";import{dirname as J1,join as YQ}from"path";import{fileURLToPath as V1}from"url";import{createHash as z1}from"crypto";zQ();import{mkdirSync as d0,readFileSync as a0,writeFileSync as n0}from"fs";import{join as t0}from"path";var l0=["default","acceptEdits","bypassPermissions","auto"];function TZ(Q){return typeof Q==="string"&&l0.includes(Q)}function RZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function FZ(){return t0(G(),"preferences.json")}function EQ(){try{let Q=JSON.parse(a0(FZ(),"utf8"));return{planApprovalMode:TZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function T2(Q){let Z={...EQ(),...Q};return d0(G(),{recursive:!0}),n0(FZ(),JSON.stringify(Z,null,2)),Z}function wZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
351
+ ${iQ}
352
+ `});var XZ={};VQ(XZ,{provisionDb:()=>E0});import{createClient as C0}from"@libsql/client";import{drizzle as M0}from"drizzle-orm/libsql";import{migrate as T0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as F0}from"drizzle-orm/migrator";import{dirname as wQ,join as R0}from"path";import{fileURLToPath as w0}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 f0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function qZ(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 u0(Q){for(let[Z,$]of Object.entries(O0)){if(!await QQ(Q,Z))continue;let Y=await f0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function E0(Q,Z=D0){let $=C0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await QQ($,"__drizzle_migrations"),J=await QQ($,"Node"),V=!1;if(J&&!Y){let W=F0({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 qZ($);if(await T0(M0($),{migrationsFolder:Z}),await qZ($)>q)V=!0;return await u0($),{migrated:V}}finally{$.close()}}var g0,D0,O0;var UZ=M(async()=>{g0=wQ(wQ(wQ(w0(import.meta.url)))),D0=process.env.BEACON_MIGRATIONS_DIR||R0(g0,"drizzle"),O0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});KQ();import{existsSync as q0}from"fs";import{homedir as X0}from"os";import{join as i}from"path";function U0(){return process.env.HOME||process.env.USERPROFILE||X0()}var e=()=>i(U0(),".claude"),CQ=()=>i(e(),"skills"),MQ=()=>i(e(),"settings.json"),TQ=()=>i(e(),"CLAUDE.md"),FQ="<!-- beacon:global:start -->",YZ="<!-- beacon:global:end -->";var W0=_,RQ=[{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 H0(Q,Z){return l(CQ(),Q,Z)}function JZ(Q){return g(CQ(),Q)}function B0(Q){return d(CQ(),Q)}function G0(Q){return S(MQ(),Q)}function j0(Q){return h(MQ(),Q)}function K0(Q){return m(MQ(),Q)}function x0(Q){p(TQ(),FQ,YZ,Q)}function VZ(){return w(TQ(),FQ)}function N0(){return c(TQ(),FQ,YZ)}function c1(){let Q={};for(let $ of N)Q[$]=JZ($);let Z={};for(let $ of RQ)Z[$.event]=j0({event:$.event,command:$.command});return{homeExists:q0(e()),skills:Q,hooks:Z,claudeMdBlock:VZ()}}async function P0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (BQ(),HQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of N){if(!JZ(z))V.push(z);H0(z,J[z])}let q=0;for(let z of RQ)if(G0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=VZ();return x0(W0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function zZ(){if(cQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(dQ()){try{v0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await P0()}}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(() => ($Z(),ZZ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function v0(){let Q=[];for(let Y of N)if(B0(Y))Q.push(Y);let Z=0;for(let Y of RQ)if(K0(Y))Z++;let $=N0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as b0}from"async_hooks";import{spawnSync as A0}from"child_process";import{createHash as I0}from"crypto";import{existsSync as HZ,mkdirSync as E,readFileSync as DQ,writeFileSync as OQ}from"fs";import{homedir as BZ}from"os";import{basename as y0,join as P,parse as L0,resolve as WZ}from"path";function G(){return process.env.BEACON_HOME||P(BZ(),".beacon")}function fQ(){return P(G(),"workspaces.json")}function u(Q){return I0("sha256").update(Q).digest("hex").slice(0,12)}function k0(Q=process.cwd()){let Z=A0("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=WZ(Q);return Z!==WZ(BZ())&&Z!==L0(Z).root}function jZ(){return P(G(),"deleted.json")}function uQ(){try{let Q=JSON.parse(DQ(jZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function KZ(Q){E(G(),{recursive:!0}),OQ(jZ(),JSON.stringify(Q,null,2))}function xZ(Q){return uQ().includes(Q)}function Y2(Q){let Z=uQ();if(!Z.includes(Q))KZ([...Z,Q])}function _0(Q){let Z=uQ();if(Z.includes(Q))KZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return P(G(),Q)}function S0(Q){return`file:${P(ZQ(Q),"db.sqlite")}`}function b(){try{let Q=JSON.parse(DQ(fQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function EQ(Q){E(G(),{recursive:!0}),OQ(fQ(),JSON.stringify(Q,null,2))}function NZ(){return b().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function v(Q){return b().find((Z)=>Z.id===Q)??null}function PZ(Q,Z,$=new Date().toISOString()){if(!GZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=u(Q);if(xZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=b(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||y0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return E(ZQ(Y),{recursive:!0}),EQ(W),q}function J2(Q,Z){return _0(u(Q)),PZ(Q,Z)}function V2(Q,Z=new Date().toISOString()){let $=b(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,EQ($)}function z2(Q){if(EQ(b().filter((Z)=>Z.id!==Q)),bQ()===Q)h0(NZ()[0]?.id??null)}function vZ(){return P(G(),"active")}function bQ(){try{return DQ(vZ(),"utf8").trim()||null}catch{return null}}function h0(Q){E(G(),{recursive:!0}),OQ(vZ(),Q??"")}function q2(){let Q=bQ();return Q?v(Q):null}function X2(){let Q=p0()??bQ();return Q?v(Q):null}function U2(Q){return v(Q)?.path??null}function W2(){return HZ(fQ())}var CZ="beacon_ws";function MZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function H2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&v(Z))return Z;let $=MZ(Q,CZ);if($&&v($))return $;return m0()}function m0(){let Q=NZ();return Q.length===1?Q[0].id:null}var TZ="x-beacon-workspace-path";function B2(Q=process.cwd()){let Z=k0(Q);return{"x-beacon-workspace":u(Z),[TZ]:Z}}async function G2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&v(Z))return Z;let $=Q.headers.get(TZ);if($&&GZ($)&&!xZ(u($))&&(!Z||u($)===Z)){let J=PZ($);return await c0(J.id),J.id}let Y=MZ(Q,CZ);if(Y&&v(Y))return Y;return null}var FZ=new b0;function j2(Q,Z){return Q?FZ.run(Q,Z):Z()}function p0(){return FZ.getStore()??null}var gQ=new Set;function K2(Q){gQ.delete(P(ZQ(Q),"db.sqlite"))}async function c0(Q){let Z=ZQ(Q),$=P(Z,"db.sqlite"),Y=HZ($);if(Y&&gQ.has($))return{ok:!0,created:!1,migrated:!1};try{E(Z,{recursive:!0});let{provisionDb:J}=await UZ().then(() => XZ),V=await J(S0(Q));return gQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as l0}from"net";var P2=4319;function d0(Q,Z,$=400){return new Promise((Y)=>{let J=l0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function a0(Q){for(let Z of["127.0.0.1","::1"])if(await d0(Z,Q))return!1;return!0}async function RZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await a0($))return $;return Q}import{execSync as Q1,spawn as Z1}from"child_process";import{mkdirSync as $1,openSync as Y1,readFileSync as J1,writeFileSync as V1}from"fs";import{homedir as z1}from"os";import{dirname as q1,join as YQ}from"path";import{fileURLToPath as X1}from"url";import{createHash as U1}from"crypto";zQ();import{mkdirSync as s0,readFileSync as t0,writeFileSync as r0}from"fs";import{join as o0}from"path";var n0=["default","acceptEdits","bypassPermissions","auto"];function wZ(Q){return typeof Q==="string"&&n0.includes(Q)}function gZ(Q,Z,$){let Y={behavior:"allow"};if($&&Object.keys($).length>0)Y.updatedInput=$;if(Q)Y.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let J={hookEventName:"PermissionRequest",decision:Y};if(Z?.trim())J.additionalContext=Z;return{hookSpecificOutput:J}}function DZ(){return o0(G(),"preferences.json")}function AQ(){try{let Q=JSON.parse(t0(DZ(),"utf8"));return{planApprovalMode:wZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function w2(Q){let Z={...AQ(),...Q};return s0(G(),{recursive:!0}),r0(DZ(),JSON.stringify(Z,null,2)),Z}function OZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
352
353
 
353
354
  This plan created these roadmap feature(s):
354
355
  `+Z.join(`
355
- `)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as s0}from"child_process";import{platform as uZ}from"os";function r0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=uZ()==="darwin"?"open":uZ()==="win32"?"start":"xdg-open";try{s0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function gZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);r0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var q1=YQ(J1(V1(import.meta.url)),".."),IQ=process.env.BEACON_HOME||YQ(Y1(),".beacon"),DZ=YQ(IQ,"server.json"),X1=process.env.PORT||"4319";function U1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function W1(Q){try{return JSON.parse(Z1(Q,"utf8"))}catch{return null}}async function fZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function H1(Q,Z=60){for(let $=0;$<Z;$++){if(await fZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function B1(Q){e0(IQ,{recursive:!0});let Z=Q1(YQ(IQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=i0("bun",["run","dev"],{cwd:q1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return $1(DZ,JSON.stringify(J)),J}async function G1(){let Q=W1(DZ);if(Q&&U1(Q.pid)&&await fZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await MZ(Number(X1))),{port:$}=B1(Z);return await H1(`http://localhost:${$}/api/workspace`),$}function j1(){try{return o0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function K1(Q){return z1("sha256").update(Q).digest("hex").slice(0,12)}async function x1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function bQ(Q,Z){return RZ(Q,Z)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function v(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await JZ();let Z=(await x1())?.tool_input?.plan;if(!Z||!Z.trim())v(bQ());let Y=`http://localhost:${await G1()}`,J=j1()||process.cwd(),V=K1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
356
- `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));v($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!W.ok)v(bQ());await gZ(Y,V);let z=Date.now()+LQ,X=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await X(yQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")v(bQ(EQ().planApprovalMode,wZ(H.features)));if(H.kind==="discarded")v($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")v($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
356
+ `)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as i0}from"child_process";import{platform as fZ}from"os";function e0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=fZ()==="darwin"?"open":fZ()==="win32"?"start":"xdg-open";try{i0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function uZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);e0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var W1=YQ(q1(X1(import.meta.url)),".."),yQ=process.env.BEACON_HOME||YQ(z1(),".beacon"),EZ=YQ(yQ,"server.json"),H1=process.env.PORT||"4319";function B1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function G1(Q){try{return JSON.parse(J1(Q,"utf8"))}catch{return null}}async function bZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function j1(Q,Z=60){for(let $=0;$<Z;$++){if(await bZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function K1(Q){$1(yQ,{recursive:!0});let Z=Y1(YQ(yQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=Z1("bun",["run","dev"],{cwd:W1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return V1(EZ,JSON.stringify(J)),J}async function x1(){let Q=G1(EZ);if(Q&&B1(Q.pid)&&await bZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await RZ(Number(H1))),{port:$}=K1(Z);return await j1(`http://localhost:${$}/api/workspace`),$}function N1(){try{return Q1("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function P1(Q){return U1("sha256").update(Q).digest("hex").slice(0,12)}async function v1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function IQ(Q,Z,$){return gZ(Q,Z,$)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function C(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await zZ();let Z=(await v1())?.tool_input?.plan;if(!Z||!Z.trim())C(IQ());let Y=`http://localhost:${await x1()}`,J=N1()||process.cwd(),V=P1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
357
+ `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));C($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!W.ok)C(IQ());await uZ(Y,V);let z=Date.now()+kQ,X=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await X(LQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")C(IQ(AQ().planApprovalMode,OZ(H.features),{plan:Z}));if(H.kind==="discarded")C($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")C($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
357
358
 
358
- `+H.feedback))}v($Q("\u23F3 Still awaiting your review in Beacon \u2014 the plan is open on /plan and nothing was lost. "+"Claude Code caps a single plan-review hook at ~10 minutes, so to keep waiting you MUST call ExitPlanMode again now with the SAME plan. Re-presenting resumes the same review (your in-progress annotations and any decision are preserved). Do NOT implement, and do "+"NOT ask in the terminal \u2014 just re-present."))})();
359
+ `+H.feedback))}C($Q("\u23F3 Still awaiting your review in Beacon \u2014 the plan is open on /plan and nothing was lost. "+"Claude Code caps a single plan-review hook at ~10 minutes, so to keep waiting you MUST call ExitPlanMode again now with the SAME plan. Re-presenting resumes the same review (your in-progress annotations and any decision are preserved). Do NOT implement, and do "+"NOT ask in the terminal \u2014 just re-present."))})();