trybeacon 0.1.47 → 0.1.49
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 +14 -12
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/routes-manifest.json +12 -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 -1
- package/.next/server/app/api/board-annotations/route.js +1 -1
- package/.next/server/app/api/board-layout/route.js +1 -1
- package/.next/server/app/api/bug-flags/[id]/route.js +1 -1
- package/.next/server/app/api/bug-flags/route.js +1 -1
- 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/context/feature/route.js +1 -1
- package/.next/server/app/api/context/file/route.js +1 -1
- package/.next/server/app/api/context/route.js +2 -2
- package/.next/server/app/api/db/arrange/route.js +1 -1
- package/.next/server/app/api/db/backfill-access/route.js +1 -1
- package/.next/server/app/api/db/position/route.js +1 -1
- package/.next/server/app/api/db/prune-planned/route.js +1 -1
- package/.next/server/app/api/db/reconcile-endpoints/route.js +1 -1
- package/.next/server/app/api/db/relations/[id]/route.js +1 -1
- package/.next/server/app/api/db/tables/[id]/route.js +1 -1
- package/.next/server/app/api/draft/approve/route.js +1 -1
- package/.next/server/app/api/draft/route.js +1 -1
- package/.next/server/app/api/draft/status/route.js +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/endpoints/[id]/route.js +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/flags/route.js +1 -0
- package/.next/server/app/api/flags/route.js.nft.json +1 -0
- package/.next/server/app/api/flags/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/ingest/route.js +2 -2
- package/.next/server/app/api/init/route.js +1 -1
- package/.next/server/app/api/map/describe/route.js +2 -2
- package/.next/server/app/api/map/files/route.js +1 -1
- package/.next/server/app/api/map/finish/route.js +1 -1
- package/.next/server/app/api/map/route.js +1 -1
- package/.next/server/app/api/map/start/route.js +1 -1
- package/.next/server/app/api/map/touch-active/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/position/route.js +1 -1
- package/.next/server/app/api/nodes/[id]/route.js +1 -1
- package/.next/server/app/api/nodes/positions/route.js +1 -1
- package/.next/server/app/api/nodes/route.js +1 -1
- package/.next/server/app/api/nodes/subtasks/route.js +1 -1
- package/.next/server/app/api/notes/[id]/route.js +1 -1
- package/.next/server/app/api/notes/route.js +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/approve/route.js +2 -2
- 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/presence/route.js +1 -1
- package/.next/server/app/api/plan/route.js +1 -1
- package/.next/server/app/api/plan/verdict/route.js +1 -1
- package/.next/server/app/api/preferences/route.js +1 -1
- package/.next/server/app/api/project-meta/route.js +1 -1
- package/.next/server/app/api/reset/route.js +1 -1
- package/.next/server/app/api/scope-guard/check/route.js +1 -0
- package/.next/server/app/api/scope-guard/check/route.js.nft.json +1 -0
- package/.next/server/app/api/scope-guard/check/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/stream/route.js +2 -2
- package/.next/server/app/api/tab/nav/route.js +1 -1
- package/.next/server/app/api/tab/presence/route.js +1 -1
- package/.next/server/app/api/telemetry/route.js +1 -1
- package/.next/server/app/api/telemetry/stats/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/api/workspace/activate/route.js +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 +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- 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 +14 -12
- package/.next/server/chunks/1341.js +1 -1
- package/.next/server/chunks/249.js +1 -1
- package/.next/server/chunks/2933.js +1 -1
- package/.next/server/chunks/{7208.js → 2999.js} +3 -3
- package/.next/server/chunks/3221.js +2 -2
- package/.next/server/chunks/3622.js +1 -1
- package/.next/server/chunks/4378.js +1 -1
- package/.next/server/chunks/4940.js +1 -1
- package/.next/server/chunks/7331.js +1 -0
- package/.next/server/chunks/9213.js +1 -1
- package/.next/server/chunks/9683.js +1 -1
- package/.next/server/chunks/9734.js +1 -1
- 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/chunks/3343-af1292b51a276724.js +1 -0
- package/.next/static/chunks/7323-480fb88e9d24f9e9.js +1 -0
- package/.next/static/chunks/app/_global-error/page-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/context/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/edges/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/entities/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/flags/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/init/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/notes/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/open/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/reset/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/scope-guard/check/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/stream/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/tab/nav/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/tab/presence/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/version/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/app/map/page-66d71744ae3363d7.js +1 -0
- package/.next/static/chunks/app/page-541e900d67f17dae.js +1 -0
- package/.next/static/chunks/app/plan/page-e7d16fa2a3713a92.js +1 -0
- package/.next/static/chunks/app/settings/page-7e176d120b1effa9.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-dc3f0f4fd9e88c4e.js +1 -0
- package/.next/static/css/629ab377241de9ca.css +1 -0
- package/.next/static/qeqVD-yeoYO_3C0pw9kHg/_buildManifest.js +1 -0
- package/.next/trace +39 -39
- package/.next/trace-build +1 -1
- package/.next/types/app/api/flags/route.ts +351 -0
- package/.next/types/app/api/scope-guard/check/route.ts +351 -0
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +18 -0
- package/dist/bin/beacon.js +7 -7
- package/dist/bin/doctor.js +33 -26
- package/dist/bin/guard.js +3 -0
- package/dist/bin/hook.js +33 -26
- package/dist/bin/mcp.js +42 -35
- package/dist/bin/plan.js +34 -27
- package/dist/bin/remove.js +7 -6
- package/dist/bin/uninstall.js +33 -26
- package/dist/lib/assets.js +20 -13
- package/dist/lib/codex-install.js +30 -23
- package/dist/lib/global-install.js +30 -23
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/workspaces.js +1 -1
- package/drizzle/0008_good_lucky_pierre.sql +21 -0
- package/drizzle/meta/0008_snapshot.json +1904 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/public/install.sh +37 -6
- package/.next/server/chunks/142.js +0 -1
- package/.next/static/OO5fwNXOYFYnu4W91Z44C/_buildManifest.js +0 -1
- package/.next/static/chunks/5811-4d1f942c37146b40.js +0 -1
- package/.next/static/chunks/8074-a6b2725786399e2c.js +0 -1
- package/.next/static/chunks/app/_global-error/page-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/context/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/edges/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/entities/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/init/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/notes/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/open/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/reset/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/stream/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/tab/nav/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/tab/presence/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/telemetry/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/telemetry/stats/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/version/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/app/map/page-a0bcd15b8dbfb3d3.js +0 -1
- package/.next/static/chunks/app/page-968dd5a6f667bff9.js +0 -1
- package/.next/static/chunks/app/plan/page-376f36858e187c73.js +0 -1
- package/.next/static/chunks/app/settings/page-67cab634be8bfef2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-16ca2ed05a1d74d1.js +0 -1
- package/.next/static/css/2d019ca6e0582481.css +0 -1
- /package/.next/static/{OO5fwNXOYFYnu4W91Z44C → qeqVD-yeoYO_3C0pw9kHg}/_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/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/stream" | "/api/tab/nav" | "/api/tab/presence" | "/api/telemetry" | "/api/telemetry/stats" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/flags" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/scope-guard/check" | "/api/stream" | "/api/tab/nav" | "/api/tab/presence" | "/api/telemetry" | "/api/telemetry/stats" | "/api/version" | "/api/workspace" | "/api/workspace/activate"
|
|
6
6
|
type PageRoutes = never
|
|
7
7
|
type LayoutRoutes = "/"
|
|
8
8
|
type RedirectRoutes = never
|
|
@@ -39,6 +39,7 @@ interface ParamMap {
|
|
|
39
39
|
"/api/feedback": {}
|
|
40
40
|
"/api/feedback/[id]": { "id": string; }
|
|
41
41
|
"/api/feedback/[id]/vote": { "id": string; }
|
|
42
|
+
"/api/flags": {}
|
|
42
43
|
"/api/ingest": {}
|
|
43
44
|
"/api/init": {}
|
|
44
45
|
"/api/map": {}
|
|
@@ -65,6 +66,7 @@ interface ParamMap {
|
|
|
65
66
|
"/api/preferences": {}
|
|
66
67
|
"/api/project-meta": {}
|
|
67
68
|
"/api/reset": {}
|
|
69
|
+
"/api/scope-guard/check": {}
|
|
68
70
|
"/api/stream": {}
|
|
69
71
|
"/api/tab/nav": {}
|
|
70
72
|
"/api/tab/presence": {}
|
package/.next/types/validator.ts
CHANGED
|
@@ -353,6 +353,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
353
353
|
type __Unused = __Check
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
// Validate ../../app/api/flags/route.ts
|
|
357
|
+
{
|
|
358
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/flags">> = Specific
|
|
359
|
+
const handler = {} as typeof import("../../app/api/flags/route.js")
|
|
360
|
+
type __Check = __IsExpected<typeof handler>
|
|
361
|
+
// @ts-ignore
|
|
362
|
+
type __Unused = __Check
|
|
363
|
+
}
|
|
364
|
+
|
|
356
365
|
// Validate ../../app/api/ingest/route.ts
|
|
357
366
|
{
|
|
358
367
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/ingest">> = Specific
|
|
@@ -587,6 +596,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
587
596
|
type __Unused = __Check
|
|
588
597
|
}
|
|
589
598
|
|
|
599
|
+
// Validate ../../app/api/scope-guard/check/route.ts
|
|
600
|
+
{
|
|
601
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/scope-guard/check">> = Specific
|
|
602
|
+
const handler = {} as typeof import("../../app/api/scope-guard/check/route.js")
|
|
603
|
+
type __Check = __IsExpected<typeof handler>
|
|
604
|
+
// @ts-ignore
|
|
605
|
+
type __Unused = __Check
|
|
606
|
+
}
|
|
607
|
+
|
|
590
608
|
// Validate ../../app/api/stream/route.ts
|
|
591
609
|
{
|
|
592
610
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/stream">> = Specific
|
package/dist/bin/beacon.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{execSync as _,spawn as m}from"child_process";import{existsSync as u,mkdirSync as g,openSync as c,readFileSync as
|
|
4
|
-
\u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${H}`),console.log(` \u2713 skill: ${B}`);for(let I of y)console.log(` \u2713 skill: ${I}`);console.log(` ${
|
|
5
|
-
`)}return{initSkill:H,refreshSkill:B,mcp
|
|
6
|
-
`+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let W=X(z),F=J(W),M=!u(U(F,"db.sqlite"));if(M)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await K(W);if(!N.ok)console.error(`[beacon] failed to provision database: ${N.error}`);if(M)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:H}=await E(z,!0),B=[];if(H.skillsAdded.length)B.push(`skills ${H.skillsAdded.join(", ")}`);if(H.hooksAdded)B.push(`${H.hooksAdded} Claude Code hook${H.hooksAdded===1?"":"s"}`);if(H.claudeMdBlockTouched)B.push("global CLAUDE.md block");if(B.length)console.log(`[beacon] wired into ~/.claude/: ${B.join(" + ")}.`);let
|
|
3
|
+
import{execSync as _,spawn as m}from"child_process";import{existsSync as u,mkdirSync as g,openSync as c,readFileSync as d,writeFileSync as p}from"fs";import{homedir as t,platform as L}from"os";import{basename as l,dirname as j,join as U}from"path";import{fileURLToPath as a}from"url";var T=j(a(import.meta.url)),O=l(j(T))==="dist",V=O?j(j(T)):j(T),P=process.cwd(),v=process.env.BEACON_HOME||U(t(),".beacon"),A=U(v,"server.json"),w=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=U(V,"drizzle");function Q(z){if(!O)return U(V,z);return U(V,"dist",z.replace(/\.ts$/,".js"))}var Y=process.argv[2];if(Y==="mcp")await import(Q("bin/mcp.ts"));else if(Y==="hook")await import(Q("bin/hook.ts"));else if(Y==="guard")await import(Q("bin/guard.ts"));else if(Y==="plan")await import(Q("bin/plan.ts"));else if(Y==="prompt")await import(Q("bin/prompt.ts"));else if(Y==="stop-hook")await import(Q("bin/stop-hook.ts"));else if(Y==="stop")f();else if(Y==="remove")await import(Q("bin/remove.ts"));else if(Y==="setup")await E(D()||P);else if(Y==="doctor")await import(Q("bin/doctor.ts"));else if(Y==="uninstall")await import(Q("bin/uninstall.ts"));else if(Y==="update")await zz(process.argv.includes("--force")||process.argv.includes("-f"));else if(Y==="telemetry")await e(process.argv[3]);else if(Y==="version"||Y==="--version"||Y==="-v")console.log(x());else await r();async function E(z,Z=!1){let{installInitSkill:X,installRefreshSkill:J,installCodexRepoSkills:K,ensureMcp:G,ensureWorkflowDoc:W}=await import(Q("lib/assets.ts")),{selfHealGlobal:F}=await import(Q("lib/global-install.ts")),{codexDetected:M}=await import(Q("lib/codex-install.ts")),N=await F(),H=X(z),B=J(z);W(z);let $=G(z),y=M()?K(z):[];if(Z){if($.added||$.updated)console.log(`[beacon] ${$.added?"registered":"updated"} Beacon MCP in ${$.path} \u2014 restart your agent CLI`+($.updated?" to apply the longer plan-review timeout.":" to use @beacon mentions."))}else{console.log(`
|
|
4
|
+
\u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${H}`),console.log(` \u2713 skill: ${B}`);for(let I of y)console.log(` \u2713 skill: ${I}`);console.log(` ${$.added?"\u2713 added ":"\xB7 kept "} Beacon MCP in ${$.path}`),console.log(` \u2192 in this repo, run /beacon-init in your agent (Claude Code or Codex) to map the repo.
|
|
5
|
+
`)}return{initSkill:H,refreshSkill:B,mcp:$,codexSkills:y,heal:N}}function D(){try{return _("git rev-parse --show-toplevel",{cwd:P,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function k(z){try{return process.kill(z,0),!0}catch{return!1}}function R(z){try{return JSON.parse(d(z,"utf8"))}catch{return null}}async function S(z){try{return(await fetch(z)).ok}catch{return!1}}async function n(z,Z=60){for(let X=0;X<Z;X++){if(await S(z))return!0;await new Promise((J)=>setTimeout(J,500))}return!1}function i(z){g(v,{recursive:!0});let Z=c(U(v,"server.log"),"a"),X={...process.env,PORT:z,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:U(V,"drizzle")};delete X.BEACON_REPO,delete X.BEACON_DATA_DIR,delete X.DATABASE_URL;let K=m("bun",O?["run","start"]:["run","dev"],{cwd:V,env:X,detached:!0,stdio:["ignore",Z,Z]});K.unref();let G={pid:K.pid??0,port:z};return p(A,JSON.stringify(G)),G}async function s(){let z=R(A);if(z&&k(z.pid)&&await S(`http://localhost:${z.port}/api/workspace`))return z.port;let{findAvailablePort:Z}=await import(Q("lib/daemon-port.ts")),X=String(await Z(Number(w)));console.log(X===w?"[beacon] starting the Beacon server\u2026":`[beacon] port ${w} is busy \u2014 starting the Beacon server on port ${X}\u2026`);let{port:J}=i(X);if(!await n(`http://localhost:${J}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return J}function o(z){if(process.env.BEACON_NO_OPEN)return;let Z=L()==="darwin"?"open":L()==="win32"?"start":"xdg-open";try{_(`${Z} "${z}"`,{stdio:"ignore"})}catch{}}async function r(){let z=D()||P,{registerWorkspaceExplicit:Z,idForPath:X,dataDirFor:J,ensureWorkspaceDb:K,isRegistrableWorkspacePath:G}=await import(Q("lib/workspaces.ts"));if(!G(z))console.error(`[beacon] refusing to open Beacon in ${z} \u2014 that's your home directory, not a project.
|
|
6
|
+
`+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let W=X(z),F=J(W),M=!u(U(F,"db.sqlite"));if(M)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await K(W);if(!N.ok)console.error(`[beacon] failed to provision database: ${N.error}`);if(M)console.log("[beacon] tip: already have code here? run `/beacon-init` in your agent (Claude Code or Codex) to map the project.");let{heal:H}=await E(z,!0),B=[];if(H.skillsAdded.length)B.push(`skills ${H.skillsAdded.join(", ")}`);if(H.hooksAdded)B.push(`${H.hooksAdded} Claude Code hook${H.hooksAdded===1?"":"s"}`);if(H.claudeMdBlockTouched)B.push("global CLAUDE.md block");if(B.length)console.log(`[beacon] wired into ~/.claude/: ${B.join(" + ")}.`);let $=H.codex;if($){let q=[];if($.skillsAdded.length)q.push(`skills ${$.skillsAdded.join(", ")}`);if($.hooksAdded)q.push(`${$.hooksAdded} Codex hook${$.hooksAdded===1?"":"s"}`);if($.agentsMdBlockTouched)q.push("global AGENTS.md block");if($.mcp.added)q.push("MCP entry in config.toml");if(q.length)console.log(`[beacon] wired into ~/.codex/: ${q.join(" + ")}.`);if($.mcp.error)console.log(`[beacon] codex MCP not wired: ${$.mcp.error}`)}try{let q=await import(Q("lib/telemetry.ts"));if(!q.telemetryStatus().machineId){let b=q.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
|
|
7
7
|
`+` architecture \u2014 never repo names, paths, or code) at most every 12h to count
|
|
8
8
|
`+` active installs. Opt out: \`beacon telemetry off\`, BEACON_TELEMETRY_DISABLED=1,
|
|
9
9
|
or DO_NOT_TRACK=1. Details: beacon telemetry status.${b?"":" (currently disabled by your env)"}`),q.ensureTelemetryId()}}catch{}Z(z);let I=`http://localhost:${await s()}`,C=`/map?ws=${W}`,h=`${I}/api/workspace/activate?id=${W}&redirect=${encodeURIComponent(C)}`;if(console.log(`
|
|
@@ -12,8 +12,8 @@ import{execSync as _,spawn as m}from"child_process";import{existsSync as u,mkdir
|
|
|
12
12
|
data: ${F}
|
|
13
13
|
url: ${I}
|
|
14
14
|
`),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),await fetch(`${I}/api/tab/presence`,{headers:{"x-beacon-workspace":W}}).then((q)=>q.json()).then((q)=>!!q?.live).catch(()=>!1))await fetch(`${I}/api/tab/nav`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":W},body:JSON.stringify({path:C})}).catch(()=>{}),console.log(` \u21BB reusing your open Beacon tab \u2014 switch to your browser.
|
|
15
|
-
`);else o(h)}function x(){return R(U(V,"package.json"))?.version??"0.0.0"}async function e(z){let Z=await import(
|
|
15
|
+
`);else o(h)}function x(){return R(U(V,"package.json"))?.version??"0.0.0"}async function e(z){let Z=await import(Q("lib/telemetry.ts"));if(z==="on"||z==="off"){Z.setTelemetryEnabled(z==="on"),console.log(`[beacon] telemetry ${z==="on"?"enabled":"disabled"}.`);return}if(z&&z!=="status")console.error("usage: beacon telemetry [on|off|status]"),process.exit(1);let X=Z.telemetryStatus(),J=X.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":X.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":X.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
|
|
16
16
|
\u25C9 Beacon telemetry: ${X.enabled?"enabled":"disabled"}${J}`),console.log(` machine id: ${X.machineId??"(not generated yet \u2014 created on first `beacon` run)"}`),X.machineId)console.log(` payload: ${JSON.stringify(Z.heartbeatPayload(x()))}`);console.log(` sent at most every 12h while the daemon runs \u2014 never repo names, paths, or code.
|
|
17
|
-
`+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function zz(z){let Z=x(),{INSTALL_COMMAND:X,NPM_LATEST_URL:J}=await import(
|
|
18
|
-
npm i -g trybeacon@latest`);return}let K=null;try{let G=await fetch(J);if(G.ok)K=(await G.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:G}=await import(
|
|
17
|
+
`+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function zz(z){let Z=x(),{INSTALL_COMMAND:X,NPM_LATEST_URL:J}=await import(Q("lib/release.ts"));if(L()==="win32"){console.log(`[beacon] current version v${Z}.`),console.log(`[beacon] on Windows, update with your package manager:
|
|
18
|
+
npm i -g trybeacon@latest`);return}let K=null;try{let G=await fetch(J);if(G.ok)K=(await G.json()).version??null}catch{}if(K&&!z){let{isNewerVersion:G}=await import(Q("lib/semver.ts"));if(!G(K,Z)){console.log(`[beacon] already on the latest version (v${Z}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(K?`[beacon] updating Beacon v${Z} \u2192 v${K}\u2026`:`[beacon] reinstalling Beacon (current v${Z})\u2026`);try{_(X,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
|
|
19
19
|
${X}`),process.exitCode=1;return}f(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function f(){let z=R(A);if(z&&k(z.pid))try{try{process.kill(-z.pid)}catch{process.kill(z.pid)}console.log(`[beacon] stopped the server (pid ${z.pid}).`)}catch{console.log("[beacon] could not stop the server.")}else console.log("[beacon] no server running.")}
|
package/dist/bin/doctor.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
3
|
+
var MZ=Object.defineProperty;var uZ=(Q)=>Q;function wZ(Q,Z){this[Q]=uZ.bind(null,Z)}var jQ=(Q,Z)=>{for(var $ in Z)MZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:wZ.bind(Z,$)})};var u=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var b0=1500,L0=480000,_0=1800000,L=3600000,k0=3000;var hQ=()=>{};var GQ={};jQ(GQ,{removeRepoAssets:()=>OZ,installRefreshSkill:()=>TZ,installPlanSkill:()=>RZ,installInitSkill:()=>FZ,installCodexRepoSkills:()=>EZ,ensureWorkflowDoc:()=>IZ,ensureMcp:()=>DZ,auditRepo:()=>NQ,REFRESH_SKILL:()=>vQ,PLAN_SKILL:()=>pQ,INIT_SKILL:()=>PQ});import{existsSync as w,mkdirSync as k,readFileSync as x,rmSync as _,writeFileSync as N}from"fs";import{join as q}from"path";function FZ(Q){let Z=q(Q,".claude","skills","beacon-init");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,PQ),$}function TZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,vQ),$}function RZ(Q){let Z=q(Q,".claude","skills","beacon-plan");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,pQ),$}function EZ(Q){let Z=[];for(let $ of gZ){let J=q(Q,".agents","skills",$.name);k(J,{recursive:!0});let Y=q(J,"SKILL.md");N(Y,$.body()),Z.push(Y)}return Z}function IZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=x(Z,"utf8")}catch{}let J=new RegExp(`${S}[\\s\\S]*?${BQ}`);$=J.test($)?$.replace(J,mQ):`${$.trim()}
|
|
4
4
|
|
|
5
|
-
${
|
|
5
|
+
${mQ}
|
|
6
6
|
`.trimStart(),N(Z,$.endsWith(`
|
|
7
7
|
`)?$:`${$}
|
|
8
|
-
`);let Y=q(Q,"CLAUDE.md"),V="";try{V=
|
|
8
|
+
`);let Y=q(Q,"CLAUDE.md"),V="";try{V=x(Y,"utf8")}catch{}if(!/@AGENTS\.md/.test(V))N(Y,`${V?`${V.trim()}
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
|
-
`)}function
|
|
12
|
-
`),{path:Z,added:!0}
|
|
13
|
-
`)}}catch{}let
|
|
11
|
+
`)}function DZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(x(Z,"utf8"))}catch{}$.mcpServers=$.mcpServers??{};let J=$.mcpServers.beacon;if(J){if(!J.timeout||J.timeout<L)return J.timeout=L,N(Z,JSON.stringify($,null,2)+`
|
|
12
|
+
`),{path:Z,added:!1,updated:!0};return{path:Z,added:!1,updated:!1}}return $.mcpServers.beacon={command:"beacon",args:["mcp"],timeout:L},N(Z,JSON.stringify($,null,2)+`
|
|
13
|
+
`),{path:Z,added:!0,updated:!1}}function NQ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(x(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=x(q(Q,"AGENTS.md"),"utf8").includes(S)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(x(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":w(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":w(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":w(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":w(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function OZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=q(Q,".claude","skills",z);if(w(P))_(P,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let P=q(Q,".agents","skills",z);if(w(P))_(P,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(x(J,"utf8"));if(z.mcpServers?.beacon){if(delete z.mcpServers.beacon,$=!0,z.mcpServers&&Object.keys(z.mcpServers).length===0)delete z.mcpServers;if(Object.keys(z).length===0)_(J,{force:!0});else N(J,JSON.stringify(z,null,2)+`
|
|
14
|
+
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=x(V,"utf8"),P=new RegExp(`\\n?${S}[\\s\\S]*?${BQ}\\n?`);if(P.test(z)){let HQ=z.replace(P,`
|
|
14
15
|
`).replace(/\n{3,}/g,`
|
|
15
16
|
|
|
16
|
-
`).trimStart();N(V,
|
|
17
|
-
`)?
|
|
18
|
-
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=
|
|
17
|
+
`).trimStart();N(V,HQ.endsWith(`
|
|
18
|
+
`)?HQ:`${HQ}
|
|
19
|
+
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=x(U,"utf8"),P=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(P!==z){if(!P.trim())_(U,{force:!0});else N(U,P);X=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:X}}var PQ=`---
|
|
19
20
|
name: beacon-init
|
|
20
21
|
description: Read this repository and map its architecture, schema, and roadmap into Beacon (the local visual planning panel). Use when the user runs /beacon-init, asks to "set up Beacon for this repo", or asks to initialize/bootstrap Beacon's map of this codebase.
|
|
21
22
|
---
|
|
@@ -54,7 +55,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
54
55
|
If \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-init.
|
|
55
56
|
|
|
56
57
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
57
|
-
`,
|
|
58
|
+
`,vQ=`---
|
|
58
59
|
name: beacon-refresh
|
|
59
60
|
description: Re-survey the repo and update Beacon's architecture / schema / endpoints map after /beacon-init was already run \u2014 picks up new components, removed ones, schema changes, and new routes. Use when the user runs /beacon-refresh or asks to "refresh", "update", "re-sync", or "bring Beacon up to date" with the current code.
|
|
60
61
|
---
|
|
@@ -101,7 +102,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
101
102
|
If \`beacon_entities\` or \`beacon_init_persist\` isn't available, the Beacon panel isn't running in this repo. Tell the user to run \`beacon\` here first, then re-invoke /beacon-refresh.
|
|
102
103
|
|
|
103
104
|
After the tool returns, report the final counts plus a one-line summary of the diff you surfaced.
|
|
104
|
-
`,
|
|
105
|
+
`,pQ=`---
|
|
105
106
|
name: beacon-plan
|
|
106
107
|
description: Present your current plan or approach to the user on Beacon's /plan canvas for review \u2014 instead of asking for approval in prose. Use when the user says "present the plan", "show me the plan", "let me see it / the plan", or whenever you are about to end a turn asking whether to proceed with a plan, design, or approach.
|
|
107
108
|
---
|
|
@@ -129,6 +130,12 @@ Beacon extracts that block deterministically, strips it from the prose, and rend
|
|
|
129
130
|
board on /plan. The board is built ONLY from the block \u2014 prose is never parsed \u2014 so mirror EVERY
|
|
130
131
|
table/endpoint/feature you mention in the prose into the block, or that board will be empty.
|
|
131
132
|
|
|
133
|
+
- **Declare your scope.** List the repo-relative files this plan will touch in a top-level
|
|
134
|
+
\`"contract"\` array in the block (or the \`contract\` arg of \`beacon_propose_plan\`). When the user
|
|
135
|
+
has the plan scope-guard enabled, those files are frozen at approval and you're held to them while
|
|
136
|
+
implementing \u2014 editing an undeclared file pauses for the user's authorization (which then adds it
|
|
137
|
+
to the contract). Harmless when the guard is off. Declare the files you genuinely expect to edit.
|
|
138
|
+
|
|
132
139
|
\`beacon_present_plan\` opens /plan and BLOCKS until the user clicks Approve / Discard / submits
|
|
133
140
|
feedback, then returns their verdict. Implement code or migrations ONLY after it returns approval.
|
|
134
141
|
If it returns feedback, revise and call it again.
|
|
@@ -143,7 +150,7 @@ If it returns feedback, revise and call it again.
|
|
|
143
150
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
144
151
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
145
152
|
run \`beacon\` in this repo once.
|
|
146
|
-
`,
|
|
153
|
+
`,gZ,S="<!-- beacon:workflow:start -->",BQ="<!-- beacon:workflow:end -->",mQ;var h=u(()=>{hQ();gZ=[{name:"beacon-init",body:()=>PQ},{name:"beacon-refresh",body:()=>vQ}];mQ=`${S}
|
|
147
154
|
## Beacon \u2014 feature workflow
|
|
148
155
|
|
|
149
156
|
This project uses Beacon (a local planning/visualization panel; run \`beacon\` to open it). When you start work on a FEATURE \u2014 whether referenced via an \`@beacon:feature://\u2026\` mention, an \`@beacon:note://\u2026\` note the user wrote in the Notes panel (treat its checkbox \`- [ ]\` todos as subtasks and order features by their dependencies), or just described in chat \u2014 follow these steps in order:
|
|
@@ -201,18 +208,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
201
208
|
If the feature added or materially changed a REAL architectural component (a subsystem \u2014 NOT a file), also pass \`architecture: [{ title, domain, role, \u2026 }]\` so the Architecture map stays accurate. It upserts curated components by title; never list files as components. If you found a bug or something worth investigating in a component's code, add \`bugs: [{ note }]\` to its architecture entry \u2014 it renders as a bug flag on the node (attributed to the agent); identical open flags are not duplicated. Only flag what you actually saw in the code.
|
|
202
209
|
|
|
203
210
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
204
|
-
${
|
|
205
|
-
`)}function l(Q,Z){let $=
|
|
211
|
+
${BQ}`});import{existsSync as cQ,mkdirSync as xQ,readFileSync as p,rmSync as yZ,writeFileSync as c}from"fs";import{dirname as nQ,join as m}from"path";function KQ(Q){try{return JSON.parse(p(Q,"utf8"))}catch{return{}}}function lQ(Q,Z){xQ(nQ(Q),{recursive:!0}),c(Q,JSON.stringify(Z,null,2)+`
|
|
212
|
+
`)}function l(Q,Z){let $=KQ(Q);$.hooks=$.hooks??{},$.hooks[Z.event]=$.hooks[Z.event]??[];let J=$.hooks[Z.event];if(J.some((V)=>V.matcher===Z.matcher&&V.hooks?.some((X)=>X.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),lQ(Q,$),!0}function s(Q,Z){return(KQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function t(Q,Z){let $=KQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((X)=>{let U=X.hooks?.length??0,z=(X.hooks??[]).filter((P)=>P.command!==Z.command);if(z.length!==U)Y=!0;return{...X,hooks:z}}).filter((X)=>(X.hooks??[]).length>0);if(!Y)return!1;if(V.length)$.hooks[Z.event]=V;else delete $.hooks[Z.event];if($.hooks&&Object.keys($.hooks).length===0)delete $.hooks;return lQ(Q,$),!0}function a(Q,Z,$,J){let Y=`${Z}
|
|
206
213
|
${J.trim()}
|
|
207
|
-
${$}`,V="";try{V=
|
|
214
|
+
${$}`,V="";try{V=p(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
|
|
208
215
|
|
|
209
216
|
${Y}
|
|
210
217
|
`:`${Y}
|
|
211
|
-
`,
|
|
218
|
+
`,xQ(nQ(Q),{recursive:!0}),c(Q,V.endsWith(`
|
|
212
219
|
`)?V:`${V}
|
|
213
|
-
`)}function
|
|
220
|
+
`)}function g(Q,Z){try{return p(Q,"utf8").includes(Z)}catch{return!1}}function d(Q,Z,$){let J="";try{J=p(Q,"utf8")}catch{return!1}let Y=new RegExp(`${Z}[\\s\\S]*?${$}\\n?`);if(!Y.test(J))return!1;let V=J.replace(Y,"").replace(/\n{3,}/g,`
|
|
214
221
|
|
|
215
|
-
`).trimStart();return
|
|
222
|
+
`).trimStart();return c(Q,V),!0}function r(Q,Z,$){let J=m(Q,Z);xQ(J,{recursive:!0});let Y=m(J,"SKILL.md");return c(Y,$),Y}function E(Q,Z){return cQ(m(Q,Z,"SKILL.md"))}function o(Q,Z){let $=m(Q,Z);if(!cQ($))return!1;return yZ($,{recursive:!0,force:!0}),!0}var v,n=`## Beacon (visual planning panel)
|
|
216
223
|
|
|
217
224
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
218
225
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -233,19 +240,19 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
233
240
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
234
241
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
235
242
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
236
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
243
|
+
verbatim. Do NOT implement until the tool returns approval.`;var CQ=u(()=>{v=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as AZ,renameSync as bZ,rmSync as LZ,writeFileSync as _Z}from"fs";import{dirname as kZ}from"path";function i(Q,Z){AZ(kZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{_Z($,Z),bZ($,Q)}catch(J){throw LZ($,{force:!0}),J}}function a0(Q,Z,$=!1){i(Q,JSON.stringify(Z,null,$?2:void 0))}var sQ=()=>{};var eQ={};jQ(eQ,{setupCodexAssets:()=>mZ,removeCodexMcp:()=>iQ,removeCodexArtifacts:()=>pZ,hasCodexMcp:()=>wQ,ensureCodexMcp:()=>oQ,codexMcpProblem:()=>FQ,codexDetected:()=>JQ,auditCodex:()=>TQ,CODEX_HOOKS:()=>C});import{readFileSync as $Q}from"fs";import{homedir as SZ}from"os";import{join as O}from"path";function tQ(){return process.env.HOME||process.env.USERPROFILE||SZ()}function JQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(fQ===void 0)fQ=Bun.which("codex")!==null;return fQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function wQ(){try{return Boolean(D($Q(F(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function FQ(){let Q="";try{Q=$Q(F(),"utf8")}catch{return null}let Z=D(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${I}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${I}`;return null}function oQ(){let Q="",Z=!1;try{Q=$Q(F(),"utf8"),Z=!0}catch{}if(Z){let V=D(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${I}`};if(V.mcp_servers?.beacon)return{added:!1};if(/^\s*mcp_servers\s*=/m.test(Q))return{added:!1,error:`mcp_servers is an inline table \u2014 ${I}`}}let $=!Q?"":Q.endsWith(`
|
|
237
244
|
`)?`
|
|
238
245
|
`:`
|
|
239
246
|
|
|
240
|
-
`,J=Q+$+
|
|
241
|
-
`),$=Z.indexOf(
|
|
247
|
+
`,J=Q+$+hZ;if(D(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return i(F(),J),{added:!0}}function iQ(){let Q="";try{Q=$Q(F(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
248
|
+
`),$=Z.indexOf(dQ);if($===-1)return{removed:!1,skipped:wQ()};let J=Z.indexOf(rQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
242
249
|
`).replace(/\n{3,}/g,`
|
|
243
250
|
|
|
244
|
-
`).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return
|
|
251
|
+
`).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return i(F(),Y),{removed:!0}}async function mZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),GQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of v){if(!E(QQ(),z))Y.push(z);r(QQ(),z,J[z])}let V=0;for(let z of C)if(l(uQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=g(e(),ZQ);a(e(),ZQ,aQ,n);let U=oQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function TQ(){let Q={};for(let $ of v)Q[$]=E(QQ(),$);let Z={};for(let $ of C)Z[$.event]=s(uQ(),{event:$.event,command:$.command});return{detected:JQ(),skills:Q,hooks:Z,agentsMdBlock:g(e(),ZQ),mcp:wQ()}}function pZ(){let Q=[];for(let Y of v)if(o(QQ(),Y))Q.push(Y);let Z=0;for(let Y of C)if(t(uQ(),{event:Y.event,command:Y.command}))Z++;let $=d(e(),ZQ,aQ),J=iQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var MQ=()=>O(tQ(),".codex"),uQ=()=>O(MQ(),"hooks.json"),F=()=>O(MQ(),"config.toml"),e=()=>O(MQ(),"AGENTS.md"),QQ=()=>O(tQ(),".agents","skills"),ZQ="<!-- beacon:global:start -->",aQ="<!-- beacon:global:end -->",C,fQ,dQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",rQ="# beacon:end",hZ,I="add it manually: codex mcp add beacon -- beacon mcp";var RQ=u(()=>{CQ();sQ();C=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];hZ=`${dQ}
|
|
245
252
|
[mcp_servers.beacon]
|
|
246
253
|
command = "beacon"
|
|
247
254
|
args = ["mcp"]
|
|
248
|
-
${
|
|
249
|
-
`});var
|
|
250
|
-
\x1B[1m${Q}\x1B[0m`;function
|
|
251
|
-
${
|
|
255
|
+
${rQ}
|
|
256
|
+
`});var VZ={};jQ(VZ,{provisionDb:()=>j0});import{createClient as Z0}from"@libsql/client";import{drizzle as $0}from"drizzle-orm/libsql";import{migrate as J0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as Y0}from"drizzle-orm/migrator";import{dirname as OQ,join as V0}from"path";import{fileURLToPath as z0}from"url";async function zQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function W0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function YZ(Q){if(!await zQ(Q,"__drizzle_migrations"))return 0;let Z=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(Z.rows[0]?.n??0)}async function H0(Q){for(let[Z,$]of Object.entries(U0)){if(!await zQ(Q,Z))continue;let J=await W0(Q,Z);for(let Y of $){if(!J.has(Y))continue;await Q.execute(`UPDATE "${Z}" SET "${Y}" = CAST((julianday("${Y}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${Y}") = 'text'`)}}}async function j0(Q,Z=X0){let $=Z0({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await zQ($,"__drizzle_migrations"),Y=await zQ($,"Node"),V=!1;if(Y&&!J){let U=Y0({migrationsFolder:Z})[0];if(U)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[U.hash,U.folderMillis]}),V=!0}let X=await YZ($);if(await J0($0($),{migrationsFolder:Z}),await YZ($)>X)V=!0;return await H0($),{migrated:V}}finally{$.close()}}var q0,X0,U0;var zZ=u(async()=>{q0=OQ(OQ(OQ(z0(import.meta.url)))),X0=process.env.BEACON_MIGRATIONS_DIR||V0(q0,"drizzle"),U0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});CQ();import{existsSync as cZ}from"fs";import{homedir as nZ}from"os";import{join as YQ}from"path";function lZ(){return process.env.HOME||process.env.USERPROFILE||nZ()}var VQ=()=>YQ(lZ(),".claude"),gQ=()=>YQ(VQ(),"skills"),EQ=()=>YQ(VQ(),"settings.json"),IQ=()=>YQ(VQ(),"CLAUDE.md"),DQ="<!-- beacon:global:start -->",QZ="<!-- beacon:global:end -->";var sZ=n,T=[{event:"PreToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon guard",description:"Gate edits against the active plan's scope contract (when the scope-guard flag is on): in-scope \u2192 allow, off-scope \u2192 ask the user to authorize. No-op + fail-open otherwise."},{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function tZ(Q,Z){return r(gQ(),Q,Z)}function ZZ(Q){return E(gQ(),Q)}function aZ(Q){return o(gQ(),Q)}function dZ(Q){return l(EQ(),Q)}function rZ(Q){return s(EQ(),Q)}function oZ(Q){return t(EQ(),Q)}function iZ(Q){a(IQ(),DQ,QZ,Q)}function $Z(){return g(IQ(),DQ)}function eZ(){return d(IQ(),DQ,QZ)}function JZ(){let Q={};for(let $ of v)Q[$]=ZZ($);let Z={};for(let $ of T)Z[$.event]=rZ({event:$.event,command:$.command});return{homeExists:cZ(VQ()),skills:Q,hooks:Z,claudeMdBlock:$Z()}}async function Q0(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (h(),GQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of v){if(!ZZ(U))Y.push(U);tZ(U,J[U])}let V=0;for(let U of T)if(dZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=$Z();return iZ(sZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function V1(){let Q;try{Q={ok:!0,...await Q0()}}catch(Z){Q={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,claudeMdBlockTouched:!1}}try{let Z=await Promise.resolve().then(() => (RQ(),eQ));if(Z.codexDetected())Q.codex={ok:!0,...await Z.setupCodexAssets()}}catch(Z){Q.codex={ok:!1,error:Z instanceof Error?Z.message:String(Z),skillsAdded:[],hooksAdded:0,agentsMdBlockTouched:!1,mcp:{added:!1}}}return Q}function z1(){let Q=[];for(let J of v)if(aZ(J))Q.push(J);let Z=0;for(let J of T)if(oZ(J))Z++;let $=eZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as P0}from"async_hooks";import{spawnSync as v0}from"child_process";import{createHash as B0}from"crypto";import{existsSync as XZ,mkdirSync as y,readFileSync as AQ,writeFileSync as bQ}from"fs";import{homedir as UZ}from"os";import{basename as N0,join as K,parse as G0,resolve as qZ}from"path";function G(){return process.env.BEACON_HOME||K(UZ(),".beacon")}function LQ(){return K(G(),"workspaces.json")}function qQ(Q){return B0("sha256").update(Q).digest("hex").slice(0,12)}function C1(Q=process.cwd()){let Z=v0("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(Z.status===0){let $=Z.stdout?.toString().trim();if($)return $}return Q}function WZ(Q){let Z=qZ(Q);return Z!==qZ(UZ())&&Z!==G0(Z).root}function HZ(){return K(G(),"deleted.json")}function _Q(){try{let Q=JSON.parse(AQ(HZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function jZ(Q){y(G(),{recursive:!0}),bQ(HZ(),JSON.stringify(Q,null,2))}function PZ(Q){return _Q().includes(Q)}function f1(Q){let Z=_Q();if(!Z.includes(Q))jZ([...Z,Q])}function x0(Q){let Z=_Q();if(Z.includes(Q))jZ(Z.filter(($)=>$!==Q))}function XQ(Q){return K(G(),Q)}function K0(Q){return`file:${K(XQ(Q),"db.sqlite")}`}function A(){try{let Q=JSON.parse(AQ(LQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function kQ(Q){y(G(),{recursive:!0}),bQ(LQ(),JSON.stringify(Q,null,2))}function UQ(){return A().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function f(Q){return A().find((Z)=>Z.id===Q)??null}function vZ(Q,Z,$=new Date().toISOString()){if(!WZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=qQ(Q);if(PZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=A(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||N0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return y(XQ(J),{recursive:!0}),kQ(U),X}function M1(Q,Z){return x0(qQ(Q)),vZ(Q,Z)}function u1(Q,Z=new Date().toISOString()){let $=A(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,kQ($)}function w1(Q){if(kQ(A().filter((Z)=>Z.id!==Q)),SQ()===Q)C0(UQ()[0]?.id??null)}function BZ(){return K(G(),"active")}function SQ(){try{return AQ(BZ(),"utf8").trim()||null}catch{return null}}function C0(Q){y(G(),{recursive:!0}),bQ(BZ(),Q??"")}function F1(){let Q=SQ();return Q?f(Q):null}function T1(){let Q=u0()??SQ();return Q?f(Q):null}function R1(Q){return f(Q)?.path??null}function g1(){return XZ(LQ())}var NZ="beacon_ws";function GZ(Q,Z){let $=Q.headers.get("cookie");if(!$)return null;for(let J of $.split(";")){let Y=J.indexOf("=");if(Y===-1)continue;if(J.slice(0,Y).trim()===Z)return decodeURIComponent(J.slice(Y+1).trim())}return null}function E1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&f(Z))return Z;let $=GZ(Q,NZ);if($&&f($))return $;return f0()}function f0(){let Q=UQ();return Q.length===1?Q[0].id:null}var M0="x-beacon-workspace-path";async function I1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&f(Z))return Z;let $=Q.headers.get(M0);if($&&WZ($)&&!PZ(qQ($))&&(!Z||qQ($)===Z)){let Y=vZ($);return await w0(Y.id),Y.id}let J=GZ(Q,NZ);if(J&&f(J))return J;return null}var xZ=new P0;function D1(Q,Z){return Q?xZ.run(Q,Z):Z()}function u0(){return xZ.getStore()??null}var yQ=new Set;function O1(Q){yQ.delete(K(XQ(Q),"db.sqlite"))}async function w0(Q){let Z=XQ(Q),$=K(Z,"db.sqlite"),J=XZ($);if(J&&yQ.has($))return{ok:!0,created:!1,migrated:!1};try{y(Z,{recursive:!0});let{provisionDb:Y}=await zZ().then(() => VZ),V=await Y(K0(Q));return yQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}h();RQ();import{execSync as F0,spawnSync as KZ}from"child_process";import{existsSync as T0,readFileSync as R0}from"fs";import{join as CZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,H=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,M=(Q)=>`\x1B[2m${Q}\x1B[0m`,b=(Q)=>`
|
|
257
|
+
\x1B[1m${Q}\x1B[0m`;function g0(){try{return F0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function E0(){let Q=CZ(G(),"server.json");try{let Z=JSON.parse(R0(Q,"utf8"));if(!Z.pid)return H("daemon: no server.json yet");try{return process.kill(Z.pid,0),W(`daemon running (pid ${Z.pid}, port ${Z.port??"?"})`)}catch{return H(`daemon NOT running (server.json stale: pid ${Z.pid})`)}}catch{return H("daemon: no server.json (never started)")}}function I0(){let Q=KZ("bun",["--version"],{stdio:["ignore","pipe","ignore"]});if(Q.status===0)return W(`bun ${Q.stdout.toString().trim()}`);return H("bun NOT found on PATH (required to run Beacon)")}function D0(){return g0()||process.cwd()}var WQ=D0(),R=JZ(),fZ=UQ(),O0=fZ.some((Q)=>Q.path===WQ),j=O0||T0(CZ(WQ,".mcp.json"))?NQ(WQ):null;console.log(b("Beacon \xB7 doctor"));console.log(b("Runtime"));console.log(` ${I0()}`);console.log(` ${E0()}`);console.log(` ${W(`home: ${G()}`)}`);console.log(` ${W(`workspaces registered: ${fZ.length}`)}`);console.log(b("Global (~/.claude/)"));for(let Q of v)console.log(` ${R.skills[Q]?W(`skill ${Q}`):H(`skill ${Q} \u2014 missing`)}`);for(let Q of T)console.log(` ${R.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):H(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${M(Q.description)}`);console.log(` ${R.claudeMdBlock?W("global CLAUDE.md block"):H("global CLAUDE.md block \u2014 missing (every Claude session won't auto-discover Beacon)")}`);console.log(b("Codex (~/.codex/ + ~/.agents/)"));var B=JQ()?TQ():null;if(!B)console.log(` ${M("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=KZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):M("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of v)console.log(` ${B.skills[$]?W(`skill ${$} (~/.agents/skills)`):H(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of C)console.log(` ${B.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):H(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${M($.description)}`);console.log(` ${B.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):H("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=FQ();console.log(` ${B.mcp?W("config.toml has [mcp_servers.beacon]"):H(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(b(`Current repo (${WQ})`));if(!j)console.log(` ${M("not registered with Beacon and no .mcp.json \u2014 run `beacon` here to wire it.")}`);else if(console.log(` ${j.mcpRegistered?W(".mcp.json has beacon entry"):H(".mcp.json missing beacon entry")}`),console.log(` ${j.agentsMdBlock?W("AGENTS.md has Beacon workflow block"):H("AGENTS.md missing Beacon workflow block")}`),console.log(` ${j.claudeMdImport?W("CLAUDE.md @-imports AGENTS.md"):H("CLAUDE.md does NOT @-import AGENTS.md")}`),console.log(` ${j.skills["beacon-init"]?W("skill beacon-init (repo)"):H("skill beacon-init (repo) \u2014 missing")}`),console.log(` ${j.skills["beacon-refresh"]?W("skill beacon-refresh (repo)"):H("skill beacon-refresh (repo) \u2014 missing")}`),B)console.log(` ${j.codexSkills["beacon-init"]?W("skill beacon-init (.agents/skills)"):H("skill beacon-init (.agents/skills) \u2014 missing")}`),console.log(` ${j.codexSkills["beacon-refresh"]?W("skill beacon-refresh (.agents/skills)"):H("skill beacon-refresh (.agents/skills) \u2014 missing")}`);var y0=v.some((Q)=>!R.skills[Q])||T.some((Q)=>!R.hooks[Q.event])||!R.claudeMdBlock||(B?v.some((Q)=>!B.skills[Q])||C.some((Q)=>!B.hooks[Q.event])||!B.agentsMdBlock||!B.mcp:!1)||(j?!j.mcpRegistered||!j.agentsMdBlock||!j.claudeMdImport||!j.skills["beacon-init"]||!j.skills["beacon-refresh"]||(B?!j.codexSkills["beacon-init"]||!j.codexSkills["beacon-refresh"]:!1):!1);if(y0)console.log(`
|
|
258
|
+
${M("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${M("in this repo.")}`);console.log();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
var n=Object.defineProperty;var s=(Q)=>Q;function d(Q,X){this[Q]=s.bind(null,X)}var o=(Q,X)=>{for(var Z in X)n(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:d.bind(X,Z)})};var a=(Q,X)=>()=>(Q&&(X=Q(Q=0)),X);var R={};o(R,{provisionDb:()=>VQ});import{createClient as t}from"@libsql/client";import{drizzle as r}from"drizzle-orm/libsql";import{migrate as i}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as e}from"drizzle-orm/migrator";import{dirname as H,join as QQ}from"path";import{fileURLToPath as XQ}from"url";async function j(Q,X){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[X]})).rows.length>0}async function YQ(Q,X){let Z=await Q.execute(`PRAGMA table_info("${X}")`);return new Set(Z.rows.map(($)=>String($.name)))}async function q(Q){if(!await j(Q,"__drizzle_migrations"))return 0;let X=await Q.execute('SELECT count(*) AS n FROM "__drizzle_migrations"');return Number(X.rows[0]?.n??0)}async function GQ(Q){for(let[X,Z]of Object.entries(JQ)){if(!await j(Q,X))continue;let $=await YQ(Q,X);for(let J of Z){if(!$.has(J))continue;await Q.execute(`UPDATE "${X}" SET "${J}" = CAST((julianday("${J}") - 2440587.5) * 86400000 AS INTEGER) WHERE typeof("${J}") = 'text'`)}}}async function VQ(Q,X=$Q){let Z=t({url:Q});try{await Z.execute("PRAGMA journal_mode = WAL;"),await Z.execute("PRAGMA foreign_keys = ON;"),await Z.execute("PRAGMA busy_timeout = 5000;");let $=await j(Z,"__drizzle_migrations"),J=await j(Z,"Node"),Y=!1;if(J&&!$){let B=e({migrationsFolder:X})[0];if(B)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:[B.hash,B.folderMillis]}),Y=!0}let V=await q(Z);if(await i(r(Z),{migrationsFolder:X}),await q(Z)>V)Y=!0;return await GQ(Z),{migrated:Y}}finally{Z.close()}}var ZQ,$Q,JQ;var D=a(async()=>{ZQ=H(H(H(XQ(import.meta.url)))),$Q=process.env.BEACON_MIGRATIONS_DIR||QQ(ZQ,"drizzle"),JQ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});import{AsyncLocalStorage as KQ}from"async_hooks";import{spawnSync as BQ}from"child_process";import{createHash as NQ}from"crypto";import{existsSync as v,mkdirSync as U,readFileSync as _,writeFileSync as T}from"fs";import{homedir as W}from"os";import{basename as MQ,join as K,parse as UQ,resolve as I}from"path";function G(){return process.env.BEACON_HOME||K(W(),".beacon")}function x(){return K(G(),"workspaces.json")}function M(Q){return NQ("sha256").update(Q).digest("hex").slice(0,12)}function S(Q=process.cwd()){let X=BQ("git",["rev-parse","--show-toplevel"],{cwd:Q,stdio:["ignore","pipe","ignore"]});if(X.status===0){let Z=X.stdout?.toString().trim();if(Z)return Z}return Q}function F(Q){let X=I(Q);return X!==I(W())&&X!==UQ(X).root}function P(){return K(G(),"deleted.json")}function E(){try{let Q=JSON.parse(_(P(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function y(Q){U(G(),{recursive:!0}),T(P(),JSON.stringify(Q,null,2))}function f(Q){return E().includes(Q)}function bQ(Q){let X=E();if(!X.includes(Q))y([...X,Q])}function LQ(Q){let X=E();if(X.includes(Q))y(X.filter((Z)=>Z!==Q))}function z(Q){return K(G(),Q)}function jQ(Q){return`file:${K(z(Q),"db.sqlite")}`}function L(){try{let Q=JSON.parse(_(x(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function u(Q){U(G(),{recursive:!0}),T(x(),JSON.stringify(Q,null,2))}function k(){return L().sort((Q,X)=>X.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function N(Q){return L().find((X)=>X.id===Q)??null}function g(Q,X,Z=new Date().toISOString()){if(!F(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let $=M(Q);if(f($))throw Error(`beacon: workspace ${$} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let J=L(),Y=J.find((C)=>C.id===$),V={id:$,path:Q,name:X||Y?.name||MQ(Q),lastOpenedAt:Z},B=[V,...J.filter((C)=>C.id!==$)];return U(z($),{recursive:!0}),u(B),V}function mQ(Q,X){return LQ(M(Q)),g(Q,X)}function hQ(Q,X=new Date().toISOString()){let Z=L(),$=Z.find((J)=>J.id===Q);if(!$)return;$.lastOpenedAt=X,u(Z)}function pQ(Q){if(u(L().filter((X)=>X.id!==Q)),A()===Q)zQ(k()[0]?.id??null)}function w(){return K(G(),"active")}function A(){try{return _(w(),"utf8").trim()||null}catch{return null}}function zQ(Q){U(G(),{recursive:!0}),T(w(),Q??"")}function cQ(){let Q=A();return Q?N(Q):null}function lQ(){let Q=OQ()??A();return Q?N(Q):null}function nQ(Q){return N(Q)?.path??null}function sQ(){return v(x())}var b="beacon_ws";function m(Q,X){let Z=Q.headers.get("cookie");if(!Z)return null;for(let $ of Z.split(";")){let J=$.indexOf("=");if(J===-1)continue;if($.slice(0,J).trim()===X)return decodeURIComponent($.slice(J+1).trim())}return null}function dQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=m(Q,b);if(Z&&N(Z))return Z;return CQ()}function CQ(){let Q=k();return Q.length===1?Q[0].id:null}var HQ="x-beacon-workspace-path";async function oQ(Q){let X=Q.headers.get("x-beacon-workspace");if(X&&N(X))return X;let Z=Q.headers.get(HQ);if(Z&&F(Z)&&!f(M(Z))&&(!X||M(Z)===X)){let J=g(Z);return await _Q(J.id),J.id}let $=m(Q,b);if($&&N($))return $;return null}var h=new KQ;function aQ(Q,X){return Q?h.run(Q,X):X()}function OQ(){return h.getStore()??null}var O=new Set;function tQ(Q){O.delete(K(z(Q),"db.sqlite"))}async function _Q(Q){let X=z(Q),Z=K(X,"db.sqlite"),$=v(Z);if($&&O.has(Z))return{ok:!0,created:!1,migrated:!1};try{U(X,{recursive:!0});let{provisionDb:J}=await D().then(() => R),Y=await J(jQ(Q));return O.add(Z),{ok:!0,created:!$,migrated:$&&Y.migrated}}catch(J){return{ok:!1,created:!1,migrated:!1,error:J instanceof Error?J.message:String(J)}}}import{connect as TQ}from"net";var p=4319;function xQ(Q,X,Z=400){return new Promise(($)=>{let J=TQ({host:Q,port:X}),Y=!1,V=(B)=>{if(Y)return;Y=!0,J.destroy(),$(B)};J.once("connect",()=>V(!0)),J.once("error",()=>V(!1)),J.setTimeout(Z,()=>V(!1))})}async function EQ(Q){for(let X of["127.0.0.1","::1"])if(await xQ(X,Q))return!1;return!0}async function eQ(Q,X=20){for(let Z=Q;Z<Q+X;Z++)if(await EQ(Z))return Z;return Q}import{readFileSync as uQ}from"fs";import{join as AQ}from"path";function qQ(){try{return JSON.parse(uQ(AQ(G(),"server.json"),"utf8"))}catch{return null}}function c(){if(process.env.BEACON_URL)return process.env.BEACON_URL;return`http://localhost:${qQ()?.port||process.env.PORT||p}`}var l="";for await(let Q of process.stdin)l+=Q;try{let Q=JSON.parse(l||"{}"),X=Q?.tool_input?.file_path;if(typeof X==="string"&&X){let Z=M(S(typeof Q.cwd==="string"?Q.cwd:void 0)),$=await fetch(`${c()}/api/scope-guard/check?file=${encodeURIComponent(X)}`,{headers:{"x-beacon-workspace":Z}}).catch(()=>null);if($?.ok){let J=await $.json().catch(()=>null);if(J?.decision==="ask")process.stdout.write(JSON.stringify({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"ask",permissionDecisionReason:J.reason??"This edit is outside the current plan's declared scope."}}))}}}catch{}process.exit(0);
|