trybeacon 0.1.8 → 0.1.10
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 +20 -18
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +14 -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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- 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 -0
- package/.next/server/app/api/board-annotations/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/board-annotations/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/board-annotations/route.js +1 -0
- package/.next/server/app/api/board-annotations/route.js.nft.json +1 -0
- package/.next/server/app/api/board-annotations/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/code-graph/position/route.js +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/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/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 +2 -2
- package/.next/server/app/api/draft/approve/route.js.nft.json +1 -1
- package/.next/server/app/api/draft/route.js +2 -2
- 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/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/feedback/[id]/route.js +1 -1
- package/.next/server/app/api/feedback/[id]/vote/route.js +1 -1
- package/.next/server/app/api/feedback/route.js +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/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/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/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/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 +2 -2
- 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/reset/route.js +1 -1
- package/.next/server/app/api/reset/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +1 -1
- 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/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/apple-icon.png/route.js +1 -1
- package/.next/server/app/docs/page.js +2 -2
- 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 +2 -2
- package/.next/server/app/docs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +2 -2
- package/.next/server/app/feedback.segments/_full.segment.rsc +2 -2
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +2 -2
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +2 -2
- package/.next/server/app/help.segments/_full.segment.rsc +2 -2
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +2 -2
- package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- 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 +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- 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_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/settings/page.js +2 -2
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +20 -18
- package/.next/server/chunks/1130.js +1 -1
- package/.next/server/chunks/249.js +1 -1
- package/.next/server/chunks/29.js +2 -2
- package/.next/server/chunks/2933.js +3 -3
- package/.next/server/chunks/3349.js +1 -0
- package/.next/server/chunks/4046.js +3 -3
- package/.next/server/chunks/5259.js +1 -0
- package/.next/server/chunks/9683.js +1 -1
- package/.next/server/chunks/9734.js +1 -0
- package/.next/server/middleware-build-manifest.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/VND4o7Y3VvKm_kVx_sdWe/_buildManifest.js +1 -0
- package/.next/static/chunks/1a258343-248e24606fc4ca54.js +2 -0
- package/.next/static/chunks/9933-20810d5d4fd061ec.js +1 -0
- package/.next/static/chunks/app/_global-error/page-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/context/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/draft/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/edges/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/entities/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/init/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/notes/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/open/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/reset/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/settings/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/stream/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/version/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/app/map/page-9cf4e23f7c727202.js +1 -0
- package/.next/static/chunks/app/plan/page-24e8087dff10d6c3.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-fedcca5f9349ab93.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fedcca5f9349ab93.js +1 -0
- package/.next/static/css/ea4a42f0a9905598.css +1 -0
- package/.next/trace +37 -37
- package/.next/trace-build +1 -1
- package/.next/types/app/api/board-annotations/[id]/route.ts +351 -0
- package/.next/types/app/api/board-annotations/route.ts +351 -0
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +18 -0
- package/dist/bin/mcp.js +17 -17
- package/drizzle/0001_fluffy_venus.sql +13 -0
- package/drizzle/meta/0001_snapshot.json +1671 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/.next/server/chunks/1172.js +0 -1
- package/.next/server/chunks/2996.js +0 -1
- package/.next/server/chunks/3777.js +0 -1
- package/.next/server/chunks/4490.js +0 -1
- package/.next/server/chunks/9252.js +0 -1
- package/.next/static/chunks/1a258343-152a68da2b250652.js +0 -2
- package/.next/static/chunks/8811-57b200845c2e1f2d.js +0 -1
- package/.next/static/chunks/app/_global-error/page-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/context/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/draft/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/edges/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/entities/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/init/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/notes/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/open/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/reset/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/settings/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/stream/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/version/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/app/map/page-7c6a7f7b53bcc669.js +0 -1
- package/.next/static/chunks/app/plan/page-d281cb104d352713.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-c1b5e3c2b2451a38.js +0 -1
- package/.next/static/css/c1d125c7e7e0530c.css +0 -1
- package/.next/static/vkXAuKrDgeKgSM-4XYCAy/_buildManifest.js +0 -1
- /package/.next/static/{vkXAuKrDgeKgSM-4XYCAy → VND4o7Y3VvKm_kVx_sdWe}/_ssgManifest.js +0 -0
package/.next/types/routes.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Do not edit this file manually
|
|
3
3
|
|
|
4
4
|
type AppRoutes = "/" | "/docs" | "/feedback" | "/help" | "/map" | "/plan" | "/settings"
|
|
5
|
-
type AppRouteHandlerRoutes = "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/reset" | "/api/settings" | "/api/stream" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/reset" | "/api/settings" | "/api/stream" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
|
|
6
6
|
type PageRoutes = never
|
|
7
7
|
type LayoutRoutes = "/"
|
|
8
8
|
type RedirectRoutes = never
|
|
@@ -12,6 +12,8 @@ type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRo
|
|
|
12
12
|
|
|
13
13
|
interface ParamMap {
|
|
14
14
|
"/": {}
|
|
15
|
+
"/api/board-annotations": {}
|
|
16
|
+
"/api/board-annotations/[id]": { "id": string; }
|
|
15
17
|
"/api/code-graph": {}
|
|
16
18
|
"/api/code-graph/position": {}
|
|
17
19
|
"/api/context": {}
|
package/.next/types/validator.ts
CHANGED
|
@@ -110,6 +110,24 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
110
110
|
type __Unused = __Check
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
// Validate ../../app/api/board-annotations/[id]/route.ts
|
|
114
|
+
{
|
|
115
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/board-annotations/[id]">> = Specific
|
|
116
|
+
const handler = {} as typeof import("../../app/api/board-annotations/[id]/route.js")
|
|
117
|
+
type __Check = __IsExpected<typeof handler>
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
type __Unused = __Check
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Validate ../../app/api/board-annotations/route.ts
|
|
123
|
+
{
|
|
124
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/board-annotations">> = Specific
|
|
125
|
+
const handler = {} as typeof import("../../app/api/board-annotations/route.js")
|
|
126
|
+
type __Check = __IsExpected<typeof handler>
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
type __Unused = __Check
|
|
129
|
+
}
|
|
130
|
+
|
|
113
131
|
// Validate ../../app/api/code-graph/position/route.ts
|
|
114
132
|
{
|
|
115
133
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/code-graph/position">> = Specific
|
package/dist/bin/mcp.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var T5=Object.defineProperty;var S5=($)=>$;function h5($,Q){this[$]=S5.bind(null,Q)}var e=($,Q)=>{for(var Z in Q)T5($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:h5.bind(Q,Z)})};var b0=($,Q)=>()=>($&&(Q=$($=0)),Q);var s0={};e(s0,{removeRepoAssets:()=>b5,installRefreshSkill:()=>x5,installPlanSkill:()=>g5,installInitSkill:()=>y5,ensureWorkflowDoc:()=>f5,ensureMcp:()=>u5,auditRepo:()=>z5,REFRESH_SKILL:()=>c0,PLAN_SKILL:()=>l0,INIT_SKILL:()=>p0});import{existsSync as K0,mkdirSync as M0,readFileSync as _,rmSync as N0,writeFileSync as
|
|
3
|
+
var T5=Object.defineProperty;var S5=($)=>$;function h5($,Q){this[$]=S5.bind(null,Q)}var e=($,Q)=>{for(var Z in Q)T5($,Z,{get:Q[Z],enumerable:!0,configurable:!0,set:h5.bind(Q,Z)})};var b0=($,Q)=>()=>($&&(Q=$($=0)),Q);var s0={};e(s0,{removeRepoAssets:()=>b5,installRefreshSkill:()=>x5,installPlanSkill:()=>g5,installInitSkill:()=>y5,ensureWorkflowDoc:()=>f5,ensureMcp:()=>u5,auditRepo:()=>z5,REFRESH_SKILL:()=>c0,PLAN_SKILL:()=>l0,INIT_SKILL:()=>p0});import{existsSync as K0,mkdirSync as M0,readFileSync as _,rmSync as N0,writeFileSync as L}from"fs";import{join as C}from"path";function y5($){let Q=C($,".claude","skills","beacon-init");M0(Q,{recursive:!0});let Z=C(Q,"SKILL.md");return L(Z,p0),Z}function x5($){let Q=C($,".claude","skills","beacon-refresh");M0(Q,{recursive:!0});let Z=C(Q,"SKILL.md");return L(Z,c0),Z}function g5($){let Q=C($,".claude","skills","beacon-plan");M0(Q,{recursive:!0});let Z=C(Q,"SKILL.md");return L(Z,l0),Z}function f5($){let Q=C($,"AGENTS.md"),Z="";try{Z=_(Q,"utf8")}catch{}let X=new RegExp(`${$0}[\\s\\S]*?${W0}`);Z=X.test(Z)?Z.replace(X,m0):`${Z.trim()}
|
|
4
4
|
|
|
5
5
|
${m0}
|
|
6
|
-
`.trimStart(),
|
|
6
|
+
`.trimStart(),L(Q,Z.endsWith(`
|
|
7
7
|
`)?Z:`${Z}
|
|
8
|
-
`);let V=C($,"CLAUDE.md"),H="";try{H=_(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(H))
|
|
8
|
+
`);let V=C($,"CLAUDE.md"),H="";try{H=_(V,"utf8")}catch{}if(!/@AGENTS\.md/.test(H))L(V,`${H?`${H.trim()}
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
|
-
`)}function u5($){let Q=C($,".mcp.json"),Z={};try{Z=JSON.parse(_(Q,"utf8"))}catch{}if(Z.mcpServers=Z.mcpServers??{},Z.mcpServers.beacon)return{path:Q,added:!1};return Z.mcpServers.beacon={command:"beacon",args:["mcp"]},
|
|
12
|
-
`),{path:Q,added:!0}}function z5($){let Q=C($,".mcp.json"),Z=!1;try{Z=!!JSON.parse(_(Q,"utf8")).mcpServers?.beacon}catch{}let X=!1;try{X=_(C($,"AGENTS.md"),"utf8").includes($0)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(_(C($,"CLAUDE.md"),"utf8"))}catch{}return{repo:$,mcpRegistered:Z,agentsMdBlock:X,claudeMdImport:V,skills:{"beacon-init":K0(C($,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":K0(C($,".claude","skills","beacon-refresh","SKILL.md"))}}}function b5($){let Q=[];for(let K of["beacon-init","beacon-refresh","beacon-db-design"]){let O=C($,".claude","skills",K);if(K0(O))N0(O,{recursive:!0,force:!0}),Q.push(K)}let Z=!1,X=C($,".mcp.json");try{let K=JSON.parse(_(X,"utf8"));if(K.mcpServers?.beacon){if(delete K.mcpServers.beacon,Z=!0,K.mcpServers&&Object.keys(K.mcpServers).length===0)delete K.mcpServers;if(Object.keys(K).length===0)N0(X,{force:!0});else
|
|
11
|
+
`)}function u5($){let Q=C($,".mcp.json"),Z={};try{Z=JSON.parse(_(Q,"utf8"))}catch{}if(Z.mcpServers=Z.mcpServers??{},Z.mcpServers.beacon)return{path:Q,added:!1};return Z.mcpServers.beacon={command:"beacon",args:["mcp"]},L(Q,JSON.stringify(Z,null,2)+`
|
|
12
|
+
`),{path:Q,added:!0}}function z5($){let Q=C($,".mcp.json"),Z=!1;try{Z=!!JSON.parse(_(Q,"utf8")).mcpServers?.beacon}catch{}let X=!1;try{X=_(C($,"AGENTS.md"),"utf8").includes($0)}catch{}let V=!1;try{V=/@AGENTS\.md/.test(_(C($,"CLAUDE.md"),"utf8"))}catch{}return{repo:$,mcpRegistered:Z,agentsMdBlock:X,claudeMdImport:V,skills:{"beacon-init":K0(C($,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":K0(C($,".claude","skills","beacon-refresh","SKILL.md"))}}}function b5($){let Q=[];for(let K of["beacon-init","beacon-refresh","beacon-db-design"]){let O=C($,".claude","skills",K);if(K0(O))N0(O,{recursive:!0,force:!0}),Q.push(K)}let Z=!1,X=C($,".mcp.json");try{let K=JSON.parse(_(X,"utf8"));if(K.mcpServers?.beacon){if(delete K.mcpServers.beacon,Z=!0,K.mcpServers&&Object.keys(K.mcpServers).length===0)delete K.mcpServers;if(Object.keys(K).length===0)N0(X,{force:!0});else L(X,JSON.stringify(K,null,2)+`
|
|
13
13
|
`)}}catch{}let V=!1,H=C($,"AGENTS.md");try{let K=_(H,"utf8"),O=new RegExp(`\\n?${$0}[\\s\\S]*?${W0}\\n?`);if(O.test(K)){let l=K.replace(O,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();
|
|
16
|
+
`).trimStart();L(H,l.endsWith(`
|
|
17
17
|
`)?l:`${l}
|
|
18
|
-
`),V=!0}}catch{}let
|
|
18
|
+
`),V=!0}}catch{}let j=!1,N=C($,"CLAUDE.md");try{let K=_(N,"utf8"),O=K.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(O!==K){if(!O.trim())N0(N,{force:!0});else L(N,O);j=!0}}catch{}return{skillsRemoved:Q,mcpUnregistered:Z,agentsBlockRemoved:V,claudeImportRemoved:j}}var p0=`---
|
|
19
19
|
name: beacon-init
|
|
20
20
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
21
21
|
---
|
|
@@ -190,7 +190,7 @@ Do this per feature. If a plan added five features, that's five \`beacon_describ
|
|
|
190
190
|
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.
|
|
191
191
|
|
|
192
192
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
193
|
-
${W0}`});var e0={};e(e0,{provisionDb:()=>j9});import{createClient as e5}from"@libsql/client";import{drizzle as $9}from"drizzle-orm/libsql";import{migrate as Q9}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as Z9}from"drizzle-orm/migrator";import{dirname as F0,join as J9}from"path";import{fileURLToPath as X9}from"url";async function X0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function G9($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((X)=>String(X.name)))}async function t0($){if(!await X0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function B9($){for(let[Q,Z]of Object.entries(H9)){if(!await X0($,Q))continue;let X=await G9($,Q);for(let V of Z){if(!X.has(V))continue;await $.execute(`UPDATE "${Q}" SET "${V}" = CAST((julianday("${V}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${V}") = 'text'`)}}}async function j9($,Q=V9){let Z=e5({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;");let X=await X0(Z,"__drizzle_migrations"),V=await X0(Z,"Node"),H=!1;if(V&&!X){let N=Z9({migrationsFolder:Q})[0];if(N)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:[N.hash,N.folderMillis]}),H=!0}let
|
|
193
|
+
${W0}`});var e0={};e(e0,{provisionDb:()=>j9});import{createClient as e5}from"@libsql/client";import{drizzle as $9}from"drizzle-orm/libsql";import{migrate as Q9}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as Z9}from"drizzle-orm/migrator";import{dirname as F0,join as J9}from"path";import{fileURLToPath as X9}from"url";async function X0($,Q){return(await $.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Q]})).rows.length>0}async function G9($,Q){let Z=await $.execute(`PRAGMA table_info("${Q}")`);return new Set(Z.rows.map((X)=>String(X.name)))}async function t0($){if(!await X0($,"__drizzle_migrations"))return 0;let Q=await $.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Q.rows[0]?.n??0)}async function B9($){for(let[Q,Z]of Object.entries(H9)){if(!await X0($,Q))continue;let X=await G9($,Q);for(let V of Z){if(!X.has(V))continue;await $.execute(`UPDATE "${Q}" SET "${V}" = CAST((julianday("${V}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${V}") = 'text'`)}}}async function j9($,Q=V9){let Z=e5({url:$});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;");let X=await X0(Z,"__drizzle_migrations"),V=await X0(Z,"Node"),H=!1;if(V&&!X){let N=Z9({migrationsFolder:Q})[0];if(N)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:[N.hash,N.folderMillis]}),H=!0}let j=await t0(Z);if(await Q9($9(Z),{migrationsFolder:Q}),await t0(Z)>j)H=!0;return await B9(Z),{migrated:H}}finally{Z.close()}}var Y9,V9,H9;var $5=b0(async()=>{Y9=F0(F0(F0(X9(import.meta.url)))),V9=process.env.BEACON_MIGRATIONS_DIR||J9(Y9,"drizzle"),H9={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});import{existsSync as P0,mkdirSync as C0,readFileSync as Z0,rmSync as m5,writeFileSync as J0}from"fs";import{homedir as p5}from"os";import{join as T}from"path";function c5(){return process.env.HOME||process.env.USERPROFILE||p5()}var z=()=>T(c5(),".claude"),O0=()=>T(z(),"skills"),o0=()=>T(z(),"settings.json"),s=()=>T(z(),"CLAUDE.md"),Q0="<!-- beacon:global:start -->",U0="<!-- beacon:global:end -->",w0=["beacon-init","beacon-refresh","beacon-plan"],q0=[{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."}],l5=`## Beacon (visual planning panel)
|
|
194
194
|
|
|
195
195
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
196
196
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -212,7 +212,7 @@ Feedback bundles inline annotations on the markdown PLUS any edits the user made
|
|
|
212
212
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
213
213
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
214
214
|
verbatim. Do NOT implement until the tool returns approval.`;function s5($,Q){let Z=T(O0(),$);C0(Z,{recursive:!0});let X=T(Z,"SKILL.md");return J0(X,Q),X}function n0($){return P0(T(O0(),$,"SKILL.md"))}function d5($){let Q=T(O0(),$);if(!P0(Q))return!1;return m5(Q,{recursive:!0,force:!0}),!0}function D0(){try{return JSON.parse(Z0(o0(),"utf8"))}catch{return{}}}function a0($){C0(z(),{recursive:!0}),J0(o0(),JSON.stringify($,null,2)+`
|
|
215
|
-
`)}function o5($){let Q=D0();Q.hooks=Q.hooks??{},Q.hooks[$.event]=Q.hooks[$.event]??[];let Z=Q.hooks[$.event];if(Z.some((V)=>V.matcher===$.matcher&&V.hooks?.some((H)=>H.command===$.command)))return!1;return Z.push({matcher:$.matcher,hooks:[{type:"command",command:$.command}]}),a0(Q),!0}function n5($){return(D0().hooks?.[$.event]??[]).some((X)=>X.hooks?.some((V)=>V.command===$.command))}function a5($){let Q=D0(),Z=Q.hooks?.[$.event];if(!Z)return!1;let X=!1,V=Z.map((H)=>{let
|
|
215
|
+
`)}function o5($){let Q=D0();Q.hooks=Q.hooks??{},Q.hooks[$.event]=Q.hooks[$.event]??[];let Z=Q.hooks[$.event];if(Z.some((V)=>V.matcher===$.matcher&&V.hooks?.some((H)=>H.command===$.command)))return!1;return Z.push({matcher:$.matcher,hooks:[{type:"command",command:$.command}]}),a0(Q),!0}function n5($){return(D0().hooks?.[$.event]??[]).some((X)=>X.hooks?.some((V)=>V.command===$.command))}function a5($){let Q=D0(),Z=Q.hooks?.[$.event];if(!Z)return!1;let X=!1,V=Z.map((H)=>{let j=H.hooks?.length??0,N=(H.hooks??[]).filter((K)=>K.command!==$.command);if(N.length!==j)X=!0;return{...H,hooks:N}}).filter((H)=>(H.hooks??[]).length>0);if(!X)return!1;if(V.length)Q.hooks[$.event]=V;else delete Q.hooks[$.event];if(Q.hooks&&Object.keys(Q.hooks).length===0)delete Q.hooks;return a0(Q),!0}function r5($){let Q=`${Q0}
|
|
216
216
|
${$.trim()}
|
|
217
217
|
${U0}`,Z="";try{Z=Z0(s(),"utf8")}catch{}let X=new RegExp(`${Q0}[\\s\\S]*?${U0}`);Z=X.test(Z)?Z.replace(X,Q):Z.trim()?`${Z.trim()}
|
|
218
218
|
|
|
@@ -222,26 +222,26 @@ ${Q}
|
|
|
222
222
|
`)?Z:`${Z}
|
|
223
223
|
`)}function r0(){try{return Z0(s(),"utf8").includes(Q0)}catch{return!1}}function i5(){let $="";try{$=Z0(s(),"utf8")}catch{return!1}let Q=new RegExp(`${Q0}[\\s\\S]*?${U0}\\n?`);if(!Q.test($))return!1;let Z=$.replace(Q,"").replace(/\n{3,}/g,`
|
|
224
224
|
|
|
225
|
-
`).trimStart();return J0(s(),Z),!0}function V$(){let $={};for(let Z of w0)$[Z]=n0(Z);let Q={};for(let Z of q0)Q[Z.event]=n5({event:Z.event,command:Z.command});return{homeExists:P0(z()),skills:$,hooks:Q,claudeMdBlock:r0()}}async function t5(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (d0(),s0)),X={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},V=[];for(let N of w0){if(!n0(N))V.push(N);s5(N,X[N])}let H=0;for(let N of q0)if(o5({event:N.event,matcher:N.matcher,command:N.command}))H++;let B=r0();return r5(l5),{skillsAdded:V,hooksAdded:H,claudeMdBlockTouched:!B}}async function i0(){try{return{ok:!0,...await t5()}}catch($){return{ok:!1,error:$ instanceof Error?$.message:String($),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}}function H$(){let $=[];for(let X of w0)if(d5(X))$.push(X);let Q=0;for(let X of q0)if(a5(X))Q++;let Z=i5();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as N9}from"async_hooks";import{spawnSync as K9}from"child_process";import{createHash as M9}from"crypto";import{existsSync as Z5,mkdirSync as Y0,readFileSync as J5,writeFileSync as X5}from"fs";import{homedir as W9}from"os";import{basename as U9,join as b}from"path";function d(){return process.env.BEACON_HOME||b(W9(),".beacon")}function v0(){return b(d(),"workspaces.json")}function V0($){return M9("sha256").update($).digest("hex").slice(0,12)}function Y5($=process.cwd()){let Q=K9("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 A0($){return b(d(),$)}function R0($){return`file:${b(A0($),"db.sqlite")}`}function o(){try{let $=JSON.parse(J5(v0(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function E0($){Y0(d(),{recursive:!0}),X5(v0(),JSON.stringify($,null,2))}function P9(){return o().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function h($){return o().find((Q)=>Q.id===$)??null}function _0($,Q,Z=new Date().toISOString()){let X=V0($),V=o(),H=V.find((K)=>K.id===X),B={id:X,path:$,name:Q||H?.name||U9($),lastOpenedAt:Z},N=[B,...V.filter((K)=>K.id!==X)];return Y0(A0(X),{recursive:!0}),E0(N),B}function D$($,Q=new Date().toISOString()){let Z=o(),X=Z.find((V)=>V.id===$);if(!X)return;X.lastOpenedAt=Q,E0(Z)}function F$($){if(E0(o().filter((Q)=>Q.id!==$)),n()===$)C9(P9()[0]?.id??null)}function V5(){return b(d(),"active")}function n(){try{return J5(V5(),"utf8").trim()||null}catch{return null}}function C9($){Y0(d(),{recursive:!0}),X5(V5(),$??"")}function v$(){let $=n();return $?h($):null}function A$(){let $=L0()??n();return $?h($):null}function R$($){return h($)?.path??null}function E$(){return Z5(v0())}var H5="beacon_ws";function G5($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let X of Z.split(";")){let V=X.indexOf("=");if(V===-1)continue;if(X.slice(0,V).trim()===Q)return decodeURIComponent(X.slice(V+1).trim())}return null}function _$($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=G5($,H5);if(Z&&h(Z))return Z;return null}var I0="x-beacon-workspace-path";async function I$($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=$.headers.get(I0);if(Z&&(!Q||V0(Z)===Q)){let V=_0(Z);return await k0(V.id),V.id}let X=G5($,H5);if(X&&h(X))return X;return null}var B5=new N9;function O9($,Q){return $?B5.run($,Q):Q()}function L0(){return B5.getStore()??null}var Q5=new Set;async function k0($){let Q=A0($),Z=b(Q,"db.sqlite"),X=Z5(Z);if(X&&Q5.has(Z))return{ok:!0,created:!1,migrated:!1};try{Y0(Q,{recursive:!0});let{provisionDb:V}=await $5().then(() => e0),H=await V(R0($));return Q5.add(Z),{ok:!0,created:!X,migrated:X&&H.migrated}}catch(V){return{ok:!1,created:!1,migrated:!1,error:V instanceof Error?V.message:String(V)}}}import{McpServer as t9,ResourceTemplate as f0}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as e9}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as G}from"zod";var w9=new Set(["GET","HEAD","OPTIONS"]);function j5($){return w9.has($.trim().toUpperCase())?"read":"write"}var q9=G.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},G.object({name:G.string().trim().min(1),type:G.string().trim().min(1),isPk:G.boolean().optional(),isFk:G.boolean().optional(),nullable:G.boolean().optional(),note:G.string().nullish()})),N5=G.object({name:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),columns:G.array(q9).default([])}),K5=G.object({fromTable:G.string(),fromColumn:G.string(),toTable:G.string(),toColumn:G.string(),label:G.string().nullish()}),M5=G.object({method:G.string().trim().min(1),path:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),uses:G.array(G.object({table:G.string().trim().min(1),access:G.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??j5($.method)}))})),h$=G.object({tables:G.array(N5).default([]),relations:G.array(K5).default([]),endpoints:G.array(M5).default([])});import{z as R}from"zod";import{and as $Q,eq as QQ,inArray as ZQ}from"drizzle-orm";import{drizzle as p9}from"drizzle-orm/libsql";import{createClient as c9}from"@libsql/client";var T0={};e(T0,{tag:()=>m,syncState:()=>A9,projectMeta:()=>E9,note:()=>v9,nodeTags:()=>y,nodeFile:()=>a,node:()=>U,endpointTable:()=>g,endpoint:()=>p,edge:()=>S,draftTable:()=>A,draftRelation:()=>f,draftColumn:()=>i,dbTable:()=>w,dbRelation:()=>x,dbColumn:()=>r,codeFileEdge:()=>u,codeFile:()=>L,appSetting:()=>R9});import{sqliteTable as P,index as W,foreignKey as D9,text as Y,integer as j,real as v,uniqueIndex as k,primaryKey as F9}from"drizzle-orm/sqlite-core";import{createId as F}from"@paralleldrive/cuid2";var U=P("Node",{id:Y().primaryKey().$defaultFn(()=>F()),view:Y().notNull(),cluster:Y(),title:Y().notNull(),role:Y(),plain:Y(),status:Y().default("PENDING").notNull(),priority:j().default(2).notNull(),progress:j().default(0).notNull(),x:v().default(0).notNull(),y:v().default(0).notNull(),sourceRef:Y(),externalId:Y(),source:Y().default("MANUAL").notNull(),parentId:Y(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date),embedding:Y()},($)=>[W("Node_cluster_idx").on($.cluster),W("Node_parentId_idx").on($.parentId),W("Node_view_idx").on($.view),D9(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),a=P("NodeFile",{id:Y().primaryKey().$defaultFn(()=>F()),nodeId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),path:Y().notNull()},($)=>[k("NodeFile_nodeId_path_key").on($.nodeId,$.path),W("NodeFile_nodeId_idx").on($.nodeId)]),m=P("Tag",{id:Y().primaryKey().$defaultFn(()=>F()),label:Y().notNull(),color:Y()},($)=>[k("Tag_label_key").on($.label)]),S=P("Edge",{id:Y().primaryKey().$defaultFn(()=>F()),fromId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:Y().default("DEPENDS").notNull(),label:Y(),sourceHandle:Y(),targetHandle:Y()},($)=>[k("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),W("Edge_toId_idx").on($.toId),W("Edge_fromId_idx").on($.fromId)]),y=P("_NodeTags",{a:Y("A").notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),b:Y("B").notNull().references(()=>m.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[k("_NodeTags_AB_unique").on($.a,$.b),W("_NodeTags_B_index").on($.b)]),v9=P("Note",{id:Y().primaryKey().$defaultFn(()=>F()),title:Y().default("Untitled").notNull(),body:Y().default("").notNull(),ord:v().default(0).notNull(),pinned:j({mode:"boolean"}).default(!1).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[W("Note_updatedAt_idx").on($.updatedAt)]),w=P("DbTable",{id:Y().primaryKey().$defaultFn(()=>F()),name:Y().notNull(),domain:Y(),description:Y(),source:Y().default("MANUAL").notNull(),x:v().default(0).notNull(),y:v().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[W("DbTable_domain_idx").on($.domain),k("DbTable_name_key").on($.name)]),r=P("DbColumn",{id:Y().primaryKey().$defaultFn(()=>F()),tableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),name:Y().notNull(),type:Y().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:Y(),ord:j().default(0).notNull()},($)=>[k("DbColumn_tableId_name_key").on($.tableId,$.name),W("DbColumn_tableId_idx").on($.tableId)]),x=P("DbRelation",{id:Y().primaryKey().$defaultFn(()=>F()),fromTableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:Y().notNull(),toColumn:Y().notNull(),label:Y()},($)=>[W("DbRelation_toTableId_idx").on($.toTableId),W("DbRelation_fromTableId_idx").on($.fromTableId)]),p=P("Endpoint",{id:Y().primaryKey().$defaultFn(()=>F()),method:Y().notNull(),path:Y().notNull(),domain:Y(),description:Y(),source:Y().default("MANUAL").notNull(),x:v().default(0).notNull(),y:v().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[k("Endpoint_method_path_key").on($.method,$.path),W("Endpoint_domain_idx").on($.domain)]),g=P("EndpointTable",{id:Y().primaryKey().$defaultFn(()=>F()),endpointId:Y().notNull().references(()=>p.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),access:Y().default("read").notNull()},($)=>[k("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),W("EndpointTable_tableId_idx").on($.tableId)]),A=P("DraftTable",{id:Y().primaryKey().$defaultFn(()=>F()),name:Y().notNull(),domain:Y(),description:Y(),x:v().default(0).notNull(),y:v().default(0).notNull(),createdAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[k("DraftTable_name_key").on($.name)]),i=P("DraftColumn",{id:Y().primaryKey().$defaultFn(()=>F()),tableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),name:Y().notNull(),type:Y().notNull(),isPk:j({mode:"boolean"}).default(!1).notNull(),isFk:j({mode:"boolean"}).default(!1).notNull(),nullable:j({mode:"boolean"}).default(!0).notNull(),note:Y(),ord:j().default(0).notNull()},($)=>[W("DraftColumn_tableId_idx").on($.tableId)]),f=P("DraftRelation",{id:Y().primaryKey().$defaultFn(()=>F()),fromTableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:Y().notNull(),toColumn:Y().notNull(),label:Y()},($)=>[W("DraftRelation_toTableId_idx").on($.toTableId),W("DraftRelation_fromTableId_idx").on($.fromTableId)]),L=P("CodeFile",{path:Y().primaryKey(),root:Y(),lang:Y(),x:v().default(0).notNull(),y:v().default(0).notNull(),mtimeMs:v(),size:j(),inDegree:j().default(0).notNull(),outDegree:j().default(0).notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),u=P("CodeFileEdge",{fromPath:Y().notNull().references(()=>L.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:Y().notNull().references(()=>L.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:j({mode:"boolean"}).default(!1).notNull()},($)=>[W("CodeFileEdge_circular_idx").on($.circular),W("CodeFileEdge_toPath_idx").on($.toPath),W("CodeFileEdge_fromPath_idx").on($.fromPath),F9({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),A9=P("SyncState",{id:Y().primaryKey().default("singleton"),version:j().default(0).notNull(),codeGraphSyncedAt:j({mode:"timestamp_ms"}),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),R9=P("AppSetting",{id:Y().primaryKey().default("singleton"),intelModel:Y().default("claude-haiku-4-5").notNull(),intelProvider:Y().default("auto").notNull(),editor:Y().default("auto").notNull(),currentFeatureId:Y(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),E9=P("ProjectMeta",{id:Y().primaryKey().default("singleton"),overview:Y(),conventions:Y().default("[]").notNull(),updatedAt:j({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)});var S0={};e(S0,{tagRelations:()=>L9,nodeTagsRelations:()=>k9,nodeRelations:()=>_9,nodeFileRelations:()=>I9,endpointTableRelations:()=>g9,endpointRelations:()=>x9,edgeRelations:()=>T9,draftTableRelations:()=>f9,draftRelationRelations:()=>z9,draftColumnRelations:()=>u9,dbTableRelations:()=>S9,dbRelationRelations:()=>y9,dbColumnRelations:()=>h9,codeFileRelations:()=>b9,codeFileEdgeRelations:()=>m9});import{relations as q}from"drizzle-orm";var _9=q(U,({one:$,many:Q})=>({files:Q(a),nodeTags:Q(y),edgesOut:Q(S,{relationName:"EdgeFrom"}),edgesIn:Q(S,{relationName:"EdgeTo"}),parent:$(U,{fields:[U.parentId],references:[U.id],relationName:"NodeTree"}),children:Q(U,{relationName:"NodeTree"})})),I9=q(a,({one:$})=>({node:$(U,{fields:[a.nodeId],references:[U.id]})})),L9=q(m,({many:$})=>({nodeTags:$(y)})),k9=q(y,({one:$})=>({node:$(U,{fields:[y.a],references:[U.id]}),tag:$(m,{fields:[y.b],references:[m.id]})})),T9=q(S,({one:$})=>({from:$(U,{fields:[S.fromId],references:[U.id],relationName:"EdgeFrom"}),to:$(U,{fields:[S.toId],references:[U.id],relationName:"EdgeTo"})})),S9=q(w,({many:$})=>({columns:$(r),fksOut:$(x,{relationName:"FkFrom"}),fksIn:$(x,{relationName:"FkTo"}),usages:$(g)})),h9=q(r,({one:$})=>({table:$(w,{fields:[r.tableId],references:[w.id]})})),y9=q(x,({one:$})=>({fromTable:$(w,{fields:[x.fromTableId],references:[w.id],relationName:"FkFrom"}),toTable:$(w,{fields:[x.toTableId],references:[w.id],relationName:"FkTo"})})),x9=q(p,({many:$})=>({tables:$(g)})),g9=q(g,({one:$})=>({endpoint:$(p,{fields:[g.endpointId],references:[p.id]}),table:$(w,{fields:[g.tableId],references:[w.id]})})),f9=q(A,({many:$})=>({columns:$(i),fksOut:$(f,{relationName:"DraftFkFrom"}),fksIn:$(f,{relationName:"DraftFkTo"})})),u9=q(i,({one:$})=>({table:$(A,{fields:[i.tableId],references:[A.id]})})),z9=q(f,({one:$})=>({fromTable:$(A,{fields:[f.fromTableId],references:[A.id],relationName:"DraftFkFrom"}),toTable:$(A,{fields:[f.toTableId],references:[A.id],relationName:"DraftFkTo"})})),b9=q(L,({many:$})=>({edgesOut:$(u,{relationName:"CFEFrom"}),edgesIn:$(u,{relationName:"CFETo"})})),m9=q(u,({one:$})=>({fromFile:$(L,{fields:[u.fromPath],references:[L.path],relationName:"CFEFrom"}),toFile:$(L,{fields:[u.toPath],references:[L.path],relationName:"CFETo"})}));var l9={...T0,...S0};function s9(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var d9=s9();function U5($){let Q=c9({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),p9(Q,{schema:l9})}var y0=globalThis,h0=y0.dzDefault??U5(d9);y0.dzDefault=h0;var W5=y0.dzByUrl??=new Map;function o9($){let Q=W5.get($);if(!Q)Q=U5($),W5.set($,Q);return Q}function n9(){if(process.env.BEACON_REPO)return h0;let $=L0()??n();if(!$)return h0;return o9(R0($))}var a9=new Proxy({},{get($,Q){let Z=n9(),X=Z[Q];return typeof X==="function"?X.bind(Z):X}});import{forceCenter as s$,forceCollide as d$,forceLink as o$,forceManyBody as n$,forceSimulation as a$}from"d3-force";var P5=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(),dependsOn:R.array(R.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,...X})=>({...X,cluster:X.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z)))})),VQ=R.object({features:R.array(P5).default([])});var r9=/(\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 C5($){return!!$&&r9.test($)}function i9($){return $.cluster??$.category??$.domain??null}function O5($){let Q=$.map((Z)=>{let X=[],V=i9(Z);if(!V||!V.trim())X.push("category");if(Z.priority==null)X.push("priority");return X.length?` \u2022 "${Z.title?.trim()||"(untitled)"}" \u2014 missing ${X.join(" + ")}`:null}).filter((Z)=>Z!==null);if(Q.length===0)return null;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. Missing:
|
|
225
|
+
`).trimStart();return J0(s(),Z),!0}function H$(){let $={};for(let Z of w0)$[Z]=n0(Z);let Q={};for(let Z of q0)Q[Z.event]=n5({event:Z.event,command:Z.command});return{homeExists:P0(z()),skills:$,hooks:Q,claudeMdBlock:r0()}}async function t5(){let{INIT_SKILL:$,REFRESH_SKILL:Q,PLAN_SKILL:Z}=await Promise.resolve().then(() => (d0(),s0)),X={"beacon-init":$,"beacon-refresh":Q,"beacon-plan":Z},V=[];for(let N of w0){if(!n0(N))V.push(N);s5(N,X[N])}let H=0;for(let N of q0)if(o5({event:N.event,matcher:N.matcher,command:N.command}))H++;let j=r0();return r5(l5),{skillsAdded:V,hooksAdded:H,claudeMdBlockTouched:!j}}async function i0(){try{return{ok:!0,...await t5()}}catch($){return{ok:!1,error:$ instanceof Error?$.message:String($),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}}function G$(){let $=[];for(let X of w0)if(d5(X))$.push(X);let Q=0;for(let X of q0)if(a5(X))Q++;let Z=i5();return{skillsRemoved:$,hooksRemoved:Q,claudeMdBlockRemoved:Z}}import{AsyncLocalStorage as N9}from"async_hooks";import{spawnSync as K9}from"child_process";import{createHash as M9}from"crypto";import{existsSync as Z5,mkdirSync as Y0,readFileSync as J5,writeFileSync as X5}from"fs";import{homedir as W9}from"os";import{basename as U9,join as b}from"path";function d(){return process.env.BEACON_HOME||b(W9(),".beacon")}function v0(){return b(d(),"workspaces.json")}function V0($){return M9("sha256").update($).digest("hex").slice(0,12)}function Y5($=process.cwd()){let Q=K9("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 A0($){return b(d(),$)}function R0($){return`file:${b(A0($),"db.sqlite")}`}function o(){try{let $=JSON.parse(J5(v0(),"utf8"));return Array.isArray($)?$:[]}catch{return[]}}function E0($){Y0(d(),{recursive:!0}),X5(v0(),JSON.stringify($,null,2))}function P9(){return o().sort(($,Q)=>Q.lastOpenedAt.localeCompare($.lastOpenedAt))}function h($){return o().find((Q)=>Q.id===$)??null}function _0($,Q,Z=new Date().toISOString()){let X=V0($),V=o(),H=V.find((K)=>K.id===X),j={id:X,path:$,name:Q||H?.name||U9($),lastOpenedAt:Z},N=[j,...V.filter((K)=>K.id!==X)];return Y0(A0(X),{recursive:!0}),E0(N),j}function F$($,Q=new Date().toISOString()){let Z=o(),X=Z.find((V)=>V.id===$);if(!X)return;X.lastOpenedAt=Q,E0(Z)}function v$($){if(E0(o().filter((Q)=>Q.id!==$)),n()===$)C9(P9()[0]?.id??null)}function V5(){return b(d(),"active")}function n(){try{return J5(V5(),"utf8").trim()||null}catch{return null}}function C9($){Y0(d(),{recursive:!0}),X5(V5(),$??"")}function A$(){let $=n();return $?h($):null}function R$(){let $=I0()??n();return $?h($):null}function E$($){return h($)?.path??null}function _$(){return Z5(v0())}var H5="beacon_ws";function G5($,Q){let Z=$.headers.get("cookie");if(!Z)return null;for(let X of Z.split(";")){let V=X.indexOf("=");if(V===-1)continue;if(X.slice(0,V).trim()===Q)return decodeURIComponent(X.slice(V+1).trim())}return null}function L$($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=G5($,H5);if(Z&&h(Z))return Z;return null}var L0="x-beacon-workspace-path";async function I$($){let Q=$.headers.get("x-beacon-workspace");if(Q&&h(Q))return Q;let Z=$.headers.get(L0);if(Z&&(!Q||V0(Z)===Q)){let V=_0(Z);return await k0(V.id),V.id}let X=G5($,H5);if(X&&h(X))return X;return null}var B5=new N9;function O9($,Q){return $?B5.run($,Q):Q()}function I0(){return B5.getStore()??null}var Q5=new Set;async function k0($){let Q=A0($),Z=b(Q,"db.sqlite"),X=Z5(Z);if(X&&Q5.has(Z))return{ok:!0,created:!1,migrated:!1};try{Y0(Q,{recursive:!0});let{provisionDb:V}=await $5().then(() => e0),H=await V(R0($));return Q5.add(Z),{ok:!0,created:!X,migrated:X&&H.migrated}}catch(V){return{ok:!1,created:!1,migrated:!1,error:V instanceof Error?V.message:String(V)}}}import{McpServer as e9,ResourceTemplate as f0}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as $$}from"@modelcontextprotocol/sdk/server/stdio.js";import{z as J}from"zod";import{z as G}from"zod";var w9=new Set(["GET","HEAD","OPTIONS"]);function j5($){return w9.has($.trim().toUpperCase())?"read":"write"}var q9=G.preprocess(($)=>{if(typeof $==="string"){let[Q,...Z]=$.trim().split(/\s+/);return{name:Q,type:Z.join(" ")||"text"}}return $},G.object({name:G.string().trim().min(1),type:G.string().trim().min(1),isPk:G.boolean().optional(),isFk:G.boolean().optional(),nullable:G.boolean().optional(),note:G.string().nullish()})),N5=G.object({name:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),columns:G.array(q9).default([])}),K5=G.object({fromTable:G.string(),fromColumn:G.string(),toTable:G.string(),toColumn:G.string(),label:G.string().nullish()}),M5=G.object({method:G.string().trim().min(1),path:G.string().trim().min(1),domain:G.string().nullish(),description:G.string().nullish(),uses:G.array(G.object({table:G.string().trim().min(1),access:G.string().optional()})).default([])}).transform(($)=>({...$,uses:$.uses.map((Q)=>({...Q,access:Q.access??j5($.method)}))})),y$=G.object({tables:G.array(N5).default([]),relations:G.array(K5).default([]),endpoints:G.array(M5).default([])});import{z as R}from"zod";import{and as QQ,eq as ZQ,inArray as JQ}from"drizzle-orm";import{drizzle as c9}from"drizzle-orm/libsql";import{createClient as l9}from"@libsql/client";var T0={};e(T0,{tag:()=>m,syncState:()=>R9,projectMeta:()=>_9,note:()=>v9,nodeTags:()=>y,nodeFile:()=>a,node:()=>U,endpointTable:()=>g,endpoint:()=>p,edge:()=>S,draftTable:()=>A,draftRelation:()=>f,draftColumn:()=>i,dbTable:()=>w,dbRelation:()=>x,dbColumn:()=>r,codeFileEdge:()=>u,codeFile:()=>I,boardAnnotation:()=>A9,appSetting:()=>E9});import{sqliteTable as P,index as W,foreignKey as D9,text as Y,integer as B,real as F,uniqueIndex as k,primaryKey as F9}from"drizzle-orm/sqlite-core";import{createId as v}from"@paralleldrive/cuid2";var U=P("Node",{id:Y().primaryKey().$defaultFn(()=>v()),view:Y().notNull(),cluster:Y(),title:Y().notNull(),role:Y(),plain:Y(),status:Y().default("PENDING").notNull(),priority:B().default(2).notNull(),progress:B().default(0).notNull(),x:F().default(0).notNull(),y:F().default(0).notNull(),sourceRef:Y(),externalId:Y(),source:Y().default("MANUAL").notNull(),parentId:Y(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date),embedding:Y()},($)=>[W("Node_cluster_idx").on($.cluster),W("Node_parentId_idx").on($.parentId),W("Node_view_idx").on($.view),D9(()=>({columns:[$.parentId],foreignColumns:[$.id],name:"Node_parentId_Node_id_fk"})).onUpdate("cascade").onDelete("cascade")]),a=P("NodeFile",{id:Y().primaryKey().$defaultFn(()=>v()),nodeId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),path:Y().notNull()},($)=>[k("NodeFile_nodeId_path_key").on($.nodeId,$.path),W("NodeFile_nodeId_idx").on($.nodeId)]),m=P("Tag",{id:Y().primaryKey().$defaultFn(()=>v()),label:Y().notNull(),color:Y()},($)=>[k("Tag_label_key").on($.label)]),S=P("Edge",{id:Y().primaryKey().$defaultFn(()=>v()),fromId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),toId:Y().notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),kind:Y().default("DEPENDS").notNull(),label:Y(),sourceHandle:Y(),targetHandle:Y()},($)=>[k("Edge_fromId_toId_kind_key").on($.fromId,$.toId,$.kind),W("Edge_toId_idx").on($.toId),W("Edge_fromId_idx").on($.fromId)]),y=P("_NodeTags",{a:Y("A").notNull().references(()=>U.id,{onDelete:"cascade",onUpdate:"cascade"}),b:Y("B").notNull().references(()=>m.id,{onDelete:"cascade",onUpdate:"cascade"})},($)=>[k("_NodeTags_AB_unique").on($.a,$.b),W("_NodeTags_B_index").on($.b)]),v9=P("Note",{id:Y().primaryKey().$defaultFn(()=>v()),title:Y().default("Untitled").notNull(),body:Y().default("").notNull(),ord:F().default(0).notNull(),pinned:B({mode:"boolean"}).default(!1).notNull(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[W("Note_updatedAt_idx").on($.updatedAt)]),A9=P("BoardAnnotation",{id:Y().primaryKey().$defaultFn(()=>v()),targetKind:Y().notNull(),targetId:Y().notNull(),columnName:Y(),body:Y().default("").notNull(),x:F(),y:F(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[W("BoardAnnotation_target_idx").on($.targetId)]),w=P("DbTable",{id:Y().primaryKey().$defaultFn(()=>v()),name:Y().notNull(),domain:Y(),description:Y(),source:Y().default("MANUAL").notNull(),x:F().default(0).notNull(),y:F().default(0).notNull(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[W("DbTable_domain_idx").on($.domain),k("DbTable_name_key").on($.name)]),r=P("DbColumn",{id:Y().primaryKey().$defaultFn(()=>v()),tableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),name:Y().notNull(),type:Y().notNull(),isPk:B({mode:"boolean"}).default(!1).notNull(),isFk:B({mode:"boolean"}).default(!1).notNull(),nullable:B({mode:"boolean"}).default(!0).notNull(),note:Y(),ord:B().default(0).notNull()},($)=>[k("DbColumn_tableId_name_key").on($.tableId,$.name),W("DbColumn_tableId_idx").on($.tableId)]),x=P("DbRelation",{id:Y().primaryKey().$defaultFn(()=>v()),fromTableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:Y().notNull(),toColumn:Y().notNull(),label:Y()},($)=>[W("DbRelation_toTableId_idx").on($.toTableId),W("DbRelation_fromTableId_idx").on($.fromTableId)]),p=P("Endpoint",{id:Y().primaryKey().$defaultFn(()=>v()),method:Y().notNull(),path:Y().notNull(),domain:Y(),description:Y(),source:Y().default("MANUAL").notNull(),x:F().default(0).notNull(),y:F().default(0).notNull(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)},($)=>[k("Endpoint_method_path_key").on($.method,$.path),W("Endpoint_domain_idx").on($.domain)]),g=P("EndpointTable",{id:Y().primaryKey().$defaultFn(()=>v()),endpointId:Y().notNull().references(()=>p.id,{onDelete:"cascade",onUpdate:"cascade"}),tableId:Y().notNull().references(()=>w.id,{onDelete:"cascade",onUpdate:"cascade"}),access:Y().default("read").notNull()},($)=>[k("EndpointTable_endpointId_tableId_key").on($.endpointId,$.tableId),W("EndpointTable_tableId_idx").on($.tableId)]),A=P("DraftTable",{id:Y().primaryKey().$defaultFn(()=>v()),name:Y().notNull(),domain:Y(),description:Y(),x:F().default(0).notNull(),y:F().default(0).notNull(),createdAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date)},($)=>[k("DraftTable_name_key").on($.name)]),i=P("DraftColumn",{id:Y().primaryKey().$defaultFn(()=>v()),tableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),name:Y().notNull(),type:Y().notNull(),isPk:B({mode:"boolean"}).default(!1).notNull(),isFk:B({mode:"boolean"}).default(!1).notNull(),nullable:B({mode:"boolean"}).default(!0).notNull(),note:Y(),ord:B().default(0).notNull()},($)=>[W("DraftColumn_tableId_idx").on($.tableId)]),f=P("DraftRelation",{id:Y().primaryKey().$defaultFn(()=>v()),fromTableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),toTableId:Y().notNull().references(()=>A.id,{onDelete:"cascade",onUpdate:"cascade"}),fromColumn:Y().notNull(),toColumn:Y().notNull(),label:Y()},($)=>[W("DraftRelation_toTableId_idx").on($.toTableId),W("DraftRelation_fromTableId_idx").on($.fromTableId)]),I=P("CodeFile",{path:Y().primaryKey(),root:Y(),lang:Y(),x:F().default(0).notNull(),y:F().default(0).notNull(),mtimeMs:F(),size:B(),inDegree:B().default(0).notNull(),outDegree:B().default(0).notNull(),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),u=P("CodeFileEdge",{fromPath:Y().notNull().references(()=>I.path,{onDelete:"cascade",onUpdate:"cascade"}),toPath:Y().notNull().references(()=>I.path,{onDelete:"cascade",onUpdate:"cascade"}),circular:B({mode:"boolean"}).default(!1).notNull()},($)=>[W("CodeFileEdge_circular_idx").on($.circular),W("CodeFileEdge_toPath_idx").on($.toPath),W("CodeFileEdge_fromPath_idx").on($.fromPath),F9({columns:[$.fromPath,$.toPath],name:"CodeFileEdge_fromPath_toPath_pk"})]),R9=P("SyncState",{id:Y().primaryKey().default("singleton"),version:B().default(0).notNull(),codeGraphSyncedAt:B({mode:"timestamp_ms"}),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),E9=P("AppSetting",{id:Y().primaryKey().default("singleton"),intelModel:Y().default("claude-haiku-4-5").notNull(),intelProvider:Y().default("auto").notNull(),editor:Y().default("auto").notNull(),currentFeatureId:Y(),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)}),_9=P("ProjectMeta",{id:Y().primaryKey().default("singleton"),overview:Y(),conventions:Y().default("[]").notNull(),updatedAt:B({mode:"timestamp_ms"}).notNull().$defaultFn(()=>new Date).$onUpdate(()=>new Date)});var S0={};e(S0,{tagRelations:()=>k9,nodeTagsRelations:()=>T9,nodeRelations:()=>L9,nodeFileRelations:()=>I9,endpointTableRelations:()=>f9,endpointRelations:()=>g9,edgeRelations:()=>S9,draftTableRelations:()=>u9,draftRelationRelations:()=>b9,draftColumnRelations:()=>z9,dbTableRelations:()=>h9,dbRelationRelations:()=>x9,dbColumnRelations:()=>y9,codeFileRelations:()=>m9,codeFileEdgeRelations:()=>p9});import{relations as q}from"drizzle-orm";var L9=q(U,({one:$,many:Q})=>({files:Q(a),nodeTags:Q(y),edgesOut:Q(S,{relationName:"EdgeFrom"}),edgesIn:Q(S,{relationName:"EdgeTo"}),parent:$(U,{fields:[U.parentId],references:[U.id],relationName:"NodeTree"}),children:Q(U,{relationName:"NodeTree"})})),I9=q(a,({one:$})=>({node:$(U,{fields:[a.nodeId],references:[U.id]})})),k9=q(m,({many:$})=>({nodeTags:$(y)})),T9=q(y,({one:$})=>({node:$(U,{fields:[y.a],references:[U.id]}),tag:$(m,{fields:[y.b],references:[m.id]})})),S9=q(S,({one:$})=>({from:$(U,{fields:[S.fromId],references:[U.id],relationName:"EdgeFrom"}),to:$(U,{fields:[S.toId],references:[U.id],relationName:"EdgeTo"})})),h9=q(w,({many:$})=>({columns:$(r),fksOut:$(x,{relationName:"FkFrom"}),fksIn:$(x,{relationName:"FkTo"}),usages:$(g)})),y9=q(r,({one:$})=>({table:$(w,{fields:[r.tableId],references:[w.id]})})),x9=q(x,({one:$})=>({fromTable:$(w,{fields:[x.fromTableId],references:[w.id],relationName:"FkFrom"}),toTable:$(w,{fields:[x.toTableId],references:[w.id],relationName:"FkTo"})})),g9=q(p,({many:$})=>({tables:$(g)})),f9=q(g,({one:$})=>({endpoint:$(p,{fields:[g.endpointId],references:[p.id]}),table:$(w,{fields:[g.tableId],references:[w.id]})})),u9=q(A,({many:$})=>({columns:$(i),fksOut:$(f,{relationName:"DraftFkFrom"}),fksIn:$(f,{relationName:"DraftFkTo"})})),z9=q(i,({one:$})=>({table:$(A,{fields:[i.tableId],references:[A.id]})})),b9=q(f,({one:$})=>({fromTable:$(A,{fields:[f.fromTableId],references:[A.id],relationName:"DraftFkFrom"}),toTable:$(A,{fields:[f.toTableId],references:[A.id],relationName:"DraftFkTo"})})),m9=q(I,({many:$})=>({edgesOut:$(u,{relationName:"CFEFrom"}),edgesIn:$(u,{relationName:"CFETo"})})),p9=q(u,({one:$})=>({fromFile:$(I,{fields:[u.fromPath],references:[I.path],relationName:"CFEFrom"}),toFile:$(I,{fields:[u.toPath],references:[I.path],relationName:"CFETo"})}));var s9={...T0,...S0};function d9(){let $=process.env.DATABASE_URL;if($&&/^(file:|libsql:|wss?:|https?:|:memory:)/i.test($))return $;return"file:./dev.db"}var o9=d9();function U5($){let Q=l9({url:$});return Q.execute("PRAGMA foreign_keys = ON;"),c9(Q,{schema:s9})}var y0=globalThis,h0=y0.dzDefault??U5(o9);y0.dzDefault=h0;var W5=y0.dzByUrl??=new Map;function n9($){let Q=W5.get($);if(!Q)Q=U5($),W5.set($,Q);return Q}function a9(){if(process.env.BEACON_REPO)return h0;let $=I0()??n();if(!$)return h0;return n9(R0($))}var r9=new Proxy({},{get($,Q){let Z=a9(),X=Z[Q];return typeof X==="function"?X.bind(Z):X}});import{forceCenter as d$,forceCollide as o$,forceLink as n$,forceManyBody as a$,forceSimulation as r$}from"d3-force";var P5=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(),dependsOn:R.array(R.string()).nullish()}).transform(({category:$,domain:Q,priority:Z,...X})=>({...X,cluster:X.cluster??$??Q??null,priority:Z==null?null:Math.max(0,Math.min(3,Math.round(Z)))})),HQ=R.object({features:R.array(P5).default([])});var i9=/(\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 C5($){return!!$&&i9.test($)}function t9($){return $.cluster??$.category??$.domain??null}function O5($){let Q=$.map((Z)=>{let X=[],V=t9(Z);if(!V||!V.trim())X.push("category");if(Z.priority==null)X.push("priority");return X.length?` \u2022 "${Z.title?.trim()||"(untitled)"}" \u2014 missing ${X.join(" + ")}`:null}).filter((Z)=>Z!==null);if(Q.length===0)return null;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. Missing:
|
|
226
226
|
`+Q.join(`
|
|
227
|
-
`)+"\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). Set BOTH on EVERY feature; don't rely on defaults."}var x0=1500,
|
|
228
|
-
`)}await i0();var u0=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`,z0=Y5(),B0=V0(z0);try{_0(z0);let $=await k0(B0);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",B0),Z.set(I0,z0);let X=await fetch(`${u0}${$}`,{...Q,headers:Z}),V=await X.text();if(!X.ok)throw Error(`Beacon ${$} -> ${X.status} ${V}`);return V?JSON.parse(V):null}function c($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function R5($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let X=JSON.parse(Z[0]);if(X?.error)return{content:[{type:"text",text:X.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var D=new t9({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($,null,2)}]}});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.")}},async({title:$,id:Q,front:Z,detail:X,category:V})=>{try{let H=await c("/api/map/start",{title:$,id:Q,front:Z,detail:X,category:V});return{content:[{type:"text",text:JSON.stringify(H)}]}}catch(H){return R5(H)}});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")})).describe("the sub-tasks to add")}},async({parentId:$,parentTitle:Q,items:Z})=>{try{let X=await c("/api/nodes/subtasks",{parentId:$,parentTitle:Q,items:Z});return{content:[{type:"text",text:JSON.stringify(X,null,2)}]}}catch(X){return R5(X)}});D.registerTool("beacon_describe_feature",{description:"Call ONCE at the end of a feature: marks status=DONE, records the files you touched (kept on the FEATURE for context), and replaces the node's description with `description` markdown. Subsumes touch_files + finish_feature. If the feature added or materially changed a REAL architectural component (a subsystem \u2014 never a file), also pass `architecture` to keep the Architecture map accurate.",inputSchema:{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"),id:J.string().optional().describe("node id from beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),architecture: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"),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")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file")}},async({description:$,files:Q,id:Z,title:X,architecture:V})=>{let H=await c("/api/map/describe",{description:$,files:Q,id:Z,title:X,architecture:V});return{content:[{type:"text",text:JSON.stringify(H)}]}});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"),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"),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")})).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")})).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 c("/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 X=new URLSearchParams;if($)X.set("id",$);if(Q)X.set("title",Q);if(Z)X.set("query",Z);let V=await E(`/api/context/feature?${X.toString()}`);return{content:[{type:"text",text:JSON.stringify(V,null,2)}]}});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 X=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(X,null,2)}]}});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,null,2)}]}});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 the tool REJECTS a plan whose features omit either, so set both 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")})).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()}},async({description:$,features:Q,tables:Z,relations:X,endpoints:V})=>{let H=(M)=>new Promise((j0)=>setTimeout(j0,M)),B=(M)=>({content:[{type:"text",text:M}]}),N=(Z?.length??0)>0,K=(Q??[]).map((M)=>`${M.title} ${M.role??""} ${M.plain??""}`).join(`
|
|
227
|
+
`)+"\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). Set BOTH on EVERY feature; don't rely on defaults."}var x0=1500,PQ=345600000,g0=1800000,w5=3000;function t($){return $.toLowerCase().normalize("NFD").replace(/[\u0300-\u036F]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,50)||"item"}function q5($){return`${t($.title)}-${$.id.slice(-6)}`}function D5($){return{resources:$.map((Q)=>({uri:`note://${q5(Q)}`,name:Q.title||"Untitled",description:`${Q.title||"Untitled"}${Q.pinned?" \xB7 pinned":""} \xB7 note`,mimeType:"text/markdown"}))}}function F5($,Q){return $.find((Z)=>q5(Z)===Q)}function v5($){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(`
|
|
228
|
+
`)}await i0();var u0=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`,z0=Y5(),B0=V0(z0);try{_0(z0);let $=await k0(B0);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",B0),Z.set(L0,z0);let X=await fetch(`${u0}${$}`,{...Q,headers:Z}),V=await X.text();if(!X.ok)throw Error(`Beacon ${$} -> ${X.status} ${V}`);return V?JSON.parse(V):null}function c($,Q){return E($,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Q)})}function R5($){let Q=$ instanceof Error?$.message:String($),Z=Q.match(/\{[\s\S]*\}$/);if(Z)try{let X=JSON.parse(Z[0]);if(X?.error)return{content:[{type:"text",text:X.error}],isError:!0}}catch{}return{content:[{type:"text",text:Q}],isError:!0}}var D=new e9({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($,null,2)}]}});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.")}},async({title:$,id:Q,front:Z,detail:X,category:V})=>{try{let H=await c("/api/map/start",{title:$,id:Q,front:Z,detail:X,category:V});return{content:[{type:"text",text:JSON.stringify(H)}]}}catch(H){return R5(H)}});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")})).describe("the sub-tasks to add")}},async({parentId:$,parentTitle:Q,items:Z})=>{try{let X=await c("/api/nodes/subtasks",{parentId:$,parentTitle:Q,items:Z});return{content:[{type:"text",text:JSON.stringify(X,null,2)}]}}catch(X){return R5(X)}});D.registerTool("beacon_describe_feature",{description:"Call ONCE at the end of a feature: marks status=DONE, records the files you touched (kept on the FEATURE for context), and replaces the node's description with `description` markdown. Subsumes touch_files + finish_feature. If the feature added or materially changed a REAL architectural component (a subsystem \u2014 never a file), also pass `architecture` to keep the Architecture map accurate.",inputSchema:{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"),id:J.string().optional().describe("node id from beacon_map (preferred over title)"),title:J.string().optional().describe("feature title (fuzzy-matched if no id)"),architecture: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"),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")})).optional().describe("Only when the feature adds/changes a REAL architectural component \u2014 upserts curated nodes, never one-per-file")}},async({description:$,files:Q,id:Z,title:X,architecture:V})=>{let H=await c("/api/map/describe",{description:$,files:Q,id:Z,title:X,architecture:V});return{content:[{type:"text",text:JSON.stringify(H)}]}});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"),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"),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")})).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")})).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 c("/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 X=new URLSearchParams;if($)X.set("id",$);if(Q)X.set("title",Q);if(Z)X.set("query",Z);let V=await E(`/api/context/feature?${X.toString()}`);return{content:[{type:"text",text:JSON.stringify(V,null,2)}]}});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 X=await E(`/api/context/file?${Z.toString()}`);return{content:[{type:"text",text:JSON.stringify(X,null,2)}]}});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,null,2)}]}});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 the tool REJECTS a plan whose features omit either, so set both 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")})).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()}},async({description:$,features:Q,tables:Z,relations:X,endpoints:V})=>{let H=(M)=>new Promise((j0)=>setTimeout(j0,M)),j=(M)=>({content:[{type:"text",text:M}]}),N=(Z?.length??0)>0,K=(Q??[]).map((M)=>`${M.title} ${M.role??""} ${M.plain??""}`).join(`
|
|
229
229
|
`),O=(V?.length??0)>0||C5(`${$}
|
|
230
|
-
${K}`);if(!N&&O)return
|
|
230
|
+
${K}`);if(!N&&O)return j("\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 M=O5(Q);if(M)return j(M)}let l=(Z?.length??0)+(V?.length??0)>0;await c("/api/plan",{description:$,draft:l?{tables:Z??[],relations:X??[],endpoints:V??[]}:void 0,features:Q?.length?Q:void 0}),await fetch(`${u0}/api/workspace/activate?id=${B0}`).catch(()=>{});let I5=Date.now()+g0;while(Date.now()<I5){await H(x0);let M=await E("/api/plan/verdict").catch(()=>null);if(!M)continue;if(M.kind==="feedback")return j("\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:
|
|
231
231
|
|
|
232
232
|
`+M.feedback);if(M.kind==="approved"){let j0=M.features?.length?`
|
|
233
233
|
|
|
234
234
|
\u26A0\uFE0F This plan created these roadmap feature(s):
|
|
235
235
|
`+M.features.map((k5)=>` \u2022 ${k5}`).join(`
|
|
236
|
-
`)+"\n\nAs you SHIP each one, call `beacon_describe_feature` for it BY ITS EXACT TITLE (with the files you touched + a short summary) so it flips to Done. Do this per "+"feature \u2014 do NOT register only the umbrella, or the rest stay Pending on the map.":"";return
|
|
236
|
+
`)+"\n\nAs you SHIP each one, call `beacon_describe_feature` for it BY ITS EXACT TITLE (with the files you touched + a short summary) so it flips to Done. Do this per "+"feature \u2014 do NOT register only the umbrella, or the rest stay Pending on the map.":"";return j(`\u2705 Plan approved by the user. ${M.summary}`+(M.detail?`
|
|
237
237
|
|
|
238
238
|
Implement EXACTLY the schema below (migrations + code) \u2014 the user may have `+`edited columns on the canvas:
|
|
239
239
|
|
|
240
|
-
`+M.detail:"")+j0)}if(M.kind==="discarded")return
|
|
240
|
+
`+M.detail:"")+j0)}if(M.kind==="discarded")return j(`\u274C The user discarded the plan in Beacon. ${M.summary} Ask what they want to adjust before proposing again.`)}return j("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.")});D.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)),X=(H)=>({content:[{type:"text",text:H}]});await c("/api/plan",{description:$,markdown:Q}),await fetch(`${u0}/api/workspace/activate?id=${B0}`).catch(()=>{});let V=Date.now()+g0;while(Date.now()<V){await Z(x0);let H=await E("/api/plan/verdict").catch(()=>null);if(!H)continue;if(H.kind==="feedback")return X("\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:
|
|
241
241
|
|
|
242
242
|
`+H.feedback);if(H.kind==="approved")return X(`\u2705 Plan approved by the user. ${H.summary??""}`.trim()+(H.detail?`
|
|
243
243
|
|
|
244
244
|
Implement exactly what's on the board:
|
|
245
245
|
|
|
246
|
-
${H.detail}`:""));if(H.kind==="discarded")return X(`\u274C The user discarded the plan in Beacon. ${H.summary??""} Ask what they want to adjust before presenting again.`.trim())}return X("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 E5=($)=>Array.isArray($)?$[0]:$;async function G0($){return(await E(`/api/entities?kind=${$}`)).items}function _5($,Q){return{resources:$.map((Z)=>({uri:`${Q}${t(Z.title)}`,name:Z.title,description:`${Z.title}${Z.cluster?` \xB7 ${Z.cluster}`:""} \xB7 ${Z.status}`,mimeType:"text/markdown"}))}}async function
|
|
247
|
-
`)}]}}D.registerResource("beacon-feature",new f0("feature://{slug}",{list:async()=>_5(await G0("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})=>
|
|
246
|
+
${H.detail}`:""));if(H.kind==="discarded")return X(`\u274C The user discarded the plan in Beacon. ${H.summary??""} Ask what they want to adjust before presenting again.`.trim())}return X("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 E5=($)=>Array.isArray($)?$[0]:$;async function G0($){return(await E(`/api/entities?kind=${$}`)).items}function _5($,Q){return{resources:$.map((Z)=>({uri:`${Q}${t(Z.title)}`,name:Z.title,description:`${Z.title}${Z.cluster?` \xB7 ${Z.cluster}`:""} \xB7 ${Z.status}`,mimeType:"text/markdown"}))}}async function L5($,Q,Z){let X=(await G0(Z)).find((N)=>t(N.title)===E5(Q));if(!X)return{contents:[{uri:$.href,mimeType:"text/markdown",text:"(not found)"}]};let H=((await E("/api/entities?kind=tables")).items??[]).map((N)=>N.name),j=[`# ${X.title}`];if(X.cluster)j.push(`*Domain:* \`${X.cluster}\``);if(X.status)j.push(`*Status:* \`${X.status}\``);if(j.push(""),j.push(X.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 N=await G0("features"),K=[...new Set(N.map((O)=>O.cluster?.trim()).filter((O)=>!!O))].sort();j.push("","## Existing feature categories \u2014 reuse one before inventing a new one"),j.push(K.length?K.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.** When the work is done, call `beacon_describe_feature` with the files you touched + a short markdown summary, so the map and AGENTS.md stay accurate for the next session.")}return{contents:[{uri:$.href,mimeType:"text/markdown",text:j.join(`
|
|
247
|
+
`)}]}}D.registerResource("beacon-feature",new f0("feature://{slug}",{list:async()=>_5(await G0("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})=>L5($,Q,"features"));D.registerResource("beacon-component",new f0("component://{slug}",{list:async()=>_5(await G0("architecture"),"component://")}),{title:"Beacon: architecture",description:"Architecture components \u2014 picking one imports 'what the agent sees'.",mimeType:"text/markdown"},($,{slug:Q})=>L5($,Q,"architecture"));async function A5(){return await E("/api/notes")}D.registerResource("beacon-note",new f0("note://{slug}",{list:async()=>D5(await A5())}),{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=F5(await A5(),E5(Q)),X=Z?v5(Z):"(not found)";return{contents:[{uri:$.href,mimeType:"text/markdown",text:X}]}});await D.connect(new $$);var H0=-1;setInterval(async()=>{try{let{version:$}=await E("/api/version");if(H0===-1)H0=$;else if($!==H0)H0=$,D.sendResourceListChanged()}catch{}},w5);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
CREATE TABLE `BoardAnnotation` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`targetKind` text NOT NULL,
|
|
4
|
+
`targetId` text NOT NULL,
|
|
5
|
+
`columnName` text,
|
|
6
|
+
`body` text DEFAULT '' NOT NULL,
|
|
7
|
+
`x` real,
|
|
8
|
+
`y` real,
|
|
9
|
+
`createdAt` integer NOT NULL,
|
|
10
|
+
`updatedAt` integer NOT NULL
|
|
11
|
+
);
|
|
12
|
+
--> statement-breakpoint
|
|
13
|
+
CREATE INDEX `BoardAnnotation_target_idx` ON `BoardAnnotation` (`targetId`);
|