trybeacon 0.1.47 → 0.1.49

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 (335) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +14 -12
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +12 -0
  6. package/.next/server/app/_global-error/page.js +3 -3
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page.js +2 -2
  17. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/_not-found.html +1 -1
  19. package/.next/server/app/_not-found.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  21. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  23. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  26. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  27. package/.next/server/app/api/board-annotations/route.js +1 -1
  28. package/.next/server/app/api/board-layout/route.js +1 -1
  29. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  30. package/.next/server/app/api/bug-flags/route.js +1 -1
  31. package/.next/server/app/api/code-graph/position/route.js +1 -1
  32. package/.next/server/app/api/code-graph/route.js +1 -1
  33. package/.next/server/app/api/context/feature/route.js +1 -1
  34. package/.next/server/app/api/context/file/route.js +1 -1
  35. package/.next/server/app/api/context/route.js +2 -2
  36. package/.next/server/app/api/db/arrange/route.js +1 -1
  37. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  38. package/.next/server/app/api/db/position/route.js +1 -1
  39. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  40. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  41. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  42. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  43. package/.next/server/app/api/draft/approve/route.js +1 -1
  44. package/.next/server/app/api/draft/route.js +1 -1
  45. package/.next/server/app/api/draft/status/route.js +1 -1
  46. package/.next/server/app/api/edges/[id]/route.js +1 -1
  47. package/.next/server/app/api/edges/route.js +1 -1
  48. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  49. package/.next/server/app/api/entities/route.js +1 -1
  50. package/.next/server/app/api/feedback/[id]/route.js +1 -1
  51. package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
  52. package/.next/server/app/api/feedback/route.js +1 -1
  53. package/.next/server/app/api/flags/route.js +1 -0
  54. package/.next/server/app/api/flags/route.js.nft.json +1 -0
  55. package/.next/server/app/api/flags/route_client-reference-manifest.js +1 -0
  56. package/.next/server/app/api/ingest/route.js +2 -2
  57. package/.next/server/app/api/init/route.js +1 -1
  58. package/.next/server/app/api/map/describe/route.js +2 -2
  59. package/.next/server/app/api/map/files/route.js +1 -1
  60. package/.next/server/app/api/map/finish/route.js +1 -1
  61. package/.next/server/app/api/map/route.js +1 -1
  62. package/.next/server/app/api/map/start/route.js +1 -1
  63. package/.next/server/app/api/map/touch-active/route.js +1 -1
  64. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  65. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  66. package/.next/server/app/api/nodes/positions/route.js +1 -1
  67. package/.next/server/app/api/nodes/route.js +1 -1
  68. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  69. package/.next/server/app/api/notes/[id]/route.js +1 -1
  70. package/.next/server/app/api/notes/route.js +1 -1
  71. package/.next/server/app/api/open/route.js +1 -1
  72. package/.next/server/app/api/plan/annotations/route.js +3 -3
  73. package/.next/server/app/api/plan/approve/route.js +2 -2
  74. package/.next/server/app/api/plan/history/route.js +1 -1
  75. package/.next/server/app/api/plan/markdown/route.js +1 -1
  76. package/.next/server/app/api/plan/presence/route.js +1 -1
  77. package/.next/server/app/api/plan/route.js +1 -1
  78. package/.next/server/app/api/plan/verdict/route.js +1 -1
  79. package/.next/server/app/api/preferences/route.js +1 -1
  80. package/.next/server/app/api/project-meta/route.js +1 -1
  81. package/.next/server/app/api/reset/route.js +1 -1
  82. package/.next/server/app/api/scope-guard/check/route.js +1 -0
  83. package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -0
  84. package/.next/server/app/api/scope-guard/check/route_client-reference-manifest.js +1 -0
  85. package/.next/server/app/api/stream/route.js +2 -2
  86. package/.next/server/app/api/tab/nav/route.js +1 -1
  87. package/.next/server/app/api/tab/presence/route.js +1 -1
  88. package/.next/server/app/api/telemetry/route.js +1 -1
  89. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  90. package/.next/server/app/api/version/route.js +1 -1
  91. package/.next/server/app/api/workspace/activate/route.js +1 -1
  92. package/.next/server/app/api/workspace/route.js +1 -1
  93. package/.next/server/app/apple-icon.png/route.js +1 -1
  94. package/.next/server/app/docs/page.js +2 -2
  95. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  96. package/.next/server/app/docs.html +1 -1
  97. package/.next/server/app/docs.rsc +2 -2
  98. package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  99. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  100. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  101. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  102. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  103. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  104. package/.next/server/app/feedback/page.js +2 -2
  105. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  106. package/.next/server/app/feedback.html +1 -1
  107. package/.next/server/app/feedback.rsc +2 -2
  108. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  109. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  110. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  111. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  112. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  113. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  114. package/.next/server/app/help/page.js +2 -2
  115. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  116. package/.next/server/app/help.html +1 -1
  117. package/.next/server/app/help.rsc +2 -2
  118. package/.next/server/app/help.segments/_full.segment.rsc +2 -2
  119. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  120. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  121. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  122. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  123. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  124. package/.next/server/app/icon.svg/route.js +1 -1
  125. package/.next/server/app/index.html +1 -1
  126. package/.next/server/app/index.rsc +3 -3
  127. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  128. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  129. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  130. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  131. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  132. package/.next/server/app/map/page.js +2 -2
  133. package/.next/server/app/map/page.js.nft.json +1 -1
  134. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  135. package/.next/server/app/page.js +2 -2
  136. package/.next/server/app/page_client-reference-manifest.js +1 -1
  137. package/.next/server/app/plan/page.js +2 -2
  138. package/.next/server/app/plan/page.js.nft.json +1 -1
  139. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  140. package/.next/server/app/settings/page.js +2 -2
  141. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  142. package/.next/server/app-paths-manifest.json +14 -12
  143. package/.next/server/chunks/1341.js +1 -1
  144. package/.next/server/chunks/249.js +1 -1
  145. package/.next/server/chunks/2933.js +1 -1
  146. package/.next/server/chunks/{7208.js → 2999.js} +3 -3
  147. package/.next/server/chunks/3221.js +2 -2
  148. package/.next/server/chunks/3622.js +1 -1
  149. package/.next/server/chunks/4378.js +1 -1
  150. package/.next/server/chunks/4940.js +1 -1
  151. package/.next/server/chunks/7331.js +1 -0
  152. package/.next/server/chunks/9213.js +1 -1
  153. package/.next/server/chunks/9683.js +1 -1
  154. package/.next/server/chunks/9734.js +1 -1
  155. package/.next/server/middleware-build-manifest.js +1 -1
  156. package/.next/server/pages/404.html +1 -1
  157. package/.next/server/pages/500.html +1 -1
  158. package/.next/server/server-reference-manifest.js +1 -1
  159. package/.next/server/server-reference-manifest.json +1 -1
  160. package/.next/static/chunks/3343-af1292b51a276724.js +1 -0
  161. package/.next/static/chunks/7323-480fb88e9d24f9e9.js +1 -0
  162. package/.next/static/chunks/app/_global-error/page-dc3f0f4fd9e88c4e.js +1 -0
  163. package/.next/static/chunks/app/api/board-annotations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  164. package/.next/static/chunks/app/api/board-annotations/route-dc3f0f4fd9e88c4e.js +1 -0
  165. package/.next/static/chunks/app/api/board-layout/route-dc3f0f4fd9e88c4e.js +1 -0
  166. package/.next/static/chunks/app/api/bug-flags/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  167. package/.next/static/chunks/app/api/bug-flags/route-dc3f0f4fd9e88c4e.js +1 -0
  168. package/.next/static/chunks/app/api/code-graph/position/route-dc3f0f4fd9e88c4e.js +1 -0
  169. package/.next/static/chunks/app/api/code-graph/route-dc3f0f4fd9e88c4e.js +1 -0
  170. package/.next/static/chunks/app/api/context/feature/route-dc3f0f4fd9e88c4e.js +1 -0
  171. package/.next/static/chunks/app/api/context/file/route-dc3f0f4fd9e88c4e.js +1 -0
  172. package/.next/static/chunks/app/api/context/route-dc3f0f4fd9e88c4e.js +1 -0
  173. package/.next/static/chunks/app/api/db/arrange/route-dc3f0f4fd9e88c4e.js +1 -0
  174. package/.next/static/chunks/app/api/db/backfill-access/route-dc3f0f4fd9e88c4e.js +1 -0
  175. package/.next/static/chunks/app/api/db/position/route-dc3f0f4fd9e88c4e.js +1 -0
  176. package/.next/static/chunks/app/api/db/prune-planned/route-dc3f0f4fd9e88c4e.js +1 -0
  177. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-dc3f0f4fd9e88c4e.js +1 -0
  178. package/.next/static/chunks/app/api/db/relations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  179. package/.next/static/chunks/app/api/db/tables/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  180. package/.next/static/chunks/app/api/draft/approve/route-dc3f0f4fd9e88c4e.js +1 -0
  181. package/.next/static/chunks/app/api/draft/route-dc3f0f4fd9e88c4e.js +1 -0
  182. package/.next/static/chunks/app/api/draft/status/route-dc3f0f4fd9e88c4e.js +1 -0
  183. package/.next/static/chunks/app/api/edges/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  184. package/.next/static/chunks/app/api/edges/route-dc3f0f4fd9e88c4e.js +1 -0
  185. package/.next/static/chunks/app/api/endpoints/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  186. package/.next/static/chunks/app/api/entities/route-dc3f0f4fd9e88c4e.js +1 -0
  187. package/.next/static/chunks/app/api/feedback/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  188. package/.next/static/chunks/app/api/feedback/[id]/vote/route-dc3f0f4fd9e88c4e.js +1 -0
  189. package/.next/static/chunks/app/api/feedback/route-dc3f0f4fd9e88c4e.js +1 -0
  190. package/.next/static/chunks/app/api/flags/route-dc3f0f4fd9e88c4e.js +1 -0
  191. package/.next/static/chunks/app/api/ingest/route-dc3f0f4fd9e88c4e.js +1 -0
  192. package/.next/static/chunks/app/api/init/route-dc3f0f4fd9e88c4e.js +1 -0
  193. package/.next/static/chunks/app/api/map/describe/route-dc3f0f4fd9e88c4e.js +1 -0
  194. package/.next/static/chunks/app/api/map/files/route-dc3f0f4fd9e88c4e.js +1 -0
  195. package/.next/static/chunks/app/api/map/finish/route-dc3f0f4fd9e88c4e.js +1 -0
  196. package/.next/static/chunks/app/api/map/route-dc3f0f4fd9e88c4e.js +1 -0
  197. package/.next/static/chunks/app/api/map/start/route-dc3f0f4fd9e88c4e.js +1 -0
  198. package/.next/static/chunks/app/api/map/touch-active/route-dc3f0f4fd9e88c4e.js +1 -0
  199. package/.next/static/chunks/app/api/nodes/[id]/position/route-dc3f0f4fd9e88c4e.js +1 -0
  200. package/.next/static/chunks/app/api/nodes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  201. package/.next/static/chunks/app/api/nodes/positions/route-dc3f0f4fd9e88c4e.js +1 -0
  202. package/.next/static/chunks/app/api/nodes/route-dc3f0f4fd9e88c4e.js +1 -0
  203. package/.next/static/chunks/app/api/nodes/subtasks/route-dc3f0f4fd9e88c4e.js +1 -0
  204. package/.next/static/chunks/app/api/notes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
  205. package/.next/static/chunks/app/api/notes/route-dc3f0f4fd9e88c4e.js +1 -0
  206. package/.next/static/chunks/app/api/open/route-dc3f0f4fd9e88c4e.js +1 -0
  207. package/.next/static/chunks/app/api/plan/annotations/route-dc3f0f4fd9e88c4e.js +1 -0
  208. package/.next/static/chunks/app/api/plan/approve/route-dc3f0f4fd9e88c4e.js +1 -0
  209. package/.next/static/chunks/app/api/plan/history/route-dc3f0f4fd9e88c4e.js +1 -0
  210. package/.next/static/chunks/app/api/plan/markdown/route-dc3f0f4fd9e88c4e.js +1 -0
  211. package/.next/static/chunks/app/api/plan/presence/route-dc3f0f4fd9e88c4e.js +1 -0
  212. package/.next/static/chunks/app/api/plan/route-dc3f0f4fd9e88c4e.js +1 -0
  213. package/.next/static/chunks/app/api/plan/verdict/route-dc3f0f4fd9e88c4e.js +1 -0
  214. package/.next/static/chunks/app/api/preferences/route-dc3f0f4fd9e88c4e.js +1 -0
  215. package/.next/static/chunks/app/api/project-meta/route-dc3f0f4fd9e88c4e.js +1 -0
  216. package/.next/static/chunks/app/api/reset/route-dc3f0f4fd9e88c4e.js +1 -0
  217. package/.next/static/chunks/app/api/scope-guard/check/route-dc3f0f4fd9e88c4e.js +1 -0
  218. package/.next/static/chunks/app/api/stream/route-dc3f0f4fd9e88c4e.js +1 -0
  219. package/.next/static/chunks/app/api/tab/nav/route-dc3f0f4fd9e88c4e.js +1 -0
  220. package/.next/static/chunks/app/api/tab/presence/route-dc3f0f4fd9e88c4e.js +1 -0
  221. package/.next/static/chunks/app/api/telemetry/route-dc3f0f4fd9e88c4e.js +1 -0
  222. package/.next/static/chunks/app/api/telemetry/stats/route-dc3f0f4fd9e88c4e.js +1 -0
  223. package/.next/static/chunks/app/api/version/route-dc3f0f4fd9e88c4e.js +1 -0
  224. package/.next/static/chunks/app/api/workspace/activate/route-dc3f0f4fd9e88c4e.js +1 -0
  225. package/.next/static/chunks/app/api/workspace/route-dc3f0f4fd9e88c4e.js +1 -0
  226. package/.next/static/chunks/app/map/page-66d71744ae3363d7.js +1 -0
  227. package/.next/static/chunks/app/page-541e900d67f17dae.js +1 -0
  228. package/.next/static/chunks/app/plan/page-e7d16fa2a3713a92.js +1 -0
  229. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
  230. package/.next/static/chunks/next/dist/client/components/builtin/app-error-dc3f0f4fd9e88c4e.js +1 -0
  231. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc3f0f4fd9e88c4e.js +1 -0
  232. package/.next/static/chunks/next/dist/client/components/builtin/not-found-dc3f0f4fd9e88c4e.js +1 -0
  233. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc3f0f4fd9e88c4e.js +1 -0
  234. package/.next/static/css/629ab377241de9ca.css +1 -0
  235. package/.next/static/qeqVD-yeoYO_3C0pw9kHg/_buildManifest.js +1 -0
  236. package/.next/trace +39 -39
  237. package/.next/trace-build +1 -1
  238. package/.next/types/app/api/flags/route.ts +351 -0
  239. package/.next/types/app/api/scope-guard/check/route.ts +351 -0
  240. package/.next/types/routes.d.ts +3 -1
  241. package/.next/types/validator.ts +18 -0
  242. package/dist/bin/beacon.js +7 -7
  243. package/dist/bin/doctor.js +33 -26
  244. package/dist/bin/guard.js +3 -0
  245. package/dist/bin/hook.js +33 -26
  246. package/dist/bin/mcp.js +42 -35
  247. package/dist/bin/plan.js +34 -27
  248. package/dist/bin/remove.js +7 -6
  249. package/dist/bin/uninstall.js +33 -26
  250. package/dist/lib/assets.js +20 -13
  251. package/dist/lib/codex-install.js +30 -23
  252. package/dist/lib/global-install.js +30 -23
  253. package/dist/lib/telemetry.js +1 -1
  254. package/dist/lib/workspaces.js +1 -1
  255. package/drizzle/0008_good_lucky_pierre.sql +21 -0
  256. package/drizzle/meta/0008_snapshot.json +1904 -0
  257. package/drizzle/meta/_journal.json +7 -0
  258. package/package.json +1 -1
  259. package/public/install.sh +37 -6
  260. package/.next/server/chunks/142.js +0 -1
  261. package/.next/static/OO5fwNXOYFYnu4W91Z44C/_buildManifest.js +0 -1
  262. package/.next/static/chunks/5811-4d1f942c37146b40.js +0 -1
  263. package/.next/static/chunks/8074-a6b2725786399e2c.js +0 -1
  264. package/.next/static/chunks/app/_global-error/page-16ca2ed05a1d74d1.js +0 -1
  265. package/.next/static/chunks/app/api/board-annotations/[id]/route-16ca2ed05a1d74d1.js +0 -1
  266. package/.next/static/chunks/app/api/board-annotations/route-16ca2ed05a1d74d1.js +0 -1
  267. package/.next/static/chunks/app/api/board-layout/route-16ca2ed05a1d74d1.js +0 -1
  268. package/.next/static/chunks/app/api/bug-flags/[id]/route-16ca2ed05a1d74d1.js +0 -1
  269. package/.next/static/chunks/app/api/bug-flags/route-16ca2ed05a1d74d1.js +0 -1
  270. package/.next/static/chunks/app/api/code-graph/position/route-16ca2ed05a1d74d1.js +0 -1
  271. package/.next/static/chunks/app/api/code-graph/route-16ca2ed05a1d74d1.js +0 -1
  272. package/.next/static/chunks/app/api/context/feature/route-16ca2ed05a1d74d1.js +0 -1
  273. package/.next/static/chunks/app/api/context/file/route-16ca2ed05a1d74d1.js +0 -1
  274. package/.next/static/chunks/app/api/context/route-16ca2ed05a1d74d1.js +0 -1
  275. package/.next/static/chunks/app/api/db/arrange/route-16ca2ed05a1d74d1.js +0 -1
  276. package/.next/static/chunks/app/api/db/backfill-access/route-16ca2ed05a1d74d1.js +0 -1
  277. package/.next/static/chunks/app/api/db/position/route-16ca2ed05a1d74d1.js +0 -1
  278. package/.next/static/chunks/app/api/db/prune-planned/route-16ca2ed05a1d74d1.js +0 -1
  279. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-16ca2ed05a1d74d1.js +0 -1
  280. package/.next/static/chunks/app/api/db/relations/[id]/route-16ca2ed05a1d74d1.js +0 -1
  281. package/.next/static/chunks/app/api/db/tables/[id]/route-16ca2ed05a1d74d1.js +0 -1
  282. package/.next/static/chunks/app/api/draft/approve/route-16ca2ed05a1d74d1.js +0 -1
  283. package/.next/static/chunks/app/api/draft/route-16ca2ed05a1d74d1.js +0 -1
  284. package/.next/static/chunks/app/api/draft/status/route-16ca2ed05a1d74d1.js +0 -1
  285. package/.next/static/chunks/app/api/edges/[id]/route-16ca2ed05a1d74d1.js +0 -1
  286. package/.next/static/chunks/app/api/edges/route-16ca2ed05a1d74d1.js +0 -1
  287. package/.next/static/chunks/app/api/endpoints/[id]/route-16ca2ed05a1d74d1.js +0 -1
  288. package/.next/static/chunks/app/api/entities/route-16ca2ed05a1d74d1.js +0 -1
  289. package/.next/static/chunks/app/api/feedback/[id]/route-16ca2ed05a1d74d1.js +0 -1
  290. package/.next/static/chunks/app/api/feedback/[id]/vote/route-16ca2ed05a1d74d1.js +0 -1
  291. package/.next/static/chunks/app/api/feedback/route-16ca2ed05a1d74d1.js +0 -1
  292. package/.next/static/chunks/app/api/ingest/route-16ca2ed05a1d74d1.js +0 -1
  293. package/.next/static/chunks/app/api/init/route-16ca2ed05a1d74d1.js +0 -1
  294. package/.next/static/chunks/app/api/map/describe/route-16ca2ed05a1d74d1.js +0 -1
  295. package/.next/static/chunks/app/api/map/files/route-16ca2ed05a1d74d1.js +0 -1
  296. package/.next/static/chunks/app/api/map/finish/route-16ca2ed05a1d74d1.js +0 -1
  297. package/.next/static/chunks/app/api/map/route-16ca2ed05a1d74d1.js +0 -1
  298. package/.next/static/chunks/app/api/map/start/route-16ca2ed05a1d74d1.js +0 -1
  299. package/.next/static/chunks/app/api/map/touch-active/route-16ca2ed05a1d74d1.js +0 -1
  300. package/.next/static/chunks/app/api/nodes/[id]/position/route-16ca2ed05a1d74d1.js +0 -1
  301. package/.next/static/chunks/app/api/nodes/[id]/route-16ca2ed05a1d74d1.js +0 -1
  302. package/.next/static/chunks/app/api/nodes/positions/route-16ca2ed05a1d74d1.js +0 -1
  303. package/.next/static/chunks/app/api/nodes/route-16ca2ed05a1d74d1.js +0 -1
  304. package/.next/static/chunks/app/api/nodes/subtasks/route-16ca2ed05a1d74d1.js +0 -1
  305. package/.next/static/chunks/app/api/notes/[id]/route-16ca2ed05a1d74d1.js +0 -1
  306. package/.next/static/chunks/app/api/notes/route-16ca2ed05a1d74d1.js +0 -1
  307. package/.next/static/chunks/app/api/open/route-16ca2ed05a1d74d1.js +0 -1
  308. package/.next/static/chunks/app/api/plan/annotations/route-16ca2ed05a1d74d1.js +0 -1
  309. package/.next/static/chunks/app/api/plan/approve/route-16ca2ed05a1d74d1.js +0 -1
  310. package/.next/static/chunks/app/api/plan/history/route-16ca2ed05a1d74d1.js +0 -1
  311. package/.next/static/chunks/app/api/plan/markdown/route-16ca2ed05a1d74d1.js +0 -1
  312. package/.next/static/chunks/app/api/plan/presence/route-16ca2ed05a1d74d1.js +0 -1
  313. package/.next/static/chunks/app/api/plan/route-16ca2ed05a1d74d1.js +0 -1
  314. package/.next/static/chunks/app/api/plan/verdict/route-16ca2ed05a1d74d1.js +0 -1
  315. package/.next/static/chunks/app/api/preferences/route-16ca2ed05a1d74d1.js +0 -1
  316. package/.next/static/chunks/app/api/project-meta/route-16ca2ed05a1d74d1.js +0 -1
  317. package/.next/static/chunks/app/api/reset/route-16ca2ed05a1d74d1.js +0 -1
  318. package/.next/static/chunks/app/api/stream/route-16ca2ed05a1d74d1.js +0 -1
  319. package/.next/static/chunks/app/api/tab/nav/route-16ca2ed05a1d74d1.js +0 -1
  320. package/.next/static/chunks/app/api/tab/presence/route-16ca2ed05a1d74d1.js +0 -1
  321. package/.next/static/chunks/app/api/telemetry/route-16ca2ed05a1d74d1.js +0 -1
  322. package/.next/static/chunks/app/api/telemetry/stats/route-16ca2ed05a1d74d1.js +0 -1
  323. package/.next/static/chunks/app/api/version/route-16ca2ed05a1d74d1.js +0 -1
  324. package/.next/static/chunks/app/api/workspace/activate/route-16ca2ed05a1d74d1.js +0 -1
  325. package/.next/static/chunks/app/api/workspace/route-16ca2ed05a1d74d1.js +0 -1
  326. package/.next/static/chunks/app/map/page-a0bcd15b8dbfb3d3.js +0 -1
  327. package/.next/static/chunks/app/page-968dd5a6f667bff9.js +0 -1
  328. package/.next/static/chunks/app/plan/page-376f36858e187c73.js +0 -1
  329. package/.next/static/chunks/app/settings/page-67cab634be8bfef2.js +0 -1
  330. package/.next/static/chunks/next/dist/client/components/builtin/app-error-16ca2ed05a1d74d1.js +0 -1
  331. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-16ca2ed05a1d74d1.js +0 -1
  332. package/.next/static/chunks/next/dist/client/components/builtin/not-found-16ca2ed05a1d74d1.js +0 -1
  333. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-16ca2ed05a1d74d1.js +0 -1
  334. package/.next/static/css/2d019ca6e0582481.css +0 -1
  335. /package/.next/static/{OO5fwNXOYFYnu4W91Z44C → qeqVD-yeoYO_3C0pw9kHg}/_ssgManifest.js +0 -0
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var fZ=Object.defineProperty;var TZ=(Q)=>Q;function wZ(Q,Z){this[Q]=TZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)fZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var xQ={};WQ(xQ,{removeRepoAssets:()=>jQ,installRefreshSkill:()=>FZ,installPlanSkill:()=>RZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>IZ,ensureWorkflowDoc:()=>bZ,ensureMcp:()=>OZ,auditRepo:()=>AZ,REFRESH_SKILL:()=>HQ,PLAN_SKILL:()=>mQ,INIT_SKILL:()=>PQ});import{existsSync as M,mkdirSync as L,readFileSync as x,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,PQ),$}function FZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,HQ),$}function RZ(Q){let Z=q(Q,".claude","skills","beacon-plan");L(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,mQ),$}function IZ(Q){let Z=[];for(let $ of EZ){let J=q(Q,".agents","skills",$.name);L(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function bZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${k}[\\s\\S]*?${BQ}`);$=J.test($)?$.replace(J,hQ):`${$.trim()}
3
+ var wZ=Object.defineProperty;var FZ=(Q)=>Q;function RZ(Q,Z){this[Q]=FZ.bind(null,Z)}var PQ=(Q,Z)=>{for(var $ in Z)wZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:RZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var A0=1500,O0=480000,y0=1800000,L=3600000,L0=3000;var mQ=()=>{};var NQ={};PQ(NQ,{removeRepoAssets:()=>xQ,installRefreshSkill:()=>IZ,installPlanSkill:()=>EZ,installInitSkill:()=>gZ,installCodexRepoSkills:()=>DZ,ensureWorkflowDoc:()=>AZ,ensureMcp:()=>OZ,auditRepo:()=>yZ,REFRESH_SKILL:()=>BQ,PLAN_SKILL:()=>cQ,INIT_SKILL:()=>jQ});import{existsSync as M,mkdirSync as k,readFileSync as v,rmSync as _,writeFileSync as H}from"fs";import{join as q}from"path";function gZ(Q){let Z=q(Q,".claude","skills","beacon-init");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,jQ),$}function IZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,BQ),$}function EZ(Q){let Z=q(Q,".claude","skills","beacon-plan");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return H($,cQ),$}function DZ(Q){let Z=[];for(let $ of bZ){let J=q(Q,".agents","skills",$.name);k(J,{recursive:!0});let Y=q(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function AZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=v(Z,"utf8")}catch{}let J=new RegExp(`${S}[\\s\\S]*?${vQ}`);$=J.test($)?$.replace(J,pQ):`${$.trim()}
4
4
 
5
- ${hQ}
5
+ ${pQ}
6
6
  `.trimStart(),H(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
- `);let Y=q(Q,"CLAUDE.md"),V="";try{V=x(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
8
+ `);let Y=q(Q,"CLAUDE.md"),V="";try{V=v(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},H(Z,JSON.stringify($,null,2)+`
12
- `),{path:Z,added:!0}}function AZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(k)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function jQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=q(Q,".claude","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=q(Q,".agents","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(x(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)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
13
- `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),W=new RegExp(`\\n?${k}[\\s\\S]*?${BQ}\\n?`);if(W.test(z)){let UQ=z.replace(W,`
11
+ `)}function OZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(v(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<L)return J.timeout=L,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:L},H(Z,JSON.stringify($,null,2)+`
13
+ `),{path:Z,added:!0,updated:!1}}function yZ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(v(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=v(q(Q,"AGENTS.md"),"utf8").includes(S)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(v(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":M(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function xQ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=q(Q,".claude","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=q(Q,".agents","skills",z);if(M(W))_(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(v(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)_(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=v(V,"utf8"),W=new RegExp(`\\n?${S}[\\s\\S]*?${vQ}\\n?`);if(W.test(z)){let HQ=z.replace(W,`
14
15
  `).replace(/\n{3,}/g,`
15
16
 
16
- `).trimStart();H(V,UQ.endsWith(`
17
- `)?UQ:`${UQ}
18
- `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())_(U,{force:!0});else H(U,W);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var PQ=`---
17
+ `).trimStart();H(V,HQ.endsWith(`
18
+ `)?HQ:`${HQ}
19
+ `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=v(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())_(U,{force:!0});else H(U,W);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var jQ=`---
19
20
  name: beacon-init
20
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.
21
22
  ---
@@ -54,7 +55,7 @@ A single \`beacon_init_persist\` MCP tool call with:
54
55
  If \`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-init.
55
56
 
56
57
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
57
- `,HQ=`---
58
+ `,BQ=`---
58
59
  name: beacon-refresh
59
60
  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.
60
61
  ---
@@ -101,7 +102,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
101
102
  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.
102
103
 
103
104
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
104
- `,mQ=`---
105
+ `,cQ=`---
105
106
  name: beacon-plan
106
107
  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.
107
108
  ---
@@ -129,6 +130,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
129
130
  board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
130
131
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
131
132
 
133
+ - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
134
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
135
+ has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
136
+ implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
137
+ to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
138
+
132
139
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
133
140
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
134
141
  If it returns feedback, revise and call it again.
@@ -143,7 +150,7 @@ If it returns feedback, revise and call it again.
143
150
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
144
151
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
145
152
  run \`beacon\` in this repo once.
146
- `,EZ,k="<!-- beacon:workflow:start -->",BQ="<!-- beacon:workflow:end -->",hQ;var S=g(()=>{EZ=[{name:"beacon-init",body:()=>PQ},{name:"beacon-refresh",body:()=>HQ}];hQ=`${k}
153
+ `,bZ,S="<!-- beacon:workflow:start -->",vQ="<!-- beacon:workflow:end -->",pQ;var h=C(()=>{mQ();bZ=[{name:"beacon-init",body:()=>jQ},{name:"beacon-refresh",body:()=>BQ}];pQ=`${S}
147
154
  ## Beacon \u2014 feature workflow
148
155
 
149
156
  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:
@@ -201,18 +208,18 @@ Register them all in that single batched call. If a plan added five features, th
201
208
  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.
202
209
 
203
210
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
204
- ${BQ}`});import{existsSync as pQ,mkdirSync as vQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as cQ,join as h}from"path";function NQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){vQ(cQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
205
- `)}function l(Q,Z){let $=NQ(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((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function n(Q,Z){return(NQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function t(Q,Z){let $=NQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.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 lQ(Q,$),!0}function d(Q,Z,$,J){let Y=`${Z}
211
+ ${vQ}`});import{existsSync as lQ,mkdirSync as GQ,readFileSync as p,rmSync as LZ,writeFileSync as c}from"fs";import{dirname as nQ,join as m}from"path";function uQ(Q){try{return JSON.parse(p(Q,"utf8"))}catch{return{}}}function tQ(Q,Z){GQ(nQ(Q),{recursive:!0}),c(Q,JSON.stringify(Z,null,2)+`
212
+ `)}function n(Q,Z){let $=uQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),tQ(Q,$),!0}function t(Q,Z){return(uQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function d(Q,Z){let $=uQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.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 tQ(Q,$),!0}function a(Q,Z,$,J){let Y=`${Z}
206
213
  ${J.trim()}
207
- ${$}`,V="";try{V=m(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
214
+ ${$}`,V="";try{V=p(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
208
215
 
209
216
  ${Y}
210
217
  `:`${Y}
211
- `,vQ(cQ(Q),{recursive:!0}),p(Q,V.endsWith(`
218
+ `,GQ(nQ(Q),{recursive:!0}),c(Q,V.endsWith(`
212
219
  `)?V:`${V}
213
- `)}function F(Q,Z){try{return m(Q,"utf8").includes(Z)}catch{return!1}}function a(Q,Z,$){let J="";try{J=m(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,`
220
+ `)}function R(Q,Z){try{return p(Q,"utf8").includes(Z)}catch{return!1}}function s(Q,Z,$){let J="";try{J=p(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,`
214
221
 
215
- `).trimStart();return p(Q,V),!0}function s(Q,Z,$){let J=h(Q,Z);vQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function R(Q,Z){return pQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!pQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var P,c=`## Beacon (visual planning panel)
222
+ `).trimStart();return c(Q,V),!0}function r(Q,Z,$){let J=m(Q,Z);GQ(J,{recursive:!0});let Y=m(J,"SKILL.md");return c(Y,$),Y}function g(Q,Z){return lQ(m(Q,Z,"SKILL.md"))}function o(Q,Z){let $=m(Q,Z);if(!lQ($))return!1;return LZ($,{recursive:!0,force:!0}),!0}var P,l=`## Beacon (visual planning panel)
216
223
 
217
224
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
218
225
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -233,20 +240,20 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
233
240
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
234
241
  on the /map and /db boards (added features, attached subtasks, edited columns, new
235
242
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
236
- verbatim. Do NOT implement until the tool returns approval.`;var uQ=g(()=>{P=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as yZ,renameSync as _Z,rmSync as LZ,writeFileSync as kZ}from"fs";import{dirname as SZ}from"path";function o(Q,Z){yZ(SZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{kZ($,Z),_Z($,Q)}catch(J){throw LZ($,{force:!0}),J}}function L0(Q,Z,$=!1){o(Q,JSON.stringify(Z,null,$?2:void 0))}var nQ=()=>{};var eQ={};WQ(eQ,{setupCodexAssets:()=>cZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>TQ,hasCodexMcp:()=>MQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>pZ,codexDetected:()=>aQ,auditCodex:()=>fQ,CODEX_HOOKS:()=>T});import{readFileSync as ZQ}from"fs";import{homedir as hZ}from"os";import{join as b}from"path";function tQ(){return process.env.HOME||process.env.USERPROFILE||hZ()}function aQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(GQ===void 0)GQ=Bun.which("codex")!==null;return GQ}function I(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function MQ(){try{return Boolean(I(ZQ(f(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function pZ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return null}let Z=I(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${E}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${E}`;return null}function oQ(){let Q="",Z=!1;try{Q=ZQ(f(),"utf8"),Z=!0}catch{}if(Z){let V=I(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${E}`};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 ${E}`}}let $=!Q?"":Q.endsWith(`
243
+ verbatim. Do NOT implement until the tool returns approval.`;var KQ=C(()=>{P=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as _Z,renameSync as kZ,rmSync as SZ,writeFileSync as hZ}from"fs";import{dirname as mZ}from"path";function i(Q,Z){_Z(mZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{hZ($,Z),kZ($,Q)}catch(J){throw SZ($,{force:!0}),J}}function t0(Q,Z,$=!1){i(Q,JSON.stringify(Z,null,$?2:void 0))}var dQ=()=>{};var ZZ={};PQ(ZZ,{setupCodexAssets:()=>nZ,removeCodexMcp:()=>QZ,removeCodexArtifacts:()=>FQ,hasCodexMcp:()=>TQ,ensureCodexMcp:()=>eQ,codexMcpProblem:()=>lZ,codexDetected:()=>rQ,auditCodex:()=>wQ,CODEX_HOOKS:()=>w});import{readFileSync as $Q}from"fs";import{homedir as pZ}from"os";import{join as b}from"path";function aQ(){return process.env.HOME||process.env.USERPROFILE||pZ()}function rQ(){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 E(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function TQ(){try{return Boolean(E($Q(T(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function lZ(){let Q="";try{Q=$Q(T(),"utf8")}catch{return null}let Z=E(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${I}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${I}`;return null}function eQ(){let Q="",Z=!1;try{Q=$Q(T(),"utf8"),Z=!0}catch{}if(Z){let V=E(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${I}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${I}`}}let $=!Q?"":Q.endsWith(`
237
244
  `)?`
238
245
  `:`
239
246
 
240
- `,J=Q+$+mZ;if(I(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${E}`};return o(f(),J),{added:!0}}function iQ(){let Q="";try{Q=ZQ(f(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
241
- `),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:MQ()};let J=Z.indexOf(rQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
247
+ `,J=Q+$+cZ;if(E(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return i(T(),J),{added:!0}}function QZ(){let Q="";try{Q=$Q(T(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
248
+ `),$=Z.indexOf(oQ);if($===-1)return{removed:!1,skipped:TQ()};let J=Z.indexOf(iQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
242
249
  `).replace(/\n{3,}/g,`
243
250
 
244
- `).replace(/^\n+/,"");if(I(Y)===null)return{removed:!1,skipped:!0};return o(f(),Y),{removed:!0}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),xQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of P){if(!R(e(),z))Y.push(z);s(e(),z,J[z])}let V=0;for(let z of T)if(l(CQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=F(i(),QQ);d(i(),QQ,dQ,c);let U=oQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function fQ(){let Q={};for(let $ of P)Q[$]=R(e(),$);let Z={};for(let $ of T)Z[$.event]=n(CQ(),{event:$.event,command:$.command});return{detected:aQ(),skills:Q,hooks:Z,agentsMdBlock:F(i(),QQ),mcp:MQ()}}function TQ(){let Q=[];for(let Y of P)if(r(e(),Y))Q.push(Y);let Z=0;for(let Y of T)if(t(CQ(),{event:Y.event,command:Y.command}))Z++;let $=a(i(),QQ,dQ),J=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var KQ=()=>b(tQ(),".codex"),CQ=()=>b(KQ(),"hooks.json"),f=()=>b(KQ(),"config.toml"),i=()=>b(KQ(),"AGENTS.md"),e=()=>b(tQ(),".agents","skills"),QQ="<!-- beacon:global:start -->",dQ="<!-- beacon:global:end -->",T,GQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",mZ,E="add it manually: codex mcp add beacon -- beacon mcp";var wQ=g(()=>{uQ();nQ();T=[{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."}];mZ=`${sQ}
251
+ `).replace(/^\n+/,"");if(E(Y)===null)return{removed:!1,skipped:!0};return i(T(),Y),{removed:!0}}async function nZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),NQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of P){if(!g(QQ(),z))Y.push(z);r(QQ(),z,J[z])}let V=0;for(let z of w)if(n(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=R(e(),ZQ);a(e(),ZQ,sQ,l);let U=eQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function wQ(){let Q={};for(let $ of P)Q[$]=g(QQ(),$);let Z={};for(let $ of w)Z[$.event]=t(MQ(),{event:$.event,command:$.command});return{detected:rQ(),skills:Q,hooks:Z,agentsMdBlock:R(e(),ZQ),mcp:TQ()}}function FQ(){let Q=[];for(let Y of P)if(o(QQ(),Y))Q.push(Y);let Z=0;for(let Y of w)if(d(MQ(),{event:Y.event,command:Y.command}))Z++;let $=s(e(),ZQ,sQ),J=QZ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>b(aQ(),".codex"),MQ=()=>b(CQ(),"hooks.json"),T=()=>b(CQ(),"config.toml"),e=()=>b(CQ(),"AGENTS.md"),QQ=()=>b(aQ(),".agents","skills"),ZQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->",w,fQ,oQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",iQ="# beacon:end",cZ,I="add it manually: codex mcp add beacon -- beacon mcp";var RQ=C(()=>{KQ();dQ();w=[{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."}];cZ=`${oQ}
245
252
  [mcp_servers.beacon]
246
253
  command = "beacon"
247
254
  args = ["mcp"]
248
- ${rQ}
249
- `});var zZ={};WQ(zZ,{provisionDb:()=>B0});import{createClient as $0}from"@libsql/client";import{drizzle as J0}from"drizzle-orm/libsql";import{migrate as Y0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as V0}from"drizzle-orm/migrator";import{dirname as IQ,join as z0}from"path";import{fileURLToPath as q0}from"url";async function YQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function P0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function VZ(Q){if(!await YQ(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 H0(Q){for(let[Z,$]of Object.entries(W0)){if(!await YQ(Q,Z))continue;let J=await P0(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 B0(Q,Z=U0){let $=$0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await YQ($,"__drizzle_migrations"),Y=await YQ($,"Node"),V=!1;if(Y&&!J){let U=V0({migrationsFolder:Z})[0];if(U)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:[U.hash,U.folderMillis]}),V=!0}let X=await VZ($);if(await Y0(J0($),{migrationsFolder:Z}),await VZ($)>X)V=!0;return await H0($),{migrated:V}}finally{$.close()}}var X0,U0,W0;var qZ=g(async()=>{X0=IQ(IQ(IQ(q0(import.meta.url)))),U0=process.env.BEACON_MIGRATIONS_DIR||z0(X0,"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"]}});uQ();import{existsSync as lZ}from"fs";import{homedir as nZ}from"os";import{join as $Q}from"path";function tZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var JQ=()=>$Q(tZ(),".claude"),gQ=()=>$Q(JQ(),"skills"),FQ=()=>$Q(JQ(),"settings.json"),RQ=()=>$Q(JQ(),"CLAUDE.md"),EQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var dZ=c,O=[{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 aZ(Q,Z){return s(gQ(),Q,Z)}function ZZ(Q){return R(gQ(),Q)}function sZ(Q){return r(gQ(),Q)}function rZ(Q){return l(FQ(),Q)}function oZ(Q){return n(FQ(),Q)}function iZ(Q){return t(FQ(),Q)}function eZ(Q){d(RQ(),EQ,QZ,Q)}function $Z(){return F(RQ(),EQ)}function Q0(){return a(RQ(),EQ,QZ)}function JZ(){let Q={};for(let $ of P)Q[$]=ZZ($);let Z={};for(let $ of O)Z[$.event]=oZ({event:$.event,command:$.command});return{homeExists:lZ(JQ()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function Z0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),xQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of P){if(!ZZ(U))Y.push(U);aZ(U,J[U])}let V=0;for(let U of O)if(rZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=$Z();return eZ(dZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function a0(){let Q;try{Q={ok:!0,...await Z0()}}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(() => (wQ(),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 YZ(){let Q=[];for(let J of P)if(sZ(J))Q.push(J);let Z=0;for(let J of O)if(iZ(J))Z++;let $=Q0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as j0}from"async_hooks";import{spawnSync as x0}from"child_process";import{createHash as v0}from"crypto";import{existsSync as UZ,mkdirSync as A,readFileSync as OQ,writeFileSync as AQ}from"fs";import{homedir as WZ}from"os";import{basename as N0,join as N,parse as u0,resolve as XZ}from"path";function v(){return process.env.BEACON_HOME||N(WZ(),".beacon")}function DQ(){return N(v(),"workspaces.json")}function VQ(Q){return v0("sha256").update(Q).digest("hex").slice(0,12)}function X1(Q=process.cwd()){let Z=x0("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 PZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==u0(Z).root}function HZ(){return N(v(),"deleted.json")}function yQ(){try{let Q=JSON.parse(OQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(v(),{recursive:!0}),AQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return yQ().includes(Q)}function U1(Q){let Z=yQ();if(!Z.includes(Q))BZ([...Z,Q])}function G0(Q){let Z=yQ();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function zQ(Q){return N(v(),Q)}function K0(Q){return`file:${N(zQ(Q),"db.sqlite")}`}function D(){try{let Q=JSON.parse(OQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function _Q(Q){A(v(),{recursive:!0}),AQ(DQ(),JSON.stringify(Q,null,2))}function LQ(){return D().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return D().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!PZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=VQ(Q);if(jZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=D(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||N0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(zQ(J),{recursive:!0}),_Q(U),X}function W1(Q,Z){return G0(VQ(Q)),xZ(Q,Z)}function P1(Q,Z=new Date().toISOString()){let $=D(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,_Q($)}function H1(Q){if(_Q(D().filter((Z)=>Z.id!==Q)),kQ()===Q)C0(LQ()[0]?.id??null)}function vZ(){return N(v(),"active")}function kQ(){try{return OQ(vZ(),"utf8").trim()||null}catch{return null}}function C0(Q){A(v(),{recursive:!0}),AQ(vZ(),Q??"")}function B1(){let Q=kQ();return Q?G(Q):null}function j1(){let Q=f0()??kQ();return Q?G(Q):null}function x1(Q){return G(Q)?.path??null}function v1(){return UZ(DQ())}var NZ="beacon_ws";function uZ(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 N1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=uZ(Q,NZ);if($&&G($))return $;return null}var M0="x-beacon-workspace-path";async function u1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(M0);if($&&PZ($)&&!jZ(VQ($))&&(!Z||VQ($)===Z)){let Y=xZ($);return await T0(Y.id),Y.id}let J=uZ(Q,NZ);if(J&&G(J))return J;return null}var GZ=new j0;function G1(Q,Z){return Q?GZ.run(Q,Z):Z()}function f0(){return GZ.getStore()??null}var bQ=new Set;function K1(Q){bQ.delete(N(zQ(Q),"db.sqlite"))}async function T0(Q){let Z=zQ(Q),$=N(Z,"db.sqlite"),J=UZ($);if(J&&bQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await qZ().then(() => zZ),V=await Y(K0(Q));return bQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}S();wQ();import{existsSync as qQ,readFileSync as w0,rmSync as g0}from"fs";import{join as F0}from"path";var KZ=process.argv.slice(3),CZ=KZ.includes("--yes")||KZ.includes("-y"),j=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,B=(Q)=>`\x1B[2m${Q}\x1B[0m`,C=(Q)=>`
250
- \x1B[1m${Q}\x1B[0m`,MZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=v(),y=LQ(),SQ=JZ();console.log(C(CZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(C("Global"));console.log(` ${qQ(K)?`wipe ${K} (${y.length} workspaces)`:`${B(`${K} \u2014 already gone`)}`}`);for(let Q of P)console.log(` ${SQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of O)console.log(` ${SQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${SQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":B("global CLAUDE.md block \u2014 already gone")}`);var XQ=fQ();console.log(C("Codex"));for(let Q of P)console.log(` ${XQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:B(`skill ${Q} \u2014 already gone`)}`);for(let Q of T)console.log(` ${XQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command} from ~/.codex/hooks.json`:B(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${XQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":B("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${XQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":B("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(C(`Per-repo (${y.length})`));for(let Q of y){if(!qQ(Q.path)){console.log(` ${B(`${Q.path} \u2014 repo no longer on disk, skipping`)}`);continue}console.log(` ${Q.path}`),console.log(` ${B("strip beacon entry from .mcp.json, workflow block from AGENTS.md, skills, CLAUDE.md @-import")}`)}}if(!CZ)console.log(C("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.
251
- `),process.exit(0);console.log(C("Applying\u2026"));var w=YZ();if(w.skillsRemoved.length)console.log(` ${j(`removed skills: ${w.skillsRemoved.join(", ")}`)}`);if(w.hooksRemoved)console.log(` ${j(`removed ${w.hooksRemoved} hook${w.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(w.claudeMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var u=TQ();if(u.skillsRemoved.length)console.log(` ${j(`removed ~/.agents/skills: ${u.skillsRemoved.join(", ")}`)}`);if(u.hooksRemoved)console.log(` ${j(`removed ${u.hooksRemoved} hook${u.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(u.agentsMdBlockRemoved)console.log(` ${j("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(u.mcpRemoved)console.log(` ${j("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(u.mcpSkipped)console.log(` ${MZ("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 y){if(!qQ(Q.path))continue;let Z=jQ(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(` ${j(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var R0=F0(K,"server.json");try{let{pid:Q}=JSON.parse(w0(R0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${j(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(qQ(K))g0(K,{recursive:!0,force:!0}),console.log(` ${j(`removed ${K}`)}`);console.log(C("Done."));console.log(` ${MZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
255
+ ${iQ}
256
+ `});var XZ={};PQ(XZ,{provisionDb:()=>v0});import{createClient as Y0}from"@libsql/client";import{drizzle as V0}from"drizzle-orm/libsql";import{migrate as z0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as q0}from"drizzle-orm/migrator";import{dirname as DQ,join as X0}from"path";import{fileURLToPath as U0}from"url";async function VQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function j0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function qZ(Q){if(!await VQ(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 B0(Q){for(let[Z,$]of Object.entries(P0)){if(!await VQ(Q,Z))continue;let J=await j0(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 v0(Q,Z=H0){let $=Y0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await VQ($,"__drizzle_migrations"),Y=await VQ($,"Node"),V=!1;if(Y&&!J){let U=q0({migrationsFolder:Z})[0];if(U)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:[U.hash,U.folderMillis]}),V=!0}let X=await qZ($);if(await z0(V0($),{migrationsFolder:Z}),await qZ($)>X)V=!0;return await B0($),{migrated:V}}finally{$.close()}}var W0,H0,P0;var UZ=C(async()=>{W0=DQ(DQ(DQ(U0(import.meta.url)))),H0=process.env.BEACON_MIGRATIONS_DIR||X0(W0,"drizzle"),P0={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 tZ}from"fs";import{homedir as dZ}from"os";import{join as JQ}from"path";function aZ(){return process.env.HOME||process.env.USERPROFILE||dZ()}var YQ=()=>JQ(aZ(),".claude"),gQ=()=>JQ(YQ(),"skills"),IQ=()=>JQ(YQ(),"settings.json"),EQ=()=>JQ(YQ(),"CLAUDE.md"),bQ="<!-- beacon:global:start -->",$Z="<!-- beacon:global:end -->";var sZ=l,D=[{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 rZ(Q,Z){return r(gQ(),Q,Z)}function JZ(Q){return g(gQ(),Q)}function oZ(Q){return o(gQ(),Q)}function iZ(Q){return n(IQ(),Q)}function eZ(Q){return t(IQ(),Q)}function Q0(Q){return d(IQ(),Q)}function Z0(Q){a(EQ(),bQ,$Z,Q)}function YZ(){return R(EQ(),bQ)}function $0(){return s(EQ(),bQ,$Z)}function VZ(){let Q={};for(let $ of P)Q[$]=JZ($);let Z={};for(let $ of D)Z[$.event]=eZ({event:$.event,command:$.command});return{homeExists:tZ(YQ()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function J0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),NQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of P){if(!JZ(U))Y.push(U);rZ(U,J[U])}let V=0;for(let U of D)if(iZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=YZ();return Z0(sZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function J1(){let Q;try{Q={ok:!0,...await J0()}}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(() => (RQ(),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 zZ(){let Q=[];for(let J of P)if(oZ(J))Q.push(J);let Z=0;for(let J of D)if(Q0(J))Z++;let $=$0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as x0}from"async_hooks";import{spawnSync as N0}from"child_process";import{createHash as G0}from"crypto";import{existsSync as HZ,mkdirSync as A,readFileSync as OQ,writeFileSync as yQ}from"fs";import{homedir as PZ}from"os";import{basename as u0,join as N,parse as K0,resolve as WZ}from"path";function x(){return process.env.BEACON_HOME||N(PZ(),".beacon")}function LQ(){return N(x(),"workspaces.json")}function zQ(Q){return G0("sha256").update(Q).digest("hex").slice(0,12)}function N1(Q=process.cwd()){let Z=N0("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 jZ(Q){let Z=WZ(Q);return Z!==WZ(PZ())&&Z!==K0(Z).root}function BZ(){return N(x(),"deleted.json")}function _Q(){try{let Q=JSON.parse(OQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function vZ(Q){A(x(),{recursive:!0}),yQ(BZ(),JSON.stringify(Q,null,2))}function xZ(Q){return _Q().includes(Q)}function G1(Q){let Z=_Q();if(!Z.includes(Q))vZ([...Z,Q])}function f0(Q){let Z=_Q();if(Z.includes(Q))vZ(Z.filter(($)=>$!==Q))}function qQ(Q){return N(x(),Q)}function C0(Q){return`file:${N(qQ(Q),"db.sqlite")}`}function O(){try{let Q=JSON.parse(OQ(LQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function kQ(Q){A(x(),{recursive:!0}),yQ(LQ(),JSON.stringify(Q,null,2))}function XQ(){return O().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function u(Q){return O().find((Z)=>Z.id===Q)??null}function NZ(Q,Z,$=new Date().toISOString()){if(!jZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=zQ(Q);if(xZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=O(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||u0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(qQ(J),{recursive:!0}),kQ(U),X}function u1(Q,Z){return f0(zQ(Q)),NZ(Q,Z)}function K1(Q,Z=new Date().toISOString()){let $=O(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,kQ($)}function f1(Q){if(kQ(O().filter((Z)=>Z.id!==Q)),SQ()===Q)M0(XQ()[0]?.id??null)}function GZ(){return N(x(),"active")}function SQ(){try{return OQ(GZ(),"utf8").trim()||null}catch{return null}}function M0(Q){A(x(),{recursive:!0}),yQ(GZ(),Q??"")}function C1(){let Q=SQ();return Q?u(Q):null}function M1(){let Q=F0()??SQ();return Q?u(Q):null}function T1(Q){return u(Q)?.path??null}function w1(){return HZ(LQ())}var uZ="beacon_ws";function KZ(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 F1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=KZ(Q,uZ);if($&&u($))return $;return T0()}function T0(){let Q=XQ();return Q.length===1?Q[0].id:null}var w0="x-beacon-workspace-path";async function R1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&u(Z))return Z;let $=Q.headers.get(w0);if($&&jZ($)&&!xZ(zQ($))&&(!Z||zQ($)===Z)){let Y=NZ($);return await R0(Y.id),Y.id}let J=KZ(Q,uZ);if(J&&u(J))return J;return null}var fZ=new x0;function g1(Q,Z){return Q?fZ.run(Q,Z):Z()}function F0(){return fZ.getStore()??null}var AQ=new Set;function I1(Q){AQ.delete(N(qQ(Q),"db.sqlite"))}async function R0(Q){let Z=qQ(Q),$=N(Z,"db.sqlite"),J=HZ($);if(J&&AQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await UZ().then(() => XZ),V=await Y(C0(Q));return AQ.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)}}}h();RQ();import{existsSync as UQ,readFileSync as g0,rmSync as I0}from"fs";import{join as E0}from"path";var CZ=process.argv.slice(3),MZ=CZ.includes("--yes")||CZ.includes("-y"),B=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,j=(Q)=>`\x1B[2m${Q}\x1B[0m`,f=(Q)=>`
257
+ \x1B[1m${Q}\x1B[0m`,TZ=(Q)=>`\x1B[33m!\x1B[0m ${Q}`,K=x(),y=XQ(),hQ=VZ();console.log(f(MZ?"Beacon \xB7 uninstall":"Beacon \xB7 uninstall (dry run)"));console.log(f("Global"));console.log(` ${UQ(K)?`wipe ${K} (${y.length} workspaces)`:`${j(`${K} \u2014 already gone`)}`}`);for(let Q of P)console.log(` ${hQ.skills[Q]?`remove ~/.claude/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of D)console.log(` ${hQ.hooks[Q.event]?`remove hook ${Q.event} \u2192 ${Q.command}`:j(`hook ${Q.event} \u2192 ${Q.command} \u2014 already gone`)}`);console.log(` ${hQ.claudeMdBlock?"strip Beacon block from ~/.claude/CLAUDE.md":j("global CLAUDE.md block \u2014 already gone")}`);var WQ=wQ();console.log(f("Codex"));for(let Q of P)console.log(` ${WQ.skills[Q]?`remove ~/.agents/skills/${Q}/`:j(`skill ${Q} \u2014 already gone`)}`);for(let Q of w)console.log(` ${WQ.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(` ${WQ.agentsMdBlock?"strip Beacon block from ~/.codex/AGENTS.md":j("global ~/.codex/AGENTS.md block \u2014 already gone")}`);console.log(` ${WQ.mcp?"strip [mcp_servers.beacon] from ~/.codex/config.toml (if Beacon wrote it)":j("config.toml beacon entry \u2014 already gone")}`);if(y.length){console.log(f(`Per-repo (${y.length})`));for(let Q of y){if(!UQ(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(!MZ)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.
258
+ `),process.exit(0);console.log(f("Applying\u2026"));var F=zZ();if(F.skillsRemoved.length)console.log(` ${B(`removed skills: ${F.skillsRemoved.join(", ")}`)}`);if(F.hooksRemoved)console.log(` ${B(`removed ${F.hooksRemoved} hook${F.hooksRemoved===1?"":"s"} from ~/.claude/settings.json`)}`);if(F.claudeMdBlockRemoved)console.log(` ${B("stripped Beacon block from ~/.claude/CLAUDE.md")}`);var G=FQ();if(G.skillsRemoved.length)console.log(` ${B(`removed ~/.agents/skills: ${G.skillsRemoved.join(", ")}`)}`);if(G.hooksRemoved)console.log(` ${B(`removed ${G.hooksRemoved} hook${G.hooksRemoved===1?"":"s"} from ~/.codex/hooks.json`)}`);if(G.agentsMdBlockRemoved)console.log(` ${B("stripped Beacon block from ~/.codex/AGENTS.md")}`);if(G.mcpRemoved)console.log(` ${B("stripped [mcp_servers.beacon] from ~/.codex/config.toml")}`);if(G.mcpSkipped)console.log(` ${TZ("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 y){if(!UQ(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(` ${B(`${Q.path} \u2192 ${$.join(", ")}`)}`)}var b0=E0(K,"server.json");try{let{pid:Q}=JSON.parse(g0(b0,"utf8"));if(Q)try{process.kill(Q),console.log(` ${B(`stopped daemon (pid ${Q})`)}`)}catch{}}catch{}if(UQ(K))I0(K,{recursive:!0,force:!0}),console.log(` ${B(`removed ${K}`)}`);console.log(f("Done."));console.log(` ${TZ("The `beacon` binary on your PATH is still there \u2014 run the matching uninstall step from your installer to remove it.")}
252
259
  `);
@@ -1,20 +1,21 @@
1
1
  // @bun
2
- var w=Object.defineProperty;var u=(q)=>q;function E(q,J){this[q]=u.bind(null,J)}var A=(q,J)=>{for(var z in J)w(q,z,{get:J[z],enumerable:!0,configurable:!0,set:E.bind(J,z)})};var I=(q,J)=>()=>(q&&(J=q(q=0)),J);var F={};A(F,{removeRepoAssets:()=>h,installRefreshSkill:()=>W,installPlanSkill:()=>O,installInitSkill:()=>f,installCodexRepoSkills:()=>j,ensureWorkflowDoc:()=>_,ensureMcp:()=>g,auditRepo:()=>L,REFRESH_SKILL:()=>k,PLAN_SKILL:()=>b,INIT_SKILL:()=>v});import{existsSync as H,mkdirSync as D,readFileSync as X,rmSync as B,writeFileSync as G}from"fs";import{join as Q}from"path";function f(q){let J=Q(q,".claude","skills","beacon-init");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,v),z}function W(q){let J=Q(q,".claude","skills","beacon-refresh");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,k),z}function O(q){let J=Q(q,".claude","skills","beacon-plan");D(J,{recursive:!0});let z=Q(J,"SKILL.md");return G(z,b),z}function j(q){let J=[];for(let z of K){let Y=Q(q,".agents","skills",z.name);D(Y,{recursive:!0});let $=Q(Y,"SKILL.md");G($,z.body()),J.push($)}return J}function _(q){let J=Q(q,"AGENTS.md"),z="";try{z=X(J,"utf8")}catch{}let Y=new RegExp(`${U}[\\s\\S]*?${M}`);z=Y.test(z)?z.replace(Y,T):`${z.trim()}
2
+ var u=Object.defineProperty;var W=(z)=>z;function E(z,J){this[z]=W.bind(null,J)}var M=(z,J)=>{for(var q in J)u(z,q,{get:J[q],enumerable:!0,configurable:!0,set:E.bind(J,q)})};var A=(z,J)=>()=>(z&&(J=z(z=0)),J);var S=1500,s=480000,a=1800000,B=3600000,d=3000;var I=()=>{};var m={};M(m,{removeRepoAssets:()=>R,installRefreshSkill:()=>j,installPlanSkill:()=>L,installInitSkill:()=>K,installCodexRepoSkills:()=>g,ensureWorkflowDoc:()=>F,ensureMcp:()=>_,auditRepo:()=>h,REFRESH_SKILL:()=>P,PLAN_SKILL:()=>f,INIT_SKILL:()=>k});import{existsSync as D,mkdirSync as U,readFileSync as X,rmSync as C,writeFileSync as G}from"fs";import{join as Q}from"path";function K(z){let J=Q(z,".claude","skills","beacon-init");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,k),q}function j(z){let J=Q(z,".claude","skills","beacon-refresh");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,P),q}function L(z){let J=Q(z,".claude","skills","beacon-plan");U(J,{recursive:!0});let q=Q(J,"SKILL.md");return G(q,f),q}function g(z){let J=[];for(let q of O){let Y=Q(z,".agents","skills",q.name);U(Y,{recursive:!0});let $=Q(Y,"SKILL.md");G($,q.body()),J.push($)}return J}function F(z){let J=Q(z,"AGENTS.md"),q="";try{q=X(J,"utf8")}catch{}let Y=new RegExp(`${v}[\\s\\S]*?${b}`);q=Y.test(q)?q.replace(Y,T):`${q.trim()}
3
3
 
4
4
  ${T}
5
- `.trimStart(),G(J,z.endsWith(`
6
- `)?z:`${z}
7
- `);let $=Q(q,"CLAUDE.md"),C="";try{C=X($,"utf8")}catch{}if(!/@AGENTS\.md/.test(C))G($,`${C?`${C.trim()}
5
+ `.trimStart(),G(J,q.endsWith(`
6
+ `)?q:`${q}
7
+ `);let $=Q(z,"CLAUDE.md"),H="";try{H=X($,"utf8")}catch{}if(!/@AGENTS\.md/.test(H))G($,`${H?`${H.trim()}
8
8
 
9
9
  `:""}@AGENTS.md
10
- `)}function g(q){let J=Q(q,".mcp.json"),z={};try{z=JSON.parse(X(J,"utf8"))}catch{}if(z.mcpServers=z.mcpServers??{},z.mcpServers.beacon)return{path:J,added:!1};return z.mcpServers.beacon={command:"beacon",args:["mcp"]},G(J,JSON.stringify(z,null,2)+`
11
- `),{path:J,added:!0}}function L(q){let J=Q(q,".mcp.json"),z=!1;try{z=!!JSON.parse(X(J,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=X(Q(q,"AGENTS.md"),"utf8").includes(U)}catch{}let $=!1;try{$=/@AGENTS\.md/.test(X(Q(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:z,agentsMdBlock:Y,claudeMdImport:$,skills:{"beacon-init":H(Q(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":H(Q(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":H(Q(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":H(Q(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function h(q){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let Z=Q(q,".claude","skills",V);if(H(Z))B(Z,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let Z=Q(q,".agents","skills",V);if(H(Z))B(Z,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let z=!1,Y=Q(q,".mcp.json");try{let V=JSON.parse(X(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,z=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)B(Y,{force:!0});else G(Y,JSON.stringify(V,null,2)+`
12
- `)}}catch{}let $=!1,C=Q(q,"AGENTS.md");try{let V=X(C,"utf8"),Z=new RegExp(`\\n?${U}[\\s\\S]*?${M}\\n?`);if(Z.test(V)){let N=V.replace(Z,`
10
+ `)}function _(z){let J=Q(z,".mcp.json"),q={};try{q=JSON.parse(X(J,"utf8"))}catch{}q.mcpServers=q.mcpServers??{};let Y=q.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<B)return Y.timeout=B,G(J,JSON.stringify(q,null,2)+`
11
+ `),{path:J,added:!1,updated:!0};return{path:J,added:!1,updated:!1}}return q.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:B},G(J,JSON.stringify(q,null,2)+`
12
+ `),{path:J,added:!0,updated:!1}}function h(z){let J=Q(z,".mcp.json"),q=!1;try{q=!!JSON.parse(X(J,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=X(Q(z,"AGENTS.md"),"utf8").includes(v)}catch{}let $=!1;try{$=/@AGENTS\.md/.test(X(Q(z,"CLAUDE.md"),"utf8"))}catch{}return{repo:z,mcpRegistered:q,agentsMdBlock:Y,claudeMdImport:$,skills:{"beacon-init":D(Q(z,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":D(Q(z,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":D(Q(z,".agents","skills","beacon-refresh","SKILL.md"))}}}function R(z){let J=[];for(let V of["beacon-init","beacon-refresh","beacon-db-design"]){let Z=Q(z,".claude","skills",V);if(D(Z))C(Z,{recursive:!0,force:!0}),J.push(V)}for(let V of["beacon-init","beacon-refresh"]){let Z=Q(z,".agents","skills",V);if(D(Z))C(Z,{recursive:!0,force:!0}),J.push(`codex:${V}`)}let q=!1,Y=Q(z,".mcp.json");try{let V=JSON.parse(X(Y,"utf8"));if(V.mcpServers?.beacon){if(delete V.mcpServers.beacon,q=!0,V.mcpServers&&Object.keys(V.mcpServers).length===0)delete V.mcpServers;if(Object.keys(V).length===0)C(Y,{force:!0});else G(Y,JSON.stringify(V,null,2)+`
13
+ `)}}catch{}let $=!1,H=Q(z,"AGENTS.md");try{let V=X(H,"utf8"),Z=new RegExp(`\\n?${v}[\\s\\S]*?${b}\\n?`);if(Z.test(V)){let N=V.replace(Z,`
13
14
  `).replace(/\n{3,}/g,`
14
15
 
15
- `).trimStart();G(C,N.endsWith(`
16
+ `).trimStart();G(H,N.endsWith(`
16
17
  `)?N:`${N}
17
- `),$=!0}}catch{}let P=!1,x=Q(q,"CLAUDE.md");try{let V=X(x,"utf8"),Z=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(Z!==V){if(!Z.trim())B(x,{force:!0});else G(x,Z);P=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:z,agentsBlockRemoved:$,claudeImportRemoved:P}}var v=`---
18
+ `),$=!0}}catch{}let w=!1,x=Q(z,"CLAUDE.md");try{let V=X(x,"utf8"),Z=V.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(Z!==V){if(!Z.trim())C(x,{force:!0});else G(x,Z);w=!0}}catch{}return{skillsRemoved:J,mcpUnregistered:q,agentsBlockRemoved:$,claudeImportRemoved:w}}var k=`---
18
19
  name: beacon-init
19
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
20
21
  ---
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
53
54
  If \`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-init.
54
55
 
55
56
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
56
- `,k=`---
57
+ `,P=`---
57
58
  name: beacon-refresh
58
59
  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.
59
60
  ---
@@ -100,7 +101,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
100
101
  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.
101
102
 
102
103
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
103
- `,b=`---
104
+ `,f=`---
104
105
  name: beacon-plan
105
106
  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.
106
107
  ---
@@ -128,6 +129,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
128
129
  board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
129
130
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
130
131
 
132
+ - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
133
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
134
+ has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
135
+ implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
136
+ to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
137
+
131
138
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
132
139
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
133
140
  If it returns feedback, revise and call it again.
@@ -142,7 +149,7 @@ If it returns feedback, revise and call it again.
142
149
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
143
150
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
144
151
  run \`beacon\` in this repo once.
145
- `,K,U="<!-- beacon:workflow:start -->",M="<!-- beacon:workflow:end -->",T;var R=I(()=>{K=[{name:"beacon-init",body:()=>v},{name:"beacon-refresh",body:()=>k}];T=`${U}
152
+ `,O,v="<!-- beacon:workflow:start -->",b="<!-- beacon:workflow:end -->",T;var y=A(()=>{I();O=[{name:"beacon-init",body:()=>k},{name:"beacon-refresh",body:()=>P}];T=`${v}
146
153
  ## Beacon \u2014 feature workflow
147
154
 
148
155
  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:
@@ -200,4 +207,4 @@ Register them all in that single batched call. If a plan added five features, th
200
207
  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.
201
208
 
202
209
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
203
- ${M}`});R();export{h as removeRepoAssets,W as installRefreshSkill,O as installPlanSkill,f as installInitSkill,j as installCodexRepoSkills,_ as ensureWorkflowDoc,g as ensureMcp,L as auditRepo,k as REFRESH_SKILL,b as PLAN_SKILL,v as INIT_SKILL};
210
+ ${b}`});y();export{R as removeRepoAssets,j as installRefreshSkill,L as installPlanSkill,K as installInitSkill,g as installCodexRepoSkills,F as ensureWorkflowDoc,_ as ensureMcp,h as auditRepo,P as REFRESH_SKILL,f as PLAN_SKILL,k as INIT_SKILL};
@@ -1,20 +1,21 @@
1
1
  // @bun
2
- var uq=Object.defineProperty;var Xq=(q)=>q;function Gq(q,z){this[q]=Xq.bind(null,z)}var l=(q,z)=>{for(var J in z)uq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:Gq.bind(z,J)})};var b=(q,z)=>()=>(q&&(z=q(q=0)),z);var d={};l(d,{removeRepoAssets:()=>fq,installRefreshSkill:()=>wq,installPlanSkill:()=>gq,installInitSkill:()=>bq,installCodexRepoSkills:()=>Cq,ensureWorkflowDoc:()=>Nq,ensureMcp:()=>Kq,auditRepo:()=>Mq,REFRESH_SKILL:()=>k,PLAN_SKILL:()=>t,INIT_SKILL:()=>F});import{existsSync as v,mkdirSync as g,readFileSync as W,rmSync as w,writeFileSync as B}from"fs";import{join as $}from"path";function bq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,F),J}function wq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,k),J}function gq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return B(J,t),J}function Cq(q){let z=[];for(let J of jq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");B(V,J.body()),z.push(V)}return z}function Nq(q){let z=$(q,"AGENTS.md"),J="";try{J=W(z,"utf8")}catch{}let Q=new RegExp(`${j}[\\s\\S]*?${O}`);J=Q.test(J)?J.replace(Q,s):`${J.trim()}
2
+ var bq=Object.defineProperty;var uq=(q)=>q;function wq(q,z){this[q]=uq.bind(null,z)}var d=(q,z)=>{for(var J in z)bq(q,J,{get:z[J],enumerable:!0,configurable:!0,set:wq.bind(z,J)})};var X=(q,z)=>()=>(q&&(z=q(q=0)),z);var lq=1500,dq=480000,sq=1800000,w=3600000,cq=3000;var s=()=>{};var n={};d(n,{removeRepoAssets:()=>Dq,installRefreshSkill:()=>gq,installPlanSkill:()=>Kq,installInitSkill:()=>jq,installCodexRepoSkills:()=>Nq,ensureWorkflowDoc:()=>Mq,ensureMcp:()=>fq,auditRepo:()=>Rq,REFRESH_SKILL:()=>L,PLAN_SKILL:()=>t,INIT_SKILL:()=>E});import{existsSync as v,mkdirSync as g,readFileSync as H,rmSync as j,writeFileSync as W}from"fs";import{join as $}from"path";function jq(q){let z=$(q,".claude","skills","beacon-init");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,E),J}function gq(q){let z=$(q,".claude","skills","beacon-refresh");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,L),J}function Kq(q){let z=$(q,".claude","skills","beacon-plan");g(z,{recursive:!0});let J=$(z,"SKILL.md");return W(J,t),J}function Nq(q){let z=[];for(let J of Cq){let Q=$(q,".agents","skills",J.name);g(Q,{recursive:!0});let V=$(Q,"SKILL.md");W(V,J.body()),z.push(V)}return z}function Mq(q){let z=$(q,"AGENTS.md"),J="";try{J=H(z,"utf8")}catch{}let Q=new RegExp(`${K}[\\s\\S]*?${y}`);J=Q.test(J)?J.replace(Q,c):`${J.trim()}
3
3
 
4
- ${s}
5
- `.trimStart(),B(z,J.endsWith(`
4
+ ${c}
5
+ `.trimStart(),W(z,J.endsWith(`
6
6
  `)?J:`${J}
7
- `);let V=$(q,"CLAUDE.md"),Y="";try{Y=W(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))B(V,`${Y?`${Y.trim()}
7
+ `);let V=$(q,"CLAUDE.md"),Y="";try{Y=H(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(Y))W(V,`${Y?`${Y.trim()}
8
8
 
9
9
  `:""}@AGENTS.md
10
- `)}function Kq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(W(z,"utf8"))}catch{}if(J.mcpServers=J.mcpServers??{},J.mcpServers.beacon)return{path:z,added:!1};return J.mcpServers.beacon={command:"beacon",args:["mcp"]},B(z,JSON.stringify(J,null,2)+`
11
- `),{path:z,added:!0}}function Mq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(W(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=W($(q,"AGENTS.md"),"utf8").includes(j)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(W($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function fq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))w(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(W(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)w(Q,{force:!0});else B(Q,JSON.stringify(Z,null,2)+`
12
- `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=W(Y,"utf8"),P=new RegExp(`\\n?${j}[\\s\\S]*?${O}\\n?`);if(P.test(Z)){let E=Z.replace(P,`
10
+ `)}function fq(q){let z=$(q,".mcp.json"),J={};try{J=JSON.parse(H(z,"utf8"))}catch{}J.mcpServers=J.mcpServers??{};let Q=J.mcpServers.beacon;if(Q){if(!Q.timeout||Q.timeout<w)return Q.timeout=w,W(z,JSON.stringify(J,null,2)+`
11
+ `),{path:z,added:!1,updated:!0};return{path:z,added:!1,updated:!1}}return J.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:w},W(z,JSON.stringify(J,null,2)+`
12
+ `),{path:z,added:!0,updated:!1}}function Rq(q){let z=$(q,".mcp.json"),J=!1;try{J=!!JSON.parse(H(z,"utf8")).mcpServers?.beacon}catch{}let Q=!1;try{Q=H($(q,"AGENTS.md"),"utf8").includes(K)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(H($(q,"CLAUDE.md"),"utf8"))}catch{}return{repo:q,mcpRegistered:J,agentsMdBlock:Q,claudeMdImport:V,skills:{"beacon-init":v($(q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":v($(q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":v($(q,".agents","skills","beacon-refresh","SKILL.md"))}}}function Dq(q){let z=[];for(let Z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=$(q,".claude","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(Z)}for(let Z of["beacon-init","beacon-refresh"]){let P=$(q,".agents","skills",Z);if(v(P))j(P,{recursive:!0,force:!0}),z.push(`codex:${Z}`)}let J=!1,Q=$(q,".mcp.json");try{let Z=JSON.parse(H(Q,"utf8"));if(Z.mcpServers?.beacon){if(delete Z.mcpServers.beacon,J=!0,Z.mcpServers&&Object.keys(Z.mcpServers).length===0)delete Z.mcpServers;if(Object.keys(Z).length===0)j(Q,{force:!0});else W(Q,JSON.stringify(Z,null,2)+`
13
+ `)}}catch{}let V=!1,Y=$(q,"AGENTS.md");try{let Z=H(Y,"utf8"),P=new RegExp(`\\n?${K}[\\s\\S]*?${y}\\n?`);if(P.test(Z)){let k=Z.replace(P,`
13
14
  `).replace(/\n{3,}/g,`
14
15
 
15
- `).trimStart();B(Y,E.endsWith(`
16
- `)?E:`${E}
17
- `),V=!0}}catch{}let U=!1,H=$(q,"CLAUDE.md");try{let Z=W(H,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())w(H,{force:!0});else B(H,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var F=`---
16
+ `).trimStart();W(Y,k.endsWith(`
17
+ `)?k:`${k}
18
+ `),V=!0}}catch{}let U=!1,B=$(q,"CLAUDE.md");try{let Z=H(B,"utf8"),P=Z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==Z){if(!P.trim())j(B,{force:!0});else W(B,P);U=!0}}catch{}return{skillsRemoved:z,mcpUnregistered:J,agentsBlockRemoved:V,claudeImportRemoved:U}}var E=`---
18
19
  name: beacon-init
19
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
20
21
  ---
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
53
54
  If \`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-init.
54
55
 
55
56
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
56
- `,k=`---
57
+ `,L=`---
57
58
  name: beacon-refresh
58
59
  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.
59
60
  ---
@@ -128,6 +129,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
128
129
  board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
129
130
  table/endpoint/feature you mention in the prose into the block, or that board will be empty.
130
131
 
132
+ - **Declare your scope.** List the repo-relative files this plan will touch in a top-level
133
+ \`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
134
+ has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
135
+ implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
136
+ to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
137
+
131
138
  \`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
132
139
  feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
133
140
  If it returns feedback, revise and call it again.
@@ -142,7 +149,7 @@ If it returns feedback, revise and call it again.
142
149
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
143
150
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
144
151
  run \`beacon\` in this repo once.
145
- `,jq,j="<!-- beacon:workflow:start -->",O="<!-- beacon:workflow:end -->",s;var c=b(()=>{jq=[{name:"beacon-init",body:()=>F},{name:"beacon-refresh",body:()=>k}];s=`${j}
152
+ `,Cq,K="<!-- beacon:workflow:start -->",y="<!-- beacon:workflow:end -->",c;var r=X(()=>{s();Cq=[{name:"beacon-init",body:()=>E},{name:"beacon-refresh",body:()=>L}];c=`${K}
146
153
  ## Beacon \u2014 feature workflow
147
154
 
148
155
  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:
@@ -200,18 +207,18 @@ Register them all in that single batched call. If a plan added five features, th
200
207
  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.
201
208
 
202
209
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
203
- ${O}`});import{existsSync as n,mkdirSync as L,readFileSync as N,rmSync as Tq,writeFileSync as K}from"fs";import{dirname as r,join as C}from"path";function y(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function o(q,z){L(r(q),{recursive:!0}),K(q,JSON.stringify(z,null,2)+`
204
- `)}function e(q,z){let J=y(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),o(q,J),!0}function qq(q,z){return(y(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function zq(q,z){let J=y(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let H=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==H)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return o(q,J),!0}function Jq(q,z,J,Q){let V=`${z}
210
+ ${y}`});import{existsSync as i,mkdirSync as O,readFileSync as N,rmSync as Iq,writeFileSync as M}from"fs";import{dirname as o,join as C}from"path";function h(q){try{return JSON.parse(N(q,"utf8"))}catch{return{}}}function qq(q,z){O(o(q),{recursive:!0}),M(q,JSON.stringify(z,null,2)+`
211
+ `)}function zq(q,z){let J=h(q);J.hooks=J.hooks??{},J.hooks[z.event]=J.hooks[z.event]??[];let Q=J.hooks[z.event];if(Q.some((Y)=>Y.matcher===z.matcher&&Y.hooks?.some((U)=>U.command===z.command)))return!1;return Q.push({matcher:z.matcher,hooks:[{type:"command",command:z.command}]}),qq(q,J),!0}function Jq(q,z){return(h(q).hooks?.[z.event]??[]).some((V)=>V.hooks?.some((Y)=>Y.command===z.command))}function Qq(q,z){let J=h(q),Q=J.hooks?.[z.event];if(!Q)return!1;let V=!1,Y=Q.map((U)=>{let B=U.hooks?.length??0,Z=(U.hooks??[]).filter((P)=>P.command!==z.command);if(Z.length!==B)V=!0;return{...U,hooks:Z}}).filter((U)=>(U.hooks??[]).length>0);if(!V)return!1;if(Y.length)J.hooks[z.event]=Y;else delete J.hooks[z.event];if(J.hooks&&Object.keys(J.hooks).length===0)delete J.hooks;return qq(q,J),!0}function Vq(q,z,J,Q){let V=`${z}
205
212
  ${Q.trim()}
206
213
  ${J}`,Y="";try{Y=N(q,"utf8")}catch{}let U=new RegExp(`${z}[\\s\\S]*?${J}`);Y=U.test(Y)?Y.replace(U,V):Y.trim()?`${Y.trim()}
207
214
 
208
215
  ${V}
209
216
  `:`${V}
210
- `,L(r(q),{recursive:!0}),K(q,Y.endsWith(`
217
+ `,O(o(q),{recursive:!0}),M(q,Y.endsWith(`
211
218
  `)?Y:`${Y}
212
- `)}function h(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Qq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
219
+ `)}function _(q,z){try{return N(q,"utf8").includes(z)}catch{return!1}}function Yq(q,z,J){let Q="";try{Q=N(q,"utf8")}catch{return!1}let V=new RegExp(`${z}[\\s\\S]*?${J}\\n?`);if(!V.test(Q))return!1;let Y=Q.replace(V,"").replace(/\n{3,}/g,`
213
220
 
214
- `).trimStart();return K(q,Y),!0}function Vq(q,z,J){let Q=C(q,z);L(Q,{recursive:!0});let V=C(Q,"SKILL.md");return K(V,J),V}function _(q,z){return n(C(q,z,"SKILL.md"))}function Yq(q,z){let J=C(q,z);if(!n(J))return!1;return Tq(J,{recursive:!0,force:!0}),!0}var M,i=`## Beacon (visual planning panel)
221
+ `).trimStart();return M(q,Y),!0}function Zq(q,z,J){let Q=C(q,z);O(Q,{recursive:!0});let V=C(Q,"SKILL.md");return M(V,J),V}function m(q,z){return i(C(q,z,"SKILL.md"))}function $q(q,z){let J=C(q,z);if(!i(J))return!1;return Iq(J,{recursive:!0,force:!0}),!0}var f,e=`## Beacon (visual planning panel)
215
222
 
216
223
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
217
224
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -232,17 +239,17 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
232
239
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
233
240
  on the /map and /db boards (added features, attached subtasks, edited columns, new
234
241
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
235
- verbatim. Do NOT implement until the tool returns approval.`;var Zq=b(()=>{M=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Iq,renameSync as Rq,rmSync as Aq,writeFileSync as Dq}from"fs";import{dirname as Eq}from"path";function f(q,z){Iq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{Dq(J,z),Rq(J,q)}catch(Q){throw Aq(J,{force:!0}),Q}}function nq(q,z,J=!1){f(q,JSON.stringify(z,null,J?2:void 0))}var $q=()=>{};var _q={};l(_q,{setupCodexAssets:()=>Lq,removeCodexMcp:()=>xq,removeCodexArtifacts:()=>hq,hasCodexMcp:()=>a,ensureCodexMcp:()=>vq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>yq,CODEX_HOOKS:()=>D});import{readFileSync as A}from"fs";import{homedir as Fq}from"os";import{join as G}from"path";function Uq(){return process.env.HOME||process.env.USERPROFILE||Fq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(m===void 0)m=Bun.which("codex")!==null;return m}function X(q){try{return Bun.TOML.parse(q)}catch{return null}}function a(){try{return Boolean(X(A(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=A(x(),"utf8")}catch{return null}let z=X(q);if(!z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function vq(){let q="",z=!1;try{q=A(x(),"utf8"),z=!0}catch{}if(z){let Y=X(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};if(Y.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${u}`}}let J=!q?"":q.endsWith(`
242
+ verbatim. Do NOT implement until the tool returns approval.`;var Uq=X(()=>{f=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as Aq,renameSync as Tq,rmSync as Fq,writeFileSync as kq}from"fs";import{dirname as Eq}from"path";function R(q,z){Aq(Eq(q),{recursive:!0});let J=`${q}.tmp`;try{kq(J,z),Tq(J,q)}catch(Q){throw Fq(J,{force:!0}),Q}}function Qz(q,z,J=!1){R(q,JSON.stringify(z,null,J?2:void 0))}var Pq=()=>{};var Sq={};d(Sq,{setupCodexAssets:()=>hq,removeCodexMcp:()=>Gq,removeCodexArtifacts:()=>mq,hasCodexMcp:()=>l,ensureCodexMcp:()=>Xq,codexMcpProblem:()=>Oq,codexDetected:()=>Bq,auditCodex:()=>_q,CODEX_HOOKS:()=>F});import{readFileSync as T}from"fs";import{homedir as Lq}from"os";import{join as u}from"path";function Wq(){return process.env.HOME||process.env.USERPROFILE||Lq()}function Bq(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(S===void 0)S=Bun.which("codex")!==null;return S}function b(q){try{return Bun.TOML.parse(q)}catch{return null}}function l(){try{return Boolean(b(T(x(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function Oq(){let q="";try{q=T(x(),"utf8")}catch{return null}let z=b(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 Xq(){let q="",z=!1;try{q=T(x(),"utf8"),z=!0}catch{}if(z){let Y=b(q);if(!Y)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${G}`};if(Y.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${G}`}}let J=!q?"":q.endsWith(`
236
243
  `)?`
237
244
  `:`
238
245
 
239
- `,Q=q+J+kq;if(X(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return f(x(),Q),{added:!0}}function xq(){let q="";try{q=A(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
240
- `),J=z.indexOf(Wq);if(J===-1)return{removed:!1,skipped:a()};let Q=z.indexOf(Hq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
246
+ `,Q=q+J+yq;if(b(Q)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${G}`};return R(x(),Q),{added:!0}}function Gq(){let q="";try{q=T(x(),"utf8")}catch{return{removed:!1}}let z=q.split(`
247
+ `),J=z.indexOf(vq);if(J===-1)return{removed:!1,skipped:l()};let Q=z.indexOf(xq,J);if(Q===-1)return{removed:!1,skipped:!0};z.splice(J,Q-J+1);let V=z.join(`
241
248
  `).replace(/\n{3,}/g,`
242
249
 
243
- `).replace(/^\n+/,"");if(X(V)===null)return{removed:!1,skipped:!0};return f(x(),V),{removed:!0}}async function Lq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (c(),d)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of M){if(!_(I(),Z))V.push(Z);Vq(I(),Z,Q[Z])}let Y=0;for(let Z of D)if(e(p(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=h(T(),R);Jq(T(),R,Pq,i);let H=vq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:H}}function yq(){let q={};for(let J of M)q[J]=_(I(),J);let z={};for(let J of D)z[J.event]=qq(p(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:h(T(),R),mcp:a()}}function hq(){let q=[];for(let V of M)if(Yq(I(),V))q.push(V);let z=0;for(let V of D)if(zq(p(),{event:V.event,command:V.command}))z++;let J=Qq(T(),R,Pq),Q=xq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var S=()=>G(Uq(),".codex"),p=()=>G(S(),"hooks.json"),x=()=>G(S(),"config.toml"),T=()=>G(S(),"AGENTS.md"),I=()=>G(Uq(),".agents","skills"),R="<!-- beacon:global:start -->",Pq="<!-- beacon:global:end -->",D,m,Wq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",Hq="# beacon:end",kq,u="add it manually: codex mcp add beacon -- beacon mcp";var mq=b(()=>{Zq();$q();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."}];kq=`${Wq}
250
+ `).replace(/^\n+/,"");if(b(V)===null)return{removed:!1,skipped:!0};return R(x(),V),{removed:!0}}async function hq(){let{INIT_SKILL:q,REFRESH_SKILL:z,PLAN_SKILL:J}=await Promise.resolve().then(() => (r(),n)),Q={"beacon-init":q,"beacon-refresh":z,"beacon-plan":J},V=[];for(let Z of f){if(!m(I(),Z))V.push(Z);Zq(I(),Z,Q[Z])}let Y=0;for(let Z of F)if(zq(a(),{event:Z.event,matcher:Z.matcher,command:Z.command}))Y++;let U=_(D(),A);Vq(D(),A,Hq,e);let B=Xq();return{skillsAdded:V,hooksAdded:Y,agentsMdBlockTouched:!U,mcp:B}}function _q(){let q={};for(let J of f)q[J]=m(I(),J);let z={};for(let J of F)z[J.event]=Jq(a(),{event:J.event,command:J.command});return{detected:Bq(),skills:q,hooks:z,agentsMdBlock:_(D(),A),mcp:l()}}function mq(){let q=[];for(let V of f)if($q(I(),V))q.push(V);let z=0;for(let V of F)if(Qq(a(),{event:V.event,command:V.command}))z++;let J=Yq(D(),A,Hq),Q=Gq();return{skillsRemoved:q,hooksRemoved:z,agentsMdBlockRemoved:J,mcpRemoved:Q.removed,mcpSkipped:Q.skipped}}var p=()=>u(Wq(),".codex"),a=()=>u(p(),"hooks.json"),x=()=>u(p(),"config.toml"),D=()=>u(p(),"AGENTS.md"),I=()=>u(Wq(),".agents","skills"),A="<!-- beacon:global:start -->",Hq="<!-- beacon:global:end -->",F,S,vq="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",xq="# beacon:end",yq,G="add it manually: codex mcp add beacon -- beacon mcp";var pq=X(()=>{Uq();Pq();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."}];yq=`${vq}
244
251
  [mcp_servers.beacon]
245
252
  command = "beacon"
246
253
  args = ["mcp"]
247
- ${Hq}
248
- `});mq();export{Lq as setupCodexAssets,xq as removeCodexMcp,hq as removeCodexArtifacts,a as hasCodexMcp,vq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,yq as auditCodex,D as CODEX_HOOKS};
254
+ ${xq}
255
+ `});pq();export{hq as setupCodexAssets,Gq as removeCodexMcp,mq as removeCodexArtifacts,l as hasCodexMcp,Xq as ensureCodexMcp,Oq as codexMcpProblem,Bq as codexDetected,_q as auditCodex,F as CODEX_HOOKS};