trybeacon 0.1.49 → 0.1.51
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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +22 -18
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +26 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +11 -11
- package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +11 -11
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/board-annotations/[id]/route.js +1 -1
- package/.next/server/app/api/board-annotations/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-annotations/route.js.nft.json +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js.nft.json +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js.nft.json +1 -1
- package/.next/server/app/api/code-graph/position/route.js +1 -1
- package/.next/server/app/api/code-graph/position/route.js.nft.json +1 -1
- package/.next/server/app/api/code-graph/route.js +1 -1
- package/.next/server/app/api/code-graph/route.js.nft.json +1 -1
- package/.next/server/app/api/context/feature/route.js +1 -1
- package/.next/server/app/api/context/feature/route.js.nft.json +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/file/route.js.nft.json +1 -1
- package/.next/server/app/api/context/route.js +2 -2
- package/.next/server/app/api/context/route.js.nft.json +1 -1
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/arrange/route.js.nft.json +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js.nft.json +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/position/route.js.nft.json +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js.nft.json +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js.nft.json +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/status/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js.nft.json +1 -1
- package/.next/server/app/api/edges/[id]/route.js +1 -1
- package/.next/server/app/api/edges/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/edges/route.js +1 -1
- package/.next/server/app/api/edges/route.js.nft.json +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js +1 -1
- package/.next/server/app/api/endpoints/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/entities/route.js +1 -1
- package/.next/server/app/api/entities/route.js.nft.json +1 -1
- package/.next/server/app/api/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js.nft.json +1 -1
- package/.next/server/app/api/feedback/route.js +1 -1
- package/.next/server/app/api/feedback/route.js.nft.json +1 -1
- package/.next/server/app/api/flags/route.js +1 -1
- package/.next/server/app/api/flags/route.js.nft.json +1 -1
- package/.next/server/app/api/ingest/route.js +2 -2
- package/.next/server/app/api/ingest/route.js.nft.json +1 -1
- package/.next/server/app/api/init/route.js +2 -2
- package/.next/server/app/api/init/route.js.nft.json +1 -1
- package/.next/server/app/api/map/describe/route.js +2 -2
- package/.next/server/app/api/map/describe/route.js.nft.json +1 -1
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/files/route.js.nft.json +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js.nft.json +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/route.js.nft.json +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/start/route.js.nft.json +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js.nft.json +1 -1
- package/.next/server/app/api/mention-search/route.js +1 -0
- package/.next/server/app/api/mention-search/route.js.nft.json +1 -0
- package/.next/server/app/api/mention-search/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/route.js.nft.json +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notes/route.js +1 -1
- package/.next/server/app/api/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/open/route.js +1 -1
- package/.next/server/app/api/open/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/annotations/route.js +3 -3
- package/.next/server/app/api/plan/annotations/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/approve/route.js +2 -2
- package/.next/server/app/api/plan/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/history/route.js +1 -1
- package/.next/server/app/api/plan/history/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/markdown/route.js +1 -1
- package/.next/server/app/api/plan/markdown/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/presence/route.js +1 -1
- package/.next/server/app/api/plan/presence/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js.nft.json +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/preferences/route.js.nft.json +1 -1
- package/.next/server/app/api/project-meta/route.js +1 -1
- package/.next/server/app/api/project-meta/route.js.nft.json +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/reset/route.js.nft.json +1 -1
- package/.next/server/app/api/scope-guard/check/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -1
- package/.next/server/app/api/share/create/route.js +1 -0
- package/.next/server/app/api/share/create/route.js.nft.json +1 -0
- package/.next/server/app/api/share/create/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/share/route.js +1 -0
- package/.next/server/app/api/share/route.js.nft.json +1 -0
- package/.next/server/app/api/share/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/stream/route.js +2 -2
- package/.next/server/app/api/stream/route.js.nft.json +1 -1
- package/.next/server/app/api/tab/nav/route.js +1 -1
- package/.next/server/app/api/tab/nav/route.js.nft.json +1 -1
- package/.next/server/app/api/tab/presence/route.js +1 -1
- package/.next/server/app/api/tab/presence/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/route.js +1 -1
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/stats/route.js +1 -1
- package/.next/server/app/api/telemetry/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/version/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/activate/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js.nft.json +1 -1
- package/.next/server/app/api/workspace/route.js +1 -1
- package/.next/server/app/api/workspace/route.js.nft.json +1 -1
- package/.next/server/app/apple-icon.png/route.js +1 -1
- package/.next/server/app/docs/page.js +2 -2
- package/.next/server/app/docs/page.js.nft.json +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +12 -12
- package/.next/server/app/docs.segments/_full.segment.rsc +12 -12
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +11 -11
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/feedback/page.js +2 -2
- package/.next/server/app/feedback/page.js.nft.json +1 -1
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +11 -11
- package/.next/server/app/feedback.segments/_full.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +11 -11
- package/.next/server/app/feedback.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
- package/.next/server/app/help/page.js +2 -2
- package/.next/server/app/help/page.js.nft.json +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +13 -13
- package/.next/server/app/help.segments/_full.segment.rsc +13 -13
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +11 -11
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +10 -12
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +12 -12
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +12 -12
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +11 -11
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/map/page.js +2 -2
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +2 -0
- package/.next/server/app/s/[token]/page.js.nft.json +1 -0
- package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/settings/page.js +2 -2
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +22 -18
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/1669.js +1 -0
- package/.next/server/chunks/2050.js +1 -0
- package/.next/server/chunks/249.js +1 -1
- package/.next/server/chunks/{3221.js → 2693.js} +1 -1
- package/.next/server/chunks/2942.js +1 -0
- package/.next/server/chunks/3098.js +1 -0
- package/.next/server/chunks/3254.js +1 -1
- package/.next/server/chunks/{2999.js → 3304.js} +65 -4
- package/.next/server/chunks/3622.js +1 -1
- package/.next/server/chunks/4046.js +3 -3
- package/.next/server/chunks/4307.js +1 -1
- package/.next/server/chunks/{4217.js → 4700.js} +19 -19
- package/.next/server/chunks/5841.js +1 -0
- package/.next/server/chunks/{4940.js → 7350.js} +1 -1
- package/.next/server/chunks/{8423.js → 9338.js} +8 -8
- package/.next/server/chunks/9683.js +1 -1
- package/.next/server/chunks/9734.js +1 -1
- package/.next/server/chunks/9884.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/Etq8pxeFDTNRRYXdxo_DD/_buildManifest.js +1 -0
- package/.next/static/chunks/1099-208cc390a92efae0.js +62 -0
- package/.next/static/chunks/1175-715e4664e518ded4.js +1 -0
- package/.next/static/chunks/2231-379685a022444780.js +1 -0
- package/.next/static/chunks/{2500-15c373070714563d.js → 3021-ed52ee7b3f02e2cd.js} +1 -1
- package/.next/static/chunks/54a60aa6-0378818fce5a4dc5.js +82 -0
- package/.next/static/chunks/874-c750840a8644deb1.js +1 -0
- package/.next/static/chunks/9320-7bd45e3feba086b6.js +1 -0
- package/.next/static/chunks/9887-e8954568a4031ed3.js +74 -0
- package/.next/static/chunks/app/_global-error/page-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/context/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/draft/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/edges/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/entities/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/flags/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/init/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/mention-search/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/notes/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/open/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/reset/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/share/create/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/share/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/stream/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/version/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-548a84d85e061550.js +1 -0
- package/.next/static/chunks/app/docs/page-ae19d2e91ec24771.js +1 -0
- package/.next/static/chunks/app/layout-3115f8503ff00902.js +1 -0
- package/.next/static/chunks/app/map/page-07f6e0d7c4cac26c.js +1 -0
- package/.next/static/chunks/app/{page-541e900d67f17dae.js → page-a229992616b3a3de.js} +1 -1
- package/.next/static/chunks/app/plan/page-e314ca5940473e0e.js +1 -0
- package/.next/static/chunks/app/s/[token]/page-5fbceb666bceb88e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-548a84d85e061550.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-548a84d85e061550.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-548a84d85e061550.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-548a84d85e061550.js +1 -0
- package/.next/static/css/d60eecd8c5676c16.css +1 -0
- package/.next/trace +42 -39
- package/.next/trace-build +1 -1
- package/.next/types/app/api/mention-search/route.ts +351 -0
- package/.next/types/app/api/share/create/route.ts +351 -0
- package/.next/types/app/api/share/route.ts +351 -0
- package/.next/types/app/s/[token]/page.ts +87 -0
- package/.next/types/routes.d.ts +6 -2
- package/.next/types/validator.ts +36 -0
- package/dist/bin/doctor.js +16 -6
- package/dist/bin/hook.js +16 -6
- package/dist/bin/mcp.js +47 -37
- package/dist/bin/plan.js +22 -12
- package/dist/bin/prompt.js +1 -1
- package/dist/bin/uninstall.js +16 -6
- package/dist/lib/assets.js +16 -6
- package/dist/lib/codex-install.js +16 -6
- package/dist/lib/global-install.js +16 -6
- package/package.json +4 -1
- package/.next/server/chunks/1341.js +0 -1
- package/.next/server/chunks/7331.js +0 -1
- package/.next/static/chunks/1439-260d1c3a9b3b79b3.js +0 -1
- package/.next/static/chunks/3343-af1292b51a276724.js +0 -1
- package/.next/static/chunks/54a60aa6-407808fee210eca2.js +0 -82
- package/.next/static/chunks/7323-480fb88e9d24f9e9.js +0 -1
- package/.next/static/chunks/7886-46eaf3a9533310f7.js +0 -74
- package/.next/static/chunks/app/_global-error/page-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/context/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/draft/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/edges/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/entities/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/flags/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/init/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/notes/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/open/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/reset/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/scope-guard/check/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/stream/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/version/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/app/docs/page-0c841cb9a7aa2f9a.js +0 -1
- package/.next/static/chunks/app/layout-1bc5f9fd4ce6bff9.js +0 -1
- package/.next/static/chunks/app/map/page-66d71744ae3363d7.js +0 -1
- package/.next/static/chunks/app/plan/page-e7d16fa2a3713a92.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc3f0f4fd9e88c4e.js +0 -1
- package/.next/static/css/629ab377241de9ca.css +0 -1
- package/.next/static/qeqVD-yeoYO_3C0pw9kHg/_buildManifest.js +0 -1
- /package/.next/static/{qeqVD-yeoYO_3C0pw9kHg → Etq8pxeFDTNRRYXdxo_DD}/_ssgManifest.js +0 -0
package/dist/bin/mcp.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
3
|
+
var x9=Object.defineProperty;var z9=($)=>$;function S9($,Q){this[$]=z9.bind(null,Q)}var r=($,Q)=>{for(var Z in Q)x9($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:S9.bind(Q,Z)})};var c=($,Q)=>()=>($&&(Q=$($=0)),Q);var o0=1500,yQ=480000,s0=1800000,B0=3600000,_5=3000;var n0=()=>{};var t0={};r(t0,{removeRepoAssets:()=>l9,installRefreshSkill:()=>g9,installPlanSkill:()=>u9,installInitSkill:()=>h9,installCodexRepoSkills:()=>b9,ensureWorkflowDoc:()=>m9,ensureMcp:()=>p9,auditRepo:()=>c9,REFRESH_SKILL:()=>a0,PLAN_SKILL:()=>y5,INIT_SKILL:()=>i0});import{existsSync as l,mkdirSync as N0,readFileSync as L,rmSync as K0,writeFileSync as I}from"fs";import{join as K}from"path";function h9($){let Q=K($,".claude","skills","beacon-init");N0(Q,{recursive:!0});let Z=K(Q,"SKILL.md");return I(Z,i0),Z}function g9($){let Q=K($,".claude","skills","beacon-refresh");N0(Q,{recursive:!0});let Z=K(Q,"SKILL.md");return I(Z,a0),Z}function u9($){let Q=K($,".claude","skills","beacon-plan");N0(Q,{recursive:!0});let Z=K(Q,"SKILL.md");return I(Z,y5),Z}function b9($){let Q=[];for(let Z of f9){let Y=K($,".agents","skills",Z.name);N0(Y,{recursive:!0});let X=K(Y,"SKILL.md");I(X,Z.body()),Q.push(X)}return Q}function m9($){let Q=K($,"AGENTS.md"),Z="";try{Z=L(Q,"utf8")}catch{}let Y=new RegExp(`${M0}[\\s\\S]*?${r0}`);Z=Y.test(Z)?Z.replace(Y,k5):`${Z.trim()}
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${k5}
|
|
6
6
|
`.trimStart(),I(Q,Z.endsWith(`
|
|
7
7
|
`)?Z:`${Z}
|
|
8
|
-
`);let X=K($,"CLAUDE.md"),H="";try{H=
|
|
8
|
+
`);let X=K($,"CLAUDE.md"),H="";try{H=L(X,"utf8")}catch{}if(!/@AGENTS\.md/.test(H))I(X,`${H?`${H.trim()}
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
|
-
`)}function
|
|
12
|
-
`),{path:Q,added:!1,updated:!0};return{path:Q,added:!1,updated:!1}}return Z.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:
|
|
13
|
-
`),{path:Q,added:!0,updated:!1}}function
|
|
14
|
-
`)}}catch{}let X=!1,H=K($,"AGENTS.md");try{let W=
|
|
11
|
+
`)}function p9($){let Q=K($,".mcp.json"),Z={};try{Z=JSON.parse(L(Q,"utf8"))}catch{}Z.mcpServers=Z.mcpServers??{};let Y=Z.mcpServers.beacon;if(Y){if(!Y.timeout||Y.timeout<B0)return Y.timeout=B0,I(Q,JSON.stringify(Z,null,2)+`
|
|
12
|
+
`),{path:Q,added:!1,updated:!0};return{path:Q,added:!1,updated:!1}}return Z.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:B0},I(Q,JSON.stringify(Z,null,2)+`
|
|
13
|
+
`),{path:Q,added:!0,updated:!1}}function c9($){let Q=K($,".mcp.json"),Z=!1;try{Z=!!JSON.parse(L(Q,"utf8")).mcpServers?.beacon}catch{}let Y=!1;try{Y=L(K($,"AGENTS.md"),"utf8").includes(M0)}catch{}let X=!1;try{X=/@AGENTS\.md/.test(L(K($,"CLAUDE.md"),"utf8"))}catch{}return{repo:$,mcpRegistered:Z,agentsMdBlock:Y,claudeMdImport:X,skills:{"beacon-init":l(K($,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":l(K($,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":l(K($,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":l(K($,".agents","skills","beacon-refresh","SKILL.md"))}}}function l9($){let Q=[];for(let W of["beacon-init","beacon-refresh","beacon-db-design"]){let w=K($,".claude","skills",W);if(l(w))K0(w,{recursive:!0,force:!0}),Q.push(W)}for(let W of["beacon-init","beacon-refresh"]){let w=K($,".agents","skills",W);if(l(w))K0(w,{recursive:!0,force:!0}),Q.push(`codex:${W}`)}let Z=!1,Y=K($,".mcp.json");try{let W=JSON.parse(L(Y,"utf8"));if(W.mcpServers?.beacon){if(delete W.mcpServers.beacon,Z=!0,W.mcpServers&&Object.keys(W.mcpServers).length===0)delete W.mcpServers;if(Object.keys(W).length===0)K0(Y,{force:!0});else I(Y,JSON.stringify(W,null,2)+`
|
|
14
|
+
`)}}catch{}let X=!1,H=K($,"AGENTS.md");try{let W=L(H,"utf8"),w=new RegExp(`\\n?${M0}[\\s\\S]*?${r0}\\n?`);if(w.test(W)){let a=W.replace(w,`
|
|
15
15
|
`).replace(/\n{3,}/g,`
|
|
16
16
|
|
|
17
|
-
`).trimStart();I(H,
|
|
18
|
-
`)?
|
|
19
|
-
`),X=!0}}catch{}let j=!1,G=K($,"CLAUDE.md");try{let W=
|
|
17
|
+
`).trimStart();I(H,a.endsWith(`
|
|
18
|
+
`)?a:`${a}
|
|
19
|
+
`),X=!0}}catch{}let j=!1,G=K($,"CLAUDE.md");try{let W=L(G,"utf8"),w=W.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(w!==W){if(!w.trim())K0(G,{force:!0});else I(G,w);j=!0}}catch{}return{skillsRemoved:Q,mcpUnregistered:Z,agentsBlockRemoved:X,claudeImportRemoved:j}}var i0=`---
|
|
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
|
---
|
|
@@ -55,7 +55,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
55
55
|
If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
|
|
56
56
|
|
|
57
57
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
58
|
-
`,
|
|
58
|
+
`,a0=`---
|
|
59
59
|
name: beacon-refresh
|
|
60
60
|
description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
|
|
61
61
|
---
|
|
@@ -71,7 +71,7 @@ Beacon was already initialized in this repo (\`/beacon-init\` ran at some point)
|
|
|
71
71
|
|
|
72
72
|
## What gets preserved vs replaced
|
|
73
73
|
|
|
74
|
-
The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`
|
|
74
|
+
The \`beacon_init_persist\` tool **replaces only init-derived nodes** (\`source=INIT\`). A curated architecture node (created by \`beacon_feature\` action:done or by hand) whose title matches a component in your refreshed analysis is **merged in place** \u2014 your fresh \`domain\`/\`role\`/\`plain\`/\`layer\`/\`files\` land on it, but it keeps its source, position, status, and bug flags, and no duplicate INIT node is created. Curated nodes your analysis does NOT mention survive untouched, as do hand-edited tables, custom positions, notes, and draft feature plans. So you can re-run this freely.
|
|
75
75
|
|
|
76
76
|
The one caveat: if the user manually edited an INIT-source node on the canvas (e.g., renamed it, rewrote its role), that edit IS overwritten when you re-persist \u2014 and a renamed node no longer title-matches, so it survives as its own card. If the user mentions hand-curated INIT nodes, ask whether they want those carried into the new analysis verbatim.
|
|
77
77
|
|
|
@@ -150,7 +150,7 @@ If it returns feedback, revise and call it again.
|
|
|
150
150
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
151
151
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
152
152
|
run \`beacon\` in this repo once.
|
|
153
|
-
`,
|
|
153
|
+
`,f9,M0="<!-- beacon:workflow:start -->",r0="<!-- beacon:workflow:end -->",k5;var e0=c(()=>{n0();f9=[{name:"beacon-init",body:()=>i0},{name:"beacon-refresh",body:()=>a0}];k5=`${M0}
|
|
154
154
|
## Beacon \u2014 feature workflow
|
|
155
155
|
|
|
156
156
|
This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
|
|
@@ -175,13 +175,23 @@ When listing endpoints, give each \`uses: [{ table, access }]\` so the endpoint\
|
|
|
175
175
|
|
|
176
176
|
EVERY feature MUST carry \`category\` (e.g. AUTH | SEARCH | DATA | INTEL | BILLING | \u2026; \`cluster\` is accepted as an alias) and \`priority\` (0 = P0 critical, 1 = P1 high, 2 = P2 medium, 3 = P3 low). Beacon REJECTS a plan whose features omit either \u2014 \`beacon_propose_plan\` returns the list of what's missing, and an ExitPlanMode \`\`\`beacon block is denied \u2014 so set both on every feature instead of relying on defaults.
|
|
177
177
|
|
|
178
|
-
When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`
|
|
178
|
+
When the workspace HAS A FRONTEND (Beacon knows \u2014 the agent set \`hasFrontend\` at init, or frontend files were detected), every feature must ALSO carry \`layer\`: \`"frontend" | "backend" | "fullstack"\` \u2014 which side of the stack the work lands on. Plans omitting it are REJECTED the same way category/priority are. It works on every surface that creates roadmap cards (\`beacon_propose_plan\`, the \`\`\`beacon block, \`beacon_feature\` \u2014 sub-tasks default to the parent's layer) and on architecture components (\`beacon_feature\` action:done / \`beacon_init_persist\`). In a pure-backend repo, never set it \u2014 the boards don't show it there.
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
### Adding a card directly \u2014 \`beacon_feature\` (no review gate)
|
|
181
|
+
|
|
182
|
+
To put a card on the board WITHOUT the plan-review flow, call \`beacon_feature\` \u2014 ONE tool for a feature's whole lifecycle:
|
|
183
|
+
- \`{ action: "add" }\` creates a card in a SINGLE call. It defaults to \`status: "backlog"\` (a PENDING item you're NOT working on yet); pass \`status: "active"\` to start it IN_PROGRESS now. A title that matches an existing card returns \`exists\` (reuse it) \u2014 \`add\` never activates or demotes a card already on the board.
|
|
184
|
+
- \`{ action: "start" }\` marks an existing card IN_PROGRESS (create-or-flag).
|
|
185
|
+
- \`{ action: "subtasks" }\` adds child tasks under a card.
|
|
186
|
+
- \`{ action: "done" }\` completes feature(s) and registers the files/architecture touched.
|
|
187
|
+
|
|
188
|
+
A NEW card REQUIRES \`category\` + \`priority\` (and \`layer\` where the workspace has a frontend). Use \`beacon_propose_plan\` / \`beacon_present_plan\` only when you want the user to REVIEW before the card lands.
|
|
189
|
+
|
|
190
|
+
REUSE before you create. Call \`beacon_map\` FIRST \u2014 it lists every card with its \`category\`, \`priority\`, \`layer\` and \`status\`, so you reuse an existing category (don't invent a near-synonym) and spot duplicates WITHOUT calling \`beacon_entities\`. Beacon HARD-BLOCKS a feature that duplicates an existing one (it returns the existing feature to use instead) and one created without a category. \`category\` is the ONLY domain field. \`front\` (in \`beacon_feature\`) nests a card UNDER an existing parent feature \u2014 it is NOT a domain tag; a \`front\` that matches no real feature is rejected.
|
|
181
191
|
|
|
182
192
|
When listing features, give each \`dependsOn: ["Other feature title", \u2026]\` for any feature that must ship after another in the same plan. Beacon draws these as "depends on" links so the roadmap shows the dependency chain instead of loose, disconnected cards.
|
|
183
193
|
|
|
184
|
-
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`
|
|
194
|
+
A roadmap item that is a BUG to fix (not a feature to build) should carry \`kind: "BUG"\` \u2014 it renders as a typed bug card. This works everywhere roadmap cards are created: \`beacon_propose_plan\` features, the \`\`\`beacon block, \`beacon_feature\` (add/start when the user is working on a bug; or \`subtasks\` items for a bug discovered mid-work), and \`beacon_init_persist\` roadmap items. Default is FEATURE.
|
|
185
195
|
|
|
186
196
|
### 2b. Presenting a plan in plan mode (ExitPlanMode)
|
|
187
197
|
|
|
@@ -199,27 +209,27 @@ Beacon extracts it deterministically and **strips the block from the prose** (it
|
|
|
199
209
|
|
|
200
210
|
### 3. At the end, register the work \u2014 in ONE call
|
|
201
211
|
|
|
202
|
-
Call \`
|
|
212
|
+
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.
|
|
203
213
|
|
|
204
214
|
Key each entry by its node \`id\`: the ids are handed back to you when the plan is approved (in the approval message / additionalContext), so you don't fuzzy-match titles or pay a disambiguation round-trip. If you don't have an id, \`title\` still works.
|
|
205
215
|
|
|
206
|
-
Register them all in that single batched call. If a plan added five features, that's ONE \`
|
|
216
|
+
Register them all in that single batched call. If a plan added five features, that's ONE \`beacon_feature({ action: "done" })\` call with five entries \u2014 NOT five calls, and NOT just an umbrella ("Harden auth"), which leaves the individual features stuck on **Pending**.
|
|
207
217
|
|
|
208
218
|
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.
|
|
209
219
|
|
|
210
220
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
211
|
-
${r0}`});import{existsSync as x5,mkdirSync as $5,readFileSync as
|
|
212
|
-
`)}function
|
|
221
|
+
${r0}`});import{existsSync as x5,mkdirSync as $5,readFileSync as q0,rmSync as d9,writeFileSync as w0}from"fs";import{dirname as z5,join as P0}from"path";function Q5($){try{return JSON.parse(q0($,"utf8"))}catch{return{}}}function S5($,Q){$5(z5($),{recursive:!0}),w0($,JSON.stringify(Q,null,2)+`
|
|
222
|
+
`)}function v0($,Q){let Z=Q5($);Z.hooks=Z.hooks??{},Z.hooks[Q.event]=Z.hooks[Q.event]??[];let Y=Z.hooks[Q.event];if(Y.some((H)=>H.matcher===Q.matcher&&H.hooks?.some((j)=>j.command===Q.command)))return!1;return Y.push({matcher:Q.matcher,hooks:[{type:"command",command:Q.command}]}),S5($,Z),!0}function F0($,Q){return(Q5($).hooks?.[Q.event]??[]).some((X)=>X.hooks?.some((H)=>H.command===Q.command))}function D0($,Q){let Z=Q5($),Y=Z.hooks?.[Q.event];if(!Y)return!1;let X=!1,H=Y.map((j)=>{let G=j.hooks?.length??0,W=(j.hooks??[]).filter((w)=>w.command!==Q.command);if(W.length!==G)X=!0;return{...j,hooks:W}}).filter((j)=>(j.hooks??[]).length>0);if(!X)return!1;if(H.length)Z.hooks[Q.event]=H;else delete Z.hooks[Q.event];if(Z.hooks&&Object.keys(Z.hooks).length===0)delete Z.hooks;return S5($,Z),!0}function O0($,Q,Z,Y){let X=`${Q}
|
|
213
223
|
${Y.trim()}
|
|
214
|
-
${Z}`,H="";try{H=
|
|
224
|
+
${Z}`,H="";try{H=q0($,"utf8")}catch{}let j=new RegExp(`${Q}[\\s\\S]*?${Z}`);H=j.test(H)?H.replace(j,X):H.trim()?`${H.trim()}
|
|
215
225
|
|
|
216
226
|
${X}
|
|
217
227
|
`:`${X}
|
|
218
|
-
`,$5(z5($),{recursive:!0}),
|
|
228
|
+
`,$5(z5($),{recursive:!0}),w0($,H.endsWith(`
|
|
219
229
|
`)?H:`${H}
|
|
220
|
-
`)}function
|
|
230
|
+
`)}function t($,Q){try{return q0($,"utf8").includes(Q)}catch{return!1}}function R0($,Q,Z){let Y="";try{Y=q0($,"utf8")}catch{return!1}let X=new RegExp(`${Q}[\\s\\S]*?${Z}\\n?`);if(!X.test(Y))return!1;let H=Y.replace(X,"").replace(/\n{3,}/g,`
|
|
221
231
|
|
|
222
|
-
`).trimStart();return
|
|
232
|
+
`).trimStart();return w0($,H),!0}function A0($,Q,Z){let Y=P0($,Q);$5(Y,{recursive:!0});let X=P0(Y,"SKILL.md");return w0(X,Z),X}function e($,Q){return x5(P0($,Q,"SKILL.md"))}function E0($,Q){let Z=P0($,Q);if(!x5(Z))return!1;return d9(Z,{recursive:!0,force:!0}),!0}var y,C0=`## Beacon (visual planning panel)
|
|
223
233
|
|
|
224
234
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
225
235
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -240,39 +250,39 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
240
250
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
241
251
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
242
252
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
243
|
-
verbatim. Do NOT implement until the tool returns approval.`;var Z5=c(()=>{
|
|
253
|
+
verbatim. Do NOT implement until the tool returns approval.`;var Z5=c(()=>{y=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as o9,renameSync as s9,rmSync as n9,writeFileSync as i9}from"fs";import{dirname as a9}from"path";function I0($,Q){o9(a9($),{recursive:!0});let Z=`${$}.tmp`;try{i9(Z,Q),s9(Z,$)}catch(Y){throw n9(Z,{force:!0}),Y}}function pQ($,Q,Z=!1){I0($,JSON.stringify(Q,null,Z?2:void 0))}var h5=()=>{};var l5={};r(l5,{setupCodexAssets:()=>$$,removeCodexMcp:()=>c5,removeCodexArtifacts:()=>Z$,hasCodexMcp:()=>X5,ensureCodexMcp:()=>p5,codexMcpProblem:()=>e9,codexDetected:()=>f5,auditCodex:()=>Q$,CODEX_HOOKS:()=>y0});import{readFileSync as k0}from"fs";import{homedir as r9}from"os";import{join as Z0}from"path";function g5(){return process.env.HOME||process.env.USERPROFILE||r9()}function f5(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(J5===void 0)J5=Bun.which("codex")!==null;return J5}function Q0($){try{return Bun.TOML.parse($)}catch{return null}}function X5(){try{return Boolean(Q0(k0(d(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function e9(){let $="";try{$=k0(d(),"utf8")}catch{return null}let Q=Q0($);if(!Q)return`~/.codex/config.toml does not parse \u2014 ${$0}`;if(Q.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test($))return`mcp_servers is an inline table \u2014 ${$0}`;return null}function p5(){let $="",Q=!1;try{$=k0(d(),"utf8"),Q=!0}catch{}if(Q){let H=Q0($);if(!H)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${$0}`};if(H.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test($))return{added:!1,error:`mcp_servers is an inline table \u2014 ${$0}`}}let Z=!$?"":$.endsWith(`
|
|
244
254
|
`)?`
|
|
245
255
|
`:`
|
|
246
256
|
|
|
247
|
-
`,Y=$+Z+
|
|
248
|
-
`),Z=Q.indexOf(
|
|
257
|
+
`,Y=$+Z+t9;if(Q0(Y)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${$0}`};return I0(d(),Y),{added:!0}}function c5(){let $="";try{$=k0(d(),"utf8")}catch{return{removed:!1}}let Q=$.split(`
|
|
258
|
+
`),Z=Q.indexOf(b5);if(Z===-1)return{removed:!1,skipped:X5()};let Y=Q.indexOf(m5,Z);if(Y===-1)return{removed:!1,skipped:!0};Q.splice(Z,Y-Z+1);let X=Q.join(`
|
|
249
259
|
`).replace(/\n{3,}/g,`
|
|
250
260
|
|
|
251
|
-
`).replace(/^\n+/,"");if(
|
|
261
|
+
`).replace(/^\n+/,"");if(Q0(X)===null)return{removed:!1,skipped:!0};return I0(d(),X),{removed:!0}}async function $$(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (e0(),t0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let W of y){if(!e(L0(),W))X.push(W);A0(L0(),W,Y[W])}let H=0;for(let W of y0)if(v0(V5(),{event:W.event,matcher:W.matcher,command:W.command}))H++;let j=t(T0(),_0);O0(T0(),_0,u5,C0);let G=p5();return{skillsAdded:X,hooksAdded:H,agentsMdBlockTouched:!j,mcp:G}}function Q$(){let $={};for(let Z of y)$[Z]=e(L0(),Z);let Q={};for(let Z of y0)Q[Z.event]=F0(V5(),{event:Z.event,command:Z.command});return{detected:f5(),skills:$,hooks:Q,agentsMdBlock:t(T0(),_0),mcp:X5()}}function Z$(){let $=[];for(let X of y)if(E0(L0(),X))$.push(X);let Q=0;for(let X of y0)if(D0(V5(),{event:X.event,command:X.command}))Q++;let Z=R0(T0(),_0,u5),Y=c5();return{skillsRemoved:$,hooksRemoved:Q,agentsMdBlockRemoved:Z,mcpRemoved:Y.removed,mcpSkipped:Y.skipped}}var Y5=()=>Z0(g5(),".codex"),V5=()=>Z0(Y5(),"hooks.json"),d=()=>Z0(Y5(),"config.toml"),T0=()=>Z0(Y5(),"AGENTS.md"),L0=()=>Z0(g5(),".agents","skills"),_0="<!-- beacon:global:start -->",u5="<!-- beacon:global:end -->",y0,J5,b5="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",m5="# beacon:end",t9,$0="add it manually: codex mcp add beacon -- beacon mcp";var d5=c(()=>{Z5();h5();y0=[{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."}];t9=`${b5}
|
|
252
262
|
[mcp_servers.beacon]
|
|
253
263
|
command = "beacon"
|
|
254
264
|
args = ["mcp"]
|
|
255
|
-
${
|
|
256
|
-
`});var t5={};t(t5,{provisionDb:()=>A$});import{createClient as N$}from"@libsql/client";import{drizzle as M$}from"drizzle-orm/libsql";import{migrate as P$}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as q$}from"drizzle-orm/migrator";import{dirname as B5,join as w$}from"path";import{fileURLToPath as C$}from"url";async function S0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function O$($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((Y)=>String(Y.name)))}async function r5($){if(!await S0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function R$($){for(let[Q,Z]of Object.entries(D$)){if(!await S0($,Q))continue;let Y=await O$($,Q);for(let X of Z){if(!Y.has(X))continue;await $.execute(`UPDATE "${Q}" SET "${X}" = CAST((julianday("${X}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${X}") = 'text'`)}}}async function A$($,Q=F$){let Z=N$({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let Y=await S0(Z,"__drizzle_migrations"),X=await S0(Z,"Node"),H=!1;if(X&&!Y){let G=q$({migrationsFolder:Q})[0];if(G)await Z.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await Z.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[G.hash,G.folderMillis]}),H=!0}let j=await r5(Z);if(await P$(M$(Z),{migrationsFolder:Q}),await r5(Z)>j)H=!0;return await R$(Z),{migrated:H}}finally{Z.close()}}var v$,F$,D$;var e5=c(async()=>{v$=B5(B5(B5(C$(import.meta.url)))),F$=process.env.BEACON_MIGRATIONS_DIR||w$(v$,"drizzle"),D$={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});Z5();import{existsSync as Z$}from"fs";import{homedir as J$}from"os";import{join as x0}from"path";function Y$(){return process.env.HOME||process.env.USERPROFILE||J$()}var z0=()=>x0(Y$(),".claude"),H5=()=>x0(z0(),"skills"),j5=()=>x0(z0(),"settings.json"),G5=()=>x0(z0(),"CLAUDE.md"),W5="<!-- beacon:global:start -->",o5="<!-- beacon:global:end -->";var V$=v0,U5=[{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 X$($,Q){return E0(H5(),$,Q)}function n5($){return $0(H5(),$)}function H$($){return I0(H5(),$)}function j$($){return F0(j5(),$)}function G$($){return D0(j5(),$)}function W$($){return O0(j5(),$)}function U$($){R0(G5(),W5,o5,$)}function a5(){return e(G5(),W5)}function B$(){return A0(G5(),W5,o5)}function tQ(){let $={};for(let Z of g)$[Z]=n5(Z);let Q={};for(let Z of U5)Q[Z.event]=G$({event:Z.event,command:Z.command});return{homeExists:Z$(z0()),skills:$,hooks:Q,claudeMdBlock:a5()}}async function K$(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (e0(),t0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let G of g){if(!n5(G))X.push(G);X$(G,Y[G])}let H=0;for(let G of U5)if(j$({event:G.event,matcher:G.matcher,command:G.command}))H++;let j=a5();return U$(V$),{skillsAdded:X,hooksAdded:H,claudeMdBlockTouched:!j}}async function i5(){let $;try{$={ok:!0,...await K$()}}catch(Q){$={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Q=await Promise.resolve().then(() => (s5(),d5));if(Q.codexDetected())$.codex={ok:!0,...await Q.setupCodexAssets()}}catch(Q){$.codex={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return $}function eQ(){let $=[];for(let Y of g)if(H$(Y))$.push(Y);let Q=0;for(let Y of U5)if(W$(Y))Q++;let Z=B$();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as E$}from"async_hooks";import{spawnSync as I$}from"child_process";import{createHash as L$}from"crypto";import{existsSync as Q9,mkdirSync as Y0,readFileSync as N5,writeFileSync as M5}from"fs";import{homedir as Z9}from"os";import{basename as T$,join as y,parse as _$,resolve as $9}from"path";function _(){return process.env.BEACON_HOME||y(Z9(),".beacon")}function P5(){return y(_(),"workspaces.json")}function s($){return L$("sha256").update($).digest("hex").slice(0,12)}function J9($=process.cwd()){let Q=I$("git",["rev-parse","--show-toplevel"],{cwd:$,stdio:["ignore","pipe","ignore"]});if(Q.status===0){let Z=Q.stdout?.toString().trim();if(Z)return Z}return $}function h0($){let Q=$9($);return Q!==$9(Z9())&&Q!==_$(Q).root}function Y9(){return y(_(),"deleted.json")}function q5(){try{let $=JSON.parse(N5(Y9(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function V9($){Y0(_(),{recursive:!0}),M5(Y9(),JSON.stringify($,null,2))}function u0($){return q5().includes($)}function KZ($){let Q=q5();if(!Q.includes($))V9([...Q,$])}function k$($){let Q=q5();if(Q.includes($))V9(Q.filter((Z)=>Z!==$))}function f0($){return y(_(),$)}function w5($){return`file:${y(f0($),"db.sqlite")}`}function V0(){try{let $=JSON.parse(N5(P5(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function C5($){Y0(_(),{recursive:!0}),M5(P5(),JSON.stringify($,null,2))}function b0(){return V0().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function S($){return V0().find((Q)=>Q.id===$)??null}function m0($,Q,Z=new Date().toISOString()){if(!h0($))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${$}`);let Y=s($);if(u0(Y))throw Error(`beacon: workspace ${Y} (${$}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let X=V0(),H=X.find((W)=>W.id===Y),j={id:Y,path:$,name:Q||H?.name||T$($),lastOpenedAt:Z},G=[j,...X.filter((W)=>W.id!==Y)];return Y0(f0(Y),{recursive:!0}),C5(G),j}function NZ($,Q){return k$(s($)),m0($,Q)}function MZ($,Q=new Date().toISOString()){let Z=V0(),Y=Z.find((X)=>X.id===$);if(!Y)return;Y.lastOpenedAt=Q,C5(Z)}function PZ($){if(C5(V0().filter((Q)=>Q.id!==$)),X0()===$)g$(b0()[0]?.id??null)}function X9(){return y(_(),"active")}function X0(){try{return N5(X9(),"utf8").trim()||null}catch{return null}}function g$($){Y0(_(),{recursive:!0}),M5(X9(),$??"")}function qZ(){let $=X0();return $?S($):null}function wZ(){let $=F5()??X0();return $?S($):null}function CZ($){return S($)?.path??null}function vZ(){return Q9(P5())}var H9="beacon_ws";function j9($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let Y of Z.split(";")){let X=Y.indexOf("=");if(X===-1)continue;if(Y.slice(0,X).trim()===Q)return decodeURIComponent(Y.slice(X+1).trim())}return null}function FZ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&S(Q))return Q;let Z=j9($,H9);if(Z&&S(Z))return Z;return y$()}function y$(){let $=b0();return $.length===1?$[0].id:null}var v5="x-beacon-workspace-path";async function DZ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&S(Q))return Q;let Z=$.headers.get(v5);if(Z&&h0(Z)&&!u0(s(Z))&&(!Q||s(Z)===Q)){let X=m0(Z);return await D5(X.id),X.id}let Y=j9($,H9);if(Y&&S(Y))return Y;return null}var G9=new E$;function x$($,Q){return $?G9.run($,Q):Q()}function F5(){return G9.getStore()??null}var K5=new Set;function OZ($){K5.delete(y(f0($),"db.sqlite"))}async function D5($){let Q=f0($),Z=y(Q,"db.sqlite"),Y=Q9(Z);if(Y&&K5.has(Z))return{ok:!0,created:!1,migrated:!1};try{Y0(Q,{recursive:!0});let{provisionDb:X}=await e5().then(() => t5),H=await X(w5($));return K5.add(Z),{ok:!0,created:!Y,migrated:Y&&H.migrated}}catch(X){return{ok:!1,created:!1,migrated:!1,error:X instanceof Error?X.message:String(X)}}}import{connect as z$}from"net";var W9=4319;function S$($,Q,Z=400){return new Promise((Y)=>{let X=z$({host:$,port:Q}),H=!1,j=(G)=>{if(H)return;H=!0,X.destroy(),Y(G)};X.once("connect",()=>j(!0)),X.once("error",()=>j(!1)),X.setTimeout(Z,()=>j(!1))})}async function h$($){for(let Q of["127.0.0.1","::1"])if(await S$(Q,$))return!1;return!0}async function EZ($,Q=20){for(let Z=$;Z<$+Q;Z++)if(await h$(Z))return Z;return $}import{McpServer as LQ,ResourceTemplate as T5}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as TQ}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as B}from"zod";var u$=new Set(["GET","HEAD","OPTIONS"]);function U9($){return u$.has($.trim().toUpperCase())?"read":"write"}var f$=B.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},B.object({name:B.string().trim().min(1),type:B.string().trim().min(1),isPk:B.boolean().optional(),isFk:B.boolean().optional(),nullable:B.boolean().optional(),note:B.string().nullish()})),B9=B.object({name:B.string().trim().min(1),domain:B.string().nullish(),description:B.string().nullish(),columns:B.array(f$).default([])}),K9=B.object({fromTable:B.string(),fromColumn:B.string(),toTable:B.string(),toColumn:B.string(),label:B.string().nullish()}),N9=B.object({method:B.string().trim().min(1),path:B.string().trim().min(1),domain:B.string().nullish(),description:B.string().nullish(),uses:B.array(B.object({table:B.string().trim().min(1),access:B.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??U9($.method)}))})),kZ=B.object({tables:B.array(B9).default([]),relations:B.array(K9).default([]),endpoints:B.array(N9).default([])});import{z as R}from"zod";import{and as $1,eq as Q1,inArray as Z1}from"drizzle-orm";import{drizzle as UQ}from"drizzle-orm/libsql";import{createClient as BQ}from"@libsql/client";var O5={};t(O5,{workspaceFlag:()=>o$,tag:()=>o,syncState:()=>l$,projectMeta:()=>s$,planContract:()=>n$,note:()=>p$,nodeTags:()=>h,nodeFile:()=>H0,node:()=>M,endpointTable:()=>f,endpoint:()=>n,edge:()=>x,draftTable:()=>A,draftRelation:()=>b,draftColumn:()=>W0,dbTable:()=>F,dbRelation:()=>u,dbColumn:()=>G0,codeFileEdge:()=>m,codeFile:()=>k,bugFlag:()=>j0,boardAnnotation:()=>c$,appSetting:()=>d$});import{sqliteTable as P,index as N,foreignKey as b$,text as V,integer as U,real as O,uniqueIndex as L,primaryKey as m$}from"drizzle-orm/sqlite-core";import{createId as C}from"@paralleldrive/cuid2";var M=P("Node",{id:V().primaryKey().$defaultFn(()=>C()),view:V().notNull(),kind:V().default("FEATURE").notNull(),cluster:V(),layer:V(),title:V().notNull(),role:V(),plain:V(),status:V().default("PENDING").notNull(),priority:U().default(2).notNull(),progress:U().default(0).notNull(),x:O().default(0).notNull(),y:O().default(0).notNull(),sourceRef:V(),externalId:V(),source:V().default("MANUAL").notNull(),planId:V(),parentId:V(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Node_cluster_idx").on($.cluster),N("Node_parentId_idx").on($.parentId),N("Node_view_idx").on($.view),b$(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),H0=P("NodeFile",{id:V().primaryKey().$defaultFn(()=>C()),nodeId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),path:V().notNull()},($)=>[L("NodeFile_nodeId_path_key").on($.nodeId,$.path),N("NodeFile_nodeId_idx").on($.nodeId)]),o=P("Tag",{id:V().primaryKey().$defaultFn(()=>C()),label:V().notNull(),color:V()},($)=>[L("Tag_label_key").on($.label)]),x=P("Edge",{id:V().primaryKey().$defaultFn(()=>C()),fromId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:V().default("DEPENDS").notNull(),label:V(),sourceHandle:V(),targetHandle:V()},($)=>[L("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),N("Edge_toId_idx").on($.toId),N("Edge_fromId_idx").on($.fromId)]),h=P("_NodeTags",{a:V("A").notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),b:V("B").notNull().references(()=>o.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[L("_NodeTags_AB_unique").on($.a,$.b),N("_NodeTags_B_index").on($.b)]),p$=P("Note",{id:V().primaryKey().$defaultFn(()=>C()),title:V().default("Untitled").notNull(),body:V().default("").notNull(),ord:O().default(0).notNull(),pinned:U({mode:"boolean"}).default(!1).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Note_updatedAt_idx").on($.updatedAt)]),c$=P("BoardAnnotation",{id:V().primaryKey().$defaultFn(()=>C()),targetKind:V().notNull(),targetId:V().notNull(),columnName:V(),body:V().default("").notNull(),x:O(),y:O(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("BoardAnnotation_target_idx").on($.targetId)]),j0=P("BugFlag",{id:V().primaryKey().$defaultFn(()=>C()),nodeId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),by:V().notNull(),note:V().notNull(),resolvedAt:U({mode:"timestamp_ms"}),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[N("BugFlag_nodeId_idx").on($.nodeId)]),F=P("DbTable",{id:V().primaryKey().$defaultFn(()=>C()),name:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),planId:V(),x:O().default(0).notNull(),y:O().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("DbTable_domain_idx").on($.domain),L("DbTable_name_key").on($.name)]),G0=P("DbColumn",{id:V().primaryKey().$defaultFn(()=>C()),tableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:U({mode:"boolean"}).default(!1).notNull(),isFk:U({mode:"boolean"}).default(!1).notNull(),nullable:U({mode:"boolean"}).default(!0).notNull(),note:V(),ord:U().default(0).notNull()},($)=>[L("DbColumn_tableId_name_key").on($.tableId,$.name),N("DbColumn_tableId_idx").on($.tableId)]),u=P("DbRelation",{id:V().primaryKey().$defaultFn(()=>C()),fromTableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DbRelation_toTableId_idx").on($.toTableId),N("DbRelation_fromTableId_idx").on($.fromTableId)]),n=P("Endpoint",{id:V().primaryKey().$defaultFn(()=>C()),method:V().notNull(),path:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),planId:V(),x:O().default(0).notNull(),y:O().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[L("Endpoint_method_path_key").on($.method,$.path),N("Endpoint_domain_idx").on($.domain)]),f=P("EndpointTable",{id:V().primaryKey().$defaultFn(()=>C()),endpointId:V().notNull().references(()=>n.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),access:V().default("read").notNull()},($)=>[L("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),N("EndpointTable_tableId_idx").on($.tableId)]),A=P("DraftTable",{id:V().primaryKey().$defaultFn(()=>C()),name:V().notNull(),domain:V(),description:V(),x:O().default(0).notNull(),y:O().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[L("DraftTable_name_key").on($.name)]),W0=P("DraftColumn",{id:V().primaryKey().$defaultFn(()=>C()),tableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:U({mode:"boolean"}).default(!1).notNull(),isFk:U({mode:"boolean"}).default(!1).notNull(),nullable:U({mode:"boolean"}).default(!0).notNull(),note:V(),ord:U().default(0).notNull()},($)=>[N("DraftColumn_tableId_idx").on($.tableId)]),b=P("DraftRelation",{id:V().primaryKey().$defaultFn(()=>C()),fromTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DraftRelation_toTableId_idx").on($.toTableId),N("DraftRelation_fromTableId_idx").on($.fromTableId)]),k=P("CodeFile",{path:V().primaryKey(),root:V(),lang:V(),x:O().default(0).notNull(),y:O().default(0).notNull(),mtimeMs:O(),size:U(),inDegree:U().default(0).notNull(),outDegree:U().default(0).notNull(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),m=P("CodeFileEdge",{fromPath:V().notNull().references(()=>k.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:V().notNull().references(()=>k.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:U({mode:"boolean"}).default(!1).notNull()},($)=>[N("CodeFileEdge_circular_idx").on($.circular),N("CodeFileEdge_toPath_idx").on($.toPath),N("CodeFileEdge_fromPath_idx").on($.fromPath),m$({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),l$=P("SyncState",{id:V().primaryKey().default("singleton"),version:U().default(0).notNull(),codeGraphSyncedAt:U({mode:"timestamp_ms"}),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),d$=P("AppSetting",{id:V().primaryKey().default("singleton"),editor:V().default("auto").notNull(),currentFeatureId:V(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),s$=P("ProjectMeta",{id:V().primaryKey().default("singleton"),overview:V(),conventions:V().default("[]").notNull(),hasFrontend:U({mode:"boolean"}),classificationRoots:V().default("[]").notNull(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),o$=P("WorkspaceFlag",{id:V().primaryKey().$defaultFn(()=>C()),key:V().notNull(),enabled:U({mode:"boolean"}).default(!1).notNull(),config:V(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[L("WorkspaceFlag_key_key").on($.key)]),n$=P("PlanContract",{id:V().primaryKey().$defaultFn(()=>C()),planId:V().notNull(),declaredFiles:V().default("[]").notNull(),authorizedExtras:V().default("[]").notNull(),active:U({mode:"boolean"}).default(!1).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[L("PlanContract_planId_key").on($.planId),N("PlanContract_active_idx").on($.active)]);var R5={};t(R5,{tagRelations:()=>t$,nodeTagsRelations:()=>e$,nodeRelations:()=>a$,nodeFileRelations:()=>i$,endpointTableRelations:()=>VQ,endpointRelations:()=>YQ,edgeRelations:()=>$Q,draftTableRelations:()=>XQ,draftRelationRelations:()=>jQ,draftColumnRelations:()=>HQ,dbTableRelations:()=>QQ,dbRelationRelations:()=>JQ,dbColumnRelations:()=>ZQ,codeFileRelations:()=>GQ,codeFileEdgeRelations:()=>WQ,bugFlagRelations:()=>r$});import{relations as v}from"drizzle-orm";var a$=v(M,({one:$,many:Q})=>({files:Q(H0),bugFlags:Q(j0),nodeTags:Q(h),edgesOut:Q(x,{relationName:"EdgeFrom"}),edgesIn:Q(x,{relationName:"EdgeTo"}),parent:$(M,{fields:[M.parentId],references:[M.id],relationName:"NodeTree"}),children:Q(M,{relationName:"NodeTree"})})),i$=v(H0,({one:$})=>({node:$(M,{fields:[H0.nodeId],references:[M.id]})})),r$=v(j0,({one:$})=>({node:$(M,{fields:[j0.nodeId],references:[M.id]})})),t$=v(o,({many:$})=>({nodeTags:$(h)})),e$=v(h,({one:$})=>({node:$(M,{fields:[h.a],references:[M.id]}),tag:$(o,{fields:[h.b],references:[o.id]})})),$Q=v(x,({one:$})=>({from:$(M,{fields:[x.fromId],references:[M.id],relationName:"EdgeFrom"}),to:$(M,{fields:[x.toId],references:[M.id],relationName:"EdgeTo"})})),QQ=v(F,({many:$})=>({columns:$(G0),fksOut:$(u,{relationName:"FkFrom"}),fksIn:$(u,{relationName:"FkTo"}),usages:$(f)})),ZQ=v(G0,({one:$})=>({table:$(F,{fields:[G0.tableId],references:[F.id]})})),JQ=v(u,({one:$})=>({fromTable:$(F,{fields:[u.fromTableId],references:[F.id],relationName:"FkFrom"}),toTable:$(F,{fields:[u.toTableId],references:[F.id],relationName:"FkTo"})})),YQ=v(n,({many:$})=>({tables:$(f)})),VQ=v(f,({one:$})=>({endpoint:$(n,{fields:[f.endpointId],references:[n.id]}),table:$(F,{fields:[f.tableId],references:[F.id]})})),XQ=v(A,({many:$})=>({columns:$(W0),fksOut:$(b,{relationName:"DraftFkFrom"}),fksIn:$(b,{relationName:"DraftFkTo"})})),HQ=v(W0,({one:$})=>({table:$(A,{fields:[W0.tableId],references:[A.id]})})),jQ=v(b,({one:$})=>({fromTable:$(A,{fields:[b.fromTableId],references:[A.id],relationName:"DraftFkFrom"}),toTable:$(A,{fields:[b.toTableId],references:[A.id],relationName:"DraftFkTo"})})),GQ=v(k,({many:$})=>({edgesOut:$(m,{relationName:"CFEFrom"}),edgesIn:$(m,{relationName:"CFETo"})})),WQ=v(m,({one:$})=>({fromFile:$(k,{fields:[m.fromPath],references:[k.path],relationName:"CFEFrom"}),toFile:$(k,{fields:[m.toPath],references:[k.path],relationName:"CFETo"})}));var KQ={...O5,...R5};function NQ(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var MQ=NQ();function M9($){let Q=BQ({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),Q.execute("PRAGMA busy_timeout = 5000;"),UQ(Q,{schema:KQ})}var E5=globalThis,A5=E5.dzDefault??M9(MQ);E5.dzDefault=A5;var p0=E5.dzByUrl??=new Map;function PQ($){let Q=p0.get($);if(!Q)Q=M9($),p0.set($,Q);return Q}function bZ($){let Q=p0.get($);p0.delete($);try{Q?.$client?.close?.()}catch{}}function qQ(){if(process.env.BEACON_REPO)return A5;let $=F5()??X0();if(!$)return A5;return PQ(w5($))}var wQ=new Proxy({},{get($,Q){let Z=qQ(),Y=Z[Q];return typeof Y==="function"?Y.bind(Z):Y}});var CQ=["frontend","backend","fullstack"],vQ={fe:"frontend",front:"frontend",be:"backend",back:"backend",fs:"fullstack","full-stack":"fullstack","full stack":"fullstack"};function c0($){let Q=($??"").trim().toLowerCase();if(!Q)return null;if(CQ.includes(Q))return Q;return vQ[Q]??null}import{forceCenter as dZ,forceCollide as sZ,forceLink as oZ,forceManyBody as nZ,forceSimulation as aZ}from"d3-force";var P9=R.object({title:R.string().trim().min(1),role:R.string().nullish(),plain:R.string().nullish(),cluster:R.string().nullish(),category:R.string().nullish(),domain:R.string().nullish(),priority:R.number().nullish(),kind:R.string().nullish(),layer:R.string().nullish(),dependsOn:R.array(R.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,kind:Y,layer:X,...H})=>({...H,cluster:H.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z))),kind:Y?.trim().toUpperCase()==="BUG"?"BUG":"FEATURE",layer:c0(X)})),H1=R.object({features:R.array(P9).default([])});var FQ=/(\bmigrations?\b|\balembic\b|make revision|prisma migrate|unique\s?constraint|foreign\s?keys?|primary\s?keys?|\bFKs?\b|\bJSONB\b|create\s+table|alter\s+table|add\s+(a\s+)?column|new\s+(table|model|column)|app\/models\/|\bBaseModel\b|DeclarativeBase|schema\.prisma|@@unique|natural\s+keys?|\bpgvector\b|\bTSVECTOR\b|\bDbTable\b)/i;function q9($){return!!$&&FQ.test($)}function DQ($){return $.cluster??$.category??$.domain??null}function w9($,Q){let Z=Q?.requireLayer??!1,Y=$.map((H)=>{let j=[],G=DQ(H);if(!G||!G.trim())j.push("category");if(H.priority==null)j.push("priority");if(Z&&!c0(H.layer))j.push("layer");return j.length?` \u2022 "${H.title?.trim()||"(untitled)"}" \u2014 missing ${j.join(" + ")}`:null}).filter((H)=>H!==null);if(Y.length===0)return null;let X=Z?" This workspace has a frontend surface, so every feature must also carry `layer`: "+'"frontend" | "backend" | "fullstack" \u2014 which side of the stack the work lands on.':"";return"\u26D4 Every roadmap feature needs a category AND a priority \u2014 they drive grouping and ordering "+"on the board, and the user shouldn't have to add them by hand."+X+` Missing:
|
|
265
|
+
${m5}
|
|
266
|
+
`});var r5={};r(r5,{provisionDb:()=>E$});import{createClient as M$}from"@libsql/client";import{drizzle as P$}from"drizzle-orm/libsql";import{migrate as q$}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as w$}from"drizzle-orm/migrator";import{dirname as B5,join as C$}from"path";import{fileURLToPath as v$}from"url";async function S0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function R$($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((Y)=>String(Y.name)))}async function a5($){if(!await S0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function A$($){for(let[Q,Z]of Object.entries(O$)){if(!await S0($,Q))continue;let Y=await R$($,Q);for(let X of Z){if(!Y.has(X))continue;await $.execute(`UPDATE "${Q}" SET "${X}" = CAST((julianday("${X}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${X}") = 'text'`)}}}async function E$($,Q=D$){let Z=M$({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let Y=await S0(Z,"__drizzle_migrations"),X=await S0(Z,"Node"),H=!1;if(X&&!Y){let G=w$({migrationsFolder:Q})[0];if(G)await Z.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await Z.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[G.hash,G.folderMillis]}),H=!0}let j=await a5(Z);if(await q$(P$(Z),{migrationsFolder:Q}),await a5(Z)>j)H=!0;return await A$(Z),{migrated:H}}finally{Z.close()}}var F$,D$,O$;var t5=c(async()=>{F$=B5(B5(B5(v$(import.meta.url)))),D$=process.env.BEACON_MIGRATIONS_DIR||C$(F$,"drizzle"),O$={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});Z5();import{existsSync as J$}from"fs";import{homedir as Y$}from"os";import{join as x0}from"path";function V$(){return process.env.HOME||process.env.USERPROFILE||Y$()}var z0=()=>x0(V$(),".claude"),H5=()=>x0(z0(),"skills"),j5=()=>x0(z0(),"settings.json"),G5=()=>x0(z0(),"CLAUDE.md"),W5="<!-- beacon:global:start -->",o5="<!-- beacon:global:end -->";var X$=C0,U5=[{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 H$($,Q){return A0(H5(),$,Q)}function s5($){return e(H5(),$)}function j$($){return E0(H5(),$)}function G$($){return v0(j5(),$)}function W$($){return F0(j5(),$)}function U$($){return D0(j5(),$)}function B$($){O0(G5(),W5,o5,$)}function n5(){return t(G5(),W5)}function K$(){return R0(G5(),W5,o5)}function eQ(){let $={};for(let Z of y)$[Z]=s5(Z);let Q={};for(let Z of U5)Q[Z.event]=W$({event:Z.event,command:Z.command});return{homeExists:J$(z0()),skills:$,hooks:Q,claudeMdBlock:n5()}}async function N$(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (e0(),t0)),Y={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},X=[];for(let G of y){if(!s5(G))X.push(G);H$(G,Y[G])}let H=0;for(let G of U5)if(G$({event:G.event,matcher:G.matcher,command:G.command}))H++;let j=n5();return B$(X$),{skillsAdded:X,hooksAdded:H,claudeMdBlockTouched:!j}}async function i5(){let $;try{$={ok:!0,...await N$()}}catch(Q){$={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Q=await Promise.resolve().then(() => (d5(),l5));if(Q.codexDetected())$.codex={ok:!0,...await Q.setupCodexAssets()}}catch(Q){$.codex={ok:!1,error:Q instanceof Error?Q.message:String(Q),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return $}function $Z(){let $=[];for(let Y of y)if(j$(Y))$.push(Y);let Q=0;for(let Y of U5)if(U$(Y))Q++;let Z=K$();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as I$}from"async_hooks";import{spawnSync as T$}from"child_process";import{createHash as L$}from"crypto";import{existsSync as $9,mkdirSync as J0,readFileSync as N5,writeFileSync as M5}from"fs";import{homedir as Q9}from"os";import{basename as _$,join as x,parse as k$,resolve as e5}from"path";function _(){return process.env.BEACON_HOME||x(Q9(),".beacon")}function P5(){return x(_(),"workspaces.json")}function o($){return L$("sha256").update($).digest("hex").slice(0,12)}function Z9($=process.cwd()){let Q=T$("git",["rev-parse","--show-toplevel"],{cwd:$,stdio:["ignore","pipe","ignore"]});if(Q.status===0){let Z=Q.stdout?.toString().trim();if(Z)return Z}return $}function h0($){let Q=e5($);return Q!==e5(Q9())&&Q!==k$(Q).root}function J9(){return x(_(),"deleted.json")}function q5(){try{let $=JSON.parse(N5(J9(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function Y9($){J0(_(),{recursive:!0}),M5(J9(),JSON.stringify($,null,2))}function g0($){return q5().includes($)}function NZ($){let Q=q5();if(!Q.includes($))Y9([...Q,$])}function y$($){let Q=q5();if(Q.includes($))Y9(Q.filter((Z)=>Z!==$))}function u0($){return x(_(),$)}function w5($){return`file:${x(u0($),"db.sqlite")}`}function Y0(){try{let $=JSON.parse(N5(P5(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function C5($){J0(_(),{recursive:!0}),M5(P5(),JSON.stringify($,null,2))}function f0(){return Y0().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function h($){return Y0().find((Q)=>Q.id===$)??null}function b0($,Q,Z=new Date().toISOString()){if(!h0($))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${$}`);let Y=o($);if(g0(Y))throw Error(`beacon: workspace ${Y} (${$}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let X=Y0(),H=X.find((W)=>W.id===Y),j={id:Y,path:$,name:Q||H?.name||_$($),lastOpenedAt:Z},G=[j,...X.filter((W)=>W.id!==Y)];return J0(u0(Y),{recursive:!0}),C5(G),j}function MZ($,Q){return y$(o($)),b0($,Q)}function PZ($,Q=new Date().toISOString()){let Z=Y0(),Y=Z.find((X)=>X.id===$);if(!Y)return;Y.lastOpenedAt=Q,C5(Z)}function qZ($){if(C5(Y0().filter((Q)=>Q.id!==$)),V0()===$)x$(f0()[0]?.id??null)}function V9(){return x(_(),"active")}function V0(){try{return N5(V9(),"utf8").trim()||null}catch{return null}}function x$($){J0(_(),{recursive:!0}),M5(V9(),$??"")}function wZ(){let $=V0();return $?h($):null}function CZ(){let $=F5()??V0();return $?h($):null}function vZ($){return h($)?.path??null}function FZ(){return $9(P5())}var X9="beacon_ws";function H9($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let Y of Z.split(";")){let X=Y.indexOf("=");if(X===-1)continue;if(Y.slice(0,X).trim()===Q)return decodeURIComponent(Y.slice(X+1).trim())}return null}function DZ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=H9($,X9);if(Z&&h(Z))return Z;return z$()}function z$(){let $=f0();return $.length===1?$[0].id:null}var v5="x-beacon-workspace-path";async function OZ($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=$.headers.get(v5);if(Z&&h0(Z)&&!g0(o(Z))&&(!Q||o(Z)===Q)){let X=b0(Z);return await D5(X.id),X.id}let Y=H9($,X9);if(Y&&h(Y))return Y;return null}var j9=new I$;function S$($,Q){return $?j9.run($,Q):Q()}function F5(){return j9.getStore()??null}var K5=new Set;function RZ($){K5.delete(x(u0($),"db.sqlite"))}async function D5($){let Q=u0($),Z=x(Q,"db.sqlite"),Y=$9(Z);if(Y&&K5.has(Z))return{ok:!0,created:!1,migrated:!1};try{J0(Q,{recursive:!0});let{provisionDb:X}=await t5().then(() => r5),H=await X(w5($));return K5.add(Z),{ok:!0,created:!Y,migrated:Y&&H.migrated}}catch(X){return{ok:!1,created:!1,migrated:!1,error:X instanceof Error?X.message:String(X)}}}import{connect as h$}from"net";var G9=4319;function g$($,Q,Z=400){return new Promise((Y)=>{let X=h$({host:$,port:Q}),H=!1,j=(G)=>{if(H)return;H=!0,X.destroy(),Y(G)};X.once("connect",()=>j(!0)),X.once("error",()=>j(!1)),X.setTimeout(Z,()=>j(!1))})}async function u$($){for(let Q of["127.0.0.1","::1"])if(await g$(Q,$))return!1;return!0}async function IZ($,Q=20){for(let Z=$;Z<$+Q;Z++)if(await u$(Z))return Z;return $}import{McpServer as LQ,ResourceTemplate as L5}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as _Q}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as B}from"zod";var f$=new Set(["GET","HEAD","OPTIONS"]);function W9($){return f$.has($.trim().toUpperCase())?"read":"write"}var b$=B.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},B.object({name:B.string().trim().min(1),type:B.string().trim().min(1),isPk:B.boolean().optional(),isFk:B.boolean().optional(),nullable:B.boolean().optional(),note:B.string().nullish()})),U9=B.object({name:B.string().trim().min(1),domain:B.string().nullish(),description:B.string().nullish(),columns:B.array(b$).default([])}),B9=B.object({fromTable:B.string(),fromColumn:B.string(),toTable:B.string(),toColumn:B.string(),label:B.string().nullish()}),K9=B.object({method:B.string().trim().min(1),path:B.string().trim().min(1),domain:B.string().nullish(),description:B.string().nullish(),uses:B.array(B.object({table:B.string().trim().min(1),access:B.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??W9($.method)}))})),yZ=B.object({tables:B.array(U9).default([]),relations:B.array(B9).default([]),endpoints:B.array(K9).default([])});import{z as O}from"zod";import{and as Q1,eq as Z1,inArray as J1}from"drizzle-orm";import{drizzle as BQ}from"drizzle-orm/libsql";import{createClient as KQ}from"@libsql/client";var O5={};r(O5,{workspaceFlag:()=>n$,tag:()=>s,syncState:()=>d$,projectMeta:()=>s$,planContract:()=>i$,note:()=>c$,nodeTags:()=>g,nodeFile:()=>X0,node:()=>M,endpointTable:()=>f,endpoint:()=>n,edge:()=>z,draftTable:()=>A,draftRelation:()=>b,draftColumn:()=>G0,dbTable:()=>F,dbRelation:()=>u,dbColumn:()=>j0,codeFileEdge:()=>m,codeFile:()=>k,bugFlag:()=>H0,boardAnnotation:()=>l$,appSetting:()=>o$});import{sqliteTable as P,index as N,foreignKey as m$,text as V,integer as U,real as D,uniqueIndex as T,primaryKey as p$}from"drizzle-orm/sqlite-core";import{createId as C}from"@paralleldrive/cuid2";var M=P("Node",{id:V().primaryKey().$defaultFn(()=>C()),view:V().notNull(),kind:V().default("FEATURE").notNull(),cluster:V(),layer:V(),title:V().notNull(),role:V(),plain:V(),status:V().default("PENDING").notNull(),priority:U().default(2).notNull(),progress:U().default(0).notNull(),x:D().default(0).notNull(),y:D().default(0).notNull(),sourceRef:V(),externalId:V(),source:V().default("MANUAL").notNull(),planId:V(),parentId:V(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Node_cluster_idx").on($.cluster),N("Node_parentId_idx").on($.parentId),N("Node_view_idx").on($.view),m$(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),X0=P("NodeFile",{id:V().primaryKey().$defaultFn(()=>C()),nodeId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),path:V().notNull()},($)=>[T("NodeFile_nodeId_path_key").on($.nodeId,$.path),N("NodeFile_nodeId_idx").on($.nodeId)]),s=P("Tag",{id:V().primaryKey().$defaultFn(()=>C()),label:V().notNull(),color:V()},($)=>[T("Tag_label_key").on($.label)]),z=P("Edge",{id:V().primaryKey().$defaultFn(()=>C()),fromId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:V().default("DEPENDS").notNull(),label:V(),sourceHandle:V(),targetHandle:V()},($)=>[T("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),N("Edge_toId_idx").on($.toId),N("Edge_fromId_idx").on($.fromId)]),g=P("_NodeTags",{a:V("A").notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),b:V("B").notNull().references(()=>s.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[T("_NodeTags_AB_unique").on($.a,$.b),N("_NodeTags_B_index").on($.b)]),c$=P("Note",{id:V().primaryKey().$defaultFn(()=>C()),title:V().default("Untitled").notNull(),body:V().default("").notNull(),ord:D().default(0).notNull(),pinned:U({mode:"boolean"}).default(!1).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("Note_updatedAt_idx").on($.updatedAt)]),l$=P("BoardAnnotation",{id:V().primaryKey().$defaultFn(()=>C()),targetKind:V().notNull(),targetId:V().notNull(),columnName:V(),body:V().default("").notNull(),x:D(),y:D(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("BoardAnnotation_target_idx").on($.targetId)]),H0=P("BugFlag",{id:V().primaryKey().$defaultFn(()=>C()),nodeId:V().notNull().references(()=>M.id,{onDelete:"cascade",onUpdate:"cascade"}),by:V().notNull(),note:V().notNull(),resolvedAt:U({mode:"timestamp_ms"}),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[N("BugFlag_nodeId_idx").on($.nodeId)]),F=P("DbTable",{id:V().primaryKey().$defaultFn(()=>C()),name:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),planId:V(),x:D().default(0).notNull(),y:D().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[N("DbTable_domain_idx").on($.domain),T("DbTable_name_key").on($.name)]),j0=P("DbColumn",{id:V().primaryKey().$defaultFn(()=>C()),tableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:U({mode:"boolean"}).default(!1).notNull(),isFk:U({mode:"boolean"}).default(!1).notNull(),nullable:U({mode:"boolean"}).default(!0).notNull(),note:V(),ord:U().default(0).notNull()},($)=>[T("DbColumn_tableId_name_key").on($.tableId,$.name),N("DbColumn_tableId_idx").on($.tableId)]),u=P("DbRelation",{id:V().primaryKey().$defaultFn(()=>C()),fromTableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DbRelation_toTableId_idx").on($.toTableId),N("DbRelation_fromTableId_idx").on($.fromTableId)]),n=P("Endpoint",{id:V().primaryKey().$defaultFn(()=>C()),method:V().notNull(),path:V().notNull(),domain:V(),description:V(),source:V().default("MANUAL").notNull(),planId:V(),x:D().default(0).notNull(),y:D().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[T("Endpoint_method_path_key").on($.method,$.path),N("Endpoint_domain_idx").on($.domain)]),f=P("EndpointTable",{id:V().primaryKey().$defaultFn(()=>C()),endpointId:V().notNull().references(()=>n.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:V().notNull().references(()=>F.id,{onDelete:"cascade",onUpdate:"cascade"}),access:V().default("read").notNull()},($)=>[T("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),N("EndpointTable_tableId_idx").on($.tableId)]),A=P("DraftTable",{id:V().primaryKey().$defaultFn(()=>C()),name:V().notNull(),domain:V(),description:V(),x:D().default(0).notNull(),y:D().default(0).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[T("DraftTable_name_key").on($.name)]),G0=P("DraftColumn",{id:V().primaryKey().$defaultFn(()=>C()),tableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),name:V().notNull(),type:V().notNull(),isPk:U({mode:"boolean"}).default(!1).notNull(),isFk:U({mode:"boolean"}).default(!1).notNull(),nullable:U({mode:"boolean"}).default(!0).notNull(),note:V(),ord:U().default(0).notNull()},($)=>[N("DraftColumn_tableId_idx").on($.tableId)]),b=P("DraftRelation",{id:V().primaryKey().$defaultFn(()=>C()),fromTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:V().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:V().notNull(),toColumn:V().notNull(),label:V()},($)=>[N("DraftRelation_toTableId_idx").on($.toTableId),N("DraftRelation_fromTableId_idx").on($.fromTableId)]),k=P("CodeFile",{path:V().primaryKey(),root:V(),lang:V(),x:D().default(0).notNull(),y:D().default(0).notNull(),mtimeMs:D(),size:U(),inDegree:U().default(0).notNull(),outDegree:U().default(0).notNull(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),m=P("CodeFileEdge",{fromPath:V().notNull().references(()=>k.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:V().notNull().references(()=>k.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:U({mode:"boolean"}).default(!1).notNull()},($)=>[N("CodeFileEdge_circular_idx").on($.circular),N("CodeFileEdge_toPath_idx").on($.toPath),N("CodeFileEdge_fromPath_idx").on($.fromPath),p$({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),d$=P("SyncState",{id:V().primaryKey().default("singleton"),version:U().default(0).notNull(),codeGraphSyncedAt:U({mode:"timestamp_ms"}),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),o$=P("AppSetting",{id:V().primaryKey().default("singleton"),editor:V().default("auto").notNull(),currentFeatureId:V(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),s$=P("ProjectMeta",{id:V().primaryKey().default("singleton"),overview:V(),conventions:V().default("[]").notNull(),hasFrontend:U({mode:"boolean"}),classificationRoots:V().default("[]").notNull(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),n$=P("WorkspaceFlag",{id:V().primaryKey().$defaultFn(()=>C()),key:V().notNull(),enabled:U({mode:"boolean"}).default(!1).notNull(),config:V(),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[T("WorkspaceFlag_key_key").on($.key)]),i$=P("PlanContract",{id:V().primaryKey().$defaultFn(()=>C()),planId:V().notNull(),declaredFiles:V().default("[]").notNull(),authorizedExtras:V().default("[]").notNull(),active:U({mode:"boolean"}).default(!1).notNull(),createdAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:U({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[T("PlanContract_planId_key").on($.planId),N("PlanContract_active_idx").on($.active)]);var R5={};r(R5,{tagRelations:()=>e$,nodeTagsRelations:()=>$Q,nodeRelations:()=>a$,nodeFileRelations:()=>r$,endpointTableRelations:()=>XQ,endpointRelations:()=>VQ,edgeRelations:()=>QQ,draftTableRelations:()=>HQ,draftRelationRelations:()=>GQ,draftColumnRelations:()=>jQ,dbTableRelations:()=>ZQ,dbRelationRelations:()=>YQ,dbColumnRelations:()=>JQ,codeFileRelations:()=>WQ,codeFileEdgeRelations:()=>UQ,bugFlagRelations:()=>t$});import{relations as v}from"drizzle-orm";var a$=v(M,({one:$,many:Q})=>({files:Q(X0),bugFlags:Q(H0),nodeTags:Q(g),edgesOut:Q(z,{relationName:"EdgeFrom"}),edgesIn:Q(z,{relationName:"EdgeTo"}),parent:$(M,{fields:[M.parentId],references:[M.id],relationName:"NodeTree"}),children:Q(M,{relationName:"NodeTree"})})),r$=v(X0,({one:$})=>({node:$(M,{fields:[X0.nodeId],references:[M.id]})})),t$=v(H0,({one:$})=>({node:$(M,{fields:[H0.nodeId],references:[M.id]})})),e$=v(s,({many:$})=>({nodeTags:$(g)})),$Q=v(g,({one:$})=>({node:$(M,{fields:[g.a],references:[M.id]}),tag:$(s,{fields:[g.b],references:[s.id]})})),QQ=v(z,({one:$})=>({from:$(M,{fields:[z.fromId],references:[M.id],relationName:"EdgeFrom"}),to:$(M,{fields:[z.toId],references:[M.id],relationName:"EdgeTo"})})),ZQ=v(F,({many:$})=>({columns:$(j0),fksOut:$(u,{relationName:"FkFrom"}),fksIn:$(u,{relationName:"FkTo"}),usages:$(f)})),JQ=v(j0,({one:$})=>({table:$(F,{fields:[j0.tableId],references:[F.id]})})),YQ=v(u,({one:$})=>({fromTable:$(F,{fields:[u.fromTableId],references:[F.id],relationName:"FkFrom"}),toTable:$(F,{fields:[u.toTableId],references:[F.id],relationName:"FkTo"})})),VQ=v(n,({many:$})=>({tables:$(f)})),XQ=v(f,({one:$})=>({endpoint:$(n,{fields:[f.endpointId],references:[n.id]}),table:$(F,{fields:[f.tableId],references:[F.id]})})),HQ=v(A,({many:$})=>({columns:$(G0),fksOut:$(b,{relationName:"DraftFkFrom"}),fksIn:$(b,{relationName:"DraftFkTo"})})),jQ=v(G0,({one:$})=>({table:$(A,{fields:[G0.tableId],references:[A.id]})})),GQ=v(b,({one:$})=>({fromTable:$(A,{fields:[b.fromTableId],references:[A.id],relationName:"DraftFkFrom"}),toTable:$(A,{fields:[b.toTableId],references:[A.id],relationName:"DraftFkTo"})})),WQ=v(k,({many:$})=>({edgesOut:$(m,{relationName:"CFEFrom"}),edgesIn:$(m,{relationName:"CFETo"})})),UQ=v(m,({one:$})=>({fromFile:$(k,{fields:[m.fromPath],references:[k.path],relationName:"CFEFrom"}),toFile:$(k,{fields:[m.toPath],references:[k.path],relationName:"CFETo"})}));var NQ={...O5,...R5};function MQ(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var PQ=MQ();function N9($){let Q=KQ({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),Q.execute("PRAGMA busy_timeout = 5000;"),BQ(Q,{schema:NQ})}var E5=globalThis,A5=E5.dzDefault??N9(PQ);E5.dzDefault=A5;var m0=E5.dzByUrl??=new Map;function qQ($){let Q=m0.get($);if(!Q)Q=N9($),m0.set($,Q);return Q}function mZ($){let Q=m0.get($);m0.delete($);try{Q?.$client?.close?.()}catch{}}function wQ(){if(process.env.BEACON_REPO)return A5;let $=F5()??V0();if(!$)return A5;return qQ(w5($))}var CQ=new Proxy({},{get($,Q){let Z=wQ(),Y=Z[Q];return typeof Y==="function"?Y.bind(Z):Y}});var vQ=["frontend","backend","fullstack"],FQ={fe:"frontend",front:"frontend",be:"backend",back:"backend",fs:"fullstack","full-stack":"fullstack","full stack":"fullstack"};function p0($){let Q=($??"").trim().toLowerCase();if(!Q)return null;if(vQ.includes(Q))return Q;return FQ[Q]??null}import{forceCenter as oZ,forceCollide as sZ,forceLink as nZ,forceManyBody as iZ,forceSimulation as aZ}from"d3-force";var M9=O.object({title:O.string().trim().min(1),role:O.string().nullish(),plain:O.string().nullish(),cluster:O.string().nullish(),category:O.string().nullish(),domain:O.string().nullish(),priority:O.number().nullish(),kind:O.string().nullish(),layer:O.string().nullish(),dependsOn:O.array(O.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,kind:Y,layer:X,...H})=>({...H,cluster:H.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z))),kind:Y?.trim().toUpperCase()==="BUG"?"BUG":"FEATURE",layer:p0(X)})),j1=O.object({features:O.array(M9).default([])});var DQ=/(\bmigrations?\b|\balembic\b|make revision|prisma migrate|unique\s?constraint|foreign\s?keys?|primary\s?keys?|\bFKs?\b|\bJSONB\b|create\s+table|alter\s+table|add\s+(a\s+)?column|new\s+(table|model|column)|app\/models\/|\bBaseModel\b|DeclarativeBase|schema\.prisma|@@unique|natural\s+keys?|\bpgvector\b|\bTSVECTOR\b|\bDbTable\b)/i;function P9($){return!!$&&DQ.test($)}function q9($,Q){switch($){case"add":return{path:"/api/map/start",body:{title:Q.title,id:Q.id,front:Q.front,detail:Q.detail,category:Q.category,priority:Q.priority,kind:Q.kind,layer:Q.layer,status:Q.status??"backlog",flagExisting:!1}};case"start":return{path:"/api/map/start",body:{title:Q.title,id:Q.id,front:Q.front,detail:Q.detail,category:Q.category,priority:Q.priority,kind:Q.kind,layer:Q.layer,status:"active",flagExisting:!0}};case"subtasks":return{path:"/api/nodes/subtasks",body:{parentId:Q.parentId,parentTitle:Q.parentTitle,items:Q.items}};case"done":return{path:"/api/map/describe",body:Q.features?.length?{features:Q.features}:{description:Q.description,files:Q.files,id:Q.id,title:Q.title,architecture:Q.architecture}};default:throw Error(`unknown beacon_feature action "${$}"`)}}function OQ($){return $.cluster??$.category??$.domain??null}function w9($,Q){let Z=Q?.requireLayer??!1,Y=$.map((H)=>{let j=[],G=OQ(H);if(!G||!G.trim())j.push("category");if(H.priority==null)j.push("priority");if(Z&&!p0(H.layer))j.push("layer");return j.length?` \u2022 "${H.title?.trim()||"(untitled)"}" \u2014 missing ${j.join(" + ")}`:null}).filter((H)=>H!==null);if(Y.length===0)return null;let X=Z?" This workspace has a frontend surface, so every feature must also carry `layer`: "+'"frontend" | "backend" | "fullstack" \u2014 which side of the stack the work lands on.':"";return"\u26D4 Every roadmap feature needs a category AND a priority \u2014 they drive grouping and ordering "+"on the board, and the user shouldn't have to add them by hand."+X+` Missing:
|
|
257
267
|
`+Y.join(`
|
|
258
268
|
`)+"\n\nRe-present with each feature carrying its category as `category` (or `cluster` \u2014 both "+"work; e.g. AUTH, SEARCH, DATA, INTEL, BILLING \u2026) and `priority` (0 = P0 critical, 1 = P1 "+"high, 2 = P2 medium, 3 = P3 low)."+(Z?" Set `layer` on EVERY feature too.":"")+" Don't rely on defaults."}function I5($){if(!$?.length)return"";let Q=$.map((Y)=>Y.id?` \u2022 ${Y.title} \u2014 id: ${Y.id}`:` \u2022 ${Y.title}`),Z=$.some((Y)=>Y.id);return`
|
|
259
269
|
|
|
260
270
|
This plan created these roadmap feature(s):
|
|
261
271
|
`+Q.join(`
|
|
262
|
-
`)+
|
|
263
|
-
`)}await i5();var z=J9(),p=s(z);if(!h0(z)){let $=b0();if($.length===1)console.error(`[beacon mcp] cwd ${z} isn't a registered repo \u2014 falling back to your only Beacon workspace "${$[0].name}".`);else if($.length>1)console.error(`[beacon mcp] cwd ${z} isn't a registered repo and you have ${$.length} Beacon workspaces \u2014 can't auto-detect which. Run /beacon-init in this repo, or name the project explicitly in your request.`);else console.error(`[beacon mcp] not registering ${z} \u2014 home/non-repo dir.`)}else if(u0(p))console.error(`[beacon mcp] not registering ${z} \u2014 workspace was deleted; run /beacon-init to re-add it.`);else try{m0(z);let $=await D5(p);if(!$.ok)console.error(`[beacon mcp] db provisioning failed: ${$.error}`)}catch($){console.error(`[beacon mcp] workspace registration failed: ${$ instanceof Error?$.message:$}`)}async function E($,Q){let Z=new Headers(Q?.headers);Z.set("x-beacon-workspace",p),Z.set(v5,z);let Y=await fetch(`${a()}${$}`,{...Q,headers:Z}),X=await Y.text();if(!Y.ok)throw Error(`Beacon ${$} -> ${Y.status} ${X}`);return X?JSON.parse(X):null}function i($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function _5($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let Y=JSON.parse(Z[0]);if(Y?.error)return{content:[{type:"text",text:Y.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var D=new LQ({name:"beacon",version:"0.1.0"});D.registerTool("beacon_map",{description:"List existing features on the roadmap. Call before starting work."},async()=>{let $=await E("/api/map");return{content:[{type:"text",text:JSON.stringify($)}]}});D.registerTool("beacon_start_feature",{description:"Flag that you're working on a feature. If the title matches an existing feature it just marks it IN_PROGRESS (no category needed); if it's NEW it creates the node \u2014 and a new feature REQUIRES a `category`. Call beacon_map first so you reuse an existing feature/category instead of duplicating one.",inputSchema:{title:J.string(),id:J.string().optional().describe("node id from beacon_map (preferred)"),category:J.string().optional().describe("Domain lane for a NEW feature: AUTH | SEARCH | DATA | INTEL | BILLING | INFRA | UI | \u2026 REQUIRED when this creates a new top-level feature; reuse a category already on the board. Ignored when flagging an existing feature or nesting under a `front` (inherits the parent's)."),front:J.string().optional().describe("Title of an EXISTING parent feature to nest this under (draws the parent \u2192 child edge). It must match a real feature \u2014 it is NOT a domain tag (use `category` for the domain). A `front` that matches nothing is REJECTED; create the parent first via beacon_propose_plan."),detail:J.string().optional().describe("One-line plain-language description shown on the canvas card. Replaced later by beacon_describe_feature's markdown when the work is done."),kind:J.enum(["FEATURE","BUG"]).optional().describe("Card type when this CREATES a new node: BUG renders a typed bug card on the roadmap (use when the user is starting work on a bug, not a feature). Defaults to FEATURE; ignored when flagging an existing node."),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("Which side of the stack a NEW feature lands on. REQUIRED for a new top-level feature when the workspace has a frontend; a feature nested under a `front` inherits the parent's. Omit in pure-backend repos.")}},async({title:$,id:Q,front:Z,detail:Y,category:X,kind:H,layer:j})=>{try{let G=await i("/api/map/start",{title:$,id:Q,front:Z,detail:Y,category:X,kind:H,layer:j});return{content:[{type:"text",text:JSON.stringify(G)}]}}catch(G){return _5(G)}});D.registerTool("beacon_add_subtasks",{description:"Add N sub-tasks under an existing feature in one call. Use when the user says 'add these as subtasks to <feature>' or you want to record follow-ups discovered during work. Parent resolves by `parentId` (preferred \u2014 get it from beacon_map / beacon_entities) or by `parentTitle` (fuzzy-matched against top-level features). Children inherit the parent's view and cluster and land in a row beneath it; bumps the sync version so an open /map canvas refreshes.",inputSchema:{parentId:J.string().optional().describe("node id of the parent feature (preferred)"),parentTitle:J.string().optional().describe("fuzzy title of the parent feature; ignored if parentId is provided"),items:J.array(J.object({title:J.string().describe("short sub-task title"),plain:J.string().optional().describe("one-paragraph description / why / acceptance hint"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG for a bug discovered during work \u2014 renders as a typed bug card; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the sub-task lands on; defaults to the parent's layer")})).describe("the sub-tasks to add")}},async({parentId:$,parentTitle:Q,items:Z})=>{try{let Y=await i("/api/nodes/subtasks",{parentId:$,parentTitle:Q,items:Z});return{content:[{type:"text",text:JSON.stringify(Y)}]}}catch(Y){return _5(Y)}});var R9=J.array(J.object({title:J.string().describe("real component/subsystem name (e.g. 'Plan review loop') \u2014 NEVER a file"),domain:J.string().describe("uppercase lane: PLAN | DATA | UI | MCP | INTEL | \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the component lives on (only when the repo has a frontend); omitting it on an update keeps the prior value"),status:J.enum(["KEEP","REBUILD","REPLACE","DROP"]).optional(),files:J.array(J.string()).optional(),depends:J.array(J.string()).optional().describe("titles of components this one depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found in this component's code \u2014 flagged on the node (by=agent); identical open flags are not duplicated")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file");D.registerTool("beacon_describe_feature",{description:"Register shipped feature(s) at the end of the work: marks status=DONE, records the files touched (kept on the FEATURE for context), and replaces each node's description with your markdown. Subsumes touch_files + finish_feature. A feature's unfinished SUB-TASKS are completed along with it (cascade; reported as `subtasksCompleted`) \u2014 if a sub-task is genuinely NOT done, set it BLOCKED or CANCELLED via the nodes API/board FIRST, those are left alone (`subtasksBlocked` lists what stayed). REGISTER ALL FEATURES A PLAN CREATED IN ONE CALL via the `features` array (one entry per feature) \u2014 do NOT call this once per feature. Pass each feature's `id` (returned to you at plan approval) so no title-matching is needed. For a single feature you may pass the top-level fields instead. Pass `architecture` only when a feature added/changed a REAL subsystem (never a file).",inputSchema:{features:J.array(J.object({id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),description:J.string().describe("Markdown: ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches"),architecture:R9})).optional().describe("Register many features at once \u2014 one entry per feature, each id-keyed. Use this instead of N separate calls."),description:J.string().optional().describe("Single-feature markdown (omit when using `features`): ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches (single form)"),id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),architecture:R9}},async({features:$,description:Q,files:Z,id:Y,title:X,architecture:H})=>{let j=$?.length?{features:$}:{description:Q,files:Z,id:Y,title:X,architecture:H},G=await i("/api/map/describe",j);return{content:[{type:"text",text:JSON.stringify(G)}]}});D.registerTool("beacon_init_persist",{description:"Use ONLY inside the `beacon-init` skill. After YOU (Claude Code) have read the repo and built the architecture analysis, call this once to persist it into Beacon. Replaces any prior init-derived map. Same DB shape as `beacon_propose_plan` for tables/endpoints, but it commits directly (no /plan review step) because the user explicitly invoked init.",inputSchema:{overview:J.string().optional().describe("one-paragraph summary of the project \u2014 written to ProjectMeta + AGENTS.md"),conventions:J.array(J.string()).optional().describe("3-8 concrete conventions/gotchas a contributor must follow"),hasFrontend:J.boolean().optional().describe("Whether this repo has a frontend surface (UI code) \u2014 you just read the repo, so you know. Gates the per-item `layer` requirement + the layer UI on the boards. Set it explicitly (true or false); omitting leaves Beacon to detect it from the code graph."),classificationRoots:J.array(J.string()).optional().describe("Top-level dirs whose immediate children are the meaningful groups on the Files canvas \u2014 e.g. ['frontend','backend/app']. The canvas groups files ONE level below each (so 'frontend' \u2192 'frontend/components', 'frontend/app', \u2026). Pick the dir sitting directly ABOVE the real package dirs (use 'frontend/src' if there's a src/ wrapper). Not every dir \u2014 just where grouping should start. Omit for a simple single-root repo (the canvas auto-groups)."),components:J.array(J.object({title:J.string(),domain:J.string().describe("short UPPERCASE area: AUTH, API, DATA, UI, JOBS, INFRA, \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the component lives on \u2014 set it when hasFrontend is true"),files:J.array(J.string()).optional().describe("repo-relative key files"),depends:J.array(J.string()).optional().describe("titles of other components it depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found while examining this component \u2014 flagged on the node (by=agent)")})).describe("8-25 main building blocks, not every file"),roadmap:J.array(J.object({title:J.string(),why:J.string().optional(),category:J.string().optional().describe("category for the board (AUTH | SEARCH | DATA | INTEL | \u2026) \u2014 set it so the item isn't category-less"),priority:J.number().int().min(0).max(3).optional().describe("0=P0 critical .. 3=P3 low"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when the survey found a concrete bug to fix \u2014 renders as a typed bug card; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the item lands on \u2014 set it when hasFrontend is true")})).optional().describe("3-6 broad strategic directions (NOT detailed tasks); each with a `category` + `priority`. Re-runs DEDUPE roadmap features by title, so re-persisting won't double up existing ones."),snapshot:J.object({tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string(),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}).optional().describe("optional: also seed /db with the schema you discovered from prisma/SQLAlchemy/etc.")}},async($)=>{let Q=await i("/api/init",$);return{content:[{type:"text",text:JSON.stringify(Q)}]}});D.registerTool("beacon_context_for_feature",{description:"Use BEFORE Glob/Grep/Read when starting work on a feature. Returns a single bundle of everything Beacon knows about it: attached files, what those files import + what imports them (1-hop blast radius from the live code graph), endpoints in the feature's domain + the tables each touches, those tables' FK relations, sibling architecture components, and the project's conventions. Saves an entire discovery-phase round of file reads. Match by id (preferred), exact title, or a natural-language query.",inputSchema:{id:J.string().optional().describe("node id from beacon_map (preferred)"),title:J.string().optional().describe("feature title (case-insensitive contains)"),query:J.string().optional().describe("natural-language phrase \u2014 OR-matched against title + plain description")}},async({id:$,title:Q,query:Z})=>{let Y=new URLSearchParams;if($)Y.set("id",$);if(Q)Y.set("title",Q);if(Z)Y.set("query",Z);let X=await E(`/api/context/feature?${Y.toString()}`);return{content:[{type:"text",text:JSON.stringify(X)}]}});D.registerTool("beacon_blast_radius",{description:"For 'if I change this file, what else cares?' \u2014 returns the file's 1-hop imports + importedBy, the TRANSITIVE blast radius both directions (downstream = who depends on it, upstream = what it depends on, grouped by depth), hub/centrality scoring (inDegree/outDegree + isHub), and every feature/component that has the file attached. Use mid-feature when deciding the impact of a change, or before refactoring a hub file.",inputSchema:{path:J.string().describe("repo-relative POSIX file path"),depth:J.number().optional().describe("how far to walk the transitive graph (default 2, capped at 5)")}},async({path:$,depth:Q})=>{let Z=new URLSearchParams({path:$});if(Q!=null)Z.set("depth",String(Q));let Y=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(Y)}]}});D.registerTool("beacon_entities",{description:"Read planning data. `features` = roadmap, `architecture` = components, `tables`/`endpoints` = DB map.",inputSchema:{kind:J.enum(["features","architecture","tables","endpoints"])}},async({kind:$})=>{let Q=await E(`/api/entities?kind=${$}`);return{content:[{type:"text",text:JSON.stringify(Q)}]}});D.registerTool("beacon_propose_plan",{description:"BLOCKS until the user reviews. Pushes a feature plan (top-level roadmap features + DB tables + endpoints) to Beacon's /plan page. Use when the user asks you to plan a feature. EVERY feature MUST include `cluster` (its category) and `priority` (0=P0 critical .. 3=P3 low) \u2014 and, when the workspace has a frontend, `layer` (frontend | backend | fullstack). The tool REJECTS a plan whose features omit any required field, so set them on every feature. Do not implement code or migrations until this returns approval. If it returns inline feedback, revise and call again.",inputSchema:{description:J.string().describe("Short summary the user will see in the review header"),features:J.array(J.object({title:J.string(),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence for the user"),category:J.string().optional().describe("REQUIRED category for the board (AUTH | SEARCH | BILLING | DATA | INTEL | \u2026)"),cluster:J.string().optional().describe("alias for `category`"),domain:J.string().optional().describe("alias for `category`"),priority:J.number().int().min(0).max(3).optional().describe("REQUIRED priority: 0=P0 critical, 1=P1 high, 2=P2 medium, 3=P3 low"),dependsOn:J.array(J.string()).optional().describe("titles of other features in THIS plan that must ship first \u2014 drawn as 'depends on' links so the board shows the dependency chain, not loose cards"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when this roadmap item is a bug to fix \u2014 renders as a typed bug card; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("Which side of the stack the work lands on. REQUIRED on every feature when the workspace has a frontend (the tool rejects the plan otherwise); omit in pure-backend repos.")})).optional().describe("the top-level roadmap features this plan adds"),tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string().describe("GET|POST|PUT|PATCH|DELETE"),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional(),contract:J.array(J.string()).optional().describe("Repo-relative files THIS plan will touch \u2014 the scope contract. When the user has the plan scope-guard enabled, these are frozen at approval and you are held to them while implementing: editing an undeclared file pauses for the user's authorization (which adds it to the contract). Safe to always include; ignored when the guard is off.")}},async({description:$,features:Q,tables:Z,relations:Y,endpoints:X,contract:H})=>{let j=(q)=>new Promise((B0)=>setTimeout(B0,q)),G=(q)=>({content:[{type:"text",text:q}]}),W=(Z?.length??0)>0,w=(Q??[]).map((q)=>`${q.title} ${q.role??""} ${q.plain??""}`).join(`
|
|
264
|
-
`),
|
|
265
|
-
${w}`);if(!W&&
|
|
272
|
+
`)+'\n\nWhen the work ships, register them in ONE call: `beacon_feature({ action: "done" })` with a '+"`features` array \u2014 one entry per feature"+(Z?", 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{readFileSync as RQ}from"fs";import{join as AQ}from"path";function EQ(){try{return JSON.parse(RQ(AQ(_(),"server.json"),"utf8"))}catch{return null}}function i(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${EQ()?.port||process.env.PORT||G9}`}import{execSync as IQ}from"child_process";import{platform as C9}from"os";function TQ($){if(process.env.BEACON_NO_OPEN)return;let Q=C9()==="darwin"?"open":C9()==="win32"?"start":"xdg-open";try{IQ(`${Q} "${$}"`,{stdio:"ignore"})}catch{}}async function T5($,Q){if(await fetch(`${$}/api/plan/presence`,{headers:{"x-beacon-workspace":Q}}).then((X)=>X.json()).then((X)=>!!X?.live).catch(()=>!1))return;let Y=encodeURIComponent(`/plan?ws=${Q}`);TQ(`${$}/api/workspace/activate?id=${Q}&redirect=${Y}`)}n0();function W0($){return $.toLowerCase().normalize("NFD").replace(/[\u0300-\u036F]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50)||"item"}function v9($){return`${W0($.title)}-${$.id.slice(-6)}`}function F9($){return{resources:$.map((Q)=>({uri:`note://${v9(Q)}`,name:Q.title||"Untitled",description:`${Q.title||"Untitled"}${Q.pinned?" \xB7 pinned":""} \xB7 note`,mimeType:"text/markdown"}))}}function D9($,Q){return $.find((Z)=>v9(Z)===Q)}function O9($){let Q=$.body.trim()||"(this note is empty)";return[`# ${$.title||"Untitled"}`,"","_User note from Beacon. To turn it into roadmap work, call `beacon_propose_plan` \u2014"+" checkbox `- [ ]` / `- [x]` items become subtasks, and order the features with `dependsOn`. Do NOT implement until it returns approval._","","---","",Q].join(`
|
|
273
|
+
`)}await i5();var S=Z9(),p=o(S);if(!h0(S)){let $=f0();if($.length===1)console.error(`[beacon mcp] cwd ${S} isn't a registered repo \u2014 falling back to your only Beacon workspace "${$[0].name}".`);else if($.length>1)console.error(`[beacon mcp] cwd ${S} isn't a registered repo and you have ${$.length} Beacon workspaces \u2014 can't auto-detect which. Run /beacon-init in this repo, or name the project explicitly in your request.`);else console.error(`[beacon mcp] not registering ${S} \u2014 home/non-repo dir.`)}else if(g0(p))console.error(`[beacon mcp] not registering ${S} \u2014 workspace was deleted; run /beacon-init to re-add it.`);else try{b0(S);let $=await D5(p);if(!$.ok)console.error(`[beacon mcp] db provisioning failed: ${$.error}`)}catch($){console.error(`[beacon mcp] workspace registration failed: ${$ instanceof Error?$.message:$}`)}async function E($,Q){let Z=new Headers(Q?.headers);Z.set("x-beacon-workspace",p),Z.set(v5,S);let Y=await fetch(`${i()}${$}`,{...Q,headers:Z}),X=await Y.text();if(!Y.ok)throw Error(`Beacon ${$} -> ${Y.status} ${X}`);return X?JSON.parse(X):null}function d0($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function E9($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let Y=JSON.parse(Z[0]);if(Y?.error)return{content:[{type:"text",text:Y.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var R=new LQ({name:"beacon",version:"0.1.0"});R.registerTool("beacon_map",{description:"List the roadmap: every feature + its sub-tasks with `category`, `priority`, `layer`, `kind`, and `status`. Call this BEFORE creating anything with `beacon_feature` \u2014 it's the cheap way to learn which categories already exist (reuse one instead of inventing a synonym) and whether a card already exists. You do NOT need `beacon_entities` just to see categories."},async()=>{let $=await E("/api/map");return{content:[{type:"text",text:JSON.stringify($)}]}});var R9=J.array(J.object({title:J.string().describe("real component/subsystem name (e.g. 'Plan review loop') \u2014 NEVER a file"),domain:J.string().describe("uppercase lane: PLAN | DATA | UI | MCP | INTEL | \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the component lives on (only when the repo has a frontend); omitting it on an update keeps the prior value"),status:J.enum(["KEEP","REBUILD","REPLACE","DROP"]).optional(),files:J.array(J.string()).optional(),depends:J.array(J.string()).optional().describe("titles of components this one depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found in this component's code \u2014 flagged on the node (by=agent); identical open flags are not duplicated")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file");R.registerTool("beacon_feature",{description:'Manage a roadmap feature\'s whole lifecycle in ONE tool \u2014 no approval gate (that\'s `beacon_propose_plan`/`beacon_present_plan`). `action:"add"` puts a card on the board, defaulting to BACKLOG/PENDING (pass `status:"active"` to start it now); `"start"` marks an existing card IN_PROGRESS (create-or-flag); `"subtasks"` adds child tasks under a card; `"done"` completes feature(s) and registers the files/architecture touched (marks DONE + cascades to sub-tasks). A NEW card REQUIRES `category` + `priority` (and `layer` when the workspace has a frontend). Call `beacon_map` FIRST \u2014 it lists every card\'s category/priority/layer/status, so reuse a category and don\'t duplicate a card. `add` never activates an existing match \u2014 it returns `exists` so you can reuse it.',inputSchema:{action:J.enum(["add","start","subtasks","done"]).describe("add = put a card on the board (defaults to BACKLOG/PENDING); start = mark an existing card IN_PROGRESS; subtasks = add child tasks under a card; done = complete feature(s) + register files/architecture."),title:J.string().optional().describe("card title (add/start); for done's single form, the feature title (id preferred)."),id:J.string().optional().describe("node id from beacon_map (preferred over title) \u2014 start/done, or add to reference a known card."),category:J.string().optional().describe("REQUIRED for a NEW card (add/start): domain lane \u2014 AUTH | SEARCH | DATA | INTEL | BILLING | INFRA | UI | \u2026 Reuse one from beacon_map; ignored when matching an existing card or nesting under a `front`."),priority:J.number().int().min(0).max(3).optional().describe("priority of a NEW card (add/start): 0=P0 critical .. 3=P3 low. Defaults to P2."),front:J.string().optional().describe("title of an EXISTING parent feature to nest a NEW card under (add/start). NOT a domain tag (use `category`); a `front` matching nothing is REJECTED."),detail:J.string().optional().describe("one-line plain-language description shown on the card (add/start)."),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG renders a typed bug card; defaults to FEATURE (add/start)."),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack a NEW card lands on (add/start). REQUIRED when the workspace has a frontend; a card nested under a `front` inherits the parent's. Omit in pure-backend repos."),status:J.enum(["backlog","active"]).optional().describe(`add only: "backlog" (default) creates a PENDING card you're not working on yet; "active" creates it IN_PROGRESS.`),parentId:J.string().optional().describe("subtasks: node id of the parent card (preferred)."),parentTitle:J.string().optional().describe("subtasks: fuzzy title of the parent card; ignored if parentId is given."),items:J.array(J.object({title:J.string().describe("short sub-task title"),plain:J.string().optional().describe("one-paragraph description / why / acceptance hint"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG for a bug discovered during work; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the sub-task lands on; defaults to the parent's layer")})).optional().describe("subtasks: the child tasks to add under the parent."),features:J.array(J.object({id:J.string().optional().describe("node id from plan approval / beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),description:J.string().describe("Markdown: ### Overview ... ### Files - `path` \u2014 what it does"),files:J.array(J.string()).optional().describe("repo-relative files this feature touches"),architecture:R9})).optional().describe("done: register MANY features at once \u2014 one entry per feature the plan created, each id-keyed. Use this instead of N separate calls."),description:J.string().optional().describe("done (single form, omit when using `features`): the markdown summary of the shipped feature."),files:J.array(J.string()).optional().describe("done (single form): repo-relative files the feature touched."),architecture:R9}},async($)=>{try{let{path:Q,body:Z}=q9($.action,$),Y=await d0(Q,Z);return{content:[{type:"text",text:JSON.stringify(Y)}]}}catch(Q){return E9(Q)}});R.registerTool("beacon_init_persist",{description:"Use ONLY inside the `beacon-init` skill. After YOU (Claude Code) have read the repo and built the architecture analysis, call this once to persist it into Beacon. Replaces any prior init-derived map. Same DB shape as `beacon_propose_plan` for tables/endpoints, but it commits directly (no /plan review step) because the user explicitly invoked init.",inputSchema:{overview:J.string().optional().describe("one-paragraph summary of the project \u2014 written to ProjectMeta + AGENTS.md"),conventions:J.array(J.string()).optional().describe("3-8 concrete conventions/gotchas a contributor must follow"),hasFrontend:J.boolean().optional().describe("Whether this repo has a frontend surface (UI code) \u2014 you just read the repo, so you know. Gates the per-item `layer` requirement + the layer UI on the boards. Set it explicitly (true or false); omitting leaves Beacon to detect it from the code graph."),classificationRoots:J.array(J.string()).optional().describe("Top-level dirs whose immediate children are the meaningful groups on the Files canvas \u2014 e.g. ['frontend','backend/app']. The canvas groups files ONE level below each (so 'frontend' \u2192 'frontend/components', 'frontend/app', \u2026). Pick the dir sitting directly ABOVE the real package dirs (use 'frontend/src' if there's a src/ wrapper). Not every dir \u2014 just where grouping should start. Omit for a simple single-root repo (the canvas auto-groups)."),components:J.array(J.object({title:J.string(),domain:J.string().describe("short UPPERCASE area: AUTH, API, DATA, UI, JOBS, INFRA, \u2026"),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the component lives on \u2014 set it when hasFrontend is true"),files:J.array(J.string()).optional().describe("repo-relative key files"),depends:J.array(J.string()).optional().describe("titles of other components it depends on"),bugs:J.array(J.object({note:J.string().describe("what was found / worth investigating")})).optional().describe("bugs or things worth investigating you found while examining this component \u2014 flagged on the node (by=agent)")})).describe("8-25 main building blocks, not every file"),roadmap:J.array(J.object({title:J.string(),why:J.string().optional(),category:J.string().optional().describe("category for the board (AUTH | SEARCH | DATA | INTEL | \u2026) \u2014 set it so the item isn't category-less"),priority:J.number().int().min(0).max(3).optional().describe("0=P0 critical .. 3=P3 low"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when the survey found a concrete bug to fix \u2014 renders as a typed bug card; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("which side of the stack the item lands on \u2014 set it when hasFrontend is true")})).optional().describe("3-6 broad strategic directions (NOT detailed tasks); each with a `category` + `priority`. Re-runs DEDUPE roadmap features by title, so re-persisting won't double up existing ones."),snapshot:J.object({tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string(),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional()}).optional().describe("optional: also seed /db with the schema you discovered from prisma/SQLAlchemy/etc.")}},async($)=>{let Q=await d0("/api/init",$);return{content:[{type:"text",text:JSON.stringify(Q)}]}});R.registerTool("beacon_context_for_feature",{description:"Use BEFORE Glob/Grep/Read when starting work on a feature. Returns a single bundle of everything Beacon knows about it: attached files, what those files import + what imports them (1-hop blast radius from the live code graph), endpoints in the feature's domain + the tables each touches, those tables' FK relations, sibling architecture components, and the project's conventions. Saves an entire discovery-phase round of file reads. Match by id (preferred), exact title, or a natural-language query.",inputSchema:{id:J.string().optional().describe("node id from beacon_map (preferred)"),title:J.string().optional().describe("feature title (case-insensitive contains)"),query:J.string().optional().describe("natural-language phrase \u2014 OR-matched against title + plain description")}},async({id:$,title:Q,query:Z})=>{let Y=new URLSearchParams;if($)Y.set("id",$);if(Q)Y.set("title",Q);if(Z)Y.set("query",Z);let X=await E(`/api/context/feature?${Y.toString()}`);return{content:[{type:"text",text:JSON.stringify(X)}]}});R.registerTool("beacon_blast_radius",{description:"For 'if I change this file, what else cares?' \u2014 returns the file's 1-hop imports + importedBy, the TRANSITIVE blast radius both directions (downstream = who depends on it, upstream = what it depends on, grouped by depth), hub/centrality scoring (inDegree/outDegree + isHub), and every feature/component that has the file attached. Use mid-feature when deciding the impact of a change, or before refactoring a hub file.",inputSchema:{path:J.string().describe("repo-relative POSIX file path"),depth:J.number().optional().describe("how far to walk the transitive graph (default 2, capped at 5)")}},async({path:$,depth:Q})=>{let Z=new URLSearchParams({path:$});if(Q!=null)Z.set("depth",String(Q));let Y=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(Y)}]}});R.registerTool("beacon_entities",{description:"Read raw planning data: `features` (roadmap), `architecture` (components), `tables`/`endpoints` (DB map). Descriptions are truncated to ~160 chars by default to stay within the tool-result limit \u2014 pass `full:true` for complete text and `limit` to cap rows. For just titles + categories + status, prefer the lighter `beacon_map`.",inputSchema:{kind:J.enum(["features","architecture","tables","endpoints"]),full:J.boolean().optional().describe("return complete descriptions instead of the truncated default (features/architecture)"),limit:J.number().int().positive().optional().describe("cap the number of rows returned")}},async({kind:$,full:Q,limit:Z})=>{let Y=new URLSearchParams({kind:$});if(Q)Y.set("full","1");if(Z)Y.set("limit",String(Z));let X=await E(`/api/entities?${Y.toString()}`);return{content:[{type:"text",text:JSON.stringify(X)}]}});R.registerTool("beacon_propose_plan",{description:"BLOCKS until the user reviews. Pushes a feature plan (top-level roadmap features + DB tables + endpoints) to Beacon's /plan page. Use when the user asks you to plan a feature. EVERY feature MUST include `cluster` (its category) and `priority` (0=P0 critical .. 3=P3 low) \u2014 and, when the workspace has a frontend, `layer` (frontend | backend | fullstack). The tool REJECTS a plan whose features omit any required field, so set them on every feature. Do not implement code or migrations until this returns approval. If it returns inline feedback, revise and call again.",inputSchema:{description:J.string().describe("Short summary the user will see in the review header"),features:J.array(J.object({title:J.string(),role:J.string().optional().describe("one-line technical role"),plain:J.string().optional().describe("one plain-language sentence for the user"),category:J.string().optional().describe("REQUIRED category for the board (AUTH | SEARCH | BILLING | DATA | INTEL | \u2026)"),cluster:J.string().optional().describe("alias for `category`"),domain:J.string().optional().describe("alias for `category`"),priority:J.number().int().min(0).max(3).optional().describe("REQUIRED priority: 0=P0 critical, 1=P1 high, 2=P2 medium, 3=P3 low"),dependsOn:J.array(J.string()).optional().describe("titles of other features in THIS plan that must ship first \u2014 drawn as 'depends on' links so the board shows the dependency chain, not loose cards"),kind:J.enum(["FEATURE","BUG"]).optional().describe("BUG when this roadmap item is a bug to fix \u2014 renders as a typed bug card; defaults to FEATURE"),layer:J.enum(["frontend","backend","fullstack"]).optional().describe("Which side of the stack the work lands on. REQUIRED on every feature when the workspace has a frontend (the tool rejects the plan otherwise); omit in pure-backend repos.")})).optional().describe("the top-level roadmap features this plan adds"),tables:J.array(J.object({name:J.string(),domain:J.string().optional(),description:J.string().optional(),columns:J.array(J.object({name:J.string(),type:J.string(),isPk:J.boolean().optional(),isFk:J.boolean().optional(),nullable:J.boolean().optional(),note:J.string().optional()}))})).optional(),relations:J.array(J.object({fromTable:J.string(),fromColumn:J.string(),toTable:J.string(),toColumn:J.string(),label:J.string().optional()})).optional(),endpoints:J.array(J.object({method:J.string().describe("GET|POST|PUT|PATCH|DELETE"),path:J.string(),domain:J.string().optional(),description:J.string().optional(),uses:J.array(J.object({table:J.string(),access:J.string().optional()})).optional()})).optional(),contract:J.array(J.string()).optional().describe("Repo-relative files THIS plan will touch \u2014 the scope contract. When the user has the plan scope-guard enabled, these are frozen at approval and you are held to them while implementing: editing an undeclared file pauses for the user's authorization (which adds it to the contract). Safe to always include; ignored when the guard is off.")}},async({description:$,features:Q,tables:Z,relations:Y,endpoints:X,contract:H})=>{let j=(q)=>new Promise((U0)=>setTimeout(U0,q)),G=(q)=>({content:[{type:"text",text:q}]}),W=(Z?.length??0)>0,w=(Q??[]).map((q)=>`${q.title} ${q.role??""} ${q.plain??""}`).join(`
|
|
274
|
+
`),a=(X?.length??0)>0||P9(`${$}
|
|
275
|
+
${w}`);if(!W&&a)return G("\u26D4 This plan touches the database \u2014 it declares endpoints and/or its text describes "+"models/tables/migrations \u2014 but you passed NO `tables`. Beacon's schema board renders "+"ONLY from structured `tables`; prose is never parsed, so the /db tab would be empty and nothing would persist on approve.\n\nRe-call `beacon_propose_plan` with every table in `tables` (each with its `columns`), the `relations` (FKs), and keep the `endpoints` (each with `uses:[{table,access}]`). Mirror EVERY database entity your plan mentions into the structured fields.");if(Q?.length){let q=await E("/api/project-meta").then((y9)=>!!y9?.hasFrontend).catch(()=>!1),U0=w9(Q,{requireLayer:q});if(U0)return G(U0)}let _9=(Z?.length??0)+(X?.length??0)>0;try{await d0("/api/plan",{description:$,draft:_9?{tables:Z??[],relations:Y??[],endpoints:X??[]}:void 0,features:Q?.length?Q:void 0,contract:H?.length?H:void 0})}catch(q){return E9(q)}await fetch(`${i()}/api/workspace/activate?id=${p}`).catch(()=>{}),await T5(i(),p);let k9=Date.now()+s0;while(Date.now()<k9){await j(o0);let q=await E("/api/plan/verdict").catch(()=>null);if(!q)continue;if(q.kind==="feedback")return G("\uD83D\uDCAC The user left feedback on the plan in Beacon \u2014 text comments and/or edits they "+"made directly on the /map and /db boards. Read everything below, revise the plan accordingly (matching the board changes verbatim), and call `beacon_propose_plan` "+`again with the revised version \u2014 DO NOT implement yet:
|
|
266
276
|
|
|
267
277
|
`+q.feedback);if(q.kind==="approved")return G(`\u2705 Plan approved by the user. ${q.summary}`+(q.detail?`
|
|
268
278
|
|
|
269
279
|
Implement EXACTLY the schema below (migrations + code) \u2014 the user may have `+`edited columns on the canvas:
|
|
270
280
|
|
|
271
|
-
`+q.detail:"")+I5(q.features));if(q.kind==="discarded")return G(`\u274C The user discarded the plan in Beacon. ${q.summary} Ask what they want to adjust before proposing again.`)}return G("Still waiting for the user to review in Beacon. Your plan is preserved \u2014 call "+"`beacon_propose_plan` again with the SAME plan to resume (the verdict is picked up immediately if they've since decided), or ask whether they've reviewed it.")});
|
|
281
|
+
`+q.detail:"")+I5(q.features));if(q.kind==="discarded")return G(`\u274C The user discarded the plan in Beacon. ${q.summary} Ask what they want to adjust before proposing again.`)}return G("Still waiting for the user to review in Beacon. Your plan is preserved \u2014 call "+"`beacon_propose_plan` again with the SAME plan to resume (the verdict is picked up immediately if they've since decided), or ask whether they've reviewed it.")});R.registerTool("beacon_present_plan",{description:"BLOCKS until the user reviews. Pushes ANY plan (as markdown) to Beacon's /plan page so the user reviews it on the canvas instead of in the terminal \u2014 use this whenever you'd otherwise end a turn asking 'does this look right / should I proceed?'. Embed ONE fenced ```beacon block of JSON ({tables,relations,endpoints,features}) for any DB/roadmap entities so they render as an editable board. Returns the verdict (approved / discarded / feedback). Do NOT implement until it returns approval; on feedback, revise and call again. (For a pure schema+features plan, beacon_propose_plan is the structured alternative.)",inputSchema:{description:J.string().describe("One-line summary shown in the review header"),markdown:J.string().describe("The full plan as markdown. Embed a ```beacon block for tables/endpoints/features.")}},async({description:$,markdown:Q})=>{let Z=(H)=>new Promise((j)=>setTimeout(j,H)),Y=(H)=>({content:[{type:"text",text:H}]});await d0("/api/plan",{description:$,markdown:Q}),await fetch(`${i()}/api/workspace/activate?id=${p}`).catch(()=>{}),await T5(i(),p);let X=Date.now()+s0;while(Date.now()<X){await Z(o0);let H=await E("/api/plan/verdict").catch(()=>null);if(!H)continue;if(H.kind==="feedback")return Y("\uD83D\uDCAC The user left feedback on the plan in Beacon (inline comments and/or edits on the "+"/map and /db boards). Revise the plan accordingly and call `beacon_present_plan` "+`again \u2014 do NOT implement yet:
|
|
272
282
|
|
|
273
283
|
`+H.feedback);if(H.kind==="approved")return Y(`\u2705 Plan approved by the user. ${H.summary??""}`.trim()+(H.detail?`
|
|
274
284
|
|
|
275
285
|
Implement exactly what's on the board:
|
|
276
286
|
|
|
277
|
-
${H.detail}`:"")+I5(H.features));if(H.kind==="discarded")return Y(`\u274C The user discarded the plan in Beacon. ${H.summary??""} Ask what they want to adjust before presenting again.`.trim())}return Y("Still waiting for the user to review in Beacon. Your plan is preserved \u2014 call "+"`beacon_present_plan` again with the SAME plan to resume, or ask whether they've reviewed it.")});var
|
|
278
|
-
`)}]}}
|
|
287
|
+
${H.detail}`:"")+I5(H.features));if(H.kind==="discarded")return Y(`\u274C The user discarded the plan in Beacon. ${H.summary??""} Ask what they want to adjust before presenting again.`.trim())}return Y("Still waiting for the user to review in Beacon. Your plan is preserved \u2014 call "+"`beacon_present_plan` again with the SAME plan to resume, or ask whether they've reviewed it.")});var I9=($)=>Array.isArray($)?$[0]:$;async function l0($){return(await E(`/api/entities?kind=${$}&full=1`)).items}function T9($,Q){return{resources:$.map((Z)=>({uri:`${Q}${W0(Z.title)}`,name:Z.title,description:`${Z.title}${Z.cluster?` \xB7 ${Z.cluster}`:""} \xB7 ${Z.status}`,mimeType:"text/markdown"}))}}async function L9($,Q,Z){let Y=(await l0(Z)).find((G)=>W0(G.title)===I9(Q));if(!Y)return{contents:[{uri:$.href,mimeType:"text/markdown",text:"(not found)"}]};let H=((await E("/api/entities?kind=tables")).items??[]).map((G)=>G.name),j=[`# ${Y.title}`];if(Y.cluster)j.push(`*Domain:* \`${Y.cluster}\``);if(Y.status)j.push(`*Status:* \`${Y.status}\``);if(j.push(""),j.push(Y.plain?.trim()||"(this node has no description yet \u2014 add one on Beacon's /map page)"),j.push("","## Existing DB tables in this project"),j.push(H.length?H.join(", "):"(none yet)"),Z==="features"){let G=await l0("features"),W=[...new Set(G.map((w)=>w.cluster?.trim()).filter((w)=>!!w))].sort();j.push("","## Existing feature categories \u2014 reuse one before inventing a new one"),j.push(W.length?W.join(", "):"(none yet)"),j.push("","## Beacon feature loop \u2014 follow IN ORDER (do not jump to Glob/Grep/Read)","1. **Load context FIRST.** Call `beacon_context_for_feature({ title })` for this feature BEFORE any Glob/Grep/Read. It returns the attached files, 1-hop import blast radius, the domain's endpoints + tables + FK relations, sibling components, and the project conventions \u2014 and marks this feature active so your edits attach to it. That bundle replaces the discovery phase; Glob is a last resort.","2. **Design data before code.** Identify the tables this feature needs. If ANY are missing from the list above, design the schema and call `beacon_propose_plan` (tables + relations + endpoints, each endpoint with `uses:[{table,access}]`). It BLOCKS until the user approves on /plan \u2014 do NOT write migrations or code until it returns approval.","3. **Register at the end \u2014 in ONE call.** When the work is done, call `beacon_feature({ action: \"done\" })` ONCE with a `features` array (one entry per feature the plan created, each keyed by the `id` you got back at approval, with the files you touched + a short markdown summary). Don't make one call per feature, and don't register only the umbrella \u2014 that leaves the rest Pending.")}return{contents:[{uri:$.href,mimeType:"text/markdown",text:j.join(`
|
|
288
|
+
`)}]}}R.registerResource("beacon-feature",new L5("feature://{slug}",{list:async()=>T9(await l0("features"),"feature://")}),{title:"Beacon: features",description:"Roadmap features \u2014 picking one imports the node's description plus existing-DB context.",mimeType:"text/markdown"},($,{slug:Q})=>L9($,Q,"features"));R.registerResource("beacon-component",new L5("component://{slug}",{list:async()=>T9(await l0("architecture"),"component://")}),{title:"Beacon: architecture",description:"Architecture components \u2014 picking one imports 'what the agent sees'.",mimeType:"text/markdown"},($,{slug:Q})=>L9($,Q,"architecture"));async function A9(){return await E("/api/notes")}R.registerResource("beacon-note",new L5("note://{slug}",{list:async()=>F9(await A9())}),{title:"Beacon: notes",description:"Your Beacon notes \u2014 picking one imports its markdown verbatim so you can turn it into features.",mimeType:"text/markdown"},async($,{slug:Q})=>{let Z=D9(await A9(),I9(Q)),Y=Z?O9(Z):"(not found)";return{contents:[{uri:$.href,mimeType:"text/markdown",text:Y}]}});await R.connect(new _Q);var c0=-1;setInterval(async()=>{try{let{version:$}=await E("/api/version");if(c0===-1)c0=$;else if($!==c0)c0=$,R.sendResourceListChanged()}catch{}},_5);
|