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
package/dist/bin/hook.js CHANGED
@@ -1,21 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var WZ=Object.defineProperty;var xZ=(Q)=>Q;function BZ(Q,Z){this[Q]=xZ.bind(null,Z)}var e=(Q,Z)=>{for(var $ in Z)WZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:BZ.bind(Z,$)})};var v=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var JQ={};e(JQ,{removeRepoAssets:()=>CZ,installRefreshSkill:()=>jZ,installPlanSkill:()=>PZ,installInitSkill:()=>HZ,installCodexRepoSkills:()=>NZ,ensureWorkflowDoc:()=>KZ,ensureMcp:()=>uZ,auditRepo:()=>vZ,REFRESH_SKILL:()=>ZQ,PLAN_SKILL:()=>RQ,INIT_SKILL:()=>QQ});import{existsSync as N,mkdirSync as b,readFileSync as B,rmSync as f,writeFileSync as x}from"fs";import{join as U}from"path";function HZ(Q){let Z=U(Q,".claude","skills","beacon-init");b(Z,{recursive:!0});let $=U(Z,"SKILL.md");return x($,QQ),$}function jZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");b(Z,{recursive:!0});let $=U(Z,"SKILL.md");return x($,ZQ),$}function PZ(Q){let Z=U(Q,".claude","skills","beacon-plan");b(Z,{recursive:!0});let $=U(Z,"SKILL.md");return x($,RQ),$}function NZ(Q){let Z=[];for(let $ of GZ){let J=U(Q,".agents","skills",$.name);b(J,{recursive:!0});let Y=U(J,"SKILL.md");x(Y,$.body()),Z.push(Y)}return Z}function KZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=B(Z,"utf8")}catch{}let J=new RegExp(`${O}[\\s\\S]*?${$Q}`);$=J.test($)?$.replace(J,TQ):`${$.trim()}
3
+ var BZ=Object.defineProperty;var jZ=(Q)=>Q;function PZ(Q,Z){this[Q]=jZ.bind(null,Z)}var QQ=(Q,Z)=>{for(var $ in Z)BZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:PZ.bind(Z,$)})};var N=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var I0=1500,O0=480000,A0=1800000,f=3600000,D0=3000;var TQ=()=>{};var YQ={};QQ(YQ,{removeRepoAssets:()=>gZ,installRefreshSkill:()=>NZ,installPlanSkill:()=>KZ,installInitSkill:()=>GZ,installCodexRepoSkills:()=>uZ,ensureWorkflowDoc:()=>CZ,ensureMcp:()=>MZ,auditRepo:()=>wZ,REFRESH_SKILL:()=>$Q,PLAN_SKILL:()=>fQ,INIT_SKILL:()=>ZQ});import{existsSync as K,mkdirSync as I,readFileSync as x,rmSync as b,writeFileSync as H}from"fs";import{join as U}from"path";function GZ(Q){let Z=U(Q,".claude","skills","beacon-init");I(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,ZQ),$}function NZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");I(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,$Q),$}function KZ(Q){let Z=U(Q,".claude","skills","beacon-plan");I(Z,{recursive:!0});let $=U(Z,"SKILL.md");return H($,fQ),$}function uZ(Q){let Z=[];for(let $ of vZ){let J=U(Q,".agents","skills",$.name);I(J,{recursive:!0});let Y=U(J,"SKILL.md");H(Y,$.body()),Z.push(Y)}return Z}function CZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${O}[\\s\\S]*?${JQ}`);$=J.test($)?$.replace(J,FQ):`${$.trim()}
4
4
 
5
- ${TQ}
6
- `.trimStart(),x(Z,$.endsWith(`
5
+ ${FQ}
6
+ `.trimStart(),H(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
- `);let Y=U(Q,"CLAUDE.md"),V="";try{V=B(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))x(Y,`${V?`${V.trim()}
8
+ `);let Y=U(Q,"CLAUDE.md"),V="";try{V=x(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))H(Y,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function uZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(B(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},x(Z,JSON.stringify($,null,2)+`
12
- `),{path:Z,added:!0}}function vZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(B(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=B(U(Q,"AGENTS.md"),"utf8").includes(O)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(B(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":N(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":N(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":N(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":N(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function CZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=U(Q,".claude","skills",z);if(N(W))f(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=U(Q,".agents","skills",z);if(N(W))f(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=U(Q,".mcp.json");try{let z=JSON.parse(B(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)f(J,{force:!0});else x(J,JSON.stringify(z,null,2)+`
13
- `)}}catch{}let Y=!1,V=U(Q,"AGENTS.md");try{let z=B(V,"utf8"),W=new RegExp(`\\n?${O}[\\s\\S]*?${$Q}\\n?`);if(W.test(z)){let i=z.replace(W,`
11
+ `)}function MZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<f)return J.timeout=f,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:f},H(Z,JSON.stringify($,null,2)+`
13
+ `),{path:Z,added:!0,updated:!1}}function wZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(U(Q,"AGENTS.md"),"utf8").includes(O)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":K(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":K(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":K(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":K(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function gZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=U(Q,".claude","skills",z);if(K(W))b(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=U(Q,".agents","skills",z);if(K(W))b(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=U(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)b(J,{force:!0});else H(J,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let Y=!1,V=U(Q,"AGENTS.md");try{let z=x(V,"utf8"),W=new RegExp(`\\n?${O}[\\s\\S]*?${JQ}\\n?`);if(W.test(z)){let e=z.replace(W,`
14
15
  `).replace(/\n{3,}/g,`
15
16
 
16
- `).trimStart();x(V,i.endsWith(`
17
- `)?i:`${i}
18
- `),Y=!0}}catch{}let q=!1,X=U(Q,"CLAUDE.md");try{let z=B(X,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())f(X,{force:!0});else x(X,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var QQ=`---
17
+ `).trimStart();H(V,e.endsWith(`
18
+ `)?e:`${e}
19
+ `),Y=!0}}catch{}let q=!1,X=U(Q,"CLAUDE.md");try{let z=x(X,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())b(X,{force:!0});else H(X,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var ZQ=`---
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
- `,ZQ=`---
58
+ `,$Q=`---
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
- `,RQ=`---
105
+ `,fQ=`---
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
- `,GZ,O="<!-- beacon:workflow:start -->",$Q="<!-- beacon:workflow:end -->",TQ;var YQ=v(()=>{GZ=[{name:"beacon-init",body:()=>QQ},{name:"beacon-refresh",body:()=>ZQ}];TQ=`${O}
153
+ `,vZ,O="<!-- beacon:workflow:start -->",JQ="<!-- beacon:workflow:end -->",FQ;var VQ=N(()=>{TQ();vZ=[{name:"beacon-init",body:()=>ZQ},{name:"beacon-refresh",body:()=>$Q}];FQ=`${O}
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
- ${$Q}`});import{existsSync as FQ,mkdirSync as VQ,readFileSync as E,rmSync as MZ,writeFileSync as A}from"fs";import{dirname as fQ,join as I}from"path";function zQ(Q){try{return JSON.parse(E(Q,"utf8"))}catch{return{}}}function bQ(Q,Z){VQ(fQ(Q),{recursive:!0}),A(Q,JSON.stringify(Z,null,2)+`
205
- `)}function y(Q,Z){let $=zQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),bQ(Q,$),!0}function L(Q,Z){return(zQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function k(Q,Z){let $=zQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let X=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==X)Y=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return bQ(Q,$),!0}function _(Q,Z,$,J){let Y=`${Z}
211
+ ${JQ}`});import{existsSync as bQ,mkdirSync as zQ,readFileSync as D,rmSync as RZ,writeFileSync as E}from"fs";import{dirname as IQ,join as A}from"path";function qQ(Q){try{return JSON.parse(D(Q,"utf8"))}catch{return{}}}function OQ(Q,Z){zQ(IQ(Q),{recursive:!0}),E(Q,JSON.stringify(Z,null,2)+`
212
+ `)}function L(Q,Z){let $=qQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),OQ(Q,$),!0}function k(Q,Z){return(qQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function _(Q,Z){let $=qQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let X=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==X)Y=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return OQ(Q,$),!0}function S(Q,Z,$,J){let Y=`${Z}
206
213
  ${J.trim()}
207
- ${$}`,V="";try{V=E(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
214
+ ${$}`,V="";try{V=D(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
208
215
 
209
216
  ${Y}
210
217
  `:`${Y}
211
- `,VQ(fQ(Q),{recursive:!0}),A(Q,V.endsWith(`
218
+ `,zQ(IQ(Q),{recursive:!0}),E(Q,V.endsWith(`
212
219
  `)?V:`${V}
213
- `)}function C(Q,Z){try{return E(Q,"utf8").includes(Z)}catch{return!1}}function S(Q,Z,$){let J="";try{J=E(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 C(Q,Z){try{return D(Q,"utf8").includes(Z)}catch{return!1}}function h(Q,Z,$){let J="";try{J=D(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 A(Q,V),!0}function h(Q,Z,$){let J=I(Q,Z);VQ(J,{recursive:!0});let Y=I(J,"SKILL.md");return A(Y,$),Y}function M(Q,Z){return FQ(I(Q,Z,"SKILL.md"))}function m(Q,Z){let $=I(Q,Z);if(!FQ($))return!1;return MZ($,{recursive:!0,force:!0}),!0}var j,D=`## Beacon (visual planning panel)
222
+ `).trimStart();return E(Q,V),!0}function m(Q,Z,$){let J=A(Q,Z);zQ(J,{recursive:!0});let Y=A(J,"SKILL.md");return E(Y,$),Y}function M(Q,Z){return bQ(A(Q,Z,"SKILL.md"))}function p(Q,Z){let $=A(Q,Z);if(!bQ($))return!1;return RZ($,{recursive:!0,force:!0}),!0}var j,y=`## 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,18 +240,18 @@ 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 qQ=v(()=>{j=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as wZ,renameSync as gZ,rmSync as TZ,writeFileSync as RZ}from"fs";import{dirname as FZ}from"path";function p(Q,Z){wZ(FZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{RZ($,Z),gZ($,Q)}catch(J){throw TZ($,{force:!0}),J}}function D0(Q,Z,$=!1){p(Q,JSON.stringify(Z,null,$?2:void 0))}var OQ=()=>{};var _Q={};e(_Q,{setupCodexAssets:()=>IZ,removeCodexMcp:()=>kQ,removeCodexArtifacts:()=>AZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>LQ,codexMcpProblem:()=>OZ,codexDetected:()=>AQ,auditCodex:()=>EZ,CODEX_HOOKS:()=>a});import{readFileSync as d}from"fs";import{homedir as fZ}from"os";import{join as T}from"path";function IQ(){return process.env.HOME||process.env.USERPROFILE||fZ()}function AQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(XQ===void 0)XQ=Bun.which("codex")!==null;return XQ}function g(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(g(d(K(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function OZ(){let Q="";try{Q=d(K(),"utf8")}catch{return null}let Z=g(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${w}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${w}`;return null}function LQ(){let Q="",Z=!1;try{Q=d(K(),"utf8"),Z=!0}catch{}if(Z){let V=g(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${w}`};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 ${w}`}}let $=!Q?"":Q.endsWith(`
243
+ verbatim. Do NOT implement until the tool returns approval.`;var XQ=N(()=>{j=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as TZ,renameSync as FZ,rmSync as fZ,writeFileSync as bZ}from"fs";import{dirname as IZ}from"path";function c(Q,Z){TZ(IZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{bZ($,Z),FZ($,Q)}catch(J){throw fZ($,{force:!0}),J}}function c0(Q,Z,$=!1){c(Q,JSON.stringify(Z,null,$?2:void 0))}var AQ=()=>{};var hQ={};QQ(hQ,{setupCodexAssets:()=>EZ,removeCodexMcp:()=>SQ,removeCodexArtifacts:()=>LZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>_Q,codexMcpProblem:()=>DZ,codexDetected:()=>yQ,auditCodex:()=>yZ,CODEX_HOOKS:()=>s});import{readFileSync as a}from"fs";import{homedir as OZ}from"os";import{join as R}from"path";function DQ(){return process.env.HOME||process.env.USERPROFILE||OZ()}function yQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(UQ===void 0)UQ=Bun.which("codex")!==null;return UQ}function g(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(g(a(v(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function DZ(){let Q="";try{Q=a(v(),"utf8")}catch{return null}let Z=g(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${w}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${w}`;return null}function _Q(){let Q="",Z=!1;try{Q=a(v(),"utf8"),Z=!0}catch{}if(Z){let V=g(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${w}`};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 ${w}`}}let $=!Q?"":Q.endsWith(`
237
244
  `)?`
238
245
  `:`
239
246
 
240
- `,J=Q+$+bZ;if(g(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${w}`};return p(K(),J),{added:!0}}function kQ(){let Q="";try{Q=d(K(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
241
- `),$=Z.indexOf(DQ);if($===-1)return{removed:!1,skipped:xQ()};let J=Z.indexOf(yQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
247
+ `,J=Q+$+AZ;if(g(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${w}`};return c(v(),J),{added:!0}}function SQ(){let Q="";try{Q=a(v(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
248
+ `),$=Z.indexOf(LQ);if($===-1)return{removed:!1,skipped:xQ()};let J=Z.indexOf(kQ,$);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(g(Y)===null)return{removed:!1,skipped:!0};return p(K(),Y),{removed:!0}}async function IZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (YQ(),JQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of j){if(!M(n(),z))Y.push(z);h(n(),z,J[z])}let V=0;for(let z of a)if(y(WQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=C(c(),l);_(c(),l,EQ,D);let X=LQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!q,mcp:X}}function EZ(){let Q={};for(let $ of j)Q[$]=M(n(),$);let Z={};for(let $ of a)Z[$.event]=L(WQ(),{event:$.event,command:$.command});return{detected:AQ(),skills:Q,hooks:Z,agentsMdBlock:C(c(),l),mcp:xQ()}}function AZ(){let Q=[];for(let Y of j)if(m(n(),Y))Q.push(Y);let Z=0;for(let Y of a)if(k(WQ(),{event:Y.event,command:Y.command}))Z++;let $=S(c(),l,EQ),J=kQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var UQ=()=>T(IQ(),".codex"),WQ=()=>T(UQ(),"hooks.json"),K=()=>T(UQ(),"config.toml"),c=()=>T(UQ(),"AGENTS.md"),n=()=>T(IQ(),".agents","skills"),l="<!-- beacon:global:start -->",EQ="<!-- beacon:global:end -->",a,XQ,DQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",yQ="# beacon:end",bZ,w="add it manually: codex mcp add beacon -- beacon mcp";var SQ=v(()=>{qQ();OQ();a=[{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."}];bZ=`${DQ}
251
+ `).replace(/^\n+/,"");if(g(Y)===null)return{removed:!1,skipped:!0};return c(v(),Y),{removed:!0}}async function EZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (VQ(),YQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of j){if(!M(l(),z))Y.push(z);m(l(),z,J[z])}let V=0;for(let z of s)if(L(HQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=C(n(),d);S(n(),d,EQ,y);let X=_Q();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!q,mcp:X}}function yZ(){let Q={};for(let $ of j)Q[$]=M(l(),$);let Z={};for(let $ of s)Z[$.event]=k(HQ(),{event:$.event,command:$.command});return{detected:yQ(),skills:Q,hooks:Z,agentsMdBlock:C(n(),d),mcp:xQ()}}function LZ(){let Q=[];for(let Y of j)if(p(l(),Y))Q.push(Y);let Z=0;for(let Y of s)if(_(HQ(),{event:Y.event,command:Y.command}))Z++;let $=h(n(),d,EQ),J=SQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var WQ=()=>R(DQ(),".codex"),HQ=()=>R(WQ(),"hooks.json"),v=()=>R(WQ(),"config.toml"),n=()=>R(WQ(),"AGENTS.md"),l=()=>R(DQ(),".agents","skills"),d="<!-- beacon:global:start -->",EQ="<!-- beacon:global:end -->",s,UQ,LQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",kQ="# beacon:end",AZ,w="add it manually: codex mcp add beacon -- beacon mcp";var mQ=N(()=>{XQ();AQ();s=[{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."}];AZ=`${LQ}
245
252
  [mcp_servers.beacon]
246
253
  command = "beacon"
247
254
  args = ["mcp"]
248
- ${yQ}
249
- `});var lQ={};e(lQ,{provisionDb:()=>J0});import{createClient as dZ}from"@libsql/client";import{drizzle as aZ}from"drizzle-orm/libsql";import{migrate as sZ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as tZ}from"drizzle-orm/migrator";import{dirname as NQ,join as rZ}from"path";import{fileURLToPath as oZ}from"url";async function r(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function Z0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function nQ(Q){if(!await r(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 $0(Q){for(let[Z,$]of Object.entries(Q0)){if(!await r(Q,Z))continue;let J=await Z0(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 J0(Q,Z=eZ){let $=dZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await r($,"__drizzle_migrations"),Y=await r($,"Node"),V=!1;if(Y&&!J){let X=tZ({migrationsFolder:Z})[0];if(X)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:[X.hash,X.folderMillis]}),V=!0}let q=await nQ($);if(await sZ(aZ($),{migrationsFolder:Z}),await nQ($)>q)V=!0;return await $0($),{migrated:V}}finally{$.close()}}var iZ,eZ,Q0;var dQ=v(async()=>{iZ=NQ(NQ(NQ(oZ(import.meta.url)))),eZ=process.env.BEACON_MIGRATIONS_DIR||rZ(iZ,"drizzle"),Q0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});qQ();import{existsSync as DZ}from"fs";import{homedir as yZ}from"os";import{join as s}from"path";function LZ(){return process.env.HOME||process.env.USERPROFILE||yZ()}var t=()=>s(LZ(),".claude"),BQ=()=>s(t(),"skills"),HQ=()=>s(t(),"settings.json"),jQ=()=>s(t(),"CLAUDE.md"),PQ="<!-- beacon:global:start -->",hQ="<!-- beacon:global:end -->";var kZ=D,GQ=[{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 _Z(Q,Z){return h(BQ(),Q,Z)}function mQ(Q){return M(BQ(),Q)}function SZ(Q){return m(BQ(),Q)}function hZ(Q){return y(HQ(),Q)}function mZ(Q){return L(HQ(),Q)}function pZ(Q){return k(HQ(),Q)}function cZ(Q){_(jQ(),PQ,hQ,Q)}function pQ(){return C(jQ(),PQ)}function nZ(){return S(jQ(),PQ,hQ)}function l0(){let Q={};for(let $ of j)Q[$]=mQ($);let Z={};for(let $ of GQ)Z[$.event]=mZ({event:$.event,command:$.command});return{homeExists:DZ(t()),skills:Q,hooks:Z,claudeMdBlock:pQ()}}async function lZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (YQ(),JQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let X of j){if(!mQ(X))Y.push(X);_Z(X,J[X])}let V=0;for(let X of GQ)if(hZ({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=pQ();return cZ(kZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!q}}async function cQ(){let Q;try{Q={ok:!0,...await lZ()}}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(() => (SQ(),_Q));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 d0(){let Q=[];for(let J of j)if(SZ(J))Q.push(J);let Z=0;for(let J of GQ)if(pZ(J))Z++;let $=nZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as Y0}from"async_hooks";import{spawnSync as V0}from"child_process";import{createHash as z0}from"crypto";import{existsSync as sQ,mkdirSync as R,readFileSync as uQ,writeFileSync as vQ}from"fs";import{homedir as tQ}from"os";import{basename as q0,join as P,parse as X0,resolve as aQ}from"path";function H(){return process.env.BEACON_HOME||P(tQ(),".beacon")}function CQ(){return P(H(),"workspaces.json")}function u(Q){return z0("sha256").update(Q).digest("hex").slice(0,12)}function rQ(Q=process.cwd()){let Z=V0("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 oQ(Q){let Z=aQ(Q);return Z!==aQ(tQ())&&Z!==X0(Z).root}function iQ(){return P(H(),"deleted.json")}function MQ(){try{let Q=JSON.parse(uQ(iQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function eQ(Q){R(H(),{recursive:!0}),vQ(iQ(),JSON.stringify(Q,null,2))}function QZ(Q){return MQ().includes(Q)}function z1(Q){let Z=MQ();if(!Z.includes(Q))eQ([...Z,Q])}function U0(Q){let Z=MQ();if(Z.includes(Q))eQ(Z.filter(($)=>$!==Q))}function o(Q){return P(H(),Q)}function W0(Q){return`file:${P(o(Q),"db.sqlite")}`}function F(){try{let Q=JSON.parse(uQ(CQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function wQ(Q){R(H(),{recursive:!0}),vQ(CQ(),JSON.stringify(Q,null,2))}function x0(){return F().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return F().find((Z)=>Z.id===Q)??null}function ZZ(Q,Z,$=new Date().toISOString()){if(!oQ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=u(Q);if(QZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=F(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||q0(Q),lastOpenedAt:$},X=[q,...Y.filter((z)=>z.id!==J)];return R(o(J),{recursive:!0}),wQ(X),q}function q1(Q,Z){return U0(u(Q)),ZZ(Q,Z)}function X1(Q,Z=new Date().toISOString()){let $=F(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,wQ($)}function U1(Q){if(wQ(F().filter((Z)=>Z.id!==Q)),gQ()===Q)B0(x0()[0]?.id??null)}function $Z(){return P(H(),"active")}function gQ(){try{return uQ($Z(),"utf8").trim()||null}catch{return null}}function B0(Q){R(H(),{recursive:!0}),vQ($Z(),Q??"")}function W1(){let Q=gQ();return Q?G(Q):null}function x1(){let Q=j0()??gQ();return Q?G(Q):null}function B1(Q){return G(Q)?.path??null}function H1(){return sQ(CQ())}var JZ="beacon_ws";function YZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function j1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=YZ(Q,JZ);if($&&G($))return $;return null}var H0="x-beacon-workspace-path";async function P1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(H0);if($&&oQ($)&&!QZ(u($))&&(!Z||u($)===Z)){let Y=ZZ($);return await P0(Y.id),Y.id}let J=YZ(Q,JZ);if(J&&G(J))return J;return null}var VZ=new Y0;function G1(Q,Z){return Q?VZ.run(Q,Z):Z()}function j0(){return VZ.getStore()??null}var KQ=new Set;function N1(Q){KQ.delete(P(o(Q),"db.sqlite"))}async function P0(Q){let Z=o(Q),$=P(Z,"db.sqlite"),J=sQ($);if(J&&KQ.has($))return{ok:!0,created:!1,migrated:!1};try{R(Z,{recursive:!0});let{provisionDb:Y}=await dQ().then(() => lQ),V=await Y(W0(Q));return KQ.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)}}}import{connect as G0}from"net";var zZ=4319;function N0(Q,Z,$=400){return new Promise((J)=>{let Y=G0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,Y.destroy(),J(X)};Y.once("connect",()=>q(!0)),Y.once("error",()=>q(!1)),Y.setTimeout($,()=>q(!1))})}async function K0(Q){for(let Z of["127.0.0.1","::1"])if(await N0(Z,Q))return!1;return!0}async function v1(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await K0($))return $;return Q}import{resolve as u0}from"path";var v0="*** Begin Patch",C0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function M0(Q){let Z=[];for(let $ of Q.split(`
250
- `)){let J=C0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function qZ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(v0))continue;return M0(V).map((q)=>u0(Y,q))}return[]}import{readFileSync as w0}from"fs";import{join as g0}from"path";function T0(){try{return JSON.parse(w0(g0(H(),"server.json"),"utf8"))}catch{return null}}function XZ(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${T0()?.port||process.env.PORT||zZ}`}await cQ();var UZ="";for await(let Q of process.stdin)UZ+=Q;try{let Q=JSON.parse(UZ||"{}"),Z=qZ(Q);if(Z.length){let $=u(rQ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${XZ()}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z})}).catch(()=>{})}}catch{}process.exit(0);
255
+ ${kQ}
256
+ `});var aQ={};QQ(aQ,{provisionDb:()=>z0});import{createClient as tZ}from"@libsql/client";import{drizzle as rZ}from"drizzle-orm/libsql";import{migrate as oZ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as iZ}from"drizzle-orm/migrator";import{dirname as KQ,join as eZ}from"path";import{fileURLToPath as Q0}from"url";async function o(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function Y0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function dQ(Q){if(!await o(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 V0(Q){for(let[Z,$]of Object.entries(J0)){if(!await o(Q,Z))continue;let J=await Y0(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 z0(Q,Z=$0){let $=tZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await o($,"__drizzle_migrations"),Y=await o($,"Node"),V=!1;if(Y&&!J){let X=iZ({migrationsFolder:Z})[0];if(X)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:[X.hash,X.folderMillis]}),V=!0}let q=await dQ($);if(await oZ(rZ($),{migrationsFolder:Z}),await dQ($)>q)V=!0;return await V0($),{migrated:V}}finally{$.close()}}var Z0,$0,J0;var sQ=N(async()=>{Z0=KQ(KQ(KQ(Q0(import.meta.url)))),$0=process.env.BEACON_MIGRATIONS_DIR||eZ(Z0,"drizzle"),J0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});XQ();import{existsSync as kZ}from"fs";import{homedir as _Z}from"os";import{join as t}from"path";function SZ(){return process.env.HOME||process.env.USERPROFILE||_Z()}var r=()=>t(SZ(),".claude"),BQ=()=>t(r(),"skills"),jQ=()=>t(r(),"settings.json"),PQ=()=>t(r(),"CLAUDE.md"),GQ="<!-- beacon:global:start -->",pQ="<!-- beacon:global:end -->";var hZ=y,NQ=[{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 mZ(Q,Z){return m(BQ(),Q,Z)}function cQ(Q){return M(BQ(),Q)}function pZ(Q){return p(BQ(),Q)}function cZ(Q){return L(jQ(),Q)}function nZ(Q){return k(jQ(),Q)}function lZ(Q){return _(jQ(),Q)}function dZ(Q){S(PQ(),GQ,pQ,Q)}function nQ(){return C(PQ(),GQ)}function aZ(){return h(PQ(),GQ,pQ)}function Q1(){let Q={};for(let $ of j)Q[$]=cQ($);let Z={};for(let $ of NQ)Z[$.event]=nZ({event:$.event,command:$.command});return{homeExists:kZ(r()),skills:Q,hooks:Z,claudeMdBlock:nQ()}}async function sZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (VQ(),YQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let X of j){if(!cQ(X))Y.push(X);mZ(X,J[X])}let V=0;for(let X of NQ)if(cZ({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=nQ();return dZ(hZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!q}}async function lQ(){let Q;try{Q={ok:!0,...await sZ()}}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(() => (mQ(),hQ));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 Z1(){let Q=[];for(let J of j)if(pZ(J))Q.push(J);let Z=0;for(let J of NQ)if(lZ(J))Z++;let $=aZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as q0}from"async_hooks";import{spawnSync as X0}from"child_process";import{createHash as U0}from"crypto";import{existsSync as rQ,mkdirSync as T,readFileSync as uQ,writeFileSync as CQ}from"fs";import{homedir as oQ}from"os";import{basename as W0,join as P,parse as H0,resolve as tQ}from"path";function B(){return process.env.BEACON_HOME||P(oQ(),".beacon")}function MQ(){return P(B(),"workspaces.json")}function u(Q){return U0("sha256").update(Q).digest("hex").slice(0,12)}function iQ(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 eQ(Q){let Z=tQ(Q);return Z!==tQ(oQ())&&Z!==H0(Z).root}function QZ(){return P(B(),"deleted.json")}function wQ(){try{let Q=JSON.parse(uQ(QZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function ZZ(Q){T(B(),{recursive:!0}),CQ(QZ(),JSON.stringify(Q,null,2))}function $Z(Q){return wQ().includes(Q)}function P1(Q){let Z=wQ();if(!Z.includes(Q))ZZ([...Z,Q])}function x0(Q){let Z=wQ();if(Z.includes(Q))ZZ(Z.filter(($)=>$!==Q))}function i(Q){return P(B(),Q)}function B0(Q){return`file:${P(i(Q),"db.sqlite")}`}function F(){try{let Q=JSON.parse(uQ(MQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function gQ(Q){T(B(),{recursive:!0}),CQ(MQ(),JSON.stringify(Q,null,2))}function JZ(){return F().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function G(Q){return F().find((Z)=>Z.id===Q)??null}function YZ(Q,Z,$=new Date().toISOString()){if(!eQ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=u(Q);if($Z(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=F(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||W0(Q),lastOpenedAt:$},X=[q,...Y.filter((z)=>z.id!==J)];return T(i(J),{recursive:!0}),gQ(X),q}function G1(Q,Z){return x0(u(Q)),YZ(Q,Z)}function N1(Q,Z=new Date().toISOString()){let $=F(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,gQ($)}function K1(Q){if(gQ(F().filter((Z)=>Z.id!==Q)),RQ()===Q)j0(JZ()[0]?.id??null)}function VZ(){return P(B(),"active")}function RQ(){try{return uQ(VZ(),"utf8").trim()||null}catch{return null}}function j0(Q){T(B(),{recursive:!0}),CQ(VZ(),Q??"")}function v1(){let Q=RQ();return Q?G(Q):null}function u1(){let Q=N0()??RQ();return Q?G(Q):null}function C1(Q){return G(Q)?.path??null}function M1(){return rQ(MQ())}var zZ="beacon_ws";function qZ(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 w1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=qZ(Q,zZ);if($&&G($))return $;return P0()}function P0(){let Q=JZ();return Q.length===1?Q[0].id:null}var G0="x-beacon-workspace-path";async function g1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&G(Z))return Z;let $=Q.headers.get(G0);if($&&eQ($)&&!$Z(u($))&&(!Z||u($)===Z)){let Y=YZ($);return await K0(Y.id),Y.id}let J=qZ(Q,zZ);if(J&&G(J))return J;return null}var XZ=new q0;function R1(Q,Z){return Q?XZ.run(Q,Z):Z()}function N0(){return XZ.getStore()??null}var vQ=new Set;function T1(Q){vQ.delete(P(i(Q),"db.sqlite"))}async function K0(Q){let Z=i(Q),$=P(Z,"db.sqlite"),J=rQ($);if(J&&vQ.has($))return{ok:!0,created:!1,migrated:!1};try{T(Z,{recursive:!0});let{provisionDb:Y}=await sQ().then(() => aQ),V=await Y(B0(Q));return vQ.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)}}}import{connect as v0}from"net";var UZ=4319;function u0(Q,Z,$=400){return new Promise((J)=>{let Y=v0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,Y.destroy(),J(X)};Y.once("connect",()=>q(!0)),Y.once("error",()=>q(!1)),Y.setTimeout($,()=>q(!1))})}async function C0(Q){for(let Z of["127.0.0.1","::1"])if(await u0(Z,Q))return!1;return!0}async function b1(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await C0($))return $;return Q}import{resolve as M0}from"path";var w0="*** Begin Patch",g0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function R0(Q){let Z=[];for(let $ of Q.split(`
257
+ `)){let J=g0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function WZ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(w0))continue;return R0(V).map((q)=>M0(Y,q))}return[]}import{readFileSync as T0}from"fs";import{join as F0}from"path";function f0(){try{return JSON.parse(T0(F0(B(),"server.json"),"utf8"))}catch{return null}}function HZ(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${f0()?.port||process.env.PORT||UZ}`}await lQ();var xZ="";for await(let Q of process.stdin)xZ+=Q;try{let Q=JSON.parse(xZ||"{}"),Z=WZ(Q);if(Z.length){let $=u(iQ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${HZ()}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z})}).catch(()=>{})}}catch{}process.exit(0);