trybeacon 0.1.64 → 0.1.66

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 (386) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-path-routes-manifest.json +15 -8
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/routes-manifest.json +42 -0
  7. package/.next/server/app/_global-error/page.js +2 -2
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +11 -11
  21. package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  22. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
  28. package/.next/server/app/api/board-annotations/route.js +1 -1
  29. package/.next/server/app/api/board-layout/route.js +1 -1
  30. package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
  31. package/.next/server/app/api/bug-flags/route.js +1 -1
  32. package/.next/server/app/api/code-graph/position/route.js +1 -1
  33. package/.next/server/app/api/code-graph/route.js +1 -1
  34. package/.next/server/app/api/context/feature/route.js +1 -1
  35. package/.next/server/app/api/context/file/route.js +1 -1
  36. package/.next/server/app/api/context/route.js +1 -1
  37. package/.next/server/app/api/db/arrange/route.js +1 -1
  38. package/.next/server/app/api/db/backfill-access/route.js +1 -1
  39. package/.next/server/app/api/db/position/route.js +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/endpoints/[id]/route.js +1 -1
  50. package/.next/server/app/api/entities/route.js +1 -1
  51. package/.next/server/app/api/feedback/[id]/route.js +1 -1
  52. package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
  53. package/.next/server/app/api/feedback/route.js +1 -1
  54. package/.next/server/app/api/flags/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/lesson/close/route.js +1 -0
  58. package/.next/server/app/api/lesson/close/route.js.nft.json +1 -0
  59. package/.next/server/app/api/lesson/close/route_client-reference-manifest.js +1 -0
  60. package/.next/server/app/api/lesson/presence/route.js +1 -0
  61. package/.next/server/app/api/lesson/presence/route.js.nft.json +1 -0
  62. package/.next/server/app/api/lesson/presence/route_client-reference-manifest.js +1 -0
  63. package/.next/server/app/api/lesson/questions/route.js +1 -0
  64. package/.next/server/app/api/lesson/questions/route.js.nft.json +1 -0
  65. package/.next/server/app/api/lesson/questions/route_client-reference-manifest.js +1 -0
  66. package/.next/server/app/api/lesson/route.js +1 -0
  67. package/.next/server/app/api/lesson/route.js.nft.json +1 -0
  68. package/.next/server/app/api/lesson/route_client-reference-manifest.js +1 -0
  69. package/.next/server/app/api/lesson/save/route.js +1 -0
  70. package/.next/server/app/api/lesson/save/route.js.nft.json +1 -0
  71. package/.next/server/app/api/lesson/save/route_client-reference-manifest.js +1 -0
  72. package/.next/server/app/api/lesson/verdict/route.js +1 -0
  73. package/.next/server/app/api/lesson/verdict/route.js.nft.json +1 -0
  74. package/.next/server/app/api/lesson/verdict/route_client-reference-manifest.js +1 -0
  75. package/.next/server/app/api/map/describe/route.js +2 -2
  76. package/.next/server/app/api/map/files/route.js +1 -1
  77. package/.next/server/app/api/map/finish/route.js +1 -1
  78. package/.next/server/app/api/map/route.js +1 -1
  79. package/.next/server/app/api/map/start/route.js +1 -1
  80. package/.next/server/app/api/map/touch-active/route.js +1 -1
  81. package/.next/server/app/api/mention-search/route.js +1 -1
  82. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  83. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  84. package/.next/server/app/api/nodes/positions/route.js +1 -1
  85. package/.next/server/app/api/nodes/route.js +1 -1
  86. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  87. package/.next/server/app/api/notes/[id]/route.js +1 -1
  88. package/.next/server/app/api/notes/route.js +1 -1
  89. package/.next/server/app/api/open/route.js +1 -1
  90. package/.next/server/app/api/plan/annotations/route.js +3 -3
  91. package/.next/server/app/api/plan/approve/route.js +2 -2
  92. package/.next/server/app/api/plan/history/route.js +1 -1
  93. package/.next/server/app/api/plan/markdown/route.js +1 -1
  94. package/.next/server/app/api/plan/presence/route.js +1 -1
  95. package/.next/server/app/api/plan/route.js +1 -1
  96. package/.next/server/app/api/plan/verdict/route.js +1 -1
  97. package/.next/server/app/api/preferences/route.js +1 -1
  98. package/.next/server/app/api/project-meta/route.js +1 -1
  99. package/.next/server/app/api/reset/route.js +1 -1
  100. package/.next/server/app/api/scope-guard/check/route.js +1 -1
  101. package/.next/server/app/api/share/create/route.js +1 -1
  102. package/.next/server/app/api/share/route.js +1 -1
  103. package/.next/server/app/api/stream/route.js +2 -2
  104. package/.next/server/app/api/tab/nav/route.js +1 -1
  105. package/.next/server/app/api/tab/presence/route.js +1 -1
  106. package/.next/server/app/api/telemetry/route.js +1 -1
  107. package/.next/server/app/api/telemetry/stats/route.js +1 -1
  108. package/.next/server/app/api/version/route.js +1 -1
  109. package/.next/server/app/api/workspace/activate/route.js +1 -1
  110. package/.next/server/app/api/workspace/route.js +1 -1
  111. package/.next/server/app/apple-icon.png/route.js +1 -1
  112. package/.next/server/app/docs/page.js +2 -2
  113. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  114. package/.next/server/app/docs.html +1 -1
  115. package/.next/server/app/docs.rsc +11 -11
  116. package/.next/server/app/docs.segments/_full.segment.rsc +11 -11
  117. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  118. package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
  119. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  120. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  121. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  122. package/.next/server/app/feedback/page.js +2 -2
  123. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/feedback.html +1 -1
  125. package/.next/server/app/feedback.rsc +11 -11
  126. package/.next/server/app/feedback.segments/_full.segment.rsc +11 -11
  127. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  128. package/.next/server/app/feedback.segments/_index.segment.rsc +11 -11
  129. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  130. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  131. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  132. package/.next/server/app/help/page.js +2 -2
  133. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  134. package/.next/server/app/help.html +1 -1
  135. package/.next/server/app/help.rsc +11 -11
  136. package/.next/server/app/help.segments/_full.segment.rsc +11 -11
  137. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  138. package/.next/server/app/help.segments/_index.segment.rsc +11 -11
  139. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  140. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  141. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  142. package/.next/server/app/icon.svg/route.js +1 -1
  143. package/.next/server/app/index.html +1 -1
  144. package/.next/server/app/index.rsc +12 -12
  145. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  146. package/.next/server/app/index.segments/_full.segment.rsc +12 -12
  147. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  148. package/.next/server/app/index.segments/_index.segment.rsc +11 -11
  149. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  150. package/.next/server/app/learn/page.js +6 -0
  151. package/.next/server/app/learn/page.js.nft.json +1 -0
  152. package/.next/server/app/learn/page_client-reference-manifest.js +1 -0
  153. package/.next/server/app/map/page.js +2 -2
  154. package/.next/server/app/map/page.js.nft.json +1 -1
  155. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  156. package/.next/server/app/page.js +2 -2
  157. package/.next/server/app/page.js.nft.json +1 -1
  158. package/.next/server/app/page_client-reference-manifest.js +1 -1
  159. package/.next/server/app/plan/page.js +2 -2
  160. package/.next/server/app/plan/page.js.nft.json +1 -1
  161. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/s/[token]/page.js +2 -2
  163. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  164. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  165. package/.next/server/app/settings/page.js +2 -2
  166. package/.next/server/app/settings/page.js.nft.json +1 -1
  167. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  168. package/.next/server/app-paths-manifest.json +15 -8
  169. package/.next/server/chunks/2050.js +1 -1
  170. package/.next/server/chunks/3174.js +1 -0
  171. package/.next/server/chunks/3584.js +154 -0
  172. package/.next/server/chunks/4307.js +1 -1
  173. package/.next/server/chunks/6024.js +2 -0
  174. package/.next/server/chunks/{4384.js → 7187.js} +1 -1
  175. package/.next/server/chunks/8035.js +1 -0
  176. package/.next/server/chunks/9338.js +8 -8
  177. package/.next/server/middleware-build-manifest.js +1 -1
  178. package/.next/server/pages/404.html +1 -1
  179. package/.next/server/pages/500.html +1 -1
  180. package/.next/server/server-reference-manifest.js +1 -1
  181. package/.next/server/server-reference-manifest.json +1 -1
  182. package/.next/static/P3uXQySdS-m6_bxuiezYe/_buildManifest.js +1 -0
  183. package/.next/static/chunks/1909-98243a0473be2aae.js +1 -0
  184. package/.next/static/chunks/1936-7fea5225b5bfcfda.js +1 -0
  185. package/.next/static/chunks/2019-3be80edc82176878.js +1 -0
  186. package/.next/static/chunks/4549-591415d55ca009a3.js +62 -0
  187. package/.next/static/chunks/6638-4e53879181b1df75.js +1 -0
  188. package/.next/static/chunks/{4888-911c0da3c2d785d2.js → 7043-254590cf9891391f.js} +1 -1
  189. package/.next/static/chunks/7643-6c7ff4b9400f68fc.js +1 -0
  190. package/.next/static/chunks/app/_global-error/page-2390ea0e69e5991f.js +1 -0
  191. package/.next/static/chunks/app/api/board-annotations/[id]/route-2390ea0e69e5991f.js +1 -0
  192. package/.next/static/chunks/app/api/board-annotations/route-2390ea0e69e5991f.js +1 -0
  193. package/.next/static/chunks/app/api/board-layout/route-2390ea0e69e5991f.js +1 -0
  194. package/.next/static/chunks/app/api/bug-flags/[id]/route-2390ea0e69e5991f.js +1 -0
  195. package/.next/static/chunks/app/api/bug-flags/route-2390ea0e69e5991f.js +1 -0
  196. package/.next/static/chunks/app/api/code-graph/position/route-2390ea0e69e5991f.js +1 -0
  197. package/.next/static/chunks/app/api/code-graph/route-2390ea0e69e5991f.js +1 -0
  198. package/.next/static/chunks/app/api/context/feature/route-2390ea0e69e5991f.js +1 -0
  199. package/.next/static/chunks/app/api/context/file/route-2390ea0e69e5991f.js +1 -0
  200. package/.next/static/chunks/app/api/context/route-2390ea0e69e5991f.js +1 -0
  201. package/.next/static/chunks/app/api/db/arrange/route-2390ea0e69e5991f.js +1 -0
  202. package/.next/static/chunks/app/api/db/backfill-access/route-2390ea0e69e5991f.js +1 -0
  203. package/.next/static/chunks/app/api/db/position/route-2390ea0e69e5991f.js +1 -0
  204. package/.next/static/chunks/app/api/db/prune-planned/route-2390ea0e69e5991f.js +1 -0
  205. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-2390ea0e69e5991f.js +1 -0
  206. package/.next/static/chunks/app/api/db/relations/[id]/route-2390ea0e69e5991f.js +1 -0
  207. package/.next/static/chunks/app/api/db/tables/[id]/route-2390ea0e69e5991f.js +1 -0
  208. package/.next/static/chunks/app/api/draft/approve/route-2390ea0e69e5991f.js +1 -0
  209. package/.next/static/chunks/app/api/draft/route-2390ea0e69e5991f.js +1 -0
  210. package/.next/static/chunks/app/api/draft/status/route-2390ea0e69e5991f.js +1 -0
  211. package/.next/static/chunks/app/api/edges/[id]/route-2390ea0e69e5991f.js +1 -0
  212. package/.next/static/chunks/app/api/edges/route-2390ea0e69e5991f.js +1 -0
  213. package/.next/static/chunks/app/api/endpoints/[id]/route-2390ea0e69e5991f.js +1 -0
  214. package/.next/static/chunks/app/api/entities/route-2390ea0e69e5991f.js +1 -0
  215. package/.next/static/chunks/app/api/feedback/[id]/route-2390ea0e69e5991f.js +1 -0
  216. package/.next/static/chunks/app/api/feedback/[id]/vote/route-2390ea0e69e5991f.js +1 -0
  217. package/.next/static/chunks/app/api/feedback/route-2390ea0e69e5991f.js +1 -0
  218. package/.next/static/chunks/app/api/flags/route-2390ea0e69e5991f.js +1 -0
  219. package/.next/static/chunks/app/api/ingest/route-2390ea0e69e5991f.js +1 -0
  220. package/.next/static/chunks/app/api/init/route-2390ea0e69e5991f.js +1 -0
  221. package/.next/static/chunks/app/api/lesson/close/route-2390ea0e69e5991f.js +1 -0
  222. package/.next/static/chunks/app/api/lesson/presence/route-2390ea0e69e5991f.js +1 -0
  223. package/.next/static/chunks/app/api/lesson/questions/route-2390ea0e69e5991f.js +1 -0
  224. package/.next/static/chunks/app/api/lesson/route-2390ea0e69e5991f.js +1 -0
  225. package/.next/static/chunks/app/api/lesson/save/route-2390ea0e69e5991f.js +1 -0
  226. package/.next/static/chunks/app/api/lesson/verdict/route-2390ea0e69e5991f.js +1 -0
  227. package/.next/static/chunks/app/api/map/describe/route-2390ea0e69e5991f.js +1 -0
  228. package/.next/static/chunks/app/api/map/files/route-2390ea0e69e5991f.js +1 -0
  229. package/.next/static/chunks/app/api/map/finish/route-2390ea0e69e5991f.js +1 -0
  230. package/.next/static/chunks/app/api/map/route-2390ea0e69e5991f.js +1 -0
  231. package/.next/static/chunks/app/api/map/start/route-2390ea0e69e5991f.js +1 -0
  232. package/.next/static/chunks/app/api/map/touch-active/route-2390ea0e69e5991f.js +1 -0
  233. package/.next/static/chunks/app/api/mention-search/route-2390ea0e69e5991f.js +1 -0
  234. package/.next/static/chunks/app/api/nodes/[id]/position/route-2390ea0e69e5991f.js +1 -0
  235. package/.next/static/chunks/app/api/nodes/[id]/route-2390ea0e69e5991f.js +1 -0
  236. package/.next/static/chunks/app/api/nodes/positions/route-2390ea0e69e5991f.js +1 -0
  237. package/.next/static/chunks/app/api/nodes/route-2390ea0e69e5991f.js +1 -0
  238. package/.next/static/chunks/app/api/nodes/subtasks/route-2390ea0e69e5991f.js +1 -0
  239. package/.next/static/chunks/app/api/notes/[id]/route-2390ea0e69e5991f.js +1 -0
  240. package/.next/static/chunks/app/api/notes/route-2390ea0e69e5991f.js +1 -0
  241. package/.next/static/chunks/app/api/open/route-2390ea0e69e5991f.js +1 -0
  242. package/.next/static/chunks/app/api/plan/annotations/route-2390ea0e69e5991f.js +1 -0
  243. package/.next/static/chunks/app/api/plan/approve/route-2390ea0e69e5991f.js +1 -0
  244. package/.next/static/chunks/app/api/plan/history/route-2390ea0e69e5991f.js +1 -0
  245. package/.next/static/chunks/app/api/plan/markdown/route-2390ea0e69e5991f.js +1 -0
  246. package/.next/static/chunks/app/api/plan/presence/route-2390ea0e69e5991f.js +1 -0
  247. package/.next/static/chunks/app/api/plan/route-2390ea0e69e5991f.js +1 -0
  248. package/.next/static/chunks/app/api/plan/verdict/route-2390ea0e69e5991f.js +1 -0
  249. package/.next/static/chunks/app/api/preferences/route-2390ea0e69e5991f.js +1 -0
  250. package/.next/static/chunks/app/api/project-meta/route-2390ea0e69e5991f.js +1 -0
  251. package/.next/static/chunks/app/api/reset/route-2390ea0e69e5991f.js +1 -0
  252. package/.next/static/chunks/app/api/scope-guard/check/route-2390ea0e69e5991f.js +1 -0
  253. package/.next/static/chunks/app/api/share/create/route-2390ea0e69e5991f.js +1 -0
  254. package/.next/static/chunks/app/api/share/route-2390ea0e69e5991f.js +1 -0
  255. package/.next/static/chunks/app/api/stream/route-2390ea0e69e5991f.js +1 -0
  256. package/.next/static/chunks/app/api/tab/nav/route-2390ea0e69e5991f.js +1 -0
  257. package/.next/static/chunks/app/api/tab/presence/route-2390ea0e69e5991f.js +1 -0
  258. package/.next/static/chunks/app/api/telemetry/route-2390ea0e69e5991f.js +1 -0
  259. package/.next/static/chunks/app/api/telemetry/stats/route-2390ea0e69e5991f.js +1 -0
  260. package/.next/static/chunks/app/api/version/route-2390ea0e69e5991f.js +1 -0
  261. package/.next/static/chunks/app/api/workspace/activate/route-2390ea0e69e5991f.js +1 -0
  262. package/.next/static/chunks/app/api/workspace/route-2390ea0e69e5991f.js +1 -0
  263. package/.next/static/chunks/app/layout-0c993f55d3a798f4.js +1 -0
  264. package/.next/static/chunks/app/learn/page-797d74e02b98fa88.js +5 -0
  265. package/.next/static/chunks/app/map/page-634b6d5d98e921b3.js +1 -0
  266. package/.next/static/chunks/app/page-84dc684d45002cfb.js +1 -0
  267. package/.next/static/chunks/app/plan/page-df829b2054c40611.js +1 -0
  268. package/.next/static/chunks/app/s/[token]/page-f97dec75856a7952.js +1 -0
  269. package/.next/static/chunks/app/settings/page-59d90685cd17fc1f.js +1 -0
  270. package/.next/static/chunks/next/dist/client/components/builtin/app-error-2390ea0e69e5991f.js +1 -0
  271. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2390ea0e69e5991f.js +1 -0
  272. package/.next/static/chunks/next/dist/client/components/builtin/not-found-2390ea0e69e5991f.js +1 -0
  273. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2390ea0e69e5991f.js +1 -0
  274. package/.next/static/css/b3d3212da726bbfb.css +1 -0
  275. package/.next/trace +43 -42
  276. package/.next/trace-build +1 -1
  277. package/.next/types/app/api/lesson/close/route.ts +351 -0
  278. package/.next/types/app/api/lesson/presence/route.ts +351 -0
  279. package/.next/types/app/api/lesson/questions/route.ts +351 -0
  280. package/.next/types/app/api/lesson/route.ts +351 -0
  281. package/.next/types/app/api/lesson/save/route.ts +351 -0
  282. package/.next/types/app/api/lesson/verdict/route.ts +351 -0
  283. package/.next/types/app/learn/page.ts +87 -0
  284. package/.next/types/routes.d.ts +9 -2
  285. package/.next/types/validator.ts +63 -0
  286. package/README.md +2 -1
  287. package/dist/bin/doctor.js +92 -22
  288. package/dist/bin/hook.js +91 -21
  289. package/dist/bin/mcp.js +107 -35
  290. package/dist/bin/plan.js +92 -22
  291. package/dist/bin/uninstall.js +95 -25
  292. package/dist/lib/assets.js +81 -14
  293. package/dist/lib/codex-install.js +92 -22
  294. package/dist/lib/global-install.js +93 -23
  295. package/package.json +1 -1
  296. package/plugin/skills/beacon-explain/SKILL.md +63 -0
  297. package/.next/server/chunks/2942.js +0 -1
  298. package/.next/server/chunks/2994.js +0 -2
  299. package/.next/server/chunks/3284.js +0 -154
  300. package/.next/server/chunks/5719.js +0 -1
  301. package/.next/static/chunks/3415-05007c2bd98125c7.js +0 -1
  302. package/.next/static/chunks/5957-83f611fcd5a08b45.js +0 -1
  303. package/.next/static/chunks/766-242213d211df0afd.js +0 -1
  304. package/.next/static/chunks/874-c750840a8644deb1.js +0 -1
  305. package/.next/static/chunks/8915-fa61a860c63a7c85.js +0 -62
  306. package/.next/static/chunks/8997-78a359d0d238622e.js +0 -1
  307. package/.next/static/chunks/app/_global-error/page-548a84d85e061550.js +0 -1
  308. package/.next/static/chunks/app/api/board-annotations/[id]/route-548a84d85e061550.js +0 -1
  309. package/.next/static/chunks/app/api/board-annotations/route-548a84d85e061550.js +0 -1
  310. package/.next/static/chunks/app/api/board-layout/route-548a84d85e061550.js +0 -1
  311. package/.next/static/chunks/app/api/bug-flags/[id]/route-548a84d85e061550.js +0 -1
  312. package/.next/static/chunks/app/api/bug-flags/route-548a84d85e061550.js +0 -1
  313. package/.next/static/chunks/app/api/code-graph/position/route-548a84d85e061550.js +0 -1
  314. package/.next/static/chunks/app/api/code-graph/route-548a84d85e061550.js +0 -1
  315. package/.next/static/chunks/app/api/context/feature/route-548a84d85e061550.js +0 -1
  316. package/.next/static/chunks/app/api/context/file/route-548a84d85e061550.js +0 -1
  317. package/.next/static/chunks/app/api/context/route-548a84d85e061550.js +0 -1
  318. package/.next/static/chunks/app/api/db/arrange/route-548a84d85e061550.js +0 -1
  319. package/.next/static/chunks/app/api/db/backfill-access/route-548a84d85e061550.js +0 -1
  320. package/.next/static/chunks/app/api/db/position/route-548a84d85e061550.js +0 -1
  321. package/.next/static/chunks/app/api/db/prune-planned/route-548a84d85e061550.js +0 -1
  322. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-548a84d85e061550.js +0 -1
  323. package/.next/static/chunks/app/api/db/relations/[id]/route-548a84d85e061550.js +0 -1
  324. package/.next/static/chunks/app/api/db/tables/[id]/route-548a84d85e061550.js +0 -1
  325. package/.next/static/chunks/app/api/draft/approve/route-548a84d85e061550.js +0 -1
  326. package/.next/static/chunks/app/api/draft/route-548a84d85e061550.js +0 -1
  327. package/.next/static/chunks/app/api/draft/status/route-548a84d85e061550.js +0 -1
  328. package/.next/static/chunks/app/api/edges/[id]/route-548a84d85e061550.js +0 -1
  329. package/.next/static/chunks/app/api/edges/route-548a84d85e061550.js +0 -1
  330. package/.next/static/chunks/app/api/endpoints/[id]/route-548a84d85e061550.js +0 -1
  331. package/.next/static/chunks/app/api/entities/route-548a84d85e061550.js +0 -1
  332. package/.next/static/chunks/app/api/feedback/[id]/route-548a84d85e061550.js +0 -1
  333. package/.next/static/chunks/app/api/feedback/[id]/vote/route-548a84d85e061550.js +0 -1
  334. package/.next/static/chunks/app/api/feedback/route-548a84d85e061550.js +0 -1
  335. package/.next/static/chunks/app/api/flags/route-548a84d85e061550.js +0 -1
  336. package/.next/static/chunks/app/api/ingest/route-548a84d85e061550.js +0 -1
  337. package/.next/static/chunks/app/api/init/route-548a84d85e061550.js +0 -1
  338. package/.next/static/chunks/app/api/map/describe/route-548a84d85e061550.js +0 -1
  339. package/.next/static/chunks/app/api/map/files/route-548a84d85e061550.js +0 -1
  340. package/.next/static/chunks/app/api/map/finish/route-548a84d85e061550.js +0 -1
  341. package/.next/static/chunks/app/api/map/route-548a84d85e061550.js +0 -1
  342. package/.next/static/chunks/app/api/map/start/route-548a84d85e061550.js +0 -1
  343. package/.next/static/chunks/app/api/map/touch-active/route-548a84d85e061550.js +0 -1
  344. package/.next/static/chunks/app/api/mention-search/route-548a84d85e061550.js +0 -1
  345. package/.next/static/chunks/app/api/nodes/[id]/position/route-548a84d85e061550.js +0 -1
  346. package/.next/static/chunks/app/api/nodes/[id]/route-548a84d85e061550.js +0 -1
  347. package/.next/static/chunks/app/api/nodes/positions/route-548a84d85e061550.js +0 -1
  348. package/.next/static/chunks/app/api/nodes/route-548a84d85e061550.js +0 -1
  349. package/.next/static/chunks/app/api/nodes/subtasks/route-548a84d85e061550.js +0 -1
  350. package/.next/static/chunks/app/api/notes/[id]/route-548a84d85e061550.js +0 -1
  351. package/.next/static/chunks/app/api/notes/route-548a84d85e061550.js +0 -1
  352. package/.next/static/chunks/app/api/open/route-548a84d85e061550.js +0 -1
  353. package/.next/static/chunks/app/api/plan/annotations/route-548a84d85e061550.js +0 -1
  354. package/.next/static/chunks/app/api/plan/approve/route-548a84d85e061550.js +0 -1
  355. package/.next/static/chunks/app/api/plan/history/route-548a84d85e061550.js +0 -1
  356. package/.next/static/chunks/app/api/plan/markdown/route-548a84d85e061550.js +0 -1
  357. package/.next/static/chunks/app/api/plan/presence/route-548a84d85e061550.js +0 -1
  358. package/.next/static/chunks/app/api/plan/route-548a84d85e061550.js +0 -1
  359. package/.next/static/chunks/app/api/plan/verdict/route-548a84d85e061550.js +0 -1
  360. package/.next/static/chunks/app/api/preferences/route-548a84d85e061550.js +0 -1
  361. package/.next/static/chunks/app/api/project-meta/route-548a84d85e061550.js +0 -1
  362. package/.next/static/chunks/app/api/reset/route-548a84d85e061550.js +0 -1
  363. package/.next/static/chunks/app/api/scope-guard/check/route-548a84d85e061550.js +0 -1
  364. package/.next/static/chunks/app/api/share/create/route-548a84d85e061550.js +0 -1
  365. package/.next/static/chunks/app/api/share/route-548a84d85e061550.js +0 -1
  366. package/.next/static/chunks/app/api/stream/route-548a84d85e061550.js +0 -1
  367. package/.next/static/chunks/app/api/tab/nav/route-548a84d85e061550.js +0 -1
  368. package/.next/static/chunks/app/api/tab/presence/route-548a84d85e061550.js +0 -1
  369. package/.next/static/chunks/app/api/telemetry/route-548a84d85e061550.js +0 -1
  370. package/.next/static/chunks/app/api/telemetry/stats/route-548a84d85e061550.js +0 -1
  371. package/.next/static/chunks/app/api/version/route-548a84d85e061550.js +0 -1
  372. package/.next/static/chunks/app/api/workspace/activate/route-548a84d85e061550.js +0 -1
  373. package/.next/static/chunks/app/api/workspace/route-548a84d85e061550.js +0 -1
  374. package/.next/static/chunks/app/layout-3115f8503ff00902.js +0 -1
  375. package/.next/static/chunks/app/map/page-491d4767dbc4e954.js +0 -1
  376. package/.next/static/chunks/app/page-d08947a671077569.js +0 -1
  377. package/.next/static/chunks/app/plan/page-a90e0981499546e3.js +0 -1
  378. package/.next/static/chunks/app/s/[token]/page-5c8f260e75758b02.js +0 -1
  379. package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +0 -1
  380. package/.next/static/chunks/next/dist/client/components/builtin/app-error-548a84d85e061550.js +0 -1
  381. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-548a84d85e061550.js +0 -1
  382. package/.next/static/chunks/next/dist/client/components/builtin/not-found-548a84d85e061550.js +0 -1
  383. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-548a84d85e061550.js +0 -1
  384. package/.next/static/css/490566ec68a48e1a.css +0 -1
  385. package/.next/static/qoq7TibU72duRZATxeVnT/_buildManifest.js +0 -1
  386. /package/.next/static/{qoq7TibU72duRZATxeVnT → P3uXQySdS-m6_bxuiezYe}/_ssgManifest.js +0 -0
package/dist/bin/plan.js CHANGED
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var AZ=Object.defineProperty;var fZ=(Q)=>Q;function EZ(Q,Z){this[Q]=fZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)AZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var yQ=1500,LQ=480000,G1=1800000,E=3600000,K1=3000;var zQ=()=>{};var WQ={};VQ(WQ,{removeRepoAssets:()=>hZ,installRefreshSkill:()=>OZ,installPlanSkill:()=>bZ,installInitSkill:()=>IZ,installCodexRepoSkills:()=>LZ,ensureWorkflowDoc:()=>kZ,ensureMcp:()=>_Z,auditRepo:()=>SZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>_Q,INIT_SKILL:()=>qQ});import{existsSync as M,mkdirSync as O,readFileSync as G,rmSync as I,writeFileSync as B}from"fs";import{join as U}from"path";function IZ(Q){let Z=U(Q,".claude","skills","beacon-init");O(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function OZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");O(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function bZ(Q){let Z=U(Q,".claude","skills","beacon-plan");O(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,_Q),$}function LZ(Q){let Z=[];for(let $ of yZ){let Y=U(Q,".agents","skills",$.name);O(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function kZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=G(Z,"utf8")}catch{}let Y=new RegExp(`${b}[\\s\\S]*?${UQ}`);$=Y.test($)?$.replace(Y,kQ):`${$.trim()}
3
+ var OZ=Object.defineProperty;var AZ=(Q)=>Q;function EZ(Q,Z){this[Q]=AZ.bind(null,Z)}var VQ=(Q,Z)=>{for(var $ in Z)OZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:EZ.bind(Z,$)})};var C=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var yQ=1500,kQ=480000,x1=1800000,E=3600000,N1=3000;var zQ=()=>{};var WQ={};VQ(WQ,{removeRepoAssets:()=>pZ,installRefreshSkill:()=>IZ,installPlanSkill:()=>yZ,installInitSkill:()=>bZ,installExplainSkill:()=>kZ,installCodexRepoSkills:()=>_Z,ensureWorkflowDoc:()=>SZ,ensureMcp:()=>hZ,auditRepo:()=>mZ,REFRESH_SKILL:()=>XQ,PLAN_SKILL:()=>_Q,INIT_SKILL:()=>qQ,EXPLAIN_SKILL:()=>SQ});import{existsSync as M,mkdirSync as F,readFileSync as j,rmSync as b,writeFileSync as B}from"fs";import{join as U}from"path";function bZ(Q){let Z=U(Q,".claude","skills","beacon-init");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,qQ),$}function IZ(Q){let Z=U(Q,".claude","skills","beacon-refresh");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,XQ),$}function yZ(Q){let Z=U(Q,".claude","skills","beacon-plan");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,_Q),$}function kZ(Q){let Z=U(Q,".claude","skills","beacon-explain");F(Z,{recursive:!0});let $=U(Z,"SKILL.md");return B($,SQ),$}function _Z(Q){let Z=[];for(let $ of LZ){let Y=U(Q,".agents","skills",$.name);F(Y,{recursive:!0});let J=U(Y,"SKILL.md");B(J,$.body()),Z.push(J)}return Z}function SZ(Q){let Z=U(Q,"AGENTS.md"),$="";try{$=j(Z,"utf8")}catch{}let Y=new RegExp(`${I}[\\s\\S]*?${UQ}`);$=Y.test($)?$.replace(Y,LQ):`${$.trim()}
4
4
 
5
- ${kQ}
5
+ ${LQ}
6
6
  `.trimStart(),B(Z,$.endsWith(`
7
7
  `)?$:`${$}
8
- `);let J=U(Q,"CLAUDE.md"),V="";try{V=G(J,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))B(J,`${V?`${V.trim()}
8
+ `);let J=U(Q,"CLAUDE.md"),V="";try{V=j(J,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))B(J,`${V?`${V.trim()}
9
9
 
10
10
  `:""}@AGENTS.md
11
- `)}function _Z(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(G(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<E)return Y.timeout=E,B(Z,JSON.stringify($,null,2)+`
11
+ `)}function hZ(Q){let Z=U(Q,".mcp.json"),$={};try{$=JSON.parse(j(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let Y=$.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<E)return Y.timeout=E,B(Z,JSON.stringify($,null,2)+`
12
12
  `),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:E},B(Z,JSON.stringify($,null,2)+`
13
- `),{path:Z,added:!0,updated:!1}}function SZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(G(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=G(U(Q,"AGENTS.md"),"utf8").includes(b)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(G(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":M(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function hZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=U(Q,".claude","skills",z);if(M(W))I(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=U(Q,".agents","skills",z);if(M(W))I(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(G(Y,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)I(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
14
- `)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=G(V,"utf8"),W=new RegExp(`\\n?${b}[\\s\\S]*?${UQ}\\n?`);if(W.test(z)){let H=z.replace(W,`
13
+ `),{path:Z,added:!0,updated:!1}}function mZ(Q){let Z=U(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(j(Z,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=j(U(Q,"AGENTS.md"),"utf8").includes(I)}catch{}let J=!1;try{J=/@AGENTS\.md/.test(j(U(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:Y,claudeMdImport:J,skills:{"beacon-init":M(U(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":M(U(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":M(U(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function pZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let X=U(Q,".claude","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let X=U(Q,".agents","skills",z);if(M(X))b(X,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,Y=U(Q,".mcp.json");try{let z=JSON.parse(j(Y,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)b(Y,{force:!0});else B(Y,JSON.stringify(z,null,2)+`
14
+ `)}}catch{}let J=!1,V=U(Q,"AGENTS.md");try{let z=j(V,"utf8"),X=new RegExp(`\\n?${I}[\\s\\S]*?${UQ}\\n?`);if(X.test(z)){let H=z.replace(X,`
15
15
  `).replace(/\n{3,}/g,`
16
16
 
17
17
  `).trimStart();B(V,H.endsWith(`
18
18
  `)?H:`${H}
19
- `),J=!0}}catch{}let q=!1,X=U(Q,"CLAUDE.md");try{let z=G(X,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())I(X,{force:!0});else B(X,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
19
+ `),J=!0}}catch{}let q=!1,W=U(Q,"CLAUDE.md");try{let z=j(W,"utf8"),X=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(X!==z){if(!X.trim())b(W,{force:!0});else B(W,X);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:J,claudeImportRemoved:q}}var qQ=`---
20
20
  name: beacon-init
21
21
  description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
22
22
  ---
@@ -158,7 +158,70 @@ If it returns feedback, revise and call it again.
158
158
  If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
159
159
  with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
160
160
  run \`beacon\` in this repo once.
161
- `,yZ,b="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",kQ;var HQ=C(()=>{zQ();yZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];kQ=`${b}
161
+ `,SQ=`---
162
+ name: beacon-explain
163
+ description: Teach the user part of THIS codebase as an interactive visual lesson on Beacon's /learn page \u2014 a concept map + plain-English narrative they can question \u2014 instead of a wall of text. Use when the user says "explain", "teach me", "walk me through", "how does X work", or "help me understand the Y category".
164
+ ---
165
+
166
+ # Explain the codebase visually (/beacon-explain)
167
+
168
+ When the user wants to UNDERSTAND part of the code (not build something), don't dump prose in the
169
+ terminal and don't open a plan \u2014 plans are for building. Author an interactive **Lesson** and push it
170
+ with the \`beacon_explain\` MCP tool: a curated concept map (boxes + labeled arrows) beside a
171
+ plain-English narrative on Beacon's /learn page. The tool BLOCKS while the user reads, highlights text
172
+ to ask questions, and drops question notes; it returns their questions, you ANSWER and re-push, looping
173
+ until they Save the lesson. There is NO approve/discard \u2014 understanding, not building.
174
+
175
+ ## 1. Load context first \u2014 don't explain blind
176
+
177
+ Before writing, call \`beacon_context_for_feature\` / \`beacon_map\` and read the relevant files so the
178
+ lesson is accurate. Name real files, functions, tables, and endpoints \u2014 never vague descriptions.
179
+
180
+ ## 2. Write like a great teacher \u2014 the house style (this is the whole point)
181
+
182
+ Every lesson must read like a patient senior engineer explaining to a sharp newcomer:
183
+
184
+ - **Plain English, always.** Define any term the first time it appears. No unexplained jargon, no
185
+ wall of nouns.
186
+ - **Problem-first.** Open each component with the PROBLEM it solves \u2014 a concrete human scenario, the
187
+ tension that forced the design, then the decision and what it means. (e.g. "When a salesperson
188
+ confirms an order it must also land in the ERP \u2014 but the ERP can be slow or down, and you do *not*
189
+ want confirmation to hang. So the sync is *decoupled*: confirming succeeds immediately and the push
190
+ happens in the background, with retries.")
191
+ - **Concrete step-by-step flow.** Walk the real path as a numbered list. Each step is ONE clear
192
+ action and names the real identifier in backticks \u2014 file (\`order-placed-sync-erp.ts\`), function
193
+ (\`syncOrderToErpWorkflow\`), event (\`order.placed\`), column (\`erp_sync_record\`), value
194
+ (\`requires_human_action\`). Enumerate the cases (success / retryable / rejected / \u2026) with the plain
195
+ meaning of each.
196
+ - **Anticipate-and-answer "Why X?".** After the flow, add short sections that answer the confusions a
197
+ reader will actually have ("Why two status columns?", "Why is the ledger append-only?"). ALWAYS
198
+ explain why the alternative is worse ("claiming success could hide a real failure; claiming hard
199
+ failure could cause a duplicate order later").
200
+ - **A worked example with real data.** Show the mechanism running on one concrete case \u2014 ideally a
201
+ small markdown table of state transitions \u2014 and land the insight ("that's 8 rows for one order, and
202
+ that's the point").
203
+ - **Typographic discipline.** **Bold** the decisions, *italic* the concepts being introduced, and put
204
+ \`inline code\` around every real identifier \u2014 on /learn, backticked real file paths become clickable
205
+ to open in the user's editor.
206
+
207
+ ## 3. Map the prose to the board
208
+
209
+ Every component/flow you NAME in the narrative becomes a \`node\` (title + a one-line \`summary\` for its
210
+ face + a fuller \`detail\` + the real \`files\` it maps to). Every "A does X to B" becomes an \`edge\` with
211
+ a relationship VERB \u2014 one of: imports, calls, persists to, reads from, writes to, routes to, depends
212
+ on, emits, returns, contains, extends \u2014 never a bare line. Keep the resting set small (~4\u20137 nodes);
213
+ push depth into \`detail\`, not the node face. Supply \`steps\` for the guided walkthrough: the first step
214
+ is the overview (empty \`focusIds\`), then teach one node (or a few) per step in order, each with its
215
+ \`focusIds\`.
216
+
217
+ ## 4. Answer in the loop \u2014 don't stop after one round
218
+
219
+ \`beacon_explain\` returns the user's questions, each tagged \`[q:ID]\`. Answer EACH by calling
220
+ \`beacon_explain\` AGAIN with the SAME lesson plus \`answers: [{ questionId, answer }]\` (keyed by the id).
221
+ Every answer must ADD understanding (rationale, trade-off) \u2014 never just restate the question. Expand
222
+ the narrative or add nodes where it helps. Keep looping until the tool reports the user saved or closed
223
+ the lesson.
224
+ `,LZ,I="<!-- beacon:workflow:start -->",UQ="<!-- beacon:workflow:end -->",LQ;var HQ=C(()=>{zQ();LZ=[{name:"beacon-init",body:()=>qQ},{name:"beacon-refresh",body:()=>XQ}];LQ=`${I}
162
225
  ## Beacon \u2014 feature workflow
163
226
 
164
227
  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:
@@ -215,6 +278,10 @@ Beacon extracts it deterministically and **strips the block from the prose** (it
215
278
 
216
279
  **The board is built ONLY from the block \u2014 prose is NOT parsed.** If your plan describes ANY database models/tables/columns in the prose (e.g. "Model \`legal_precedent.py\` \u2014 natural key (court, \u2026)"), you MUST also put them in the block's \`tables\` array (with \`columns\`), or the /db tab will be empty for that plan. Same for endpoints (\`endpoints\` with \`uses:[{table,access}]\`) and features (\`features\`). A plan that lists five tables in prose but ships a block with only \`features\` renders an empty database board \u2014 exactly the "I described models but the DB tab is empty" failure. Mirror every DB entity you mention into the block.
217
280
 
281
+ ### 2c. Mark the files you mention \u2014 write repo-relative paths in backticks
282
+
283
+ When a plan, feature, or architecture-component description mentions a source file, write its **repo-relative path inside backticks** \u2014 \`app/api/plan/route.ts\`, not "the plan route". On the /plan canvas Beacon turns every backticked token that matches a REAL repo file into a clickable mention that opens it in the user's editor; a bare filename matching several files (e.g. \`route.ts\`) opens a pick-one dropdown of the same-named candidates. The match is deterministic against the live code graph, so a path that isn't a real file just stays plain text \u2014 there's no special syntax to learn and no downside to over-marking: always name files by their real path so the reader can jump straight to the code.
284
+
218
285
  ### 3. At the end, register the work \u2014 in ONE call
219
286
 
220
287
  Call \`beacon_feature({ action: "done" })\` **ONCE** with a \`features\` array \u2014 one entry per feature the plan created \u2014 each with the files you touched and a short markdown description. This flips each one to **Done** \u2014 including its sub-tasks (the cascade completes every PENDING/IN_PROGRESS child; a sub-task you did NOT finish must be set BLOCKED or CANCELLED before registering, so it survives visibly) \u2014 and keeps \`beacon_context_for_feature\` accurate for the next session.
@@ -226,18 +293,18 @@ Register them all in that single batched call. If a plan added five features, th
226
293
  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.
227
294
 
228
295
  Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
229
- ${UQ}`});import{existsSync as y,mkdirSync as BQ,readdirSync as mZ,readFileSync as F,rmSync as pZ,writeFileSync as L}from"fs";import{dirname as SQ,join as N}from"path";function hQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function mQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=N(Q,".claude","plugins");if(!y(Z))return null;let $=[Z];for(let Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=N(V,".claude-plugin","plugin.json");try{if(y(q)&&JSON.parse(F(q,"utf8")).name==="beacon")return V}catch{}try{for(let X of mZ(V,{withFileTypes:!0}))if(X.isDirectory())J.push(N(V,X.name))}catch{}}$=J}return null}function pQ(Q){return mQ(Q)!==null}function jQ(Q){try{return JSON.parse(F(Q,"utf8"))}catch{return{}}}function cQ(Q,Z){BQ(SQ(Q),{recursive:!0}),L(Q,JSON.stringify(Z,null,2)+`
230
- `)}function _(Q,Z){let $=jQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),cQ(Q,$),!0}function S(Q,Z){return(jQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function h(Q,Z){let $=jQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let X=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==X)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return cQ(Q,$),!0}function m(Q,Z,$,Y){let J=`${Z}
296
+ ${UQ}`});import{existsSync as y,mkdirSync as BQ,readdirSync as cZ,readFileSync as R,rmSync as lZ,writeFileSync as k}from"fs";import{dirname as hQ,join as N}from"path";function mQ(){return!!process.env.CLAUDE_PLUGIN_ROOT}function pQ(Q=process.env.HOME||process.env.USERPROFILE||""){if(!Q)return null;let Z=N(Q,".claude","plugins");if(!y(Z))return null;let $=[Z];for(let Y=0;Y<3&&$.length;Y++){let J=[];for(let V of $){let q=N(V,".claude-plugin","plugin.json");try{if(y(q)&&JSON.parse(R(q,"utf8")).name==="beacon")return V}catch{}try{for(let W of cZ(V,{withFileTypes:!0}))if(W.isDirectory())J.push(N(V,W.name))}catch{}}$=J}return null}function cQ(Q){return pQ(Q)!==null}function GQ(Q){try{return JSON.parse(R(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){BQ(hQ(Q),{recursive:!0}),k(Q,JSON.stringify(Z,null,2)+`
297
+ `)}function _(Q,Z){let $=GQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let Y=$.hooks[Z.event];if(Y.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((q)=>q.command===Z.command)))return!1;return Y.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function S(Q,Z){return(GQ(Q).hooks?.[Z.event]??[]).some((J)=>J.hooks?.some((V)=>V.command===Z.command))}function h(Q,Z){let $=GQ(Q),Y=$.hooks?.[Z.event];if(!Y)return!1;let J=!1,V=Y.map((q)=>{let W=q.hooks?.length??0,z=(q.hooks??[]).filter((X)=>X.command!==Z.command);if(z.length!==W)J=!0;return{...q,hooks:z}}).filter((q)=>(q.hooks??[]).length>0);if(!J)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function m(Q,Z,$,Y){let J=`${Z}
231
298
  ${Y.trim()}
232
- ${$}`,V="";try{V=F(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
299
+ ${$}`,V="";try{V=R(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,J):V.trim()?`${V.trim()}
233
300
 
234
301
  ${J}
235
302
  `:`${J}
236
- `,BQ(SQ(Q),{recursive:!0}),L(Q,V.endsWith(`
303
+ `,BQ(hQ(Q),{recursive:!0}),k(Q,V.endsWith(`
237
304
  `)?V:`${V}
238
- `)}function R(Q,Z){try{return F(Q,"utf8").includes(Z)}catch{return!1}}function p(Q,Z,$){let Y="";try{Y=F(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
305
+ `)}function w(Q,Z){try{return R(Q,"utf8").includes(Z)}catch{return!1}}function p(Q,Z,$){let Y="";try{Y=R(Q,"utf8")}catch{return!1}let J=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!J.test(Y))return!1;let V=Y.replace(J,"").replace(/\n{3,}/g,`
239
306
 
240
- `).trimStart();return L(Q,V),!0}function c(Q,Z,$){let Y=N(Q,Z);BQ(Y,{recursive:!0});let J=N(Y,"SKILL.md");return L(J,$),J}function w(Q,Z){return y(N(Q,Z,"SKILL.md"))}function l(Q,Z){let $=N(Q,Z);if(!y($))return!1;return pZ($,{recursive:!0,force:!0}),!0}var K,k=`## Beacon (visual planning panel)
307
+ `).trimStart();return k(Q,V),!0}function c(Q,Z,$){let Y=N(Q,Z);BQ(Y,{recursive:!0});let J=N(Y,"SKILL.md");return k(J,$),J}function u(Q,Z){return y(N(Q,Z,"SKILL.md"))}function l(Q,Z){let $=N(Q,Z);if(!y($))return!1;return lZ($,{recursive:!0,force:!0}),!0}var K,L=`## Beacon (visual planning panel)
241
308
 
242
309
  This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
243
310
  agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
@@ -251,6 +318,9 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
251
318
  - User asks to "refresh Beacon" / "update the map" / "bring Beacon up to date" \u2192 invoke
252
319
  the \`beacon-refresh\` skill. Re-surveys the repo and updates init-derived nodes while
253
320
  preserving anything the user added by hand.
321
+ - User asks to "explain" / "teach me" / "walk me through" / "how does X work" \u2192 if the
322
+ \`beacon_explain\` MCP tool is available, author an interactive Lesson (a concept map +
323
+ plain-English narrative on /learn the user questions back) via the \`beacon-explain\` skill.
254
324
  - Run \`beacon doctor\` to audit what's wired (global hooks, repo's .mcp.json, AGENTS.md block).
255
325
 
256
326
  **The plan feedback loop**
@@ -258,24 +328,24 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
258
328
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
259
329
  on the /map and /db boards (added features, attached subtasks, edited columns, new
260
330
  endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
261
- verbatim. Do NOT implement until the tool returns approval.`;var GQ=C(()=>{K=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as cZ,renameSync as lZ,rmSync as dZ,writeFileSync as aZ}from"fs";import{dirname as nZ}from"path";function d(Q,Z){cZ(nZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{aZ($,Z),lZ($,Q)}catch(Y){throw dZ($,{force:!0}),Y}}function w1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var lQ=()=>{};var iQ={};VQ(iQ,{setupCodexAssets:()=>oZ,removeCodexMcp:()=>oQ,removeCodexArtifacts:()=>eZ,hasCodexMcp:()=>PQ,ensureCodexMcp:()=>rQ,codexMcpProblem:()=>rZ,codexDetected:()=>nQ,auditCodex:()=>iZ,CODEX_HOOKS:()=>r});import{readFileSync as s}from"fs";import{homedir as tZ}from"os";import{join as D}from"path";function dQ(){return process.env.HOME||process.env.USERPROFILE||tZ()}function nQ(){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 g(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function PQ(){try{return Boolean(g(s(T(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function rZ(){let Q="";try{Q=s(T(),"utf8")}catch{return null}let Z=g(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${u}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${u}`;return null}function rQ(){let Q="",Z=!1;try{Q=s(T(),"utf8"),Z=!0}catch{}if(Z){let V=g(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${u}`};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 ${u}`}}let $=!Q?"":Q.endsWith(`
331
+ verbatim. Do NOT implement until the tool returns approval.`;var jQ=C(()=>{K=["beacon-init","beacon-refresh","beacon-plan","beacon-explain"]});import{mkdirSync as dZ,renameSync as aZ,rmSync as nZ,writeFileSync as tZ}from"fs";import{dirname as sZ}from"path";function d(Q,Z){dZ(sZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{tZ($,Z),aZ($,Q)}catch(Y){throw nZ($,{force:!0}),Y}}function g1(Q,Z,$=!1){d(Q,JSON.stringify(Z,null,$?2:void 0))}var dQ=()=>{};var eQ={};VQ(eQ,{setupCodexAssets:()=>eZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>Z0,hasCodexMcp:()=>PQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>iZ,codexDetected:()=>tQ,auditCodex:()=>Q0,CODEX_HOOKS:()=>r});import{readFileSync as s}from"fs";import{homedir as rZ}from"os";import{join as f}from"path";function aQ(){return process.env.HOME||process.env.USERPROFILE||rZ()}function tQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function PQ(){try{return Boolean(D(s(T(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function iZ(){let Q="";try{Q=s(T(),"utf8")}catch{return null}let Z=D(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${g}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${g}`;return null}function oQ(){let Q="",Z=!1;try{Q=s(T(),"utf8"),Z=!0}catch{}if(Z){let V=D(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${g}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${g}`}}let $=!Q?"":Q.endsWith(`
262
332
  `)?`
263
333
  `:`
264
334
 
265
- `,Y=Q+$+sZ;if(g(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${u}`};return d(T(),Y),{added:!0}}function oQ(){let Q="";try{Q=s(T(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
266
- `),$=Z.indexOf(tQ);if($===-1)return{removed:!1,skipped:PQ()};let Y=Z.indexOf(sQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
335
+ `,Y=Q+$+oZ;if(D(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${g}`};return d(T(),Y),{added:!0}}function iQ(){let Q="";try{Q=s(T(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
336
+ `),$=Z.indexOf(sQ);if($===-1)return{removed:!1,skipped:PQ()};let Y=Z.indexOf(rQ,$);if(Y===-1)return{removed:!1,skipped:!0};Z.splice($,Y-$+1);let J=Z.join(`
267
337
  `).replace(/\n{3,}/g,`
268
338
 
269
- `).replace(/^\n+/,"");if(g(J)===null)return{removed:!1,skipped:!0};return d(T(),J),{removed:!0}}async function oZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (HQ(),WQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let z of K){if(!w(n(),z))J.push(z);c(n(),z,Y[z])}let V=0;for(let z of r)if(_(NQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=R(a(),t);m(a(),t,aQ,k);let X=rQ();return{skillsAdded:J,hooksAdded:V,agentsMdBlockTouched:!q,mcp:X}}function iZ(){let Q={};for(let $ of K)Q[$]=w(n(),$);let Z={};for(let $ of r)Z[$.event]=S(NQ(),{event:$.event,command:$.command});return{detected:nQ(),skills:Q,hooks:Z,agentsMdBlock:R(a(),t),mcp:PQ()}}function eZ(){let Q=[];for(let J of K)if(l(n(),J))Q.push(J);let Z=0;for(let J of r)if(h(NQ(),{event:J.event,command:J.command}))Z++;let $=p(a(),t,aQ),Y=oQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var xQ=()=>D(dQ(),".codex"),NQ=()=>D(xQ(),"hooks.json"),T=()=>D(xQ(),"config.toml"),a=()=>D(xQ(),"AGENTS.md"),n=()=>D(dQ(),".agents","skills"),t="<!-- beacon:global:start -->",aQ="<!-- beacon:global:end -->",r,KQ,tQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",sQ="# beacon:end",sZ,u="add it manually: codex mcp add beacon -- beacon mcp";var eQ=C(()=>{GQ();lQ();r=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];sZ=`${tQ}
339
+ `).replace(/^\n+/,"");if(D(J)===null)return{removed:!1,skipped:!0};return d(T(),J),{removed:!0}}async function eZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let X of K){if(!u(n(),X))V.push(X);c(n(),X,J[X])}let q=0;for(let X of r)if(_(NQ(),{event:X.event,matcher:X.matcher,command:X.command}))q++;let W=w(a(),t);m(a(),t,nQ,L);let z=oQ();return{skillsAdded:V,hooksAdded:q,agentsMdBlockTouched:!W,mcp:z}}function Q0(){let Q={};for(let $ of K)Q[$]=u(n(),$);let Z={};for(let $ of r)Z[$.event]=S(NQ(),{event:$.event,command:$.command});return{detected:tQ(),skills:Q,hooks:Z,agentsMdBlock:w(a(),t),mcp:PQ()}}function Z0(){let Q=[];for(let J of K)if(l(n(),J))Q.push(J);let Z=0;for(let J of r)if(h(NQ(),{event:J.event,command:J.command}))Z++;let $=p(a(),t,nQ),Y=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var xQ=()=>f(aQ(),".codex"),NQ=()=>f(xQ(),"hooks.json"),T=()=>f(xQ(),"config.toml"),a=()=>f(xQ(),"AGENTS.md"),n=()=>f(aQ(),".agents","skills"),t="<!-- beacon:global:start -->",nQ="<!-- beacon:global:end -->",r,KQ,sQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",oZ,g="add it manually: codex mcp add beacon -- beacon mcp";var QZ=C(()=>{jQ();dQ();r=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];oZ=`${sQ}
270
340
  [mcp_servers.beacon]
271
341
  command = "beacon"
272
342
  args = ["mcp"]
273
- ${sQ}
274
- `});var VZ={};VQ(VZ,{provisionDb:()=>R0});import{createClient as j0}from"@libsql/client";import{drizzle as G0}from"drizzle-orm/libsql";import{migrate as K0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as x0}from"drizzle-orm/migrator";import{dirname as RQ,join as N0}from"path";import{fileURLToPath as P0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function T0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function JZ(Q){if(!await e(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function F0(Q){for(let[Z,$]of Object.entries(M0)){if(!await e(Q,Z))continue;let Y=await T0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function R0(Q,Z=C0){let $=j0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let X=x0({migrationsFolder:Z})[0];if(X)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[X.hash,X.folderMillis]}),V=!0}let q=await JZ($);if(await K0(G0($),{migrationsFolder:Z}),await JZ($)>q)V=!0;return await F0($),{migrated:V}}finally{$.close()}}var v0,C0,M0;var zZ=C(async()=>{v0=RQ(RQ(RQ(P0(import.meta.url)))),C0=process.env.BEACON_MIGRATIONS_DIR||N0(v0,"drizzle"),M0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});GQ();import{existsSync as Q0}from"fs";import{homedir as Z0}from"os";import{join as o}from"path";function $0(){return process.env.HOME||process.env.USERPROFILE||Z0()}var i=()=>o($0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var Y0=k,FQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function J0(Q,Z){return c(vQ(),Q,Z)}function ZZ(Q){return w(vQ(),Q)}function V0(Q){return l(vQ(),Q)}function z0(Q){return _(CQ(),Q)}function q0(Q){return S(CQ(),Q)}function X0(Q){return h(CQ(),Q)}function U0(Q){m(MQ(),TQ,QZ,Q)}function $Z(){return R(MQ(),TQ)}function W0(){return p(MQ(),TQ,QZ)}function L1(){let Q={};for(let $ of K)Q[$]=ZZ($);let Z={};for(let $ of FQ)Z[$.event]=q0({event:$.event,command:$.command});return{homeExists:Q0(i()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function H0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (HQ(),WQ)),Y={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},J=[];for(let X of K){if(!ZZ(X))J.push(X);J0(X,Y[X])}let V=0;for(let X of FQ)if(z0({event:X.event,matcher:X.matcher,command:X.command}))V++;let q=$Z();return U0(Y0),{skillsAdded:J,hooksAdded:V,claudeMdBlockTouched:!q}}async function YZ(){if(hQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(pQ()){try{B0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await H0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (eQ(),iQ));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 B0(){let Q=[];for(let Y of K)if(V0(Y))Q.push(Y);let Z=0;for(let Y of FQ)if(X0(Y))Z++;let $=W0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as w0}from"async_hooks";import{spawnSync as u0}from"child_process";import{createHash as g0}from"crypto";import{existsSync as XZ,mkdirSync as A,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as UZ}from"os";import{basename as D0,join as x,parse as A0,resolve as qZ}from"path";function j(){return process.env.BEACON_HOME||x(UZ(),".beacon")}function DQ(){return x(j(),"workspaces.json")}function QQ(Q){return g0("sha256").update(Q).digest("hex").slice(0,12)}function r1(Q=process.cwd()){let Z=u0("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 WZ(Q){let Z=qZ(Q);return Z!==qZ(UZ())&&Z!==A0(Z).root}function HZ(){return x(j(),"deleted.json")}function AQ(){try{let Q=JSON.parse(uQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function BZ(Q){A(j(),{recursive:!0}),gQ(HZ(),JSON.stringify(Q,null,2))}function jZ(Q){return AQ().includes(Q)}function o1(Q){let Z=AQ();if(!Z.includes(Q))BZ([...Z,Q])}function f0(Q){let Z=AQ();if(Z.includes(Q))BZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return x(j(),Q)}function E0(Q){return`file:${x(ZQ(Q),"db.sqlite")}`}function f(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function fQ(Q){A(j(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function GZ(){return f().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return f().find((Z)=>Z.id===Q)??null}function KZ(Q,Z,$=new Date().toISOString()){if(!WZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=f(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||D0(Q),lastOpenedAt:$},X=[q,...J.filter((z)=>z.id!==Y)];return A(ZQ(Y),{recursive:!0}),fQ(X),q}function i1(Q,Z){return f0(QQ(Q)),KZ(Q,Z)}function e1(Q,Z=new Date().toISOString()){let $=f(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,fQ($)}function Q2(Q){if(fQ(f().filter((Z)=>Z.id!==Q)),EQ()===Q)I0(GZ()[0]?.id??null)}function xZ(){return x(j(),"active")}function EQ(){try{return uQ(xZ(),"utf8").trim()||null}catch{return null}}function I0(Q){A(j(),{recursive:!0}),gQ(xZ(),Q??"")}function Z2(){let Q=EQ();return Q?P(Q):null}function $2(){let Q=y0()??EQ();return Q?P(Q):null}function Y2(Q){return P(Q)?.path??null}function J2(){return XZ(DQ())}var NZ="beacon_ws";function PZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function V2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=PZ(Q,NZ);if($&&P($))return $;return O0()}function O0(){let Q=GZ();return Q.length===1?Q[0].id:null}var b0="x-beacon-workspace-path";async function z2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(b0);if($&&WZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=KZ($);return await L0(J.id),J.id}let Y=PZ(Q,NZ);if(Y&&P(Y))return Y;return null}var vZ=new w0;function q2(Q,Z){return Q?vZ.run(Q,Z):Z()}function y0(){return vZ.getStore()??null}var wQ=new Set;function X2(Q){wQ.delete(x(ZQ(Q),"db.sqlite"))}async function L0(Q){let Z=ZQ(Q),$=x(Z,"db.sqlite"),Y=XZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:J}=await zZ().then(() => VZ),V=await J(E0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as k0}from"net";var H2=4319;function _0(Q,Z,$=400){return new Promise((Y)=>{let J=k0({host:Q,port:Z}),V=!1,q=(X)=>{if(V)return;V=!0,J.destroy(),Y(X)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function S0(Q){for(let Z of["127.0.0.1","::1"])if(await _0(Z,Q))return!1;return!0}async function CZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await S0($))return $;return Q}import{execSync as n0,spawn as t0}from"child_process";import{mkdirSync as s0,openSync as r0,readFileSync as o0,writeFileSync as i0}from"fs";import{homedir as e0}from"os";import{dirname as Q1,join as YQ}from"path";import{fileURLToPath as Z1}from"url";import{createHash as $1}from"crypto";zQ();import{mkdirSync as m0,readFileSync as p0,writeFileSync as c0}from"fs";import{join as l0}from"path";var h0=["default","acceptEdits","bypassPermissions","auto"];function MZ(Q){return typeof Q==="string"&&h0.includes(Q)}function TZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function FZ(){return l0(j(),"preferences.json")}function IQ(){try{let Q=JSON.parse(p0(FZ(),"utf8"));return{planApprovalMode:MZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function P2(Q){let Z={...IQ(),...Q};return m0(j(),{recursive:!0}),c0(FZ(),JSON.stringify(Z,null,2)),Z}function RZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
343
+ ${rQ}
344
+ `});var zZ={};VQ(zZ,{provisionDb:()=>u0});import{createClient as K0}from"@libsql/client";import{drizzle as x0}from"drizzle-orm/libsql";import{migrate as N0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as P0}from"drizzle-orm/migrator";import{dirname as RQ,join as v0}from"path";import{fileURLToPath as C0}from"url";async function e(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function R0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((Y)=>String(Y.name)))}async function VZ(Q){if(!await e(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function w0(Q){for(let[Z,$]of Object.entries(F0)){if(!await e(Q,Z))continue;let Y=await R0(Q,Z);for(let J of $){if(!Y.has(J))continue;await Q.execute(`UPDATE "${Z}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function u0(Q,Z=T0){let $=K0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let Y=await e($,"__drizzle_migrations"),J=await e($,"Node"),V=!1;if(J&&!Y){let W=P0({migrationsFolder:Z})[0];if(W)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[W.hash,W.folderMillis]}),V=!0}let q=await VZ($);if(await N0(x0($),{migrationsFolder:Z}),await VZ($)>q)V=!0;return await w0($),{migrated:V}}finally{$.close()}}var M0,T0,F0;var qZ=C(async()=>{M0=RQ(RQ(RQ(C0(import.meta.url)))),T0=process.env.BEACON_MIGRATIONS_DIR||v0(M0,"drizzle"),F0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});jQ();import{existsSync as $0}from"fs";import{homedir as Y0}from"os";import{join as o}from"path";function J0(){return process.env.HOME||process.env.USERPROFILE||Y0()}var i=()=>o(J0(),".claude"),vQ=()=>o(i(),"skills"),CQ=()=>o(i(),"settings.json"),MQ=()=>o(i(),"CLAUDE.md"),TQ="<!-- beacon:global:start -->",ZZ="<!-- beacon:global:end -->";var V0=L,FQ=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function z0(Q,Z){return c(vQ(),Q,Z)}function $Z(Q){return u(vQ(),Q)}function q0(Q){return l(vQ(),Q)}function X0(Q){return _(CQ(),Q)}function U0(Q){return S(CQ(),Q)}function W0(Q){return h(CQ(),Q)}function H0(Q){m(MQ(),TQ,ZZ,Q)}function YZ(){return w(MQ(),TQ)}function B0(){return p(MQ(),TQ,ZZ)}function _1(){let Q={};for(let $ of K)Q[$]=$Z($);let Z={};for(let $ of FQ)Z[$.event]=U0({event:$.event,command:$.command});return{homeExists:$0(i()),skills:Q,hooks:Z,claudeMdBlock:YZ()}}async function G0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$,EXPLAIN_SKILL:Y}=await Promise.resolve().then(() => (HQ(),WQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$,"beacon-explain":Y},V=[];for(let z of K){if(!$Z(z))V.push(z);z0(z,J[z])}let q=0;for(let z of FQ)if(X0({event:z.event,matcher:z.matcher,command:z.command}))q++;let W=YZ();return H0(V0),{skillsAdded:V,hooksAdded:q,claudeMdBlockTouched:!W}}async function JZ(){if(mQ())return{ok:!0,skipped:"plugin",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1};let Q;if(cQ()){try{j0()}catch{}Q={ok:!0,skipped:"plugin-present",skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}else try{Q={ok:!0,...await G0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (QZ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function j0(){let Q=[];for(let Y of K)if(q0(Y))Q.push(Y);let Z=0;for(let Y of FQ)if(W0(Y))Z++;let $=B0();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as g0}from"async_hooks";import{spawnSync as D0}from"child_process";import{createHash as f0}from"crypto";import{existsSync as UZ,mkdirSync as O,readFileSync as uQ,writeFileSync as gQ}from"fs";import{homedir as WZ}from"os";import{basename as O0,join as x,parse as A0,resolve as XZ}from"path";function G(){return process.env.BEACON_HOME||x(WZ(),".beacon")}function DQ(){return x(G(),"workspaces.json")}function QQ(Q){return f0("sha256").update(Q).digest("hex").slice(0,12)}function i1(Q=process.cwd()){let Z=D0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function HZ(Q){let Z=XZ(Q);return Z!==XZ(WZ())&&Z!==A0(Z).root}function BZ(){return x(G(),"deleted.json")}function fQ(){try{let Q=JSON.parse(uQ(BZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function GZ(Q){O(G(),{recursive:!0}),gQ(BZ(),JSON.stringify(Q,null,2))}function jZ(Q){return fQ().includes(Q)}function e1(Q){let Z=fQ();if(!Z.includes(Q))GZ([...Z,Q])}function E0(Q){let Z=fQ();if(Z.includes(Q))GZ(Z.filter(($)=>$!==Q))}function ZQ(Q){return x(G(),Q)}function b0(Q){return`file:${x(ZQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(uQ(DQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function OQ(Q){O(G(),{recursive:!0}),gQ(DQ(),JSON.stringify(Q,null,2))}function KZ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return A().find((Z)=>Z.id===Q)??null}function xZ(Q,Z,$=new Date().toISOString()){if(!HZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let Y=QQ(Q);if(jZ(Y))throw Error(`beacon: workspace ${Y} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=A(),V=J.find((z)=>z.id===Y),q={id:Y,path:Q,name:Z||V?.name||O0(Q),lastOpenedAt:$},W=[q,...J.filter((z)=>z.id!==Y)];return O(ZQ(Y),{recursive:!0}),OQ(W),q}function Q2(Q,Z){return E0(QQ(Q)),xZ(Q,Z)}function Z2(Q,Z=new Date().toISOString()){let $=A(),Y=$.find((J)=>J.id===Q);if(!Y)return;Y.lastOpenedAt=Z,OQ($)}function $2(Q){if(OQ(A().filter((Z)=>Z.id!==Q)),AQ()===Q)I0(KZ()[0]?.id??null)}function NZ(){return x(G(),"active")}function AQ(){try{return uQ(NZ(),"utf8").trim()||null}catch{return null}}function I0(Q){O(G(),{recursive:!0}),gQ(NZ(),Q??"")}function Y2(){let Q=AQ();return Q?P(Q):null}function J2(){let Q=L0()??AQ();return Q?P(Q):null}function V2(Q){return P(Q)?.path??null}function z2(){return UZ(DQ())}var PZ="beacon_ws";function vZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let Y of $.split(";")){let J=Y.indexOf("=");if(J===-1)continue;if(Y.slice(0,J).trim()===Z)return decodeURIComponent(Y.slice(J+1).trim())}return null}function q2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=vZ(Q,PZ);if($&&P($))return $;return y0()}function y0(){let Q=KZ();return Q.length===1?Q[0].id:null}var k0="x-beacon-workspace-path";async function X2(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(k0);if($&&HZ($)&&!jZ(QQ($))&&(!Z||QQ($)===Z)){let J=xZ($);return await _0(J.id),J.id}let Y=vZ(Q,PZ);if(Y&&P(Y))return Y;return null}var CZ=new g0;function U2(Q,Z){return Q?CZ.run(Q,Z):Z()}function L0(){return CZ.getStore()??null}var wQ=new Set;function W2(Q){wQ.delete(x(ZQ(Q),"db.sqlite"))}async function _0(Q){let Z=ZQ(Q),$=x(Z,"db.sqlite"),Y=UZ($);if(Y&&wQ.has($))return{ok:!0,created:!1,migrated:!1};try{O(Z,{recursive:!0});let{provisionDb:J}=await qZ().then(() => zZ),V=await J(b0(Q));return wQ.add($),{ok:!0,created:!Y,migrated:Y&&V.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as S0}from"net";var G2=4319;function h0(Q,Z,$=400){return new Promise((Y)=>{let J=S0({host:Q,port:Z}),V=!1,q=(W)=>{if(V)return;V=!0,J.destroy(),Y(W)};J.once("connect",()=>q(!0)),J.once("error",()=>q(!1)),J.setTimeout($,()=>q(!1))})}async function m0(Q){for(let Z of["127.0.0.1","::1"])if(await h0(Z,Q))return!1;return!0}async function MZ(Q,Z=20){for(let $=Q;$<Q+Z;$++)if(await m0($))return $;return Q}import{execSync as s0,spawn as r0}from"child_process";import{mkdirSync as o0,openSync as i0,readFileSync as e0,writeFileSync as Q1}from"fs";import{homedir as Z1}from"os";import{dirname as $1,join as YQ}from"path";import{fileURLToPath as Y1}from"url";import{createHash as J1}from"crypto";zQ();import{mkdirSync as c0,readFileSync as l0,writeFileSync as d0}from"fs";import{join as a0}from"path";var p0=["default","acceptEdits","bypassPermissions","auto"];function TZ(Q){return typeof Q==="string"&&p0.includes(Q)}function FZ(Q,Z){let $={behavior:"allow"};if(Q)$.updatedPermissions=[{type:"setMode",mode:Q,destination:"session"}];let Y={hookEventName:"PermissionRequest",decision:$};if(Z?.trim())Y.additionalContext=Z;return{hookSpecificOutput:Y}}function RZ(){return a0(G(),"preferences.json")}function EQ(){try{let Q=JSON.parse(l0(RZ(),"utf8"));return{planApprovalMode:TZ(Q.planApprovalMode)?Q.planApprovalMode:void 0,planApprovalModeConfigured:Q.planApprovalModeConfigured===!0,telemetryUuid:typeof Q.telemetryUuid==="string"?Q.telemetryUuid:void 0,telemetryEnabled:Q.telemetryEnabled===!1?!1:Q.telemetryEnabled===!0?!0:void 0}}catch{return{}}}function C2(Q){let Z={...EQ(),...Q};return c0(G(),{recursive:!0}),d0(RZ(),JSON.stringify(Z,null,2)),Z}function wZ(Q){if(!Q?.length)return"";let Z=Q.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),$=Q.some((Y)=>Y.id);return`
275
345
 
276
346
  This plan created these roadmap feature(s):
277
347
  `+Z.join(`
278
- `)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as d0}from"child_process";import{platform as wZ}from"os";function a0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=wZ()==="darwin"?"open":wZ()==="win32"?"start":"xdg-open";try{d0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function uZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);a0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var Y1=YQ(Q1(Z1(import.meta.url)),".."),bQ=process.env.BEACON_HOME||YQ(e0(),".beacon"),gZ=YQ(bQ,"server.json"),J1=process.env.PORT||"4319";function V1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function z1(Q){try{return JSON.parse(o0(Q,"utf8"))}catch{return null}}async function DZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function q1(Q,Z=60){for(let $=0;$<Z;$++){if(await DZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function X1(Q){s0(bQ,{recursive:!0});let Z=r0(YQ(bQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=t0("bun",["run","dev"],{cwd:Y1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return i0(gZ,JSON.stringify(J)),J}async function U1(){let Q=z1(gZ);if(Q&&V1(Q.pid)&&await DZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await CZ(Number(J1))),{port:$}=X1(Z);return await q1(`http://localhost:${$}/api/workspace`),$}function W1(){try{return n0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function H1(Q){return $1("sha256").update(Q).digest("hex").slice(0,12)}async function B1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function OQ(Q,Z){return TZ(Q,Z)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function v(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await YZ();let Z=(await B1())?.tool_input?.plan;if(!Z||!Z.trim())v(OQ());let Y=`http://localhost:${await U1()}`,J=W1()||process.cwd(),V=H1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
279
- `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",X=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(X.status===422){let H=await X.json().catch(()=>({}));v($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!X.ok)v(OQ());await uZ(Y,V);let z=Date.now()+LQ,W=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await W(yQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")v(OQ(IQ().planApprovalMode,RZ(H.features)));if(H.kind==="discarded")v($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")v($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
348
+ `)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+($?", each keyed by the `id` above (no title-matching needed)":"")+", each with the files you touched + a short markdown summary. Do them all in that single "+"batched call so every feature flips to Done \u2014 do NOT register only the umbrella, and do "+"NOT make one call per feature."}import{execSync as n0}from"child_process";import{platform as uZ}from"os";function t0(Q){if(process.env.BEACON_NO_OPEN)return;let Z=uZ()==="darwin"?"open":uZ()==="win32"?"start":"xdg-open";try{n0(`${Z} "${Q}"`,{stdio:"ignore"})}catch{}}async function gZ(Q,Z){if(await fetch(`${Q}/api/plan/presence`,{headers:{"x-beacon-workspace":Z}}).then((J)=>J.json()).then((J)=>!!J?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Z}`);t0(`${Q}/api/workspace/activate?id=${Z}&redirect=${Y}`)}var V1=YQ($1(Y1(import.meta.url)),".."),IQ=process.env.BEACON_HOME||YQ(Z1(),".beacon"),DZ=YQ(IQ,"server.json"),z1=process.env.PORT||"4319";function q1(Q){try{return process.kill(Q,0),!0}catch{return!1}}function X1(Q){try{return JSON.parse(e0(Q,"utf8"))}catch{return null}}async function fZ(Q){try{return(await fetch(Q)).ok}catch{return!1}}async function U1(Q,Z=60){for(let $=0;$<Z;$++){if(await fZ(Q))return!0;await new Promise((Y)=>setTimeout(Y,500))}return!1}function W1(Q){o0(IQ,{recursive:!0});let Z=i0(YQ(IQ,"server.log"),"a"),$={...process.env,PORT:Q,BEACON_NO_OPEN:"1"};delete $.BEACON_REPO,delete $.BEACON_DATA_DIR,delete $.DATABASE_URL;let Y=r0("bun",["run","dev"],{cwd:V1,env:$,detached:!0,stdio:["ignore",Z,Z]});Y.unref();let J={pid:Y.pid??0,port:Q};return Q1(DZ,JSON.stringify(J)),J}async function H1(){let Q=X1(DZ);if(Q&&q1(Q.pid)&&await fZ(`http://localhost:${Q.port}/api/workspace`))return Q.port;let Z=String(await MZ(Number(z1))),{port:$}=W1(Z);return await U1(`http://localhost:${$}/api/workspace`),$}function B1(){try{return s0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function G1(Q){return J1("sha256").update(Q).digest("hex").slice(0,12)}async function j1(){if(process.stdin.isTTY)return null;let Q=[];for await(let $ of process.stdin)Q.push($);let Z=Buffer.concat(Q).toString("utf8").trim();if(!Z)return null;try{return JSON.parse(Z)}catch{return null}}function bQ(Q,Z){return FZ(Q,Z)}function $Q(Q){return{hookSpecificOutput:{hookEventName:"PermissionRequest",decision:{behavior:"deny",message:Q}}}}function v(Q){process.stdout.write(JSON.stringify(Q)),process.exit(0)}(async()=>{await JZ();let Z=(await j1())?.tool_input?.plan;if(!Z||!Z.trim())v(bQ());let Y=`http://localhost:${await H1()}`,J=B1()||process.cwd(),V=G1(J);await fetch(`${Y}/api/workspace/activate?id=${V}`).catch(()=>{});let q=Z.split(`
349
+ `,1)[0]?.replace(/^#+\s*/,"").slice(0,160)||"Plan review",W=await fetch(`${Y}/api/plan`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":V},body:JSON.stringify({description:q,markdown:Z})});if(W.status===422){let H=await W.json().catch(()=>({}));v($Q(H.error??"Beacon rejected the plan: every roadmap feature needs a category and a priority. Add them and re-present."))}if(!W.ok)v(bQ());await gZ(Y,V);let z=Date.now()+kQ,X=(H)=>new Promise((JQ)=>setTimeout(JQ,H));while(Date.now()<z){await X(yQ);let H=await fetch(`${Y}/api/plan/verdict`,{headers:{"x-beacon-workspace":V}}).then((JQ)=>JQ.json()).catch(()=>null);if(!H)continue;if(H.kind==="approved")v(bQ(EQ().planApprovalMode,wZ(H.features)));if(H.kind==="discarded")v($Q("The user discarded the plan in Beacon. Ask what they want to adjust before re-presenting."));if(H.kind==="feedback")v($Q(`The user left feedback on the plan in Beacon (inline comments and/or edits on the /map and /db boards). Revise the plan based on the feedback below, then re-present (call ExitPlanMode again):
280
350
 
281
351
  `+H.feedback))}v($Q("\u23F3 Still awaiting your review in Beacon \u2014 the plan is open on /plan and nothing was lost. "+"Claude Code caps a single plan-review hook at ~10 minutes, so to keep waiting you MUST call ExitPlanMode again now with the SAME plan. Re-presenting resumes the same review (your in-progress annotations and any decision are preserved). Do NOT implement, and do "+"NOT ask in the terminal \u2014 just re-present."))})();