trybeacon 0.1.37 → 0.1.39
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 +2 -2
- 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 +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- 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 +1 -1
- 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/ingest/route.js +2 -2
- package/.next/server/app/api/init/route.js +2 -2
- 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 +2 -2
- 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/stream/route.js +2 -2
- package/.next/server/app/api/telemetry/route.js +1 -0
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -0
- package/.next/server/app/api/telemetry/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/telemetry/stats/route.js +1 -0
- package/.next/server/app/api/telemetry/stats/route.js.nft.json +1 -0
- package/.next/server/app/api/telemetry/stats/route_client-reference-manifest.js +1 -0
- 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 +1 -1
- package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/feedback/page.js +2 -2
- package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
- package/.next/server/app/feedback.html +1 -1
- package/.next/server/app/feedback.rsc +1 -1
- package/.next/server/app/feedback.segments/_full.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_index.segment.rsc +1 -1
- package/.next/server/app/feedback.segments/_tree.segment.rsc +1 -1
- 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 +1 -1
- package/.next/server/app/help.segments/_full.segment.rsc +1 -1
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +1 -1
- package/.next/server/app/help.segments/_tree.segment.rsc +1 -1
- 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 +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- 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/176.js +1 -0
- package/.next/server/chunks/1893.js +1 -0
- package/.next/server/chunks/2933.js +1 -1
- package/.next/server/chunks/2981.js +1 -1
- package/.next/server/chunks/3622.js +1 -1
- package/.next/server/chunks/3838.js +1 -0
- package/.next/server/chunks/4046.js +3 -3
- package/.next/server/chunks/4378.js +1 -1
- package/.next/server/chunks/5362.js +7 -0
- package/.next/server/chunks/6774.js +14 -0
- package/.next/server/chunks/7844.js +1 -0
- package/.next/server/chunks/8423.js +1 -1
- package/.next/server/chunks/9683.js +1 -1
- package/.next/server/chunks/9884.js +2 -2
- package/.next/server/instrumentation.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware.js +3 -3
- 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/FcKcgfUAfLhrW5iXsBe6p/_buildManifest.js +1 -0
- package/.next/static/chunks/1237-9d3991189a7950bf.js +1 -0
- package/.next/static/chunks/app/_global-error/page-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/board-annotations/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/board-layout/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/bug-flags/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/code-graph/position/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/code-graph/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/context/feature/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/context/file/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/context/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/arrange/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/backfill-access/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/position/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/prune-planned/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/relations/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/db/tables/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/draft/approve/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/draft/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/draft/status/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/edges/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/edges/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/endpoints/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/entities/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/feedback/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/ingest/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/init/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/describe/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/files/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/finish/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/start/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/map/touch-active/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/position/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/nodes/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/nodes/positions/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/nodes/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/nodes/subtasks/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/notes/[id]/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/notes/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/open/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/annotations/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/approve/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/history/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/markdown/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/presence/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/plan/verdict/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/preferences/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/project-meta/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/reset/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/stream/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/telemetry/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/telemetry/stats/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/version/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/workspace/activate/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/api/workspace/route-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/app/docs/page-0c841cb9a7aa2f9a.js +1 -0
- package/.next/static/chunks/app/map/page-0b80331a4e6a28d1.js +1 -0
- package/.next/static/chunks/app/plan/{page-51d95294906a3249.js → page-6f5b996737bcedc4.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-f0868dfbc3f7bf63.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-f0868dfbc3f7bf63.js +1 -0
- package/.next/trace +38 -38
- package/.next/trace-build +1 -1
- package/.next/types/app/api/telemetry/route.ts +351 -0
- package/.next/types/app/api/telemetry/stats/route.ts +351 -0
- package/.next/types/routes.d.ts +3 -1
- package/.next/types/validator.ts +18 -0
- package/README.md +13 -0
- package/dist/bin/beacon.js +14 -9
- package/dist/bin/doctor.js +19 -18
- package/dist/bin/hook.js +17 -16
- package/dist/bin/mcp.js +19 -18
- package/dist/bin/plan.js +25 -24
- package/dist/bin/remove.js +5 -5
- package/dist/bin/uninstall.js +20 -19
- package/dist/lib/assets.js +2 -1
- package/dist/lib/codex-install.js +18 -17
- package/dist/lib/global-install.js +17 -16
- package/dist/lib/telemetry.js +2 -0
- package/drizzle/0007_brainy_george_stacy.sql +1 -0
- package/drizzle/meta/0007_snapshot.json +1773 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +7 -2
- package/.next/server/chunks/1957.js +0 -1
- package/.next/server/chunks/9313.js +0 -14
- package/.next/static/W1vjncv08yTEtdbheb7cY/_buildManifest.js +0 -1
- package/.next/static/chunks/4851-a062f2295be1bf51.js +0 -1
- package/.next/static/chunks/app/_global-error/page-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/board-annotations/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/board-layout/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/bug-flags/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/code-graph/position/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/code-graph/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/context/feature/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/context/file/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/context/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/arrange/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/backfill-access/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/position/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/prune-planned/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/reconcile-endpoints/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/relations/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/db/tables/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/draft/approve/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/draft/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/draft/status/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/edges/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/edges/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/endpoints/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/entities/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/feedback/[id]/vote/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/feedback/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/ingest/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/init/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/describe/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/files/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/finish/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/start/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/map/touch-active/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/position/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/nodes/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/nodes/positions/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/nodes/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/nodes/subtasks/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/notes/[id]/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/notes/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/open/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/annotations/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/approve/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/history/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/markdown/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/presence/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/plan/verdict/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/preferences/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/project-meta/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/reset/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/stream/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/version/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/workspace/activate/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/api/workspace/route-68515a67eece5248.js +0 -1
- package/.next/static/chunks/app/docs/page-402d7f2c9321710a.js +0 -1
- package/.next/static/chunks/app/map/page-8a0fbf35bb338b5f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-68515a67eece5248.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-68515a67eece5248.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-68515a67eece5248.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-68515a67eece5248.js +0 -1
- /package/.next/static/{W1vjncv08yTEtdbheb7cY → FcKcgfUAfLhrW5iXsBe6p}/_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/version" | "/api/workspace" | "/api/workspace/activate"
|
|
5
|
+
type AppRouteHandlerRoutes = "/api/board-annotations" | "/api/board-annotations/[id]" | "/api/board-layout" | "/api/bug-flags" | "/api/bug-flags/[id]" | "/api/code-graph" | "/api/code-graph/position" | "/api/context" | "/api/context/feature" | "/api/context/file" | "/api/db/arrange" | "/api/db/backfill-access" | "/api/db/position" | "/api/db/prune-planned" | "/api/db/reconcile-endpoints" | "/api/db/relations/[id]" | "/api/db/tables/[id]" | "/api/draft" | "/api/draft/approve" | "/api/draft/status" | "/api/edges" | "/api/edges/[id]" | "/api/endpoints/[id]" | "/api/entities" | "/api/feedback" | "/api/feedback/[id]" | "/api/feedback/[id]/vote" | "/api/ingest" | "/api/init" | "/api/map" | "/api/map/describe" | "/api/map/files" | "/api/map/finish" | "/api/map/start" | "/api/map/touch-active" | "/api/nodes" | "/api/nodes/[id]" | "/api/nodes/[id]/position" | "/api/nodes/positions" | "/api/nodes/subtasks" | "/api/notes" | "/api/notes/[id]" | "/api/open" | "/api/plan" | "/api/plan/annotations" | "/api/plan/approve" | "/api/plan/history" | "/api/plan/markdown" | "/api/plan/presence" | "/api/plan/verdict" | "/api/preferences" | "/api/project-meta" | "/api/reset" | "/api/stream" | "/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
|
|
@@ -66,6 +66,8 @@ interface ParamMap {
|
|
|
66
66
|
"/api/project-meta": {}
|
|
67
67
|
"/api/reset": {}
|
|
68
68
|
"/api/stream": {}
|
|
69
|
+
"/api/telemetry": {}
|
|
70
|
+
"/api/telemetry/stats": {}
|
|
69
71
|
"/api/version": {}
|
|
70
72
|
"/api/workspace": {}
|
|
71
73
|
"/api/workspace/activate": {}
|
package/.next/types/validator.ts
CHANGED
|
@@ -596,6 +596,24 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
|
|
|
596
596
|
type __Unused = __Check
|
|
597
597
|
}
|
|
598
598
|
|
|
599
|
+
// Validate ../../app/api/telemetry/route.ts
|
|
600
|
+
{
|
|
601
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/telemetry">> = Specific
|
|
602
|
+
const handler = {} as typeof import("../../app/api/telemetry/route.js")
|
|
603
|
+
type __Check = __IsExpected<typeof handler>
|
|
604
|
+
// @ts-ignore
|
|
605
|
+
type __Unused = __Check
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// Validate ../../app/api/telemetry/stats/route.ts
|
|
609
|
+
{
|
|
610
|
+
type __IsExpected<Specific extends RouteHandlerConfig<"/api/telemetry/stats">> = Specific
|
|
611
|
+
const handler = {} as typeof import("../../app/api/telemetry/stats/route.js")
|
|
612
|
+
type __Check = __IsExpected<typeof handler>
|
|
613
|
+
// @ts-ignore
|
|
614
|
+
type __Unused = __Check
|
|
615
|
+
}
|
|
616
|
+
|
|
599
617
|
// Validate ../../app/api/version/route.ts
|
|
600
618
|
{
|
|
601
619
|
type __IsExpected<Specific extends RouteHandlerConfig<"/api/version">> = Specific
|
package/README.md
CHANGED
|
@@ -92,3 +92,16 @@ Beacon is local-first: every user's boards live in per-workspace SQLite on their
|
|
|
92
92
|
so there is **no production database**. A hosted deployment is just the static app + (optionally)
|
|
93
93
|
read-only shared-board snapshots persisted to a blob/KV store — no Postgres, no migrations to run
|
|
94
94
|
against a server.
|
|
95
|
+
|
|
96
|
+
(The one exception is the deploy's small shared Neon Postgres holding the anonymous feedback
|
|
97
|
+
board and the telemetry counters below — never user board data.)
|
|
98
|
+
|
|
99
|
+
## Telemetry
|
|
100
|
+
|
|
101
|
+
Beacon sends an **anonymous heartbeat** at most every 12 hours while the local server runs, so we
|
|
102
|
+
can count active installs (npm download counts are dominated by mirrors and CI). The payload is
|
|
103
|
+
exactly five fields: a random machine id (a locally generated UUID tied to nothing), the Beacon
|
|
104
|
+
version, OS, CPU architecture, and a CI flag. **Never** repo names, file paths, code, plans, or
|
|
105
|
+
board content; IP addresses are not stored. Inspect the exact payload with `beacon telemetry status`.
|
|
106
|
+
|
|
107
|
+
Opt out any time with `beacon telemetry off`, `BEACON_TELEMETRY_DISABLED=1`, or `DO_NOT_TRACK=1`.
|
package/dist/bin/beacon.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import{execSync as
|
|
4
|
-
\u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${K}`),console.log(` \u2713 skill: ${
|
|
5
|
-
`)}return{initSkill:K,refreshSkill:
|
|
6
|
-
`+" cd into a repo (or run `git init` there) and try again."),process.exit(1);let
|
|
3
|
+
import{execSync as w,spawn as f}from"child_process";import{existsSync as h,mkdirSync as m,openSync as u,readFileSync as g,writeFileSync as c}from"fs";import{homedir as p,platform as P}from"os";import{basename as d,dirname as j,join as H}from"path";import{fileURLToPath as t}from"url";var T=j(t(import.meta.url)),L=d(j(T))==="dist",B=L?j(j(T)):j(T),O=process.cwd(),v=process.env.BEACON_HOME||H(p(),".beacon"),_=H(v,"server.json"),x=process.env.PORT||"4319";if(!process.env.BEACON_MIGRATIONS_DIR)process.env.BEACON_MIGRATIONS_DIR=H(B,"drizzle");function Q(z){if(!L)return H(B,z);return H(B,"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==="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")S();else if(Y==="remove")await import(Q("bin/remove.ts"));else if(Y==="setup")await C(E()||O);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 r(process.argv.includes("--force")||process.argv.includes("-f"));else if(Y==="telemetry")await o(process.argv[3]);else if(Y==="version"||Y==="--version"||Y==="-v")console.log(R());else await s();async function C(z,X=!1){let{installInitSkill:Z,installRefreshSkill:q,installCodexRepoSkills:J,ensureMcp:U,ensureWorkflowDoc:I}=await import(Q("lib/assets.ts")),{selfHealGlobal:V}=await import(Q("lib/global-install.ts")),{codexDetected:M}=await import(Q("lib/codex-install.ts")),N=await V(),K=Z(z),W=q(z);I(z);let $=U(z),F=M()?J(z):[];if(X){if($.added)console.log(`[beacon] registered Beacon MCP in ${$.path} \u2014 restart your agent CLI to use @beacon mentions.`)}else{console.log(`
|
|
4
|
+
\u25C9 Beacon setup \xB7 ${z}`),console.log(` \u2713 skill: ${K}`),console.log(` \u2713 skill: ${W}`);for(let y of F)console.log(` \u2713 skill: ${y}`);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:K,refreshSkill:W,mcp:$,codexSkills:F,heal:N}}function E(){try{return w("git rev-parse --show-toplevel",{cwd:O,stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function D(z){try{return process.kill(z,0),!0}catch{return!1}}function A(z){try{return JSON.parse(g(z,"utf8"))}catch{return null}}async function k(z){try{return(await fetch(z)).ok}catch{return!1}}async function a(z,X=60){for(let Z=0;Z<X;Z++){if(await k(z))return!0;await new Promise((q)=>setTimeout(q,500))}return!1}function l(){m(v,{recursive:!0});let z=u(H(v,"server.log"),"a"),X={...process.env,PORT:x,BEACON_NO_OPEN:"1",BEACON_MIGRATIONS_DIR:H(B,"drizzle")};delete X.BEACON_REPO,delete X.BEACON_DATA_DIR,delete X.DATABASE_URL;let q=f("bun",L?["run","start"]:["run","dev"],{cwd:B,env:X,detached:!0,stdio:["ignore",z,z]});q.unref();let J={pid:q.pid??0,port:x};return c(_,JSON.stringify(J)),J}async function n(){let z=A(_);if(z&&D(z.pid)&&await k(`http://localhost:${z.port}/api/workspace`))return z.port;console.log("[beacon] starting the Beacon server\u2026");let{port:X}=l();if(!await a(`http://localhost:${X}/api/workspace`))console.log("[beacon] (server is taking a while \u2014 it may still be compiling)");return X}function i(z){if(process.env.BEACON_NO_OPEN)return;let X=P()==="darwin"?"open":P()==="win32"?"start":"xdg-open";try{w(`${X} "${z}"`,{stdio:"ignore"})}catch{}}async function s(){let z=E()||O,{registerWorkspaceExplicit:X,idForPath:Z,dataDirFor:q,ensureWorkspaceDb:J,isRegistrableWorkspacePath:U}=await import(Q("lib/workspaces.ts"));if(!U(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 I=Z(z),V=q(I),M=!h(H(V,"db.sqlite"));if(M)console.log(`[beacon] first run for ${z} \u2014 creating database\u2026`);let N=await J(I);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:K}=await C(z,!0),W=[];if(K.skillsAdded.length)W.push(`skills ${K.skillsAdded.join(", ")}`);if(K.hooksAdded)W.push(`${K.hooksAdded} Claude Code hook${K.hooksAdded===1?"":"s"}`);if(K.claudeMdBlockTouched)W.push("global CLAUDE.md block");if(W.length)console.log(`[beacon] wired into ~/.claude/: ${W.join(" + ")}.`);let $=K.codex;if($){let G=[];if($.skillsAdded.length)G.push(`skills ${$.skillsAdded.join(", ")}`);if($.hooksAdded)G.push(`${$.hooksAdded} Codex hook${$.hooksAdded===1?"":"s"}`);if($.agentsMdBlockTouched)G.push("global AGENTS.md block");if($.mcp.added)G.push("MCP entry in config.toml");if(G.length)console.log(`[beacon] wired into ~/.codex/: ${G.join(" + ")}.`);if($.mcp.error)console.log(`[beacon] codex MCP not wired: ${$.mcp.error}`)}try{let G=await import(Q("lib/telemetry.ts"));if(!G.telemetryStatus().machineId){let b=G.telemetryStatus().enabled;console.log(`[beacon] telemetry: Beacon sends an anonymous heartbeat (random machine id, version, OS,
|
|
7
|
+
`+` architecture \u2014 never repo names, paths, or code) at most every 12h to count
|
|
8
|
+
`+` active installs. Opt out: \`beacon telemetry off\`, BEACON_TELEMETRY_DISABLED=1,
|
|
9
|
+
or DO_NOT_TRACK=1. Details: beacon telemetry status.${b?"":" (currently disabled by your env)"}`),G.ensureTelemetryId()}}catch{}X(z);let F=await n(),y=`http://localhost:${F}/api/workspace/activate?id=${I}&redirect=/map`;console.log(`
|
|
7
10
|
\u25C9 Beacon
|
|
8
11
|
repo: ${z}
|
|
9
|
-
data: ${
|
|
10
|
-
url: http://localhost:${
|
|
11
|
-
`),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
data: ${V}
|
|
13
|
+
url: http://localhost:${F}
|
|
14
|
+
`),console.log(" (the server keeps running in the background \u2014 `beacon stop` to stop it)\n"),i(y)}function R(){return A(H(B,"package.json"))?.version??"0.0.0"}async function o(z){let X=await import(Q("lib/telemetry.ts"));if(z==="on"||z==="off"){X.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 Z=X.telemetryStatus(),q=Z.reason==="env:BEACON_TELEMETRY_DISABLED"?" (BEACON_TELEMETRY_DISABLED=1)":Z.reason==="env:DO_NOT_TRACK"?" (DO_NOT_TRACK)":Z.reason==="preference"?" (beacon telemetry off)":"";if(console.log(`
|
|
15
|
+
\u25C9 Beacon telemetry: ${Z.enabled?"enabled":"disabled"}${q}`),console.log(` machine id: ${Z.machineId??"(not generated yet \u2014 created on first `beacon` run)"}`),Z.machineId)console.log(` payload: ${JSON.stringify(X.heartbeatPayload(R()))}`);console.log(` sent at most every 12h while the daemon runs \u2014 never repo names, paths, or code.
|
|
16
|
+
`+" toggle: `beacon telemetry on|off` \xB7 env: BEACON_TELEMETRY_DISABLED=1 or DO_NOT_TRACK=1\n")}async function r(z){let X=R(),{INSTALL_COMMAND:Z,NPM_LATEST_URL:q}=await import(Q("lib/release.ts"));if(P()==="win32"){console.log(`[beacon] current version v${X}.`),console.log(`[beacon] on Windows, update with your package manager:
|
|
17
|
+
npm i -g trybeacon@latest`);return}let J=null;try{let U=await fetch(q);if(U.ok)J=(await U.json()).version??null}catch{}if(J&&!z){let{isNewerVersion:U}=await import(Q("lib/semver.ts"));if(!U(J,X)){console.log(`[beacon] already on the latest version (v${X}).`),console.log(" run `beacon update --force` to reinstall anyway.");return}}console.log(J?`[beacon] updating Beacon v${X} \u2192 v${J}\u2026`:`[beacon] reinstalling Beacon (current v${X})\u2026`);try{w(Z,{stdio:"inherit"})}catch{console.error(`[beacon] update failed. Run it manually:
|
|
18
|
+
${Z}`),process.exitCode=1;return}S(),console.log("[beacon] updated. Run `beacon` to relaunch on the new version.")}function S(){let z=A(_);if(z&&D(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,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var CZ=Object.defineProperty;var MZ=(Q)=>Q;function fZ(Q,Z){this[Q]=MZ.bind(null,Z)}var
|
|
3
|
+
var CZ=Object.defineProperty;var MZ=(Q)=>Q;function fZ(Q,Z){this[Q]=MZ.bind(null,Z)}var WQ=(Q,Z)=>{for(var $ in Z)CZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:fZ.bind(Z,$)})};var g=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var vQ={};WQ(vQ,{removeRepoAssets:()=>IZ,installRefreshSkill:()=>wZ,installPlanSkill:()=>TZ,installInitSkill:()=>uZ,installCodexRepoSkills:()=>gZ,ensureWorkflowDoc:()=>RZ,ensureMcp:()=>EZ,auditRepo:()=>BQ,REFRESH_SKILL:()=>jQ,PLAN_SKILL:()=>hQ,INIT_SKILL:()=>HQ});import{existsSync as u,mkdirSync as k,readFileSync as G,rmSync as _,writeFileSync as N}from"fs";import{join as q}from"path";function uZ(Q){let Z=q(Q,".claude","skills","beacon-init");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,HQ),$}function wZ(Q){let Z=q(Q,".claude","skills","beacon-refresh");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,jQ),$}function TZ(Q){let Z=q(Q,".claude","skills","beacon-plan");k(Z,{recursive:!0});let $=q(Z,"SKILL.md");return N($,hQ),$}function gZ(Q){let Z=[];for(let $ of FZ){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 RZ(Q){let Z=q(Q,"AGENTS.md"),$="";try{$=G(Z,"utf8")}catch{}let J=new RegExp(`${L}[\\s\\S]*?${PQ}`);$=J.test($)?$.replace(J,SQ):`${$.trim()}
|
|
4
4
|
|
|
5
5
|
${SQ}
|
|
6
6
|
`.trimStart(),N(Z,$.endsWith(`
|
|
@@ -9,13 +9,13 @@ ${SQ}
|
|
|
9
9
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
11
|
`)}function EZ(Q){let Z=q(Q,".mcp.json"),$={};try{$=JSON.parse(G(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},N(Z,JSON.stringify($,null,2)+`
|
|
12
|
-
`),{path:Z,added:!0}}function
|
|
13
|
-
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=G(V,"utf8"),P=new RegExp(`\\n?${L}[\\s\\S]*?${
|
|
12
|
+
`),{path:Z,added:!0}}function BQ(Q){let Z=q(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(G(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=G(q(Q,"AGENTS.md"),"utf8").includes(L)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(G(q(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":u(q(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":u(q(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":u(q(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":u(q(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function IZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let P=q(Q,".claude","skills",z);if(u(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(u(P))_(P,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=q(Q,".mcp.json");try{let z=JSON.parse(G(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)+`
|
|
13
|
+
`)}}catch{}let Y=!1,V=q(Q,"AGENTS.md");try{let z=G(V,"utf8"),P=new RegExp(`\\n?${L}[\\s\\S]*?${PQ}\\n?`);if(P.test(z)){let UQ=z.replace(P,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();N(V,
|
|
17
|
-
`)?
|
|
18
|
-
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=G(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
|
|
16
|
+
`).trimStart();N(V,UQ.endsWith(`
|
|
17
|
+
`)?UQ:`${UQ}
|
|
18
|
+
`),Y=!0}}catch{}let X=!1,U=q(Q,"CLAUDE.md");try{let z=G(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 HQ=`---
|
|
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
|
---
|
|
@@ -29,6 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **hasFrontend**: \`true\` or \`false\` \u2014 does this repo have a frontend surface (UI code)? You just read the repo, so you know. Set it explicitly; it gates the frontend/backend \`layer\` distinction on the boards (a pure-backend repo never shows it).
|
|
32
|
+
- **classificationRoots** (optional): the top-level directories whose immediate children are the meaningful groups on the Files canvas \u2014 e.g. \`["frontend", "backend/app"]\`. The canvas groups files ONE level below each root (so \`frontend\` \u2192 \`frontend/components\`, \`frontend/app\`, \u2026). Pick the dir sitting directly ABOVE the real package dirs \u2014 use \`frontend/src\` if there's a \`src/\` wrapper. List both sides of a monorepo so neither collapses into one flat blob. Not every dir \u2014 just where grouping should START. Omit it for a simple single-root repo; the canvas falls back to automatic grouping.
|
|
32
33
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), \`depends\` listing other component titles it relies on \u2014 and, when \`hasFrontend\` is true, \`layer\` (\`"frontend" | "backend" | "fullstack"\`). Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
33
34
|
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card. When \`hasFrontend\` is true, give each a \`layer\` too (\`"frontend" | "backend" | "fullstack"\`).
|
|
34
35
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
53
54
|
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.
|
|
54
55
|
|
|
55
56
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
56
|
-
`,
|
|
57
|
+
`,jQ=`---
|
|
57
58
|
name: beacon-refresh
|
|
58
59
|
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.
|
|
59
60
|
---
|
|
@@ -88,7 +89,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
88
89
|
- **~ changed**: COMPONENT_X (role expanded to cover Y)
|
|
89
90
|
- **schema**: + 2 new tables (TableA, TableB); + 3 new endpoints; \u2212 1 deprecated endpoint
|
|
90
91
|
No need to wait for confirmation \u2014 just show the diff so the user sees what's about to land.
|
|
91
|
-
5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`, \`hasFrontend\` \u2014 re-assert it, the stack may have changed). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
|
|
92
|
+
5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`, \`hasFrontend\` \u2014 re-assert it, the stack may have changed; and \`classificationRoots\` if the Files-canvas grouping needs to change, e.g. a new top-level dir like \`mobile/\` \u2014 OMIT it to keep the existing roots, don't pass \`[]\` unless you mean to clear them). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
|
|
92
93
|
|
|
93
94
|
## What you should NOT do
|
|
94
95
|
|
|
@@ -142,7 +143,7 @@ If it returns feedback, revise and call it again.
|
|
|
142
143
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
143
144
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
144
145
|
run \`beacon\` in this repo once.
|
|
145
|
-
`,FZ,L="<!-- beacon:workflow:start -->",
|
|
146
|
+
`,FZ,L="<!-- beacon:workflow:start -->",PQ="<!-- beacon:workflow:end -->",SQ;var S=g(()=>{FZ=[{name:"beacon-init",body:()=>HQ},{name:"beacon-refresh",body:()=>jQ}];SQ=`${L}
|
|
146
147
|
## Beacon \u2014 feature workflow
|
|
147
148
|
|
|
148
149
|
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:
|
|
@@ -200,18 +201,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
200
201
|
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.
|
|
201
202
|
|
|
202
203
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
203
|
-
${
|
|
204
|
-
`)}function l(Q,Z){let $=
|
|
204
|
+
${PQ}`});import{existsSync as mQ,mkdirSync as NQ,readFileSync as m,rmSync as DZ,writeFileSync as p}from"fs";import{dirname as pQ,join as h}from"path";function xQ(Q){try{return JSON.parse(m(Q,"utf8"))}catch{return{}}}function cQ(Q,Z){NQ(pQ(Q),{recursive:!0}),p(Q,JSON.stringify(Z,null,2)+`
|
|
205
|
+
`)}function l(Q,Z){let $=xQ(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}]}),cQ(Q,$),!0}function n(Q,Z){return(xQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function s(Q,Z){let $=xQ(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 cQ(Q,$),!0}function t(Q,Z,$,J){let Y=`${Z}
|
|
205
206
|
${J.trim()}
|
|
206
207
|
${$}`,V="";try{V=m(Q,"utf8")}catch{}let X=new RegExp(`${Z}[\\s\\S]*?${$}`);V=X.test(V)?V.replace(X,Y):V.trim()?`${V.trim()}
|
|
207
208
|
|
|
208
209
|
${Y}
|
|
209
210
|
`:`${Y}
|
|
210
|
-
`,
|
|
211
|
+
`,NQ(pQ(Q),{recursive:!0}),p(Q,V.endsWith(`
|
|
211
212
|
`)?V:`${V}
|
|
212
213
|
`)}function R(Q,Z){try{return m(Q,"utf8").includes(Z)}catch{return!1}}function a(Q,Z,$){let J="";try{J=m(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,`
|
|
213
214
|
|
|
214
|
-
`).trimStart();return p(Q,V),!0}function d(Q,Z,$){let J=h(Q,Z);
|
|
215
|
+
`).trimStart();return p(Q,V),!0}function d(Q,Z,$){let J=h(Q,Z);NQ(J,{recursive:!0});let Y=h(J,"SKILL.md");return p(Y,$),Y}function E(Q,Z){return mQ(h(Q,Z,"SKILL.md"))}function r(Q,Z){let $=h(Q,Z);if(!mQ($))return!1;return DZ($,{recursive:!0,force:!0}),!0}var B,c=`## Beacon (visual planning panel)
|
|
215
216
|
|
|
216
217
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
217
218
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -232,19 +233,19 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
232
233
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
233
234
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
234
235
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
235
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
236
|
+
verbatim. Do NOT implement until the tool returns approval.`;var GQ=g(()=>{B=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as OZ,renameSync as AZ,rmSync as yZ,writeFileSync as bZ}from"fs";import{dirname as _Z}from"path";function o(Q,Z){OZ(_Z(Q),{recursive:!0});let $=`${Q}.tmp`;try{bZ($,Z),AZ($,Q)}catch(J){throw yZ($,{force:!0}),J}}function S0(Q,Z,$=!1){o(Q,JSON.stringify(Z,null,$?2:void 0))}var lQ=()=>{};var oQ={};WQ(oQ,{setupCodexAssets:()=>SZ,removeCodexMcp:()=>rQ,removeCodexArtifacts:()=>hZ,hasCodexMcp:()=>fQ,ensureCodexMcp:()=>dQ,codexMcpProblem:()=>uQ,codexDetected:()=>$Q,auditCodex:()=>wQ,CODEX_HOOKS:()=>C});import{readFileSync as ZQ}from"fs";import{homedir as kZ}from"os";import{join as O}from"path";function nQ(){return process.env.HOME||process.env.USERPROFILE||kZ()}function $Q(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(KQ===void 0)KQ=Bun.which("codex")!==null;return KQ}function D(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function fQ(){try{return Boolean(D(ZQ(w(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function uQ(){let Q="";try{Q=ZQ(w(),"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 dQ(){let Q="",Z=!1;try{Q=ZQ(w(),"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(`
|
|
236
237
|
`)?`
|
|
237
238
|
`:`
|
|
238
239
|
|
|
239
|
-
`,J=Q+$+LZ;if(D(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return
|
|
240
|
+
`,J=Q+$+LZ;if(D(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${I}`};return o(w(),J),{added:!0}}function rQ(){let Q="";try{Q=ZQ(w(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
240
241
|
`),$=Z.indexOf(tQ);if($===-1)return{removed:!1,skipped:fQ()};let J=Z.indexOf(aQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
241
242
|
`).replace(/\n{3,}/g,`
|
|
242
243
|
|
|
243
|
-
`).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return
|
|
244
|
+
`).replace(/^\n+/,"");if(D(Y)===null)return{removed:!1,skipped:!0};return o(w(),Y),{removed:!0}}async function SZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of B){if(!E(e(),z))Y.push(z);d(e(),z,J[z])}let V=0;for(let z of C)if(l(MQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let X=R(i(),QQ);t(i(),QQ,sQ,c);let U=dQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!X,mcp:U}}function wQ(){let Q={};for(let $ of B)Q[$]=E(e(),$);let Z={};for(let $ of C)Z[$.event]=n(MQ(),{event:$.event,command:$.command});return{detected:$Q(),skills:Q,hooks:Z,agentsMdBlock:R(i(),QQ),mcp:fQ()}}function hZ(){let Q=[];for(let Y of B)if(r(e(),Y))Q.push(Y);let Z=0;for(let Y of C)if(s(MQ(),{event:Y.event,command:Y.command}))Z++;let $=a(i(),QQ,sQ),J=rQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var CQ=()=>O(nQ(),".codex"),MQ=()=>O(CQ(),"hooks.json"),w=()=>O(CQ(),"config.toml"),i=()=>O(CQ(),"AGENTS.md"),e=()=>O(nQ(),".agents","skills"),QQ="<!-- beacon:global:start -->",sQ="<!-- beacon:global:end -->",C,KQ,tQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",aQ="# beacon:end",LZ,I="add it manually: codex mcp add beacon -- beacon mcp";var TQ=g(()=>{GQ();lQ();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."}];LZ=`${tQ}
|
|
244
245
|
[mcp_servers.beacon]
|
|
245
246
|
command = "beacon"
|
|
246
247
|
args = ["mcp"]
|
|
247
248
|
${aQ}
|
|
248
|
-
`});var JZ={};
|
|
249
|
-
\x1B[1m${Q}\x1B[0m`;function T0(){try{return f0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function F0(){let Q=GZ(x(),"server.json");try{let Z=JSON.parse(w0(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 g0(){let Q=xZ("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 R0(){return T0()||process.cwd()}var
|
|
249
|
+
`});var JZ={};WQ(JZ,{provisionDb:()=>W0});import{createClient as eZ}from"@libsql/client";import{drizzle as Q0}from"drizzle-orm/libsql";import{migrate as Z0}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as $0}from"drizzle-orm/migrator";import{dirname as IQ,join as J0}from"path";import{fileURLToPath as Y0}from"url";async function VQ(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function X0(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function $Z(Q){if(!await VQ(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 U0(Q){for(let[Z,$]of Object.entries(q0)){if(!await VQ(Q,Z))continue;let J=await X0(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 W0(Q,Z=z0){let $=eZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await VQ($,"__drizzle_migrations"),Y=await VQ($,"Node"),V=!1;if(Y&&!J){let U=$0({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 $Z($);if(await Z0(Q0($),{migrationsFolder:Z}),await $Z($)>X)V=!0;return await U0($),{migrated:V}}finally{$.close()}}var V0,z0,q0;var YZ=g(async()=>{V0=IQ(IQ(IQ(Y0(import.meta.url)))),z0=process.env.BEACON_MIGRATIONS_DIR||J0(V0,"drizzle"),q0={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});GQ();import{existsSync as mZ}from"fs";import{homedir as pZ}from"os";import{join as JQ}from"path";function cZ(){return process.env.HOME||process.env.USERPROFILE||pZ()}var YQ=()=>JQ(cZ(),".claude"),FQ=()=>JQ(YQ(),"skills"),gQ=()=>JQ(YQ(),"settings.json"),RQ=()=>JQ(YQ(),"CLAUDE.md"),EQ="<!-- beacon:global:start -->",iQ="<!-- beacon:global:end -->";var lZ=c,T=[{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function nZ(Q,Z){return d(FQ(),Q,Z)}function eQ(Q){return E(FQ(),Q)}function sZ(Q){return r(FQ(),Q)}function tZ(Q){return l(gQ(),Q)}function aZ(Q){return n(gQ(),Q)}function dZ(Q){return s(gQ(),Q)}function rZ(Q){t(RQ(),EQ,iQ,Q)}function QZ(){return R(RQ(),EQ)}function oZ(){return a(RQ(),EQ,iQ)}function ZZ(){let Q={};for(let $ of B)Q[$]=eQ($);let Z={};for(let $ of T)Z[$.event]=aZ({event:$.event,command:$.command});return{homeExists:mZ(YQ()),skills:Q,hooks:Z,claudeMdBlock:QZ()}}async function iZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (S(),vQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of B){if(!eQ(U))Y.push(U);nZ(U,J[U])}let V=0;for(let U of T)if(tZ({event:U.event,matcher:U.matcher,command:U.command}))V++;let X=QZ();return rZ(lZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!X}}async function r0(){let Q;try{Q={ok:!0,...await iZ()}}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(() => (TQ(),oQ));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 o0(){let Q=[];for(let J of B)if(sZ(J))Q.push(J);let Z=0;for(let J of T)if(dZ(J))Z++;let $=oZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as H0}from"async_hooks";import{spawnSync as j0}from"child_process";import{createHash as P0}from"crypto";import{existsSync as zZ,mkdirSync as A,readFileSync as OQ,writeFileSync as AQ}from"fs";import{homedir as qZ}from"os";import{basename as B0,join as K,parse as v0,resolve as VZ}from"path";function x(){return process.env.BEACON_HOME||K(qZ(),".beacon")}function yQ(){return K(x(),"workspaces.json")}function zQ(Q){return P0("sha256").update(Q).digest("hex").slice(0,12)}function H1(Q=process.cwd()){let Z=j0("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 XZ(Q){let Z=VZ(Q);return Z!==VZ(qZ())&&Z!==v0(Z).root}function UZ(){return K(x(),"deleted.json")}function bQ(){try{let Q=JSON.parse(OQ(UZ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function WZ(Q){A(x(),{recursive:!0}),AQ(UZ(),JSON.stringify(Q,null,2))}function HZ(Q){return bQ().includes(Q)}function j1(Q){let Z=bQ();if(!Z.includes(Q))WZ([...Z,Q])}function N0(Q){let Z=bQ();if(Z.includes(Q))WZ(Z.filter(($)=>$!==Q))}function qQ(Q){return K(x(),Q)}function x0(Q){return`file:${K(qQ(Q),"db.sqlite")}`}function y(){try{let Q=JSON.parse(OQ(yQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function _Q(Q){A(x(),{recursive:!0}),AQ(yQ(),JSON.stringify(Q,null,2))}function kQ(){return y().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function M(Q){return y().find((Z)=>Z.id===Q)??null}function jZ(Q,Z,$=new Date().toISOString()){if(!XZ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=zQ(Q);if(HZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=y(),V=Y.find((z)=>z.id===J),X={id:J,path:Q,name:Z||V?.name||B0(Q),lastOpenedAt:$},U=[X,...Y.filter((z)=>z.id!==J)];return A(qQ(J),{recursive:!0}),_Q(U),X}function P1(Q,Z){return N0(zQ(Q)),jZ(Q,Z)}function B1(Q,Z=new Date().toISOString()){let $=y(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,_Q($)}function v1(Q){if(_Q(y().filter((Z)=>Z.id!==Q)),LQ()===Q)G0(kQ()[0]?.id??null)}function PZ(){return K(x(),"active")}function LQ(){try{return OQ(PZ(),"utf8").trim()||null}catch{return null}}function G0(Q){A(x(),{recursive:!0}),AQ(PZ(),Q??"")}function N1(){let Q=LQ();return Q?M(Q):null}function x1(){let Q=C0()??LQ();return Q?M(Q):null}function G1(Q){return M(Q)?.path??null}function K1(){return zZ(yQ())}var BZ="beacon_ws";function vZ(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 C1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=vZ(Q,BZ);if($&&M($))return $;return null}var K0="x-beacon-workspace-path";async function M1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&M(Z))return Z;let $=Q.headers.get(K0);if($&&XZ($)&&!HZ(zQ($))&&(!Z||zQ($)===Z)){let Y=jZ($);return await M0(Y.id),Y.id}let J=vZ(Q,BZ);if(J&&M(J))return J;return null}var NZ=new H0;function f1(Q,Z){return Q?NZ.run(Q,Z):Z()}function C0(){return NZ.getStore()??null}var DQ=new Set;function u1(Q){DQ.delete(K(qQ(Q),"db.sqlite"))}async function M0(Q){let Z=qQ(Q),$=K(Z,"db.sqlite"),J=zZ($);if(J&&DQ.has($))return{ok:!0,created:!1,migrated:!1};try{A(Z,{recursive:!0});let{provisionDb:Y}=await YZ().then(() => JZ),V=await Y(x0(Q));return DQ.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)}}}S();TQ();import{execSync as f0,spawnSync as xZ}from"child_process";import{existsSync as u0,readFileSync as w0}from"fs";import{join as GZ}from"path";var W=(Q)=>`\x1B[32m\u2713\x1B[0m ${Q}`,H=(Q)=>`\x1B[31m\u2717\x1B[0m ${Q}`,f=(Q)=>`\x1B[2m${Q}\x1B[0m`,b=(Q)=>`
|
|
250
|
+
\x1B[1m${Q}\x1B[0m`;function T0(){try{return f0("git rev-parse --show-toplevel",{cwd:process.cwd(),stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return""}}function F0(){let Q=GZ(x(),"server.json");try{let Z=JSON.parse(w0(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 g0(){let Q=xZ("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 R0(){return T0()||process.cwd()}var XQ=R0(),F=ZZ(),KZ=kQ(),E0=KZ.some((Q)=>Q.path===XQ),j=E0||u0(GZ(XQ,".mcp.json"))?BQ(XQ):null;console.log(b("Beacon \xB7 doctor"));console.log(b("Runtime"));console.log(` ${g0()}`);console.log(` ${F0()}`);console.log(` ${W(`home: ${x()}`)}`);console.log(` ${W(`workspaces registered: ${KZ.length}`)}`);console.log(b("Global (~/.claude/)"));for(let Q of B)console.log(` ${F.skills[Q]?W(`skill ${Q}`):H(`skill ${Q} \u2014 missing`)}`);for(let Q of T)console.log(` ${F.hooks[Q.event]?W(`hook ${Q.event} \u2192 ${Q.command}`):H(`hook ${Q.event} \u2192 ${Q.command} \u2014 missing`)} ${f(Q.description)}`);console.log(` ${F.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 v=$Q()?wQ():null;if(!v)console.log(` ${f("codex not on PATH \u2014 Codex integration inactive (wires automatically once codex is installed)")}`);else{let Q=xZ("codex",["--version"],{stdio:["ignore","pipe","ignore"]});console.log(` ${Q.status===0?W(`codex ${Q.stdout.toString().trim()}`):f("codex version unavailable (BEACON_CODEX override?)")}`);for(let $ of B)console.log(` ${v.skills[$]?W(`skill ${$} (~/.agents/skills)`):H(`skill ${$} (~/.agents/skills) \u2014 missing`)}`);for(let $ of C)console.log(` ${v.hooks[$.event]?W(`hook ${$.event} \u2192 ${$.command}`):H(`hook ${$.event} \u2192 ${$.command} \u2014 missing`)} ${f($.description)}`);console.log(` ${v.agentsMdBlock?W("global ~/.codex/AGENTS.md block"):H("global ~/.codex/AGENTS.md block \u2014 missing")}`);let Z=uQ();console.log(` ${v.mcp?W("config.toml has [mcp_servers.beacon]"):H(`config.toml missing [mcp_servers.beacon]${Z?` \u2014 ${Z}`:""}`)}`)}console.log(b(`Current repo (${XQ})`));if(!j)console.log(` ${f("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")}`),v)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 I0=B.some((Q)=>!F.skills[Q])||T.some((Q)=>!F.hooks[Q.event])||!F.claudeMdBlock||(v?B.some((Q)=>!v.skills[Q])||C.some((Q)=>!v.hooks[Q.event])||!v.agentsMdBlock||!v.mcp:!1)||(j?!j.mcpRegistered||!j.agentsMdBlock||!j.claudeMdImport||!j.skills["beacon-init"]||!j.skills["beacon-refresh"]||(v?!j.codexSkills["beacon-init"]||!j.codexSkills["beacon-refresh"]:!1):!1);if(I0)console.log(`
|
|
250
251
|
${f("Fix everything marked \u2717 by running")} \x1B[1mbeacon\x1B[0m ${f("in this repo.")}`);console.log();
|
package/dist/bin/hook.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var XZ=Object.defineProperty;var UZ=(Q)=>Q;function WZ(Q,Z){this[Q]=UZ.bind(null,Z)}var
|
|
3
|
+
var XZ=Object.defineProperty;var UZ=(Q)=>Q;function WZ(Q,Z){this[Q]=UZ.bind(null,Z)}var e=(Q,Z)=>{for(var $ in Z)XZ(Q,$,{get:Z[$],enumerable:!0,configurable:!0,set:WZ.bind(Z,$)})};var v=(Q,Z)=>()=>(Q&&(Z=Q(Q=0)),Z);var JQ={};e(JQ,{removeRepoAssets:()=>uZ,installRefreshSkill:()=>HZ,installPlanSkill:()=>BZ,installInitSkill:()=>xZ,installCodexRepoSkills:()=>PZ,ensureWorkflowDoc:()=>GZ,ensureMcp:()=>NZ,auditRepo:()=>KZ,REFRESH_SKILL:()=>ZQ,PLAN_SKILL:()=>fQ,INIT_SKILL:()=>QQ});import{existsSync as N,mkdirSync as b,readFileSync as H,rmSync as R,writeFileSync as x}from"fs";import{join as X}from"path";function xZ(Q){let Z=X(Q,".claude","skills","beacon-init");b(Z,{recursive:!0});let $=X(Z,"SKILL.md");return x($,QQ),$}function HZ(Q){let Z=X(Q,".claude","skills","beacon-refresh");b(Z,{recursive:!0});let $=X(Z,"SKILL.md");return x($,ZQ),$}function BZ(Q){let Z=X(Q,".claude","skills","beacon-plan");b(Z,{recursive:!0});let $=X(Z,"SKILL.md");return x($,fQ),$}function PZ(Q){let Z=[];for(let $ of jZ){let J=X(Q,".agents","skills",$.name);b(J,{recursive:!0});let Y=X(J,"SKILL.md");x(Y,$.body()),Z.push(Y)}return Z}function GZ(Q){let Z=X(Q,"AGENTS.md"),$="";try{$=H(Z,"utf8")}catch{}let J=new RegExp(`${I}[\\s\\S]*?${$Q}`);$=J.test($)?$.replace(J,TQ):`${$.trim()}
|
|
4
4
|
|
|
5
5
|
${TQ}
|
|
6
6
|
`.trimStart(),x(Z,$.endsWith(`
|
|
@@ -10,12 +10,12 @@ ${TQ}
|
|
|
10
10
|
`:""}@AGENTS.md
|
|
11
11
|
`)}function NZ(Q){let Z=X(Q,".mcp.json"),$={};try{$=JSON.parse(H(Z,"utf8"))}catch{}if($.mcpServers=$.mcpServers??{},$.mcpServers.beacon)return{path:Z,added:!1};return $.mcpServers.beacon={command:"beacon",args:["mcp"]},x(Z,JSON.stringify($,null,2)+`
|
|
12
12
|
`),{path:Z,added:!0}}function KZ(Q){let Z=X(Q,".mcp.json"),$=!1;try{$=!!JSON.parse(H(Z,"utf8")).mcpServers?.beacon}catch{}let J=!1;try{J=H(X(Q,"AGENTS.md"),"utf8").includes(I)}catch{}let Y=!1;try{Y=/@AGENTS\.md/.test(H(X(Q,"CLAUDE.md"),"utf8"))}catch{}return{repo:Q,mcpRegistered:$,agentsMdBlock:J,claudeMdImport:Y,skills:{"beacon-init":N(X(Q,".claude","skills","beacon-init","SKILL.md")),"beacon-refresh":N(X(Q,".claude","skills","beacon-refresh","SKILL.md"))},codexSkills:{"beacon-init":N(X(Q,".agents","skills","beacon-init","SKILL.md")),"beacon-refresh":N(X(Q,".agents","skills","beacon-refresh","SKILL.md"))}}}function uZ(Q){let Z=[];for(let z of["beacon-init","beacon-refresh","beacon-db-design"]){let W=X(Q,".claude","skills",z);if(N(W))R(W,{recursive:!0,force:!0}),Z.push(z)}for(let z of["beacon-init","beacon-refresh"]){let W=X(Q,".agents","skills",z);if(N(W))R(W,{recursive:!0,force:!0}),Z.push(`codex:${z}`)}let $=!1,J=X(Q,".mcp.json");try{let z=JSON.parse(H(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)R(J,{force:!0});else x(J,JSON.stringify(z,null,2)+`
|
|
13
|
-
`)}}catch{}let Y=!1,V=X(Q,"AGENTS.md");try{let z=H(V,"utf8"),W=new RegExp(`\\n?${I}[\\s\\S]*?${
|
|
13
|
+
`)}}catch{}let Y=!1,V=X(Q,"AGENTS.md");try{let z=H(V,"utf8"),W=new RegExp(`\\n?${I}[\\s\\S]*?${$Q}\\n?`);if(W.test(z)){let i=z.replace(W,`
|
|
14
14
|
`).replace(/\n{3,}/g,`
|
|
15
15
|
|
|
16
|
-
`).trimStart();x(V,
|
|
17
|
-
`)?
|
|
18
|
-
`),Y=!0}}catch{}let q=!1,U=X(Q,"CLAUDE.md");try{let z=H(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())R(U,{force:!0});else x(U,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var
|
|
16
|
+
`).trimStart();x(V,i.endsWith(`
|
|
17
|
+
`)?i:`${i}
|
|
18
|
+
`),Y=!0}}catch{}let q=!1,U=X(Q,"CLAUDE.md");try{let z=H(U,"utf8"),W=z.replace(/^[ \t]*@AGENTS\.md[ \t]*\n?/m,"");if(W!==z){if(!W.trim())R(U,{force:!0});else x(U,W);q=!0}}catch{}return{skillsRemoved:Z,mcpUnregistered:$,agentsBlockRemoved:Y,claudeImportRemoved:q}}var QQ=`---
|
|
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
|
---
|
|
@@ -29,6 +29,7 @@ The user already has Beacon running. You're going to map this repository's archi
|
|
|
29
29
|
A single \`beacon_init_persist\` MCP tool call with:
|
|
30
30
|
|
|
31
31
|
- **hasFrontend**: \`true\` or \`false\` \u2014 does this repo have a frontend surface (UI code)? You just read the repo, so you know. Set it explicitly; it gates the frontend/backend \`layer\` distinction on the boards (a pure-backend repo never shows it).
|
|
32
|
+
- **classificationRoots** (optional): the top-level directories whose immediate children are the meaningful groups on the Files canvas \u2014 e.g. \`["frontend", "backend/app"]\`. The canvas groups files ONE level below each root (so \`frontend\` \u2192 \`frontend/components\`, \`frontend/app\`, \u2026). Pick the dir sitting directly ABOVE the real package dirs \u2014 use \`frontend/src\` if there's a \`src/\` wrapper. List both sides of a monorepo so neither collapses into one flat blob. Not every dir \u2014 just where grouping should START. Omit it for a simple single-root repo; the canvas falls back to automatic grouping.
|
|
32
33
|
- **components**: 8\u201325 main building blocks of this codebase. NOT every file. Group them by \`domain\` (short UPPERCASE: AUTH, API, DATA, UI, JOBS, INFRA, BILLING, SEARCH, \u2026). For each: a one-line technical \`role\`, a one-sentence plain-language \`plain\`, the few \`files\` that implement it (repo-relative), \`depends\` listing other component titles it relies on \u2014 and, when \`hasFrontend\` is true, \`layer\` (\`"frontend" | "backend" | "fullstack"\`). Use the dependency graph you can see in the source \u2014 files that import each other heavily usually belong together. If you spot a bug or something worth investigating while reading a component's code, add \`bugs: [{ note }]\` to that component \u2014 it renders as a bug flag on the node (attributed to the agent). Only flag what you actually saw in the code; don't speculate.
|
|
33
34
|
- **roadmap**: 3\u20136 BROAD strategic directions. Big-picture themes only \u2014 "Harden auth & security", "Add observability", "Scale the data layer", "Pay down test-coverage debt". NOT detailed tasks. NOT file-level. Each gets a short title and one-line \`why\`. If one of them is a concrete BUG to fix (something broken you saw in the code), add \`kind: "BUG"\` so it renders as a typed bug card. When \`hasFrontend\` is true, give each a \`layer\` too (\`"frontend" | "backend" | "fullstack"\`).
|
|
34
35
|
- **overview**: one paragraph describing what this project is and its stack. This lands in AGENTS.md as the project intro.
|
|
@@ -53,7 +54,7 @@ A single \`beacon_init_persist\` MCP tool call with:
|
|
|
53
54
|
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.
|
|
54
55
|
|
|
55
56
|
After the tool returns, tell the user the counts (components / roadmap / tables / endpoints) and point them at the running Beacon panel.
|
|
56
|
-
`,
|
|
57
|
+
`,ZQ=`---
|
|
57
58
|
name: beacon-refresh
|
|
58
59
|
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.
|
|
59
60
|
---
|
|
@@ -88,7 +89,7 @@ The one caveat: if the user manually edited an INIT-source node on the canvas (e
|
|
|
88
89
|
- **~ changed**: COMPONENT_X (role expanded to cover Y)
|
|
89
90
|
- **schema**: + 2 new tables (TableA, TableB); + 3 new endpoints; \u2212 1 deprecated endpoint
|
|
90
91
|
No need to wait for confirmation \u2014 just show the diff so the user sees what's about to land.
|
|
91
|
-
5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`, \`hasFrontend\` \u2014 re-assert it, the stack may have changed). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
|
|
92
|
+
5. **Call \`beacon_init_persist\`** ONCE with the refreshed full analysis (same shape as init: \`components\`, \`roadmap\`, \`overview\`, \`conventions\`, \`snapshot\`, \`hasFrontend\` \u2014 re-assert it, the stack may have changed; and \`classificationRoots\` if the Files-canvas grouping needs to change, e.g. a new top-level dir like \`mobile/\` \u2014 OMIT it to keep the existing roots, don't pass \`[]\` unless you mean to clear them). It replaces all init-source nodes and regenerates \`AGENTS.md\`. Bug flags already on a component survive the refresh (they're carried over by title); add \`bugs: [{ note }]\` for anything NEW you found worth investigating \u2014 identical open flags are not duplicated.
|
|
92
93
|
|
|
93
94
|
## What you should NOT do
|
|
94
95
|
|
|
@@ -142,7 +143,7 @@ If it returns feedback, revise and call it again.
|
|
|
142
143
|
If \`beacon_present_plan\` isn't available, the panel isn't wired here \u2014 fall back to ExitPlanMode
|
|
143
144
|
with the same \`\`\`beacon block (Claude Code only; Codex has no ExitPlanMode), or tell the user to
|
|
144
145
|
run \`beacon\` in this repo once.
|
|
145
|
-
`,jZ,I="<!-- beacon:workflow:start -->"
|
|
146
|
+
`,jZ,I="<!-- beacon:workflow:start -->",$Q="<!-- beacon:workflow:end -->",TQ;var YQ=v(()=>{jZ=[{name:"beacon-init",body:()=>QQ},{name:"beacon-refresh",body:()=>ZQ}];TQ=`${I}
|
|
146
147
|
## Beacon \u2014 feature workflow
|
|
147
148
|
|
|
148
149
|
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:
|
|
@@ -200,18 +201,18 @@ Register them all in that single batched call. If a plan added five features, th
|
|
|
200
201
|
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.
|
|
201
202
|
|
|
202
203
|
Pull raw planning data anytime with \`beacon_entities\` (features / architecture / tables / endpoints).
|
|
203
|
-
${
|
|
204
|
-
`)}function y(Q,Z){let $=
|
|
204
|
+
${$Q}`});import{existsSync as FQ,mkdirSync as VQ,readFileSync as E,rmSync as vZ,writeFileSync as A}from"fs";import{dirname as RQ,join as O}from"path";function zQ(Q){try{return JSON.parse(E(Q,"utf8"))}catch{return{}}}function bQ(Q,Z){VQ(RQ(Q),{recursive:!0}),A(Q,JSON.stringify(Z,null,2)+`
|
|
205
|
+
`)}function y(Q,Z){let $=zQ(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((q)=>q.command===Z.command)))return!1;return J.push({matcher:Z.matcher,hooks:[{type:"command",command:Z.command}]}),bQ(Q,$),!0}function k(Q,Z){return(zQ(Q).hooks?.[Z.event]??[]).some((Y)=>Y.hooks?.some((V)=>V.command===Z.command))}function L(Q,Z){let $=zQ(Q),J=$.hooks?.[Z.event];if(!J)return!1;let Y=!1,V=J.map((q)=>{let U=q.hooks?.length??0,z=(q.hooks??[]).filter((W)=>W.command!==Z.command);if(z.length!==U)Y=!0;return{...q,hooks:z}}).filter((q)=>(q.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 bQ(Q,$),!0}function _(Q,Z,$,J){let Y=`${Z}
|
|
205
206
|
${J.trim()}
|
|
206
207
|
${$}`,V="";try{V=E(Q,"utf8")}catch{}let q=new RegExp(`${Z}[\\s\\S]*?${$}`);V=q.test(V)?V.replace(q,Y):V.trim()?`${V.trim()}
|
|
207
208
|
|
|
208
209
|
${Y}
|
|
209
210
|
`:`${Y}
|
|
210
|
-
`,
|
|
211
|
+
`,VQ(RQ(Q),{recursive:!0}),A(Q,V.endsWith(`
|
|
211
212
|
`)?V:`${V}
|
|
212
213
|
`)}function C(Q,Z){try{return E(Q,"utf8").includes(Z)}catch{return!1}}function h(Q,Z,$){let J="";try{J=E(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,`
|
|
213
214
|
|
|
214
|
-
`).trimStart();return A(Q,V),!0}function S(Q,Z,$){let J=O(Q,Z);
|
|
215
|
+
`).trimStart();return A(Q,V),!0}function S(Q,Z,$){let J=O(Q,Z);VQ(J,{recursive:!0});let Y=O(J,"SKILL.md");return A(Y,$),Y}function M(Q,Z){return FQ(O(Q,Z,"SKILL.md"))}function m(Q,Z){let $=O(Q,Z);if(!FQ($))return!1;return vZ($,{recursive:!0,force:!0}),!0}var B,D=`## Beacon (visual planning panel)
|
|
215
216
|
|
|
216
217
|
This machine has Beacon installed \u2014 a local visual planning surface for the terminal-side
|
|
217
218
|
agent. Beacon proposes feature plans (roadmap features + DB schema + endpoints) via MCP,
|
|
@@ -232,18 +233,18 @@ the user reviews on a canvas at /plan, and feedback flows back as the next round
|
|
|
232
233
|
Feedback bundles inline annotations on the markdown PLUS any edits the user made directly
|
|
233
234
|
on the /map and /db boards (added features, attached subtasks, edited columns, new
|
|
234
235
|
endpoints). Treat board edits as the user's revision intent \u2014 re-propose matching them
|
|
235
|
-
verbatim. Do NOT implement until the tool returns approval.`;var
|
|
236
|
+
verbatim. Do NOT implement until the tool returns approval.`;var qQ=v(()=>{B=["beacon-init","beacon-refresh","beacon-plan"]});import{mkdirSync as CZ,renameSync as MZ,rmSync as wZ,writeFileSync as gZ}from"fs";import{dirname as TZ}from"path";function p(Q,Z){CZ(TZ(Q),{recursive:!0});let $=`${Q}.tmp`;try{gZ($,Z),MZ($,Q)}catch(J){throw wZ($,{force:!0}),J}}function F0(Q,Z,$=!1){p(Q,JSON.stringify(Z,null,$?2:void 0))}var IQ=()=>{};var _Q={};e(_Q,{setupCodexAssets:()=>bZ,removeCodexMcp:()=>LQ,removeCodexArtifacts:()=>OZ,hasCodexMcp:()=>xQ,ensureCodexMcp:()=>kQ,codexMcpProblem:()=>RZ,codexDetected:()=>AQ,auditCodex:()=>IZ,CODEX_HOOKS:()=>a});import{readFileSync as s}from"fs";import{homedir as fZ}from"os";import{join as T}from"path";function OQ(){return process.env.HOME||process.env.USERPROFILE||fZ()}function AQ(){if(process.env.BEACON_CODEX==="1")return!0;if(process.env.BEACON_CODEX==="0")return!1;if(XQ===void 0)XQ=Bun.which("codex")!==null;return XQ}function g(Q){try{return Bun.TOML.parse(Q)}catch{return null}}function xQ(){try{return Boolean(g(s(K(),"utf8"))?.mcp_servers?.beacon)}catch{return!1}}function RZ(){let Q="";try{Q=s(K(),"utf8")}catch{return null}let Z=g(Q);if(!Z)return`~/.codex/config.toml does not parse \u2014 ${w}`;if(Z.mcp_servers?.beacon)return null;if(/^\s*mcp_servers\s*=/m.test(Q))return`mcp_servers is an inline table \u2014 ${w}`;return null}function kQ(){let Q="",Z=!1;try{Q=s(K(),"utf8"),Z=!0}catch{}if(Z){let V=g(Q);if(!V)return{added:!1,error:`~/.codex/config.toml does not parse \u2014 ${w}`};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 ${w}`}}let $=!Q?"":Q.endsWith(`
|
|
236
237
|
`)?`
|
|
237
238
|
`:`
|
|
238
239
|
|
|
239
|
-
`,J=Q+$+FZ;if(g(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${w}`};return
|
|
240
|
+
`,J=Q+$+FZ;if(g(J)?.mcp_servers?.beacon?.command!=="beacon")return{added:!1,error:`could not safely append [mcp_servers.beacon] \u2014 ${w}`};return p(K(),J),{added:!0}}function LQ(){let Q="";try{Q=s(K(),"utf8")}catch{return{removed:!1}}let Z=Q.split(`
|
|
240
241
|
`),$=Z.indexOf(DQ);if($===-1)return{removed:!1,skipped:xQ()};let J=Z.indexOf(yQ,$);if(J===-1)return{removed:!1,skipped:!0};Z.splice($,J-$+1);let Y=Z.join(`
|
|
241
242
|
`).replace(/\n{3,}/g,`
|
|
242
243
|
|
|
243
|
-
`).replace(/^\n+/,"");if(g(Y)===null)return{removed:!1,skipped:!0};return
|
|
244
|
+
`).replace(/^\n+/,"");if(g(Y)===null)return{removed:!1,skipped:!0};return p(K(),Y),{removed:!0}}async function bZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (YQ(),JQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let z of B){if(!M(n(),z))Y.push(z);S(n(),z,J[z])}let V=0;for(let z of a)if(y(WQ(),{event:z.event,matcher:z.matcher,command:z.command}))V++;let q=C(c(),l);_(c(),l,EQ,D);let U=kQ();return{skillsAdded:Y,hooksAdded:V,agentsMdBlockTouched:!q,mcp:U}}function IZ(){let Q={};for(let $ of B)Q[$]=M(n(),$);let Z={};for(let $ of a)Z[$.event]=k(WQ(),{event:$.event,command:$.command});return{detected:AQ(),skills:Q,hooks:Z,agentsMdBlock:C(c(),l),mcp:xQ()}}function OZ(){let Q=[];for(let Y of B)if(m(n(),Y))Q.push(Y);let Z=0;for(let Y of a)if(L(WQ(),{event:Y.event,command:Y.command}))Z++;let $=h(c(),l,EQ),J=LQ();return{skillsRemoved:Q,hooksRemoved:Z,agentsMdBlockRemoved:$,mcpRemoved:J.removed,mcpSkipped:J.skipped}}var UQ=()=>T(OQ(),".codex"),WQ=()=>T(UQ(),"hooks.json"),K=()=>T(UQ(),"config.toml"),c=()=>T(UQ(),"AGENTS.md"),n=()=>T(OQ(),".agents","skills"),l="<!-- beacon:global:start -->",EQ="<!-- beacon:global:end -->",a,XQ,DQ="# beacon:start (managed by Beacon \u2014 `beacon uninstall` removes this block)",yQ="# beacon:end",FZ,w="add it manually: codex mcp add beacon -- beacon mcp";var hQ=v(()=>{qQ();IQ();a=[{event:"PostToolUse",matcher:"apply_patch",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose, nudge it to present the plan on Beacon's /plan canvas."}];FZ=`${DQ}
|
|
244
245
|
[mcp_servers.beacon]
|
|
245
246
|
command = "beacon"
|
|
246
247
|
args = ["mcp"]
|
|
247
248
|
${yQ}
|
|
248
|
-
`});var lQ={};
|
|
249
|
+
`});var lQ={};e(lQ,{provisionDb:()=>Z0});import{createClient as nZ}from"@libsql/client";import{drizzle as lZ}from"drizzle-orm/libsql";import{migrate as sZ}from"drizzle-orm/libsql/migrator";import{readMigrationFiles as aZ}from"drizzle-orm/migrator";import{dirname as NQ,join as dZ}from"path";import{fileURLToPath as tZ}from"url";async function r(Q,Z){return(await Q.execute({sql:"SELECT 1 FROM sqlite_master WHERE type='table' AND name = ?",args:[Z]})).rows.length>0}async function eZ(Q,Z){let $=await Q.execute(`PRAGMA table_info("${Z}")`);return new Set($.rows.map((J)=>String(J.name)))}async function nQ(Q){if(!await r(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 Q0(Q){for(let[Z,$]of Object.entries(iZ)){if(!await r(Q,Z))continue;let J=await eZ(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 Z0(Q,Z=oZ){let $=nZ({url:Q});try{await $.execute("PRAGMA journal_mode = WAL;"),await $.execute("PRAGMA foreign_keys = ON;"),await $.execute("PRAGMA busy_timeout = 5000;");let J=await r($,"__drizzle_migrations"),Y=await r($,"Node"),V=!1;if(Y&&!J){let U=aZ({migrationsFolder:Z})[0];if(U)await $.execute('CREATE TABLE IF NOT EXISTS "__drizzle_migrations" (id SERIAL PRIMARY KEY, hash text NOT NULL, created_at numeric)'),await $.execute({sql:'INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES (?, ?)',args:[U.hash,U.folderMillis]}),V=!0}let q=await nQ($);if(await sZ(lZ($),{migrationsFolder:Z}),await nQ($)>q)V=!0;return await Q0($),{migrated:V}}finally{$.close()}}var rZ,oZ,iZ;var sQ=v(async()=>{rZ=NQ(NQ(NQ(tZ(import.meta.url)))),oZ=process.env.BEACON_MIGRATIONS_DIR||dZ(rZ,"drizzle"),iZ={Node:["createdAt","updatedAt"],Note:["createdAt","updatedAt"],DbTable:["createdAt","updatedAt"],Endpoint:["createdAt","updatedAt"],DraftTable:["createdAt"],SyncState:["codeGraphSyncedAt","updatedAt"],AppSetting:["updatedAt"],ProjectMeta:["updatedAt"],CodeFile:["updatedAt"]}});qQ();import{existsSync as EZ}from"fs";import{homedir as AZ}from"os";import{join as d}from"path";function DZ(){return process.env.HOME||process.env.USERPROFILE||AZ()}var t=()=>d(DZ(),".claude"),HQ=()=>d(t(),"skills"),BQ=()=>d(t(),"settings.json"),jQ=()=>d(t(),"CLAUDE.md"),PQ="<!-- beacon:global:start -->",SQ="<!-- beacon:global:end -->";var yZ=D,GQ=[{event:"PostToolUse",matcher:"Edit|Write|MultiEdit",command:"beacon hook",description:"Report file edits to Beacon's active feature so the map stays fresh."},{event:"PermissionRequest",matcher:"ExitPlanMode",command:"beacon plan",description:"Pipe the agent's plan markdown into Beacon's /plan canvas for review."},{event:"UserPromptSubmit",matcher:"*",command:"beacon prompt",description:"On feature-y prompts in a Beacon-wired repo, remind the agent to run the context\u2192propose\u2192describe loop (no-op otherwise)."},{event:"Stop",matcher:"*",command:"beacon stop-hook",description:"When the agent ends a turn asking for plan approval in prose (instead of presenting it), nudge it to present the plan on Beacon's /plan canvas. Bounded by stop_hook_active \u2014 at most one nudge."}];function kZ(Q,Z){return S(HQ(),Q,Z)}function mQ(Q){return M(HQ(),Q)}function LZ(Q){return m(HQ(),Q)}function _Z(Q){return y(BQ(),Q)}function hZ(Q){return k(BQ(),Q)}function SZ(Q){return L(BQ(),Q)}function mZ(Q){_(jQ(),PQ,SQ,Q)}function pQ(){return C(jQ(),PQ)}function pZ(){return h(jQ(),PQ,SQ)}function _0(){let Q={};for(let $ of B)Q[$]=mQ($);let Z={};for(let $ of GQ)Z[$.event]=hZ({event:$.event,command:$.command});return{homeExists:EZ(t()),skills:Q,hooks:Z,claudeMdBlock:pQ()}}async function cZ(){let{INIT_SKILL:Q,REFRESH_SKILL:Z,PLAN_SKILL:$}=await Promise.resolve().then(() => (YQ(),JQ)),J={"beacon-init":Q,"beacon-refresh":Z,"beacon-plan":$},Y=[];for(let U of B){if(!mQ(U))Y.push(U);kZ(U,J[U])}let V=0;for(let U of GQ)if(_Z({event:U.event,matcher:U.matcher,command:U.command}))V++;let q=pQ();return mZ(yZ),{skillsAdded:Y,hooksAdded:V,claudeMdBlockTouched:!q}}async function cQ(){let Q;try{Q={ok:!0,...await cZ()}}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(() => (hQ(),_Q));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 h0(){let Q=[];for(let J of B)if(LZ(J))Q.push(J);let Z=0;for(let J of GQ)if(SZ(J))Z++;let $=pZ();return{skillsRemoved:Q,hooksRemoved:Z,claudeMdBlockRemoved:$}}import{AsyncLocalStorage as $0}from"async_hooks";import{spawnSync as J0}from"child_process";import{createHash as Y0}from"crypto";import{existsSync as dQ,mkdirSync as f,readFileSync as uQ,writeFileSync as vQ}from"fs";import{homedir as tQ}from"os";import{basename as V0,join as j,parse as z0,resolve as aQ}from"path";function G(){return process.env.BEACON_HOME||j(tQ(),".beacon")}function CQ(){return j(G(),"workspaces.json")}function u(Q){return Y0("sha256").update(Q).digest("hex").slice(0,12)}function rQ(Q=process.cwd()){let Z=J0("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 oQ(Q){let Z=aQ(Q);return Z!==aQ(tQ())&&Z!==z0(Z).root}function iQ(){return j(G(),"deleted.json")}function MQ(){try{let Q=JSON.parse(uQ(iQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function eQ(Q){f(G(),{recursive:!0}),vQ(iQ(),JSON.stringify(Q,null,2))}function QZ(Q){return MQ().includes(Q)}function e0(Q){let Z=MQ();if(!Z.includes(Q))eQ([...Z,Q])}function q0(Q){let Z=MQ();if(Z.includes(Q))eQ(Z.filter(($)=>$!==Q))}function o(Q){return j(G(),Q)}function X0(Q){return`file:${j(o(Q),"db.sqlite")}`}function F(){try{let Q=JSON.parse(uQ(CQ(),"utf8"));return Array.isArray(Q)?Q:[]}catch{return[]}}function wQ(Q){f(G(),{recursive:!0}),vQ(CQ(),JSON.stringify(Q,null,2))}function U0(){return F().sort((Q,Z)=>Z.lastOpenedAt.localeCompare(Q.lastOpenedAt))}function P(Q){return F().find((Z)=>Z.id===Q)??null}function ZZ(Q,Z,$=new Date().toISOString()){if(!oQ(Q))throw Error(`beacon: refusing to register a non-repo path as a workspace: ${Q}`);let J=u(Q);if(QZ(J))throw Error(`beacon: workspace ${J} (${Q}) was deleted \u2014 run \`beacon\` or /beacon-init to re-add it`);let Y=F(),V=Y.find((z)=>z.id===J),q={id:J,path:Q,name:Z||V?.name||V0(Q),lastOpenedAt:$},U=[q,...Y.filter((z)=>z.id!==J)];return f(o(J),{recursive:!0}),wQ(U),q}function Q1(Q,Z){return q0(u(Q)),ZZ(Q,Z)}function Z1(Q,Z=new Date().toISOString()){let $=F(),J=$.find((Y)=>Y.id===Q);if(!J)return;J.lastOpenedAt=Z,wQ($)}function $1(Q){if(wQ(F().filter((Z)=>Z.id!==Q)),gQ()===Q)W0(U0()[0]?.id??null)}function $Z(){return j(G(),"active")}function gQ(){try{return uQ($Z(),"utf8").trim()||null}catch{return null}}function W0(Q){f(G(),{recursive:!0}),vQ($Z(),Q??"")}function J1(){let Q=gQ();return Q?P(Q):null}function Y1(){let Q=H0()??gQ();return Q?P(Q):null}function V1(Q){return P(Q)?.path??null}function z1(){return dQ(CQ())}var JZ="beacon_ws";function YZ(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 q1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=YZ(Q,JZ);if($&&P($))return $;return null}var x0="x-beacon-workspace-path";async function X1(Q){let Z=Q.headers.get("x-beacon-workspace");if(Z&&P(Z))return Z;let $=Q.headers.get(x0);if($&&oQ($)&&!QZ(u($))&&(!Z||u($)===Z)){let Y=ZZ($);return await B0(Y.id),Y.id}let J=YZ(Q,JZ);if(J&&P(J))return J;return null}var VZ=new $0;function U1(Q,Z){return Q?VZ.run(Q,Z):Z()}function H0(){return VZ.getStore()??null}var KQ=new Set;function W1(Q){KQ.delete(j(o(Q),"db.sqlite"))}async function B0(Q){let Z=o(Q),$=j(Z,"db.sqlite"),J=dQ($);if(J&&KQ.has($))return{ok:!0,created:!1,migrated:!1};try{f(Z,{recursive:!0});let{provisionDb:Y}=await sQ().then(() => lQ),V=await Y(X0(Q));return KQ.add($),{ok:!0,created:!J,migrated:J&&V.migrated}}catch(Y){return{ok:!1,created:!1,migrated:!1,error:Y instanceof Error?Y.message:String(Y)}}}import{resolve as j0}from"path";var P0="*** Begin Patch",G0=/^\*\*\* (Update File|Add File|Move to): (.+)$/;function N0(Q){let Z=[];for(let $ of Q.split(`
|
|
249
250
|
`)){let J=G0.exec($.trim());if(!J)continue;let Y=J[2].trim();if(J[1]==="Move to")Z.pop();Z.push(Y)}return Z}function zZ(Q){let Z=Q.tool_input;if(Z===null||typeof Z!=="object")return[];let $=Z,J=[];if(typeof $.file_path==="string")J.push($.file_path);if(typeof $.path==="string")J.push($.path);if(Array.isArray($.files))for(let V of $.files){let q=V?.file_path;if(typeof q==="string")J.push(q)}if(J.length)return J;let Y=typeof Q.cwd==="string"?Q.cwd:process.cwd();for(let V of Object.values($)){if(typeof V!=="string"||!V.includes(P0))continue;return N0(V).map((q)=>j0(Y,q))}return[]}var K0=process.env.BEACON_URL||`http://localhost:${process.env.PORT||4319}`;await cQ();var qZ="";for await(let Q of process.stdin)qZ+=Q;try{let Q=JSON.parse(qZ||"{}"),Z=zZ(Q);if(Z.length){let $=u(rQ(typeof Q.cwd==="string"?Q.cwd:void 0));await fetch(`${K0}/api/map/touch-active`,{method:"POST",headers:{"content-type":"application/json","x-beacon-workspace":$},body:JSON.stringify({files:Z})}).catch(()=>{})}}catch{}process.exit(0);
|