trybeacon 0.1.25 → 0.1.26

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 (300) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +6 -5
  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/prune-planned/route.js +1 -0
  40. package/.next/server/app/api/db/prune-planned/route.js.nft.json +1 -0
  41. package/.next/server/app/api/db/prune-planned/route_client-reference-manifest.js +1 -0
  42. package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
  43. package/.next/server/app/api/db/relations/[id]/route.js +1 -1
  44. package/.next/server/app/api/db/tables/[id]/route.js +1 -1
  45. package/.next/server/app/api/draft/approve/route.js +1 -1
  46. package/.next/server/app/api/draft/route.js +1 -1
  47. package/.next/server/app/api/draft/status/route.js +1 -1
  48. package/.next/server/app/api/edges/[id]/route.js +1 -1
  49. package/.next/server/app/api/edges/route.js +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 +1 -1
  57. package/.next/server/app/api/map/describe/route.js +2 -2
  58. package/.next/server/app/api/map/files/route.js +1 -1
  59. package/.next/server/app/api/map/finish/route.js +1 -1
  60. package/.next/server/app/api/map/route.js +1 -1
  61. package/.next/server/app/api/map/start/route.js +1 -1
  62. package/.next/server/app/api/map/touch-active/route.js +1 -1
  63. package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
  64. package/.next/server/app/api/nodes/[id]/route.js +1 -1
  65. package/.next/server/app/api/nodes/positions/route.js +1 -1
  66. package/.next/server/app/api/nodes/route.js +1 -1
  67. package/.next/server/app/api/nodes/subtasks/route.js +1 -1
  68. package/.next/server/app/api/notes/[id]/route.js +1 -1
  69. package/.next/server/app/api/notes/route.js +1 -1
  70. package/.next/server/app/api/open/route.js +1 -1
  71. package/.next/server/app/api/plan/annotations/route.js +3 -3
  72. package/.next/server/app/api/plan/approve/route.js +2 -2
  73. package/.next/server/app/api/plan/history/route.js +1 -1
  74. package/.next/server/app/api/plan/markdown/route.js +1 -1
  75. package/.next/server/app/api/plan/presence/route.js +1 -1
  76. package/.next/server/app/api/plan/route.js +1 -1
  77. package/.next/server/app/api/plan/verdict/route.js +1 -1
  78. package/.next/server/app/api/preferences/route.js +1 -1
  79. package/.next/server/app/api/reset/route.js +1 -1
  80. package/.next/server/app/api/stream/route.js +2 -2
  81. package/.next/server/app/api/version/route.js +1 -1
  82. package/.next/server/app/api/workspace/activate/route.js +1 -1
  83. package/.next/server/app/api/workspace/route.js +1 -1
  84. package/.next/server/app/apple-icon.png/route.js +1 -1
  85. package/.next/server/app/docs/page.js +2 -2
  86. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/docs.html +1 -1
  88. package/.next/server/app/docs.rsc +2 -2
  89. package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
  90. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  91. package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
  92. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  93. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  94. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  95. package/.next/server/app/feedback/page.js +2 -2
  96. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app/feedback.html +1 -1
  98. package/.next/server/app/feedback.rsc +2 -2
  99. package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
  100. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  101. package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
  102. package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
  103. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  104. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  105. package/.next/server/app/help/page.js +2 -2
  106. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  107. package/.next/server/app/help.html +1 -1
  108. package/.next/server/app/help.rsc +2 -2
  109. package/.next/server/app/help.segments/_full.segment.rsc +2 -2
  110. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  111. package/.next/server/app/help.segments/_index.segment.rsc +2 -2
  112. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  113. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  114. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  115. package/.next/server/app/icon.svg/route.js +1 -1
  116. package/.next/server/app/index.html +1 -1
  117. package/.next/server/app/index.rsc +2 -2
  118. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  119. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  120. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  121. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  122. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  123. package/.next/server/app/map/page.js +2 -2
  124. package/.next/server/app/map/page.js.nft.json +1 -1
  125. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  126. package/.next/server/app/page.js +2 -2
  127. package/.next/server/app/page_client-reference-manifest.js +1 -1
  128. package/.next/server/app/plan/page.js +2 -2
  129. package/.next/server/app/plan/page.js.nft.json +1 -1
  130. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  131. package/.next/server/app/settings/page.js +2 -2
  132. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app-paths-manifest.json +6 -5
  134. package/.next/server/chunks/249.js +1 -1
  135. package/.next/server/chunks/2877.js +1 -1
  136. package/.next/server/chunks/2933.js +1 -1
  137. package/.next/server/chunks/2981.js +1 -1
  138. package/.next/server/chunks/3221.js +1 -1
  139. package/.next/server/chunks/4378.js +1 -1
  140. package/.next/server/chunks/5258.js +1 -1
  141. package/.next/server/chunks/5934.js +1 -0
  142. package/.next/server/chunks/7373.js +1 -1
  143. package/.next/server/chunks/9127.js +1 -1
  144. package/.next/server/chunks/9213.js +1 -1
  145. package/.next/server/chunks/9313.js +3 -3
  146. package/.next/server/chunks/9683.js +1 -1
  147. package/.next/server/chunks/9734.js +1 -1
  148. package/.next/server/middleware-build-manifest.js +1 -1
  149. package/.next/server/pages/404.html +1 -1
  150. package/.next/server/pages/500.html +1 -1
  151. package/.next/server/server-reference-manifest.js +1 -1
  152. package/.next/server/server-reference-manifest.json +1 -1
  153. package/.next/static/chunks/1317-abd6936ef6f7e4d9.js +1 -0
  154. package/.next/static/chunks/app/_global-error/page-4cdc03c65547f289.js +1 -0
  155. package/.next/static/chunks/app/api/board-annotations/[id]/route-4cdc03c65547f289.js +1 -0
  156. package/.next/static/chunks/app/api/board-annotations/route-4cdc03c65547f289.js +1 -0
  157. package/.next/static/chunks/app/api/board-layout/route-4cdc03c65547f289.js +1 -0
  158. package/.next/static/chunks/app/api/bug-flags/[id]/route-4cdc03c65547f289.js +1 -0
  159. package/.next/static/chunks/app/api/bug-flags/route-4cdc03c65547f289.js +1 -0
  160. package/.next/static/chunks/app/api/code-graph/position/route-4cdc03c65547f289.js +1 -0
  161. package/.next/static/chunks/app/api/code-graph/route-4cdc03c65547f289.js +1 -0
  162. package/.next/static/chunks/app/api/context/feature/route-4cdc03c65547f289.js +1 -0
  163. package/.next/static/chunks/app/api/context/file/route-4cdc03c65547f289.js +1 -0
  164. package/.next/static/chunks/app/api/context/route-4cdc03c65547f289.js +1 -0
  165. package/.next/static/chunks/app/api/db/arrange/route-4cdc03c65547f289.js +1 -0
  166. package/.next/static/chunks/app/api/db/backfill-access/route-4cdc03c65547f289.js +1 -0
  167. package/.next/static/chunks/app/api/db/position/route-4cdc03c65547f289.js +1 -0
  168. package/.next/static/chunks/app/api/db/prune-planned/route-4cdc03c65547f289.js +1 -0
  169. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-4cdc03c65547f289.js +1 -0
  170. package/.next/static/chunks/app/api/db/relations/[id]/route-4cdc03c65547f289.js +1 -0
  171. package/.next/static/chunks/app/api/db/tables/[id]/route-4cdc03c65547f289.js +1 -0
  172. package/.next/static/chunks/app/api/draft/approve/route-4cdc03c65547f289.js +1 -0
  173. package/.next/static/chunks/app/api/draft/route-4cdc03c65547f289.js +1 -0
  174. package/.next/static/chunks/app/api/draft/status/route-4cdc03c65547f289.js +1 -0
  175. package/.next/static/chunks/app/api/edges/[id]/route-4cdc03c65547f289.js +1 -0
  176. package/.next/static/chunks/app/api/edges/route-4cdc03c65547f289.js +1 -0
  177. package/.next/static/chunks/app/api/endpoints/[id]/route-4cdc03c65547f289.js +1 -0
  178. package/.next/static/chunks/app/api/entities/route-4cdc03c65547f289.js +1 -0
  179. package/.next/static/chunks/app/api/feedback/[id]/route-4cdc03c65547f289.js +1 -0
  180. package/.next/static/chunks/app/api/feedback/[id]/vote/route-4cdc03c65547f289.js +1 -0
  181. package/.next/static/chunks/app/api/feedback/route-4cdc03c65547f289.js +1 -0
  182. package/.next/static/chunks/app/api/ingest/route-4cdc03c65547f289.js +1 -0
  183. package/.next/static/chunks/app/api/init/route-4cdc03c65547f289.js +1 -0
  184. package/.next/static/chunks/app/api/map/describe/route-4cdc03c65547f289.js +1 -0
  185. package/.next/static/chunks/app/api/map/files/route-4cdc03c65547f289.js +1 -0
  186. package/.next/static/chunks/app/api/map/finish/route-4cdc03c65547f289.js +1 -0
  187. package/.next/static/chunks/app/api/map/route-4cdc03c65547f289.js +1 -0
  188. package/.next/static/chunks/app/api/map/start/route-4cdc03c65547f289.js +1 -0
  189. package/.next/static/chunks/app/api/map/touch-active/route-4cdc03c65547f289.js +1 -0
  190. package/.next/static/chunks/app/api/nodes/[id]/position/route-4cdc03c65547f289.js +1 -0
  191. package/.next/static/chunks/app/api/nodes/[id]/route-4cdc03c65547f289.js +1 -0
  192. package/.next/static/chunks/app/api/nodes/positions/route-4cdc03c65547f289.js +1 -0
  193. package/.next/static/chunks/app/api/nodes/route-4cdc03c65547f289.js +1 -0
  194. package/.next/static/chunks/app/api/nodes/subtasks/route-4cdc03c65547f289.js +1 -0
  195. package/.next/static/chunks/app/api/notes/[id]/route-4cdc03c65547f289.js +1 -0
  196. package/.next/static/chunks/app/api/notes/route-4cdc03c65547f289.js +1 -0
  197. package/.next/static/chunks/app/api/open/route-4cdc03c65547f289.js +1 -0
  198. package/.next/static/chunks/app/api/plan/annotations/route-4cdc03c65547f289.js +1 -0
  199. package/.next/static/chunks/app/api/plan/approve/route-4cdc03c65547f289.js +1 -0
  200. package/.next/static/chunks/app/api/plan/history/route-4cdc03c65547f289.js +1 -0
  201. package/.next/static/chunks/app/api/plan/markdown/route-4cdc03c65547f289.js +1 -0
  202. package/.next/static/chunks/app/api/plan/presence/route-4cdc03c65547f289.js +1 -0
  203. package/.next/static/chunks/app/api/plan/route-4cdc03c65547f289.js +1 -0
  204. package/.next/static/chunks/app/api/plan/verdict/route-4cdc03c65547f289.js +1 -0
  205. package/.next/static/chunks/app/api/preferences/route-4cdc03c65547f289.js +1 -0
  206. package/.next/static/chunks/app/api/reset/route-4cdc03c65547f289.js +1 -0
  207. package/.next/static/chunks/app/api/stream/route-4cdc03c65547f289.js +1 -0
  208. package/.next/static/chunks/app/api/version/route-4cdc03c65547f289.js +1 -0
  209. package/.next/static/chunks/app/api/workspace/activate/route-4cdc03c65547f289.js +1 -0
  210. package/.next/static/chunks/app/api/workspace/route-4cdc03c65547f289.js +1 -0
  211. package/.next/static/chunks/app/map/{page-2cac4ffa4e4220c2.js → page-bd17b84e1aebd827.js} +1 -1
  212. package/.next/static/chunks/app/plan/page-f52b1b0bc8037bc0.js +1 -0
  213. package/.next/static/chunks/next/dist/client/components/builtin/app-error-4cdc03c65547f289.js +1 -0
  214. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-4cdc03c65547f289.js +1 -0
  215. package/.next/static/chunks/next/dist/client/components/builtin/not-found-4cdc03c65547f289.js +1 -0
  216. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-4cdc03c65547f289.js +1 -0
  217. package/.next/static/css/cbb14bbfa47152fd.css +1 -0
  218. package/.next/static/nIOWlnJIVXwqjfj2Fpn44/_buildManifest.js +1 -0
  219. package/.next/trace +37 -37
  220. package/.next/trace-build +1 -1
  221. package/.next/types/app/api/db/prune-planned/route.ts +351 -0
  222. package/.next/types/routes.d.ts +2 -1
  223. package/.next/types/validator.ts +9 -0
  224. package/dist/bin/doctor.js +1 -1
  225. package/dist/bin/hook.js +4 -4
  226. package/dist/bin/mcp.js +1 -1
  227. package/dist/bin/plan.js +1 -1
  228. package/dist/bin/remove.js +6 -6
  229. package/dist/bin/uninstall.js +1 -1
  230. package/dist/lib/workspaces.js +1 -1
  231. package/drizzle/0005_graceful_adam_warlock.sql +3 -0
  232. package/drizzle/meta/0005_snapshot.json +1751 -0
  233. package/drizzle/meta/_journal.json +7 -0
  234. package/package.json +1 -1
  235. package/.next/server/chunks/617.js +0 -1
  236. package/.next/static/MYvJ_ebinIGa9MP5kWFaY/_buildManifest.js +0 -1
  237. package/.next/static/chunks/6773-89cca3b011769270.js +0 -1
  238. package/.next/static/chunks/app/_global-error/page-8fa95c63b95bf9c3.js +0 -1
  239. package/.next/static/chunks/app/api/board-annotations/[id]/route-8fa95c63b95bf9c3.js +0 -1
  240. package/.next/static/chunks/app/api/board-annotations/route-8fa95c63b95bf9c3.js +0 -1
  241. package/.next/static/chunks/app/api/board-layout/route-8fa95c63b95bf9c3.js +0 -1
  242. package/.next/static/chunks/app/api/bug-flags/[id]/route-8fa95c63b95bf9c3.js +0 -1
  243. package/.next/static/chunks/app/api/bug-flags/route-8fa95c63b95bf9c3.js +0 -1
  244. package/.next/static/chunks/app/api/code-graph/position/route-8fa95c63b95bf9c3.js +0 -1
  245. package/.next/static/chunks/app/api/code-graph/route-8fa95c63b95bf9c3.js +0 -1
  246. package/.next/static/chunks/app/api/context/feature/route-8fa95c63b95bf9c3.js +0 -1
  247. package/.next/static/chunks/app/api/context/file/route-8fa95c63b95bf9c3.js +0 -1
  248. package/.next/static/chunks/app/api/context/route-8fa95c63b95bf9c3.js +0 -1
  249. package/.next/static/chunks/app/api/db/arrange/route-8fa95c63b95bf9c3.js +0 -1
  250. package/.next/static/chunks/app/api/db/backfill-access/route-8fa95c63b95bf9c3.js +0 -1
  251. package/.next/static/chunks/app/api/db/position/route-8fa95c63b95bf9c3.js +0 -1
  252. package/.next/static/chunks/app/api/db/reconcile-endpoints/route-8fa95c63b95bf9c3.js +0 -1
  253. package/.next/static/chunks/app/api/db/relations/[id]/route-8fa95c63b95bf9c3.js +0 -1
  254. package/.next/static/chunks/app/api/db/tables/[id]/route-8fa95c63b95bf9c3.js +0 -1
  255. package/.next/static/chunks/app/api/draft/approve/route-8fa95c63b95bf9c3.js +0 -1
  256. package/.next/static/chunks/app/api/draft/route-8fa95c63b95bf9c3.js +0 -1
  257. package/.next/static/chunks/app/api/draft/status/route-8fa95c63b95bf9c3.js +0 -1
  258. package/.next/static/chunks/app/api/edges/[id]/route-8fa95c63b95bf9c3.js +0 -1
  259. package/.next/static/chunks/app/api/edges/route-8fa95c63b95bf9c3.js +0 -1
  260. package/.next/static/chunks/app/api/endpoints/[id]/route-8fa95c63b95bf9c3.js +0 -1
  261. package/.next/static/chunks/app/api/entities/route-8fa95c63b95bf9c3.js +0 -1
  262. package/.next/static/chunks/app/api/feedback/[id]/route-8fa95c63b95bf9c3.js +0 -1
  263. package/.next/static/chunks/app/api/feedback/[id]/vote/route-8fa95c63b95bf9c3.js +0 -1
  264. package/.next/static/chunks/app/api/feedback/route-8fa95c63b95bf9c3.js +0 -1
  265. package/.next/static/chunks/app/api/ingest/route-8fa95c63b95bf9c3.js +0 -1
  266. package/.next/static/chunks/app/api/init/route-8fa95c63b95bf9c3.js +0 -1
  267. package/.next/static/chunks/app/api/map/describe/route-8fa95c63b95bf9c3.js +0 -1
  268. package/.next/static/chunks/app/api/map/files/route-8fa95c63b95bf9c3.js +0 -1
  269. package/.next/static/chunks/app/api/map/finish/route-8fa95c63b95bf9c3.js +0 -1
  270. package/.next/static/chunks/app/api/map/route-8fa95c63b95bf9c3.js +0 -1
  271. package/.next/static/chunks/app/api/map/start/route-8fa95c63b95bf9c3.js +0 -1
  272. package/.next/static/chunks/app/api/map/touch-active/route-8fa95c63b95bf9c3.js +0 -1
  273. package/.next/static/chunks/app/api/nodes/[id]/position/route-8fa95c63b95bf9c3.js +0 -1
  274. package/.next/static/chunks/app/api/nodes/[id]/route-8fa95c63b95bf9c3.js +0 -1
  275. package/.next/static/chunks/app/api/nodes/positions/route-8fa95c63b95bf9c3.js +0 -1
  276. package/.next/static/chunks/app/api/nodes/route-8fa95c63b95bf9c3.js +0 -1
  277. package/.next/static/chunks/app/api/nodes/subtasks/route-8fa95c63b95bf9c3.js +0 -1
  278. package/.next/static/chunks/app/api/notes/[id]/route-8fa95c63b95bf9c3.js +0 -1
  279. package/.next/static/chunks/app/api/notes/route-8fa95c63b95bf9c3.js +0 -1
  280. package/.next/static/chunks/app/api/open/route-8fa95c63b95bf9c3.js +0 -1
  281. package/.next/static/chunks/app/api/plan/annotations/route-8fa95c63b95bf9c3.js +0 -1
  282. package/.next/static/chunks/app/api/plan/approve/route-8fa95c63b95bf9c3.js +0 -1
  283. package/.next/static/chunks/app/api/plan/history/route-8fa95c63b95bf9c3.js +0 -1
  284. package/.next/static/chunks/app/api/plan/markdown/route-8fa95c63b95bf9c3.js +0 -1
  285. package/.next/static/chunks/app/api/plan/presence/route-8fa95c63b95bf9c3.js +0 -1
  286. package/.next/static/chunks/app/api/plan/route-8fa95c63b95bf9c3.js +0 -1
  287. package/.next/static/chunks/app/api/plan/verdict/route-8fa95c63b95bf9c3.js +0 -1
  288. package/.next/static/chunks/app/api/preferences/route-8fa95c63b95bf9c3.js +0 -1
  289. package/.next/static/chunks/app/api/reset/route-8fa95c63b95bf9c3.js +0 -1
  290. package/.next/static/chunks/app/api/stream/route-8fa95c63b95bf9c3.js +0 -1
  291. package/.next/static/chunks/app/api/version/route-8fa95c63b95bf9c3.js +0 -1
  292. package/.next/static/chunks/app/api/workspace/activate/route-8fa95c63b95bf9c3.js +0 -1
  293. package/.next/static/chunks/app/api/workspace/route-8fa95c63b95bf9c3.js +0 -1
  294. package/.next/static/chunks/app/plan/page-8a9ed9019afac5ca.js +0 -1
  295. package/.next/static/chunks/next/dist/client/components/builtin/app-error-8fa95c63b95bf9c3.js +0 -1
  296. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-8fa95c63b95bf9c3.js +0 -1
  297. package/.next/static/chunks/next/dist/client/components/builtin/not-found-8fa95c63b95bf9c3.js +0 -1
  298. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-8fa95c63b95bf9c3.js +0 -1
  299. package/.next/static/css/30e69a9d2de6ece7.css +0 -1
  300. /package/.next/static/{MYvJ_ebinIGa9MP5kWFaY → nIOWlnJIVXwqjfj2Fpn44}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":27338448,"timestamp":50616069,"id":14,"parentId":1,"tags":{},"startTime":1781132908389,"traceId":"82c33e278d4ea2f3"},{"name":"run-typescript","duration":11730316,"timestamp":77958154,"id":3946,"parentId":1,"tags":{},"startTime":1781132935731,"traceId":"82c33e278d4ea2f3"},{"name":"static-check","duration":737819,"timestamp":89706651,"id":3949,"parentId":1,"tags":{},"startTime":1781132947480,"traceId":"82c33e278d4ea2f3"},{"name":"static-generation","duration":4342850,"timestamp":91042108,"id":4087,"parentId":1,"tags":{},"startTime":1781132948815,"traceId":"82c33e278d4ea2f3"},{"name":"collect-build-traces","duration":13251113,"timestamp":90447483,"id":4084,"parentId":1,"tags":{},"startTime":1781132948221,"traceId":"82c33e278d4ea2f3"},{"name":"telemetry-flush","duration":66,"timestamp":103702132,"id":4096,"parentId":1,"tags":{},"startTime":1781132961475,"traceId":"82c33e278d4ea2f3"},{"name":"next-build","duration":53200247,"timestamp":50501962,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781132908275,"traceId":"82c33e278d4ea2f3"}]
1
+ [{"name":"run-webpack","duration":28522030,"timestamp":56437606,"id":14,"parentId":1,"tags":{},"startTime":1781136164455,"traceId":"7c9cb5df05c140d3"},{"name":"run-typescript","duration":11879932,"timestamp":84962231,"id":3959,"parentId":1,"tags":{},"startTime":1781136192980,"traceId":"7c9cb5df05c140d3"},{"name":"static-check","duration":724282,"timestamp":96923226,"id":3962,"parentId":1,"tags":{},"startTime":1781136204941,"traceId":"7c9cb5df05c140d3"},{"name":"static-generation","duration":4601941,"timestamp":98267441,"id":4102,"parentId":1,"tags":{},"startTime":1781136206285,"traceId":"7c9cb5df05c140d3"},{"name":"collect-build-traces","duration":13677758,"timestamp":97650523,"id":4099,"parentId":1,"tags":{},"startTime":1781136205668,"traceId":"7c9cb5df05c140d3"},{"name":"telemetry-flush","duration":59,"timestamp":111331856,"id":4111,"parentId":1,"tags":{},"startTime":1781136219349,"traceId":"7c9cb5df05c140d3"},{"name":"next-build","duration":55015075,"timestamp":56316852,"id":1,"tags":{"buildMode":"default","version":"16.2.7","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1781136164334,"traceId":"7c9cb5df05c140d3"}]
@@ -0,0 +1,351 @@
1
+ // File: /home/runner/work/beacon/beacon/app/api/db/prune-planned/route.ts
2
+ import * as entry from '../../../../../../app/api/db/prune-planned/route.js'
3
+ import type { NextRequest } from 'next/server.js'
4
+
5
+ import type { InstantConfigForTypeCheckInternal } from 'next/dist/build/segment-config/app/app-segment-config.js'
6
+
7
+ type TEntry = typeof import('../../../../../../app/api/db/prune-planned/route.js')
8
+
9
+ type SegmentParams<T extends Object = any> = T extends Record<string, any>
10
+ ? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
11
+ : T
12
+
13
+ // Check that the entry is a valid entry
14
+ checkFields<Diff<{
15
+ GET?: Function
16
+ HEAD?: Function
17
+ OPTIONS?: Function
18
+ POST?: Function
19
+ PUT?: Function
20
+ DELETE?: Function
21
+ PATCH?: Function
22
+ config?: {}
23
+ generateStaticParams?: Function
24
+ unstable_instant?: InstantConfigForTypeCheckInternal
25
+ unstable_dynamicStaleTime?: number
26
+ revalidate?: RevalidateRange<TEntry> | false
27
+ dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
28
+ dynamicParams?: boolean
29
+ fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
30
+ preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
31
+ runtime?: 'nodejs' | 'experimental-edge' | 'edge'
32
+ maxDuration?: number
33
+
34
+ }, TEntry, ''>>()
35
+
36
+ type RouteContext = { params: Promise<SegmentParams> }
37
+ // Check the prop type of the entry function
38
+ if ('GET' in entry) {
39
+ checkFields<
40
+ Diff<
41
+ ParamCheck<Request | NextRequest>,
42
+ {
43
+ __tag__: 'GET'
44
+ __param_position__: 'first'
45
+ __param_type__: FirstArg<MaybeField<TEntry, 'GET'>>
46
+ },
47
+ 'GET'
48
+ >
49
+ >()
50
+ checkFields<
51
+ Diff<
52
+ ParamCheck<RouteContext>,
53
+ {
54
+ __tag__: 'GET'
55
+ __param_position__: 'second'
56
+ __param_type__: SecondArg<MaybeField<TEntry, 'GET'>>
57
+ },
58
+ 'GET'
59
+ >
60
+ >()
61
+
62
+ checkFields<
63
+ Diff<
64
+ {
65
+ __tag__: 'GET',
66
+ __return_type__: Response | void | never | Promise<Response | void | never>
67
+ },
68
+ {
69
+ __tag__: 'GET',
70
+ __return_type__: ReturnType<MaybeField<TEntry, 'GET'>>
71
+ },
72
+ 'GET'
73
+ >
74
+ >()
75
+ }
76
+ // Check the prop type of the entry function
77
+ if ('HEAD' in entry) {
78
+ checkFields<
79
+ Diff<
80
+ ParamCheck<Request | NextRequest>,
81
+ {
82
+ __tag__: 'HEAD'
83
+ __param_position__: 'first'
84
+ __param_type__: FirstArg<MaybeField<TEntry, 'HEAD'>>
85
+ },
86
+ 'HEAD'
87
+ >
88
+ >()
89
+ checkFields<
90
+ Diff<
91
+ ParamCheck<RouteContext>,
92
+ {
93
+ __tag__: 'HEAD'
94
+ __param_position__: 'second'
95
+ __param_type__: SecondArg<MaybeField<TEntry, 'HEAD'>>
96
+ },
97
+ 'HEAD'
98
+ >
99
+ >()
100
+
101
+ checkFields<
102
+ Diff<
103
+ {
104
+ __tag__: 'HEAD',
105
+ __return_type__: Response | void | never | Promise<Response | void | never>
106
+ },
107
+ {
108
+ __tag__: 'HEAD',
109
+ __return_type__: ReturnType<MaybeField<TEntry, 'HEAD'>>
110
+ },
111
+ 'HEAD'
112
+ >
113
+ >()
114
+ }
115
+ // Check the prop type of the entry function
116
+ if ('OPTIONS' in entry) {
117
+ checkFields<
118
+ Diff<
119
+ ParamCheck<Request | NextRequest>,
120
+ {
121
+ __tag__: 'OPTIONS'
122
+ __param_position__: 'first'
123
+ __param_type__: FirstArg<MaybeField<TEntry, 'OPTIONS'>>
124
+ },
125
+ 'OPTIONS'
126
+ >
127
+ >()
128
+ checkFields<
129
+ Diff<
130
+ ParamCheck<RouteContext>,
131
+ {
132
+ __tag__: 'OPTIONS'
133
+ __param_position__: 'second'
134
+ __param_type__: SecondArg<MaybeField<TEntry, 'OPTIONS'>>
135
+ },
136
+ 'OPTIONS'
137
+ >
138
+ >()
139
+
140
+ checkFields<
141
+ Diff<
142
+ {
143
+ __tag__: 'OPTIONS',
144
+ __return_type__: Response | void | never | Promise<Response | void | never>
145
+ },
146
+ {
147
+ __tag__: 'OPTIONS',
148
+ __return_type__: ReturnType<MaybeField<TEntry, 'OPTIONS'>>
149
+ },
150
+ 'OPTIONS'
151
+ >
152
+ >()
153
+ }
154
+ // Check the prop type of the entry function
155
+ if ('POST' in entry) {
156
+ checkFields<
157
+ Diff<
158
+ ParamCheck<Request | NextRequest>,
159
+ {
160
+ __tag__: 'POST'
161
+ __param_position__: 'first'
162
+ __param_type__: FirstArg<MaybeField<TEntry, 'POST'>>
163
+ },
164
+ 'POST'
165
+ >
166
+ >()
167
+ checkFields<
168
+ Diff<
169
+ ParamCheck<RouteContext>,
170
+ {
171
+ __tag__: 'POST'
172
+ __param_position__: 'second'
173
+ __param_type__: SecondArg<MaybeField<TEntry, 'POST'>>
174
+ },
175
+ 'POST'
176
+ >
177
+ >()
178
+
179
+ checkFields<
180
+ Diff<
181
+ {
182
+ __tag__: 'POST',
183
+ __return_type__: Response | void | never | Promise<Response | void | never>
184
+ },
185
+ {
186
+ __tag__: 'POST',
187
+ __return_type__: ReturnType<MaybeField<TEntry, 'POST'>>
188
+ },
189
+ 'POST'
190
+ >
191
+ >()
192
+ }
193
+ // Check the prop type of the entry function
194
+ if ('PUT' in entry) {
195
+ checkFields<
196
+ Diff<
197
+ ParamCheck<Request | NextRequest>,
198
+ {
199
+ __tag__: 'PUT'
200
+ __param_position__: 'first'
201
+ __param_type__: FirstArg<MaybeField<TEntry, 'PUT'>>
202
+ },
203
+ 'PUT'
204
+ >
205
+ >()
206
+ checkFields<
207
+ Diff<
208
+ ParamCheck<RouteContext>,
209
+ {
210
+ __tag__: 'PUT'
211
+ __param_position__: 'second'
212
+ __param_type__: SecondArg<MaybeField<TEntry, 'PUT'>>
213
+ },
214
+ 'PUT'
215
+ >
216
+ >()
217
+
218
+ checkFields<
219
+ Diff<
220
+ {
221
+ __tag__: 'PUT',
222
+ __return_type__: Response | void | never | Promise<Response | void | never>
223
+ },
224
+ {
225
+ __tag__: 'PUT',
226
+ __return_type__: ReturnType<MaybeField<TEntry, 'PUT'>>
227
+ },
228
+ 'PUT'
229
+ >
230
+ >()
231
+ }
232
+ // Check the prop type of the entry function
233
+ if ('DELETE' in entry) {
234
+ checkFields<
235
+ Diff<
236
+ ParamCheck<Request | NextRequest>,
237
+ {
238
+ __tag__: 'DELETE'
239
+ __param_position__: 'first'
240
+ __param_type__: FirstArg<MaybeField<TEntry, 'DELETE'>>
241
+ },
242
+ 'DELETE'
243
+ >
244
+ >()
245
+ checkFields<
246
+ Diff<
247
+ ParamCheck<RouteContext>,
248
+ {
249
+ __tag__: 'DELETE'
250
+ __param_position__: 'second'
251
+ __param_type__: SecondArg<MaybeField<TEntry, 'DELETE'>>
252
+ },
253
+ 'DELETE'
254
+ >
255
+ >()
256
+
257
+ checkFields<
258
+ Diff<
259
+ {
260
+ __tag__: 'DELETE',
261
+ __return_type__: Response | void | never | Promise<Response | void | never>
262
+ },
263
+ {
264
+ __tag__: 'DELETE',
265
+ __return_type__: ReturnType<MaybeField<TEntry, 'DELETE'>>
266
+ },
267
+ 'DELETE'
268
+ >
269
+ >()
270
+ }
271
+ // Check the prop type of the entry function
272
+ if ('PATCH' in entry) {
273
+ checkFields<
274
+ Diff<
275
+ ParamCheck<Request | NextRequest>,
276
+ {
277
+ __tag__: 'PATCH'
278
+ __param_position__: 'first'
279
+ __param_type__: FirstArg<MaybeField<TEntry, 'PATCH'>>
280
+ },
281
+ 'PATCH'
282
+ >
283
+ >()
284
+ checkFields<
285
+ Diff<
286
+ ParamCheck<RouteContext>,
287
+ {
288
+ __tag__: 'PATCH'
289
+ __param_position__: 'second'
290
+ __param_type__: SecondArg<MaybeField<TEntry, 'PATCH'>>
291
+ },
292
+ 'PATCH'
293
+ >
294
+ >()
295
+
296
+ checkFields<
297
+ Diff<
298
+ {
299
+ __tag__: 'PATCH',
300
+ __return_type__: Response | void | never | Promise<Response | void | never>
301
+ },
302
+ {
303
+ __tag__: 'PATCH',
304
+ __return_type__: ReturnType<MaybeField<TEntry, 'PATCH'>>
305
+ },
306
+ 'PATCH'
307
+ >
308
+ >()
309
+ }
310
+
311
+ // Check the arguments and return type of the generateStaticParams function
312
+ if ('generateStaticParams' in entry) {
313
+ checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
314
+ checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
315
+ }
316
+
317
+ export interface PageProps {
318
+ params?: Promise<SegmentParams>
319
+ searchParams?: Promise<any>
320
+ }
321
+ export interface LayoutProps {
322
+ children?: React.ReactNode
323
+
324
+ params?: Promise<SegmentParams>
325
+ }
326
+
327
+ // =============
328
+ // Utility types
329
+ type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
330
+
331
+ // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
332
+ type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
333
+ type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
334
+
335
+ type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
336
+ type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
337
+ type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
338
+
339
+ type ParamCheck<T> = {
340
+ __tag__: string
341
+ __param_position__: string
342
+ __param_type__: T
343
+ }
344
+
345
+ function checkFields<_ extends { [k in keyof any]: never }>() {}
346
+
347
+ // https://github.com/sindresorhus/type-fest
348
+ type Numeric = number | bigint
349
+ type Zero = 0 | 0n
350
+ type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
351
+ type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'
@@ -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/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/reset" | "/api/stream" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
6
6
  type PageRoutes = never
7
7
  type LayoutRoutes = "/"
8
8
  type RedirectRoutes = never
@@ -25,6 +25,7 @@ interface ParamMap {
25
25
  "/api/db/arrange": {}
26
26
  "/api/db/backfill-access": {}
27
27
  "/api/db/position": {}
28
+ "/api/db/prune-planned": {}
28
29
  "/api/db/reconcile-endpoints": {}
29
30
  "/api/db/relations/[id]": { "id": string; }
30
31
  "/api/db/tables/[id]": { "id": string; }
@@ -227,6 +227,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
227
227
  type __Unused = __Check
228
228
  }
229
229
 
230
+ // Validate ../../app/api/db/prune-planned/route.ts
231
+ {
232
+ type __IsExpected<Specific extends RouteHandlerConfig<"/api/db/prune-planned">> = Specific
233
+ const handler = {} as typeof import("../../app/api/db/prune-planned/route.js")
234
+ type __Check = __IsExpected<typeof handler>
235
+ // @ts-ignore
236
+ type __Unused = __Check
237
+ }
238
+
230
239
  // Validate ../../app/api/db/reconcile-endpoints/route.ts
231
240
  {
232
241
  type __IsExpected<Specific extends RouteHandlerConfig<"/api/db/reconcile-endpoints">> = Specific
@@ -242,6 +242,6 @@ verbatim. Do NOT implement until the tool returns approval.`;var NQ=g(()=>{v=["b
242
242
  command = "beacon"
243
243
  args = ["mcp"]
244
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;");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)=>`
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
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
247
  ${f("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${f("in this repo.")}`);console.log();
package/dist/bin/hook.js CHANGED
@@ -229,7 +229,7 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
229
229
  Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
230
230
  on the /map and /db boards (added features, attached subtasks, edited columns, new
231
231
  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 zQ=K(()=>{H=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as HZ,renameSync as BZ,rmSync as jZ,writeFileSync as GZ}from"fs";import{dirname as NZ}from"path";function qQ(Q,Z){HZ(NZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{GZ($,Z),BZ($,Q)}catch(J){throw jZ($,{force:!0}),J}}var fQ=()=>{};var yQ={};i(yQ,{setupCodexAssets:()=>CZ,removeCodexMcp:()=>AQ,removeCodexArtifacts:()=>wZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>EQ,codexMcpProblem:()=>vZ,codexDetected:()=>IQ,auditCodex:()=>MZ,CODEX_HOOKS:()=>n});import{readFileSync as c}from"fs";import{homedir as KZ}from"os";import{join as w}from"path";function RQ(){return process.env.HOME||process.env.USERPROFILE||KZ()}function IQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(XQ===void 0)XQ=Bun.which("codex")!==null;return XQ}function M(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(M(c(N(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function vZ(){let Q="";try{Q=c(N(),"utf8")}catch{return null}let Z=M(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${C}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${C}`;return null}function EQ(){let Q="",Z=!1;try{Q=c(N(),"utf8"),Z=!0}catch{}if(Z){let V=M(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${C}`};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 ${C}`}}let $=!Q?"":Q.endsWith(`
232
+ verbatim. Do NOT implement until the tool returns approval.`;var zQ=K(()=>{H=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as HZ,renameSync as BZ,rmSync as jZ,writeFileSync as GZ}from"fs";import{dirname as NZ}from"path";function qQ(Q,Z){HZ(NZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{GZ($,Z),BZ($,Q)}catch(J){throw jZ($,{force:!0}),J}}var fQ=()=>{};var yQ={};i(yQ,{setupCodexAssets:()=>CZ,removeCodexMcp:()=>AQ,removeCodexArtifacts:()=>wZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>EQ,codexMcpProblem:()=>vZ,codexDetected:()=>IQ,auditCodex:()=>MZ,CODEX_HOOKS:()=>a});import{readFileSync as c}from"fs";import{homedir as KZ}from"os";import{join as w}from"path";function RQ(){return process.env.HOME||process.env.USERPROFILE||KZ()}function IQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(XQ===void 0)XQ=Bun.which("codex")!==null;return XQ}function M(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(M(c(N(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function vZ(){let Q="";try{Q=c(N(),"utf8")}catch{return null}let Z=M(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${C}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${C}`;return null}function EQ(){let Q="",Z=!1;try{Q=c(N(),"utf8"),Z=!0}catch{}if(Z){let V=M(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${C}`};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 ${C}`}}let $=!Q?"":Q.endsWith(`
233
233
  `)?`
234
234
  `:`
235
235
 
@@ -237,10 +237,10 @@ verbatim. Do NOT implement until the tool returns approval.`;var zQ=K(()=>{H=["b
237
237
  `),$=Z.indexOf(OQ);if($===-1)return{removed:!1,skipped:xQ()};let J=Z.indexOf(DQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
238
238
  `).replace(/\n{3,}/g,`
239
239
 
240
- `).replace(/^\n+/,"");if(M(Y)===null)return{removed:!1,skipped:!0};return qQ(N(),Y),{removed:!0}}async function CZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (JQ(),$Q)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of H){if(!v(m(),z))Y.push(z);_(m(),z,J[z])}let V=0;for(let z of n)if(E(WQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=u(S(),p);k(S(),p,bQ,D);let U=EQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!q,mcp:U}}function MZ(){let Q={};for(let $ of H)Q[$]=v(m(),$);let Z={};for(let $ of n)Z[$.event]=A(WQ(),{event:$.event,command:$.command});return{detected:IQ(),skills:Q,hooks:Z,agentsMdBlock:u(S(),p),mcp:xQ()}}function wZ(){let Q=[];for(let Y of H)if(h(m(),Y))Q.push(Y);let Z=0;for(let Y of n)if(y(WQ(),{event:Y.event,command:Y.command}))Z++;let $=L(S(),p,bQ),J=AQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var UQ=()=>w(RQ(),".codex"),WQ=()=>w(UQ(),"hooks.json"),N=()=>w(UQ(),"config.toml"),S=()=>w(UQ(),"AGENTS.md"),m=()=>w(RQ(),".agents","skills"),p="<!-- beacon:global:start -->",bQ="<!-- beacon:global:end -->",n,XQ,OQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",DQ="# beacon:end",uZ,C="add it manually: codex mcp add beacon -- beacon mcp";var kQ=K(()=>{zQ();fQ();n=[{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."}];uZ=`${OQ}
240
+ `).replace(/^\n+/,"");if(M(Y)===null)return{removed:!1,skipped:!0};return qQ(N(),Y),{removed:!0}}async function CZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (JQ(),$Q)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of H){if(!v(m(),z))Y.push(z);_(m(),z,J[z])}let V=0;for(let z of a)if(E(WQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=u(S(),p);k(S(),p,bQ,D);let U=EQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!q,mcp:U}}function MZ(){let Q={};for(let $ of H)Q[$]=v(m(),$);let Z={};for(let $ of a)Z[$.event]=A(WQ(),{event:$.event,command:$.command});return{detected:IQ(),skills:Q,hooks:Z,agentsMdBlock:u(S(),p),mcp:xQ()}}function wZ(){let Q=[];for(let Y of H)if(h(m(),Y))Q.push(Y);let Z=0;for(let Y of a)if(y(WQ(),{event:Y.event,command:Y.command}))Z++;let $=L(S(),p,bQ),J=AQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var UQ=()=>w(RQ(),".codex"),WQ=()=>w(UQ(),"hooks.json"),N=()=>w(UQ(),"config.toml"),S=()=>w(UQ(),"AGENTS.md"),m=()=>w(RQ(),".agents","skills"),p="<!-- beacon:global:start -->",bQ="<!-- beacon:global:end -->",a,XQ,OQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",DQ="# beacon:end",uZ,C="add it manually: codex mcp add beacon -- beacon mcp";var kQ=K(()=>{zQ();fQ();a=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];uZ=`${OQ}
241
241
  [mcp_servers.beacon]
242
242
  command = "beacon"
243
243
  args = ["mcp"]
244
244
  ${DQ}
245
- `});var pQ={};i(pQ,{provisionDb:()=>lZ});import{createClient as kZ}from"@libsql/client";import{drizzle as LZ}from"drizzle-orm/libsql";import{migrate as _Z}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as hZ}from"drizzle-orm/migrator";import{dirname as NQ,join as SZ}from"path";import{fileURLToPath as mZ}from"url";async function l(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function aZ(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function mQ(Q){if(!await l(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 dZ(Q){for(let[Z,$]of Object.entries(nZ)){if(!await l(Q,Z))continue;let J=await aZ(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 lZ(Q,Z=cZ){let $=kZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;");let J=await l($,"__drizzle_migrations"),Y=await l($,"Node"),V=!1;if(Y&&!J){let U=hZ({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 q=await mQ($);if(await _Z(LZ($),{migrationsFolder:Z}),await mQ($)>q)V=!0;return await dZ($),{migrated:V}}finally{$.close()}}var pZ,cZ,nZ;var cQ=K(async()=>{pZ=NQ(NQ(NQ(mZ(import.meta.url)))),cZ=process.env.BEACON_MIGRATIONS_DIR||SZ(pZ,"drizzle"),nZ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});zQ();import{existsSync as gZ}from"fs";import{homedir as TZ}from"os";import{join as a}from"path";function FZ(){return process.env.HOME||process.env.USERPROFILE||TZ()}var d=()=>a(FZ(),".claude"),PQ=()=>a(d(),"skills"),HQ=()=>a(d(),"settings.json"),BQ=()=>a(d(),"CLAUDE.md"),jQ="<!-- beacon:global:start -->",LQ="<!-- beacon:global:end -->";var fZ=D,GQ=[{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function RZ(Q,Z){return _(PQ(),Q,Z)}function _Q(Q){return v(PQ(),Q)}function bZ(Q){return h(PQ(),Q)}function IZ(Q){return E(HQ(),Q)}function OZ(Q){return A(HQ(),Q)}function DZ(Q){return y(HQ(),Q)}function EZ(Q){k(BQ(),jQ,LQ,Q)}function hQ(){return u(BQ(),jQ)}function AZ(){return L(BQ(),jQ,LQ)}function b0(){let Q={};for(let $ of H)Q[$]=_Q($);let Z={};for(let $ of GQ)Z[$.event]=OZ({event:$.event,command:$.command});return{homeExists:gZ(d()),skills:Q,hooks:Z,claudeMdBlock:hQ()}}async function yZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (JQ(),$Q)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of H){if(!_Q(U))Y.push(U);RZ(U,J[U])}let V=0;for(let U of GQ)if(IZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let q=hQ();return EZ(fZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!q}}async function SQ(){let Q;try{Q={ok:!0,...await yZ()}}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(() => (kQ(),yQ));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 I0(){let Q=[];for(let J of H)if(bZ(J))Q.push(J);let Z=0;for(let J of GQ)if(DZ(J))Z++;let $=AZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as tZ}from"async_hooks";import{spawnSync as sZ}from"child_process";import{createHash as rZ}from"crypto";import{existsSync as nQ,mkdirSync as t,readFileSync as aQ,writeFileSync as dQ}from"fs";import{homedir as oZ}from"os";import{basename as iZ,join as j}from"path";function g(){return process.env.BEACON_HOME||j(oZ(),".beacon")}function uQ(){return j(g(),"workspaces.json")}function s(Q){return rZ("sha256").update(Q).digest("hex").slice(0,12)}function lQ(Q=process.cwd()){let Z=sZ("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 r(Q){return j(g(),Q)}function eZ(Q){return`file:${j(r(Q),"db.sqlite")}`}function T(){try{let Q=JSON.parse(aQ(uQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function vQ(Q){t(g(),{recursive:!0}),dQ(uQ(),JSON.stringify(Q,null,2))}function Q0(){return T().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function B(Q){return T().find((Z)=>Z.id===Q)??null}function Z0(Q,Z,$=new Date().toISOString()){let J=s(Q),Y=T(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||iZ(Q),lastOpenedAt:$},U=[q,...Y.filter((z)=>z.id!==J)];return t(r(J),{recursive:!0}),vQ(U),q}function n0(Q,Z=new Date().toISOString()){let $=T(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,vQ($)}function a0(Q){if(vQ(T().filter((Z)=>Z.id!==Q)),CQ()===Q)$0(Q0()[0]?.id??null)}function tQ(){return j(g(),"active")}function CQ(){try{return aQ(tQ(),"utf8").trim()||null}catch{return null}}function $0(Q){t(g(),{recursive:!0}),dQ(tQ(),Q??"")}function d0(){let Q=CQ();return Q?B(Q):null}function l0(){let Q=Y0()??CQ();return Q?B(Q):null}function t0(Q){return B(Q)?.path??null}function s0(){return nQ(uQ())}var sQ="beacon_ws";function rQ(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 r0(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&B(Z))return Z;let $=rQ(Q,sQ);if($&&B($))return $;return null}var J0="x-beacon-workspace-path";async function o0(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&B(Z))return Z;let $=Q.headers.get(J0);if($&&(!Z||s($)===Z)){let Y=Z0($);return await V0(Y.id),Y.id}let J=rQ(Q,sQ);if(J&&B(J))return J;return null}var oQ=new tZ;function i0(Q,Z){return Q?oQ.run(Q,Z):Z()}function Y0(){return oQ.getStore()??null}var KQ=new Set;function e0(Q){KQ.delete(j(r(Q),"db.sqlite"))}async function V0(Q){let Z=r(Q),$=j(Z,"db.sqlite"),J=nQ($);if(J&&KQ.has($))return{ok:!0,created:!1,migrated:!1};try{t(Z,{recursive:!0});let{provisionDb:Y}=await cQ().then(() => pQ),V=await Y(eZ(Q));return KQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}import{resolve as z0}from"path";var q0="*** Begin Patch",X0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function U0(Q){let Z=[];for(let $ of Q.split(`
246
- `)){let J=X0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function iQ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(q0))continue;return U0(V).map((q)=>z0(Y,q))}return[]}var W0=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`;await SQ();var eQ="";for await(let Q of process.stdin)eQ+=Q;try{let Q=JSON.parse(eQ||"{}"),Z=iQ(Q);if(Z.length){let $=s(lQ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${W0}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z})}).catch(()=>{})}}catch{}process.exit(0);
245
+ `});var pQ={};i(pQ,{provisionDb:()=>lZ});import{createClient as kZ}from"@libsql/client";import{drizzle as LZ}from"drizzle-orm/libsql";import{migrate as _Z}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as hZ}from"drizzle-orm/migrator";import{dirname as NQ,join as SZ}from"path";import{fileURLToPath as mZ}from"url";async function l(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function nZ(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function mQ(Q){if(!await l(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 dZ(Q){for(let[Z,$]of Object.entries(aZ)){if(!await l(Q,Z))continue;let J=await nZ(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 lZ(Q,Z=cZ){let $=kZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await l($,"__drizzle_migrations"),Y=await l($,"Node"),V=!1;if(Y&&!J){let U=hZ({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 q=await mQ($);if(await _Z(LZ($),{migrationsFolder:Z}),await mQ($)>q)V=!0;return await dZ($),{migrated:V}}finally{$.close()}}var pZ,cZ,aZ;var cQ=K(async()=>{pZ=NQ(NQ(NQ(mZ(import.meta.url)))),cZ=process.env.BEACON_MIGRATIONS_DIR||SZ(pZ,"drizzle"),aZ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});zQ();import{existsSync as gZ}from"fs";import{homedir as TZ}from"os";import{join as n}from"path";function FZ(){return process.env.HOME||process.env.USERPROFILE||TZ()}var d=()=>n(FZ(),".claude"),PQ=()=>n(d(),"skills"),HQ=()=>n(d(),"settings.json"),BQ=()=>n(d(),"CLAUDE.md"),jQ="<!-- beacon:global:start -->",LQ="<!-- beacon:global:end -->";var fZ=D,GQ=[{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function RZ(Q,Z){return _(PQ(),Q,Z)}function _Q(Q){return v(PQ(),Q)}function bZ(Q){return h(PQ(),Q)}function IZ(Q){return E(HQ(),Q)}function OZ(Q){return A(HQ(),Q)}function DZ(Q){return y(HQ(),Q)}function EZ(Q){k(BQ(),jQ,LQ,Q)}function hQ(){return u(BQ(),jQ)}function AZ(){return L(BQ(),jQ,LQ)}function b0(){let Q={};for(let $ of H)Q[$]=_Q($);let Z={};for(let $ of GQ)Z[$.event]=OZ({event:$.event,command:$.command});return{homeExists:gZ(d()),skills:Q,hooks:Z,claudeMdBlock:hQ()}}async function yZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (JQ(),$Q)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of H){if(!_Q(U))Y.push(U);RZ(U,J[U])}let V=0;for(let U of GQ)if(IZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let q=hQ();return EZ(fZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!q}}async function SQ(){let Q;try{Q={ok:!0,...await yZ()}}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(() => (kQ(),yQ));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 I0(){let Q=[];for(let J of H)if(bZ(J))Q.push(J);let Z=0;for(let J of GQ)if(DZ(J))Z++;let $=AZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as sZ}from"async_hooks";import{spawnSync as tZ}from"child_process";import{createHash as rZ}from"crypto";import{existsSync as aQ,mkdirSync as s,readFileSync as nQ,writeFileSync as dQ}from"fs";import{homedir as oZ}from"os";import{basename as iZ,join as j}from"path";function g(){return process.env.BEACON_HOME||j(oZ(),".beacon")}function uQ(){return j(g(),"workspaces.json")}function t(Q){return rZ("sha256").update(Q).digest("hex").slice(0,12)}function lQ(Q=process.cwd()){let Z=tZ("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 r(Q){return j(g(),Q)}function eZ(Q){return`file:${j(r(Q),"db.sqlite")}`}function T(){try{let Q=JSON.parse(nQ(uQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function vQ(Q){s(g(),{recursive:!0}),dQ(uQ(),JSON.stringify(Q,null,2))}function Q0(){return T().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function B(Q){return T().find((Z)=>Z.id===Q)??null}function Z0(Q,Z,$=new Date().toISOString()){let J=t(Q),Y=T(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||iZ(Q),lastOpenedAt:$},U=[q,...Y.filter((z)=>z.id!==J)];return s(r(J),{recursive:!0}),vQ(U),q}function a0(Q,Z=new Date().toISOString()){let $=T(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,vQ($)}function n0(Q){if(vQ(T().filter((Z)=>Z.id!==Q)),CQ()===Q)$0(Q0()[0]?.id??null)}function sQ(){return j(g(),"active")}function CQ(){try{return nQ(sQ(),"utf8").trim()||null}catch{return null}}function $0(Q){s(g(),{recursive:!0}),dQ(sQ(),Q??"")}function d0(){let Q=CQ();return Q?B(Q):null}function l0(){let Q=Y0()??CQ();return Q?B(Q):null}function s0(Q){return B(Q)?.path??null}function t0(){return aQ(uQ())}var tQ="beacon_ws";function rQ(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 r0(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&B(Z))return Z;let $=rQ(Q,tQ);if($&&B($))return $;return null}var J0="x-beacon-workspace-path";async function o0(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&B(Z))return Z;let $=Q.headers.get(J0);if($&&(!Z||t($)===Z)){let Y=Z0($);return await V0(Y.id),Y.id}let J=rQ(Q,tQ);if(J&&B(J))return J;return null}var oQ=new sZ;function i0(Q,Z){return Q?oQ.run(Q,Z):Z()}function Y0(){return oQ.getStore()??null}var KQ=new Set;function e0(Q){KQ.delete(j(r(Q),"db.sqlite"))}async function V0(Q){let Z=r(Q),$=j(Z,"db.sqlite"),J=aQ($);if(J&&KQ.has($))return{ok:!0,created:!1,migrated:!1};try{s(Z,{recursive:!0});let{provisionDb:Y}=await cQ().then(() => pQ),V=await Y(eZ(Q));return KQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}import{resolve as z0}from"path";var q0="*** Begin Patch",X0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function U0(Q){let Z=[];for(let $ of Q.split(`
246
+ `)){let J=X0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function iQ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(q0))continue;return U0(V).map((q)=>z0(Y,q))}return[]}var W0=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`;await SQ();var eQ="";for await(let Q of process.stdin)eQ+=Q;try{let Q=JSON.parse(eQ||"{}"),Z=iQ(Q);if(Z.length){let $=t(lQ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${W0}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z})}).catch(()=>{})}}catch{}process.exit(0);