trybeacon 0.1.33 → 0.1.35

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 (330) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +14 -13
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +6 -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/position/route.js.nft.json +1 -1
  40. package/.next/server/app/api/db/prune-planned/route.js +1 -1
  41. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  42. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  43. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  44. package/.next/server/app/api/draft/approve/route.js +1 -1
  45. package/.next/server/app/api/draft/route.js +1 -1
  46. package/.next/server/app/api/draft/status/route.js +1 -1
  47. package/.next/server/app/api/edges/[id]/route.js +1 -1
  48. package/.next/server/app/api/edges/route.js +1 -1
  49. package/.next/server/app/api/edges/route.js.nft.json +1 -1
  50. package/.next/server/app/api/endpoints/[id]/route.js +1 -1
  51. package/.next/server/app/api/entities/route.js +1 -1
  52. package/.next/server/app/api/feedback/[id]/route.js +1 -1
  53. package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
  54. package/.next/server/app/api/feedback/route.js +1 -1
  55. package/.next/server/app/api/ingest/route.js +2 -2
  56. package/.next/server/app/api/init/route.js +2 -2
  57. package/.next/server/app/api/init/route.js.nft.json +1 -1
  58. package/.next/server/app/api/map/describe/route.js +2 -2
  59. package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
  60. package/.next/server/app/api/map/files/route.js +1 -1
  61. package/.next/server/app/api/map/files/route.js.nft.json +1 -1
  62. package/.next/server/app/api/map/finish/route.js +1 -1
  63. package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
  64. package/.next/server/app/api/map/route.js +1 -1
  65. package/.next/server/app/api/map/route.js.nft.json +1 -1
  66. package/.next/server/app/api/map/start/route.js +1 -1
  67. package/.next/server/app/api/map/start/route.js.nft.json +1 -1
  68. package/.next/server/app/api/map/touch-active/route.js +1 -1
  69. package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
  70. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  71. package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
  72. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  73. package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
  74. package/.next/server/app/api/nodes/positions/route.js +1 -1
  75. package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
  76. package/.next/server/app/api/nodes/route.js +1 -1
  77. package/.next/server/app/api/nodes/route.js.nft.json +1 -1
  78. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  79. package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
  80. package/.next/server/app/api/notes/[id]/route.js +1 -1
  81. package/.next/server/app/api/notes/route.js +1 -1
  82. package/.next/server/app/api/open/route.js +1 -1
  83. package/.next/server/app/api/plan/annotations/route.js +3 -3
  84. package/.next/server/app/api/plan/approve/route.js +2 -2
  85. package/.next/server/app/api/plan/history/route.js +1 -1
  86. package/.next/server/app/api/plan/markdown/route.js +1 -1
  87. package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
  88. package/.next/server/app/api/plan/presence/route.js +1 -1
  89. package/.next/server/app/api/plan/route.js +1 -1
  90. package/.next/server/app/api/plan/route.js.nft.json +1 -1
  91. package/.next/server/app/api/plan/verdict/route.js +1 -1
  92. package/.next/server/app/api/preferences/route.js +1 -1
  93. package/.next/server/app/api/project-meta/route.js +1 -0
  94. package/.next/server/app/api/project-meta/route.js.nft.json +1 -0
  95. package/.next/server/app/api/project-meta/route_client-reference-manifest.js +1 -0
  96. package/.next/server/app/api/reset/route.js +1 -1
  97. package/.next/server/app/api/stream/route.js +2 -2
  98. package/.next/server/app/api/version/route.js +1 -1
  99. package/.next/server/app/api/workspace/activate/route.js +1 -1
  100. package/.next/server/app/api/workspace/route.js +1 -1
  101. package/.next/server/app/apple-icon.png/route.js +1 -1
  102. package/.next/server/app/docs/page.js +2 -2
  103. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/docs.html +1 -1
  105. package/.next/server/app/docs.rsc +2 -2
  106. package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  107. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  108. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  109. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  110. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  111. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  112. package/.next/server/app/feedback/page.js +2 -2
  113. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  114. package/.next/server/app/feedback.html +1 -1
  115. package/.next/server/app/feedback.rsc +2 -2
  116. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  117. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  118. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  119. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  120. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  121. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  122. package/.next/server/app/help/page.js +2 -2
  123. package/.next/server/app/help/page.js.nft.json +1 -1
  124. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  125. package/.next/server/app/help.html +1 -1
  126. package/.next/server/app/help.rsc +2 -2
  127. package/.next/server/app/help.segments/_full.segment.rsc +2 -2
  128. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  129. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  130. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  131. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  132. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  133. package/.next/server/app/icon.svg/route.js +1 -1
  134. package/.next/server/app/index.html +1 -1
  135. package/.next/server/app/index.rsc +2 -2
  136. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  137. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  138. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  139. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  140. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  141. package/.next/server/app/map/page.js +2 -2
  142. package/.next/server/app/map/page.js.nft.json +1 -1
  143. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  144. package/.next/server/app/page.js +2 -2
  145. package/.next/server/app/page_client-reference-manifest.js +1 -1
  146. package/.next/server/app/plan/page.js +2 -2
  147. package/.next/server/app/plan/page.js.nft.json +1 -1
  148. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  149. package/.next/server/app/settings/page.js +2 -2
  150. package/.next/server/app/settings/page.js.nft.json +1 -1
  151. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  152. package/.next/server/app-paths-manifest.json +14 -13
  153. package/.next/server/chunks/1130.js +1 -0
  154. package/.next/server/chunks/1341.js +1 -0
  155. package/.next/server/chunks/249.js +1 -1
  156. package/.next/server/chunks/2933.js +1 -1
  157. package/.next/server/chunks/{4274.js → 3269.js} +2 -2
  158. package/.next/server/chunks/3622.js +1 -0
  159. package/.next/server/chunks/4378.js +1 -1
  160. package/.next/server/chunks/4940.js +1 -0
  161. package/.next/server/chunks/7154.js +1 -0
  162. package/.next/server/chunks/9213.js +1 -1
  163. package/.next/server/chunks/9313.js +3 -3
  164. package/.next/server/chunks/9683.js +1 -1
  165. package/.next/server/chunks/9734.js +1 -1
  166. package/.next/server/middleware-build-manifest.js +1 -1
  167. package/.next/server/middleware.js +3 -3
  168. package/.next/server/pages/404.html +1 -1
  169. package/.next/server/pages/500.html +1 -1
  170. package/.next/server/server-reference-manifest.js +1 -1
  171. package/.next/server/server-reference-manifest.json +1 -1
  172. package/.next/static/chunks/1551-c19a41da7732c31e.js +1 -0
  173. package/.next/static/chunks/{1202-dfeac8ec49693586.js → 6955-c21412b6dcd86d80.js} +1 -1
  174. package/.next/static/chunks/app/_global-error/page-68515a67eece5248.js +1 -0
  175. package/.next/static/chunks/app/api/board-annotations/[id]/route-68515a67eece5248.js +1 -0
  176. package/.next/static/chunks/app/api/board-annotations/route-68515a67eece5248.js +1 -0
  177. package/.next/static/chunks/app/api/board-layout/route-68515a67eece5248.js +1 -0
  178. package/.next/static/chunks/app/api/bug-flags/[id]/route-68515a67eece5248.js +1 -0
  179. package/.next/static/chunks/app/api/bug-flags/route-68515a67eece5248.js +1 -0
  180. package/.next/static/chunks/app/api/code-graph/position/route-68515a67eece5248.js +1 -0
  181. package/.next/static/chunks/app/api/code-graph/route-68515a67eece5248.js +1 -0
  182. package/.next/static/chunks/app/api/context/feature/route-68515a67eece5248.js +1 -0
  183. package/.next/static/chunks/app/api/context/file/route-68515a67eece5248.js +1 -0
  184. package/.next/static/chunks/app/api/context/route-68515a67eece5248.js +1 -0
  185. package/.next/static/chunks/app/api/db/arrange/route-68515a67eece5248.js +1 -0
  186. package/.next/static/chunks/app/api/db/backfill-access/route-68515a67eece5248.js +1 -0
  187. package/.next/static/chunks/app/api/db/position/route-68515a67eece5248.js +1 -0
  188. package/.next/static/chunks/app/api/db/prune-planned/route-68515a67eece5248.js +1 -0
  189. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-68515a67eece5248.js +1 -0
  190. package/.next/static/chunks/app/api/db/relations/[id]/route-68515a67eece5248.js +1 -0
  191. package/.next/static/chunks/app/api/db/tables/[id]/route-68515a67eece5248.js +1 -0
  192. package/.next/static/chunks/app/api/draft/approve/route-68515a67eece5248.js +1 -0
  193. package/.next/static/chunks/app/api/draft/route-68515a67eece5248.js +1 -0
  194. package/.next/static/chunks/app/api/draft/status/route-68515a67eece5248.js +1 -0
  195. package/.next/static/chunks/app/api/edges/[id]/route-68515a67eece5248.js +1 -0
  196. package/.next/static/chunks/app/api/edges/route-68515a67eece5248.js +1 -0
  197. package/.next/static/chunks/app/api/endpoints/[id]/route-68515a67eece5248.js +1 -0
  198. package/.next/static/chunks/app/api/entities/route-68515a67eece5248.js +1 -0
  199. package/.next/static/chunks/app/api/feedback/[id]/route-68515a67eece5248.js +1 -0
  200. package/.next/static/chunks/app/api/feedback/[id]/vote/route-68515a67eece5248.js +1 -0
  201. package/.next/static/chunks/app/api/feedback/route-68515a67eece5248.js +1 -0
  202. package/.next/static/chunks/app/api/ingest/route-68515a67eece5248.js +1 -0
  203. package/.next/static/chunks/app/api/init/route-68515a67eece5248.js +1 -0
  204. package/.next/static/chunks/app/api/map/describe/route-68515a67eece5248.js +1 -0
  205. package/.next/static/chunks/app/api/map/files/route-68515a67eece5248.js +1 -0
  206. package/.next/static/chunks/app/api/map/finish/route-68515a67eece5248.js +1 -0
  207. package/.next/static/chunks/app/api/map/route-68515a67eece5248.js +1 -0
  208. package/.next/static/chunks/app/api/map/start/route-68515a67eece5248.js +1 -0
  209. package/.next/static/chunks/app/api/map/touch-active/route-68515a67eece5248.js +1 -0
  210. package/.next/static/chunks/app/api/nodes/[id]/position/route-68515a67eece5248.js +1 -0
  211. package/.next/static/chunks/app/api/nodes/[id]/route-68515a67eece5248.js +1 -0
  212. package/.next/static/chunks/app/api/nodes/positions/route-68515a67eece5248.js +1 -0
  213. package/.next/static/chunks/app/api/nodes/route-68515a67eece5248.js +1 -0
  214. package/.next/static/chunks/app/api/nodes/subtasks/route-68515a67eece5248.js +1 -0
  215. package/.next/static/chunks/app/api/notes/[id]/route-68515a67eece5248.js +1 -0
  216. package/.next/static/chunks/app/api/notes/route-68515a67eece5248.js +1 -0
  217. package/.next/static/chunks/app/api/open/route-68515a67eece5248.js +1 -0
  218. package/.next/static/chunks/app/api/plan/annotations/route-68515a67eece5248.js +1 -0
  219. package/.next/static/chunks/app/api/plan/approve/route-68515a67eece5248.js +1 -0
  220. package/.next/static/chunks/app/api/plan/history/route-68515a67eece5248.js +1 -0
  221. package/.next/static/chunks/app/api/plan/markdown/route-68515a67eece5248.js +1 -0
  222. package/.next/static/chunks/app/api/plan/presence/route-68515a67eece5248.js +1 -0
  223. package/.next/static/chunks/app/api/plan/route-68515a67eece5248.js +1 -0
  224. package/.next/static/chunks/app/api/plan/verdict/route-68515a67eece5248.js +1 -0
  225. package/.next/static/chunks/app/api/preferences/route-68515a67eece5248.js +1 -0
  226. package/.next/static/chunks/app/api/project-meta/route-68515a67eece5248.js +1 -0
  227. package/.next/static/chunks/app/api/reset/route-68515a67eece5248.js +1 -0
  228. package/.next/static/chunks/app/api/stream/route-68515a67eece5248.js +1 -0
  229. package/.next/static/chunks/app/api/version/route-68515a67eece5248.js +1 -0
  230. package/.next/static/chunks/app/api/workspace/activate/route-68515a67eece5248.js +1 -0
  231. package/.next/static/chunks/app/api/workspace/route-68515a67eece5248.js +1 -0
  232. package/.next/static/chunks/app/map/page-8417d6e5dc33e7fb.js +1 -0
  233. package/.next/static/chunks/app/plan/page-af54cdc9fb6058a3.js +1 -0
  234. package/.next/static/chunks/next/dist/client/components/builtin/app-error-68515a67eece5248.js +1 -0
  235. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-68515a67eece5248.js +1 -0
  236. package/.next/static/chunks/next/dist/client/components/builtin/not-found-68515a67eece5248.js +1 -0
  237. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-68515a67eece5248.js +1 -0
  238. package/.next/static/css/496162fa86c30a1d.css +1 -0
  239. package/.next/static/p7RuAgL_wa-K9PsrN1Js0/_buildManifest.js +1 -0
  240. package/.next/trace +38 -38
  241. package/.next/trace-build +1 -1
  242. package/.next/types/app/api/{plan → project-meta}/route.ts +3 -3
  243. package/.next/types/routes.d.ts +2 -1
  244. package/.next/types/validator.ts +9 -0
  245. package/dist/bin/beacon.js +9 -6
  246. package/dist/bin/doctor.js +31 -28
  247. package/dist/bin/hook.js +28 -25
  248. package/dist/bin/mcp.js +40 -37
  249. package/dist/bin/plan.js +31 -28
  250. package/dist/bin/remove.js +6 -6
  251. package/dist/bin/uninstall.js +30 -27
  252. package/dist/lib/assets.js +6 -3
  253. package/dist/lib/codex-install.js +6 -3
  254. package/dist/lib/global-install.js +6 -3
  255. package/dist/lib/release.js +2 -0
  256. package/dist/lib/semver.js +2 -0
  257. package/dist/lib/workspaces.js +1 -1
  258. package/drizzle/0006_optimal_chronomancer.sql +2 -0
  259. package/drizzle/meta/0006_snapshot.json +1765 -0
  260. package/drizzle/meta/_journal.json +7 -0
  261. package/package.json +1 -1
  262. package/.next/server/chunks/7138.js +0 -1
  263. package/.next/server/chunks/7373.js +0 -1
  264. package/.next/static/chunks/8252-326851ad274762f5.js +0 -1
  265. package/.next/static/chunks/app/_global-error/page-4cdc03c65547f289.js +0 -1
  266. package/.next/static/chunks/app/api/board-annotations/[id]/route-4cdc03c65547f289.js +0 -1
  267. package/.next/static/chunks/app/api/board-annotations/route-4cdc03c65547f289.js +0 -1
  268. package/.next/static/chunks/app/api/board-layout/route-4cdc03c65547f289.js +0 -1
  269. package/.next/static/chunks/app/api/bug-flags/[id]/route-4cdc03c65547f289.js +0 -1
  270. package/.next/static/chunks/app/api/bug-flags/route-4cdc03c65547f289.js +0 -1
  271. package/.next/static/chunks/app/api/code-graph/position/route-4cdc03c65547f289.js +0 -1
  272. package/.next/static/chunks/app/api/code-graph/route-4cdc03c65547f289.js +0 -1
  273. package/.next/static/chunks/app/api/context/feature/route-4cdc03c65547f289.js +0 -1
  274. package/.next/static/chunks/app/api/context/file/route-4cdc03c65547f289.js +0 -1
  275. package/.next/static/chunks/app/api/context/route-4cdc03c65547f289.js +0 -1
  276. package/.next/static/chunks/app/api/db/arrange/route-4cdc03c65547f289.js +0 -1
  277. package/.next/static/chunks/app/api/db/backfill-access/route-4cdc03c65547f289.js +0 -1
  278. package/.next/static/chunks/app/api/db/position/route-4cdc03c65547f289.js +0 -1
  279. package/.next/static/chunks/app/api/db/prune-planned/route-4cdc03c65547f289.js +0 -1
  280. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-4cdc03c65547f289.js +0 -1
  281. package/.next/static/chunks/app/api/db/relations/[id]/route-4cdc03c65547f289.js +0 -1
  282. package/.next/static/chunks/app/api/db/tables/[id]/route-4cdc03c65547f289.js +0 -1
  283. package/.next/static/chunks/app/api/draft/approve/route-4cdc03c65547f289.js +0 -1
  284. package/.next/static/chunks/app/api/draft/route-4cdc03c65547f289.js +0 -1
  285. package/.next/static/chunks/app/api/draft/status/route-4cdc03c65547f289.js +0 -1
  286. package/.next/static/chunks/app/api/edges/[id]/route-4cdc03c65547f289.js +0 -1
  287. package/.next/static/chunks/app/api/edges/route-4cdc03c65547f289.js +0 -1
  288. package/.next/static/chunks/app/api/endpoints/[id]/route-4cdc03c65547f289.js +0 -1
  289. package/.next/static/chunks/app/api/entities/route-4cdc03c65547f289.js +0 -1
  290. package/.next/static/chunks/app/api/feedback/[id]/route-4cdc03c65547f289.js +0 -1
  291. package/.next/static/chunks/app/api/feedback/[id]/vote/route-4cdc03c65547f289.js +0 -1
  292. package/.next/static/chunks/app/api/feedback/route-4cdc03c65547f289.js +0 -1
  293. package/.next/static/chunks/app/api/ingest/route-4cdc03c65547f289.js +0 -1
  294. package/.next/static/chunks/app/api/init/route-4cdc03c65547f289.js +0 -1
  295. package/.next/static/chunks/app/api/map/describe/route-4cdc03c65547f289.js +0 -1
  296. package/.next/static/chunks/app/api/map/files/route-4cdc03c65547f289.js +0 -1
  297. package/.next/static/chunks/app/api/map/finish/route-4cdc03c65547f289.js +0 -1
  298. package/.next/static/chunks/app/api/map/route-4cdc03c65547f289.js +0 -1
  299. package/.next/static/chunks/app/api/map/start/route-4cdc03c65547f289.js +0 -1
  300. package/.next/static/chunks/app/api/map/touch-active/route-4cdc03c65547f289.js +0 -1
  301. package/.next/static/chunks/app/api/nodes/[id]/position/route-4cdc03c65547f289.js +0 -1
  302. package/.next/static/chunks/app/api/nodes/[id]/route-4cdc03c65547f289.js +0 -1
  303. package/.next/static/chunks/app/api/nodes/positions/route-4cdc03c65547f289.js +0 -1
  304. package/.next/static/chunks/app/api/nodes/route-4cdc03c65547f289.js +0 -1
  305. package/.next/static/chunks/app/api/nodes/subtasks/route-4cdc03c65547f289.js +0 -1
  306. package/.next/static/chunks/app/api/notes/[id]/route-4cdc03c65547f289.js +0 -1
  307. package/.next/static/chunks/app/api/notes/route-4cdc03c65547f289.js +0 -1
  308. package/.next/static/chunks/app/api/open/route-4cdc03c65547f289.js +0 -1
  309. package/.next/static/chunks/app/api/plan/annotations/route-4cdc03c65547f289.js +0 -1
  310. package/.next/static/chunks/app/api/plan/approve/route-4cdc03c65547f289.js +0 -1
  311. package/.next/static/chunks/app/api/plan/history/route-4cdc03c65547f289.js +0 -1
  312. package/.next/static/chunks/app/api/plan/markdown/route-4cdc03c65547f289.js +0 -1
  313. package/.next/static/chunks/app/api/plan/presence/route-4cdc03c65547f289.js +0 -1
  314. package/.next/static/chunks/app/api/plan/route-4cdc03c65547f289.js +0 -1
  315. package/.next/static/chunks/app/api/plan/verdict/route-4cdc03c65547f289.js +0 -1
  316. package/.next/static/chunks/app/api/preferences/route-4cdc03c65547f289.js +0 -1
  317. package/.next/static/chunks/app/api/reset/route-4cdc03c65547f289.js +0 -1
  318. package/.next/static/chunks/app/api/stream/route-4cdc03c65547f289.js +0 -1
  319. package/.next/static/chunks/app/api/version/route-4cdc03c65547f289.js +0 -1
  320. package/.next/static/chunks/app/api/workspace/activate/route-4cdc03c65547f289.js +0 -1
  321. package/.next/static/chunks/app/api/workspace/route-4cdc03c65547f289.js +0 -1
  322. package/.next/static/chunks/app/map/page-ac03f88297a40d47.js +0 -1
  323. package/.next/static/chunks/app/plan/page-47e880f3e83a2753.js +0 -1
  324. package/.next/static/chunks/next/dist/client/components/builtin/app-error-4cdc03c65547f289.js +0 -1
  325. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-4cdc03c65547f289.js +0 -1
  326. package/.next/static/chunks/next/dist/client/components/builtin/not-found-4cdc03c65547f289.js +0 -1
  327. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-4cdc03c65547f289.js +0 -1
  328. package/.next/static/css/cb2ba3334a6b2336.css +0 -1
  329. package/.next/static/kJSpkyKRHr2jFBQoOGP8P/_buildManifest.js +0 -1
  330. /package/.next/static/{kJSpkyKRHr2jFBQoOGP8P → p7RuAgL_wa-K9PsrN1Js0}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":28718140,"timestamp":64937445,"id":14,"parentId":1,"tags":{},"startTime":1781148750348,"traceId":"739061b5b676f010"},{"name":"run-typescript","duration":11981424,"timestamp":93658188,"id":3960,"parentId":1,"tags":{},"startTime":1781148779068,"traceId":"739061b5b676f010"},{"name":"static-check","duration":688118,"timestamp":105716598,"id":3963,"parentId":1,"tags":{},"startTime":1781148791127,"traceId":"739061b5b676f010"},{"name":"static-generation","duration":4433604,"timestamp":107028395,"id":4103,"parentId":1,"tags":{},"startTime":1781148792439,"traceId":"739061b5b676f010"},{"name":"collect-build-traces","duration":13662953,"timestamp":106412651,"id":4100,"parentId":1,"tags":{},"startTime":1781148791823,"traceId":"739061b5b676f010"},{"name":"telemetry-flush","duration":60,"timestamp":120079197,"id":4112,"parentId":1,"tags":{},"startTime":1781148805489,"traceId":"739061b5b676f010"},{"name":"next-build","duration":55261353,"timestamp":64818072,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781148750228,"traceId":"739061b5b676f010"}]
1
+ [{"name":"run-webpack","duration":29275564,"timestamp":127503423,"id":14,"parentId":1,"tags":{},"startTime":1781205906327,"traceId":"9fc340e37337f1c7"},{"name":"run-typescript","duration":12093817,"timestamp":156781363,"id":3987,"parentId":1,"tags":{},"startTime":1781205935605,"traceId":"9fc340e37337f1c7"},{"name":"static-check","duration":744499,"timestamp":168895605,"id":3990,"parentId":1,"tags":{},"startTime":1781205947719,"traceId":"9fc340e37337f1c7"},{"name":"static-generation","duration":4215901,"timestamp":170631071,"id":4132,"parentId":1,"tags":{},"startTime":1781205949455,"traceId":"9fc340e37337f1c7"},{"name":"collect-build-traces","duration":13753910,"timestamp":169642981,"id":4129,"parentId":1,"tags":{},"startTime":1781205948467,"traceId":"9fc340e37337f1c7"},{"name":"telemetry-flush","duration":57,"timestamp":183400558,"id":4141,"parentId":1,"tags":{},"startTime":1781205962224,"traceId":"9fc340e37337f1c7"},{"name":"next-build","duration":56023131,"timestamp":127377495,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781205906201,"traceId":"9fc340e37337f1c7"}]
@@ -1,10 +1,10 @@
1
- // File: /home/runner/work/beacon/beacon/app/api/plan/route.ts
2
- import * as entry from '../../../../../app/api/plan/route.js'
1
+ // File: /home/runner/work/beacon/beacon/app/api/project-meta/route.ts
2
+ import * as entry from '../../../../../app/api/project-meta/route.js'
3
3
  import type { NextRequest } from 'next/server.js'
4
4
 
5
5
  import type { InstantConfigForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
6
6
 
7
- type TEntry = typeof import('../../../../../app/api/plan/route.js')
7
+ type TEntry = typeof import('../../../../../app/api/project-meta/route.js')
8
8
 
9
9
  type SegmentParams<T extends Object = any> = T extends Record<string, any>
10
10
  ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
@@ -2,7 +2,7 @@
2
2
  // Do not edit this file manually
3
3
 
4
4
  type AppRoutes = "/" | "/docs" | "/feedback" | "/help" | "/map" | "/plan" | "/settings"
5
- type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/reset" | "/api/stream" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
5
+ type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/stream" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
6
6
  type PageRoutes = never
7
7
  type LayoutRoutes = "/"
8
8
  type RedirectRoutes = never
@@ -63,6 +63,7 @@ interface ParamMap {
63
63
  "/api/plan/presence": {}
64
64
  "/api/plan/verdict": {}
65
65
  "/api/preferences": {}
66
+ "/api/project-meta": {}
66
67
  "/api/reset": {}
67
68
  "/api/stream": {}
68
69
  "/api/version": {}
@@ -569,6 +569,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
569
569
  type __Unused = __Check
570
570
  }
571
571
 
572
+ // Validate ../../app/api/project-meta/route.ts
573
+ {
574
+ type __IsExpected<Specific extends RouteHandlerConfig<"/api/project-meta">> = Specific
575
+ const handler = {} as typeof import("../../app/api/project-meta/route.js")
576
+ type __Check = __IsExpected<typeof handler>
577
+ // @ts-ignore
578
+ type __Unused = __Check
579
+ }
580
+
572
581
  // Validate ../../app/api/reset/route.ts
573
582
  {
574
583
  type __IsExpected<Specific extends RouteHandlerConfig<"/api/reset">> = Specific
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{execSync as v,spawn as b}from"child_process";import{existsSync as E,mkdirSync as S,openSync as k,readFileSync as f,writeFileSync as h}from"fs";import{homedir as m,platform as w}from"os";import{basename as u,dirname as M,join as V}from"path";import{fileURLToPath as g}from"url";var y=M(g(import.meta.url)),F=u(M(y))==="dist",B=F?M(M(y)):M(y),P=process.cwd(),j=process.env.BEACON_HOME||V(m(),".beacon"),_=V(j,"server.json"),O=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=V(B,"drizzle");function $(z){if(!F)return V(B,z);return V(B,"dist",z.replace(/\.ts$/,".js"))}var Q=process.argv[2];if(Q==="mcp")await import($("bin/mcp.ts"));else if(Q==="hook")await import($("bin/hook.ts"));else if(Q==="plan")await import($("bin/plan.ts"));else if(Q==="prompt")await import($("bin/prompt.ts"));else if(Q==="stop-hook")await import($("bin/stop-hook.ts"));else if(Q==="stop")s();else if(Q==="remove")await import($("bin/remove.ts"));else if(Q==="setup")await A(R()||P);else if(Q==="doctor")await import($("bin/doctor.ts"));else if(Q==="uninstall")await import($("bin/uninstall.ts"));else await a();async function A(z,X=!1){let{installInitSkill:J,installRefreshSkill:q,installCodexRepoSkills:W,ensureMcp:G,ensureWorkflowDoc:H}=await import($("lib/assets.ts")),{selfHealGlobal:I}=await import($("lib/global-install.ts")),{codexDetected:L}=await import($("lib/codex-install.ts")),Y=await I(),K=J(z),Z=q(z);H(z);let N=G(z),T=L()?W(z):[];if(X){if(N.added)console.log(`[beacon] registered Beacon MCP in ${N.path} \u2014 restart your agent CLI to use @beacon mentions.`)}else{console.log(`
4
- \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${K}`),console.log(` \u2713 skill: ${Z}`);for(let U of T)console.log(` \u2713 skill: ${U}`);console.log(` ${N.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${N.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
- `)}return{initSkill:K,refreshSkill:Z,mcp:N,codexSkills:T,heal:Y}}function R(){try{return v("git rev-parse --show-toplevel",{cwd:P,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function x(z){try{return process.kill(z,0),!0}catch{return!1}}function C(z){try{return JSON.parse(f(z,"utf8"))}catch{return null}}async function D(z){try{return(await fetch(z)).ok}catch{return!1}}async function t(z,X=60){for(let J=0;J<X;J++){if(await D(z))return!0;await new Promise((q)=>setTimeout(q,500))}return!1}function c(){S(j,{recursive:!0});let z=k(V(j,"server.log"),"a"),X={...process.env,PORT:O,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:V(B,"drizzle")};delete X.BEACON_REPO,delete X.BEACON_DATA_DIR,delete X.DATABASE_URL;let q=b("bun",F?["run","start"]:["run","dev"],{cwd:B,env:X,detached:!0,stdio:["ignore",z,z]});q.unref();let W={pid:q.pid??0,port:O};return h(_,JSON.stringify(W)),W}async function p(){let z=C(_);if(z&&x(z.pid)&&await D(`http://localhost:${z.port}/api/workspace`))return z.port;console.log("[beacon] starting the Beacon server\u2026");let{port:X}=c();if(!await t(`http://localhost:${X}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return X}function d(z){if(process.env.BEACON_NO_OPEN)return;let X=w()==="darwin"?"open":w()==="win32"?"start":"xdg-open";try{v(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function a(){let z=R()||P,{addWorkspace:X,idForPath:J,dataDirFor:q,ensureWorkspaceDb:W}=await import($("lib/workspaces.ts")),G=J(z),H=q(G),I=!E(V(H,"db.sqlite"));if(I)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let L=await W(G);if(!L.ok)console.error(`[beacon] failed to provision database: ${L.error}`);if(I)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:Y}=await A(z,!0),K=[];if(Y.skillsAdded.length)K.push(`skills ${Y.skillsAdded.join(", ")}`);if(Y.hooksAdded)K.push(`${Y.hooksAdded} Claude Code hook${Y.hooksAdded===1?"":"s"}`);if(Y.claudeMdBlockTouched)K.push("global CLAUDE.md block");if(K.length)console.log(`[beacon] wired into ~/.claude/: ${K.join(" + ")}.`);let Z=Y.codex;if(Z){let U=[];if(Z.skillsAdded.length)U.push(`skills ${Z.skillsAdded.join(", ")}`);if(Z.hooksAdded)U.push(`${Z.hooksAdded} Codex hook${Z.hooksAdded===1?"":"s"}`);if(Z.agentsMdBlockTouched)U.push("global AGENTS.md block");if(Z.mcp.added)U.push("MCP entry in config.toml");if(U.length)console.log(`[beacon] wired into ~/.codex/: ${U.join(" + ")}.`);if(Z.mcp.error)console.log(`[beacon] codex MCP not wired: ${Z.mcp.error}`)}X(z);let N=await p(),T=`http://localhost:${N}/api/workspace/activate?id=${G}&redirect=/map`;console.log(`
3
+ import{execSync as v,spawn as S}from"child_process";import{existsSync as f,mkdirSync as h,openSync as m,readFileSync as g,writeFileSync as u}from"fs";import{homedir as d,platform as w}from"os";import{basename as c,dirname as F,join as G}from"path";import{fileURLToPath as p}from"url";var P=F(p(import.meta.url)),L=c(F(P))==="dist",B=L?F(F(P)):F(P),O=process.cwd(),T=process.env.BEACON_HOME||G(d(),".beacon"),_=G(T,"server.json"),R=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=G(B,"drizzle");function Q(z){if(!L)return G(B,z);return G(B,"dist",z.replace(/\.ts$/,".js"))}var $=process.argv[2];if($==="mcp")await import(Q("bin/mcp.ts"));else if($==="hook")await import(Q("bin/hook.ts"));else if($==="plan")await import(Q("bin/plan.ts"));else if($==="prompt")await import(Q("bin/prompt.ts"));else if($==="stop-hook")await import(Q("bin/stop-hook.ts"));else if($==="stop")k();else if($==="remove")await import(Q("bin/remove.ts"));else if($==="setup")await x(C()||O);else if($==="doctor")await import(Q("bin/doctor.ts"));else if($==="uninstall")await import(Q("bin/uninstall.ts"));else if($==="update")await i(process.argv.includes("--force")||process.argv.includes("-f"));else if($==="version"||$==="--version"||$==="-v")console.log(b());else await s();async function x(z,X=!1){let{installInitSkill:q,installRefreshSkill:J,installCodexRepoSkills:Y,ensureMcp:H,ensureWorkflowDoc:V}=await import(Q("lib/assets.ts")),{selfHealGlobal:I}=await import(Q("lib/global-install.ts")),{codexDetected:j}=await import(Q("lib/codex-install.ts")),M=await I(),K=q(z),U=J(z);V(z);let Z=H(z),y=j()?Y(z):[];if(X){if(Z.added)console.log(`[beacon] registered Beacon MCP in ${Z.path} \u2014 restart your agent CLI to use @beacon mentions.`)}else{console.log(`
4
+ \u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${K}`),console.log(` \u2713 skill: ${U}`);for(let N of y)console.log(` \u2713 skill: ${N}`);console.log(` ${Z.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${Z.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
5
+ `)}return{initSkill:K,refreshSkill:U,mcp:Z,codexSkills:y,heal:M}}function C(){try{return v("git rev-parse --show-toplevel",{cwd:O,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function E(z){try{return process.kill(z,0),!0}catch{return!1}}function A(z){try{return JSON.parse(g(z,"utf8"))}catch{return null}}async function D(z){try{return(await fetch(z)).ok}catch{return!1}}async function t(z,X=60){for(let q=0;q<X;q++){if(await D(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function a(){h(T,{recursive:!0});let z=m(G(T,"server.log"),"a"),X={...process.env,PORT:R,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:G(B,"drizzle")};delete X.BEACON_REPO,delete X.BEACON_DATA_DIR,delete X.DATABASE_URL;let J=S("bun",L?["run","start"]:["run","dev"],{cwd:B,env:X,detached:!0,stdio:["ignore",z,z]});J.unref();let Y={pid:J.pid??0,port:R};return u(_,JSON.stringify(Y)),Y}async function l(){let z=A(_);if(z&&E(z.pid)&&await D(`http://localhost:${z.port}/api/workspace`))return z.port;console.log("[beacon] starting the Beacon server\u2026");let{port:X}=a();if(!await t(`http://localhost:${X}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return X}function n(z){if(process.env.BEACON_NO_OPEN)return;let X=w()==="darwin"?"open":w()==="win32"?"start":"xdg-open";try{v(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function s(){let z=C()||O,{registerWorkspaceExplicit:X,idForPath:q,dataDirFor:J,ensureWorkspaceDb:Y,isRegistrableWorkspacePath:H}=await import(Q("lib/workspaces.ts"));if(!H(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
6
+ `+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let V=q(z),I=J(V),j=!f(G(I,"db.sqlite"));if(j)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let M=await Y(V);if(!M.ok)console.error(`[beacon] failed to provision database: ${M.error}`);if(j)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:K}=await x(z,!0),U=[];if(K.skillsAdded.length)U.push(`skills ${K.skillsAdded.join(", ")}`);if(K.hooksAdded)U.push(`${K.hooksAdded} Claude Code hook${K.hooksAdded===1?"":"s"}`);if(K.claudeMdBlockTouched)U.push("global CLAUDE.md block");if(U.length)console.log(`[beacon] wired into ~/.claude/: ${U.join(" + ")}.`);let Z=K.codex;if(Z){let W=[];if(Z.skillsAdded.length)W.push(`skills ${Z.skillsAdded.join(", ")}`);if(Z.hooksAdded)W.push(`${Z.hooksAdded} Codex hook${Z.hooksAdded===1?"":"s"}`);if(Z.agentsMdBlockTouched)W.push("global AGENTS.md block");if(Z.mcp.added)W.push("MCP entry in config.toml");if(W.length)console.log(`[beacon] wired into ~/.codex/: ${W.join(" + ")}.`);if(Z.mcp.error)console.log(`[beacon] codex MCP not wired: ${Z.mcp.error}`)}X(z);let y=await l(),N=`http://localhost:${y}/api/workspace/activate?id=${V}&redirect=/map`;console.log(`
6
7
  \u25C9 Beacon
7
8
  repo: ${z}
8
- data: ${H}
9
- url: http://localhost:${N}
10
- `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),d(T)}function s(){let z=C(_);if(z&&x(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
9
+ data: ${I}
10
+ url: http://localhost:${y}
11
+ `),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),n(N)}function b(){return A(G(B,"package.json"))?.version??"0.0.0"}async function i(z){let X=b(),{INSTALL_COMMAND:q,NPM_LATEST_URL:J}=await import(Q("lib/release.ts"));if(w()==="win32"){console.log(`[beacon] current version v${X}.`),console.log(`[beacon] on Windows, update with your package manager:
12
+ npm i -g trybeacon@latest`);return}let Y=null;try{let H=await fetch(J);if(H.ok)Y=(await H.json()).version??null}catch{}if(Y&&!z){let{isNewerVersion:H}=await import(Q("lib/semver.ts"));if(!H(Y,X)){console.log(`[beacon] already on the latest version (v${X}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(Y?`[beacon] updating Beacon v${X} \u2192 v${Y}\u2026`:`[beacon] reinstalling Beacon (current v${X})\u2026`);try{v(q,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
13
+ ${q}`),process.exitCode=1;return}k(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function k(){let z=A(_);if(z&&E(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var HZ=Object.defineProperty;var jZ=(Q)=>Q;function vZ(Q,Z){this[Q]=jZ.bind(null,Z)}var XQ=(Q,Z)=>{for(var $ in Z)HZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:vZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var jQ={};XQ(jQ,{removeRepoAssets:()=>fZ,installRefreshSkill:()=>NZ,installPlanSkill:()=>xZ,installInitSkill:()=>BZ,installCodexRepoSkills:()=>KZ,ensureWorkflowDoc:()=>CZ,ensureMcp:()=>MZ,auditRepo:()=>HQ,REFRESH_SKILL:()=>WQ,PLAN_SKILL:()=>_Q,INIT_SKILL:()=>UQ});import{existsSync as w,mkdirSync as _,readFileSync as x,rmSync as b,writeFileSync as N}from"fs";import{join as q}from"path";function BZ(Q){let Z=q(Q,".claude","skills","beacon-init");_(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,UQ),$}function NZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");_(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,WQ),$}function xZ(Q){let Z=q(Q,".claude","skills","beacon-plan");_(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,_Q),$}function KZ(Q){let Z=[];for(let $ of GZ){let J=q(Q,".agents","skills",$.name);_(J,{recursive:!0});let Y=q(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function CZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${k}[\\s\\S]*?${PQ}`);$=J.test($)?$.replace(J,bQ):`${$.trim()}
3
+ var CZ=Object.defineProperty;var MZ=(Q)=>Q;function fZ(Q,Z){this[Q]=MZ.bind(null,Z)}var UQ=(Q,Z)=>{for(var $ in Z)CZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:fZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var BQ={};UQ(BQ,{removeRepoAssets:()=>IZ,installRefreshSkill:()=>wZ,installPlanSkill:()=>TZ,installInitSkill:()=>uZ,installCodexRepoSkills:()=>gZ,ensureWorkflowDoc:()=>RZ,ensureMcp:()=>EZ,auditRepo:()=>PQ,REFRESH_SKILL:()=>HQ,PLAN_SKILL:()=>hQ,INIT_SKILL:()=>WQ});import{existsSync as u,mkdirSync as k,readFileSync as G,rmSync as _,writeFileSync as N}from"fs";import{join as q}from"path";function uZ(Q){let Z=q(Q,".claude","skills","beacon-init");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,WQ),$}function wZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,HQ),$}function TZ(Q){let Z=q(Q,".claude","skills","beacon-plan");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,hQ),$}function gZ(Q){let Z=[];for(let $ of FZ){let J=q(Q,".agents","skills",$.name);k(J,{recursive:!0});let Y=q(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function RZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=G(Z,"utf8")}catch{}let J=new RegExp(`${L}[\\s\\S]*?${jQ}`);$=J.test($)?$.replace(J,SQ):`${$.trim()}
4
4
 
5
- ${bQ}
5
+ ${SQ}
6
6
  `.trimStart(),N(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
- `);let Y=q(Q,"CLAUDE.md"),V="";try{V=x(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))N(Y,`${V?`${V.trim()}
8
+ `);let Y=q(Q,"CLAUDE.md"),V="";try{V=G(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))N(Y,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function MZ(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"]},N(Z,JSON.stringify($,null,2)+`
12
- `),{path:Z,added:!0}}function HQ(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":w(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":w(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":w(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":w(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function fZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let j=q(Q,".claude","skills",z);if(w(j))b(j,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let j=q(Q,".agents","skills",z);if(w(j))b(j,{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)b(J,{force:!0});else N(J,JSON.stringify(z,null,2)+`
13
- `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),j=new RegExp(`\\n?${k}[\\s\\S]*?${PQ}\\n?`);if(j.test(z)){let qQ=z.replace(j,`
11
+ `)}function EZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(G(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},N(Z,JSON.stringify($,null,2)+`
12
+ `),{path:Z,added:!0}}function PQ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(G(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=G(q(Q,"AGENTS.md"),"utf8").includes(L)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(G(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":u(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":u(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":u(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":u(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function IZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=q(Q,".claude","skills",z);if(u(P))_(P,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let P=q(Q,".agents","skills",z);if(u(P))_(P,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(G(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 N(J,JSON.stringify(z,null,2)+`
13
+ `)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=G(V,"utf8"),P=new RegExp(`\\n?${L}[\\s\\S]*?${jQ}\\n?`);if(P.test(z)){let XQ=z.replace(P,`
14
14
  `).replace(/\n{3,}/g,`
15
15
 
16
- `).trimStart();N(V,qQ.endsWith(`
17
- `)?qQ:`${qQ}
18
- `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),j=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(j!==z){if(!j.trim())b(U,{force:!0});else N(U,j);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var UQ=`---
16
+ `).trimStart();N(V,XQ.endsWith(`
17
+ `)?XQ:`${XQ}
18
+ `),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=G(U,"utf8"),P=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==z){if(!P.trim())_(U,{force:!0});else N(U,P);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var WQ=`---
19
19
  name: beacon-init
20
20
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
21
21
  ---
@@ -28,8 +28,9 @@ The user already has Beacon running. You're going to map this repository's archi
28
28
 
29
29
  A single \`beacon_init_persist\` MCP tool call with:
30
30
 
31
- - **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), and \`depends\` listing other component titles it relies on. Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
32
- - **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card.
31
+ - **hasFrontend**: \`true\` or \`false\` \u2014 does this repo have a frontend surface (UI code)? You just read the repo, so you know. Set it explicitly; it gates the frontend/backend \`layer\` distinction on the boards (a pure-backend repo never shows it).
32
+ - **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), \`depends\` listing other component titles it relies on \u2014 and, when \`hasFrontend\` is true, \`layer\` (\`"frontend" | "backend" | "fullstack"\`). Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
33
+ - **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card. When \`hasFrontend\` is true, give each a \`layer\` too (\`"frontend" | "backend" | "fullstack"\`).
33
34
  - **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
34
35
  - **conventions**: 3\u20138 concrete rules a contributor MUST follow \u2014 build/test commands, where code goes, patterns, things easy to get wrong. Infer from actual files, not assumptions.
35
36
  - **snapshot** (optional but encouraged): \`{ tables, relations, endpoints }\` for the existing database. If the project uses Prisma, read \`prisma/schema.prisma\`. If SQLAlchemy, read the model files. If Django, read \`models.py\`. If you find no obvious schema source, skip the snapshot \u2014 don't fabricate.
@@ -52,7 +53,7 @@ A single \`beacon_init_persist\` MCP tool call with:
52
53
  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.
53
54
 
54
55
  After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
55
- `,WQ=`---
56
+ `,HQ=`---
56
57
  name: beacon-refresh
57
58
  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.
58
59
  ---
@@ -87,7 +88,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
87
88
  - **~ changed**: COMPONENT_X (role expanded to cover Y)
88
89
  - **schema**: + 2 new tables (TableA, TableB); + 3 new endpoints; \u2212 1 deprecated endpoint
89
90
  No need to wait for confirmation \u2014 just show the diff so the user sees what's about to land.
90
- 5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
91
+ 5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`, \`hasFrontend\` \u2014 re-assert it, the stack may have changed). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
91
92
 
92
93
  ## What you should NOT do
93
94
 
@@ -99,7 +100,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
99
100
  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.
100
101
 
101
102
  After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
102
- `,_Q=`---
103
+ `,hQ=`---
103
104
  name: beacon-plan
104
105
  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.
105
106
  ---
@@ -141,7 +142,7 @@ If it returns feedback, revise and call it again.
141
142
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
142
143
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
143
144
  run \`beacon\` in this repo once.
144
- `,GZ,k="<!-- beacon:workflow:start -->",PQ="<!-- beacon:workflow:end -->",bQ;var L=g(()=>{GZ=[{name:"beacon-init",body:()=>UQ},{name:"beacon-refresh",body:()=>WQ}];bQ=`${k}
145
+ `,FZ,L="<!-- beacon:workflow:start -->",jQ="<!-- beacon:workflow:end -->",SQ;var S=g(()=>{FZ=[{name:"beacon-init",body:()=>WQ},{name:"beacon-refresh",body:()=>HQ}];SQ=`${L}
145
146
  ## Beacon \u2014 feature workflow
146
147
 
147
148
  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:
@@ -166,6 +167,8 @@ When listing endpoints, give each \`uses: [{ table, access }]\` so the endpoint\
166
167
 
167
168
  EVERY feature MUST carry \`category\` (e.g. AUTH | SEARCH | DATA | INTEL | BILLING | \u2026; \`cluster\` is accepted as an alias) and \`priority\` (0 = P0 critical, 1 = P1 high, 2 = P2 medium, 3 = P3 low). Beacon REJECTS a plan whose features omit either \u2014 \`beacon_propose_plan\` returns the list of what's missing, and an ExitPlanMode \`\`\`beacon block is denied \u2014 so set both on every feature instead of relying on defaults.
168
169
 
170
+ When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_start_feature\`, \`beacon_add_subtasks\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_describe_feature\` / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
171
+
169
172
  REUSE before you create. Call \`beacon_map\` to see the features + categories that already exist. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category \u2014 so don't re-create work that's already on the board, and reuse an existing category rather than a near-synonym. \`category\` is the ONLY domain field. \`front\` (in \`beacon_start_feature\`) nests a feature UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
170
173
 
171
174
  When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
@@ -197,18 +200,18 @@ Register them all in that single batched call. If a plan added five features, th
197
200
  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.
198
201
 
199
202
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
200
- ${PQ}`});import{existsSync as kQ,mkdirSync as vQ,readFileSync as S,rmSync as wZ,writeFileSync as m}from"fs";import{dirname as LQ,join as h}from"path";function BQ(Q){try{return JSON.parse(S(Q,"utf8"))}catch{return{}}}function hQ(Q,Z){vQ(LQ(Q),{recursive:!0}),m(Q,JSON.stringify(Z,null,2)+`
201
- `)}function c(Q,Z){let $=BQ(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}]}),hQ(Q,$),!0}function l(Q,Z){return(BQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function n(Q,Z){let $=BQ(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((j)=>j.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 hQ(Q,$),!0}function t(Q,Z,$,J){let Y=`${Z}
203
+ ${jQ}`});import{existsSync as mQ,mkdirSync as vQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as pQ,join as h}from"path";function NQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function cQ(Q,Z){vQ(pQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
204
+ `)}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}]}),cQ(Q,$),!0}function n(Q,Z){return(NQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function s(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((P)=>P.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 cQ(Q,$),!0}function t(Q,Z,$,J){let Y=`${Z}
202
205
  ${J.trim()}
203
- ${$}`,V="";try{V=S(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
206
+ ${$}`,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()}
204
207
 
205
208
  ${Y}
206
209
  `:`${Y}
207
- `,vQ(LQ(Q),{recursive:!0}),m(Q,V.endsWith(`
210
+ `,vQ(pQ(Q),{recursive:!0}),p(Q,V.endsWith(`
208
211
  `)?V:`${V}
209
- `)}function R(Q,Z){try{return S(Q,"utf8").includes(Z)}catch{return!1}}function s(Q,Z,$){let J="";try{J=S(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,`
212
+ `)}function R(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,`
210
213
 
211
- `).trimStart();return m(Q,V),!0}function a(Q,Z,$){let J=h(Q,Z);vQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return m(Y,$),Y}function E(Q,Z){return kQ(h(Q,Z,"SKILL.md"))}function d(Q,Z){let $=h(Q,Z);if(!kQ($))return!1;return wZ($,{recursive:!0,force:!0}),!0}var v,p=`## Beacon (visual planning panel)
214
+ `).trimStart();return p(Q,V),!0}function d(Q,Z,$){let J=h(Q,Z);vQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function E(Q,Z){return mQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!mQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var B,c=`## Beacon (visual planning panel)
212
215
 
213
216
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
214
217
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -229,19 +232,19 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
229
232
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
230
233
  on the /map and /db boards (added features, attached subtasks, edited columns, new
231
234
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
232
- verbatim. Do NOT implement until the tool returns approval.`;var NQ=g(()=>{v=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as uZ,renameSync as TZ,rmSync as FZ,writeFileSync as gZ}from"fs";import{dirname as RZ}from"path";function xQ(Q,Z){uZ(RZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{gZ($,Z),TZ($,Q)}catch(J){throw FZ($,{force:!0}),J}}var SQ=()=>{};var sQ={};XQ(sQ,{setupCodexAssets:()=>DZ,removeCodexMcp:()=>tQ,removeCodexArtifacts:()=>OZ,hasCodexMcp:()=>MQ,ensureCodexMcp:()=>nQ,codexMcpProblem:()=>fQ,codexDetected:()=>QQ,auditCodex:()=>wQ,CODEX_HOOKS:()=>K});import{readFileSync as e}from"fs";import{homedir as EZ}from"os";import{join as O}from"path";function mQ(){return process.env.HOME||process.env.USERPROFILE||EZ()}function QQ(){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 D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function MQ(){try{return Boolean(D(e(u(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function fQ(){let Q="";try{Q=e(u(),"utf8")}catch{return null}let Z=D(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 nQ(){let Q="",Z=!1;try{Q=e(u(),"utf8"),Z=!0}catch{}if(Z){let V=D(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(`
235
+ verbatim. Do NOT implement until the tool returns approval.`;var xQ=g(()=>{B=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as OZ,renameSync as AZ,rmSync as yZ,writeFileSync as bZ}from"fs";import{dirname as _Z}from"path";function GQ(Q,Z){OZ(_Z(Q),{recursive:!0});let $=`${Q}.tmp`;try{bZ($,Z),AZ($,Q)}catch(J){throw yZ($,{force:!0}),J}}var lQ=()=>{};var oQ={};UQ(oQ,{setupCodexAssets:()=>SZ,removeCodexMcp:()=>rQ,removeCodexArtifacts:()=>hZ,hasCodexMcp:()=>fQ,ensureCodexMcp:()=>dQ,codexMcpProblem:()=>uQ,codexDetected:()=>ZQ,auditCodex:()=>wQ,CODEX_HOOKS:()=>C});import{readFileSync as QQ}from"fs";import{homedir as kZ}from"os";import{join as O}from"path";function nQ(){return process.env.HOME||process.env.USERPROFILE||kZ()}function ZQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function fQ(){try{return Boolean(D(QQ(w(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function uQ(){let Q="";try{Q=QQ(w(),"utf8")}catch{return null}let Z=D(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 dQ(){let Q="",Z=!1;try{Q=QQ(w(),"utf8"),Z=!0}catch{}if(Z){let V=D(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(`
233
236
  `)?`
234
237
  `:`
235
238
 
236
- `,J=Q+$+IZ;if(D(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return xQ(u(),J),{added:!0}}function tQ(){let Q="";try{Q=e(u(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
237
- `),$=Z.indexOf(cQ);if($===-1)return{removed:!1,skipped:MQ()};let J=Z.indexOf(lQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
239
+ `,J=Q+$+LZ;if(D(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return GQ(w(),J),{added:!0}}function rQ(){let Q="";try{Q=QQ(w(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
240
+ `),$=Z.indexOf(tQ);if($===-1)return{removed:!1,skipped:fQ()};let J=Z.indexOf(aQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
238
241
  `).replace(/\n{3,}/g,`
239
242
 
240
- `).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return xQ(u(),Y),{removed:!0}}async function DZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (L(),jQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of v){if(!E(i(),z))Y.push(z);a(i(),z,J[z])}let V=0;for(let z of K)if(c(CQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=R(r(),o);t(r(),o,pQ,p);let U=nQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function wQ(){let Q={};for(let $ of v)Q[$]=E(i(),$);let Z={};for(let $ of K)Z[$.event]=l(CQ(),{event:$.event,command:$.command});return{detected:QQ(),skills:Q,hooks:Z,agentsMdBlock:R(r(),o),mcp:MQ()}}function OZ(){let Q=[];for(let Y of v)if(d(i(),Y))Q.push(Y);let Z=0;for(let Y of K)if(n(CQ(),{event:Y.event,command:Y.command}))Z++;let $=s(r(),o,pQ),J=tQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var KQ=()=>O(mQ(),".codex"),CQ=()=>O(KQ(),"hooks.json"),u=()=>O(KQ(),"config.toml"),r=()=>O(KQ(),"AGENTS.md"),i=()=>O(mQ(),".agents","skills"),o="<!-- beacon:global:start -->",pQ="<!-- beacon:global:end -->",K,GQ,cQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",lQ="# beacon:end",IZ,I="add it manually: codex mcp add beacon -- beacon mcp";var uQ=g(()=>{NQ();SQ();K=[{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."}];IZ=`${cQ}
243
+ `).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return GQ(w(),Y),{removed:!0}}async function SZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),BQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of B){if(!E(i(),z))Y.push(z);d(i(),z,J[z])}let V=0;for(let z of C)if(l(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=R(o(),e);t(o(),e,sQ,c);let U=dQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function wQ(){let Q={};for(let $ of B)Q[$]=E(i(),$);let Z={};for(let $ of C)Z[$.event]=n(MQ(),{event:$.event,command:$.command});return{detected:ZQ(),skills:Q,hooks:Z,agentsMdBlock:R(o(),e),mcp:fQ()}}function hZ(){let Q=[];for(let Y of B)if(r(i(),Y))Q.push(Y);let Z=0;for(let Y of C)if(s(MQ(),{event:Y.event,command:Y.command}))Z++;let $=a(o(),e,sQ),J=rQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>O(nQ(),".codex"),MQ=()=>O(CQ(),"hooks.json"),w=()=>O(CQ(),"config.toml"),o=()=>O(CQ(),"AGENTS.md"),i=()=>O(nQ(),".agents","skills"),e="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->",C,KQ,tQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",aQ="# beacon:end",LZ,I="add it manually: codex mcp add beacon -- beacon mcp";var TQ=g(()=>{xQ();lQ();C=[{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."}];LZ=`${tQ}
241
244
  [mcp_servers.beacon]
242
245
  command = "beacon"
243
246
  args = ["mcp"]
244
- ${lQ}
245
- `});var eQ={};XQ(eQ,{provisionDb:()=>$0});import{createClient as nZ}from"@libsql/client";import{drizzle as tZ}from"drizzle-orm/libsql";import{migrate as sZ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as aZ}from"drizzle-orm/migrator";import{dirname as EQ,join as dZ}from"path";import{fileURLToPath as rZ}from"url";async function JQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function Q0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function oQ(Q){if(!await JQ(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 Z0(Q){for(let[Z,$]of Object.entries(eZ)){if(!await JQ(Q,Z))continue;let J=await Q0(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 $0(Q,Z=oZ){let $=nZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await JQ($,"__drizzle_migrations"),Y=await JQ($,"Node"),V=!1;if(Y&&!J){let U=aZ({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 oQ($);if(await sZ(tZ($),{migrationsFolder:Z}),await oQ($)>X)V=!0;return await Z0($),{migrated:V}}finally{$.close()}}var iZ,oZ,eZ;var QZ=g(async()=>{iZ=EQ(EQ(EQ(rZ(import.meta.url)))),oZ=process.env.BEACON_MIGRATIONS_DIR||dZ(iZ,"drizzle"),eZ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});NQ();import{existsSync as yZ}from"fs";import{homedir as AZ}from"os";import{join as ZQ}from"path";function bZ(){return process.env.HOME||process.env.USERPROFILE||AZ()}var $Q=()=>ZQ(bZ(),".claude"),TQ=()=>ZQ($Q(),"skills"),FQ=()=>ZQ($Q(),"settings.json"),gQ=()=>ZQ($Q(),"CLAUDE.md"),RQ="<!-- beacon:global:start -->",aQ="<!-- beacon:global:end -->";var _Z=p,T=[{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 kZ(Q,Z){return a(TQ(),Q,Z)}function dQ(Q){return E(TQ(),Q)}function LZ(Q){return d(TQ(),Q)}function hZ(Q){return c(FQ(),Q)}function SZ(Q){return l(FQ(),Q)}function mZ(Q){return n(FQ(),Q)}function pZ(Q){t(gQ(),RQ,aQ,Q)}function rQ(){return R(gQ(),RQ)}function cZ(){return s(gQ(),RQ,aQ)}function iQ(){let Q={};for(let $ of v)Q[$]=dQ($);let Z={};for(let $ of T)Z[$.event]=SZ({event:$.event,command:$.command});return{homeExists:yZ($Q()),skills:Q,hooks:Z,claudeMdBlock:rQ()}}async function lZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (L(),jQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of v){if(!dQ(U))Y.push(U);kZ(U,J[U])}let V=0;for(let U of T)if(hZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=rQ();return pZ(_Z),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function m0(){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(() => (uQ(),sQ));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 p0(){let Q=[];for(let J of v)if(LZ(J))Q.push(J);let Z=0;for(let J of T)if(mZ(J))Z++;let $=cZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as J0}from"async_hooks";import{spawnSync as Y0}from"child_process";import{createHash as V0}from"crypto";import{existsSync as ZZ,mkdirSync as YQ,readFileSync as $Z,writeFileSync as JZ}from"fs";import{homedir as z0}from"os";import{basename as q0,join as M}from"path";function G(){return process.env.BEACON_HOME||M(z0(),".beacon")}function DQ(){return M(G(),"workspaces.json")}function YZ(Q){return V0("sha256").update(Q).digest("hex").slice(0,12)}function $1(Q=process.cwd()){let Z=Y0("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 VQ(Q){return M(G(),Q)}function X0(Q){return`file:${M(VQ(Q),"db.sqlite")}`}function y(){try{let Q=JSON.parse($Z(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function OQ(Q){YQ(G(),{recursive:!0}),JZ(DQ(),JSON.stringify(Q,null,2))}function yQ(){return y().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function C(Q){return y().find((Z)=>Z.id===Q)??null}function U0(Q,Z,$=new Date().toISOString()){let J=YZ(Q),Y=y(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||q0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return YQ(VQ(J),{recursive:!0}),OQ(U),X}function J1(Q,Z=new Date().toISOString()){let $=y(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,OQ($)}function Y1(Q){if(OQ(y().filter((Z)=>Z.id!==Q)),AQ()===Q)W0(yQ()[0]?.id??null)}function VZ(){return M(G(),"active")}function AQ(){try{return $Z(VZ(),"utf8").trim()||null}catch{return null}}function W0(Q){YQ(G(),{recursive:!0}),JZ(VZ(),Q??"")}function V1(){let Q=AQ();return Q?C(Q):null}function z1(){let Q=H0()??AQ();return Q?C(Q):null}function q1(Q){return C(Q)?.path??null}function X1(){return ZZ(DQ())}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 U1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&C(Z))return Z;let $=qZ(Q,zZ);if($&&C($))return $;return null}var P0="x-beacon-workspace-path";async function W1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&C(Z))return Z;let $=Q.headers.get(P0);if($&&(!Z||YZ($)===Z)){let Y=U0($);return await j0(Y.id),Y.id}let J=qZ(Q,zZ);if(J&&C(J))return J;return null}var XZ=new J0;function P1(Q,Z){return Q?XZ.run(Q,Z):Z()}function H0(){return XZ.getStore()??null}var IQ=new Set;function H1(Q){IQ.delete(M(VQ(Q),"db.sqlite"))}async function j0(Q){let Z=VQ(Q),$=M(Z,"db.sqlite"),J=ZZ($);if(J&&IQ.has($))return{ok:!0,created:!1,migrated:!1};try{YQ(Z,{recursive:!0});let{provisionDb:Y}=await QZ().then(() => eQ),V=await Y(X0(Q));return IQ.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)}}}L();uQ();import{execSync as v0,spawnSync as UZ}from"child_process";import{existsSync as B0,readFileSync as N0}from"fs";import{join as WZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,P=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,f=(Q)=>`\x1B[2m${Q}\x1B[0m`,A=(Q)=>`
246
- \x1B[1m${Q}\x1B[0m`;function x0(){try{return v0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function G0(){let Q=WZ(G(),"server.json");try{let Z=JSON.parse(N0(Q,"utf8"));if(!Z.pid)return P("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return P(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return P("daemon: no server.json (never started)")}}function K0(){let Q=UZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return P("bun NOT found on PATH (required to run Beacon)")}function C0(){return x0()||process.cwd()}var zQ=C0(),F=iQ(),PZ=yQ(),M0=PZ.some((Q)=>Q.path===zQ),H=M0||B0(WZ(zQ,".mcp.json"))?HQ(zQ):null;console.log(A("Beacon \xB7 doctor"));console.log(A("Runtime"));console.log(` ${K0()}`);console.log(` ${G0()}`);console.log(` ${W(`home: ${G()}`)}`);console.log(` ${W(`workspaces registered: ${PZ.length}`)}`);console.log(A("Global (~/.claude/)"));for(let Q of v)console.log(` ${F.skills[Q]?W(`skill ${Q}`):P(`skill ${Q} \u2014 missing`)}`);for(let Q of T)console.log(` ${F.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):P(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${f(Q.description)}`);console.log(` ${F.claudeMdBlock?W("global CLAUDE.md block"):P("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(A("Codex (~/.codex/ + ~/.agents/)"));var B=QQ()?wQ():null;if(!B)console.log(` ${f("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=UZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):f("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of v)console.log(` ${B.skills[$]?W(`skill ${$} (~/.agents/skills)`):P(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of K)console.log(` ${B.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):P(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${f($.description)}`);console.log(` ${B.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):P("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=fQ();console.log(` ${B.mcp?W("config.toml has [mcp_servers.beacon]"):P(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(A(`Current repo (${zQ})`));if(!H)console.log(` ${f("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${H.mcpRegistered?W(".mcp.json has beacon entry"):P(".mcp.json missing beacon entry")}`),console.log(` ${H.agentsMdBlock?W("AGENTS.md has Beacon workflow block"):P("AGENTS.md missing Beacon workflow block")}`),console.log(` ${H.claudeMdImport?W("CLAUDE.md @-imports AGENTS.md"):P("CLAUDE.md does NOT @-import AGENTS.md")}`),console.log(` ${H.skills["beacon-init"]?W("skill beacon-init (repo)"):P("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${H.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):P("skill beacon-refresh (repo) \u2014 missing")}`),B)console.log(` ${H.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):P("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${H.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):P("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var f0=v.some((Q)=>!F.skills[Q])||T.some((Q)=>!F.hooks[Q.event])||!F.claudeMdBlock||(B?v.some((Q)=>!B.skills[Q])||K.some((Q)=>!B.hooks[Q.event])||!B.agentsMdBlock||!B.mcp:!1)||(H?!H.mcpRegistered||!H.agentsMdBlock||!H.claudeMdImport||!H.skills["beacon-init"]||!H.skills["beacon-refresh"]||(B?!H.codexSkills["beacon-init"]||!H.codexSkills["beacon-refresh"]:!1):!1);if(f0)console.log(`
247
+ ${aQ}
248
+ `});var JZ={};UQ(JZ,{provisionDb:()=>W0});import{createClient as eZ}from"@libsql/client";import{drizzle as Q0}from"drizzle-orm/libsql";import{migrate as Z0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as $0}from"drizzle-orm/migrator";import{dirname as IQ,join as J0}from"path";import{fileURLToPath as Y0}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 X0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function $Z(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 U0(Q){for(let[Z,$]of Object.entries(q0)){if(!await YQ(Q,Z))continue;let J=await X0(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 W0(Q,Z=z0){let $=eZ({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=$0({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 $Z($);if(await Z0(Q0($),{migrationsFolder:Z}),await $Z($)>X)V=!0;return await U0($),{migrated:V}}finally{$.close()}}var V0,z0,q0;var YZ=g(async()=>{V0=IQ(IQ(IQ(Y0(import.meta.url)))),z0=process.env.BEACON_MIGRATIONS_DIR||J0(V0,"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"]}});xQ();import{existsSync as mZ}from"fs";import{homedir as pZ}from"os";import{join as $Q}from"path";function cZ(){return process.env.HOME||process.env.USERPROFILE||pZ()}var JQ=()=>$Q(cZ(),".claude"),FQ=()=>$Q(JQ(),"skills"),gQ=()=>$Q(JQ(),"settings.json"),RQ=()=>$Q(JQ(),"CLAUDE.md"),EQ="<!-- beacon:global:start -->",iQ="<!-- beacon:global:end -->";var lZ=c,T=[{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 nZ(Q,Z){return d(FQ(),Q,Z)}function eQ(Q){return E(FQ(),Q)}function sZ(Q){return r(FQ(),Q)}function tZ(Q){return l(gQ(),Q)}function aZ(Q){return n(gQ(),Q)}function dZ(Q){return s(gQ(),Q)}function rZ(Q){t(RQ(),EQ,iQ,Q)}function QZ(){return R(RQ(),EQ)}function oZ(){return a(RQ(),EQ,iQ)}function ZZ(){let Q={};for(let $ of B)Q[$]=eQ($);let Z={};for(let $ of T)Z[$.event]=aZ({event:$.event,command:$.command});return{homeExists:mZ(JQ()),skills:Q,hooks:Z,claudeMdBlock:QZ()}}async function iZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),BQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of B){if(!eQ(U))Y.push(U);nZ(U,J[U])}let V=0;for(let U of T)if(tZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=QZ();return rZ(lZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function d0(){let Q;try{Q={ok:!0,...await iZ()}}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(() => (TQ(),oQ));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 r0(){let Q=[];for(let J of B)if(sZ(J))Q.push(J);let Z=0;for(let J of T)if(dZ(J))Z++;let $=oZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as H0}from"async_hooks";import{spawnSync as j0}from"child_process";import{createHash as P0}from"crypto";import{existsSync as zZ,mkdirSync as A,readFileSync as OQ,writeFileSync as AQ}from"fs";import{homedir as qZ}from"os";import{basename as B0,join as K,parse as v0,resolve as VZ}from"path";function x(){return process.env.BEACON_HOME||K(qZ(),".beacon")}function yQ(){return K(x(),"workspaces.json")}function VQ(Q){return P0("sha256").update(Q).digest("hex").slice(0,12)}function W1(Q=process.cwd()){let Z=j0("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 XZ(Q){let Z=VZ(Q);return Z!==VZ(qZ())&&Z!==v0(Z).root}function UZ(){return K(x(),"deleted.json")}function bQ(){try{let Q=JSON.parse(OQ(UZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function WZ(Q){A(x(),{recursive:!0}),AQ(UZ(),JSON.stringify(Q,null,2))}function HZ(Q){return bQ().includes(Q)}function H1(Q){let Z=bQ();if(!Z.includes(Q))WZ([...Z,Q])}function N0(Q){let Z=bQ();if(Z.includes(Q))WZ(Z.filter(($)=>$!==Q))}function zQ(Q){return K(x(),Q)}function x0(Q){return`file:${K(zQ(Q),"db.sqlite")}`}function y(){try{let Q=JSON.parse(OQ(yQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function _Q(Q){A(x(),{recursive:!0}),AQ(yQ(),JSON.stringify(Q,null,2))}function kQ(){return y().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function M(Q){return y().find((Z)=>Z.id===Q)??null}function jZ(Q,Z,$=new Date().toISOString()){if(!XZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=VQ(Q);if(HZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=y(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||B0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(zQ(J),{recursive:!0}),_Q(U),X}function j1(Q,Z){return N0(VQ(Q)),jZ(Q,Z)}function P1(Q,Z=new Date().toISOString()){let $=y(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,_Q($)}function B1(Q){if(_Q(y().filter((Z)=>Z.id!==Q)),LQ()===Q)G0(kQ()[0]?.id??null)}function PZ(){return K(x(),"active")}function LQ(){try{return OQ(PZ(),"utf8").trim()||null}catch{return null}}function G0(Q){A(x(),{recursive:!0}),AQ(PZ(),Q??"")}function v1(){let Q=LQ();return Q?M(Q):null}function N1(){let Q=C0()??LQ();return Q?M(Q):null}function x1(Q){return M(Q)?.path??null}function G1(){return zZ(yQ())}var BZ="beacon_ws";function vZ(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 K1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=vZ(Q,BZ);if($&&M($))return $;return null}var K0="x-beacon-workspace-path";async function C1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=Q.headers.get(K0);if($&&XZ($)&&!HZ(VQ($))&&(!Z||VQ($)===Z)){let Y=jZ($);return await M0(Y.id),Y.id}let J=vZ(Q,BZ);if(J&&M(J))return J;return null}var NZ=new H0;function M1(Q,Z){return Q?NZ.run(Q,Z):Z()}function C0(){return NZ.getStore()??null}var DQ=new Set;function f1(Q){DQ.delete(K(zQ(Q),"db.sqlite"))}async function M0(Q){let Z=zQ(Q),$=K(Z,"db.sqlite"),J=zZ($);if(J&&DQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await YZ().then(() => JZ),V=await Y(x0(Q));return DQ.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();TQ();import{execSync as f0,spawnSync as xZ}from"child_process";import{existsSync as u0,readFileSync as w0}from"fs";import{join as GZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,H=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,f=(Q)=>`\x1B[2m${Q}\x1B[0m`,b=(Q)=>`
249
+ \x1B[1m${Q}\x1B[0m`;function T0(){try{return f0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function F0(){let Q=GZ(x(),"server.json");try{let Z=JSON.parse(w0(Q,"utf8"));if(!Z.pid)return H("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return H(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return H("daemon: no server.json (never started)")}}function g0(){let Q=xZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return H("bun NOT found on PATH (required to run Beacon)")}function R0(){return T0()||process.cwd()}var qQ=R0(),F=ZZ(),KZ=kQ(),E0=KZ.some((Q)=>Q.path===qQ),j=E0||u0(GZ(qQ,".mcp.json"))?PQ(qQ):null;console.log(b("Beacon \xB7 doctor"));console.log(b("Runtime"));console.log(` ${g0()}`);console.log(` ${F0()}`);console.log(` ${W(`home: ${x()}`)}`);console.log(` ${W(`workspaces registered: ${KZ.length}`)}`);console.log(b("Global (~/.claude/)"));for(let Q of B)console.log(` ${F.skills[Q]?W(`skill ${Q}`):H(`skill ${Q} \u2014 missing`)}`);for(let Q of T)console.log(` ${F.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):H(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${f(Q.description)}`);console.log(` ${F.claudeMdBlock?W("global CLAUDE.md block"):H("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(b("Codex (~/.codex/ + ~/.agents/)"));var v=ZQ()?wQ():null;if(!v)console.log(` ${f("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=xZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):f("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of B)console.log(` ${v.skills[$]?W(`skill ${$} (~/.agents/skills)`):H(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of C)console.log(` ${v.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):H(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${f($.description)}`);console.log(` ${v.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):H("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=uQ();console.log(` ${v.mcp?W("config.toml has [mcp_servers.beacon]"):H(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(b(`Current repo (${qQ})`));if(!j)console.log(` ${f("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${j.mcpRegistered?W(".mcp.json has beacon entry"):H(".mcp.json missing beacon entry")}`),console.log(` ${j.agentsMdBlock?W("AGENTS.md has Beacon workflow block"):H("AGENTS.md missing Beacon workflow block")}`),console.log(` ${j.claudeMdImport?W("CLAUDE.md @-imports AGENTS.md"):H("CLAUDE.md does NOT @-import AGENTS.md")}`),console.log(` ${j.skills["beacon-init"]?W("skill beacon-init (repo)"):H("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${j.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):H("skill beacon-refresh (repo) \u2014 missing")}`),v)console.log(` ${j.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):H("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${j.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):H("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var I0=B.some((Q)=>!F.skills[Q])||T.some((Q)=>!F.hooks[Q.event])||!F.claudeMdBlock||(v?B.some((Q)=>!v.skills[Q])||C.some((Q)=>!v.hooks[Q.event])||!v.agentsMdBlock||!v.mcp:!1)||(j?!j.mcpRegistered||!j.agentsMdBlock||!j.claudeMdImport||!j.skills["beacon-init"]||!j.skills["beacon-refresh"]||(v?!j.codexSkills["beacon-init"]||!j.codexSkills["beacon-refresh"]:!1):!1);if(I0)console.log(`
247
250
  ${f("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${f("in this repo.")}`);console.log();